Skip to content

Commit

Permalink
feat(*): remove users management tab in account and add link to iam
Browse files Browse the repository at this point in the history
ref: MANAGER-12811

Signed-off-by: Romain Jamet <romain.jamet.ext@corp.ovh.com>
  • Loading branch information
Romain Jamet committed Apr 10, 2024
1 parent a2291d9 commit 6e8089b
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"user_account_dashboard_shortcut_PAYMENT_FOLLOW_UP": "Suivre mes paiements",
"user_account_dashboard_shortcut_ADD_PAYMENT_METHOD": "Ajouter un moyen de paiement",
"user_account_dashboard_shortcut_MANAGE_SERVICES": "Gérer mes services",
"user_account_dashboard_shortcut_MANAGE_USERS": "Gérer mes utilisateurs",
"user_account_dashboard_shortcut_ADD_CONTACT": "Ajouter un contact",
"user_account_dashboard_last_bill": "Ma dernière facture",
"user_account_dashboard_last_bill_reference": "Référence",
Expand All @@ -14,5 +15,7 @@
"user_account_dashboard_profile_edit": "Éditer mon profil",
"user_account_dashboard_profile_support_level": "Mon niveau de support :",
"user_account_dashboard_nichandle": "Nichandle",
"user_account_dashboard_customer_code": "Code client"
"user_account_dashboard_customer_code": "Code client",
"user_account_dashboard_banner_users_iam_description": "La fonctionnalité de Gestion des Utilisateurs est désormais accessible via la Gestion des Identités et Accès (IAM).",
"user_account_dashboard_banner_users_iam_link": "Gérer mes utilisateurs"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default {
supportLevel: '<',
user: '<',
authMethodProvider: '<',
iamUsersLink: '<',
},
template,
};
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export const USER_DASHBOARD_SHORTCUTS = [
state: 'app.account.billing.autorenew',
regions: ['EU', 'CA'],
},
{
key: 'MANAGE_USERS',
url: {
baseURL: 'iam',
path: '/dashboard/users',
},
},
{
key: 'ADD_CONTACT',
state: 'app.account.contacts.services',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
<div class="module-useraccount-sections-dashboard">
<div data-ovh-alert="useraccount.alerts.dashboard"></div>
<!-- IAM Users Banner-->
<oui-message data-type="info">
<span
data-translate="user_account_dashboard_banner_users_iam_description"
></span>
<a
class="oui-link_icon"
data-ng-href="{{:: $ctrl.iamUsersLink }}"
target="_blank"
rel="noopener"
>
<span
data-translate="user_account_dashboard_banner_users_iam_link"
></span>
</a>
</oui-message>

<div class="row pt-4">
<div class="col-md-4 mb-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,39 @@ export default /* @ngInject */ ($stateProvider) => {
.execute(null, true)
.$promise.then((lastBill) => head(lastBill.data))
.catch(() => ({})),
shortcuts: /* @ngInject */ ($state, coreConfig, currentUser) =>
shortcuts: /* @ngInject */ (
$state,
coreConfig,
currentUser,
coreURLBuilder,
) =>
USER_DASHBOARD_SHORTCUTS.filter(
({ regions, isAvailable }) =>
(!regions || coreConfig.isRegion(regions)) &&
(!isAvailable || isAvailable(currentUser)),
).map((shortcut) => ({
...shortcut,
href: shortcut.state ? $state.href(shortcut.state) : shortcut.href,
})),
).map((shortcut) => {
let href;

if (shortcut.state) {
href = $state.href(shortcut.state);
} else if (shortcut.url) {
href = coreURLBuilder.buildURL(
shortcut.url.baseURL,
shortcut.url.path,
);
} else {
href = shortcut.href;
}

return {
...shortcut,
href,
};
}),
breadcrumb: () => null,
hideBreadcrumb: () => true,
iamUsersLink: /* @ngInject */ (coreURLBuilder) =>
coreURLBuilder.buildURL('iam', '/dashboard/users'),
},
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,6 @@
"user_account_title_dashboard": "Informations générales",
"user_account_support_level_title": "Mon niveau de support",
"user_account_ssh_keys_title": "Mes clés SSH",
"user_account_users_management_title": "Gestion des utilisateurs",
"user_account_advanced_title": "Paramètres avancés",
"user_account_guides_header": "Guides",
"user_account_guides_header_account_informations_guides": "Informations de compte"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@
data-ng-if="$ctrl.supportLevel"
><span data-translate="user_account_support_level_title"></span>
</oui-header-tabs-item>
<oui-header-tabs-item
data-href="{{ $ctrl.$state.href('app.account.user.users') }}"
data-active="$ctrl.$state.includes('app.account.user.users')"
><span
data-translate="user_account_users_management_title"
></span>
</oui-header-tabs-item>
<oui-header-tabs-item
data-href="{{ $ctrl.$state.href('app.account.user.advanced') }}"
data-active="$ctrl.$state.includes('app.account.user.advanced')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import ipRestriction from './ip/restriction/user-ip-restriction.module';
import newAccountForm from './components/newAccountForm/new-account-form-component.module';
import security from './security/user-security.module';
import supportLevel from './support-level/support-level.module';
import users from './users/users.module';

import routing from './user.routes';

Expand All @@ -39,7 +38,6 @@ angular
newAccountForm,
security,
supportLevel,
users,
])
.config(routing)
.controller(
Expand Down

0 comments on commit 6e8089b

Please sign in to comment.