Skip to content

Commit 3d5328c

Browse files
Cyrille Bourgoisjleveugle
authored andcommitted
fix(overthebox): add warning module
1 parent f0e0a1b commit 3d5328c

13 files changed

+61
-40
lines changed

packages/manager/modules/overthebox/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@ovh-ux/ng-tail-logs": "^2.0.0-beta.0",
3131
"@ovh-ux/ng-uirouter-title": "^2.0.0-beta.3",
3232
"@ovh-ux/telecom-universe-components": "^1.5.1",
33+
"@ovh-ux/translate-async-loader": "^1.0.8",
3334
"@uirouter/angularjs": "^1.0.15",
3435
"angular": "1.7.5",
3536
"angularjs-scroll-glue": "^2.2.0",

packages/manager/modules/overthebox/src/details/index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import angular from 'angular';
2+
3+
import ovhManagerOtbWarning from '../warning';
4+
25
import constant from './overTheBox-details.constant';
36
import controller from './overTheBox-details.controller';
47
import overTheBoxGraphService from './overTheBox-details.service';
5-
import overTheBoxWarningNotActivated from '../warning/overTheBox-warning-notActivated.html';
68
import template from './overTheBox-details.html';
79

810
const moduleName = 'ovhManagerOtbDetails';
911

10-
angular.module(moduleName, [])
12+
angular
13+
.module(moduleName, [
14+
ovhManagerOtbWarning,
15+
])
1116
.constant('OVERTHEBOX_DETAILS', constant)
12-
.run(($templateCache) => {
13-
// import templates required by ng-include
14-
$templateCache.put('overTheBox/warning/overTheBox-warning-notActivated.html', overTheBoxWarningNotActivated);
15-
})
1617
.config(($stateProvider) => {
1718
$stateProvider.state('overTheBox.details', {
1819
url: '/details',
@@ -24,7 +25,7 @@ angular.module(moduleName, [])
2425
},
2526
},
2627
translations: {
27-
value: ['.', '../warning', '../remote'],
28+
value: ['.', '../remote'],
2829
format: 'json',
2930
},
3031
});

packages/manager/modules/overthebox/src/order/index.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@ import angular from 'angular';
22
import controller from './order-overTheBox.controller';
33
import template from './order-overTheBox.html';
44

5-
import overTheBoxWarningNoPaymentMeans from '../warning/overTheBox-warning-noPaymentMeans.html';
6-
import overTheBoxWarningNotFound from '../warning/overTheBox-warning-notFound.html';
7-
import overTheBoxWarningNoSubscription from '../warning/overTheBox-warning-noSubscription.html';
8-
import overTheBoxWarningDeviceToLink from '../warning/overTheBox-warning-deviceToLink.html';
5+
import ovhManagerOtbWarning from '../warning';
96

107
const moduleName = 'ovhManagerOtbOrder';
118

