Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(billing): init the application #13631

Merged
merged 3 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions packages/manager/apps/billing/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"globals": {
"__VERSION__": 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
}
}
Empty file.
92 changes: 92 additions & 0 deletions packages/manager/apps/billing/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"name": "@ovh-ux/manager-billing-app",
"version": "0.0.0",
"private": true,
"description": "OVHcloud Billing app",
"repository": {
"type": "git",
"url": "git+https://github.com/ovh/manager.git",
"directory": "packages/manager/apps/billing"
},
"license": "BSD-3-Clause",
"author": "OVH SAS",
"scripts": {
"build": "webpack --env production",
"dev": "webpack-dev-server",
"dev:watch": "yarn run dev",
"start": "lerna exec --stream --scope='@ovh-ux/manager-billing-app' --include-dependencies -- npm run build --if-present",
"start:dev": "lerna exec --stream --scope='@ovh-ux/manager-billing-app' --include-dependencies -- npm run dev --if-present",
"start:watch": "lerna exec --stream --parallel --scope='@ovh-ux/manager-billing-app' --include-dependencies -- npm run dev:watch --if-present"
},
"dependencies": {
"@ovh-ux/manager-advices": "^1.8.1",
"@ovh-ux/manager-at-internet-configuration": "^1.5.0",
"@ovh-ux/manager-config": "^8.0.0",
"@ovh-ux/manager-core": "^13.0.0",
"@ovh-ux/manager-error-page": "^2.4.1",
"@ovh-ux/manager-exchange": "^4.10.0",
"@ovh-ux/manager-models": "^2.1.0",
"@ovh-ux/manager-new-billing": "^0.23.0",
"@ovh-ux/manager-ng-layout-helpers": "^2.9.1",
"@ovh-ux/ng-at-internet": "^6.0.0",
"@ovh-ux/ng-at-internet-ui-router-plugin": "^3.5.0",
"@ovh-ux/ng-ovh-api-wrappers": "^5.1.0",
"@ovh-ux/ng-ovh-chart": "^1.2.0",
"@ovh-ux/ng-ovh-contacts": "^5.3.1",
"@ovh-ux/ng-ovh-export-csv": "^2.1.1",
"@ovh-ux/ng-ovh-feature-flipping": "^1.1.2",
"@ovh-ux/ng-ovh-http": "^5.1.1",
"@ovh-ux/ng-ovh-order-tracking": "^2.5.1",
"@ovh-ux/ng-ovh-payment-method": "^9.16.5",
"@ovh-ux/ng-ovh-proxy-request": "^2.1.1",
"@ovh-ux/ng-ovh-request-tagger": "^2.0.0",
"@ovh-ux/ng-ovh-sso-auth": "^4.8.1",
"@ovh-ux/ng-ovh-swimming-poll": "^5.1.1",
"@ovh-ux/ng-ovh-user-pref": "2.1.1",
"@ovh-ux/ng-ovh-utils": "^14.4.1",
"@ovh-ux/ng-q-allsettled": "^2.1.2",
"@ovh-ux/ng-shell-tracking": "^0.6.0",
"@ovh-ux/ng-translate-async-loader": "^2.2.1",
"@ovh-ux/ng-ui-router-breadcrumb": "^1.3.1",
"@ovh-ux/ng-ui-router-layout": "^4.3.1",
"@ovh-ux/request-tagger": "^0.4.0",
"@ovh-ux/shell": "^4.0.1",
"@ovh-ux/ui-kit": "^6.10.5",
"@uirouter/angularjs": "^1.0.23",
"angular": "^1.7.5",
"angular-aria": "^1.7.8",
"angular-cookies": "^1.7.8",
"angular-dynamic-locale": "^0.1.37",
"angular-i18n": "^1.7.8",
"angular-resource": "^1.7.8",
"angular-sanitize": "^1.7.8",
"angular-translate": "^2.18.1",
"angular-translate-loader-pluggable": "^1.3.1",
"angular-ui-bootstrap": "1.3.3",
"angular-ui-utils": "angular-ui/ui-utils#0.2.3",
"angular-ui-validate": "angular-ui/ui-validate#~1.2.2",
"core-js": "^3.6.5",
"flatpickr": "~4.6.3",
"jquery": "^2.1.3",
"jsurl": "^0.1.4",
"lodash-es": "^4.17.15",
"moment": "^2.24.0",
"oclazyload": "^1.1.0",
"ovh-api-services": "^17.0.0",
"ovh-ui-kit-bs": "^4.2.0",
"regenerator-runtime": "^0.13.7",
"whatwg-fetch": "^3.5.0"
},
"devDependencies": {
"@ovh-ux/manager-webpack-config": "^7.0.3",
"glob": "^7.1.6",
"lodash": "^4.17.15",
"webpack": "^5.94.0",
"webpack-merge": "^4.2.2"
},
"regions": [
"CA",
"EU",
"US"
]
}
60 changes: 60 additions & 0 deletions packages/manager/apps/billing/src/app.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// @rem-base: rem-base(10px);

