diff --git a/packages/manager/modules/iam/src/components/deleteEntity/deleteEntity.constants.js b/packages/manager/modules/iam/src/components/deleteEntity/deleteEntity.constants.js index c81d8cbefe3a..8f893f962d1d 100644 --- a/packages/manager/modules/iam/src/components/deleteEntity/deleteEntity.constants.js +++ b/packages/manager/modules/iam/src/components/deleteEntity/deleteEntity.constants.js @@ -29,6 +29,12 @@ export const DELETE_ENTITY_TAG = { error: TAG.RESOURCE_GROUPS__DELETE_GROUP_CONFIRM_BANNER__ERROR, success: TAG.RESOURCE_GROUPS__DELETE_GROUP_CONFIRM_BANNER__SUCCESS, }, + [ENTITY.APPLICATION]: { + close: TAG.DELETE_APPLICATION__CANCEL, + delete: TAG.DELETE_APPLICATION__CONFIRM, + error: TAG.APPLICATIONS__DELETE_APPLICATION_CONFIRM_BANNER__ERROR, + success: TAG.APPLICATIONS__DELETE_APPLICATION_CONFIRM_BANNER__SUCCESS, + }, }; export default { diff --git a/packages/manager/modules/iam/src/components/deleteEntity/deleteEntity.controller.js b/packages/manager/modules/iam/src/components/deleteEntity/deleteEntity.controller.js index 43e7ab51d055..5db09ba3f061 100644 --- a/packages/manager/modules/iam/src/components/deleteEntity/deleteEntity.controller.js +++ b/packages/manager/modules/iam/src/components/deleteEntity/deleteEntity.controller.js @@ -87,6 +87,8 @@ export default class DeleteEntityController { promise = this.deletePolicy(); } else if (this.entity.type === ENTITY.RESOURCE_GROUP) { promise = this.deleteResourceGroup(); + } else if (this.entity.type === ENTITY.APPLICATION) { + promise = this.deleteApplication(); } else if (this.entity.type === ENTITY.RESOURCE_TYPE) { promise = this.$q.when(true); } else { @@ -135,6 +137,14 @@ export default class DeleteEntityController { return this.IAMService.deleteResourceGroup(this.entity.data.id); } + /** + * Delete the entity using the IAMService + * @returns {Promise} + */ + deleteApplication() { + return this.IAMService.deleteApplication(this.entity.data.applicationId); + } + /** * Custom trackClick wrapper witch uses the tagPrefix bound property * @param {'close'|'delete'} tagKey diff --git a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_de_DE.json b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_de_DE.json index 006d9ea4cd88..f121c0a1854c 100644 --- a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_de_DE.json +++ b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_de_DE.json @@ -17,5 +17,11 @@ "iam_delete_entity_resourceType_name": "Löschen des Produkttyps: ", "iam_delete_entity_resourceType_success": "Der Produkttyp wurde gelöscht", "iam_delete_entity_resourceType_warn": "Achtung, mit dieser Aktion werden alle zugehörigen Ressourcen und ausgewählten Aktionen gelöscht", - "iam_delete_entity_secondary_label": "Abbrechen" -} \ No newline at end of file + "iam_delete_entity_secondary_label": "Abbrechen", + "iam_delete_entity_application_error": "Die Anwendung konnte aufgrund eines Fehlers nicht gelöscht werden: {{ message }}", + "iam_delete_entity_application_field": "Bitte geben Sie das Wort „{{ statement }}“ ein, um das Löschen Ihrer Anwendung zu bestätigen.", + "iam_delete_entity_application_heading": "Anwendung löschen", + "iam_delete_entity_application_name": "Löschung der Anwendung: ", + "iam_delete_entity_application_success": "Anwendung gelöscht", + "iam_delete_entity_application_warn": "Warnung: Durch diese Aktion wird die Anwendung gelöscht und alle dieser Anwendung zugeordneten Zertifikate werden widerrufen." +} diff --git a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_en_GB.json b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_en_GB.json index 368d8d7d0f2b..e11a76903cef 100644 --- a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_en_GB.json +++ b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_en_GB.json @@ -17,5 +17,11 @@ "iam_delete_entity_resourceType_name": "Deleting product type: ", "iam_delete_entity_resourceType_success": "Product type deleted", "iam_delete_entity_resourceType_warn": "Warning: this action will delete the associated resources and the selected actions", - "iam_delete_entity_secondary_label": "Exit" -} \ No newline at end of file + "iam_delete_entity_secondary_label": "Exit", + "iam_delete_entity_application_error": "An error occurred deleting the application: {{ message }}", + "iam_delete_entity_application_field": "Please enter the word “{{ statement }}” to confirm the deletion of your application", + "iam_delete_entity_application_heading": "Delete an application", + "iam_delete_entity_application_name": "Delete application: ", + "iam_delete_entity_application_success": "Application deleted", + "iam_delete_entity_application_warn": "Warning: This action will delete the application and revoke all associated certificates." +} diff --git a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_es_ES.json b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_es_ES.json index 287455a67170..d1cecfc635f6 100644 --- a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_es_ES.json +++ b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_es_ES.json @@ -17,5 +17,11 @@ "iam_delete_entity_resourceType_name": "Eliminación del tipo de producto: ", "iam_delete_entity_resourceType_success": "El tipo de producto se ha eliminado correctamente", "iam_delete_entity_resourceType_warn": "Atención: Esta acción eliminará los recursos asociados y las acciones seleccionadas", - "iam_delete_entity_secondary_label": "Cancelar" -} \ No newline at end of file + "iam_delete_entity_secondary_label": "Cancelar", + "iam_delete_entity_application_error": "No se ha podido eliminar la aplicación debido a un error: {{ message }}", + "iam_delete_entity_application_field": "Introduzca la palabra «{{ statement }}» para confirmar la eliminación de su aplicación.", + "iam_delete_entity_application_heading": "Eliminar una aplicación", + "iam_delete_entity_application_name": "Eliminación de la aplicación: ", + "iam_delete_entity_application_success": "Aplicación eliminada", + "iam_delete_entity_application_warn": "Importante: esta acción eliminará la aplicación y revocará todos los certificados asociados a dicha aplicación." +} diff --git a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_fr_CA.json b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_fr_CA.json index 1daca17d53e9..cc9782db9345 100644 --- a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_fr_CA.json +++ b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_fr_CA.json @@ -12,10 +12,16 @@ "iam_delete_entity_resourceGroup_name": "Suppression du groupe de ressources : ", "iam_delete_entity_resourceGroup_success": "Le groupe de ressources a bien été supprimé", "iam_delete_entity_resourceGroup_warn": "Êtes-vous sûr.e de confirmer la suppression ?", + "iam_delete_entity_application_error": "L'application n'a pas pu être supprimée en raison d'une erreur : {{ message }}", + "iam_delete_entity_application_field": "Veuillez entrer le mot \"{{ statement }}\" pour confirmer la suppression de votre application", + "iam_delete_entity_application_heading": "Supprimer une application", + "iam_delete_entity_application_name": "Suppression de l'application : ", + "iam_delete_entity_application_success": "Application supprimée", + "iam_delete_entity_application_warn": "Avertissement : cette action supprimera l'application et révoquera tous les certificats associées à cette application.", "iam_delete_entity_resourceType_error": "Une erreur est survenue lors de la suppression du type de produit : {{ message }}", "iam_delete_entity_resourceType_heading": "Supprimer un type de produit", "iam_delete_entity_resourceType_name": "Suppression du type de produit : ", "iam_delete_entity_resourceType_success": "Le type de produit a bien été supprimé", "iam_delete_entity_resourceType_warn": "Attention, cette action va entrainer la suppression des ressources associées et des actions sélectionnées", "iam_delete_entity_secondary_label": "Annuler" -} \ No newline at end of file +} diff --git a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_fr_FR.json b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_fr_FR.json index ee9760ceb484..cc9782db9345 100644 --- a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_fr_FR.json +++ b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_fr_FR.json @@ -12,6 +12,12 @@ "iam_delete_entity_resourceGroup_name": "Suppression du groupe de ressources : ", "iam_delete_entity_resourceGroup_success": "Le groupe de ressources a bien été supprimé", "iam_delete_entity_resourceGroup_warn": "Êtes-vous sûr.e de confirmer la suppression ?", + "iam_delete_entity_application_error": "L'application n'a pas pu être supprimée en raison d'une erreur : {{ message }}", + "iam_delete_entity_application_field": "Veuillez entrer le mot \"{{ statement }}\" pour confirmer la suppression de votre application", + "iam_delete_entity_application_heading": "Supprimer une application", + "iam_delete_entity_application_name": "Suppression de l'application : ", + "iam_delete_entity_application_success": "Application supprimée", + "iam_delete_entity_application_warn": "Avertissement : cette action supprimera l'application et révoquera tous les certificats associées à cette application.", "iam_delete_entity_resourceType_error": "Une erreur est survenue lors de la suppression du type de produit : {{ message }}", "iam_delete_entity_resourceType_heading": "Supprimer un type de produit", "iam_delete_entity_resourceType_name": "Suppression du type de produit : ", diff --git a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_it_IT.json b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_it_IT.json index 3df4020dd370..d7bee04d3205 100644 --- a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_it_IT.json +++ b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_it_IT.json @@ -17,5 +17,11 @@ "iam_delete_entity_resourceType_name": "Eliminazione del tipo di prodotto: ", "iam_delete_entity_resourceType_success": "Il tipo di prodotto è stato eliminato correttamente", "iam_delete_entity_resourceType_warn": "Attenzione: questa azione comporta l'eliminazione delle risorse associate e delle azioni selezionate", - "iam_delete_entity_secondary_label": "Annullare" -} \ No newline at end of file + "iam_delete_entity_secondary_label": "Annullare", + "iam_delete_entity_application_error": "Impossibile eliminare l’applicazione a causa di un errore: {{ message }}", + "iam_delete_entity_application_field": "Inserisci la parola \"{{ statement }}\" per confermare l'eliminazione della tua applicazione.", + "iam_delete_entity_application_heading": "Eliminare un'applicazione", + "iam_delete_entity_application_name": "Eliminazione dell'applicazione ", + "iam_delete_entity_application_success": "Applicazione eliminata", + "iam_delete_entity_application_warn": "Importante: questa azione comporta l'eliminazione dell'applicazione e la revoca di tutti i certificati ad essa associati." +} diff --git a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_pl_PL.json b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_pl_PL.json index c512113f2db7..ce1f1b23aa8c 100644 --- a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_pl_PL.json +++ b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_pl_PL.json @@ -17,5 +17,11 @@ "iam_delete_entity_resourceType_name": "Usuwanie typu usługi: ", "iam_delete_entity_resourceType_success": "Typ usługi został usunięty", "iam_delete_entity_resourceType_warn": "Uwaga, ta operacja spowoduje usunięcie zasobów i powiązanych operacji.", - "iam_delete_entity_secondary_label": "Anuluj" -} \ No newline at end of file + "iam_delete_entity_secondary_label": "Anuluj", + "iam_delete_entity_application_error": "Aplikacja nie mogła zostać usunięta z powodu błędu: {{message}}", + "iam_delete_entity_application_field": "Wpisz słowo „{{ statement }}”, aby potwierdzić usunięcie aplikacji.", + "iam_delete_entity_application_heading": "Usuń aplikację", + "iam_delete_entity_application_name": "Usuwanie aplikacji: ", + "iam_delete_entity_application_success": "Aplikacja usunięta", + "iam_delete_entity_application_warn": "Ostrzeżenie: ta operacja spowoduje usunięcie aplikacji i unieważni wszystkie certyfikaty powiązane z tą aplikacją." +} diff --git a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_pt_PT.json b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_pt_PT.json index 15f5ffc05302..90533620e180 100644 --- a/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_pt_PT.json +++ b/packages/manager/modules/iam/src/components/deleteEntity/translations/Messages_pt_PT.json @@ -17,5 +17,11 @@ "iam_delete_entity_resourceType_name": "Eliminação do tipo de produto: ", "iam_delete_entity_resourceType_success": "O tipo de produto foi eliminado com sucesso", "iam_delete_entity_resourceType_warn": "Atenção, esta ação levará à eliminação dos recursos associados e das ações selecionadas", - "iam_delete_entity_secondary_label": "Anular" -} \ No newline at end of file + "iam_delete_entity_secondary_label": "Anular", + "iam_delete_entity_application_error": "Não foi possível eliminar a aplicação devido a um erro: {{ message }}", + "iam_delete_entity_application_field": "Introduza a palavra \"{{ statement }}\" para confirmar a eliminação da sua aplicação", + "iam_delete_entity_application_heading": "Eliminar uma aplicação", + "iam_delete_entity_application_name": "Eliminação da aplicação: ", + "iam_delete_entity_application_success": "Aplicação eliminada", + "iam_delete_entity_application_warn": "Atenção: esta ação eliminará a aplicação e revogará todos os certificados associados a esta aplicação." +} diff --git a/packages/manager/modules/iam/src/dashboard/applications/applications.component.js b/packages/manager/modules/iam/src/dashboard/applications/applications.component.js new file mode 100644 index 000000000000..73fb0aac643c --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/applications.component.js @@ -0,0 +1,13 @@ +import controller from './applications.controller'; +import template from './applications.template.html'; + +export default { + bindings: { + applications: '<', + alert: '<', + goTo: '<', + trackClick: '<', + }, + controller, + template, +}; diff --git a/packages/manager/modules/iam/src/dashboard/applications/applications.controller.js b/packages/manager/modules/iam/src/dashboard/applications/applications.controller.js new file mode 100644 index 000000000000..06eabc3a15f5 --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/applications.controller.js @@ -0,0 +1,23 @@ +import { AbstractCursorDatagridController } from '@ovh-ux/manager-ng-apiv2-helper'; +import { TAG } from '../../iam.constants'; + +export default class ApplicationsController extends AbstractCursorDatagridController { + /* @ngInject */ + constructor(IAMService) { + super(); + this.IAMService = IAMService; + } + + /** + * Go to resourceGroup deletion + * @param {string} id The application id + * @returns {Promise} + */ + deleteApplication(id) { + this.trackClick(TAG.APPLICATIONS__DELETE); + this.goTo({ + name: 'iam.dashboard.applications.delete', + params: { application: id }, + }); + } +} diff --git a/packages/manager/modules/iam/src/dashboard/applications/applications.module.js b/packages/manager/modules/iam/src/dashboard/applications/applications.module.js new file mode 100644 index 000000000000..7964aa5aaa33 --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/applications.module.js @@ -0,0 +1,15 @@ +import angular from 'angular'; + +import component from './applications.component'; +import routing from './applications.routing'; +import deleteModule from './delete'; + +const moduleName = 'ovhManagerIAMDashboardApplications'; + +angular + .module(moduleName, [deleteModule]) + .component('iamApplications', component) + .config(routing) + .run(/* @ngTranslationsInject:json ./translations */); + +export default moduleName; diff --git a/packages/manager/modules/iam/src/dashboard/applications/applications.routing.js b/packages/manager/modules/iam/src/dashboard/applications/applications.routing.js new file mode 100644 index 000000000000..ab3a7af20b89 --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/applications.routing.js @@ -0,0 +1,16 @@ +import { TAG } from '../../iam.constants'; + +export default /* @ngInject */ ($stateProvider) => { + $stateProvider.state('iam.dashboard.applications', { + url: '/applications?cursors', + component: 'iamApplications', + resolve: { + breadcrumb: () => null, + applications: /* @ngInject */ (IAMService) => + IAMService.getApplications(), + }, + atInternet: { + rename: TAG.APPLICATIONS, + }, + }); +}; diff --git a/packages/manager/modules/iam/src/dashboard/applications/applications.template.html b/packages/manager/modules/iam/src/dashboard/applications/applications.template.html new file mode 100644 index 000000000000..a3b2df6f42f3 --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/applications.template.html @@ -0,0 +1,58 @@ +
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/packages/manager/modules/iam/src/dashboard/applications/delete/delete.module.js b/packages/manager/modules/iam/src/dashboard/applications/delete/delete.module.js new file mode 100644 index 000000000000..db5b906b908a --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/delete/delete.module.js @@ -0,0 +1,10 @@ +import angular from 'angular'; + +import deleteEntity from '../../../components/deleteEntity'; +import routing from './delete.routing'; + +const moduleName = 'ovhManagerIAMDashboardApplicationsDelete'; + +angular.module(moduleName, [deleteEntity]).config(routing); + +export default moduleName; diff --git a/packages/manager/modules/iam/src/dashboard/applications/delete/delete.routing.js b/packages/manager/modules/iam/src/dashboard/applications/delete/delete.routing.js new file mode 100644 index 000000000000..90a843484806 --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/delete/delete.routing.js @@ -0,0 +1,43 @@ +import { ENTITY, TAG } from '../../../iam.constants'; + +export default /* @ngInject */ ($stateProvider) => { + $stateProvider.state('iam.dashboard.applications.delete', { + url: '/delete/{application:string}', + component: 'iamDeleteEntity', + resolve: { + breadcrumb: () => null, + + /** + * A polymorphic DTO required by the deleteEntity component + * @returns {{ + * data: Object, + * type: string + * }|null} + */ + entity: /* @ngInject */ (application) => { + if (application) { + return { data: application, type: ENTITY.APPLICATION }; + } + return null; + }, + + /** + * The application to delete if an id is provided + * @returns {Object|null} + */ + application: /* @ngInject */ ($transition$, IAMService) => { + const { application: id } = $transition$.params(); + return id ? IAMService.getApplication(id) : null; + }, + + /** + * Whether the entity requires a statement + * @returns {boolean} + */ + statement: /* @ngInject */ (entity) => entity.type === ENTITY.APPLICATION, + }, + atInternet: { + rename: TAG.DELETE_APPLICATION, + }, + }); +}; diff --git a/packages/manager/modules/iam/src/dashboard/applications/delete/index.js b/packages/manager/modules/iam/src/dashboard/applications/delete/index.js new file mode 100644 index 000000000000..eef7e516159b --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/delete/index.js @@ -0,0 +1,22 @@ +import angular from 'angular'; +import uiRouter from '@uirouter/angularjs'; +import ocLazyLoad from 'oclazyload'; + +const moduleName = 'ovhManagerIAMDashboardApplicationsDeleteLazyLoading'; + +angular.module(moduleName, [uiRouter, ocLazyLoad]).config( + /* @ngInject */ ($stateProvider) => { + $stateProvider.state('iam.dashboard.applications.delete.**', { + url: '/delete/{application:string}', + lazyLoad: (transition) => + import('./delete.module').then((module) => + transition + .injector() + .get('$ocLazyLoad') + .inject(module.default), + ), + }); + }, +); + +export default moduleName; diff --git a/packages/manager/modules/iam/src/dashboard/applications/index.js b/packages/manager/modules/iam/src/dashboard/applications/index.js new file mode 100644 index 000000000000..23a1506e0af1 --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/index.js @@ -0,0 +1,22 @@ +import angular from 'angular'; +import uiRouter from '@uirouter/angularjs'; +import ocLazyLoad from 'oclazyload'; + +const moduleName = 'ovhManagerIAMDashboardApplicationsLazyLoading'; + +angular.module(moduleName, [uiRouter, ocLazyLoad]).config( + /* @ngInject */ ($stateProvider) => { + $stateProvider.state('iam.dashboard.applications.**', { + url: '/applications', + lazyLoad: (transition) => + import('./applications.module').then((module) => + transition + .injector() + .get('$ocLazyLoad') + .inject(module.default), + ), + }); + }, +); + +export default moduleName; diff --git a/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_de_DE.json b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_de_DE.json new file mode 100644 index 000000000000..292d38ac9135 --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_de_DE.json @@ -0,0 +1,11 @@ +{ + "iam_applications_datagrid_column_application_id": "ID", + "iam_applications_datagrid_column_application_name": "Name", + "iam_applications_datagrid_column_application_description": "Beschreibung", + "iam_applications_datagrid_column_application_status": "Status", + "iam_applications_datagrid_column_application_key": "Schlüssel", + "iam_applications_datagrid_column_application_status_active": "Aktiv", + "iam_applications_datagrid_column_application_status_inactive": "Deaktiviert", + "iam_applications_datagrid_action_delete_application": "Löschen", + "iam_applications_description": "Sehen Sie sich Ihre Anwendungen an und verwalten Sie sie. Weitere Informationen zu den Anwendungen finden Sie in der Dokumentation." +} diff --git a/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_en_GB.json b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_en_GB.json new file mode 100644 index 000000000000..eb0dc3a6b6f2 --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_en_GB.json @@ -0,0 +1,11 @@ +{ + "iam_applications_datagrid_column_application_id": "ID", + "iam_applications_datagrid_column_application_name": "Name", + "iam_applications_datagrid_column_application_description": "Description", + "iam_applications_datagrid_column_application_status": "Status", + "iam_applications_datagrid_column_application_key": "Key", + "iam_applications_datagrid_column_application_status_active": "Active", + "iam_applications_datagrid_column_application_status_inactive": "Disabled", + "iam_applications_datagrid_action_delete_application": "Delete", + "iam_applications_description": "View and manage your applications. For more information about applications, see documentation." +} diff --git a/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_es_ES.json b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_es_ES.json new file mode 100644 index 000000000000..2ba0941effaf --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_es_ES.json @@ -0,0 +1,11 @@ +{ + "iam_applications_datagrid_column_application_id": "ID", + "iam_applications_datagrid_column_application_name": "Apellido", + "iam_applications_datagrid_column_application_description": "Descripción", + "iam_applications_datagrid_column_application_status": "Estado", + "iam_applications_datagrid_column_application_key": "Clave", + "iam_applications_datagrid_column_application_status_active": "Activo", + "iam_applications_datagrid_column_application_status_inactive": "Desactivada", + "iam_applications_datagrid_action_delete_application": "Eliminar", + "iam_applications_description": "Consulte y gestione sus aplicaciones. Para más información sobre las aplicaciones, consulte la documentación." +} diff --git a/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_fr_CA.json b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_fr_CA.json new file mode 100644 index 000000000000..6ab3b987bcff --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_fr_CA.json @@ -0,0 +1,11 @@ +{ + "iam_applications_datagrid_column_application_id": "ID", + "iam_applications_datagrid_column_application_name": "Nom", + "iam_applications_datagrid_column_application_description": "Description", + "iam_applications_datagrid_column_application_status": "Statut", + "iam_applications_datagrid_column_application_key": "Clé", + "iam_applications_datagrid_column_application_status_active": "Active", + "iam_applications_datagrid_column_application_status_inactive": "Désactivée", + "iam_applications_datagrid_action_delete_application": "Supprimer", + "iam_applications_description": "Consultez et gérez vos applications. Pour plus d'informations sur les applications, consultez la documentation." +} diff --git a/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_fr_FR.json b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_fr_FR.json new file mode 100644 index 000000000000..6ab3b987bcff --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_fr_FR.json @@ -0,0 +1,11 @@ +{ + "iam_applications_datagrid_column_application_id": "ID", + "iam_applications_datagrid_column_application_name": "Nom", + "iam_applications_datagrid_column_application_description": "Description", + "iam_applications_datagrid_column_application_status": "Statut", + "iam_applications_datagrid_column_application_key": "Clé", + "iam_applications_datagrid_column_application_status_active": "Active", + "iam_applications_datagrid_column_application_status_inactive": "Désactivée", + "iam_applications_datagrid_action_delete_application": "Supprimer", + "iam_applications_description": "Consultez et gérez vos applications. Pour plus d'informations sur les applications, consultez la documentation." +} diff --git a/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_it_IT.json b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_it_IT.json new file mode 100644 index 000000000000..2500bc91f738 --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_it_IT.json @@ -0,0 +1,11 @@ +{ + "iam_applications_datagrid_column_application_id": "ID", + "iam_applications_datagrid_column_application_name": "Cognome", + "iam_applications_datagrid_column_application_description": "Descrizione", + "iam_applications_datagrid_column_application_status": "Stato", + "iam_applications_datagrid_column_application_key": "Chiave", + "iam_applications_datagrid_column_application_status_active": "Attivo", + "iam_applications_datagrid_column_application_status_inactive": "Disattivata", + "iam_applications_datagrid_action_delete_application": "Eliminare", + "iam_applications_description": "Consulta e gestisci le tue applicazioni. Per maggiori informazioni sulle applicazioni, consulta la documentazione." +} diff --git a/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_pl_PL.json b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_pl_PL.json new file mode 100644 index 000000000000..57f467a0b739 --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_pl_PL.json @@ -0,0 +1,11 @@ +{ + "iam_applications_datagrid_column_application_id": "ID", + "iam_applications_datagrid_column_application_name": "Nazwisko", + "iam_applications_datagrid_column_application_description": "Opis", + "iam_applications_datagrid_column_application_status": "Status", + "iam_applications_datagrid_column_application_key": "Klucz", + "iam_applications_datagrid_column_application_status_active": "Aktywny", + "iam_applications_datagrid_column_application_status_inactive": "Wyłączona", + "iam_applications_datagrid_action_delete_application": "Usuń", + "iam_applications_description": "Wyświetlaj aplikacje i zarządzaj nimi. Więcej informacji na temat aplikacji znajdziesz w dokumentacji." +} diff --git a/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_pt_PT.json b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_pt_PT.json new file mode 100644 index 000000000000..d92639faa317 --- /dev/null +++ b/packages/manager/modules/iam/src/dashboard/applications/translations/Messages_pt_PT.json @@ -0,0 +1,11 @@ +{ + "iam_applications_datagrid_column_application_id": "ID", + "iam_applications_datagrid_column_application_name": "Nome", + "iam_applications_datagrid_column_application_description": "Descrição", + "iam_applications_datagrid_column_application_status": "Estado", + "iam_applications_datagrid_column_application_key": "Chave", + "iam_applications_datagrid_column_application_status_active": "Ativo", + "iam_applications_datagrid_column_application_status_inactive": "Désactivée", + "iam_applications_datagrid_action_delete_application": "Eliminar", + "iam_applications_description": "Consulte e faça a gestão das suas aplicações. Para obter mais informações sobre as aplicações, consulte a documentação." +} diff --git a/packages/manager/modules/iam/src/dashboard/dashboard.module.js b/packages/manager/modules/iam/src/dashboard/dashboard.module.js index 5a61865b226b..8a48ad100465 100644 --- a/packages/manager/modules/iam/src/dashboard/dashboard.module.js +++ b/packages/manager/modules/iam/src/dashboard/dashboard.module.js @@ -2,6 +2,7 @@ import angular from 'angular'; import policies from './policies'; import resourceGroups from './resourceGroups'; +import applications from './applications'; import users from './users/users.module'; import component from './dashboard.component'; @@ -10,7 +11,7 @@ import routing from './dashboard.routing'; const moduleName = 'ovhManagerIAMDashboard'; angular - .module(moduleName, [policies, resourceGroups, users]) + .module(moduleName, [policies, resourceGroups, applications, users]) .component('iamDashboard', component) .config(routing) .run(/* @ngTranslationsInject:json ./translations */); diff --git a/packages/manager/modules/iam/src/dashboard/dashboard.template.html b/packages/manager/modules/iam/src/dashboard/dashboard.template.html index 3635635ac992..235edf80be4c 100644 --- a/packages/manager/modules/iam/src/dashboard/dashboard.template.html +++ b/packages/manager/modules/iam/src/dashboard/dashboard.template.html @@ -19,6 +19,11 @@ data-translate="iam_dashboard_header_tabs_item_resource_groups" > + diff --git a/packages/manager/modules/iam/src/dashboard/translations/Messages_de_DE.json b/packages/manager/modules/iam/src/dashboard/translations/Messages_de_DE.json index b526d0f1b02b..1e2dde764361 100644 --- a/packages/manager/modules/iam/src/dashboard/translations/Messages_de_DE.json +++ b/packages/manager/modules/iam/src/dashboard/translations/Messages_de_DE.json @@ -4,5 +4,6 @@ "iam_dashboard_header_tabs_item_identities": "Identitäten", "iam_dashboard_header_tabs_item_policies": "Richtlinien", "iam_dashboard_header_tabs_item_resource_groups": "Ressourcengruppen", - "iam_error": "Sie sind nicht berechtigt, diese Aktion durchzuführen: {{details}}" + "iam_error": "Sie sind nicht berechtigt, diese Aktion durchzuführen: {{details}}", + "iam_dashboard_header_tabs_item_applications": "Anwendungen" } diff --git a/packages/manager/modules/iam/src/dashboard/translations/Messages_en_GB.json b/packages/manager/modules/iam/src/dashboard/translations/Messages_en_GB.json index 1aafc09e982a..2e4ef2ab49c0 100644 --- a/packages/manager/modules/iam/src/dashboard/translations/Messages_en_GB.json +++ b/packages/manager/modules/iam/src/dashboard/translations/Messages_en_GB.json @@ -4,5 +4,6 @@ "iam_dashboard_header_tabs_item_identities": "Identities", "iam_dashboard_header_tabs_item_policies": "Policies", "iam_dashboard_header_tabs_item_resource_groups": "Resource groups", - "iam_error": "You do not have the permissions to perform this action: {{details}}" + "iam_error": "You do not have the permissions to perform this action: {{details}}", + "iam_dashboard_header_tabs_item_applications": "Applications" } diff --git a/packages/manager/modules/iam/src/dashboard/translations/Messages_es_ES.json b/packages/manager/modules/iam/src/dashboard/translations/Messages_es_ES.json index d5c77f367e67..e5705458e829 100644 --- a/packages/manager/modules/iam/src/dashboard/translations/Messages_es_ES.json +++ b/packages/manager/modules/iam/src/dashboard/translations/Messages_es_ES.json @@ -4,5 +4,6 @@ "iam_dashboard_header_tabs_item_identities": "Identidades", "iam_dashboard_header_tabs_item_policies": "Políticas", "iam_dashboard_header_tabs_item_resource_groups": "Grupos de recursos", - "iam_error": "No tiene permisos para realizar esta acción: {{details}}" + "iam_error": "No tiene permisos para realizar esta acción: {{details}}", + "iam_dashboard_header_tabs_item_applications": "Aplicaciones" } diff --git a/packages/manager/modules/iam/src/dashboard/translations/Messages_fr_CA.json b/packages/manager/modules/iam/src/dashboard/translations/Messages_fr_CA.json index d94cde1eb64d..783923c7c582 100644 --- a/packages/manager/modules/iam/src/dashboard/translations/Messages_fr_CA.json +++ b/packages/manager/modules/iam/src/dashboard/translations/Messages_fr_CA.json @@ -4,5 +4,6 @@ "iam_dashboard_header_heading": "Gestion des identités et des accès (IAM)", "iam_dashboard_header_tabs_item_identities": "Identités", "iam_dashboard_header_tabs_item_policies": "Politiques", - "iam_dashboard_header_tabs_item_resource_groups": "Groupes de ressources" + "iam_dashboard_header_tabs_item_resource_groups": "Groupes de ressources", + "iam_dashboard_header_tabs_item_applications": "Applications" } diff --git a/packages/manager/modules/iam/src/dashboard/translations/Messages_fr_FR.json b/packages/manager/modules/iam/src/dashboard/translations/Messages_fr_FR.json index d94cde1eb64d..783923c7c582 100644 --- a/packages/manager/modules/iam/src/dashboard/translations/Messages_fr_FR.json +++ b/packages/manager/modules/iam/src/dashboard/translations/Messages_fr_FR.json @@ -4,5 +4,6 @@ "iam_dashboard_header_heading": "Gestion des identités et des accès (IAM)", "iam_dashboard_header_tabs_item_identities": "Identités", "iam_dashboard_header_tabs_item_policies": "Politiques", - "iam_dashboard_header_tabs_item_resource_groups": "Groupes de ressources" + "iam_dashboard_header_tabs_item_resource_groups": "Groupes de ressources", + "iam_dashboard_header_tabs_item_applications": "Applications" } diff --git a/packages/manager/modules/iam/src/dashboard/translations/Messages_it_IT.json b/packages/manager/modules/iam/src/dashboard/translations/Messages_it_IT.json index bd914dfad326..0ea8f4962eb7 100644 --- a/packages/manager/modules/iam/src/dashboard/translations/Messages_it_IT.json +++ b/packages/manager/modules/iam/src/dashboard/translations/Messages_it_IT.json @@ -4,5 +4,6 @@ "iam_dashboard_header_tabs_item_identities": "Identità", "iam_dashboard_header_tabs_item_policies": "Policy", "iam_dashboard_header_tabs_item_resource_groups": "Gruppi di risorse", - "iam_error": "Non hai i permessi per effettuare questa azione: {{details}}" + "iam_error": "Non hai i permessi per effettuare questa azione: {{details}}", + "iam_dashboard_header_tabs_item_applications": "Applicazioni" } diff --git a/packages/manager/modules/iam/src/dashboard/translations/Messages_pl_PL.json b/packages/manager/modules/iam/src/dashboard/translations/Messages_pl_PL.json index 83ac4882eac1..1ee086eedaaa 100644 --- a/packages/manager/modules/iam/src/dashboard/translations/Messages_pl_PL.json +++ b/packages/manager/modules/iam/src/dashboard/translations/Messages_pl_PL.json @@ -4,5 +4,6 @@ "iam_dashboard_header_tabs_item_identities": "Tożsamości", "iam_dashboard_header_tabs_item_policies": "Polityki", "iam_dashboard_header_tabs_item_resource_groups": "Grupy zasobów", - "iam_error": "Nie masz uprawnień do wykonania tej operacji: {{details}}" + "iam_error": "Nie masz uprawnień do wykonania tej operacji: {{details}}", + "iam_dashboard_header_tabs_item_applications": "Aplikacje" } diff --git a/packages/manager/modules/iam/src/dashboard/translations/Messages_pt_PT.json b/packages/manager/modules/iam/src/dashboard/translations/Messages_pt_PT.json index 8dec47bac2dc..61fdacce0c1a 100644 --- a/packages/manager/modules/iam/src/dashboard/translations/Messages_pt_PT.json +++ b/packages/manager/modules/iam/src/dashboard/translations/Messages_pt_PT.json @@ -4,5 +4,6 @@ "iam_dashboard_header_tabs_item_identities": "Identidades", "iam_dashboard_header_tabs_item_policies": "Políticas", "iam_dashboard_header_tabs_item_resource_groups": "Grupos de recursos", - "iam_error": "Não tem permissões para realizar esta ação: {{details}}" + "iam_error": "Não tem permissões para realizar esta ação: {{details}}", + "iam_dashboard_header_tabs_item_applications": "Aplicações" } diff --git a/packages/manager/modules/iam/src/iam.constants.js b/packages/manager/modules/iam/src/iam.constants.js index d8d49907fbeb..a167d73ca29c 100644 --- a/packages/manager/modules/iam/src/iam.constants.js +++ b/packages/manager/modules/iam/src/iam.constants.js @@ -35,6 +35,7 @@ const ENTITY = { IDENTITY: 'identity', RESOURCE_GROUP: 'resourceGroup', RESOURCE_TYPE: 'resourceType', + APPLICATION: 'application', }; const ENTITY_NAME_PATTERN = /^[a-zA-Z0-9-/_+]*$/; @@ -192,6 +193,11 @@ const TAG = { 'dedicated::account::iam::delete-group-ressources::cancel', DELETE_RESOURCE_GROUP__CONFIRM: 'dedicated::account::iam::delete-group-ressources::confirm', + DELETE_APPLICATION: 'dedicated::account::iam::delete-application', + DELETE_APPLICATION__CANCEL: + 'dedicated::account::iam::delete-application::cancel', + DELETE_APPLICATION__CONFIRM: + 'dedicated::account::iam::delete-application::confirm', // Policy edition EDIT_POLICY: 'dedicated::account::iam::edit-policy', @@ -254,6 +260,16 @@ const TAG = { RESOURCE_GROUPS__EDIT_GROUP_CONFIRM_BANNER__SUCCESS: 'iam::group-ressources::edit-group-confirm-banner::success', + // List of applications + APPLICATIONS: 'dedicated::account::iam::applications', + APPLICATIONS__DELETE: 'dedicated::account::iam::applications::delete', + + // List of applications - banners + APPLICATIONS__DELETE_APPLICATION_CONFIRM_BANNER__ERROR: + 'dedicated::account::iam::applications::delete-application::confirm-banner::error', + APPLICATIONS__DELETE_APPLICATION_CONFIRM_BANNER__SUCCESS: + 'dedicated::account::iam::applications::delete-application::confirm-banner::success', + // Commons ADD_ACTION_MANUALLY_SUCCESS: 'add-manually-success', ADD_ACTION_MANUALLY: 'add-manually', diff --git a/packages/manager/modules/iam/src/iam.service.js b/packages/manager/modules/iam/src/iam.service.js index 6dac09cd64d4..e181eb44f242 100644 --- a/packages/manager/modules/iam/src/iam.service.js +++ b/packages/manager/modules/iam/src/iam.service.js @@ -11,6 +11,7 @@ export const URL = { RESOURCE_GROUP: '/engine/api/v2/iam/resourceGroup', RESOURCE_TYPE: '/engine/api/v2/iam/reference/resource/type', PERMISSIONS_GROUPS: '/engine/api/v2/iam/permissionsGroup', + APPLICATIONS: '/me/api/application', }; export default class IAMService { @@ -489,4 +490,38 @@ export default class IAMService { data, }).then(({ data: resourceGroup }) => resourceGroup); } + + /** + * Retrieves a list of all applications. + * @returns {Promise} A Promise that resolves to an array of application objects, or null if an application fetch fails. + */ + getApplications() { + return this.$http + .get(URL.APPLICATIONS) + .then(({ data }) => + this.$q.all( + data + .map((id) => this.getApplication(id).catch(() => null)) + .filter((application) => application !== null), + ), + ); + } + + /** + * Retrieves the details of a specific application. + * @param {string} id The unique identifier of the application. + * @returns {Promise} A Promise that resolves to the application object. + */ + getApplication(id) { + return this.$http.get(`${URL.APPLICATIONS}/${id}`).then(({ data }) => data); + } + + /** + * Deletes an application. + * @param {string} id The unique identifier of the application to be deleted. + * @returns {Promise} A Promise that resolves when the deletion is complete. + */ + deleteApplication(id) { + return this.$http.delete(`${URL.APPLICATIONS}/${id}`); + } }