diff --git a/package.json b/package.json index 41afc66f32a2..9bbabf1a7478 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "packages:publish": "scripts/publish.js", "release": "scripts/release.js", "split": "scripts/split.js", - "start": "node -r esm scripts/start/index.js", + "start": "node -r esm scripts/start-application.js", "test": "yarn lint", "test:e2e:chromium": "rimraf ./reports && testcafe chromium", "test:e2e:chromium:headless": "rimraf ./reports && testcafe chromium:headless", diff --git a/packages/components/ng-ovh-payment-method/package.json b/packages/components/ng-ovh-payment-method/package.json index caad1341e4a3..94260ab77f82 100644 --- a/packages/components/ng-ovh-payment-method/package.json +++ b/packages/components/ng-ovh-payment-method/package.json @@ -44,7 +44,7 @@ "@ovh-ux/component-rollup-config": "^7.0.0" }, "peerDependencies": { - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/ng-translate-async-loader": "^2.1.0", "@ovh-ux/ui-kit": "^4.1.12", "angular": "^1.5.0", @@ -52,4 +52,4 @@ "bootstrap4": "twbs/bootstrap#v4.0.0", "ovh-api-services": "^9.39.1" } -} \ No newline at end of file +} diff --git a/packages/manager/apps/carrier-sip/package.json b/packages/manager/apps/carrier-sip/package.json index aa147035fcab..2057cfa2821f 100644 --- a/packages/manager/apps/carrier-sip/package.json +++ b/packages/manager/apps/carrier-sip/package.json @@ -22,7 +22,7 @@ "dependencies": { "@ovh-ux/manager-carrier-sip": "^1.0.0 || ^2.0.0", "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-telecom-styles": "^4.0.0", "@ovh-ux/ng-ovh-api-wrappers": "^4.0.7", "@ovh-ux/ng-ovh-checkbox-table": "^2.0.0", @@ -58,7 +58,7 @@ "moment": "^2.24.0", "ng-csv": "^0.3.6", "oclazyload": "^1.1.0", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-ngstrap": "^4.0.2", "ovh-ui-kit-bs": "^4.1.8", "popper.js": "^1.16.1", diff --git a/packages/manager/apps/carrier-sip/src/config.js b/packages/manager/apps/carrier-sip/src/config.js index c49caad6e0ae..5933394f6b55 100644 --- a/packages/manager/apps/carrier-sip/src/config.js +++ b/packages/manager/apps/carrier-sip/src/config.js @@ -1,7 +1,7 @@ -export const momentConfiguration = /* @ngInject */ ( - TranslateServiceProvider, -) => { - const defaultLanguage = TranslateServiceProvider.getUserLocale(true); +import { Environment } from '@ovh-ux/manager-config'; + +export const momentConfiguration = /* @ngInject */ () => { + const defaultLanguage = Environment.getUserLanguage(); moment.locale(defaultLanguage); }; diff --git a/packages/manager/apps/cloud/client/app/cloud/project/storage/storage-add/storage/step_container_type/add-storage-step-container-type-controller.js b/packages/manager/apps/cloud/client/app/cloud/project/storage/storage-add/storage/step_container_type/add-storage-step-container-type-controller.js index 7714aa1d4d2f..335db22c8872 100644 --- a/packages/manager/apps/cloud/client/app/cloud/project/storage/storage-add/storage/step_container_type/add-storage-step-container-type-controller.js +++ b/packages/manager/apps/cloud/client/app/cloud/project/storage/storage-add/storage/step_container_type/add-storage-step-container-type-controller.js @@ -7,13 +7,11 @@ angular '$scope', '$translate', 'URLS', - 'TranslateService', 'OvhApiMe', function RAAddStorageStepContainerTypeCtrl( $scope, $translate, URLS, - TranslateService, OvhApiMe, ) { const self = this; diff --git a/packages/manager/apps/cloud/client/app/deskaas/deskaas-upgrade/deskaas-upgrade.html b/packages/manager/apps/cloud/client/app/deskaas/deskaas-upgrade/deskaas-upgrade.html index 722e574870b2..e08b88d62a39 100644 --- a/packages/manager/apps/cloud/client/app/deskaas/deskaas-upgrade/deskaas-upgrade.html +++ b/packages/manager/apps/cloud/client/app/deskaas/deskaas-upgrade/deskaas-upgrade.html @@ -1,9 +1,9 @@
- - +
{ - ovhDocUrlProvider.setUserLocale(TranslateServiceProvider.getUserLocale()); +import { Environment } from '@ovh-ux/manager-config'; + +angular.module('managerApp').config( + /* @ngInject */ (ovhDocUrlProvider) => { + ovhDocUrlProvider.setUserLocale(Environment.getUserLocale()); ovhDocUrlProvider.setUrlPrefix('/engine/2api'); - }); + }, +); diff --git a/packages/manager/apps/cloud/client/components/ovh-task-alert/ovh-task-alert.service.js b/packages/manager/apps/cloud/client/components/ovh-task-alert/ovh-task-alert.service.js index 3c1701aaf5fb..6e199337fdfd 100644 --- a/packages/manager/apps/cloud/client/components/ovh-task-alert/ovh-task-alert.service.js +++ b/packages/manager/apps/cloud/client/components/ovh-task-alert/ovh-task-alert.service.js @@ -1,3 +1,5 @@ +import { Environment } from '@ovh-ux/manager-config'; + import forEach from 'lodash/forEach'; import get from 'lodash/get'; import map from 'lodash/map'; @@ -10,14 +12,12 @@ class OvhTaskAlertsService { CucCloudMessage, OvhApiMeAlertsAapi, $http, - TranslateService, ) { this.$translate = $translate; this.$http = $http; this.CucControllerHelper = CucControllerHelper; this.CucCloudMessage = CucCloudMessage; this.UserAlertsAapi = OvhApiMeAlertsAapi; - this.TranslateService = TranslateService; } getTaskInfo() { @@ -61,7 +61,7 @@ class OvhTaskAlertsService { } sendAlert(alert, tasks) { - const language = this.TranslateService.getGeneralLanguage(); + const language = Environment.getUserLanguage() === 'fr' ? 'fr' : 'en'; const locale = language === 'en' ? 'en_GB' : 'fr_FR'; const text = alert[locale]; const message = { diff --git a/packages/manager/apps/cloud/package.json b/packages/manager/apps/cloud/package.json index 6727f3fd15d7..9572f8883159 100644 --- a/packages/manager/apps/cloud/package.json +++ b/packages/manager/apps/cloud/package.json @@ -22,7 +22,7 @@ "@ovh-ux/manager-account-sidebar": "^2.0.0 || ^3.0.0", "@ovh-ux/manager-banner": "^1.1.3", "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-error-page": "^1.0.0 || ^2.0.0", "@ovh-ux/manager-navbar": "^4.0.0 || ^5.0.0", "@ovh-ux/manager-notifications-sidebar": "^0.0.0 || ^1.0.0", @@ -113,7 +113,7 @@ "ng-slide-down": "TheRusskiy/ng-slide-down#^1.0.0", "office-ui-fabric-core": "^11.0.0", "ovh-angular-list-view": "ovh-ux/ovh-angular-list-view#^0.1.5", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-common-style": "ovh-ux/ovh-common-style#^3.2.2", "ovh-manager-webfont": "^1.2.0", "ovh-ui-kit-bs": "^4.1.8", diff --git a/packages/manager/apps/dedicated/client/app/account/contacts/update/user-contacts-update.controller.js b/packages/manager/apps/dedicated/client/app/account/contacts/update/user-contacts-update.controller.js index 6e2e5902feb5..19b11eed0dbb 100644 --- a/packages/manager/apps/dedicated/client/app/account/contacts/update/user-contacts-update.controller.js +++ b/packages/manager/apps/dedicated/client/app/account/contacts/update/user-contacts-update.controller.js @@ -4,6 +4,8 @@ import find from 'lodash/find'; import findIndex from 'lodash/findIndex'; import isPlainObject from 'lodash/isPlainObject'; +import { LANGUAGES } from '@ovh-ux/manager-config'; + angular.module('UserAccount').controller('UserAccount.controllers.update', [ 'UserAccount.services.Contacts', '$scope', @@ -13,7 +15,6 @@ angular.module('UserAccount').controller('UserAccount.controllers.update', [ '$timeout', '$translate', 'Alerter', - 'CORE_LANGUAGES', function UserAccountUpdateController( Contacts, $scope, @@ -23,9 +24,8 @@ angular.module('UserAccount').controller('UserAccount.controllers.update', [ $timeout, $translate, Alerter, - CORE_LANGUAGES, ) { - $scope.languages = CORE_LANGUAGES.available; + $scope.languages = LANGUAGES.available; $scope.forms = {}; $scope.today = new Date(); $scope.alerts = { diff --git a/packages/manager/apps/dedicated/client/app/account/user/components/newAccountForm/field/new-account-form-field-component.js b/packages/manager/apps/dedicated/client/app/account/user/components/newAccountForm/field/new-account-form-field-component.js index f541ec2dcced..53904b75fd91 100644 --- a/packages/manager/apps/dedicated/client/app/account/user/components/newAccountForm/field/new-account-form-field-component.js +++ b/packages/manager/apps/dedicated/client/app/account/user/components/newAccountForm/field/new-account-form-field-component.js @@ -6,6 +6,8 @@ import isObject from 'lodash/isObject'; import map from 'lodash/map'; import startsWith from 'lodash/startsWith'; +import { LANGUAGES } from '@ovh-ux/manager-config'; + angular.module('ovhSignupApp').component('newAccountFormField', { require: { newAccountForm: '^newAccountForm', @@ -21,7 +23,6 @@ angular.module('ovhSignupApp').component('newAccountFormField', { '$timeout', '$translate', 'atInternet', - 'CORE_LANGUAGES', 'NewAccountFormConfig', function newAccountFormFieldController( @@ -30,7 +31,6 @@ angular.module('ovhSignupApp').component('newAccountFormField', { $timeout, $translate, atInternet, - CORE_LANGUAGES, NewAccountFormConfig, ) { $scope.getTemplateUrl = () => @@ -223,10 +223,7 @@ angular.module('ovhSignupApp').component('newAccountFormField', { } else if (this.rule.fieldName === 'timezone') { translated = value; } else if (this.rule.fieldName === 'managerLanguage') { - translated = get( - find(CORE_LANGUAGES.available, { key: value }), - 'name', - ); + translated = get(find(LANGUAGES.available, { key: value }), 'name'); } else { translated = $translate.instant( `signup_enum_${this.rule.fieldName}_${value}`, diff --git a/packages/manager/apps/dedicated/client/app/account/user/components/newAccountForm/new-account-form-component.js b/packages/manager/apps/dedicated/client/app/account/user/components/newAccountForm/new-account-form-component.js index 5f440e92fca1..39ba1bb014dd 100644 --- a/packages/manager/apps/dedicated/client/app/account/user/components/newAccountForm/new-account-form-component.js +++ b/packages/manager/apps/dedicated/client/app/account/user/components/newAccountForm/new-account-form-component.js @@ -13,6 +13,8 @@ import omit from 'lodash/omit'; import pick from 'lodash/pick'; import values from 'lodash/values'; +import { Environment, LANGUAGES } from '@ovh-ux/manager-config'; + angular.module('ovhSignupApp').component('newAccountForm', { bindings: { model: '<', @@ -27,10 +29,8 @@ angular.module('ovhSignupApp').component('newAccountForm', { '$http', '$timeout', 'coreConfig', - 'CORE_LANGUAGES', 'NewAccountFormConfig', 'Alerter', - 'TranslateService', 'UserAccount.constants', 'userAccountServiceInfos', '$translate', @@ -40,10 +40,8 @@ angular.module('ovhSignupApp').component('newAccountForm', { $http, $timeout, coreConfig, - CORE_LANGUAGES, NewAccountFormConfig, Alerter, - TranslateService, UserAccountConstants, UserAccountServiceInfos, $translate, @@ -55,7 +53,7 @@ angular.module('ovhSignupApp').component('newAccountForm', { this.readonly = this.readonly || []; this.rules = null; this.isSubmitting = false; - this.originalManagerLanguage = TranslateService.getUserLocale(); + this.originalManagerLanguage = Environment.getUserLocale(); const CONSENT_MARKETING_EMAIL_NAME = 'consent-marketing-email'; $scope.getTemplateUrl = () => @@ -188,8 +186,8 @@ angular.module('ovhSignupApp').component('newAccountForm', { rules.splice(languageRuleIdx + 1, 0, { fieldName: 'managerLanguage', mandatory: true, - initialValue: TranslateService.getUserLocale(), - in: map(CORE_LANGUAGES.available, 'key'), + initialValue: Environment.getUserLocale(), + in: map(LANGUAGES.available, 'key'), hasBottomMargin: true, }); } @@ -283,7 +281,7 @@ angular.module('ovhSignupApp').component('newAccountForm', { this.model.managerLanguage && this.originalManagerLanguage !== this.model.managerLanguage ) { - TranslateService.setUserLocale(this.model.managerLanguage); + Environment.setUserLocale(this.model.managerLanguage); window.location.reload(); } else if (this.onSubmit) { this.onSubmit(); diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/security/kms/add/dedicatedCloud-security-kms-add.controller.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/security/kms/add/dedicatedCloud-security-kms-add.controller.js index 03f896c9c761..6f9dbbbc34a9 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/security/kms/add/dedicatedCloud-security-kms-add.controller.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/security/kms/add/dedicatedCloud-security-kms-add.controller.js @@ -1,6 +1,8 @@ import get from 'lodash/get'; import isEqual from 'lodash/isEqual'; +import { Environment } from '@ovh-ux/manager-config'; + import config from '../../../../config/config'; angular.module('App').controller( @@ -44,7 +46,7 @@ angular.module('App').controller( }; this.pollRequestPending = false; - const usedLanguage = get(localStorage, 'univers-selected-language', ''); + const usedLanguage = Environment.getUserLocale(); if (usedLanguage) { const frenchLanguages = ['fr_FR', 'fr_CA']; this.vmEncryptionGuide = frenchLanguages.includes(usedLanguage) diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_de_DE.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_de_DE.json index 1c9d707a7020..bff5cf627edf 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_de_DE.json +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_de_DE.json @@ -325,15 +325,15 @@ "dedicatedCloud_USER_right_vmNetwork_READONLY": "Nur lesender Zugriff", "dedicatedCloud_USER_right_vmNetwork_readonly": "Nur lesender Zugriff", "dedicatedCloud_USER_right_vlan": "Zugang zu den V(x)LANs", - "dedicatedCloud_USER_right_vlan_help": "Verwaltungsrechte für den privaten Teil des Netzwerks (VxLAN für Dedicated Cloud und VLAN für SDDC)", + "dedicatedCloud_USER_right_vlan_help": "Verwaltungsrechte für den privaten Teil des Netzwerks (VxLAN für Dedicated Cloud und VLAN für SDDC und die Pakete Hosted Private Cloud Premier)", "dedicatedCloud_USER_right_vlan_ADMIN": "Ermöglicht die Einrichtung von VMs im privaten Netzwerk", "dedicatedCloud_USER_right_vlan_admin": "Ermöglicht die Einrichtung von VMs im privaten Netzwerk", "dedicatedCloud_USER_right_vlan_NO_ACCESS": "Kein Zugriff", "dedicatedCloud_USER_right_vlan_noAccess": "Kein Zugriff", "dedicatedCloud_USER_right_vlan_READONLY": "Nur lesender Zugriff", "dedicatedCloud_USER_right_vlan_readonly": "Nur lesender Zugriff", - "dedicatedCloud_USER_right_vlan_MANAGER": "Ermöglicht die Verwaltung der Portgruppen des virtuellen Switch (Erstellung, Bearbeitung, Löschen). Nur für SDDC.", - "dedicatedCloud_USER_right_vlan_manager": "Ermöglicht die Verwaltung der Portgruppen des virtuellen Switch (Erstellung, Bearbeitung, Löschen). Nur für SDDC.", + "dedicatedCloud_USER_right_vlan_MANAGER": "Ermöglicht die Verwaltung der Portgruppen des virtuellen Switch (Erstellung, Bearbeitung, Löschen). Nur für SDDC und die Pakete Hosted Private Cloud Premier.", + "dedicatedCloud_USER_right_vlan_manager": "Ermöglicht die Verwaltung der Portgruppen des virtuellen Switch (Erstellung, Bearbeitung, Löschen). Nur für SDDC und die Pakete Hosted Private Cloud Premier.", "dedicatedCloud_USER_right_resources": "Hinzufügen von Ressourcen", "dedicatedCloud_USER_right_resources_help": "Recht, über das OVHcloud Plugin im vSphere Client zusätzliche Ressourcen hinzuzufügen", "dedicatedCloud_USER_add_user": "Benutzer erstellen", diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_en_GB.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_en_GB.json index 81840de1a29c..1336f158a0f5 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_en_GB.json +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_en_GB.json @@ -325,15 +325,15 @@ "dedicatedCloud_USER_right_vmNetwork_READONLY": "Read-only access", "dedicatedCloud_USER_right_vmNetwork_readonly": "Read-only access", "dedicatedCloud_USER_right_vlan": "Access to the V(X)LANs", - "dedicatedCloud_USER_right_vlan_help": "Management rights over the private network section (VXLAN for Dedicated Cloud and VLAN for SDDC)", + "dedicatedCloud_USER_right_vlan_help": "Management rights over the private network section (VXLAN for Dedicated Cloud and VLAN for SDDC and Hosted Private Cloud Premier packs)", "dedicatedCloud_USER_right_vlan_ADMIN": "Allows VMs to be configured on a private network", "dedicatedCloud_USER_right_vlan_admin": "Allows VMs to be configured on a private network", "dedicatedCloud_USER_right_vlan_NO_ACCESS": "No access", "dedicatedCloud_USER_right_vlan_noAccess": "No access", "dedicatedCloud_USER_right_vlan_READONLY": "Read-only access", "dedicatedCloud_USER_right_vlan_readonly": "Read-only access", - "dedicatedCloud_USER_right_vlan_MANAGER": "Allows port groups to be managed on the virtual switch (creation, modification, deletion). For SDDCs only.", - "dedicatedCloud_USER_right_vlan_manager": "Allows port groups to be managed on the virtual switch (creation, modification, deletion). For SDDCs only.", + "dedicatedCloud_USER_right_vlan_MANAGER": "Allows port groups to be managed on the virtual switch (creation, modification, deletion). For SDDC and Hosted Private Cloud Premier packs only.", + "dedicatedCloud_USER_right_vlan_manager": "Allows port groups to be managed on the virtual switch (creation, modification, deletion). For SDDC and Hosted Private Cloud Premier packs only.", "dedicatedCloud_USER_right_resources": "Add resources", "dedicatedCloud_USER_right_resources_help": "Right to add additional resources through the OVHcloud plugin in the vSphere client.", "dedicatedCloud_USER_add_user": "Create User", diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_es_ES.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_es_ES.json index d76d1983e404..18155dff3939 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_es_ES.json +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_es_ES.json @@ -325,15 +325,15 @@ "dedicatedCloud_USER_right_vmNetwork_READONLY": "Acceso de solo lectura", "dedicatedCloud_USER_right_vmNetwork_readonly": "Acceso de solo lectura", "dedicatedCloud_USER_right_vlan": "Acceso a las V(X)LAN", - "dedicatedCloud_USER_right_vlan_help": "Permisos de gestión de la parte de red privada (VxLan en Dedicated Cloud y VLAN en SDDC)", + "dedicatedCloud_USER_right_vlan_help": "Permisos de gestión de la parte de red privada (VxLan en Dedicated Cloud y VLAN en SDDC y los packs Hosted Private Cloud Premier)", "dedicatedCloud_USER_right_vlan_ADMIN": "Permite configurar máquinas virtuales en la red privada", "dedicatedCloud_USER_right_vlan_admin": "Permite configurar máquinas virtuales en la red privada", "dedicatedCloud_USER_right_vlan_NO_ACCESS": "No hay accesos", "dedicatedCloud_USER_right_vlan_noAccess": "No hay accesos", "dedicatedCloud_USER_right_vlan_READONLY": "Acceso de solo lectura", "dedicatedCloud_USER_right_vlan_readonly": "Acceso de solo lectura", - "dedicatedCloud_USER_right_vlan_MANAGER": "Permite gestionar los «port groups« del switch virtual (creación, modificación y eliminación). Solo en SDDC.", - "dedicatedCloud_USER_right_vlan_manager": "Permite gestionar los «port groups« del switch virtual (creación, modificación y eliminación). Solo en SDDC.", + "dedicatedCloud_USER_right_vlan_MANAGER": "Permite gestionar los «port groups« del switch virtual (creación, modificación y eliminación). Solo para SDDC y los packs Hosted Private Cloud Premier.", + "dedicatedCloud_USER_right_vlan_manager": "Permite gestionar los «port groups« del switch virtual (creación, modificación y eliminación). Solo para SDDC y los packs Hosted Private Cloud Premier.", "dedicatedCloud_USER_right_resources": "Añadir recursos", "dedicatedCloud_USER_right_resources_help": "Permiso para añadir recursos adicionales a través del plugin de OVHcloud en vSphere Client", "dedicatedCloud_USER_add_user": "Crear un usuario", diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_fi_FI.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_fi_FI.json index 81840de1a29c..1336f158a0f5 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_fi_FI.json +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_fi_FI.json @@ -325,15 +325,15 @@ "dedicatedCloud_USER_right_vmNetwork_READONLY": "Read-only access", "dedicatedCloud_USER_right_vmNetwork_readonly": "Read-only access", "dedicatedCloud_USER_right_vlan": "Access to the V(X)LANs", - "dedicatedCloud_USER_right_vlan_help": "Management rights over the private network section (VXLAN for Dedicated Cloud and VLAN for SDDC)", + "dedicatedCloud_USER_right_vlan_help": "Management rights over the private network section (VXLAN for Dedicated Cloud and VLAN for SDDC and Hosted Private Cloud Premier packs)", "dedicatedCloud_USER_right_vlan_ADMIN": "Allows VMs to be configured on a private network", "dedicatedCloud_USER_right_vlan_admin": "Allows VMs to be configured on a private network", "dedicatedCloud_USER_right_vlan_NO_ACCESS": "No access", "dedicatedCloud_USER_right_vlan_noAccess": "No access", "dedicatedCloud_USER_right_vlan_READONLY": "Read-only access", "dedicatedCloud_USER_right_vlan_readonly": "Read-only access", - "dedicatedCloud_USER_right_vlan_MANAGER": "Allows port groups to be managed on the virtual switch (creation, modification, deletion). For SDDCs only.", - "dedicatedCloud_USER_right_vlan_manager": "Allows port groups to be managed on the virtual switch (creation, modification, deletion). For SDDCs only.", + "dedicatedCloud_USER_right_vlan_MANAGER": "Allows port groups to be managed on the virtual switch (creation, modification, deletion). For SDDC and Hosted Private Cloud Premier packs only.", + "dedicatedCloud_USER_right_vlan_manager": "Allows port groups to be managed on the virtual switch (creation, modification, deletion). For SDDC and Hosted Private Cloud Premier packs only.", "dedicatedCloud_USER_right_resources": "Add resources", "dedicatedCloud_USER_right_resources_help": "Right to add additional resources through the OVHcloud plugin in the vSphere client.", "dedicatedCloud_USER_add_user": "Create User", diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_fr_CA.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_fr_CA.json index 366c2d040ef4..24e8012796aa 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_fr_CA.json +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_fr_CA.json @@ -325,15 +325,15 @@ "dedicatedCloud_USER_right_vmNetwork_READONLY": "Accès en lecture seule", "dedicatedCloud_USER_right_vmNetwork_readonly": "Accès en lecture seule", "dedicatedCloud_USER_right_vlan": "Accès au V(x)Lans", - "dedicatedCloud_USER_right_vlan_help": "Droits de management sur la partie réseau privé (VxLan pour les Dedicated Cloud et VLAN pour les SDDC)", + "dedicatedCloud_USER_right_vlan_help": "Droits de management sur la partie réseau privé (VxLan pour les Dedicated Cloud et VLAN pour les SDDC et les packs Hosted Private Cloud Premier)", "dedicatedCloud_USER_right_vlan_ADMIN": "Permet de configurer des VMs sur le réseau privé", "dedicatedCloud_USER_right_vlan_admin": "Permet de configurer des VMs sur le réseau privé", "dedicatedCloud_USER_right_vlan_NO_ACCESS": "Aucun accès", "dedicatedCloud_USER_right_vlan_noAccess": "Aucun accès", "dedicatedCloud_USER_right_vlan_READONLY": "Accès en lecture seule", "dedicatedCloud_USER_right_vlan_readonly": "Accès en lecture seule", - "dedicatedCloud_USER_right_vlan_MANAGER": "Permet de gérer les port groups du switch virtuel (création, modification, suppression). Seulement pour les SDDC.", - "dedicatedCloud_USER_right_vlan_manager": "Permet de gérer les port groups du switch virtuel (création, modification, suppression). Seulement pour les SDDC.", + "dedicatedCloud_USER_right_vlan_MANAGER": "Permet de gérer les port groups du switch virtuel (création, modification, suppression). Seulement pour les SDDC et les packs Hosted Private Cloud Premier.", + "dedicatedCloud_USER_right_vlan_manager": "Permet de gérer les port groups du switch virtuel (création, modification, suppression). Seulement pour les SDDC et les packs Hosted Private Cloud Premier.", "dedicatedCloud_USER_right_resources": "Ajout de ressource", "dedicatedCloud_USER_right_resources_help": "Droit d'ajouter des ressources supplémentaires via le plugin OVH dans vSphere Client", "dedicatedCloud_USER_add_user": "Créer un utilisateur", diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_fr_FR.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_fr_FR.json index 366c2d040ef4..24e8012796aa 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_fr_FR.json +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_fr_FR.json @@ -325,15 +325,15 @@ "dedicatedCloud_USER_right_vmNetwork_READONLY": "Accès en lecture seule", "dedicatedCloud_USER_right_vmNetwork_readonly": "Accès en lecture seule", "dedicatedCloud_USER_right_vlan": "Accès au V(x)Lans", - "dedicatedCloud_USER_right_vlan_help": "Droits de management sur la partie réseau privé (VxLan pour les Dedicated Cloud et VLAN pour les SDDC)", + "dedicatedCloud_USER_right_vlan_help": "Droits de management sur la partie réseau privé (VxLan pour les Dedicated Cloud et VLAN pour les SDDC et les packs Hosted Private Cloud Premier)", "dedicatedCloud_USER_right_vlan_ADMIN": "Permet de configurer des VMs sur le réseau privé", "dedicatedCloud_USER_right_vlan_admin": "Permet de configurer des VMs sur le réseau privé", "dedicatedCloud_USER_right_vlan_NO_ACCESS": "Aucun accès", "dedicatedCloud_USER_right_vlan_noAccess": "Aucun accès", "dedicatedCloud_USER_right_vlan_READONLY": "Accès en lecture seule", "dedicatedCloud_USER_right_vlan_readonly": "Accès en lecture seule", - "dedicatedCloud_USER_right_vlan_MANAGER": "Permet de gérer les port groups du switch virtuel (création, modification, suppression). Seulement pour les SDDC.", - "dedicatedCloud_USER_right_vlan_manager": "Permet de gérer les port groups du switch virtuel (création, modification, suppression). Seulement pour les SDDC.", + "dedicatedCloud_USER_right_vlan_MANAGER": "Permet de gérer les port groups du switch virtuel (création, modification, suppression). Seulement pour les SDDC et les packs Hosted Private Cloud Premier.", + "dedicatedCloud_USER_right_vlan_manager": "Permet de gérer les port groups du switch virtuel (création, modification, suppression). Seulement pour les SDDC et les packs Hosted Private Cloud Premier.", "dedicatedCloud_USER_right_resources": "Ajout de ressource", "dedicatedCloud_USER_right_resources_help": "Droit d'ajouter des ressources supplémentaires via le plugin OVH dans vSphere Client", "dedicatedCloud_USER_add_user": "Créer un utilisateur", diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_it_IT.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_it_IT.json index c2a06dd65fe7..583ffc374623 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_it_IT.json +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_it_IT.json @@ -325,15 +325,15 @@ "dedicatedCloud_USER_right_vmNetwork_READONLY": "Accesso in sola lettura", "dedicatedCloud_USER_right_vmNetwork_readonly": "Accesso in sola lettura", "dedicatedCloud_USER_right_vlan": "Accesso al V(x)Lans", - "dedicatedCloud_USER_right_vlan_help": "Permessi di gestione nella sezione rete privata (VxLan per Dedicated Cloud e VLAN per SDDC)", + "dedicatedCloud_USER_right_vlan_help": "Permessi di gestione nella sezione rete privata (VxLan per Dedicated Cloud, VLAN per SDDC e pack Hosted Private Cloud Premier)", "dedicatedCloud_USER_right_vlan_ADMIN": "Permette di configurare VM sulla rete privata", "dedicatedCloud_USER_right_vlan_admin": "Permette di configurare VM sulla rete privata", "dedicatedCloud_USER_right_vlan_NO_ACCESS": "Nessun accesso", "dedicatedCloud_USER_right_vlan_noAccess": "Nessun accesso", "dedicatedCloud_USER_right_vlan_READONLY": "Accesso in sola lettura", "dedicatedCloud_USER_right_vlan_readonly": "Accesso in sola lettura", - "dedicatedCloud_USER_right_vlan_MANAGER": "Permette di gestire le \"port groups\" dello switch virtuale (creazione, modifica, eliminazione). Solo per SDDC.", - "dedicatedCloud_USER_right_vlan_manager": "Permette di gestire le \"port groups\" dello switch virtuale (creazione, modifica, eliminazione). Solo per SDDC.", + "dedicatedCloud_USER_right_vlan_MANAGER": "Permette di gestire le \"port groups\" dello switch virtuale (creazione, modifica, eliminazione). Solo per SDDC e pack Hosted Private Cloud Premier.", + "dedicatedCloud_USER_right_vlan_manager": "Permette di gestire le \"port groups\" dello switch virtuale (creazione, modifica, eliminazione). Solo per SDDC e pack Hosted Private Cloud Premier.", "dedicatedCloud_USER_right_resources": "Aggiungi risorse", "dedicatedCloud_USER_right_resources_help": "Permesso di aggiungere risorse supplementari tramite il plugin OVH nel client vSphere ", "dedicatedCloud_USER_add_user": "Crea un utente", diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_lt_LT.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_lt_LT.json index 81840de1a29c..1336f158a0f5 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_lt_LT.json +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_lt_LT.json @@ -325,15 +325,15 @@ "dedicatedCloud_USER_right_vmNetwork_READONLY": "Read-only access", "dedicatedCloud_USER_right_vmNetwork_readonly": "Read-only access", "dedicatedCloud_USER_right_vlan": "Access to the V(X)LANs", - "dedicatedCloud_USER_right_vlan_help": "Management rights over the private network section (VXLAN for Dedicated Cloud and VLAN for SDDC)", + "dedicatedCloud_USER_right_vlan_help": "Management rights over the private network section (VXLAN for Dedicated Cloud and VLAN for SDDC and Hosted Private Cloud Premier packs)", "dedicatedCloud_USER_right_vlan_ADMIN": "Allows VMs to be configured on a private network", "dedicatedCloud_USER_right_vlan_admin": "Allows VMs to be configured on a private network", "dedicatedCloud_USER_right_vlan_NO_ACCESS": "No access", "dedicatedCloud_USER_right_vlan_noAccess": "No access", "dedicatedCloud_USER_right_vlan_READONLY": "Read-only access", "dedicatedCloud_USER_right_vlan_readonly": "Read-only access", - "dedicatedCloud_USER_right_vlan_MANAGER": "Allows port groups to be managed on the virtual switch (creation, modification, deletion). For SDDCs only.", - "dedicatedCloud_USER_right_vlan_manager": "Allows port groups to be managed on the virtual switch (creation, modification, deletion). For SDDCs only.", + "dedicatedCloud_USER_right_vlan_MANAGER": "Allows port groups to be managed on the virtual switch (creation, modification, deletion). For SDDC and Hosted Private Cloud Premier packs only.", + "dedicatedCloud_USER_right_vlan_manager": "Allows port groups to be managed on the virtual switch (creation, modification, deletion). For SDDC and Hosted Private Cloud Premier packs only.", "dedicatedCloud_USER_right_resources": "Add resources", "dedicatedCloud_USER_right_resources_help": "Right to add additional resources through the OVHcloud plugin in the vSphere client.", "dedicatedCloud_USER_add_user": "Create User", diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_pl_PL.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_pl_PL.json index a7a4a0bbecab..99dda73e3f11 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_pl_PL.json +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_pl_PL.json @@ -325,15 +325,15 @@ "dedicatedCloud_USER_right_vmNetwork_READONLY": "Dostęp tylko do odczytu", "dedicatedCloud_USER_right_vmNetwork_readonly": "Dostęp tylko do odczytu", "dedicatedCloud_USER_right_vlan": "Dostęp do V(x)Lans", - "dedicatedCloud_USER_right_vlan_help": "Uprawnienia do zarządzania w prywatnej części sieci (VxLan dla Dedicated Cloud i VLAN dla SDDC)", + "dedicatedCloud_USER_right_vlan_help": "Uprawnienia do zarządzania w prywatnej części sieci (VxLan dla Dedicated Cloud i VLAN dla SDDC oraz pakiety Hosted Private Cloud Premier)", "dedicatedCloud_USER_right_vlan_ADMIN": "Pozwala na skonfigurowanie wirtualnych maszyn w sieci prywatnej", "dedicatedCloud_USER_right_vlan_admin": "Pozwala na skonfigurowanie wirtualnych maszyn w sieci prywatnej", "dedicatedCloud_USER_right_vlan_NO_ACCESS": "Brak dostępu", "dedicatedCloud_USER_right_vlan_noAccess": "Brak dostępu", "dedicatedCloud_USER_right_vlan_READONLY": "Dostęp tylko do odczytu", "dedicatedCloud_USER_right_vlan_readonly": "Dostęp tylko do odczytu", - "dedicatedCloud_USER_right_vlan_MANAGER": "Pozwala na zarządzanie grupami portów wirtualnego przełącznika (dodawanie, zmiana, usuwanie). Wyłącznie dla SDDC.", - "dedicatedCloud_USER_right_vlan_manager": "Pozwala na zarządzanie grupami portów wirtualnego przełącznika (dodawanie, zmiana, usuwanie). Wyłącznie dla SDDC.", + "dedicatedCloud_USER_right_vlan_MANAGER": "Pozwala na zarządzanie grupami portów wirtualnego przełącznika (dodawanie, zmiana, usuwanie). Tylko dla SDDC i pakietów Hosted Private Cloud Premier.", + "dedicatedCloud_USER_right_vlan_manager": "Pozwala na zarządzanie grupami portów wirtualnego przełącznika (dodawanie, zmiana, usuwanie). Tylko dla SDDC i pakietów Hosted Private Cloud Premier.", "dedicatedCloud_USER_right_resources": "Dodawanie zasobów", "dedicatedCloud_USER_right_resources_help": "Uprawnienia do dodawania dodatkowych zasobów za pomocą wtyczki OVH w vSphere Client", "dedicatedCloud_USER_add_user": "Utwórz użytkownika", diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_pt_PT.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_pt_PT.json index 2f271c3feb99..486c4f43016a 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_pt_PT.json +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/translations/Messages_pt_PT.json @@ -325,15 +325,15 @@ "dedicatedCloud_USER_right_vmNetwork_READONLY": "Acesso só de leitura", "dedicatedCloud_USER_right_vmNetwork_readonly": "Acesso só de leitura", "dedicatedCloud_USER_right_vlan": "Acesso às V(x)Lans", - "dedicatedCloud_USER_right_vlan_help": "Permissões de gestão da parte da rede privada (VxLan para Dedicated Cloud, e VLAN para SDDC)", + "dedicatedCloud_USER_right_vlan_help": "Permissões de gestão da parte da rede privada (VxLan para Dedicated Cloud, e VLAN para SDDC e os packs Hosted Private Cloud Premier)", "dedicatedCloud_USER_right_vlan_ADMIN": "Permite configurar máquinas virtuais na rede privada", "dedicatedCloud_USER_right_vlan_admin": "Permite configurar máquinas virtuais na rede privada", "dedicatedCloud_USER_right_vlan_NO_ACCESS": "Sem acesso", "dedicatedCloud_USER_right_vlan_noAccess": "Sem acesso", "dedicatedCloud_USER_right_vlan_READONLY": "Acesso só de leitura", "dedicatedCloud_USER_right_vlan_readonly": "Acesso só de leitura", - "dedicatedCloud_USER_right_vlan_MANAGER": "Permite gerir «port groups» do switch virtual (criação, alteração, eliminação). Apenas para SDDC.", - "dedicatedCloud_USER_right_vlan_manager": "Permite gerir «port groups» do switch virtual (criação, alteração, eliminação). Apenas para SDDC.", + "dedicatedCloud_USER_right_vlan_MANAGER": "Permite gerir “port groups” do switch virtual (criação, alteração, eliminação). Apenas para os SDDC e os packs Hosted Private Cloud Premier.", + "dedicatedCloud_USER_right_vlan_manager": "Permite gerir “port groups” do switch virtual (criação, alteração, eliminação). Apenas para os SDDC e os packs Hosted Private Cloud Premier.", "dedicatedCloud_USER_right_resources": "Adição de recursos", "dedicatedCloud_USER_right_resources_help": "Permissões para acrescentar recursos adicionais através do plugin OVHcloud no vSphere Client", "dedicatedCloud_USER_add_user": "Criar utilizador", diff --git a/packages/manager/apps/dedicated/package.json b/packages/manager/apps/dedicated/package.json index 54fb8b5787a7..a4849309239c 100644 --- a/packages/manager/apps/dedicated/package.json +++ b/packages/manager/apps/dedicated/package.json @@ -26,7 +26,7 @@ "@ovh-ux/manager-catalog-price": "^1.0.1", "@ovh-ux/manager-cloud-styles": "^0.4.0 || ^1.0.0", "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-enterprise-cloud-database": "^0.2.0 || ^1.0.0", "@ovh-ux/manager-error-page": "^1.0.0 || ^2.0.0", "@ovh-ux/manager-exchange": "^1.0.0 || ^2.0.0", @@ -133,7 +133,7 @@ "oclazyload": "^1.1.0", "office-ui-fabric-core": "^11.0.0", "ovh-angular-responsive-tabs": "^4.0.0", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-manager-webfont": "^1.2.0", "ovh-ui-kit-bs": "^4.1.8", "popper.js": "^1.16.1", @@ -154,4 +154,4 @@ "webpack": "^4.41.2", "webpack-merge": "^4.2.2" } -} \ No newline at end of file +} diff --git a/packages/manager/apps/enterprise-cloud-database/index.js b/packages/manager/apps/enterprise-cloud-database/index.js index f0e3524799eb..55bda7f454ff 100644 --- a/packages/manager/apps/enterprise-cloud-database/index.js +++ b/packages/manager/apps/enterprise-cloud-database/index.js @@ -11,10 +11,10 @@ import 'script-loader!messenger/build/js/messenger-theme-flat.js'; import angular from 'angular'; import '@uirouter/angularjs'; -import './index.scss'; - import ovhManagerEnterpriseCloudDatabase from '@ovh-ux/manager-enterprise-cloud-database'; +import './index.scss'; + angular.module('enterpriseCloudDatabaseApp', [ 'ui.router', ovhManagerEnterpriseCloudDatabase, diff --git a/packages/manager/apps/enterprise-cloud-database/package.json b/packages/manager/apps/enterprise-cloud-database/package.json index 6183fa97bc60..d334ecc6be2d 100644 --- a/packages/manager/apps/enterprise-cloud-database/package.json +++ b/packages/manager/apps/enterprise-cloud-database/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-enterprise-cloud-database": "^0.2.0 || ^1.0.0", "@ovh-ux/ng-ovh-api-wrappers": "^4.0.7", "@ovh-ux/ng-ovh-cloud-universe-components": "^2.0.0", @@ -46,7 +46,7 @@ "lodash": "^4.17.14", "messenger": "HubSpot/messenger#~1.4.1", "oclazyload": "^1.1.0", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-manager-webfont": "^1.2.0", "popper.js": "^1.16.1", "ui-select": "^0.19.8", diff --git a/packages/manager/apps/freefax/package.json b/packages/manager/apps/freefax/package.json index 71c2496f903a..119b7e78abdf 100644 --- a/packages/manager/apps/freefax/package.json +++ b/packages/manager/apps/freefax/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-freefax": "^6.0.0 || ^7.0.0", "@ovh-ux/manager-ng-layout-helpers": "^1.1.0", "@ovh-ux/manager-telecom-styles": "^4.0.0", @@ -56,7 +56,7 @@ "jsplumb": "^2.12.0", "ng-csv": "^0.3.6", "oclazyload": "^1.1.0", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-ngstrap": "^4.0.2", "ovh-ui-kit-bs": "^4.1.8", "popper.js": "^1.16.1", @@ -65,7 +65,6 @@ }, "devDependencies": { "@ovh-ux/manager-webpack-config": "^3.0.8", - "ovh-manager-webfont": "^1.2.0", "webpack-merge": "^4.2.2" } -} \ No newline at end of file +} diff --git a/packages/manager/apps/hub/package.json b/packages/manager/apps/hub/package.json index bb7432c190b6..c5cfd5e69ec8 100644 --- a/packages/manager/apps/hub/package.json +++ b/packages/manager/apps/hub/package.json @@ -23,7 +23,7 @@ "@ovh-ux/manager-banner": "^1.1.3", "@ovh-ux/manager-billing": "^0.0.0 || ^1.0.0", "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-error-page": "^1.3.0 || ^2.0.0", "@ovh-ux/manager-hub": "^1.0.0 || ^2.0.0", "@ovh-ux/manager-models": "^1.0.0", @@ -64,7 +64,7 @@ "lodash-es": "^4.17.15", "moment": "^2.24.0", "oclazyload": "^1.1.0", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "popper.js": "^1.16.1", "ui-select": "^0.19.8", "whatwg-fetch": "^3.0.0" @@ -76,4 +76,4 @@ "lodash": "^4.17.15", "webpack-merge": "^4.2.2" } -} \ No newline at end of file +} diff --git a/packages/manager/apps/iplb/package.json b/packages/manager/apps/iplb/package.json index cd98fb688f15..85484bf05fdf 100644 --- a/packages/manager/apps/iplb/package.json +++ b/packages/manager/apps/iplb/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-iplb": "^0.4.0 || ^1.0.0", "@ovh-ux/ng-at-internet": "^5.0.1", "@ovh-ux/ng-ovh-actions-menu": "^5.0.6", @@ -61,7 +61,7 @@ "jquery": "^2.1.3", "moment": "^2.24.0", "oclazyload": "^1.1.0", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-ui-kit-bs": "^4.1.8", "popper.js": "^1.16.1", "ui-select": "^0.19.8" diff --git a/packages/manager/apps/iplb/src/config.js b/packages/manager/apps/iplb/src/config.js index c49caad6e0ae..5933394f6b55 100644 --- a/packages/manager/apps/iplb/src/config.js +++ b/packages/manager/apps/iplb/src/config.js @@ -1,7 +1,7 @@ -export const momentConfiguration = /* @ngInject */ ( - TranslateServiceProvider, -) => { - const defaultLanguage = TranslateServiceProvider.getUserLocale(true); +import { Environment } from '@ovh-ux/manager-config'; + +export const momentConfiguration = /* @ngInject */ () => { + const defaultLanguage = Environment.getUserLanguage(); moment.locale(defaultLanguage); }; diff --git a/packages/manager/apps/nasha/package.json b/packages/manager/apps/nasha/package.json index 80d0871bffd0..dc9460b2c0f4 100644 --- a/packages/manager/apps/nasha/package.json +++ b/packages/manager/apps/nasha/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-nasha": "^1.0.0 || ^2.0.0", "@ovh-ux/ng-ovh-api-wrappers": "^4.0.7", "@ovh-ux/ng-ovh-cloud-universe-components": "^2.0.0", @@ -55,7 +55,7 @@ "clipboard": "^2.0.4", "flatpickr": "^4.6.3", "jquery": "^2.1.3", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-ui-kit-bs": "^4.1.8", "popper.js": "^1.16.1", "ui-select": "^0.19.8" @@ -65,4 +65,4 @@ "lodash": "^4.17.15", "webpack-merge": "^4.2.2" } -} \ No newline at end of file +} diff --git a/packages/manager/apps/order-tracking/package.json b/packages/manager/apps/order-tracking/package.json index 9eeac2992195..86e79d4684a9 100644 --- a/packages/manager/apps/order-tracking/package.json +++ b/packages/manager/apps/order-tracking/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/ng-ovh-http": "^5.0.0", "@ovh-ux/ng-ovh-order-tracking": "^1.0.0", "@ovh-ux/ng-ovh-sso-auth": "^4.2.3", @@ -38,7 +38,7 @@ "clipboard": "^2.0.4", "flatpickr": "^4.6.3", "jquery": "^2.1.3", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-ui-kit-bs": "^4.1.8", "popper.js": "^1.16.1", "ui-select": "^0.19.8" diff --git a/packages/manager/apps/overthebox/package.json b/packages/manager/apps/overthebox/package.json index ecf281aa4142..1ebdb8811a80 100644 --- a/packages/manager/apps/overthebox/package.json +++ b/packages/manager/apps/overthebox/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-ng-layout-helpers": "^1.1.0", "@ovh-ux/manager-overthebox": "^5.0.0 || ^6.0.0", "@ovh-ux/manager-telecom-styles": "^4.0.0", @@ -46,8 +46,7 @@ "lodash": "^4.17.15", "moment": "^2.24.0", "oclazyload": "^1.1.0", - "ovh-angular-responsive-tabs": "^4.0.0", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-manager-webfont": "^1.2.0", "ovh-ui-kit-bs": "^4.1.8" }, @@ -56,4 +55,4 @@ "ovh-manager-webfont": "^1.2.0", "webpack-merge": "^4.2.2" } -} \ No newline at end of file +} diff --git a/packages/manager/apps/pci/package.json b/packages/manager/apps/pci/package.json index 47d6d3584bf6..260abcb0eec7 100644 --- a/packages/manager/apps/pci/package.json +++ b/packages/manager/apps/pci/package.json @@ -21,7 +21,7 @@ "dependencies": { "@ovh-ux/manager-cloud-styles": "^0.4.0 || ^1.0.0", "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-pci": "^3.0.0 || ^4.0.0", "@ovh-ux/ng-at-internet": "^5.0.1", "@ovh-ux/ng-ovh-api-wrappers": "^4.0.7", @@ -54,7 +54,7 @@ "jquery-ui": "^1.12.1", "matchmedia-ng": "^1.0.8", "oclazyload": "^1.1.0", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-common-style": "^5.0.0", "ovh-manager-webfont": "^1.2.0", "ovh-ui-kit-bs": "^4.1.8", diff --git a/packages/manager/apps/public-cloud/package.json b/packages/manager/apps/public-cloud/package.json index abc9728a7357..3e2e5136bcef 100644 --- a/packages/manager/apps/public-cloud/package.json +++ b/packages/manager/apps/public-cloud/package.json @@ -23,7 +23,7 @@ "@ovh-ux/manager-account-sidebar": "^2.0.0 || ^3.0.0", "@ovh-ux/manager-cloud-styles": "^0.4.0 || ^1.0.0", "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-error-page": "^1.0.0 || ^2.0.0", "@ovh-ux/manager-navbar": "^4.0.0 || ^5.0.0", "@ovh-ux/manager-notifications-sidebar": "^0.0.0 || ^1.0.0", @@ -78,7 +78,7 @@ "matchmedia-ng": "^1.0.8", "moment": "^2.24.0", "oclazyload": "^1.1.0", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-common-style": "^5.0.0", "ovh-manager-webfont": "^1.2.0", "ovh-ui-kit-bs": "^4.1.8", @@ -93,4 +93,4 @@ "webpack": "^4.41.2", "webpack-merge": "^4.2.2" } -} \ No newline at end of file +} diff --git a/packages/manager/apps/sign-up/package.json b/packages/manager/apps/sign-up/package.json index 47bde8416fce..0c8654ec17d8 100644 --- a/packages/manager/apps/sign-up/package.json +++ b/packages/manager/apps/sign-up/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/ng-ovh-http": "^5.0.0", "@ovh-ux/ng-ovh-request-tagger": "^1.0.1", "@ovh-ux/ng-ovh-sso-auth": "^4.2.3", diff --git a/packages/manager/apps/sign-up/src/index.js b/packages/manager/apps/sign-up/src/index.js index f4433792d86a..0a3e928d71a1 100644 --- a/packages/manager/apps/sign-up/src/index.js +++ b/packages/manager/apps/sign-up/src/index.js @@ -1,5 +1,5 @@ // set environment -import { Environment } from '@ovh-ux/manager-config'; +import { Environment, findLanguage } from '@ovh-ux/manager-config'; /* eslint-disable import/no-webpack-loader-syntax, import/extensions */ import 'script-loader!jquery'; @@ -54,7 +54,7 @@ angular }, ) .config( - /* @ngInject */ ($translateProvider, TranslateServiceProvider) => { + /* @ngInject */ ($translateProvider) => { const getQueryVariable = (variable) => { const { hash } = window.location; const query = hash.substring(hash.indexOf('?') + 1); @@ -74,11 +74,8 @@ angular window.navigator.userLanguage || 'en'; - const userLocale = TranslateServiceProvider.findLanguage( - language, - language, - ); - TranslateServiceProvider.setUserLocale(userLocale); + const userLocale = findLanguage(language); + Environment.setUserLocale(userLocale); $translateProvider.use(userLocale); }, ) diff --git a/packages/manager/apps/sms/package.json b/packages/manager/apps/sms/package.json index 37d9194585f9..2219ea8eed00 100644 --- a/packages/manager/apps/sms/package.json +++ b/packages/manager/apps/sms/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-ng-layout-helpers": "^1.1.0", "@ovh-ux/manager-sms": "^8.0.0", "@ovh-ux/manager-telecom-styles": "^4.0.0", @@ -54,7 +54,7 @@ "moment": "^2.24.0", "ng-csv": "^0.3.6", "oclazyload": "^1.1.0", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-ngstrap": "^4.0.2", "validator-js": "^0.2.1" }, @@ -63,4 +63,4 @@ "ovh-manager-webfont": "^1.2.0", "webpack-merge": "^4.2.2" } -} \ No newline at end of file +} diff --git a/packages/manager/apps/support/package.json b/packages/manager/apps/support/package.json index 61cfdb0c0e40..bae5fec5d7d0 100644 --- a/packages/manager/apps/support/package.json +++ b/packages/manager/apps/support/package.json @@ -19,7 +19,7 @@ "dependencies": { "@ovh-ux/manager-account-sidebar": "^2.0.0 || ^3.0.0", "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-navbar": "^4.0.0 || ^5.0.0", "@ovh-ux/manager-support": "^0.6.0 || ^0.7.0 || ^1.0.0", "@ovh-ux/ng-at-internet": "^5.1.0", @@ -37,7 +37,7 @@ "font-awesome": "~4.7.0", "lodash": "^4.17.15", "moment": "^2.24.0", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-ui-kit-bs": "^4.1.8", "popper.js": "^1.16.1", "ui-select": "^0.19.8" @@ -46,4 +46,4 @@ "@ovh-ux/manager-webpack-config": "^3.3.0", "webpack-merge": "^4.2.2" } -} \ No newline at end of file +} diff --git a/packages/manager/apps/telecom-dashboard/package.json b/packages/manager/apps/telecom-dashboard/package.json index c6b6502381be..33cdc3c7c39d 100644 --- a/packages/manager/apps/telecom-dashboard/package.json +++ b/packages/manager/apps/telecom-dashboard/package.json @@ -21,7 +21,7 @@ "dependencies": { "@ovh-ux/manager-banner": "^1.1.3", "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-telecom-dashboard": "^5.0.0 || ^6.0.0", "@ovh-ux/manager-telecom-styles": "^4.0.0", "@ovh-ux/ng-at-internet": "^5.0.1", @@ -49,7 +49,7 @@ "jsplumb": "^2.12.0", "lodash": "^4.17.15", "ng-csv": "^0.3.6", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-manager-webfont": "^1.2.0", "ovh-ngstrap": "^4.0.2", "ovh-ui-kit-bs": "^4.1.8", diff --git a/packages/manager/apps/telecom-task/package.json b/packages/manager/apps/telecom-task/package.json index 08822e3f050f..b47526aaff99 100644 --- a/packages/manager/apps/telecom-task/package.json +++ b/packages/manager/apps/telecom-task/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-telecom-styles": "^4.0.0", "@ovh-ux/manager-telecom-task": "^5.0.0 || ^6.0.0", "@ovh-ux/ng-ovh-checkbox-table": "^2.0.0", @@ -46,7 +46,7 @@ "jsplumb": "^2.12.0", "ng-csv": "^0.3.6", "oclazyload": "^1.1.0", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-manager-webfont": "^1.2.0", "ovh-ngstrap": "^4.0.2", "ovh-ui-kit-bs": "^4.1.8", diff --git a/packages/manager/apps/telecom/package.json b/packages/manager/apps/telecom/package.json index da76700e1224..3a5ec850e142 100644 --- a/packages/manager/apps/telecom/package.json +++ b/packages/manager/apps/telecom/package.json @@ -24,7 +24,7 @@ "@ovh-ux/manager-beta-preference": "^1.0.0", "@ovh-ux/manager-carrier-sip": "^1.0.0 || ^2.0.0", "@ovh-ux/manager-config": "^0.4.0 || ^1.0.0", - "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", + "@ovh-ux/manager-core": "^10.0.0 || ^11.0.0", "@ovh-ux/manager-error-page": "^1.0.0 || ^2.0.0", "@ovh-ux/manager-freefax": "^6.0.0 || ^7.0.0", "@ovh-ux/manager-navbar": "^4.0.0 || ^5.0.0", @@ -129,7 +129,7 @@ "ngSmoothScroll": "d-oliveros/angular-smooth-scroll#~1.7.1", "oclazyload": "^1.1.0", "ovh-angular-responsive-tabs": "^4.0.0", - "ovh-api-services": "^9.47.0", + "ovh-api-services": "^9.50.0", "ovh-manager-webfont": "^1.2.0", "ovh-ng-input-password": "^1.2.5", "ovh-ngstrap": "^4.0.2", @@ -147,4 +147,4 @@ "webpack": "^4.41.2", "webpack-merge": "^4.2.2" } -} \ No newline at end of file +} diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/index.js b/packages/manager/apps/telecom/src/app/telecom/pack/index.js index 815c35fe082a..96e860335dec 100644 --- a/packages/manager/apps/telecom/src/app/telecom/pack/index.js +++ b/packages/manager/apps/telecom/src/app/telecom/pack/index.js @@ -1,6 +1,7 @@ import angular from 'angular'; import internetAccess from './internet-access'; +import packMove from './move'; import packVoipLineActivation from './slots/voipLine/activation/pack-voipLine-activation.module'; import hostedEmailDetail from './slots/hostedEmail/detail'; import xdsl from './xdsl'; @@ -18,6 +19,7 @@ angular hostedEmailDetail, packVoipLineActivation, xdsl, + packMove, ]) .controller('PackCtrl', controller) .config(routing) diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/index.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/index.js new file mode 100644 index 000000000000..a8349ca59578 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/index.js @@ -0,0 +1,15 @@ +import angular from 'angular'; + +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; +import uiRouter from '@uirouter/angularjs'; +import angularTranslate from 'angular-translate'; + +import addressCurrent from './move-address-current.component'; + +const moduleName = 'ovhManagerTelecomPackMoveAddressCurrent'; + +angular + .module(moduleName, [ngTranslateAsyncLoader, uiRouter, angularTranslate]) + .component('packMoveAddressCurrent', addressCurrent); + +export default moduleName; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/move-address-current.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/move-address-current.component.js new file mode 100644 index 000000000000..8f68d4c3838e --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/move-address-current.component.js @@ -0,0 +1,12 @@ +import template from './move-address-current.html'; + +export default { + template, + bindings: { + address: '=?', + addressLoading: '=?', + portLineNumber: '=?', + portability: '=?', + lineNumber: '@', + }, +}; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/pack-move-address-current.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/move-address-current.html similarity index 53% rename from packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/pack-move-address-current.html rename to packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/move-address-current.html index e2e23f321bb5..88b6d68c0b51 100644 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/pack-move-address-current.html +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/move-address-current.html @@ -9,88 +9,68 @@

-
+
- + - + - + - + - +
- + - +
- ,
+ -
@@ -101,8 +81,8 @@

>

@@ -124,13 +104,13 @@

diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/pack-move-address-current.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/pack-move-address-current.component.js deleted file mode 100644 index d30497158251..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/current/pack-move-address-current.component.js +++ /dev/null @@ -1,12 +0,0 @@ -angular.module('managerApp').component('packMoveAddressCurrent', { - bindings: { - address: '=?', - addressLoading: '=?', - portLineNumber: '=?', - portability: '=?', - lineNumber: '@', - }, - templateUrl: - 'app/telecom/pack/move/address/current/pack-move-address-current.html', - controllerAs: 'PackMoveAddressCurrent', -}); diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/index.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/index.js new file mode 100644 index 000000000000..2ddaa314fc7d --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/index.js @@ -0,0 +1,15 @@ +import angular from 'angular'; + +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; +import uiRouter from '@uirouter/angularjs'; +import angularTranslate from 'angular-translate'; + +import addressFuture from './move-address-future.component'; + +const moduleName = 'ovhManagerTelecomPackMoveAddressFuture'; + +angular + .module(moduleName, [ngTranslateAsyncLoader, uiRouter, angularTranslate]) + .component('packMoveAddressFuture', addressFuture); + +export default moduleName; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/move-address-future.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/move-address-future.component.js new file mode 100644 index 000000000000..84b09d7ed255 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/move-address-future.component.js @@ -0,0 +1,15 @@ +import controller from './move-address-future.controller'; +import template from './move-address-future.html'; + +export default { + controller, + template, + bindings: { + address: '=?', + addressLoading: '=?', + rio: '=?', + keepLineNumber: '=?', + lineNumber: '@', + canKeepLineNumber: '=?', + }, +}; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/move-address-future.controller.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/move-address-future.controller.js new file mode 100644 index 000000000000..5e383f445cec --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/move-address-future.controller.js @@ -0,0 +1,6 @@ +export default class MoveAddressFutureCtrl { + /* @ngInject */ + constructor(tucValidator) { + this.tucValidator = tucValidator; + } +} diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/move-address-future.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/move-address-future.html new file mode 100644 index 000000000000..794c20909ace --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/move-address-future.html @@ -0,0 +1,106 @@ +
+
+
+
+ +
+
+

+
+ +
+
+ + + + + + + + + + + + +
+
+ + + + + + + + +
+
+ + +
+
+ + +
+
+
+ +
+
+ +
+

+ + +
+ +
+
+ +
+
diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/pack-move-address-future.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/pack-move-address-future.component.js deleted file mode 100644 index 0e39a4880949..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/pack-move-address-future.component.js +++ /dev/null @@ -1,16 +0,0 @@ -angular.module('managerApp').component('packMoveAddressFuture', { - bindings: { - address: '=?', - addressLoading: '=?', - rio: '=?', - keepLineNumber: '=?', - lineNumber: '@', - canKeepLineNumber: '=?', - }, - templateUrl: - 'app/telecom/pack/move/address/future/pack-move-address-future.html', - controllerAs: 'PackMoveAddressFuture', - controller(tucValidator) { - this.validator = tucValidator; - }, -}); diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/pack-move-address-future.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/pack-move-address-future.html deleted file mode 100644 index f1aef7beae37..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/future/pack-move-address-future.html +++ /dev/null @@ -1,75 +0,0 @@ -
-
-
-
- -
-
-

-
- -
-
-
- - -
-
-
- -
-
- -
-

- - -
- -
-
- -
-
diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/index.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/index.js new file mode 100644 index 000000000000..c361703a9fa7 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/index.js @@ -0,0 +1,24 @@ +import angular from 'angular'; + +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; +import uiRouter from '@uirouter/angularjs'; +import angularTranslate from 'angular-translate'; + +import currentAddress from './current'; +import futureAddress from './future'; + +import address from './move-address.component'; + +const moduleName = 'ovhManagerTelecomPackMoveAddress'; + +angular + .module(moduleName, [ + ngTranslateAsyncLoader, + uiRouter, + angularTranslate, + currentAddress, + futureAddress, + ]) + .component('packMoveAddress', address); + +export default moduleName; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/move-address.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/move-address.component.js new file mode 100644 index 000000000000..d0af18355710 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/move-address.component.js @@ -0,0 +1,19 @@ +import controller from './move-address.controller'; +import template from './move-address.html'; + +export default { + controller, + template, + bindings: { + loading: '<', + lineNumber: '<', + portability: '<', + address: '<', + futureAddress: '<', + addressLoading: '<', + rio: '=?', + canKeepLineNumber: '<', + futureLineNumber: '<', + offer: '<', + }, +}; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/move-address.controller.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/move-address.controller.js new file mode 100644 index 000000000000..2db4f57f1967 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/move-address.controller.js @@ -0,0 +1,43 @@ +import { UNBUNDLING } from '../pack-move.constant'; + +export default class MoveAddressCtrl { + /* @ngInject */ + constructor($scope) { + this.$scope = $scope; + } + + $onInit() { + this.portLineNumber = false; + this.keepLineNumber = false; + } + + /** + * Check if can keep line number + * @returns {boolean} + */ + canKeepNumber() { + const canKeep = + this.offer.portability && + this.offer.portability.eligibility.eligible && + this.offer.unbundling !== UNBUNDLING.partial; + return canKeep; + } + + next() { + if (!this.canKeepNumber()) { + this.keepLineNumber = false; + } + const form = { + currentLandline: { + lineNumber: this.lineNumber, + portLineNumber: this.portLineNumber, + }, + futureLandline: { + lineNumber: this.futureLineNumber, + keepLineNumber: this.keepLineNumber, + rio: this.rio, + }, + }; + this.$scope.$emit('savedNumber', form); + } +} diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/address/move-address.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/move-address.html new file mode 100644 index 000000000000..5cfbd6dbb56c --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/address/move-address.html @@ -0,0 +1,34 @@ +
+

+
+ + + + + + + + +
+
+ + + +
+
diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/index.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/index.js new file mode 100644 index 000000000000..2a2408456cad --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/index.js @@ -0,0 +1,15 @@ +import angular from 'angular'; + +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; +import uiRouter from '@uirouter/angularjs'; +import angularTranslate from 'angular-translate'; + +import buildingDetails from './move-building-details.component'; + +const moduleName = 'ovhManagerTelecomPackMoveBuildingDetails'; + +angular + .module(moduleName, [ngTranslateAsyncLoader, uiRouter, angularTranslate]) + .component('packMoveBuildingDetails', buildingDetails); + +export default moduleName; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/move-building-details.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/move-building-details.component.js new file mode 100644 index 000000000000..79e722aafe19 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/move-building-details.component.js @@ -0,0 +1,10 @@ +import controller from './move-building-details.controller'; +import template from './move-building-details.html'; + +export default { + controller, + template, + bindings: { + buildings: '<', + }, +}; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/move-building-details.constant.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/move-building-details.constant.js new file mode 100644 index 000000000000..47a03a7cee45 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/move-building-details.constant.js @@ -0,0 +1,11 @@ +export const FIBER_PTO = { + FIBER_PTO_YES: 'yes', + FIBER_PTO_YES_BUT_NOT_KNOWN: 'yesNotKnown', + FIBER_PTO_NO: 'no', +}; + +export const STAIR_FLOOR = { + unknown: '_NA_', +}; + +export default { FIBER_PTO, STAIR_FLOOR }; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/move-building-details.controller.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/move-building-details.controller.js new file mode 100644 index 000000000000..3e6a9d5e5ab5 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/move-building-details.controller.js @@ -0,0 +1,177 @@ +import has from 'lodash/has'; + +import { FIBER_PTO, STAIR_FLOOR } from './move-building-details.constant'; + +export default class MoveBuildingDetailsCtrl { + /* @ngInject */ + constructor($scope, $translate, OvhApiConnectivityEligibilitySearch) { + this.$scope = $scope; + this.$translate = $translate; + this.OvhApiConnectivityEligibilitySearch = OvhApiConnectivityEligibilitySearch; + } + + $onInit() { + this.selectedOffer = { + buildingReference: null, + stair: null, + floor: null, + pto: null, + ptoReference: null, + }; + this.loading = { + init: true, + }; + this.model = { + engageMonths: null, + selectedBuilding: null, + selectedStair: null, + selectedFloor: null, + pto: null, + ptoReference: null, + ptoReferenceNotKnown: false, + }; + + this.buildings.forEach((building, i) => { + // check if the building name is empty to set a name to display in the select component + if (building.buildingName === '') { + this.buildings[i].buildingName = this.$translate.instant( + 'pack_move_building_details_unknown', + ); + } + + const params = { + building: building.buildingReference, + }; + + this.OvhApiConnectivityEligibilitySearch.v6() + .buildingDetails({}, params) + .$promise.then((buildingDetails) => { + if (has(buildingDetails, 'result.stairs')) { + this.buildings[ + i + ].stairs = buildingDetails.result.stairs.map((stair) => + this.convertStairs(stair), + ); + } + }) + .finally(() => { + this.loading.init = false; + }); + }); + } + + nextStep() { + this.selectedOffer.buildingReference = this.model.selectedBuilding.buildingReference; + this.selectedOffer.stair = this.model.selectedStair.stair.value; + this.selectedOffer.floor = this.model.selectedFloor.value; + this.selectedOffer.pto = [ + FIBER_PTO.FIBER_PTO_YES, + FIBER_PTO.FIBER_PTO_YES_BUT_NOT_KNOWN, + ].includes(this.model.pto); + this.selectedOffer.ptoReference = + this.model.pto === FIBER_PTO.FIBER_PTO_YES + ? this.model.ptoReference + : null; + + this.$scope.$emit('updateBuildingDetails', this.selectedOffer); + } + + isValidSelection() { + if ( + this.model.selectedBuilding != null && + this.model.selectedStair != null && + this.model.selectedFloor != null && + this.model.pto != null + ) { + return ( + (this.model.pto === FIBER_PTO.FIBER_PTO_YES && + this.model.ptoReference != null && + this.model.ptoReference !== '') || + [ + FIBER_PTO.FIBER_PTO_YES_BUT_NOT_KNOWN, + FIBER_PTO.FIBER_PTO_NO, + ].includes(this.model.pto) + ); + } + return false; + } + + convertStairs(stair) { + const stairsModel = {}; + if (stair.stair === STAIR_FLOOR.unknown) { + stairsModel.stair = { + label: this.$translate.instant('pack_move_building_details_none'), + value: stair.stair, + }; + } else { + stairsModel.stair = { + label: stair.stair, + value: stair.stair, + }; + } + + if (stair.floors[0] === STAIR_FLOOR.unknown) { + stairsModel.floors = [ + { + label: this.$translate.instant('pack_move_building_details_none'), + value: stair.floors[0], + }, + ]; + } else { + stairsModel.floors = stair.floors.map((floor) => ({ + label: floor, + value: floor, + })); + } + return stairsModel; + } + + /** + * Set default stairs model for empty stairs + */ + defaultStairsModel() { + return { + stair: { + label: this.$translate.instant('pack_move_building_details_none'), + value: STAIR_FLOOR.unknown, + }, + floors: [ + { + label: this.$translate.instant('pack_move_building_details_none'), + value: STAIR_FLOOR.unknown, + }, + ], + }; + } + + changeSelection(isFromStairs) { + if (!isFromStairs) { + if ( + !this.model.selectedBuilding.stairs || + this.model.selectedBuilding.stairs.length === 0 + ) { + const params = { + building: this.model.selectedBuilding.buildingReference, + }; + this.OvhApiConnectivityEligibilitySearch.v6() + .buildingDetails({}, params) + .$promise.then((buildingDetails) => { + if (has(buildingDetails, 'result.stairs')) { + if (buildingDetails.result.stairs.length === 0) { + const stairModel = this.defaultStairsModel(); + this.model.selectedBuilding.stairs.push(stairModel); + } else { + this.model.selectedBuilding.stairs = buildingDetails.result.stairs.map( + (stair) => this.convertStairs(stair), + ); + } + } + }); + } + if (this.model.selectedStair != null) { + this.model.selectedStair = null; + } + } + this.model.selectedFloor = null; + } +} diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/move-building-details.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/move-building-details.html new file mode 100644 index 000000000000..ea4c4018c9f0 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/building-details/move-building-details.html @@ -0,0 +1,157 @@ +
+ +
+ +
+ +
+

+
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+
+ +
+

+
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+ + + + +
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ +
+ + + +
+
diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/pack-move-contract.controller.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/pack-move-contract.controller.js deleted file mode 100644 index ee7eb8dc2cad..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/pack-move-contract.controller.js +++ /dev/null @@ -1,22 +0,0 @@ -angular - .module('managerApp') - .controller('PackMoveContractCtrl', function PackMoveContractCtrl( - $uibModalInstance, - data, - ) { - const self = this; - this.form = data.form; - this.offer = data.offer; - this.meeting = data.meeting; - this.checkboxSelected = false; - this.loading = false; - - this.cancel = function cancel() { - $uibModalInstance.dismiss('cancel'); - }; - - this.confirm = function confirm() { - self.loading = true; - $uibModalInstance.close(true); - }; - }); diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/pack-move-contract.modal.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/pack-move-contract.modal.html deleted file mode 100644 index 8bfc6fa06d3f..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/pack-move-contract.modal.html +++ /dev/null @@ -1,110 +0,0 @@ -
- -
- -
- - - -
diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_de_DE.json b/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_de_DE.json deleted file mode 100644 index 0569f551b5df..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_de_DE.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pack_move_contract_title": "Bestätigen", - "pack_move_contract_are_you_sure": "Sind Sie sicher, dass Sie den folgenden Vorgang fortsetzen möchten:", - "pack_move_contract_move": "Umzug", - "pack_move_contract_action": "Die ADSL Leitung {{lineNumber}} wird aktiviert.", - "pack_move_contract_action_create": "Eine neue Leitung wird unter folgender Adresse eingerichtet:", - "pack_move_contract_fake_meeting": "Ich werde von France Telecom angerufen, um ein Treffen zu vereinbaren.", - "pack_move_contract_meeting": "Es ist ein Treffen vorgesehen für den {{day}} zwischen {{start}} und {{end}}.", - "pack_move_contract_rules": "Mir ist bekannt, dass der Umzug meines Zugangs eine automatische Vertragsverlängerung von 12 Monaten bewirkt, die mit der Aktivierung des neuen Zugangs beginnt. Mein aktueller Zugang wird zum Monatsende der Einrichtung des neuen Zugangs geschlossen.", - "pack_move_contract_porta_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès." -} \ No newline at end of file diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_en_GB.json b/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_en_GB.json deleted file mode 100644 index 627b1391a7ac..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_en_GB.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pack_move_contract_title": "Order confirmation ", - "pack_move_contract_are_you_sure": "Êtes-vous sûr(e) de vouloir effectuer l'opération suivante :", - "pack_move_contract_move": "Moving", - "pack_move_contract_action": "La ligne ADSL {{lineNumber}} va être activée.", - "pack_move_contract_action_create": "Une nouvelle ligne va être créé à l'adresse :", - "pack_move_contract_fake_meeting": "Je serai contacté par France Telecom pour convenir d'un rendez-vous.", - "pack_move_contract_meeting": "Un rendez-vous est programmé le {{day}} entre {{start}} et {{end}}.", - "pack_move_contract_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès. Mon accès actuel sera cloturé à la fin du mois de mise en service de mon nouvel accès.", - "pack_move_contract_porta_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès." -} \ No newline at end of file diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_es_ES.json b/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_es_ES.json deleted file mode 100644 index e203066f755c..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_es_ES.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pack_move_contract_title": "Confirmar", - "pack_move_contract_are_you_sure": "¿Seguro que quiere realizar la siguiente operación:", - "pack_move_contract_move": "Traslado", - "pack_move_contract_action": "Va a activarse la línea ADSL {{lineNumber}}.", - "pack_move_contract_action_create": "Se va a crear una nueva línea en la dirección:", - "pack_move_contract_fake_meeting": "France Telecom se pondrá en contacto conmigo para acordar una cita.", - "pack_move_contract_meeting": "Se ha programado una cita el {{day}} entre {{start}} y {{end}}.", - "pack_move_contract_rules": "Entiendo que el traslado de mi acceso conlleva un nuevo período de compromiso de 12 meses que empezará a contar desde la activación de mi nuevo acceso. Mi acceso actual se cerrará al final del mes de puesta en servicio de mi nuevo acceso.", - "pack_move_contract_porta_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès." -} \ No newline at end of file diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_es_US.json b/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_es_US.json deleted file mode 100644 index 98063a046dda..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_es_US.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pack_move_contract_title": "Confirmation", - "pack_move_contract_are_you_sure": "Êtes-vous sûr(e) de vouloir effectuer l'opération suivante :", - "pack_move_contract_move": "Déménagement", - "pack_move_contract_action": "La ligne ADSL {{lineNumber}} va être activée.", - "pack_move_contract_action_create": "Une nouvelle ligne va être créé à l'adresse :", - "pack_move_contract_fake_meeting": "Je serai contacté par France Telecom pour convenir d'un rendez-vous.", - "pack_move_contract_meeting": "Un rendez-vous est programmé le {{day}} entre {{start}} et {{end}}.", - "pack_move_contract_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès. Mon accès actuel sera cloturé à la fin du mois de mise en service de mon nouvel accès.", - "pack_move_contract_porta_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès." -} \ No newline at end of file diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_fi_FI.json b/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_fi_FI.json deleted file mode 100644 index c2297f63bc9d..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_fi_FI.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pack_move_contract_title": "Vahvista", - "pack_move_contract_are_you_sure": "Haluatko varmasti suorittaa seuraavan operaation:", - "pack_move_contract_move": "Muutto", - "pack_move_contract_action": "ADSL-linja {{lineNumber}} aktivoidaan.", - "pack_move_contract_action_create": "Uusi linja luodaan osoitteeseen:", - "pack_move_contract_fake_meeting": "France Telecom ottaa minuun yhteyttä tapaamisen sopimista varten.", - "pack_move_contract_meeting": "Tapaaminen on sovittu {{day}} välillä {{start}} ja {{end}}.", - "pack_move_contract_rules": "Ymmärrän, että liittymän siirto johtaa uuteen 12 kuukauden sitoutumiseen, joka alkaa uuden liittymän aktivoinnista. Nykyinen liittymä suljetaan sen kuukauden lopussa jona uusi liittymä aktivoidaan.", - "pack_move_contract_porta_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès." -} \ No newline at end of file diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_fr_CA.json b/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_fr_CA.json deleted file mode 100644 index 98063a046dda..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_fr_CA.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pack_move_contract_title": "Confirmation", - "pack_move_contract_are_you_sure": "Êtes-vous sûr(e) de vouloir effectuer l'opération suivante :", - "pack_move_contract_move": "Déménagement", - "pack_move_contract_action": "La ligne ADSL {{lineNumber}} va être activée.", - "pack_move_contract_action_create": "Une nouvelle ligne va être créé à l'adresse :", - "pack_move_contract_fake_meeting": "Je serai contacté par France Telecom pour convenir d'un rendez-vous.", - "pack_move_contract_meeting": "Un rendez-vous est programmé le {{day}} entre {{start}} et {{end}}.", - "pack_move_contract_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès. Mon accès actuel sera cloturé à la fin du mois de mise en service de mon nouvel accès.", - "pack_move_contract_porta_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès." -} \ No newline at end of file diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_fr_FR.json b/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_fr_FR.json deleted file mode 100644 index 98063a046dda..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_fr_FR.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pack_move_contract_title": "Confirmation", - "pack_move_contract_are_you_sure": "Êtes-vous sûr(e) de vouloir effectuer l'opération suivante :", - "pack_move_contract_move": "Déménagement", - "pack_move_contract_action": "La ligne ADSL {{lineNumber}} va être activée.", - "pack_move_contract_action_create": "Une nouvelle ligne va être créé à l'adresse :", - "pack_move_contract_fake_meeting": "Je serai contacté par France Telecom pour convenir d'un rendez-vous.", - "pack_move_contract_meeting": "Un rendez-vous est programmé le {{day}} entre {{start}} et {{end}}.", - "pack_move_contract_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès. Mon accès actuel sera cloturé à la fin du mois de mise en service de mon nouvel accès.", - "pack_move_contract_porta_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès." -} \ No newline at end of file diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_it_IT.json b/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_it_IT.json deleted file mode 100644 index 5bb9c3306a95..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_it_IT.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pack_move_contract_title": "Conferma", - "pack_move_contract_are_you_sure": "Vuoi davvero effettuare questa operazione:", - "pack_move_contract_move": "Trasferimento", - "pack_move_contract_action": "La linea ADSL {{lineNumber}} verrà attivata.", - "pack_move_contract_action_create": "Una nuova linea verrà creata all'indirizzo:", - "pack_move_contract_fake_meeting": "Verrò contattato da France Telecom per concordare un appuntamento.", - "pack_move_contract_meeting": "L'appuntamento è stato fissato il {{day}}, tra le {{start}} e le {{end}}.", - "pack_move_contract_rules": "Sono consapevole che il trasferimento del mio accesso comporta un nuovo impegno di 12 mesi, a partire dal momento di attivazione del mio nuovo accesso. Il mio accesso attuale verrà disabilitato alla fine del mese in cui il nuovo accesso verrà attivato.", - "pack_move_contract_porta_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès." -} \ No newline at end of file diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_lt_LT.json b/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_lt_LT.json deleted file mode 100644 index 508906792b93..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_lt_LT.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pack_move_contract_title": "Patvirtinimas", - "pack_move_contract_are_you_sure": "Ar tikrai norite atlikti šią operaciją:", - "pack_move_contract_move": "Perkėlimas", - "pack_move_contract_action": "ADSL linija {{lineNumber}} bus aktyvuota.", - "pack_move_contract_action_create": "Nauja linija bus sukurta su adresu:", - "pack_move_contract_fake_meeting": "Su manim susisieks France Telecom ir suderins susitikimo laiką.", - "pack_move_contract_meeting": "Susitikimas paskirtas {{day}}, nuo {{start}} iki {{end}}.", - "pack_move_contract_rules": "Suprantu, kad prieigos perkėlimas pratęs įsipareigojimą 12 mėnesių, kurie prasidės po perkėlimo. Dabartinė mano prieiga bus uždaryta mėnesio pabaigoje, suteikus naują prieigą.", - "pack_move_contract_porta_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès." -} \ No newline at end of file diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_pl_PL.json b/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_pl_PL.json deleted file mode 100644 index d434c96d6dc9..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_pl_PL.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pack_move_contract_title": "Potwierdź", - "pack_move_contract_are_you_sure": "Czy chcesz wykonać następującą operację:", - "pack_move_contract_move": "Przeniesienie", - "pack_move_contract_action": "La ligne ADSL {{lineNumber}} va être activée.", - "pack_move_contract_action_create": "Une nouvelle ligne va être créé à l'adresse :", - "pack_move_contract_fake_meeting": "Je serai contacté par France Telecom pour convenir d'un rendez-vous.", - "pack_move_contract_meeting": "Un rendez-vous est programmé le {{day}} entre {{start}} et {{end}}.", - "pack_move_contract_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès. Mon accès actuel sera cloturé à la fin du mois de mise en service de mon nouvel accès.", - "pack_move_contract_porta_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès." -} \ No newline at end of file diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_pt_PT.json b/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_pt_PT.json deleted file mode 100644 index 9d78dd2abab5..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/contract/translations/Messages_pt_PT.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pack_move_contract_title": "Confirmação", - "pack_move_contract_are_you_sure": "Êtes-vous sûr(e) de vouloir effectuer l'opération suivante :", - "pack_move_contract_move": "Mudança", - "pack_move_contract_action": "La ligne ADSL {{lineNumber}} va être activée.", - "pack_move_contract_action_create": "Une nouvelle ligne va être créé à l'adresse :", - "pack_move_contract_fake_meeting": "Je serai contacté par France Telecom pour convenir d'un rendez-vous.", - "pack_move_contract_meeting": "Un rendez-vous est programmé le {{day}} entre {{start}} et {{end}}.", - "pack_move_contract_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès. Mon accès actuel sera cloturé à la fin du mois de mise en service de mon nouvel accès.", - "pack_move_contract_porta_rules": "Je comprends que le déménagement de mon accès engendre un réengagement de 12 mois qui débutetera à l'activation de mon nouvel accès." -} \ No newline at end of file diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/index.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/index.js new file mode 100644 index 000000000000..dfae5f0813e7 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/index.js @@ -0,0 +1,20 @@ +import angular from 'angular'; + +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; +import uiRouter from '@uirouter/angularjs'; +import angularTranslate from 'angular-translate'; + +import eligibilityAddress from './move-eligibility-address.component'; + +const moduleName = 'ovhManagerTelecomPackMoveEligibilityAddress'; + +angular + .module(moduleName, [ + ngTranslateAsyncLoader, + uiRouter, + angularTranslate, + 'oui', + ]) + .component('packMoveEligibilityAddress', eligibilityAddress); + +export default moduleName; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/move-eligibility-address.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/move-eligibility-address.component.js new file mode 100644 index 000000000000..14e112decea4 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/move-eligibility-address.component.js @@ -0,0 +1,14 @@ +import controller from './move-eligibility-address.controller'; +import template from './move-eligibility-address.html'; + +export default { + bindings: { + address: '=?', + offersChange: '&', + submited: '&', + method: '=?', + packName: '<', + }, + template, + controller, +}; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/pack-move-eligibility-address.constants.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/move-eligibility-address.constants.js similarity index 100% rename from packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/pack-move-eligibility-address.constants.js rename to packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/move-eligibility-address.constants.js diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/move-eligibility-address.controller.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/move-eligibility-address.controller.js new file mode 100644 index 000000000000..1242dbff5f0a --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/move-eligibility-address.controller.js @@ -0,0 +1,423 @@ +import assign from 'lodash/assign'; + +import { AUTHORIZED_ABBREVIATIONS } from './move-eligibility-address.constants'; +import { ELIGIBILITY_LINE_STATUS } from '../../pack-move.constant'; + +export default class { + /* @ngInject */ + constructor( + $scope, + $translate, + OvhApiConnectivityEligibility, + OvhApiConnectivityEligibilitySearch, + TucToast, + tucValidator, + ) { + this.$scope = $scope; + this.$translate = $translate; + this.OvhApiConnectivityEligibility = OvhApiConnectivityEligibility; + this.OvhApiConnectivityEligibilitySearch = OvhApiConnectivityEligibilitySearch; + this.TucToast = TucToast; + this.validator = tucValidator; + } + + $onInit() { + this.loaders = {}; + this.streets = []; + this.displaySearch = true; + } + + /** + * Search city from a zip code + * @param {String} zipcode Zip code + */ + getCities(zipCode) { + this.displaySearch = true; + this.cities = null; + this.address.city = null; + this.address.streetNumber = null; + this.address.street = null; + this.displayResult = false; + this.displaySearchResult = false; + this.offersChange({ + OFFERS: [], + }); + if (this.validator.tucIsZipcode(zipCode, ['metropolitanFrance'])) { + this.loaders.cities = true; + this.loading = true; + return this.OvhApiConnectivityEligibilitySearch.v6() + .searchCities(this.$scope, { zipCode }) + .then((cities) => { + this.cities = cities.result; + if (this.cities.length === 1) { + [this.address.city] = this.cities; + this.searchStreets(); + } + }) + .catch(() => { + this.TucToast.error( + this.$translate.instant('pack_move_eligibility_zipcode_error', { + zipCode, + }), + ); + }) + .finally(() => { + delete this.loaders.cities; + this.loading = false; + }); + } + + return null; + } + + searchStreets() { + this.address.street = null; + this.loadedStreets = []; + this.loaders.streets = true; + this.loading = true; + return this.OvhApiConnectivityEligibilitySearch.v6() + .searchStreets(this.$scope, { + inseeCode: this.address.city.inseeCode, + }) + .then((streets) => { + this.loadedStreets = streets.result; + return streets.result; + }) + .catch(() => { + this.TucToast.error( + this.$translate.instant('pack_move_eligibility_street_error', { + city: this.address.city, + }), + ); + }) + .finally(() => { + delete this.loaders.streets; + this.loading = false; + }); + } + + /** + * Propose streets from selected city + * @param {String} partial Part of the name of the street + * */ + getStreets(partial) { + this.streets = []; + const partialStreet = partial.replace(/^[\d\s,]*/, ''); + if ( + partialStreet.length > 2 || + AUTHORIZED_ABBREVIATIONS.includes(partialStreet) + ) { + this.loaders.streets = true; + this.loading = true; + + // Filter loaded streets list with partial name + this.streets = this.loadedStreets.filter((street) => + street.streetName.includes(partialStreet.toUpperCase()), + ); + delete this.loaders.streets; + this.loading = false; + } + + return this.streets; + } + + /** + * Check that the street name match with a street object + * @param {String} streetName Name of the street + * @returns {boolean} + */ + checkSelectedStreets(street) { + return ( + street && + this.streets.some(({ streetName }) => streetName === street.streetName) + ); + } + + /** + * Copper eligibility by address + */ + copperEligibilityByAddress() { + return this.OvhApiConnectivityEligibilitySearch.v6() + .searchLines(this.$scope, { + streetCode: this.address.street.streetCode, + streetNumber: this.address.streetNumber, + ownerName: this.address.owner, + }) + .then((data) => { + if (data.result.length > 0) { + const lines = { + isAvailableLines: true, + result: data.result, + }; + return lines; + } + return this.OvhApiConnectivityEligibility.v6().testAddress( + this.$scope, + { + streetCode: this.address.street.streetCode, + streetNumber: this.address.streetNumber, + }, + ); + }) + .then((res) => { + if (res.isAvailableLines) { + return res; + } + + const elig = { + isAvailableLines: false, + result: res.result, + }; + return elig; + }) + .catch((error) => { + this.loading = false; + this.TucToast.error(error); + }); + } + + /** + * Fiber eligibility by address + */ + fiberEligibilityByAddress() { + return this.OvhApiConnectivityEligibilitySearch.v6() + .searchBuildings(this.$scope, { + streetCode: this.address.street.streetCode, + streetNumber: this.address.streetNumber, + }) + .then((data) => { + if (data.result.length > 0) { + // Do an eligibility test on a building (fiber only) + const buildings = data.result; + const buildingsEligible = []; + buildings.forEach((building, index) => { + this.OvhApiConnectivityEligibility.v6() + .testBuilding(this.$scope, { + building: building.reference, + index, + }) + .then((elig) => { + return buildingsEligible.push(elig); + }); + }); + return buildingsEligible; + } + return null; + }) + .catch((error) => { + this.loading = false; + this.TucToast.error(error); + }); + } + + /** + * Launch eligibility by address + * - retrieve fiber eligibility by address + * - retrieve copper eligibility by address which can return lines associated to the address or nothing + * - if no line, retrieve the copper eligibility by address and send offers to create new line to this address + * - if lines, display them to the user + */ + submitAddress() { + this.displayResult = false; + this.availableLines = null; + this.loading = true; + this.fiber = null; + this.submited(); + + this.offersChange({ + OFFERS: [], + }); + + this.fiberEligibilityByAddress().then((fibers) => { + this.copperEligibilityByAddress().then((copper) => { + if (fibers && fibers.length > 0) { + this.checkFiberResult(fibers); + } else { + this.isFiberOffers = false; + } + + // Cooper result + if (copper.isAvailableLines) { + // Display inactive lines found for this address + this.availableLines = copper.result; + this.isAvailableLine = true; + this.displayResult = true; + this.displaySearchResult = true; + this.displaySearch = false; + this.loading = false; + } else { + this.sendLineOffers( + copper, + this.fiber, + 'address', + ELIGIBILITY_LINE_STATUS.create, + ); + this.displayResult = true; + this.displaySearchResult = true; + this.displaySearch = false; + this.loading = false; + } + }); + }); + } + + checkFiberResult(fibers) { + if (fibers.length === 1) { + const [fiber] = fibers; + this.fiber = { + eligibilityReferenceFiber: fiber.result.eligibilityReference, + fiberInfo: fiber.result.endpoint.fiberInfo, + referenceFiber: fiber.result.endpoint.reference, + referenceTypeFiber: fiber.result.endpoint.referenceType, + addressFiber: fiber.result.endpoint.address, + }; + + // Fiber result + const fiberOffers = fiber.result.offers.filter( + (offer) => offer.eligibility.eligible === true, + ); + if (fiberOffers.length > 0) { + this.fiber.offers = fiberOffers; + this.isFiberOffers = true; + } else { + this.isFiberOffers = false; + } + } else { + // Search offers eligible to fiber + fibers.forEach((fiber) => { + // Fiber result + const fiberOffers = fiber.result.offers.filter( + (offer) => offer.eligibility.eligible === true, + ); + if (fiberOffers.length > 0) { + this.fiber = { + eligibilityReferenceFiber: fiber.result.eligibilityReference, + fiberInfo: fiber.result.endpoint.fiberInfo, + referenceFiber: fiber.result.endpoint.reference, + referenceTypeFiber: fiber.result.endpoint.referenceType, + addressFiber: fiber.result.endpoint.address, + }; + this.fiber.offers = fiberOffers; + this.isFiberOffers = true; + } + return fiber; + }); + + // There is no offers eligible to fiber but there are fiber infos, + // initialize fiber with first value from table + if (!this.fiber) { + const [fiber] = fibers; + this.fiber = { + eligibilityReferenceFiber: fiber.result.eligibilityReference, + fiberInfo: fiber.result.endpoint.fiberInfo, + referenceFiber: fiber.result.endpoint.reference, + referenceTypeFiber: fiber.result.endpoint.referenceType, + addressFiber: fiber.result.endpoint.address, + }; + this.isFiberOffers = false; + } + } + } + + /** + * Create the offer response which is sent to the move-eligilibility controller + * @param { Object } copper copper eligibility result + * @param { Object } fiber fiber eligibility result + * @param { Object } eligType type of eligibility: 'address' | 'number' + * @param { Object } status status of the line: 'active' | 'inactive' | 'create' + */ + sendLineOffers(copper, fiber, eligType, status) { + const copperOffers = copper.result.offers.filter( + (offer) => offer.eligibility.eligible === true, + ); + const offer = { + eligType, + status, + eligibilityReference: copper.result.eligibilityReference, + offers: copperOffers, + endpoint: { + copperInfo: copper.result.endpoint.copperInfo, + portability: copper.result.endpoint.portability, + reference: copper.result.endpoint.reference, + referenceType: copper.result.endpoint.referenceType, + }, + }; + if (fiber) { + if (copper.result.endpoint.address !== fiber.addressFiber) { + assign(offer.endpoint, { + address: fiber.addressFiber, + neighbourAddress: copper.result.endpoint.address, + }); + } else { + assign(offer.endpoint, { + address: copper.result.endpoint.address, + }); + } + offer.buildingReference = fiber.fiberInfo.buildingReference; + } else { + assign(offer.endpoint, { + address: copper.result.endpoint.address, + }); + } + + if (this.isFiberOffers) { + offer.eligibilityReferenceFiber = fiber.eligibilityReferenceFiber; + offer.offers = [...copperOffers, ...fiber.offers]; + assign(offer.endpoint, { + fiberInfo: fiber.fiberInfo, + referenceFiber: fiber.referenceFiber, + referenceTypeFiber: fiber.referenceTypeFiber, + }); + } + this.offersChange({ + OFFERS: [offer], + }); + } + + createLine() { + this.loading = true; + return this.OvhApiConnectivityEligibility.v6() + .testAddress(this.$scope, { + streetCode: this.address.street.streetCode, + streetNumber: this.address.streetNumber, + }) + .then((res) => { + this.sendLineOffers( + res, + this.fiber, + 'address', + ELIGIBILITY_LINE_STATUS.create, + ); + this.displayResult = false; + return res; + }) + .catch((error) => { + this.TucToast.error(error); + }) + .finally(() => { + this.loading = false; + }); + } + + testLineEligibility(row) { + this.loading = true; + const lineNumber = row.lineNumber.replace(/[^0-9]/g, ''); + const { status } = row.copperInfo; + + return this.OvhApiConnectivityEligibility.v6() + .testLine(this.$scope, { + lineNumber, + status, + }) + .then((copper) => { + this.sendLineOffers(copper, this.fiber, 'number', status); + this.displayResult = false; + }) + .catch((error) => { + this.TucToast.error(error); + }) + .finally(() => { + this.loading = false; + }); + } +} diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/move-eligibility-address.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/move-eligibility-address.html new file mode 100644 index 000000000000..a321e3117b15 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/move-eligibility-address.html @@ -0,0 +1,272 @@ +
+
+ + + +
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+ + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + + + + + +
+
+ + +
+
diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/pack-move-eligibility-address.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/pack-move-eligibility-address.component.js deleted file mode 100644 index b2e20fd9cc04..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/pack-move-eligibility-address.component.js +++ /dev/null @@ -1,17 +0,0 @@ -import controller from './pack-move-eligibility-address.controller'; -import template from './pack-move-eligibility-address.html'; - -const component = { - bindings: { - address: '=?', - offersChange: '&', - submited: '&', - method: '=?', - }, - template, - controller, -}; - -export default component; - -angular.module('managerApp').component('packMoveEligibilityAddress', component); diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/pack-move-eligibility-address.controller.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/pack-move-eligibility-address.controller.js deleted file mode 100644 index fb3fbf18000a..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/pack-move-eligibility-address.controller.js +++ /dev/null @@ -1,187 +0,0 @@ -import assignIn from 'lodash/assignIn'; -import head from 'lodash/head'; -import isArray from 'lodash/isArray'; -import set from 'lodash/set'; -import sortBy from 'lodash/sortBy'; - -import { AUTHORIZED_ABBREVIATIONS } from './pack-move-eligibility-address.constants'; - -export default class { - /* @ngInject */ - constructor( - $filter, - $q, - $scope, - $stateParams, - $translate, - OvhApiXdslEligibility, - OvhApiPackXdslMove, - TucToast, - tucValidator, - costs, - ) { - this.$filter = $filter; - this.$q = $q; - this.$scope = $scope; - this.$stateParams = $stateParams; - this.$translate = $translate; - this.OvhApiXdslEligibility = OvhApiXdslEligibility; - this.OvhApiPackXdslMove = OvhApiPackXdslMove; - this.TucToast = TucToast; - this.validator = tucValidator; - this.costs = costs; - } - - $onInit() { - this.loaders = {}; - this.streets = []; - } - - /** - * Get city list from a zip code - * @param {String} zipcode Zip code - * */ - getCities(zipCode) { - this.cities = null; - this.address.city = null; - this.address.streetNumber = null; - this.address.street = null; - if (this.validator.tucIsZipcode(zipCode, ['metropolitanFrance'])) { - this.loaders.cities = true; - this.loading = true; - return this.OvhApiXdslEligibility.v6() - .getCities({ - zipCode, - }) - .$promise.then((cities) => { - this.cities = cities; - if (this.cities.length === 1) { - [this.address.city] = this.cities; - } - }) - .catch((error) => { - this.TucToast.error( - this.$translate.instant('pack_move_eligibility_zipcode_error', { - zipCode, - }), - ); - return this.$q.reject(error); - }) - .finally(() => { - delete this.loaders.cities; - this.loading = false; - }); - } - - return null; - } - - /** - * Propose streets from selected city - * @param {String} partial Part of the name of the street - * */ - getStreets(partial) { - this.streets = []; - const partialStreet = partial.replace(/^[\d\s,]*/, ''); - if ( - partialStreet.length > 2 || - AUTHORIZED_ABBREVIATIONS.includes(partialStreet) - ) { - this.loaders.streets = true; - this.loading = true; - return this.OvhApiXdslEligibility.v6() - .getStreets({ - inseeCode: this.address.city.inseeCode, - partialName: partialStreet, - }) - .$promise.then((streets) => { - this.streets = streets; - return streets; - }) - .catch((error) => { - this.TucToast.error( - this.$translate.instant('pack_move_eligibility_street_error', { - city: this.address.city, - }), - ); - return this.$q.reject(error); - }) - .finally(() => { - delete this.loaders.streets; - this.loading = false; - }); - } - - return this.streets; - } - - /** - * Check that the street name match with a street object - * @param {String} streetName Name of the street - * @returns {boolean} - */ - checkSelectedStreets(street) { - return street && this.streets.some(({ name }) => name === street.name); - } - - submitAddress() { - this.loading = true; - this.submited(); - - return this.OvhApiPackXdslMove.v6() - .pollElligibility(this.$scope, { - packName: this.$stateParams.packName, - address: this.address, - }) - .then((data) => { - if (data.error) { - this.offersChange({ OFFERS: [] }); - this.TucToast.error( - this.$translate.instant( - `pack_move_eligibility_address_error${ - data.error.includes('error_looking_for_neighbour_number') - ? '_neighbour' - : '_pairs' - }`, - ), - ); - return this.$q.reject(data.error); - } - if (data.result.offers.length) { - assignIn(this.testLine, data); - this.offers = isArray(data.result.offers) ? data.result.offers : []; - this.offers.forEach((offer) => { - set(offer, 'installationPrice', this.costs.packMove.lineCreation); - if (offer.meetingSlots) { - set(offer, 'meetingSlots.calendarData', [ - offer.meetingSlots.meetingSlots.map((slot) => ({ - tooltip: `${this.$filter('date')( - slot.startDate, - 'HH:mm', - )} - ${this.$filter('date')(slot.endDate, 'HH:mm')}`, - title: '', - start: slot.startDate, - end: slot.endDate, - data: slot, - })), - ]); - set( - offer, - 'meetingSlots.firstSlot', - head(sortBy(offer.meetingSlots.meetingSlots, ['startDate'])), - ); - } - }); - } - this.offersChange({ OFFERS: this.offers }); - return data; - }) - .catch((err) => { - this.TucToast.error(err); - return this.$q.reject(err); - }) - .finally(() => { - this.loading = false; - }); - } -} diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/pack-move-eligibility-address.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/pack-move-eligibility-address.html deleted file mode 100644 index 34ee11b935f3..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/address/pack-move-eligibility-address.html +++ /dev/null @@ -1,177 +0,0 @@ -
-
- - -
-
- - -
-
- - -
-
- - -
- - - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
- - - -
-
diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/index.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/index.js new file mode 100644 index 000000000000..ec0229af83a8 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/index.js @@ -0,0 +1,24 @@ +import angular from 'angular'; + +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; +import uiRouter from '@uirouter/angularjs'; +import angularTranslate from 'angular-translate'; + +import eligibility from './move-eligibility.component'; + +import eligibilityAddress from './address'; +import eligibilityLineNumber from './lineNumber'; + +const moduleName = 'ovhManagerTelecomPackMoveEligibility'; + +angular + .module(moduleName, [ + ngTranslateAsyncLoader, + uiRouter, + angularTranslate, + eligibilityAddress, + eligibilityLineNumber, + ]) + .component('packMoveEligibility', eligibility); + +export default moduleName; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/index.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/index.js new file mode 100644 index 000000000000..9f7d90ac304b --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/index.js @@ -0,0 +1,15 @@ +import angular from 'angular'; + +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; +import uiRouter from '@uirouter/angularjs'; +import angularTranslate from 'angular-translate'; + +import eligibilityLineNumber from './move-eligibility-lineNumber.component'; + +const moduleName = 'ovhManagerTelecomPackMoveEligibilityLineNumber'; + +angular + .module(moduleName, [ngTranslateAsyncLoader, uiRouter, angularTranslate]) + .component('packMoveEligibilityLineNumber', eligibilityLineNumber); + +export default moduleName; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/move-eligibility-lineNumber.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/move-eligibility-lineNumber.component.js new file mode 100644 index 000000000000..9f0557a2dfda --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/move-eligibility-lineNumber.component.js @@ -0,0 +1,14 @@ +import controller from './move-eligibility-lineNumber.controller'; +import template from './move-eligibility-lineNumber.html'; + +export default { + bindings: { + offers: '=?', + offersChange: '&', + submited: '&', + method: '=?', + packName: '<', + }, + controller, + template, +}; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/move-eligibility-lineNumber.controller.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/move-eligibility-lineNumber.controller.js new file mode 100644 index 000000000000..3dcfff3a4cd1 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/move-eligibility-lineNumber.controller.js @@ -0,0 +1,156 @@ +import { ELIGIBILITY_LINE_STATUS } from '../../pack-move.constant'; + +export default class { + /* @ngInject */ + constructor( + $scope, + OvhApiConnectivityEligibility, + OvhApiConnectivityEligibilitySearch, + TucToast, + ) { + this.$scope = $scope; + this.OvhApiConnectivityEligibility = OvhApiConnectivityEligibility; + this.OvhApiConnectivityEligibilitySearch = OvhApiConnectivityEligibilitySearch; + this.TucToast = TucToast; + } + + $onInit() { + this.checkLine = { + lineNumber: '', + }; + this.phoneNumberRegex = '^0[1-5]([\\s\\-]?([0-9]){2}){4}$'; + } + + /** + * Retrieve eligibility (copper and fiber) for the line number + * @param { String } lineNumber phone number to check eligibility + * @param { String } status status of the line: 'active' | 'inactive' + */ + eligibilityByNumber(lineNumber, status) { + // First copper eligibility by number + return this.OvhApiConnectivityEligibility.v6() + .testLine(this.$scope, { + lineNumber, + status, + }) + .then((copper) => { + if (copper.status === 'error') { + const offer = { + eligType: 'number', + status, + eligibilityReference: '', + endpoint: '', + offers: '', + errorMessage: copper.error, + }; + return offer; + } + // Second fiber eligibility by number + return this.fiberEligibilityByNumber(lineNumber, status).then( + (fiber) => { + const copperOffers = copper.result.offers.filter( + (offer) => offer.eligibility.eligible === true, + ); + const offer = { + eligType: 'number', + status, + eligibilityReference: copper.result.eligibilityReference, + endpoint: copper.result.endpoint, + offers: copperOffers, + errorMessage: '', + }; + if (fiber) { + const fiberOffers = fiber.result.offers.filter( + (el) => el.eligibility.eligible === true, + ); + if (fiberOffers.length > 0) { + offer.offers = [...copperOffers, ...fiberOffers]; + offer.eligibilityReferenceFiber = + fiber.result.eligibilityReference; + offer.endpoint.fiberInfo = fiber.result.endpoint.fiberInfo; + offer.endpoint.referenceFiber = fiber.result.endpoint.reference; + offer.endpoint.referenceTypeFiber = + fiber.result.endpoint.referenceType; + } + offer.buildingReference = + fiber.result.endpoint.fiberInfo.buildingReference; + } + return offer; + }, + ); + }) + .catch((error) => { + this.loading = false; + this.TucToast.error(error); + }); + } + + fiberEligibilityByNumber(lineNumber, status) { + return this.OvhApiConnectivityEligibilitySearch.v6() + .searchBuildingByLines(this.$scope, { + lineNumber, + status, + }) + .then((data) => { + if (data.result.length > 0) { + // Do an eligibility test on a building (fiber only) + const [building] = data.result; + return this.OvhApiConnectivityEligibility.v6() + .testBuilding(this.$scope, { + building: building.reference, + }) + .then((elig) => { + return elig; + }) + .catch((error) => { + this.loading = false; + this.TucToast.error(error); + }); + } + return null; + }) + .catch((error) => { + this.loading = false; + this.TucToast.error(error); + }); + } + + testLineEligibility() { + this.loading = true; + this.offersChange({ OFFERS: [] }); + this.lineNumber = this.checkLine.lineNumber.replace(/[^0-9]/g, ''); + this.submited(); + + this.eligibilityByNumber( + this.lineNumber, + ELIGIBILITY_LINE_STATUS.active, + ).then((activeOffers) => { + if (activeOffers.errorMessage) { + this.eligibilityByNumber( + this.lineNumber, + ELIGIBILITY_LINE_STATUS.inactive, + ).then((inactiveOffers) => { + if (!inactiveOffers.errorMessage) { + this.offersChange({ + OFFERS: [inactiveOffers], + }); + } else { + const noOffer = { + eligType: 'number', + errorMessage: 'pack_move_eligibility_line_no_offers', + }; + this.offersChange({ + OFFERS: [noOffer], + }); + } + this.loading = false; + }); + } else { + this.offersChange({ + OFFERS: [activeOffers], + }); + this.loading = false; + } + }); + } +} diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/move-eligibility-lineNumber.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/move-eligibility-lineNumber.html new file mode 100644 index 000000000000..e0906df16166 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/move-eligibility-lineNumber.html @@ -0,0 +1,44 @@ +
+
+ + + + + + + +
+ + + +
diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/pack-move-eligibility-lineNumber.controller.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/pack-move-eligibility-lineNumber.controller.js deleted file mode 100644 index 82ebf1ea3e66..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/pack-move-eligibility-lineNumber.controller.js +++ /dev/null @@ -1,93 +0,0 @@ -import assignIn from 'lodash/assignIn'; -import head from 'lodash/head'; -import isArray from 'lodash/isArray'; -import set from 'lodash/set'; -import sortBy from 'lodash/sortBy'; - -angular.module('managerApp').component('packMoveEligibilityLineNumber', { - bindings: { - offers: '=?', - offersChange: '&', - submited: '&', - method: '=?', - }, - templateUrl: - 'app/telecom/pack/move/eligibility/lineNumber/pack-move-eligibility-lineNumber.html', - controllerAs: 'PackMoveEligibilityPhoneNumber', - controller( - $scope, - $stateParams, - $filter, - $translate, - TucToastError, - TucToast, - OvhApiPackXdslMove, - ) { - const self = this; - this.phoneNumberRegex = '^0[1-5]([\\s\\-]?([0-9]){2}){4}$'; - - this.updateLineAccessibility = function updateLineAccessibility() { - this.loading = true; - this.lineNumber = self.testLine.lineNumber.replace(/[^0-9]/g, ''); - self.submited(); - return OvhApiPackXdslMove.v6() - .pollElligibility($scope, { - packName: $stateParams.packName, - lineNumber: self.lineNumber, - }) - .then( - (data) => { - if (data.error) { - self.offersChange({ OFFERS: [] }); - return new TucToastError(data, data.error); - } - if (angular.isDefined(data.result.offers)) { - assignIn(self.testLine, data); - self.offers = isArray(data.result.offers) - ? data.result.offers - : []; - - if (self.offers.length === 0) { - TucToast.error( - $translate.instant('pack_move_eligibility_no_offers', { - number: self.lineNumber, - }), - ); - } - } - self.offers.forEach((offer) => { - set(offer, 'lineNumber', self.lineNumber); - if (offer.meetingSlots) { - set(offer, 'meetingSlots.calendarData', [ - offer.meetingSlots.meetingSlots.map((slot) => ({ - tooltip: [ - $filter('date')(slot.startDate, 'HH:mm'), - $filter('date')(slot.endDate, 'HH:mm'), - ].join(' - '), - title: '', - start: slot.startDate, - end: slot.endDate, - data: slot, - })), - ]); - set( - offer, - 'meetingSlots.firstSlot', - head(sortBy(offer.meetingSlots.meetingSlots, ['startDate'])), - ); - } - }); - self.offersChange({ OFFERS: self.offers }); - return data; - }, - () => - new TucToastError( - $translate.instant('pack_move_eligibility_error'), - ), - ) - .finally(() => { - self.loading = false; - }); - }; - }, -}); diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/pack-move-eligibility-lineNumber.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/pack-move-eligibility-lineNumber.html deleted file mode 100644 index e1a5916c4800..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/lineNumber/pack-move-eligibility-lineNumber.html +++ /dev/null @@ -1,53 +0,0 @@ -
-
- - - - - - -
- - - -
diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/move-eligibility.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/move-eligibility.component.js new file mode 100644 index 000000000000..899a9acccc7c --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/move-eligibility.component.js @@ -0,0 +1,15 @@ +import controller from './move-eligibility.controller'; +import template from './move-eligibility.html'; + +export default { + controller, + template, + bindings: { + offers: '=?', + offersChange: '&', + submited: '&', + method: '=?', + packName: '<', + testLine: '<', + }, +}; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/move-eligibility.controller.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/move-eligibility.controller.js new file mode 100644 index 000000000000..54ffafa9a8d4 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/move-eligibility.controller.js @@ -0,0 +1,55 @@ +import { ELIGIBILITY_LINE_STATUS } from '../pack-move.constant'; + +export default class MoveEligibilityCtrl { + /* @ngInject */ + constructor($scope, $translate) { + this.$scope = $scope; + this.$translate = $translate; + } + + $onInit() { + this.displayEligibility = false; + this.minDate = moment().format('YYYY-MM-DD'); + this.maxDate = moment() + .add(30, 'day') + .format('YYYY-MM-DD'); + } + + /** + * Compute the offers + * @param offers + */ + computeOffer(offers) { + if (offers) { + this.displayEligibility = true; + this.lines = offers; + } + } + + getTitle(status) { + let label = ''; + switch (status) { + case ELIGIBILITY_LINE_STATUS.active: + label = 'pack_move_eligibility_line_status_active'; + break; + case ELIGIBILITY_LINE_STATUS.inactive: + label = 'pack_move_eligibility_line_status_inactive'; + break; + case ELIGIBILITY_LINE_STATUS.create: + label = 'pack_move_eligibility_line_status_create'; + break; + default: + label = 'pack_move_eligibility_line_unknown_status'; + break; + } + return this.$translate.instant(label); + } + + chooseLine(line) { + const selected = { + line, + moveOutDate: this.moveOutDate, + }; + this.$scope.$emit('eligibleSelectedLine', selected); + } +} diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/move-eligibility.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/move-eligibility.html new file mode 100644 index 000000000000..421a4e2b68e9 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/eligibility/move-eligibility.html @@ -0,0 +1,157 @@ +
+ + + + +
+ +

+
+
+ + + + + + +
+
+ + + + + + +
+
+ + +
+
+ +
+
+
+
+ +
+ + +
+ + +
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + + +
+
+
+
diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/index.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/index.js new file mode 100644 index 000000000000..01b58968573a --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/index.js @@ -0,0 +1,41 @@ +import angular from 'angular'; + +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; +import uiRouter from '@uirouter/angularjs'; +import angularTranslate from 'angular-translate'; + +import moveAddress from './address'; +import moveBuildingDetails from './building-details'; +import moveEligibility from './eligibility'; +import moveMeeting from './meeting'; +import moveOffers from './offers'; +import moveResume from './resume'; +import moveServiceDelete from './service-delete'; +import moveShipping from './shipping'; +import moveUnbundling from './unbundling'; + +import component from './pack-move.component'; +import routing from './pack-move.routing'; + +const moduleName = 'ovhManagerTelecomPackMove'; + +angular + .module(moduleName, [ + ngTranslateAsyncLoader, + uiRouter, + angularTranslate, + moveAddress, + moveBuildingDetails, + moveEligibility, + moveMeeting, + moveOffers, + moveResume, + moveServiceDelete, + moveShipping, + moveUnbundling, + ]) + .component('packMove', component) + .config(routing) + .run(/* @ngTranslationsInject:json ./translations */); + +export default moduleName; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/meeting/index.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/meeting/index.js new file mode 100644 index 000000000000..5a4571a5eb20 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/meeting/index.js @@ -0,0 +1,15 @@ +import angular from 'angular'; + +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; +import uiRouter from '@uirouter/angularjs'; +import angularTranslate from 'angular-translate'; + +import meeting from './move-meeting.component'; + +const moduleName = 'ovhManagerTelecomPackMoveMeeting'; + +angular + .module(moduleName, [ngTranslateAsyncLoader, uiRouter, angularTranslate]) + .component('packMoveMeeting', meeting); + +export default moduleName; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/meeting/move-meeting.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/meeting/move-meeting.component.js new file mode 100644 index 000000000000..fa80ef4be1e3 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/meeting/move-meeting.component.js @@ -0,0 +1,11 @@ +import controller from './move-meeting.controller'; +import template from './move-meeting.html'; + +export default { + controller, + template, + bindings: { + productCode: '<', + eligibilityReference: '<', + }, +}; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/meeting/move-meeting.controller.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/meeting/move-meeting.controller.js new file mode 100644 index 000000000000..eeafb2be72ae --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/meeting/move-meeting.controller.js @@ -0,0 +1,144 @@ +import get from 'lodash/get'; + +export default class MoveMeetingCtrl { + /* @ngInject */ + constructor( + $scope, + $translate, + OvhApiConnectivityEligibilitySearch, + TucToast, + ) { + this.$scope = $scope; + this.$translate = $translate; + this.OvhApiConnectivityEligibilitySearch = OvhApiConnectivityEligibilitySearch; + this.TucToast = TucToast; + } + + $onInit() { + this.offer = { + meetingSlots: { + fakeMeeting: false, + slot: null, + }, + selected: { + contactName: null, + }, + }; + + this.showMeetingSlots = false; + this.meetingSlots = {}; + + this.loading = true; + this.meetings = []; + return this.OvhApiConnectivityEligibilitySearch.v6() + .searchMeetings(this.$scope, { + eligibilityReference: this.eligibilityReference, + productCode: this.productCode, + }) + .then((data) => { + if (data.result) { + this.meetingSlots.canBookFakeMeeting = data.result.canBookFakeMeeting; + this.meetingSlots.slots = data.result.meetingSlots; + + let slots = []; + let prevTitle; + data.result.meetingSlots.forEach((slot, index) => { + const title = moment(slot.startDate) + .utc() + .format('ddd DD MMM YYYY'); + if (!prevTitle) { + prevTitle = title; + slots.push({ + id: index, + start: slot.startDate, + end: slot.endDate, + startTime: moment(slot.startDate) + .utc() + .format('HH:mm'), + endTime: moment(slot.endDate) + .utc() + .format('HH:mm'), + selected: false, + }); + } else if (prevTitle !== title) { + this.meetings.push({ + title: prevTitle, + slots, + }); + slots = []; + slots.push({ + id: index, + start: slot.startDate, + end: slot.endDate, + startTime: moment(slot.startDate) + .utc() + .format('HH:mm'), + endTime: moment(slot.endDate) + .utc() + .format('HH:mm'), + selected: false, + }); + prevTitle = title; + } else { + slots.push({ + id: index, + start: slot.startDate, + end: slot.endDate, + startTime: moment(slot.startDate) + .utc() + .format('HH:mm'), + endTime: moment(slot.endDate) + .utc() + .format('HH:mm'), + selected: false, + }); + } + }); + this.showMeetingSlots = true; + this.meetingSelectMessage = ''; + } + }) + .catch((error) => { + this.TucToast.error( + `${this.$translate.instant('pack_move_meeting_error')} ${get( + error, + 'data.message', + '', + )}`, + ); + }) + .finally(() => { + this.loading = false; + }); + } + + checkConfirm() { + const checkContact = !!this.contactName; + const checkSlot = this.offer.meetingSlots.slot !== null; + return !(checkContact && checkSlot); + } + + selectSlot(slotId) { + this.offer.meetingSlots.fakeMeeting = this.meetingSlots.canBookFakeMeeting; + this.offer.meetingSlots.slot = this.meetingSlots.slots[slotId]; + + const day = moment(this.offer.meetingSlots.slot.startDate).format( + 'DD/MM/YYYY', + ); + const start = moment(this.offer.meetingSlots.slot.startDate) + .utc() + .format('HH:mm'); + const end = moment(this.offer.meetingSlots.slot.endDate) + .utc() + .format('HH:mm'); + this.meetingSelectMessage = this.$translate.instant( + 'pack_move_programmed_meeting', + { day, start, end }, + ); + } + + next() { + this.offer.selected.contactName = this.contactName; + this.$scope.$emit('selectMeeting', this.offer); + } +} diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/meeting/move-meeting.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/meeting/move-meeting.html new file mode 100644 index 000000000000..9424976b0864 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/meeting/move-meeting.html @@ -0,0 +1,133 @@ +

+ +
+ +
+ +
+
+
+ +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ + +
+
+
+
+
+
+ +
+
+ +
+
+
+
+ + {{slot.startTime}} - {{slot.endTime}} + +
+
+
+
+
+ + + +
diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/offer/pack-move-offer.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/offer/pack-move-offer.component.js deleted file mode 100644 index 87ca664323d3..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/offer/pack-move-offer.component.js +++ /dev/null @@ -1,39 +0,0 @@ -angular.module('managerApp').component('packMoveOffer', { - bindings: { - offerModel: '=?', - offer: '=?', - change: '&', - }, - templateUrl: 'app/telecom/pack/move/offer/pack-move-offer.html', - controllerAs: 'PackMoveOffer', - controller() { - const self = this; - - this.KbPerMb = 1024; - - this.changeOffer = function changeOffer() { - this.change({ OFFER: self.offer }); - }; - - this.$onInit = function $onInit() { - Object.defineProperties(self.offer, { - _patternReseller: { - enumerable: false, - configurable: false, - writable: false, - value: /reseller/i, - }, - isResellerOffer: { - enumerable: true, - configurable: false, - get() { - return this._patternReseller.test(this.offerCode); - }, - set() { - throw new Error('isResellerOffer is a read only property'); - }, - }, - }); - }; - }, -}); diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/offer/pack-move-offer.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/offer/pack-move-offer.html deleted file mode 100644 index 56d7d4e69c8d..000000000000 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/offer/pack-move-offer.html +++ /dev/null @@ -1,107 +0,0 @@ -
-
- -
-
diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/offers/index.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/offers/index.js new file mode 100644 index 000000000000..0a54919781ee --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/offers/index.js @@ -0,0 +1,15 @@ +import angular from 'angular'; + +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; +import uiRouter from '@uirouter/angularjs'; +import angularTranslate from 'angular-translate'; + +import moveOffers from './move-offers.component'; + +const moduleName = 'ovhManagerTelecomPackMoveOffers'; + +angular + .module(moduleName, [ngTranslateAsyncLoader, uiRouter, angularTranslate]) + .component('packMoveOffers', moveOffers); + +export default moduleName; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/offers/move-offers.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/offers/move-offers.component.js new file mode 100644 index 000000000000..3dd61a12aa49 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/offers/move-offers.component.js @@ -0,0 +1,13 @@ +import controller from './move-offers.controller'; +import template from './move-offers.html'; + +export default { + controller, + template, + bindings: { + eligibilityReference: '<', + eligibilityReferenceFiber: '<', + packName: '<', + currentOffer: '<', + }, +}; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/offers/move-offers.controller.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/offers/move-offers.controller.js new file mode 100644 index 000000000000..9fe0ff555629 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/offers/move-offers.controller.js @@ -0,0 +1,185 @@ +import find from 'lodash/find'; +import isUndefined from 'lodash/isUndefined'; +import set from 'lodash/set'; + +export default class PackMoveOffersCtrl { + /* @ngInject */ + constructor( + $q, + $scope, + $translate, + OvhApiPackXdsl, + OvhApiPackXdslMove, + TucToast, + ) { + this.$q = $q; + this.$scope = $scope; + this.$translate = $translate; + this.OvhApiPackXdsl = OvhApiPackXdsl; + this.OvhApiPackXdslMove = OvhApiPackXdslMove; + this.TucToast = TucToast; + } + + $onInit() { + this.loading = { + init: true, + }; + + this.$q + .all([this.getOptions(), this.getCopperOffers()]) + .then(() => { + return this.getFiberOffers(); + }) + .then(() => { + if (this.eligibilityReferenceFiber) { + this.offers = [...this.listOffers, ...this.listOffersFiber]; + } else { + this.offers = [...this.listOffers]; + } + }) + .finally(() => { + this.loading.init = false; + }); + } + + /** + * Get available options + */ + getOptions() { + return this.OvhApiPackXdsl.v6() + .getServices({ + packId: this.packName, + }) + .$promise.then((options) => { + this.currentOffer.options = options; + }) + .catch((error) => { + this.TucToast.error( + this.$translate.instant('pack_move_choose_offer_error', { + error, + }), + ); + }); + } + + getCopperOffers() { + return this.OvhApiPackXdslMove.v6() + .pollOffers(this.$scope, { + packName: this.packName, + eligibilityReference: this.eligibilityReference, + }) + .then((offers) => { + if (offers.status === 'error') { + this.TucToast.error( + this.$translate.instant('pack_move_choose_offer_error', { + error: offers.error, + }), + ); + } else { + this.listOffers = offers.result.offers; + } + return this.listOffers; + }) + .catch((error) => { + this.TucToast.error( + this.$translate.instant('pack_move_choose_offer_error', { + error, + }), + ); + }); + } + + getFiberOffers() { + if (!this.eligibilityReferenceFiber) { + return null; + } + + return this.OvhApiPackXdslMove.v6() + .pollOffers(this.$scope, { + packName: this.packName, + eligibilityReference: this.eligibilityReferenceFiber, + }) + .then((fiberOffers) => { + if (fiberOffers === 'error') { + this.TucToast.error( + this.$translate.instant('pack_move_choose_offer_error', { + error: fiberOffers.error, + }), + ); + } else { + this.listOffersFiber = fiberOffers.result.offers; + } + return this.listOffersFiber; + }) + .catch((error) => { + this.TucToast.error( + this.$translate.instant('pack_move_choose_offer_error', { + error, + }), + ); + }); + } + + /** + * Check if option to display is available + * @param {*} offer offer to check + * @param {*} optionName option to display + */ + static isOptionAvailable(offer, optionName) { + return !!find(offer.options, (option) => option.name === optionName); + } + + /** + * Check if there are subservices to delete + */ + hasOfferWithSubServicesToDelete() { + this.offers.forEach((offer) => { + let total = 0; + const udpateOffer = offer; + offer.subServicesToDelete.forEach((service) => { + total += service.numberToDelete; + return total; + }); + udpateOffer.totalSubServiceToDelete = total; + return udpateOffer; + }); + return !!find(this.offers, (offer) => offer.totalSubServiceToDelete > 0); + } + + static updateOfferDisplayedPrice(value, offer, optionName) { + let totalOfferPrice = offer.prices.price.price + ? offer.prices.price.price.value + : 0; + + offer.options.forEach((option) => { + if (option.name === 'gtr_ovh' && option.selected) { + totalOfferPrice += option.optionalPrice.value; + } else if (option.name === optionName) { + totalOfferPrice += value * option.optionalPrice.value; + } else if ( + option.name !== 'gtr_ovh' && + !isUndefined(option.choosedValue) + ) { + totalOfferPrice += option.choosedValue * option.optionalPrice.value; + } + }); + + const displayedPrice = { + currencyCode: offer.prices.price.price + ? offer.prices.price.price.currencyCode + : 'EUR', + text: offer.prices.price.price + ? offer.prices.price.price.text.replace( + /\d+(?:[.,]\d+)?/, + totalOfferPrice.toFixed(2), + ) + : totalOfferPrice.toFixed(2), + value: totalOfferPrice, + }; + set(offer, 'displayedPrice', displayedPrice); + } + + selectOffer(offer) { + this.$scope.$emit('offerSelected', offer); + } +} diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/offers/move-offers.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/offers/move-offers.html new file mode 100644 index 000000000000..a977b3a3e16e --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/offers/move-offers.html @@ -0,0 +1,741 @@ +
+
+ +
+ +
+ + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+
+ +
+
+ / + + + +
+ / + + +
+ + + + / + + + +
+ + + +
+
+ + + + +
+
+ + +
+
+
+ + +
+ + + + + + +
+
+
+ + +
+ + + +
+
+ + + + +
+
+ + +
+
+ + +
+ + + + + + +
+
+ + +
+ + + +
+
+ + + + +
+
+ + +
+
+ + +
+ + +
+ + + +
+
+ + + + +
+
+ + +
+
+
+ + +
+ + + + + + +
+
+
+ + +
+ + + +
+
+ + + + +
+
+ + +
+
+
+ + +
+ + + + + + +
+
+
+ + +
+ + + + + + +
+
+ + + +
+
+ + +
+ +
+
+
+
+
diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.component.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.component.js new file mode 100644 index 000000000000..b570ed99d54d --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.component.js @@ -0,0 +1,11 @@ +import controller from './pack-move.controller'; +import template from './pack-move.html'; + +export default { + controller, + template, + bindings: { + packName: '<', + goBack: '<', + }, +}; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.constant.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.constant.js new file mode 100644 index 000000000000..102d85de4567 --- /dev/null +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.constant.js @@ -0,0 +1,34 @@ +const ELIGIBILITY_LINE_STATUS = { + active: 'active', + create: 'create', + inactive: 'inactive', +}; + +const LINE_STATUS = { + slamming: 'slamming', +}; + +const OFFER_TYPE = { + adsl: 'ADSL', + sdsl: 'SDSL', + ftth: 'FTTH', +}; + +const STEPS = { + eligibility: 'eligibility', + offers: 'offers', + unbundling: 'unbundling', + saveNumber: 'saveNumber', + buildingDetails: 'buildingDetails', + serviceDelete: 'serviceDelete', + shipping: 'shipping', + meeting: 'meeting', + resume: 'resume', +}; + +const UNBUNDLING = { + partial: 'partial', + total: 'full', +}; + +export { ELIGIBILITY_LINE_STATUS, LINE_STATUS, OFFER_TYPE, STEPS, UNBUNDLING }; diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.controller.js b/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.controller.js index d8bf9bebca02..8e22b24e1cdc 100644 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.controller.js +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.controller.js @@ -1,41 +1,48 @@ import chunk from 'lodash/chunk'; -import assignIn from 'lodash/assignIn'; import filter from 'lodash/filter'; import flatten from 'lodash/flatten'; import head from 'lodash/head'; import map from 'lodash/map'; -import set from 'lodash/set'; -angular - .module('managerApp') - .controller('PackMoveCtrl', function PackMoveCtrl( +import { + ELIGIBILITY_LINE_STATUS, + LINE_STATUS, + OFFER_TYPE, + STEPS, +} from './pack-move.constant'; + +export default class PackMoveCtrl { + /* @ngInject */ + constructor( + $q, $scope, - $compile, - $state, - $timeout, $translate, - $uibModal, - $filter, - $q, - $stateParams, - REDIRECT_URLS, + OvhApiXdsl, + OvhApiPackXdsl, OvhApiPackXdslMove, - Poller, + OvhApiPackXdslTask, TucToast, TucToastError, - OvhApiPackXdslTask, - OvhApiPackXdsl, - OvhApiXdsl, - uiCalendarConfig, - tucValidator, ) { - const self = this; - self.validator = tucValidator; - const taskMovePendingName = 'pendingAddressMove'; - self.moveValidationPending = false; + this.$scope = $scope; + this.$q = $q; + this.$translate = $translate; + this.OvhApiPackXdslMove = OvhApiPackXdslMove; + this.TucToast = TucToast; + this.TucToastError = TucToastError; + this.OvhApiPackXdslTask = OvhApiPackXdslTask; + this.OvhApiPackXdsl = OvhApiPackXdsl; + this.OvhApiXdsl = OvhApiXdsl; + } + + $onInit() { + this.taskMovePendingName = 'pendingAddressMove'; + this.moveValidationPending = false; + this.moveStep = STEPS.eligibility; + + this.steps = STEPS; this.operationAlreadyPending = false; - this.packName = $stateParams.packName; this.packAdress = { loading: false, @@ -51,19 +58,6 @@ angular this.method = 'number'; - this.form = { - futureLandline: { - lineNumber: null, - keepLineNumber: false, - rio: null, - }, - currentLandline: { - lineNumber: null, - portLineNumber: true, - }, - offerCode: null, - }; - this.offer = { available: [], current: { @@ -72,460 +66,250 @@ angular selected: null, }; - /** - * Calendar configuration - */ - this.calendarConfig = { - selectable: true, - timeFormat: 'HH:mm', - displayEventEnd: true, - header: { - left: 'title', - center: '', - right: 'prev,next', - }, - eventClick(slot) { - set(slot, 'display', { - day: $filter('date')(slot.data.startDate, 'dd/MM/yyyy'), - start: $filter('date')(slot.data.startDate, 'HH:mm'), - end: $filter('date')(slot.data.endDate, 'HH:mm'), - }); - self.offer.meetingSlots.slot = slot; - uiCalendarConfig.calendars.mainCalendar.fullCalendar('rerenderEvents'); - }, - eventRender(slot, element) { - const classNames = ['ovh-pack-move-event']; - if ( - self.offer.meetingSlots.slot && - self.offer.meetingSlots.slot._id === slot._id - ) { - classNames.push('selected'); - } - element.attr({ - class: classNames.join(' '), - }); - }, - eventAfterAllRender() { - if ( - uiCalendarConfig.calendars && - uiCalendarConfig.calendars.mainCalendar && - !self.offer.meetingSlots.slot - ) { - uiCalendarConfig.calendars.mainCalendar.fullCalendar( - 'gotoDate', - self.offer.selected.meetingSlots.firstSlot.startDate, - ); - } - }, + this.packAddress = { + loading: true, }; + this.loading = true; + this.$q + .all([ + this.isSlammingLine(), + this.updateOperationAlreadyPending(), + this.updateIsLegacyOffer(), + this.getCurrentPackAddress(), + this.getCurrentContactOwner(), + ]) + .finally(() => { + this.loading = false; + }); - /** - * Move the pack ! - * The post need the poll of the task (by repost), - * this made by recursive call of this function - * - * @returns {void} - */ - function moveThePack(moveDataParam) { - let moveData = moveDataParam; - if (!moveData) { - moveData = { - keepCurrentNumber: self.form.currentLandline.portLineNumber, - offerCode: self.offer.selected.offerCode, - provider: self.offer.selected.provider, - }; - if (self.offer.selected.lineNumber) { - moveData.landline = { - lineNumber: self.offer.selected.lineNumber, - portLineNumber: self.form.futureLandline.keepLineNumber, - rio: tucValidator.tucIsRio( - self.form.futureLandline.rio, - self.form.futureLandline.lineNumber, - ) - ? self.form.futureLandline.rio.toUpperCase() - : undefined, - status: self.offer.selected.lineStatus, - unbundling: self.offer.selected.unbundling, - }; - } else { - moveData.creation = { - address: self.offer.selected.address, - meeting: { - fakeMeeting: self.offer.meetingSlots.fakeMeeting, - name: self.offer.selected.contactName, - meetingSlot: !self.offer.meetingSlots.fakeMeeting - ? self.offer.meetingSlots.slot.data - : undefined, - }, - }; - } - - // The post data need to be sealed for to be exactly the same at each post - moveData = angular.copy(moveData); - - self.moveValidationPending = true; + this.$scope.$on('eligibleSelectedLine', (event, selected) => { + this.moveStep = STEPS.offers; + this.selectedLine = selected.line; + this.eligibilityReference = selected.line.eligibilityReference; + this.eligibilityReferenceFiber = selected.line.eligibilityReferenceFiber; + this.offer.selected = { + address: selected.line.endpoint.address, + portability: selected.line.endpoint.portability, + copperInfo: selected.line.endpoint.copperInfo, + moveOutDate: selected.moveOutDate, + contactOwner: this.contactOwner, + }; + if (this.selectedLine.status === ELIGIBILITY_LINE_STATUS.create) { + this.offer.selected.futureLineNumber = null; + this.isNewLine = true; + } else { + this.offer.selected.futureLineNumber = selected.line.endpoint.reference; + this.isNewLine = false; } + }); - OvhApiPackXdslMove.v6() - .move( - { - packName: $stateParams.packName, - }, - moveData, - ) - .$promise.then( - (data) => { - switch (data.status) { - case 'pending': - $timeout(() => { - moveThePack(moveData); - }, 1000); - break; - - case 'error': - $translate('pack_move_cannot_validate_move', { - message: data.error, - }).then((translation) => { - TucToast.error(translation, { hideAfter: false }); - }); - - self.moveValidationError = true; - self.moveValidationPending = false; - self.moveValidationSuccess = false; - break; - - default: - $timeout(() => { - $state.go('telecom.packs.pack', { - packName: $stateParams.packName, - }); - }, 3000); - - self.moveValidationError = false; - self.moveValidationPending = false; - self.moveValidationSuccess = true; - break; - } - }, - (err) => { - const message = []; - - if (err) { - if (err.statusText) { - message.push(err.statusText); - } - - if (err.data && err.data.message) { - message.push(err.data.message); - } - } - - $translate('pack_move_cannot_validate_move', { - message: message.join(' '), - }).then((translation) => { - TucToast.error(translation, { hideAfter: false }); - }); - - self.moveValidationPending = false; - }, - ); - } - - /** - * Open the confirm model and then launch the move - */ - this.openConfirmModal = function openConfirmModal() { - if (self.moveValidationError) { - self.moveValidationError = false; - return; + this.$scope.$on('offerSelected', (event, offerSelected) => { + this.offer.selected.offer = offerSelected; + this.offersEligible = this.selectedLine.offers.filter((offer) => + offerSelected.productCodes.includes(offer.product.code), + ); + const offerFTTH = this.offersEligible.find( + (offer) => offer.product.type === OFFER_TYPE.ftth, + ); + this.isOfferFTTH = !!offerFTTH; + this.offer.selected.eligibilityReference = this.eligibilityReference; + this.offer.selected.product = this.offersEligible[0].product; + this.offer.selected.isOfferFTTH = this.isOfferFTTH; + if (this.isOfferFTTH) { + this.moveStep = STEPS.saveNumber; + this.offer.selected.productCode = this.offersEligible[0].product.code; + this.offer.selected.eligibilityReference = this.eligibilityReferenceFiber; + } else if (this.offersEligible.length > 1) { + this.moveStep = STEPS.unbundling; + } else { + this.moveStep = STEPS.saveNumber; + this.offer.selected.productCode = this.offersEligible[0].product.code; } - - const modal = $uibModal.open({ - animation: true, - templateUrl: - 'app/telecom/pack/move/contract/pack-move-contract.modal.html', - controller: 'PackMoveContractCtrl', - controllerAs: 'PackMoveContract', - resolve: { - data() { - return { - form: self.form, - offer: self.offer.selected, - meeting: { - fakeMeeting: self.offer.meetingSlots.fakeMeeting, - slot: self.offer.meetingSlots.slot - ? self.offer.meetingSlots.slot.display - : {}, - }, - packName: $stateParams.packName, - }; - }, - }, - }); - - modal.result.then((result) => { - if (result === true) { - moveThePack(); + }); + this.$scope.$on('selectOfferUnbundling', (event, offerSelected) => { + this.offer.selected.productCode = offerSelected.selected.productCode; + this.moveStep = STEPS.saveNumber; + }); + this.$scope.$on('savedNumber', (event, form) => { + this.offer.selected.form = form; + if (!this.isOfferFTTH) { + if (this.offer.selected.offer.totalSubServiceToDelete > 0) { + this.moveStep = STEPS.serviceDelete; + } else if (this.offer.selected.offer.needNewModem) { + this.moveStep = STEPS.shipping; + } else if (this.isNewLine) { + this.moveStep = STEPS.meeting; } - }); - }; - - /** - * Test if the form is valid - * @returns {boolean} - */ - this.isFormValid = function isFormValid() { - const keepLine = - !self.form.futureLandline.keepLineNumber || - tucValidator.tucIsRio( - self.form.futureLandline.rio, - self.form.futureLandline.lineNumber, - ); - const ftMeeting = - self.offer.selected && - self.offer.meetingSlots && - (!self.offer.selected.meetingSlots || - (self.offer.selected.meetingSlots && - self.offer.meetingSlots.fakeMeeting) || - (self.offer.selected.meetingSlots && - !self.offer.meetingSlots.fakeMeeting && - self.offer.meetingSlots.slot)); - - return ( - keepLine && - ((ftMeeting && self.offer.selected.contactName) || - self.method === 'number') - ); - }; - - /** - * Compute the offers - * @param offers - */ - this.computeOffer = function computeOffer(offers) { - self.testLine = { - canMove: offers.length, - }; - if (self.testLine.canMove) { - self.testLine.performed = true; - assignIn(self.offer, { - available: offers, - selected: head(offers), - }); - self.offerSelected(self.offer.selected); - self.form.futureLandline.lineNumber = self.offer.selected.lineNumber; } else { - self.testLine.performed = false; - assignIn(self.offer, { - available: [], - selected: null, - }); + this.buildings = [this.selectedLine.endpoint.fiberInfo]; + this.moveStep = STEPS.buildingDetails; } - }; - - /** - * Launched before testing eligibility - */ - this.ongoingTest = function ongoingTest() { - self.testLine = { - loading: true, - canMove: false, - performed: false, - }; - assignIn(self.offer, { - available: [], - selected: null, - }); - }; - - /** - * Get URL of oldV6 pack move - * @returns {string} - */ - this.getOldV6TransfertUrl = function getOldV6TransfertUrl() { - return REDIRECT_URLS.oldV6ServiceTransfert; - }; - - /** - * Invoked when an offer is selected - * @param offer - */ - this.offerSelected = function offerSelected() { - this.offer.meetingSlots = { - fakeMeeting: false, - }; - - /* if no meeting available, check the fakeMeeting. - Do not offer a check box to the user if there is no choice to make */ - if ( - !( - this.offer.selected && - this.offer.selected.meetingSlots && - this.offer.selected.meetingSlots.meetingSlots && - this.offer.selected.meetingSlots.meetingSlots.length - ) - ) { - this.offer.meetingSlots.fakeMeeting = true; + }); + this.$scope.$on('updateBuildingDetails', (event, selectedOffer) => { + this.offer.selected.buildingDetails = selectedOffer; + if (this.offer.selected.offer.totalSubServiceToDelete > 0) { + this.moveStep = STEPS.serviceDelete; + } else if (this.offer.selected.offer.needNewModem) { + this.moveStep = STEPS.shipping; + } else { + this.moveStep = STEPS.resume; } - }; - - /** - * Check if can keep line number - * @returns {boolean} - */ - this.canKeepLineNumber = function canKeepLineNumber() { - const canKeep = - this.offer.selected.portability.eligible && - this.offer.selected.unbundling !== 'partial'; - if (!canKeep) { - self.form.futureLandline.keepLineNumber = false; + }); + this.$scope.$on('subservicesDelete', (event, subServicesToDelete) => { + this.offer.selected.offer.subServicesToDelete = subServicesToDelete; + if (this.offer.selected.offer.needNewModem) { + this.moveStep = STEPS.shipping; + } else if (!this.isOfferFTTH && this.isNewLine) { + this.moveStep = STEPS.meeting; + } else { + this.moveStep = STEPS.resume; } - return canKeep; - }; - - /** - * Check is a pending move is on-going - * @returns {Promise} - */ - function updateOperationAlreadyPending() { - return OvhApiPackXdslTask.Aapi() - .details({ - packName: $stateParams.packName, - }) - .$promise.then( - (data) => { - data.forEach((task) => { - if (task.function === taskMovePendingName) { - self.operationAlreadyPending = true; - } - }); - }, - (err) => new TucToastError(err), - ); - } - - /** - * Check is current offer is legacy - * @returns {Promise} - */ - function updateIsLegacyOffer() { - return OvhApiPackXdsl.v6() - .get({ - packId: $stateParams.packName, - }) - .$promise.then( - (data) => { - self.offer.current.isLegacy = data.capabilities.isLegacyOffer; - }, - (err) => new TucToastError(err), - ); - } - - /** - * Get the current pack address - * @returns {Promise} - */ - function getCurrentPackAddress() { - return $q - .all([ - OvhApiPackXdsl.Aapi() - .get({ packId: $stateParams.packName }, null) - .$promise.then( - (pack) => { - self.packAdress.current = head(pack.services); - return self.packAdress.current - ? self.packAdress.current.accessName - : null; - }, - (err) => new TucToastError(err), - ), - OvhApiPackXdsl.Aapi() - .getLines({ packId: $stateParams.packName }, null) - .$promise.then( - (lines) => { - const currentLine = head(lines); - self.packAdress.lineNumber = currentLine.number; - self.packAdress.portability = currentLine.portability; - }, - (err) => new TucToastError(err), - ), - ]) - .finally(() => { - self.packAdress.loading = false; - }); - } - - /** - * Check if the line is slamming (meaning that customer cannot keep his phone number) - * @return {Promise} - */ - function isSlammingLine() { - self.slammingCheck = true; - return OvhApiPackXdsl.v7() - .access() - .execute({ - packName: $stateParams.packName, - }) - .$promise.then((ids) => - $q - .all( - map( - chunk(ids, 200), - (chunkIds) => - OvhApiXdsl.v7() - .query() - .batch('serviceName', [''].concat(chunkIds), ',') - .expand() - .execute().$promise, - ), - ) - .then((chunkResult) => flatten(chunkResult)) - .then((result) => flatten(result)), - ) - .then((xdslLines) => { - const slammingLines = filter( - xdslLines, - (xdslLine) => xdslLine.value.status === 'slamming', - ); - self.hasSlamming = !!slammingLines.length; - return self.hasSlamming; - }) - .catch((err) => { - TucToast.error($translate.instant('pack_move_slamming_error')); - return $q.reject(err); - }) - .finally(() => { - self.slammingCheck = false; + }); + this.$scope.$on('shippingSelected', (event, shipping) => { + this.offer.selected.shipping = shipping; + if (!this.isOfferFTTH && this.isNewLine) { + this.moveStep = STEPS.meeting; + } else { + this.moveStep = STEPS.resume; + } + }); + this.$scope.$on('selectMeeting', (event, offerSelected) => { + this.offer.selected.meetingSlots = offerSelected.meetingSlots; + this.offer.selected.contactName = offerSelected.selected.contactName; + this.moveStep = STEPS.resume; + }); + this.$scope.$on('move', () => { + this.TucToast.success(this.$translate.instant('pack_move_success')); + this.goBack(this.packName); + }); + } + + /** + * Check is a pending move is on-going + * @returns {Promise} + */ + updateOperationAlreadyPending() { + return this.OvhApiPackXdslTask.Aapi() + .details({ + packName: this.packName, + }) + .$promise.then((data) => { + data.forEach((task) => { + if (task.function === this.taskMovePendingName) { + this.operationAlreadyPending = true; + } }); - } - - /** - * Initialize the controller - */ - function init() { - self.packAdress = { - loading: true, - }; - self.loading = true; - $q.all([ - isSlammingLine(), - updateOperationAlreadyPending(), - updateIsLegacyOffer(), - getCurrentPackAddress(), - ]).finally(() => { - self.loading = false; + }) + .catch((error) => new this.TucToastError(error)); + } + + /** + * Check is current offer is legacy + * @returns {Promise} + */ + updateIsLegacyOffer() { + return this.OvhApiPackXdsl.v6() + .get({ + packId: this.packName, + }) + .$promise.then((data) => { + this.offer.current.offerDescription = data.offerDescription; + this.offer.current.offerPrice = data.offerPrice; + this.offer.current.isLegacy = data.capabilities.isLegacyOffer; + }) + .catch((error) => new this.TucToastError(error)); + } + + /** + * Get the current pack address + * @returns {Promise} + */ + getCurrentPackAddress() { + return this.$q + .all([ + this.OvhApiPackXdsl.Aapi() + .get({ packId: this.packName }, null) + .$promise.then((pack) => { + this.packAddress.current = head(pack.services); + return this.packAddress.current + ? this.packAddress.current.accessName + : null; + }), + this.OvhApiPackXdsl.Aapi() + .getLines({ packId: this.packName }, null) + .$promise.then((lines) => { + const currentLine = head(lines); + this.packAddress.lineNumber = currentLine.number; + this.packAddress.portability = currentLine.portability; + }), + ]) + .catch((error) => new this.TucToastError(error)) + .finally(() => { + this.packAddress.loading = false; }); - $scope.$watch('PackMove.offer.selected.portability.eligible', (value) => { - if (!value) { - self.form.futureLandline.keepLineNumber = false; - } + } + + /** + * Check if the line is slamming (meaning that customer cannot keep his phone number) + * @return {Promise} + */ + isSlammingLine() { + this.slammingCheck = true; + return this.OvhApiPackXdsl.v7() + .access() + .execute({ + packName: this.packName, + }) + .$promise.then((ids) => + this.$q + .all( + map( + chunk(ids, 200), + (chunkIds) => + this.OvhApiXdsl.v7() + .query() + .batch('serviceName', [''].concat(chunkIds), ',') + .expand() + .execute().$promise, + ), + ) + .then((chunkResult) => flatten(chunkResult)) + .then((result) => flatten(result)), + ) + .then((xdslLines) => { + const slammingLines = filter( + xdslLines, + (xdslLine) => xdslLine.value.status === LINE_STATUS.slamming, + ); + this.hasSlamming = !!slammingLines.length; + return this.hasSlamming; + }) + .catch((error) => { + this.TucToast.error( + this.$translate.instant('pack_move_slamming_error'), + ); + return this.$q.reject(error); + }) + .finally(() => { + this.slammingCheck = false; }); - $scope.$watch('PackMove.packAdress.portability', (value) => { - if (!value) { - self.form.currentLandline.portLineNumber = false; - } + } + + /** + * Retrieve contact owner associated to the pack if it exists + */ + getCurrentContactOwner() { + return this.OvhApiPackXdsl.v6() + .getContactOwner({ + packName: this.packName, + }) + .$promise.then((result) => { + this.contactOwner = result.data; + return this.contactOwner; + }) + .catch(() => { + this.contactOwner = null; + return this.contactOwner; }); - } - - init(); - }); + } +} diff --git a/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.html b/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.html index 279a683bc58a..4232455a4852 100644 --- a/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.html +++ b/packages/manager/apps/telecom/src/app/telecom/pack/move/pack-move.html @@ -1,22 +1,22 @@
- + + +

-
+
-
+