@import 'css/source.less';

.ovh-manager-dedicated-app {
&.in-container .sidebar-menu {
top: -2px !important;
}

#nprogress {
.peg {
box-shadow: none;
}
}

.word-break-normal {
word-break: normal;
}

.ip-clipboard {
min-width: rem-calc(200);
max-width: rem-calc(350);
margin: 0;
}

// Could be removed with the next version of UI Kit
.font-inherit {
font-size: inherit;
}

ola-step-checker {
display: block;

@media (min-width: 992px) {
.oui-tile {
display: flex;
flex-direction: column;
}

.oui-tile__body {
flex: 1;

.row {
height: 100%;
}

.oui-list,
.oui-progress-tracker {
height: 100%;
margin: 0;
border-right: 1px solid #eaeaea;
}
}
}
}

#licenseOrderBlockFilters {
cursor: pointer;
}
}
157 changes: 157 additions & 0 deletions packages/manager/apps/billing/src/app.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
import angular from 'angular';
import get from 'lodash/get';
import has from 'lodash/has';
import isString from 'lodash/isString';
import uiRouter, { RejectType } from '@uirouter/angularjs';
import '@ovh-ux/ui-kit';
import '@ovh-ux/ng-at-internet';
import { isTopLevelApplication } from '@ovh-ux/manager-config';
import { registerCoreModule } from '@ovh-ux/manager-core';
import ngOvhSsoAuth from '@ovh-ux/ng-ovh-sso-auth';
import ngUiRouterBreadcrumb from '@ovh-ux/ng-ui-router-breadcrumb';
import ovhManagerAtInternetConfiguration from '@ovh-ux/manager-at-internet-configuration';
import { registerAtInternet } from '@ovh-ux/ng-shell-tracking';
// TODO: Change to '@ovh-ux/manager-billing' when module is deployed
// import Billing from '@ovh-ux/manager-billing';
import Billing from '../../../modules/new-billing/src';
import errorPage from './error';
import dedicatedUniverseComponents from '../../../modules/account/src/dedicatedUniverseComponents';
import TRACKING from './tracking/at-internet.constants';
import '@ovh-ux/ui-kit/dist/css/oui.css';
import './app.less';
import './css/source.scss';