12-
angular.module(moduleName, [])
13-
.run(($templateCache) => {
14-
// import templates required by ng-include
15-
$templateCache.put('overTheBox/warning/overTheBox-warning-noPaymentMeans.html', overTheBoxWarningNoPaymentMeans);
16-
$templateCache.put('overTheBox/warning/overTheBox-warning-notFound.html', overTheBoxWarningNotFound);
17-
$templateCache.put('overTheBox/warning/overTheBox-warning-noSubscription.html', overTheBoxWarningNoSubscription);
18-
$templateCache.put('overTheBox/warning/overTheBox-warning-deviceToLink.html', overTheBoxWarningDeviceToLink);
19-
})
9+
angular
10+
.module(moduleName, [
11+
ovhManagerOtbWarning,
12+
])
2013
.config(($stateProvider) => {
2114
$stateProvider.state('overTheBox-order', {
2215
url: '/overTheBox/order',
@@ -27,7 +20,6 @@ angular.module(moduleName, [])
2720
value: [
2821
'.',
2922
'..',
30-
'../warning',
3123
],
3224
format: 'json',
3325
},

packages/manager/modules/overthebox/src/order/order-overTheBox.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<div class="telecom-overTheBox-order">
1+
<div class="telecom-overTheBox-order"
2+
data-e2e-id="otb:order">
23
<header>
34
<h1 data-translate="overTheBox_title"></h1>
45
</header>
@@ -204,9 +205,9 @@ <h1 data-translate="overTheBox_title"></h1>
204205
data-ng-hide="OrderOverTheBox.states.orderDone"
205206
data-ng-click="OrderOverTheBox.order()"
206207
data-ng-disabled="!OrderOverTheBox.contractsAccepted || OrderOverTheBox.loaders.create"
207-
data-translate-attr="{ 'title': 'common_generate_order' }">
208+
data-translate-attr="{ 'title': 'overTheBox_order_generate_order' }">
208209
<i class="ovh-font ovh-font-cart mr-2" aria-hidden="true"></i>
209-
<span data-translate="common_generate_order"></span>
210+
<span data-translate="overTheBox_order_generate_order"></span>
210211
</button>
211212
</form>
212213
</div>

packages/manager/modules/overthebox/src/order/translations/Messages_fr_FR.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
"order_overTheBox_price_ttc": "TTC.",
2222
"order_overTheBox_orderDone": "Votre commande a bien été prise en compte. <a href=\"{{bcUrl}}\" target=\"_blank\">Cliquez ici pour accéder au bon de commande et le valider</a>.",
2323
"order_overTheBox_offers_error": "Impossible de charger la liste des offres. Veuillez réessayer plus tard.",
24-
"order_overTheBox_sure_want_to_order": "Nous avons détecté qu'une de vos OverTheBox n'est liée à aucun service et qu'au moins un de vos services ne gère pas d'OverTheBox."
25-
}
24+
"order_overTheBox_sure_want_to_order": "Nous avons détecté qu'une de vos OverTheBox n'est liée à aucun service et qu'au moins un de vos services ne gère pas d'OverTheBox.",
25+
"overTheBox_order_generate_order": "Générer le bon de commande"
26+
}

packages/manager/modules/overthebox/src/overTheBox.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<section class="telecom-legacy" id="over-the-box">
1+
<section class="telecom-legacy" id="over-the-box"
2+
data-e2e-id="otb:section">
23
<div class="telecom-section-header">
34

45
<header class="page-header"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import angular from 'angular';
2+
import '@ovh-ux/translate-async-loader';
3+
4+
import overTheBoxWarningController from './overTheBox-warning.controller';
5+
import overTheBoxWarningDeviceToLinkController from './overTheBox-warning-deviceToLink.controller';
6+
import overTheBoxWarningNoPaymentMeans from './overTheBox-warning-noPaymentMeans.html';
7+
import overTheBoxWarningNotFound from './overTheBox-warning-notFound.html';
8+
import overTheBoxWarningNoSubscription from './overTheBox-warning-noSubscription.html';
9+
import overTheBoxWarningNotActivated from './overTheBox-warning-notActivated.html';
10+
import overTheBoxWarningDeviceToLink from './overTheBox-warning-deviceToLink.html';
11+
12+
const moduleName = 'ovhManagerOtbWarning';
13+
14+
angular
15+
.module(moduleName, [])
16+
.controller('OverTheBoxWarningCtrl', overTheBoxWarningController)
17+
.controller('OverTheBoxWarningDeviceToLinkCtrl', overTheBoxWarningDeviceToLinkController)
18+
.run(/* @ngTranslationsInject:json ./translations */)
19+
.run(($templateCache) => {
20+
// import templates required by ng-include
21+
$templateCache.put('overTheBox/warning/overTheBox-warning-noPaymentMeans.html', overTheBoxWarningNoPaymentMeans);
22+
$templateCache.put('overTheBox/warning/overTheBox-warning-notFound.html', overTheBoxWarningNotFound);
23+
$templateCache.put('overTheBox/warning/overTheBox-warning-noSubscription.html', overTheBoxWarningNoSubscription);
24+
$templateCache.put('overTheBox/warning/overTheBox-warning-notActivated.html', overTheBoxWarningNotActivated);
25+
$templateCache.put('overTheBox/warning/overTheBox-warning-deviceToLink.html', overTheBoxWarningDeviceToLink);
26+
});
27+
28+
export default moduleName;

packages/manager/modules/overthebox/src/warning/overTheBox-warning-deviceToLink.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="alert alert-info"
22
role="alert"
3-
data-ng-controller="OrderOverTheBoxDeviceToLinkCtrl as DeviceToLink">
3+
data-ng-controller="OverTheBoxWarningDeviceToLinkCtrl as DeviceToLink">
44
<h3 data-ng-if="DeviceToLink.deviceCount === 1"
55
data-translate="order_overTheBox_device_detected_title">
66
</h3>

packages/manager/modules/overthebox/src/warning/overTheBox-warning-noPaymentMeans.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="alert alert-warning"
22
role="alert"
3-
data-ng-controller="OrderOverTheBoxWarningCtrl as OrderOverTheBoxWarning">
3+
data-ng-controller="OverTheBoxWarningCtrl as OrderOverTheBoxWarning">
44
<h3 data-translate="order_overTheBox_payment_no_means"></h3>
55
<p data-translate="order_overTheBox_payment_means"
66
data-translate-values="{url: OrderOverTheBoxWarning.paymentMeans}">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="alert alert-info"
22
role="alert"
3-
data-ng-controller="OrderOverTheBoxWarningCtrl as OrderOverTheBoxWarning">
3+
data-ng-controller="OverTheBoxWarningCtrl as OrderOverTheBoxWarning">
44
<h3 data-translate="order_overTheBox_device_detected_title"></h3>
55
<p data-translate="order_overTheBox_device_detected_subscription_needed"></p>
66
</div>

0 commit comments

Comments
 (0)