Skip to content

Commit

Permalink
feat(account): init account application (#13133)
Browse files Browse the repository at this point in the history
ref: MANAGER-15021
Signed-off-by: Maxime Bajeux <[email protected]>
Co-authored-by: JacquesLarique <[email protected]>
  • Loading branch information
MaximeBajeux and JacquesLarique committed Nov 21, 2024
1 parent 19dc6bc commit 1e19a4b
Show file tree
Hide file tree
Showing 901 changed files with 44,743 additions and 14 deletions.
Binary file added packages/manager/.DS_Store
Binary file not shown.
16 changes: 16 additions & 0 deletions packages/manager/apps/account/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"globals": {
"__NG_APP_INJECTIONS__": true,
"__VERSION__": true,
"EprotectIframeClient": true,
"ipaddr": true,
"JSURL": true,
"moment": true,
"punycode": true,
"RandExp": true,
"URI": true,
"validator": true,
"WEBPACK_ENV": true,
"zE": true
}
}
Empty file.
82 changes: 82 additions & 0 deletions packages/manager/apps/account/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"name": "@ovh-ux/manager-account-app",
"version": "0.0.0",
"private": true,
"description": "User account and contacts management application",
"repository": {
"type": "git",
"url": "git+https://github.com/ovh/manager.git",
"directory": "packages/manager/apps/account"
},
"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-account-app' --include-dependencies -- npm run build --if-present",
"start:dev": "lerna exec --stream --scope='@ovh-ux/manager-account-app' --include-dependencies -- npm run dev --if-present",
"start:watch": "lerna exec --stream --parallel --scope='@ovh-ux/manager-account-app' --include-dependencies -- npm run dev:watch --if-present"
},
"dependencies": {
"@ovh-ux/manager-account": "^0.0.0 || ^1.0.0",
"@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-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-feature-flipping": "^1.1.2",
"@ovh-ux/ng-ovh-http": "^5.1.1",
"@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-pagination-front": "^10.3.1",
"@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/sign-up": "^3.0.0",
"@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",
"core-js": "^3.6.5",
"flatpickr": "~4.6.3",
"jquery": "^2.1.3",
"jsurl": "^0.1.4",
"lodash": "^4.17.15",
"lodash-es": "^4.17.15",
"moment": "^2.24.0",
"oclazyload": "^1.1.0",
"ovh-api-services": "^17.0.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/account/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;
}
}
184 changes: 184 additions & 0 deletions packages/manager/apps/account/src/app.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
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-account' when module is deployed
// import Account from '@ovh-ux/manager-account';
import Account from '../../../modules/account/src';
import config, {
getConstants,
} from '../../../modules/account/src/config/config';
import dedicatedUniverseComponents from '../../../modules/account/src/dedicatedUniverseComponents';

import errorPage from './error';

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 = 'AccountApp';

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

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

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

const configConstants = getConstants(environment.getRegion());

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,
dedicatedUniverseComponents,
'oui',
uiRouter,
errorPage,
Account,
...get(__NG_APP_INJECTIONS__, environment.getRegion(), []),
].filter(isString),
)
.constant('shellClient', shellClient)
.constant('constants', {
prodMode: config.prodMode,
swsProxyRootPath: config.swsProxyRootPath,
aapiRootPath: config.aapiRootPath,
target: config.target,
renew: configConstants.RENEW_URL,
urls: configConstants.URLS,
UNIVERS: configConstants.UNIVERS,
TOP_GUIDES: configConstants.TOP_GUIDES,
vmsUrl: configConstants.vmsUrl,
statusUrl: configConstants.statusUrl,
aapiHeaderName: 'X-Ovh-Session',
vrackUrl: configConstants.vrackUrl,
REDIRECT_URLS: configConstants.REDIRECT_URLS,
DEFAULT_LANGUAGE: configConstants.DEFAULT_LANGUAGE,
FALLBACK_LANGUAGE: configConstants.FALLBACK_LANGUAGE,
SUPPORT: configConstants.SUPPORT,
SECTIONS_UNIVERSE_MAP: configConstants.SECTIONS_UNIVERSE_MAP,
})
.constant('website_url', configConstants.website_url)
.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)"
}
Loading

0 comments on commit 1e19a4b

Please sign in to comment.