export default async (containerEl, shellClient) => {
const moduleName = 'BillingApp';

const routingConfig = /* @ngInject */ ($urlRouterProvider) => {
$urlRouterProvider.otherwise('/');
};

const trackingConfig = /* @ngInject */ (atInternetConfigurationProvider) => {
atInternetConfigurationProvider.setSkipInit(true);
atInternetConfigurationProvider.setPrefix('BillingApp');
};

const [environment, locale] = await Promise.all([
shellClient.environment.getEnvironment(),
shellClient.i18n.getLocale(),
]);

const coreCallbacks = {
onLocaleChange: (lang) => {
shellClient.i18n.setLocale(lang);
},
};

const ssoAuthConfig = /* @ngInject */ (ssoAuthenticationProvider) => {
ssoAuthenticationProvider.setOnLogin(() => {
shellClient.auth.login();
});
ssoAuthenticationProvider.setOnLogout(() => {
shellClient.auth.logout();
});
};

const calendarConfigProvider = /* @ngInject */ (
ouiCalendarConfigurationProvider,
) => {
const [lang] = locale.split('_');
return import(`flatpickr/dist/l10n/${lang}.js`)
.then((module) => {
ouiCalendarConfigurationProvider.setLocale(module.default[lang]);
})
.catch(() => {});
};

const broadcastAppStarted = /* @ngInject */ ($rootScope, $transitions) => {
const unregisterHook = $transitions.onSuccess({}, async () => {
if (!isTopLevelApplication()) {
await shellClient.ux.hidePreloader();
}
$rootScope.$broadcast('app:started');
unregisterHook();
});
};

const transitionsConfig = /* @ngInject */ ($transitions) => {
if (!isTopLevelApplication()) {
$transitions.onBefore({}, (transition) => {
if (
!transition.ignored() &&
transition.from().name !== '' &&
transition.entering().length > 0
) {
shellClient.ux.startProgress();
}
});

$transitions.onSuccess({}, () => {
shellClient.ux.stopProgress();
});

$transitions.onError({}, (transition) => {
if (!transition.error().redirected) {
shellClient.ux.stopProgress();
}
});
}
};

const defaultErrorHandler = /* @ngInject */ ($state) => {
$state.defaultErrorHandler((error) => {
if (error.type === RejectType.ERROR) {
$state.go(
'error',
{
detail: {
message: get(error.detail, 'data.message'),
code: has(error.detail, 'headers')
? error.detail.headers('x-ovh-queryId')
: null,
},
},
{ location: false },
);
}
});
};

angular
.module(
moduleName,
[
registerCoreModule(environment, coreCallbacks),
registerAtInternet(shellClient.tracking),
ovhManagerAtInternetConfiguration,
ngOvhSsoAuth,
ngUiRouterBreadcrumb,
'oui',
uiRouter,
dedicatedUniverseComponents,
errorPage,
Billing,
...get(__NG_APP_INJECTIONS__, environment.getRegion(), []),
].filter(isString),
)
.constant('shellClient', shellClient)
.config(
/* @ngInject */ ($locationProvider) => $locationProvider.hashPrefix(''),
)
.config(routingConfig)
.config(ssoAuthConfig)
.config(async () => {
await shellClient.tracking.setConfig(environment.getRegion(), TRACKING);
})
.config(trackingConfig)
.config(calendarConfigProvider)
.run(broadcastAppStarted)
.run(transitionsConfig)
.run(defaultErrorHandler);

angular.bootstrap(containerEl, [moduleName], {
strictDi: true,
});

return moduleName;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"menu_back": "Zurück zur Startseite",
"menu_previous": "Zurück zur vorherigen Seite ",
"menu_unpaid": "Meine Verbindlichkeiten",
"menu_orders": "Meine Bestellungen",
"menu_statements": "Meine Aufstellungen",
"menu_history": "Meine Rechnungen",
"menu_payments": "Zahlungsverfolgung",
"menu_credits": "Meine Guthaben",
"menu_services": "Meine Dienstleistungen",
"menu_services_management": "Meine Dienste verwalten",
"menu_refunds": "Meine Gutschriften",
"menu_sla": "Meine SLA-Gutschriften",
"menu_conso": "Meine Verbrauchserfassung",
"menu_means": "Meine Zahlungsarten",
"menu_ovhaccount": "Mein Prepaid-Account",
"menu_ovhaccount_old_name": "(früher OVH Manager)",
"menu_fidelity": "Mein Treuebereich",
"menu_vouchers": "Meine Gutscheine",
"menu_bills": "Meine Rechnungen",
"menu_support": "Meine Support-Anfragen",
"menu_payment_methods": "Zahlungsarten",
"menu_subscriptions": "Meine Abos",
"menu_ssh": "Meine SSH Keys",
"menu_infos": "Mein Profil",
"menu_advanced": "Erweiterte Einstellungen",
"menu_account_title": "Mein Account",
"menu_security": "Sicherheit",
"menu_users_management": "Verwaltung der Benutzer",
"menu_emails": "Empfangene E-Mails",
"menu_contacts": "Meine Kontakte",
"menu_agreements": "Meine Verträge",
"menu_iam": "Identity and Access (IAM)"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"menu_back": "Back to home page",
"menu_previous": "Back to previous page",
"menu_unpaid": "My outstanding invoices",
"menu_orders": "My orders ",
"menu_statements": "My payments",
"menu_history": "My bills",
"menu_payments": "Payment tracking",
"menu_credits": "My credits",
"menu_services": "My services",
"menu_services_management": "Manage my services ",
"menu_refunds": "My credit notes",
"menu_sla": "My compensation ",
"menu_conso": "My usage summary",
"menu_means": "My payment methods",
"menu_ovhaccount": "My prepaid account ",
"menu_ovhaccount_old_name": "(formerly known as my OVH account)",
"menu_fidelity": "My Loyalty control panel",
"menu_vouchers": "My vouchers",
"menu_bills": "My bills",
"menu_support": "My support tickets ",
"menu_payment_methods": "Payment method",
"menu_subscriptions": "My subscriptions",
"menu_ssh": "My SSH keys",
"menu_infos": "My profile ",
"menu_advanced": "Advanced settings",
"menu_account_title": "My account",
"menu_security": "Security",
"menu_users_management": "User management",
"menu_emails": "Emails received",
"menu_contacts": "My contacts",
"menu_agreements": "My contracts",
"menu_iam": "Identity and Access Management (IAM)"
}
Loading
Loading