Skip to content

Commit

Permalink
feat(billing): move code to the new app
Browse files Browse the repository at this point in the history
ref: MANAGER-15025

Signed-off-by: Maxime Bajeux <[email protected]>
  • Loading branch information
Maxime Bajeux committed Dec 3, 2024
1 parent 552567b commit cce9806
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 62 deletions.
12 changes: 11 additions & 1 deletion packages/manager/apps/billing/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"globals": {
"__VERSION__": true,
"__NG_APP_INJECTIONS__": true
"__NG_APP_INJECTIONS__": true,
"EprotectIframeClient": true,
"ipaddr": true,
"JSURL": true,
"moment": true,
"punycode": true,
"RandExp": true,
"URI": true,
"validator": true,
"WEBPACK_ENV": true,
"zE": true
}
}
8 changes: 8 additions & 0 deletions packages/manager/apps/billing/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ module.exports = (env = {}) => {
env,
);

config.plugins.push(
new webpack.DefinePlugin({
WEBPACK_ENV: {
production: JSON.stringify(env.production),
},
}),
);

// Extra config files
const extras = glob.sync(`./.extras/**/*.js`);

Expand Down
11 changes: 5 additions & 6 deletions packages/manager/modules/new-billing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"author": "OVH SAS",
"main": "./src/index.js",
"dependencies": {
"moment": "^2.24.0"
},
"devDependencies": {
"@ovh-ux/ui-kit": "^6.10.5",
"bootstrap": "^4.4.1",
"bootstrap": "^3.3.6",
"bootstrap4": "twbs/bootstrap#v4.0.0",
"lodash-es": "^4.17.15"
"components-jqueryui": "^1.12.1",
"jquery": "^2.1.3",
"lodash-es": "^4.17.15",
"moment": "^2.24.0"
},
"peerDependencies": {
"@ovh-ux/manager-billing-components": "^2.0.0 || ^3.0.0",
Expand Down Expand Up @@ -50,7 +50,6 @@
"core-js": "^3.6.5",
"flatpickr": "~4.6.3",
"ipaddr.js": "^1.6.0",
"jquery": "^2.1.3",
"jsurl": "^0.1.4",
"lodash": "^4.17.15",
"oclazyload": "^1.1.0",
Expand Down
51 changes: 13 additions & 38 deletions packages/manager/modules/new-billing/src/billing.module.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
import angular from 'angular';
import ngOvhExportCsv from '@ovh-ux/ng-ovh-export-csv';
import ngOvhUtils from '@ovh-ux/ng-ovh-utils';
import ngRoute from 'angular-route';
import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader';
import ngSanitize from 'angular-sanitize';
import ovhManagerCore from '@ovh-ux/manager-core';
import set from 'lodash/set';
import uiBootstrap from 'angular-ui-bootstrap';
import uiRouter from '@uirouter/angularjs';
import ngAtInternetUiRouterPlugin from '@ovh-ux/ng-at-internet-ui-router-plugin';
import ngOvhPaymentMethod from '@ovh-ux/ng-ovh-payment-method';
import ngUiRouterLayout from '@ovh-ux/ng-ui-router-layout';
import '@ovh-ux/ng-ui-router-breadcrumb';
import 'ovh-api-services';
import ngOvhFeatureFlipping from '@ovh-ux/ng-ovh-feature-flipping';
import ngOvhOrderTracking from '@ovh-ux/ng-ovh-order-tracking';
import ngOvhContacts from '@ovh-ux/ng-ovh-contacts';

import ngOvhUserPref from '@ovh-ux/ng-ovh-user-pref';
import autorenew from './autoRenew/autorenew.module';
import billingMain from './main/billing-main.module';
import dateRangeSelectionService from './common/dateRangeSelection';
Expand Down Expand Up @@ -48,47 +31,39 @@ import renewFrequenceFilter from './components/filters/renewFrequence';
import routing from './billing.routing';
import billingTracking from './atInternetTracking.config';

import '@ovh-ux/ng-ui-router-breadcrumb';
import '@uirouter/angularjs';
import 'angular-translate';
import '@ovh-ux/ng-ovh-feature-flipping';
import 'angular-ui-bootstrap';

const moduleName = 'Billing';

angular
.module(moduleName, [
autorenew,
billingMain,
history,
'oui',
'pascalprecht.translate',
'ui.bootstrap',
'ui.router',
'ngUiRouterBreadcrumb',
'oc.lazyLoad',
'ui.select',
'ngRoute',
'ngSanitize',
'ovh-api-services',
ngOvhUserPref,
'ngOvhFeatureFlipping',
autorenew,
billingMain,
history,
paymentCreditAdd,
order,
ordersMain,
orders,
ordersPurchases,
ovhAccountRefund,
refunds,
ngOvhExportCsv,
ngOvhUtils,
ngRoute,
ngSanitize,
ngTranslateAsyncLoader,
ngOvhContacts,
ngOvhFeatureFlipping,
ngOvhOrderTracking,
ngOvhPaymentMethod,
ngUiRouterLayout,
ovhManagerCore,
payment,
paymentMehtod,
sla,
termination,
uiBootstrap,
uiRouter,
'ngUiRouterBreadcrumb',
ngAtInternetUiRouterPlugin,
])
.service('billingFeatureAvailability', featureAvailability)
.service('BillingdateRangeSelection', dateRangeSelectionService)
Expand Down
73 changes: 57 additions & 16 deletions packages/manager/modules/new-billing/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,67 @@ import angular from 'angular';

import '@uirouter/angularjs';
import 'oclazyload';

import '@ovh-ux/ng-ui-router-breadcrumb';
import 'ovh-api-services';
import 'core-js/stable';

import ngOvhExportCsv from '@ovh-ux/ng-ovh-export-csv';
import ngOvhUtils from '@ovh-ux/ng-ovh-utils';
import ngRoute from 'angular-route';
import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader';
import ngSanitize from 'angular-sanitize';

import ngAtInternetUiRouterPlugin from '@ovh-ux/ng-at-internet-ui-router-plugin';
import ngOvhPaymentMethod from '@ovh-ux/ng-ovh-payment-method';
import ngUiRouterLayout from '@ovh-ux/ng-ui-router-layout';
import ngOvhFeatureFlipping from '@ovh-ux/ng-ovh-feature-flipping';
import ngOvhOrderTracking from '@ovh-ux/ng-ovh-order-tracking';
import ngOvhContacts from '@ovh-ux/ng-ovh-contacts';
import ngOvhUserPref from '@ovh-ux/ng-ovh-user-pref';

import 'bootstrap';
import 'angular-ui-bootstrap';

import billing from './billing.module';
import 'punycode';

const moduleName = 'ovhManagerDedicatedBillingLazyLoading';

angular.module(moduleName, ['ui.router', 'oc.lazyLoad', billing]).config(
/* @ngInject */ ($stateProvider) => {
$stateProvider.state('billing.**', {
url: '/',
lazyLoad: ($transition$) => {
const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad');

return import('./billing.module').then((mod) =>
$ocLazyLoad.inject(mod.default || mod),
);
},
});
},
);
angular
.module(moduleName, [
'ui.select',
'ngRoute',
'ngSanitize',
'ovh-api-services',
ngOvhUserPref,
'ui.router',
'oc.lazyLoad',
ngOvhExportCsv,
ngOvhUtils,
ngRoute,
ngTranslateAsyncLoader,
ngSanitize,
ngAtInternetUiRouterPlugin,
ngOvhPaymentMethod,
ngUiRouterLayout,
ngOvhFeatureFlipping,
ngOvhOrderTracking,
ngOvhContacts,
'ngUiRouterBreadcrumb',
ngAtInternetUiRouterPlugin,
])
.config(
/* @ngInject */ ($stateProvider) => {
$stateProvider.state('billing.**', {
url: '/',
lazyLoad: ($transition$) => {
const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad');

return import('./billing.module').then((mod) =>
$ocLazyLoad.inject(mod.default || mod),
);
},
});
},
);

export default moduleName;
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default class {
this.$scope.currentAction = action;
this.$scope.currentActionData = data;

this.$scope.stepPath = `/payment/fidelity/${this.$scope.currentAction}/billing-fidelity-${this.$scope.currentAction}.html`;
this.$scope.stepPath = `billing/payment/fidelity/${this.$scope.currentAction}/billing-fidelity-${this.$scope.currentAction}.html`;
$('#currentAction').modal({
keyboard: true,
backdrop: 'static',
Expand Down

0 comments on commit cce9806

Please sign in to comment.