From e9332e2b4af912756df74e02227d0c776fde7c42 Mon Sep 17 00:00:00 2001 From: Tristan WAGNER Date: Thu, 14 Nov 2024 17:55:35 +0100 Subject: [PATCH 1/8] feat(zimbra): add autoreply delete modal (#13970) ref: MANAGER-15841 Signed-off-by: Tristan WAGNER Co-authored-by: CDS Translator Agent --- .../autoReplies/delete/Messages_de_DE.json | 8 ++ .../autoReplies/delete/Messages_en_GB.json | 8 ++ .../autoReplies/delete/Messages_es_ES.json | 8 ++ .../autoReplies/delete/Messages_fr_CA.json | 8 ++ .../autoReplies/delete/Messages_fr_FR.json | 8 ++ .../autoReplies/delete/Messages_it_IT.json | 8 ++ .../autoReplies/delete/Messages_pl_PL.json | 8 ++ .../autoReplies/delete/Messages_pt_PT.json | 8 ++ .../dashboard/Messages_de_DE.json | 3 +- .../dashboard/Messages_en_GB.json | 3 +- .../dashboard/Messages_es_ES.json | 3 +- .../dashboard/Messages_fr_CA.json | 3 +- .../dashboard/Messages_fr_FR.json | 3 +- .../dashboard/Messages_it_IT.json | 3 +- .../dashboard/Messages_pl_PL.json | 3 +- .../dashboard/Messages_pt_PT.json | 3 +- .../ActionButtonAutoReply.component.tsx | 53 +++++++++ .../dashboard/AutoReplies/AutoReplies.tsx | 28 +---- .../ModalDeleteAutoReply.component.tsx | 110 ++++++++++++++++++ .../zimbra/src/routes/routes.constants.ts | 1 + .../manager/apps/zimbra/src/routes/routes.tsx | 11 ++ .../zimbra/src/utils/iamAction.constants.ts | 5 + .../apps/zimbra/src/utils/test.provider.tsx | 4 + 23 files changed, 270 insertions(+), 30 deletions(-) create mode 100644 packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_de_DE.json create mode 100644 packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_en_GB.json create mode 100644 packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_es_ES.json create mode 100644 packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_fr_CA.json create mode 100644 packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_fr_FR.json create mode 100644 packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_it_IT.json create mode 100644 packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_pl_PL.json create mode 100644 packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_pt_PT.json create mode 100644 packages/manager/apps/zimbra/src/pages/dashboard/AutoReplies/ActionButtonAutoReply.component.tsx create mode 100644 packages/manager/apps/zimbra/src/pages/dashboard/AutoReplies/ModalDeleteAutoReply.component.tsx diff --git a/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_de_DE.json b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_de_DE.json new file mode 100644 index 000000000000..677dd3841b17 --- /dev/null +++ b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_de_DE.json @@ -0,0 +1,8 @@ +{ + "zimbra_auto_replies_delete_success_message": "Ihre Anfrage zur Löschung wurde registriert. Sie wird in einigen Augenblicken ausgeführt.", + "zimbra_auto_replies_delete_error_message": "Ihre Anfrage zum Löschen konnte nicht abgeschlossen werden. Bitte versuchen Sie es in einigen Augenblicken erneut.", + "zimbra_auto_replies_delete_modal_title": "Eine Auto-Antwort löschen", + "zimbra_auto_replies_delete_cancel": "Abbrechen", + "zimbra_auto_replies_delete_cta": "Löschen", + "zimbra_auto_replies_delete_modal_content": "Sind Sie sicher, dass Sie die Auto-Antwort löschen möchten?" +} diff --git a/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_en_GB.json b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_en_GB.json new file mode 100644 index 000000000000..ff8f76363b82 --- /dev/null +++ b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_en_GB.json @@ -0,0 +1,8 @@ +{ + "zimbra_auto_replies_delete_success_message": "Your deletion request has been processed. It will be executed in a few moments.", + "zimbra_auto_replies_delete_error_message": "Your deletion request could not be completed. Please try again in a few moments.", + "zimbra_auto_replies_delete_modal_title": "Delete an auto-reply", + "zimbra_auto_replies_delete_cancel": "Cancel", + "zimbra_auto_replies_delete_cta": "Delete", + "zimbra_auto_replies_delete_modal_content": "Are you sure you want to delete the auto-reply?" +} diff --git a/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_es_ES.json b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_es_ES.json new file mode 100644 index 000000000000..05822f40019a --- /dev/null +++ b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_es_ES.json @@ -0,0 +1,8 @@ +{ + "zimbra_auto_replies_delete_success_message": "La solicitud de eliminación se ha enviado. Va a ejecutarse.", + "zimbra_auto_replies_delete_error_message": "No se ha podido completar la solicitud de eliminación. Por favor, vuelva a intentarlo en unos instantes.", + "zimbra_auto_replies_delete_modal_title": "Eliminar un contestador", + "zimbra_auto_replies_delete_cancel": "Cancelar", + "zimbra_auto_replies_delete_cta": "Eliminar", + "zimbra_auto_replies_delete_modal_content": "¿Seguro que quiere eliminar el contestador?" +} diff --git a/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_fr_CA.json b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_fr_CA.json new file mode 100644 index 000000000000..fab2b877c075 --- /dev/null +++ b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_fr_CA.json @@ -0,0 +1,8 @@ +{ + "zimbra_auto_replies_delete_success_message": "Votre demande de suppression a bien été prise en compte. Elle sera exécutée d'ici quelques instants.", + "zimbra_auto_replies_delete_error_message": "Votre demande de suppression n'a pas pu aboutir. Merci de réessayer dans quelques instants.", + "zimbra_auto_replies_delete_modal_title": "Supprimer un répondeur", + "zimbra_auto_replies_delete_cancel": "Annuler", + "zimbra_auto_replies_delete_cta": "Supprimer", + "zimbra_auto_replies_delete_modal_content": "Êtes-vous sûr de vouloir supprimer le répondeur ?" +} diff --git a/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_fr_FR.json b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_fr_FR.json new file mode 100644 index 000000000000..fab2b877c075 --- /dev/null +++ b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_fr_FR.json @@ -0,0 +1,8 @@ +{ + "zimbra_auto_replies_delete_success_message": "Votre demande de suppression a bien été prise en compte. Elle sera exécutée d'ici quelques instants.", + "zimbra_auto_replies_delete_error_message": "Votre demande de suppression n'a pas pu aboutir. Merci de réessayer dans quelques instants.", + "zimbra_auto_replies_delete_modal_title": "Supprimer un répondeur", + "zimbra_auto_replies_delete_cancel": "Annuler", + "zimbra_auto_replies_delete_cta": "Supprimer", + "zimbra_auto_replies_delete_modal_content": "Êtes-vous sûr de vouloir supprimer le répondeur ?" +} diff --git a/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_it_IT.json b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_it_IT.json new file mode 100644 index 000000000000..2a8fce24b5f7 --- /dev/null +++ b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_it_IT.json @@ -0,0 +1,8 @@ +{ + "zimbra_auto_replies_delete_success_message": "La richiesta di eliminazione è stata presa in carico. Sarà eseguita entro pochi minuti.", + "zimbra_auto_replies_delete_error_message": "Impossibile completare la richiesta di eliminazione. Ti preghiamo di riprovare più tardi.", + "zimbra_auto_replies_delete_modal_title": "Elimina una risposta automatica", + "zimbra_auto_replies_delete_cancel": "Annulla", + "zimbra_auto_replies_delete_cta": "Eliminare", + "zimbra_auto_replies_delete_modal_content": "Vuoi davvero eliminare la risposta automatica?" +} diff --git a/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_pl_PL.json b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_pl_PL.json new file mode 100644 index 000000000000..f8f658687d9c --- /dev/null +++ b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_pl_PL.json @@ -0,0 +1,8 @@ +{ + "zimbra_auto_replies_delete_success_message": "Zlecenie usunięcia zostało przyjęte. Zostanie ona wykonana w ciągu kilku minut.", + "zimbra_auto_replies_delete_error_message": "Zlecenie usunięcia nie powiodło się. Spróbuj ponownie za kilka minut.", + "zimbra_auto_replies_delete_modal_title": "Usuń autoresponder", + "zimbra_auto_replies_delete_cancel": "Anuluj", + "zimbra_auto_replies_delete_cta": "Usuń", + "zimbra_auto_replies_delete_modal_content": "Czy na pewno chcesz usunąć autoresponder?" +} diff --git a/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_pt_PT.json b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_pt_PT.json new file mode 100644 index 000000000000..a43cd352a07d --- /dev/null +++ b/packages/manager/apps/zimbra/public/translations/autoReplies/delete/Messages_pt_PT.json @@ -0,0 +1,8 @@ +{ + "zimbra_auto_replies_delete_success_message": "O seu pedido de eliminação foi corretamente tomado em conta. Será executada dentro de alguns instantes.", + "zimbra_auto_replies_delete_error_message": "O seu pedido de eliminação não foi bem-sucedido. Tente novamente mais tarde.", + "zimbra_auto_replies_delete_modal_title": "Eliminar uma resposta automática", + "zimbra_auto_replies_delete_cancel": "Anular", + "zimbra_auto_replies_delete_cta": "Suprimir", + "zimbra_auto_replies_delete_modal_content": "Tem a certeza de que quer eliminar a resposta automática?" +} diff --git a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_de_DE.json b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_de_DE.json index 72cb8380079e..0f8196c300ef 100644 --- a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_de_DE.json +++ b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_de_DE.json @@ -51,5 +51,6 @@ "zimbra_dashboard_redirections": "Weiterleitungen", "zimbra_dashboard_redirections_edit": "Weiterleitung bearbeiten", "zimbra_dashboard_redirections_delete": "Die Weiterleitung löschen", - "zimbra_dashboard_auto_replies": "Automatische Antworten" + "zimbra_dashboard_auto_replies": "Automatische Antworten", + "zimbra_dashboard_auto_replies_delete": "Eine Auto-Antwort löschen" } diff --git a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_en_GB.json b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_en_GB.json index a13494fcec21..1b8823462c87 100644 --- a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_en_GB.json +++ b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_en_GB.json @@ -51,5 +51,6 @@ "zimbra_dashboard_redirections": "Redirections", "zimbra_dashboard_redirections_edit": "Modify redirection", "zimbra_dashboard_redirections_delete": "Delete redirection", - "zimbra_dashboard_auto_replies": "Auto-replies" + "zimbra_dashboard_auto_replies": "Auto-replies", + "zimbra_dashboard_auto_replies_delete": "Delete an auto-reply" } diff --git a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_es_ES.json b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_es_ES.json index 5f65e5c1cea5..15a971d97dd5 100644 --- a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_es_ES.json +++ b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_es_ES.json @@ -51,5 +51,6 @@ "zimbra_dashboard_redirections": "Redirecciones", "zimbra_dashboard_redirections_edit": "Editar la redirección", "zimbra_dashboard_redirections_delete": "Eliminar la redirección", - "zimbra_dashboard_auto_replies": "Contestadores" + "zimbra_dashboard_auto_replies": "Contestadores", + "zimbra_dashboard_auto_replies_delete": "Eliminar un contestador" } diff --git a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_fr_CA.json b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_fr_CA.json index e52b1af6a220..dee4eb8abeea 100644 --- a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_fr_CA.json +++ b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_fr_CA.json @@ -43,5 +43,6 @@ "zimbra_dashboard_tile_serviceConsumption_accountOffer": "Compte par offre", "zimbra_dashboard_tile_serviceConsumption_noAccountOffer": "Vous ne possedez actuellement aucune boite email.", "zimbra_dashboard_tile_usefulLinks_title": "Liens utiles", - "zimbra_dashboard_auto_replies": "Répondeurs" + "zimbra_dashboard_auto_replies": "Répondeurs", + "zimbra_dashboard_auto_replies_delete": "Supprimer un répondeur" } diff --git a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_fr_FR.json b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_fr_FR.json index e52b1af6a220..dee4eb8abeea 100644 --- a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_fr_FR.json +++ b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_fr_FR.json @@ -43,5 +43,6 @@ "zimbra_dashboard_tile_serviceConsumption_accountOffer": "Compte par offre", "zimbra_dashboard_tile_serviceConsumption_noAccountOffer": "Vous ne possedez actuellement aucune boite email.", "zimbra_dashboard_tile_usefulLinks_title": "Liens utiles", - "zimbra_dashboard_auto_replies": "Répondeurs" + "zimbra_dashboard_auto_replies": "Répondeurs", + "zimbra_dashboard_auto_replies_delete": "Supprimer un répondeur" } diff --git a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_it_IT.json b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_it_IT.json index 0222ca571064..c884c7721359 100644 --- a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_it_IT.json +++ b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_it_IT.json @@ -51,5 +51,6 @@ "zimbra_dashboard_redirections": "Reindirizzamenti", "zimbra_dashboard_redirections_edit": "Modifica il reindirizzamento", "zimbra_dashboard_redirections_delete": "Elimina il reindirizzamento", - "zimbra_dashboard_auto_replies": "Risposte automatiche" + "zimbra_dashboard_auto_replies": "Risposte automatiche", + "zimbra_dashboard_auto_replies_delete": "Elimina una risposta automatica" } diff --git a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_pl_PL.json b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_pl_PL.json index 7984ba1501cb..1007f298d129 100644 --- a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_pl_PL.json +++ b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_pl_PL.json @@ -51,5 +51,6 @@ "zimbra_dashboard_redirections": "Przekierowania", "zimbra_dashboard_redirections_edit": "Zmodyfikuj przekierowanie", "zimbra_dashboard_redirections_delete": "Usuń przekierowanie", - "zimbra_dashboard_auto_replies": "Autoresponder" + "zimbra_dashboard_auto_replies": "Autoresponder", + "zimbra_dashboard_auto_replies_delete": "Usuń autoresponder" } diff --git a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_pt_PT.json b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_pt_PT.json index 51785f4eb848..09187d58ef9c 100644 --- a/packages/manager/apps/zimbra/public/translations/dashboard/Messages_pt_PT.json +++ b/packages/manager/apps/zimbra/public/translations/dashboard/Messages_pt_PT.json @@ -51,5 +51,6 @@ "zimbra_dashboard_redirections": "Reencaminhamentos", "zimbra_dashboard_redirections_edit": "Modificar o reencaminhamento", "zimbra_dashboard_redirections_delete": "Eliminar o reencaminhamento", - "zimbra_dashboard_auto_replies": "Respostas automáticas" + "zimbra_dashboard_auto_replies": "Respostas automáticas", + "zimbra_dashboard_auto_replies_delete": "Eliminar uma resposta automática" } diff --git a/packages/manager/apps/zimbra/src/pages/dashboard/AutoReplies/ActionButtonAutoReply.component.tsx b/packages/manager/apps/zimbra/src/pages/dashboard/AutoReplies/ActionButtonAutoReply.component.tsx new file mode 100644 index 000000000000..ceae0fe3091a --- /dev/null +++ b/packages/manager/apps/zimbra/src/pages/dashboard/AutoReplies/ActionButtonAutoReply.component.tsx @@ -0,0 +1,53 @@ +import React from 'react'; +import { ManagerButton } from '@ovh-ux/manager-react-components'; +import { useSearchParams } from 'react-router-dom'; +import { + ODS_BUTTON_VARIANT, + ODS_ICON_NAME, + ODS_ICON_SIZE, +} from '@ovhcloud/ods-components'; + +import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming'; +import { OsdsIcon } from '@ovhcloud/ods-components/react'; +import { AutoRepliesItem } from './AutoReplies'; +import { useGenerateUrl, usePlatform } from '@/hooks'; +import { IAM_ACTIONS } from '@/utils/iamAction.constants'; +import { ResourceStatus } from '@/api/api.type'; + +interface ActionButtonAutoReplyProps { + autoReplyItem: AutoRepliesItem; +} + +const ActionButtonAutoReply: React.FC = ({ + autoReplyItem, +}) => { + const { platformUrn } = usePlatform(); + + const [searchParams] = useSearchParams(); + const params = Object.fromEntries(searchParams.entries()); + + const hrefDeleteAutoReply = useGenerateUrl('./delete', 'href', { + deleteAutoReplyId: autoReplyItem.id, + ...params, + }); + + return ( + + + + ); +}; + +export default ActionButtonAutoReply; diff --git a/packages/manager/apps/zimbra/src/pages/dashboard/AutoReplies/AutoReplies.tsx b/packages/manager/apps/zimbra/src/pages/dashboard/AutoReplies/AutoReplies.tsx index ee01b5ead825..d57a948f5489 100644 --- a/packages/manager/apps/zimbra/src/pages/dashboard/AutoReplies/AutoReplies.tsx +++ b/packages/manager/apps/zimbra/src/pages/dashboard/AutoReplies/AutoReplies.tsx @@ -3,17 +3,11 @@ import { DatagridColumn, Notifications, } from '@ovh-ux/manager-react-components'; -import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming'; -import { - ODS_BUTTON_SIZE, - ODS_BUTTON_VARIANT, - ODS_ICON_NAME, - ODS_ICON_SIZE, -} from '@ovhcloud/ods-components'; -import { OsdsButton, OsdsIcon } from '@ovhcloud/ods-components/react'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { Outlet } from 'react-router-dom'; +import ActionButtonAutoReply from './ActionButtonAutoReply.component'; +import { ResourceStatus } from '@/api/api.type'; export type AutoRepliesItem = { id: string; @@ -21,6 +15,7 @@ export type AutoRepliesItem = { from: string; until: string; copyTo: string; + status: ResourceStatus; }; const items: AutoRepliesItem[] = [ @@ -30,6 +25,7 @@ const items: AutoRepliesItem[] = [ from: '11/02/2023', until: '11/02/2024', copyTo: 'copy@example1.com', + status: ResourceStatus.READY, }, { id: '2', @@ -37,6 +33,7 @@ const items: AutoRepliesItem[] = [ from: '11/03/2023', until: '11/03/2024', copyTo: 'copy@example2.com', + status: ResourceStatus.ERROR, }, ]; const columns: DatagridColumn[] = [ @@ -62,20 +59,7 @@ const columns: DatagridColumn[] = [ }, { id: 'deleteButton', - cell: () => ( - - - - ), + cell: (item) => , label: '', }, ]; diff --git a/packages/manager/apps/zimbra/src/pages/dashboard/AutoReplies/ModalDeleteAutoReply.component.tsx b/packages/manager/apps/zimbra/src/pages/dashboard/AutoReplies/ModalDeleteAutoReply.component.tsx new file mode 100644 index 000000000000..a9f86e808596 --- /dev/null +++ b/packages/manager/apps/zimbra/src/pages/dashboard/AutoReplies/ModalDeleteAutoReply.component.tsx @@ -0,0 +1,110 @@ +import React from 'react'; +import { useSearchParams, useNavigate } from 'react-router-dom'; +import { useTranslation } from 'react-i18next'; +import { + ODS_THEME_COLOR_INTENT, + ODS_THEME_TYPOGRAPHY_SIZE, + ODS_THEME_TYPOGRAPHY_LEVEL, + ODS_THEME_COLOR_HUE, +} from '@ovhcloud/ods-common-theming'; +import { OsdsText } from '@ovhcloud/ods-components/react'; +import { useNotifications } from '@ovh-ux/manager-react-components'; +import { ApiError } from '@ovh-ux/manager-core-api'; +import { useMutation } from '@tanstack/react-query'; +import { ODS_BUTTON_VARIANT } from '@ovhcloud/ods-components'; +import { useGenerateUrl } from '@/hooks'; +import Modal from '@/components/Modals/Modal'; + +export default function ModalDeleteDomain() { + const { t } = useTranslation('autoReplies/delete'); + const navigate = useNavigate(); + + const [searchParams] = useSearchParams(); + const deleteAutoReplyId = searchParams.get('deleteAutoReplyId'); + + const { addError, addSuccess } = useNotifications(); + + const goBackUrl = useGenerateUrl('..', 'path'); + const onClose = () => navigate(goBackUrl); + + const { mutate: deleteAutoReply, isPending: isSending } = useMutation({ + mutationFn: (autoReplyId: string) => { + // call api + return Promise.resolve(autoReplyId); + }, + onSuccess: () => { + addSuccess( + + {t('zimbra_auto_replies_delete_success_message')} + , + true, + ); + }, + onError: (error: ApiError) => { + addError( + + {t('zimbra_auto_replies_delete_error_message', { + error: error?.response?.data?.message, + })} + , + true, + ); + }, + onSettled: () => { + /* queryClient.invalidateQueries({ + queryKey: getZimbraPlatformAutoRepliesQueryKey(platformId), + }); */ + + onClose(); + }, + }); + + const handleDeleteClick = () => { + deleteAutoReply(deleteAutoReplyId as string); + }; + + return ( + + <> + + {t('zimbra_auto_replies_delete_modal_content')} + + + + ); +} diff --git a/packages/manager/apps/zimbra/src/routes/routes.constants.ts b/packages/manager/apps/zimbra/src/routes/routes.constants.ts index ec6aae1e1864..0144fde427ea 100644 --- a/packages/manager/apps/zimbra/src/routes/routes.constants.ts +++ b/packages/manager/apps/zimbra/src/routes/routes.constants.ts @@ -34,4 +34,5 @@ export const urls = { redirections_edit: '/:serviceName/redirections/edit', redirections_delete: '/:serviceName/redirections/delete', auto_replies: '/:serviceName/auto_replies', + auto_replies_delete: '/:serviceName/auto_replies/delete', }; diff --git a/packages/manager/apps/zimbra/src/routes/routes.tsx b/packages/manager/apps/zimbra/src/routes/routes.tsx index 0ea36f3af209..c9968a57a05f 100644 --- a/packages/manager/apps/zimbra/src/routes/routes.tsx +++ b/packages/manager/apps/zimbra/src/routes/routes.tsx @@ -260,6 +260,17 @@ export const Routes: any = [ ...lazyRouteConfig(() => import('@/pages/dashboard/AutoReplies/AutoReplies'), ), + children: [ + { + path: 'delete', + ...lazyRouteConfig(() => + import( + '@/pages/dashboard/AutoReplies/ModalDeleteAutoReply.component' + ), + ), + handle: { isOverridePage: true }, + }, + ], }, ], }, diff --git a/packages/manager/apps/zimbra/src/utils/iamAction.constants.ts b/packages/manager/apps/zimbra/src/utils/iamAction.constants.ts index a678e8f37993..c31fc82f84e1 100644 --- a/packages/manager/apps/zimbra/src/utils/iamAction.constants.ts +++ b/packages/manager/apps/zimbra/src/utils/iamAction.constants.ts @@ -11,6 +11,11 @@ export const IAM_ACTIONS = { create: `${IAM_ACTIONS_PREFIX}alias/create`, delete: `${IAM_ACTIONS_PREFIX}alias/delete`, }, + autoReply: { + create: `${IAM_ACTIONS_PREFIX}autoReply/create`, + delete: `${IAM_ACTIONS_PREFIX}autoReply/delete`, + edit: `${IAM_ACTIONS_PREFIX}autoReply/edit`, + }, domain: { create: `${IAM_ACTIONS_PREFIX}domain/create`, delete: `${IAM_ACTIONS_PREFIX}domain/delete`, diff --git a/packages/manager/apps/zimbra/src/utils/test.provider.tsx b/packages/manager/apps/zimbra/src/utils/test.provider.tsx index 73a0afa2c379..85d1ee0ef05a 100644 --- a/packages/manager/apps/zimbra/src/utils/test.provider.tsx +++ b/packages/manager/apps/zimbra/src/utils/test.provider.tsx @@ -29,6 +29,8 @@ import redirectionsTranslation from '@/public/translations/redirections/Messages import redirectionsAddAndEditTranslation from '@/public/translations/redirections/addAndEdit/Messages_fr_FR.json'; import redirectionsDeleteTranslation from '@/public/translations/redirections/delete/Messages_fr_FR.json'; import onboardingTranslation from '@/public/translations/onboarding/Messages_fr_FR.json'; +import autoRepliesTranslation from '@/public/translations/autoReplies/Messages_fr_FR.json'; +import autoRepliesDeleteTranslation from '@/public/translations/autoReplies/delete/Messages_fr_FR.json'; import '@testing-library/jest-dom'; import 'element-internals-polyfill'; @@ -57,6 +59,8 @@ i18n.use(initReactI18next).init({ redirections: redirectionsTranslation, 'redirections/addAndEdit': redirectionsAddAndEditTranslation, 'redirections/delete': redirectionsDeleteTranslation, + autoReplies: autoRepliesTranslation, + 'autoReplies/delete': autoRepliesDeleteTranslation, onboarding: onboardingTranslation, }, }, From 0c4db05b024e736df4868bd3ae0ba82bc0051686 Mon Sep 17 00:00:00 2001 From: antonymarion Date: Thu, 14 Nov 2024 18:04:52 +0100 Subject: [PATCH 2/8] feat(web): make operation status sortable (#13749) ref: MANAGER-14078 Signed-off-by: Antony MARION --- .../domain-operation/operation-table/operation-table.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/manager/apps/web/client/app/domain-operation/operation-table/operation-table.html b/packages/manager/apps/web/client/app/domain-operation/operation-table/operation-table.html index 649b8cdded69..07e59dfd8db7 100644 --- a/packages/manager/apps/web/client/app/domain-operation/operation-table/operation-table.html +++ b/packages/manager/apps/web/client/app/domain-operation/operation-table/operation-table.html @@ -84,7 +84,11 @@ Date: Thu, 14 Nov 2024 18:06:06 +0100 Subject: [PATCH 3/8] feat(web.exchange): add alias feature on group and shared account (#13780) ref: MANAGER-13265 Signed-off-by: Guillaume Hyenne Co-authored-by: CDS Translator Agent --- .../exchange/src/account/account.module.js | 2 +- .../account/alias/account-alias.component.js | 11 - .../account/alias/account-alias.controller.js | 129 ----- .../src/account/alias/account-alias.module.js | 22 + .../account/alias/account-alias.routing.js | 16 + .../account/alias/add/account-alias-add.html | 114 ----- .../account-alias-add.module.js} | 8 +- .../alias/add/account-alias-add.routing.js | 15 + .../src/account/alias/alias.routing.js | 14 - .../alias/remove/account-alias-remove.html | 27 - .../remove/account-alias-remove.module.js | 15 + .../remove/account-alias-remove.routing.js | 15 + .../alias/add/exchange-alias-add.component.js | 11 + .../add/exchange-alias-add.constants.js} | 3 + .../add/exchange-alias-add.controller.js} | 22 +- .../src/alias/add/exchange-alias-add.html | 109 ++++ .../alias/add/exchange-alias-add.module.js | 14 + .../src/alias/exchange-alias.component.js | 14 + .../src/alias/exchange-alias.constants.js | 9 + .../src/alias/exchange-alias.controller.js | 91 ++++ .../exchange-alias.html} | 27 +- .../src/alias/exchange-alias.module.js | 25 + .../exchange-alias.styles.scss} | 0 .../remove/exchange-alias-remove.component.js | 11 + .../exchange-alias-remove.controller.js} | 16 +- .../alias/remove/exchange-alias-remove.html | 23 + .../remove/exchange-alias-remove.module.js | 14 + .../alias/translations/Messages_de_DE.json | 0 .../alias/translations/Messages_en_GB.json | 0 .../alias/translations/Messages_es_ES.json | 0 .../alias/translations/Messages_fr_CA.json | 0 .../alias/translations/Messages_fr_FR.json | 0 .../alias/translations/Messages_it_IT.json | 0 .../alias/translations/Messages_pl_PL.json | 0 .../alias/translations/Messages_pt_PT.json | 0 .../exchange/src/dashboard/exchange.module.js | 2 + .../src/dashboard/exchange.template.js | 25 - .../dashboard/exchangeControllers.module.js | 12 - .../translations/Messages_de_DE.json | 4 +- .../translations/Messages_en_GB.json | 2 +- .../translations/Messages_es_ES.json | 4 +- .../translations/Messages_fr_CA.json | 4 +- .../translations/Messages_fr_FR.json | 4 +- .../translations/Messages_it_IT.json | 4 +- .../translations/Messages_pl_PL.json | 2 +- .../translations/Messages_pt_PT.json | 2 +- .../alias/add/group-alias-add.controller.js | 124 ----- .../src/group/alias/add/group-alias-add.html | 89 ---- .../group-alias-add.module.js} | 4 +- .../alias/add/group-alias-add.routing.js | 15 + .../exchange/src/group/alias/alias.routing.js | 19 - .../src/group/alias/group-alias.controller.js | 138 ----- .../exchange/src/group/alias/group-alias.html | 54 -- .../src/group/alias/group-alias.module.js | 23 + .../src/group/alias/group-alias.routing.js | 18 + .../remove/group-alias-remove.controller.js | 50 -- .../alias/remove/group-alias-remove.html | 27 - .../alias/remove/group-alias-remove.module.js | 15 + .../remove/group-alias-remove.routing.js | 15 + .../alias/translations/Messages_de_DE.json | 3 - .../alias/translations/Messages_en_GB.json | 3 - .../alias/translations/Messages_es_ES.json | 3 - .../alias/translations/Messages_fr_CA.json | 3 - .../alias/translations/Messages_fr_FR.json | 3 - .../alias/translations/Messages_it_IT.json | 3 - .../alias/translations/Messages_pl_PL.json | 3 - .../alias/translations/Messages_pt_PT.json | 3 - .../exchange/src/group/group.controller.js | 7 - .../modules/exchange/src/group/group.html | 8 + .../exchange/src/group/group.module.js | 2 +- .../exchange/src/group/group.routing.js | 14 +- .../group/manager/group-manager.controller.js | 7 +- .../src/group/manager/group-manager.html | 4 +- .../src/group/manager/manager.routing.js | 5 - .../remove/group-manager-remove.controller.js | 7 +- .../manager/remove/group-manager-remove.html | 2 +- .../group/member/group-member.controller.js | 7 +- .../src/group/member/group-member.html | 4 +- .../src/group/member/member.routing.js | 5 - .../remove/group-member-remove.controller.js | 7 +- .../member/remove/group-member-remove.html | 2 +- .../add/shared-account-alias-add.module.js | 15 + .../add/shared-account-alias-add.routing.js | 15 + .../shared-account-alias-remove.module.js | 15 + .../shared-account-alias-remove.routing.js | 18 + .../alias/shared-account-alias.module.js | 22 + .../alias/shared-account-alias.routing.js | 18 + .../shared-account.component.js | 12 + .../shared-account.controller.js | 4 + .../src/shared-account/shared-account.html | 471 +++++++++--------- .../shared-account/shared-account.module.js | 10 +- .../shared-account/shared-account.routing.js | 24 +- .../src/exchange/exchange.service.js | 85 ++-- 93 files changed, 1010 insertions(+), 1237 deletions(-) delete mode 100644 packages/manager/modules/exchange/src/account/alias/account-alias.component.js delete mode 100644 packages/manager/modules/exchange/src/account/alias/account-alias.controller.js create mode 100644 packages/manager/modules/exchange/src/account/alias/account-alias.module.js create mode 100644 packages/manager/modules/exchange/src/account/alias/account-alias.routing.js delete mode 100644 packages/manager/modules/exchange/src/account/alias/add/account-alias-add.html rename packages/manager/modules/exchange/src/account/alias/{alias.module.js => add/account-alias-add.module.js} (59%) create mode 100644 packages/manager/modules/exchange/src/account/alias/add/account-alias-add.routing.js delete mode 100644 packages/manager/modules/exchange/src/account/alias/alias.routing.js delete mode 100644 packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.html create mode 100644 packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.module.js create mode 100644 packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.routing.js create mode 100644 packages/manager/modules/exchange/src/alias/add/exchange-alias-add.component.js rename packages/manager/modules/exchange/src/{account/alias/add/account-alias-add.constants.js => alias/add/exchange-alias-add.constants.js} (82%) rename packages/manager/modules/exchange/src/{account/alias/add/account-alias-add.controller.js => alias/add/exchange-alias-add.controller.js} (88%) create mode 100644 packages/manager/modules/exchange/src/alias/add/exchange-alias-add.html create mode 100644 packages/manager/modules/exchange/src/alias/add/exchange-alias-add.module.js create mode 100644 packages/manager/modules/exchange/src/alias/exchange-alias.component.js create mode 100644 packages/manager/modules/exchange/src/alias/exchange-alias.constants.js create mode 100644 packages/manager/modules/exchange/src/alias/exchange-alias.controller.js rename packages/manager/modules/exchange/src/{account/alias/account-alias.html => alias/exchange-alias.html} (67%) create mode 100644 packages/manager/modules/exchange/src/alias/exchange-alias.module.js rename packages/manager/modules/exchange/src/{account/alias/account-alias.styles.scss => alias/exchange-alias.styles.scss} (100%) create mode 100644 packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.component.js rename packages/manager/modules/exchange/src/{account/alias/remove/account-alias-remove.controller.js => alias/remove/exchange-alias-remove.controller.js} (73%) create mode 100644 packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.html create mode 100644 packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.module.js rename packages/manager/modules/exchange/src/{account => }/alias/translations/Messages_de_DE.json (100%) rename packages/manager/modules/exchange/src/{account => }/alias/translations/Messages_en_GB.json (100%) rename packages/manager/modules/exchange/src/{account => }/alias/translations/Messages_es_ES.json (100%) rename packages/manager/modules/exchange/src/{account => }/alias/translations/Messages_fr_CA.json (100%) rename packages/manager/modules/exchange/src/{account => }/alias/translations/Messages_fr_FR.json (100%) rename packages/manager/modules/exchange/src/{account => }/alias/translations/Messages_it_IT.json (100%) rename packages/manager/modules/exchange/src/{account => }/alias/translations/Messages_pl_PL.json (100%) rename packages/manager/modules/exchange/src/{account => }/alias/translations/Messages_pt_PT.json (100%) delete mode 100644 packages/manager/modules/exchange/src/group/alias/add/group-alias-add.controller.js delete mode 100644 packages/manager/modules/exchange/src/group/alias/add/group-alias-add.html rename packages/manager/modules/exchange/src/group/alias/{alias.module.js => add/group-alias-add.module.js} (75%) create mode 100644 packages/manager/modules/exchange/src/group/alias/add/group-alias-add.routing.js delete mode 100644 packages/manager/modules/exchange/src/group/alias/alias.routing.js delete mode 100644 packages/manager/modules/exchange/src/group/alias/group-alias.controller.js delete mode 100644 packages/manager/modules/exchange/src/group/alias/group-alias.html create mode 100644 packages/manager/modules/exchange/src/group/alias/group-alias.module.js create mode 100644 packages/manager/modules/exchange/src/group/alias/group-alias.routing.js delete mode 100644 packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.controller.js delete mode 100644 packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.html create mode 100644 packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.module.js create mode 100644 packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.routing.js delete mode 100644 packages/manager/modules/exchange/src/group/alias/translations/Messages_de_DE.json delete mode 100644 packages/manager/modules/exchange/src/group/alias/translations/Messages_en_GB.json delete mode 100644 packages/manager/modules/exchange/src/group/alias/translations/Messages_es_ES.json delete mode 100644 packages/manager/modules/exchange/src/group/alias/translations/Messages_fr_CA.json delete mode 100644 packages/manager/modules/exchange/src/group/alias/translations/Messages_fr_FR.json delete mode 100644 packages/manager/modules/exchange/src/group/alias/translations/Messages_it_IT.json delete mode 100644 packages/manager/modules/exchange/src/group/alias/translations/Messages_pl_PL.json delete mode 100644 packages/manager/modules/exchange/src/group/alias/translations/Messages_pt_PT.json create mode 100644 packages/manager/modules/exchange/src/shared-account/alias/add/shared-account-alias-add.module.js create mode 100644 packages/manager/modules/exchange/src/shared-account/alias/add/shared-account-alias-add.routing.js create mode 100644 packages/manager/modules/exchange/src/shared-account/alias/remove/shared-account-alias-remove.module.js create mode 100644 packages/manager/modules/exchange/src/shared-account/alias/remove/shared-account-alias-remove.routing.js create mode 100644 packages/manager/modules/exchange/src/shared-account/alias/shared-account-alias.module.js create mode 100644 packages/manager/modules/exchange/src/shared-account/alias/shared-account-alias.routing.js create mode 100644 packages/manager/modules/exchange/src/shared-account/shared-account.component.js diff --git a/packages/manager/modules/exchange/src/account/account.module.js b/packages/manager/modules/exchange/src/account/account.module.js index 862275f9b897..ea07934d00e0 100644 --- a/packages/manager/modules/exchange/src/account/account.module.js +++ b/packages/manager/modules/exchange/src/account/account.module.js @@ -6,7 +6,7 @@ import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; import routing from './account.routing'; import service from './account.service'; -import alias from './alias/alias.module'; +import alias from './alias/account-alias.module'; import add from './add/add.module'; import updateAccount from './update/update.module'; diff --git a/packages/manager/modules/exchange/src/account/alias/account-alias.component.js b/packages/manager/modules/exchange/src/account/alias/account-alias.component.js deleted file mode 100644 index 5f6d3700e60e..000000000000 --- a/packages/manager/modules/exchange/src/account/alias/account-alias.component.js +++ /dev/null @@ -1,11 +0,0 @@ -import controller from './account-alias.controller'; -import template from './account-alias.html'; - -export default { - controller, - template, - bindings: { - account: '<', - goToAccounts: '<', - }, -}; diff --git a/packages/manager/modules/exchange/src/account/alias/account-alias.controller.js b/packages/manager/modules/exchange/src/account/alias/account-alias.controller.js deleted file mode 100644 index 3bc27b216710..000000000000 --- a/packages/manager/modules/exchange/src/account/alias/account-alias.controller.js +++ /dev/null @@ -1,129 +0,0 @@ -import get from 'lodash/get'; - -export default class ExchangeAccountAliasController { - /* @ngInject */ - constructor( - $scope, - wucExchange, - exchangeAccount, - exchangeStates, - navigation, - messaging, - $translate, - ) { - this.$scope = $scope; - - this.wucExchange = wucExchange; - this.exchangeAccount = exchangeAccount; - this.exchangeStates = exchangeStates; - this.navigation = navigation; - this.messaging = messaging; - this.$translate = $translate; - } - - $onInit() { - this.$routerParams = this.wucExchange.getParams(); - this.aliasesParams = {}; - this.aliasMaxLimit = this.wucExchange.aliasMaxLimit; - - this.$scope.$on(this.wucExchange.events.accountsChanged, () => - this.refreshList(), - ); - } - - getAliases({ pageSize, offset }) { - this.aliasesParams.pageSize = pageSize; - this.aliasesParams.offset = offset; - - return this.wucExchange - .getAliases( - this.$routerParams.organization, - this.$routerParams.productId, - this.account.primaryEmailAddress, - pageSize, - offset - 1, - ) - .then((aliases) => { - this.aliases = aliases.list.results; - - return { - data: this.aliases, - meta: { - totalCount: aliases.count, - }, - }; - }) - .catch((error) => { - this.messaging.writeError( - this.$translate.instant('exchange_tab_ALIAS_error_message'), - error, - ); - this.hide(); - }); - } - - refreshList() { - this.wucExchange - .getAliases( - this.$routerParams.organization, - this.$routerParams.productId, - this.account.primaryEmailAddress, - this.aliasesParams.pageSize, - this.aliasesParams.offset - 1, - ) - .then((aliases) => { - for (let i = 0; i < aliases.list.results.length; i += 1) { - this.aliases.splice(i, 1, aliases.list.results[i]); - } - - for ( - let i = aliases.list.results.length; - i < this.aliases.length; - i += 1 - ) { - this.aliases.splice(i, 1); - } - }) - .catch((error) => { - this.messaging.writeError( - this.$translate.instant('exchange_tab_ALIAS_error_message'), - error, - ); - this.hide(); - }); - } - - hide() { - this.goToAccounts(); - } - - openDeletingDialog(alias) { - this.navigation.setAction( - 'exchange/account/alias/remove/account-alias-remove', - { - account: this.account, - alias, - }, - ); - } - - openAddingDialog() { - this.navigation.setAction( - 'exchange/account/alias/add/account-alias-add', - this.account, - ); - } - - getAddAliasTooltip() { - if (get(this.aliases, 'length', 0) >= this.aliasMaxLimit) { - return this.$translate.instant( - 'exchange_tab_ALIAS_add_alias_limit_tooltip', - { - t0: this.aliasMaxLimit, - }, - ); - } - - return null; - } -} diff --git a/packages/manager/modules/exchange/src/account/alias/account-alias.module.js b/packages/manager/modules/exchange/src/account/alias/account-alias.module.js new file mode 100644 index 000000000000..fd1984ab6457 --- /dev/null +++ b/packages/manager/modules/exchange/src/account/alias/account-alias.module.js @@ -0,0 +1,22 @@ +import angular from 'angular'; +import 'angular-translate'; +import '@ovh-ux/ui-kit'; +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; + +import routing from './account-alias.routing'; +import aliasAddModule from './add/account-alias-add.module'; +import aliasRemoveModule from './remove/account-alias-remove.module'; + +const moduleName = 'ovhManagerExchangeDashboardAccountAlias'; + +angular + .module(moduleName, [ + ngTranslateAsyncLoader, + 'oui', + 'pascalprecht.translate', + aliasAddModule, + aliasRemoveModule, + ]) + .config(routing); + +export default moduleName; diff --git a/packages/manager/modules/exchange/src/account/alias/account-alias.routing.js b/packages/manager/modules/exchange/src/account/alias/account-alias.routing.js new file mode 100644 index 000000000000..e6b2bbf06cd3 --- /dev/null +++ b/packages/manager/modules/exchange/src/account/alias/account-alias.routing.js @@ -0,0 +1,16 @@ +export default /* @ngInject */ ($stateProvider) => { + $stateProvider.state('exchange.dashboard.account.email.alias', { + url: '/alias', + component: 'exchangeAlias', + resolve: { + aliasType: /* @ngInject */ () => 'email', + goBack: /* @ngInject */ ($state) => () => $state.go('^'), + goToAliasAdd: /* @ngInject */ ($state) => () => + $state.go('exchange.dashboard.account.email.alias.add'), + goToAliasRemove: /* @ngInject */ ($state) => (alias) => + $state.go('exchange.dashboard.account.email.alias.remove', { alias }), + breadcrumb: /* @ngInject */ ($translate) => + $translate.instant('exchange_account_alias'), + }, + }); +}; diff --git a/packages/manager/modules/exchange/src/account/alias/add/account-alias-add.html b/packages/manager/modules/exchange/src/account/alias/add/account-alias-add.html deleted file mode 100644 index e9faa9f97419..000000000000 --- a/packages/manager/modules/exchange/src/account/alias/add/account-alias-add.html +++ /dev/null @@ -1,114 +0,0 @@ -
-
-
- - -
-

-
- - - - - - -
- - @ - -
- -
-
- - - - - -
- - -
-
-
-
-
-
-
-
- -
-

- -
-
-
- -
-
-
-
-
-
diff --git a/packages/manager/modules/exchange/src/account/alias/alias.module.js b/packages/manager/modules/exchange/src/account/alias/add/account-alias-add.module.js similarity index 59% rename from packages/manager/modules/exchange/src/account/alias/alias.module.js rename to packages/manager/modules/exchange/src/account/alias/add/account-alias-add.module.js index 6bdbb3e33df6..bdc4442f7ce2 100644 --- a/packages/manager/modules/exchange/src/account/alias/alias.module.js +++ b/packages/manager/modules/exchange/src/account/alias/add/account-alias-add.module.js @@ -3,17 +3,13 @@ import 'angular-translate'; import '@ovh-ux/ui-kit'; import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; -import routing from './alias.routing'; -import component from './account-alias.component'; +import routing from './account-alias-add.routing'; -import './account-alias.styles.scss'; - -const moduleName = 'ovhManagerExchangeDashboardAccountAlias'; +const moduleName = 'ovhManagerExchangeDashboardAccountAliasAdd'; angular .module(moduleName, [ngTranslateAsyncLoader, 'oui', 'pascalprecht.translate']) .config(routing) - .component('exchangeAccountAlias', component) .run(/* @ngTranslationsInject:json ./translations */); export default moduleName; diff --git a/packages/manager/modules/exchange/src/account/alias/add/account-alias-add.routing.js b/packages/manager/modules/exchange/src/account/alias/add/account-alias-add.routing.js new file mode 100644 index 000000000000..592e6284df56 --- /dev/null +++ b/packages/manager/modules/exchange/src/account/alias/add/account-alias-add.routing.js @@ -0,0 +1,15 @@ +export default /* @ngInject */ ($stateProvider) => { + $stateProvider.state('exchange.dashboard.account.email.alias.add', { + url: '/add', + views: { + modal: { + component: 'exchangeAliasAdd', + }, + }, + layout: 'modal', + resolve: { + breadcrumb: /* @ngInject */ ($translate) => + $translate.instant('exchange_account_alias'), + }, + }); +}; diff --git a/packages/manager/modules/exchange/src/account/alias/alias.routing.js b/packages/manager/modules/exchange/src/account/alias/alias.routing.js deleted file mode 100644 index 8235e5d2f3b8..000000000000 --- a/packages/manager/modules/exchange/src/account/alias/alias.routing.js +++ /dev/null @@ -1,14 +0,0 @@ -export default /* @ngInject */ ($stateProvider) => { - $stateProvider.state('exchange.dashboard.account.email.alias', { - url: '/alias', - component: 'exchangeAccountAlias', - params: { - account: {}, - }, - resolve: { - account: /* @ngInject */ ($transition$) => $transition$.params().account, - breadcrumb: /* @ngInject */ ($translate) => - $translate.instant('exchange_account_alias'), - }, - }); -}; diff --git a/packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.html b/packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.html deleted file mode 100644 index febc10ed0561..000000000000 --- a/packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.html +++ /dev/null @@ -1,27 +0,0 @@ -
-
-
-

-
-
-
- -
-
-
-
-
-
diff --git a/packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.module.js b/packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.module.js new file mode 100644 index 000000000000..dc042db13d28 --- /dev/null +++ b/packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.module.js @@ -0,0 +1,15 @@ +import angular from 'angular'; +import 'angular-translate'; +import '@ovh-ux/ui-kit'; +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; + +import routing from './account-alias-remove.routing'; + +const moduleName = 'ovhManagerExchangeDashboardAccountAliasRemove'; + +angular + .module(moduleName, [ngTranslateAsyncLoader, 'oui', 'pascalprecht.translate']) + .config(routing) + .run(/* @ngTranslationsInject:json ./translations */); + +export default moduleName; diff --git a/packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.routing.js b/packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.routing.js new file mode 100644 index 000000000000..2ee9da451d56 --- /dev/null +++ b/packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.routing.js @@ -0,0 +1,15 @@ +export default /* @ngInject */ ($stateProvider) => { + $stateProvider.state('exchange.dashboard.account.email.alias.remove', { + url: '/remove?alias', + views: { + modal: { + component: 'exchangeAliasRemove', + }, + }, + layout: 'modal', + resolve: { + breadcrumb: /* @ngInject */ ($translate) => + $translate.instant('exchange_account_alias'), + }, + }); +}; diff --git a/packages/manager/modules/exchange/src/alias/add/exchange-alias-add.component.js b/packages/manager/modules/exchange/src/alias/add/exchange-alias-add.component.js new file mode 100644 index 000000000000..8172c23df4ce --- /dev/null +++ b/packages/manager/modules/exchange/src/alias/add/exchange-alias-add.component.js @@ -0,0 +1,11 @@ +import controller from './exchange-alias-add.controller'; +import template from './exchange-alias-add.html'; + +export default { + controller, + template, + bindings: { + goBack: '<', + aliasType: '<', + }, +}; diff --git a/packages/manager/modules/exchange/src/account/alias/add/account-alias-add.constants.js b/packages/manager/modules/exchange/src/alias/add/exchange-alias-add.constants.js similarity index 82% rename from packages/manager/modules/exchange/src/account/alias/add/account-alias-add.constants.js rename to packages/manager/modules/exchange/src/alias/add/exchange-alias-add.constants.js index f0600312ff8b..b09b9fbb5e64 100644 --- a/packages/manager/modules/exchange/src/account/alias/add/account-alias-add.constants.js +++ b/packages/manager/modules/exchange/src/alias/add/exchange-alias-add.constants.js @@ -1,6 +1,9 @@ export const ALIAS_TYPE = { SMTP: 'smtp', X500: 'x500', + email: 'ACCOUNT', + group: 'MAILING_LIST', + shared: 'SHARED_ACCOUNT', }; export const SMTP_FIELD_LABEL = 'SMTP (standard)'; diff --git a/packages/manager/modules/exchange/src/account/alias/add/account-alias-add.controller.js b/packages/manager/modules/exchange/src/alias/add/exchange-alias-add.controller.js similarity index 88% rename from packages/manager/modules/exchange/src/account/alias/add/account-alias-add.controller.js rename to packages/manager/modules/exchange/src/alias/add/exchange-alias-add.controller.js index c1f88f3b9ce6..e70739494fee 100644 --- a/packages/manager/modules/exchange/src/account/alias/add/account-alias-add.controller.js +++ b/packages/manager/modules/exchange/src/alias/add/exchange-alias-add.controller.js @@ -8,21 +8,20 @@ import { SMTP_FIELD_LABEL, X500_PREFIX, X500_REGEX, -} from './account-alias-add.constants'; +} from './exchange-alias-add.constants'; +import { ALIAS_TYPE_FOR_API_PATH } from '../exchange-alias.constants'; export default class ExchangeAddAccountAliasCtrl { /* @ngInject */ - constructor($scope, wucExchange, navigation, messaging, $translate) { + constructor($scope, wucExchange, messaging, $translate) { this.services = { $scope, wucExchange, - navigation, messaging, $translate, }; this.$routerParams = wucExchange.getParams(); - this.selectedAccount = navigation.currentActionData; this.data = null; this.SMTP_FIELD_LABEL = SMTP_FIELD_LABEL; this.ALIAS_TYPE = ALIAS_TYPE; @@ -36,7 +35,9 @@ export default class ExchangeAddAccountAliasCtrl { $scope.addAccountAlias = () => this.addAccountAlias(); $scope.aliasIsValid = () => this.aliasIsValid(); + } + $onInit() { this.loadDomainData(); } @@ -45,8 +46,8 @@ export default class ExchangeAddAccountAliasCtrl { .getNewAliasOptions( this.$routerParams.organization, this.$routerParams.productId, - this.selectedAccount.primaryEmailAddress, - 'ACCOUNT', + this.$routerParams[this.aliasType], + ALIAS_TYPE[this.aliasType], ) .then((data) => { if (isEmpty(data.availableDomains)) { @@ -55,7 +56,7 @@ export default class ExchangeAddAccountAliasCtrl { 'exchange_tab_ALIAS_add_no_domains', ), ); - this.services.navigation.resetAction(); + this.goBack(); } else { this.availableDomains = data.availableDomains; this.takenEmails = data.takenEmails; @@ -69,7 +70,7 @@ export default class ExchangeAddAccountAliasCtrl { ), err, ); - this.services.navigation.resetAction(); + this.goBack(); }); } @@ -99,7 +100,8 @@ export default class ExchangeAddAccountAliasCtrl { .addAlias( this.$routerParams.organization, this.$routerParams.productId, - this.selectedAccount.primaryEmailAddress, + this.$routerParams[this.aliasType], + ALIAS_TYPE_FOR_API_PATH[this.aliasType], this.getAlias(this.model), ) .then(() => { @@ -118,7 +120,7 @@ export default class ExchangeAddAccountAliasCtrl { ); }) .finally(() => { - this.services.navigation.resetAction(); + this.goBack(); }); } diff --git a/packages/manager/modules/exchange/src/alias/add/exchange-alias-add.html b/packages/manager/modules/exchange/src/alias/add/exchange-alias-add.html new file mode 100644 index 000000000000..e37bbd225f31 --- /dev/null +++ b/packages/manager/modules/exchange/src/alias/add/exchange-alias-add.html @@ -0,0 +1,109 @@ +
+
+ + +
+

+
+ + + + + + +
+ + @ + +
+ +
+
+ + + + + +
+ + +
+
+
+
+
+
+
+
+ +
+

+ +
+
+
+ +
+
+
+
+
diff --git a/packages/manager/modules/exchange/src/alias/add/exchange-alias-add.module.js b/packages/manager/modules/exchange/src/alias/add/exchange-alias-add.module.js new file mode 100644 index 000000000000..9579e2a84337 --- /dev/null +++ b/packages/manager/modules/exchange/src/alias/add/exchange-alias-add.module.js @@ -0,0 +1,14 @@ +import angular from 'angular'; +import 'angular-translate'; +import '@ovh-ux/ui-kit'; +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; + +import component from './exchange-alias-add.component'; + +const moduleName = 'ovhManagerExchangeAliasAdd'; + +angular + .module(moduleName, [ngTranslateAsyncLoader, 'oui', 'pascalprecht.translate']) + .component('exchangeAliasAdd', component); + +export default moduleName; diff --git a/packages/manager/modules/exchange/src/alias/exchange-alias.component.js b/packages/manager/modules/exchange/src/alias/exchange-alias.component.js new file mode 100644 index 000000000000..4496a10bd294 --- /dev/null +++ b/packages/manager/modules/exchange/src/alias/exchange-alias.component.js @@ -0,0 +1,14 @@ +import controller from './exchange-alias.controller'; +import template from './exchange-alias.html'; + +export default { + controller, + template, + bindings: { + exchange: '<', + aliasType: '<', + goBack: '<', + goToAliasAdd: '<', + goToAliasRemove: '<', + }, +}; diff --git a/packages/manager/modules/exchange/src/alias/exchange-alias.constants.js b/packages/manager/modules/exchange/src/alias/exchange-alias.constants.js new file mode 100644 index 000000000000..e65afc538b3b --- /dev/null +++ b/packages/manager/modules/exchange/src/alias/exchange-alias.constants.js @@ -0,0 +1,9 @@ +export const ALIAS_TYPE_FOR_API_PATH = { + email: 'account', + group: 'mailingList', + shared: 'sharedAccount', +}; + +export default { + ALIAS_TYPE_FOR_API_PATH, +}; diff --git a/packages/manager/modules/exchange/src/alias/exchange-alias.controller.js b/packages/manager/modules/exchange/src/alias/exchange-alias.controller.js new file mode 100644 index 000000000000..067be20465c2 --- /dev/null +++ b/packages/manager/modules/exchange/src/alias/exchange-alias.controller.js @@ -0,0 +1,91 @@ +import punycode from 'punycode'; +import { ALIAS_TYPE_FOR_API_PATH } from './exchange-alias.constants'; + +export default class ExchangeAliasController { + /* @ngInject */ + constructor( + $scope, + wucExchange, + exchangeAccount, + exchangeStates, + navigation, + messaging, + $translate, + ouiDatagridService, + ) { + this.$scope = $scope; + + this.wucExchange = wucExchange; + this.exchangeAccount = exchangeAccount; + this.exchangeStates = exchangeStates; + this.navigation = navigation; + this.messaging = messaging; + this.$translate = $translate; + this.ouiDatagridService = ouiDatagridService; + } + + $onInit() { + this.$routerParams = this.wucExchange.getParams(); + this.aliasesParams = {}; + this.aliasMaxLimit = this.wucExchange.aliasMaxLimit; + + this.$scope.$on(this.wucExchange.events.accountsChanged, () => + this.refreshDatagrid(), + ); + } + + getAliases({ pageSize, offset }) { + this.isLoading = true; + const pageOffset = Math.ceil(offset / pageSize); + return this.wucExchange + .getAliases( + this.$routerParams.organization, + this.$routerParams.productId, + this.$routerParams[this.aliasType], + ALIAS_TYPE_FOR_API_PATH[this.aliasType], + pageOffset, + pageSize, + ) + .then((aliases) => { + this.aliases = aliases; + this.isLoading = false; + return aliases; + }) + .catch((error) => { + this.messaging.writeError( + this.$translate.instant('exchange_tab_ALIAS_error_message'), + error, + ); + this.goBack(); + }); + } + + refreshDatagrid() { + this.ouiDatagridService.refresh('aliasDatagrid', true); + } + + openDeletingDialog({ alias }) { + return this.goToAliasRemove(alias); + } + + openAddingDialog() { + return this.goToAliasAdd(); + } + + getAddAliasTooltip() { + if (this.aliases?.length >= this.aliasMaxLimit) { + return this.$translate.instant( + 'exchange_tab_ALIAS_add_alias_limit_tooltip', + { + t0: this.aliasMaxLimit, + }, + ); + } + + return null; + } + + static convertToPunycode(domain) { + return punycode.toUnicode(domain); + } +} diff --git a/packages/manager/modules/exchange/src/account/alias/account-alias.html b/packages/manager/modules/exchange/src/alias/exchange-alias.html similarity index 67% rename from packages/manager/modules/exchange/src/account/alias/account-alias.html rename to packages/manager/modules/exchange/src/alias/exchange-alias.html index ee9fca3ada40..19bc06a953cf 100644 --- a/packages/manager/modules/exchange/src/account/alias/account-alias.html +++ b/packages/manager/modules/exchange/src/alias/exchange-alias.html @@ -1,22 +1,33 @@ diff --git a/packages/manager/modules/exchange/src/alias/exchange-alias.module.js b/packages/manager/modules/exchange/src/alias/exchange-alias.module.js new file mode 100644 index 000000000000..8c488809aae7 --- /dev/null +++ b/packages/manager/modules/exchange/src/alias/exchange-alias.module.js @@ -0,0 +1,25 @@ +import angular from 'angular'; +import 'angular-translate'; +import '@ovh-ux/ui-kit'; +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; + +import component from './exchange-alias.component'; +import aliasAddModule from './add/exchange-alias-add.module'; +import aliasRemoveModule from './remove/exchange-alias-remove.module'; + +import './exchange-alias.styles.scss'; + +const moduleName = 'ovhManagerExchangeAlias'; + +angular + .module(moduleName, [ + ngTranslateAsyncLoader, + 'oui', + 'pascalprecht.translate', + aliasAddModule, + aliasRemoveModule, + ]) + .component('exchangeAlias', component) + .run(/* @ngTranslationsInject:json ./translations */); + +export default moduleName; diff --git a/packages/manager/modules/exchange/src/account/alias/account-alias.styles.scss b/packages/manager/modules/exchange/src/alias/exchange-alias.styles.scss similarity index 100% rename from packages/manager/modules/exchange/src/account/alias/account-alias.styles.scss rename to packages/manager/modules/exchange/src/alias/exchange-alias.styles.scss diff --git a/packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.component.js b/packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.component.js new file mode 100644 index 000000000000..b5cd967dd152 --- /dev/null +++ b/packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.component.js @@ -0,0 +1,11 @@ +import controller from './exchange-alias-remove.controller'; +import template from './exchange-alias-remove.html'; + +export default { + controller, + template, + bindings: { + goBack: '<', + aliasType: '<', + }, +}; diff --git a/packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.controller.js b/packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.controller.js similarity index 73% rename from packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.controller.js rename to packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.controller.js index ca304ca49dd4..eec1e4421678 100644 --- a/packages/manager/modules/exchange/src/account/alias/remove/account-alias-remove.controller.js +++ b/packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.controller.js @@ -1,17 +1,16 @@ +import { ALIAS_TYPE_FOR_API_PATH } from '../exchange-alias.constants'; + export default class ExchangeRemoveAliasCtrl { /* @ngInject */ - constructor($scope, wucExchange, navigation, $translate) { + constructor($scope, wucExchange, messaging, $translate) { this.services = { $scope, + messaging, wucExchange, - navigation, $translate, }; this.$routerParams = wucExchange.getParams(); - this.account = navigation.currentActionData.account; - this.alias = navigation.currentActionData.alias; - $scope.submit = () => this.submit(); } @@ -20,8 +19,9 @@ export default class ExchangeRemoveAliasCtrl { .deleteAlias( this.$routerParams.organization, this.$routerParams.productId, - this.account.primaryEmailAddress, - this.alias.alias, + this.$routerParams[this.aliasType], + ALIAS_TYPE_FOR_API_PATH[this.aliasType], + this.$routerParams.alias, ) .then(() => { this.services.messaging.writeSuccess( @@ -39,7 +39,7 @@ export default class ExchangeRemoveAliasCtrl { ); }) .finally(() => { - this.services.navigation.resetAction(); + this.goBack(); }); } } diff --git a/packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.html b/packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.html new file mode 100644 index 000000000000..29c07c5e5ab1 --- /dev/null +++ b/packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.html @@ -0,0 +1,23 @@ +
+
+

+
+
+
+ +
+
+
+
+
diff --git a/packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.module.js b/packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.module.js new file mode 100644 index 000000000000..f80460f901ec --- /dev/null +++ b/packages/manager/modules/exchange/src/alias/remove/exchange-alias-remove.module.js @@ -0,0 +1,14 @@ +import angular from 'angular'; +import 'angular-translate'; +import '@ovh-ux/ui-kit'; +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; + +import component from './exchange-alias-remove.component'; + +const moduleName = 'ovhManagerExchangeAliasRemove'; + +angular + .module(moduleName, [ngTranslateAsyncLoader, 'oui', 'pascalprecht.translate']) + .component('exchangeAliasRemove', component); + +export default moduleName; diff --git a/packages/manager/modules/exchange/src/account/alias/translations/Messages_de_DE.json b/packages/manager/modules/exchange/src/alias/translations/Messages_de_DE.json similarity index 100% rename from packages/manager/modules/exchange/src/account/alias/translations/Messages_de_DE.json rename to packages/manager/modules/exchange/src/alias/translations/Messages_de_DE.json diff --git a/packages/manager/modules/exchange/src/account/alias/translations/Messages_en_GB.json b/packages/manager/modules/exchange/src/alias/translations/Messages_en_GB.json similarity index 100% rename from packages/manager/modules/exchange/src/account/alias/translations/Messages_en_GB.json rename to packages/manager/modules/exchange/src/alias/translations/Messages_en_GB.json diff --git a/packages/manager/modules/exchange/src/account/alias/translations/Messages_es_ES.json b/packages/manager/modules/exchange/src/alias/translations/Messages_es_ES.json similarity index 100% rename from packages/manager/modules/exchange/src/account/alias/translations/Messages_es_ES.json rename to packages/manager/modules/exchange/src/alias/translations/Messages_es_ES.json diff --git a/packages/manager/modules/exchange/src/account/alias/translations/Messages_fr_CA.json b/packages/manager/modules/exchange/src/alias/translations/Messages_fr_CA.json similarity index 100% rename from packages/manager/modules/exchange/src/account/alias/translations/Messages_fr_CA.json rename to packages/manager/modules/exchange/src/alias/translations/Messages_fr_CA.json diff --git a/packages/manager/modules/exchange/src/account/alias/translations/Messages_fr_FR.json b/packages/manager/modules/exchange/src/alias/translations/Messages_fr_FR.json similarity index 100% rename from packages/manager/modules/exchange/src/account/alias/translations/Messages_fr_FR.json rename to packages/manager/modules/exchange/src/alias/translations/Messages_fr_FR.json diff --git a/packages/manager/modules/exchange/src/account/alias/translations/Messages_it_IT.json b/packages/manager/modules/exchange/src/alias/translations/Messages_it_IT.json similarity index 100% rename from packages/manager/modules/exchange/src/account/alias/translations/Messages_it_IT.json rename to packages/manager/modules/exchange/src/alias/translations/Messages_it_IT.json diff --git a/packages/manager/modules/exchange/src/account/alias/translations/Messages_pl_PL.json b/packages/manager/modules/exchange/src/alias/translations/Messages_pl_PL.json similarity index 100% rename from packages/manager/modules/exchange/src/account/alias/translations/Messages_pl_PL.json rename to packages/manager/modules/exchange/src/alias/translations/Messages_pl_PL.json diff --git a/packages/manager/modules/exchange/src/account/alias/translations/Messages_pt_PT.json b/packages/manager/modules/exchange/src/alias/translations/Messages_pt_PT.json similarity index 100% rename from packages/manager/modules/exchange/src/account/alias/translations/Messages_pt_PT.json rename to packages/manager/modules/exchange/src/alias/translations/Messages_pt_PT.json diff --git a/packages/manager/modules/exchange/src/dashboard/exchange.module.js b/packages/manager/modules/exchange/src/dashboard/exchange.module.js index 71e0f7a8396e..ae2d6c247c42 100644 --- a/packages/manager/modules/exchange/src/dashboard/exchange.module.js +++ b/packages/manager/modules/exchange/src/dashboard/exchange.module.js @@ -32,6 +32,7 @@ import resource from '../resource/resource.module'; import disclaimer from '../disclaimer/disclaimer.module'; import shared from '../shared/shared.module'; import task from '../task/task.module'; +import alias from '../alias/exchange-alias.module'; import { EXCHANGE_MX_CONFIG, @@ -70,6 +71,7 @@ angular disclaimer, shared, task, + alias, ]) .constant('EXCHANGE_MX_CONFIG', EXCHANGE_MX_CONFIG) .constant('EXCHANGE_CONFIG_URL', EXCHANGE_CONFIG_URL) diff --git a/packages/manager/modules/exchange/src/dashboard/exchange.template.js b/packages/manager/modules/exchange/src/dashboard/exchange.template.js index 0bd88b8cf451..66cac1612ddc 100644 --- a/packages/manager/modules/exchange/src/dashboard/exchange.template.js +++ b/packages/manager/modules/exchange/src/dashboard/exchange.template.js @@ -5,8 +5,6 @@ import serviceDiskOrderSpaceTemplate from '../information/disk/service-disk-orde import disclaimerRemoveTemplate from '../disclaimer/remove/disclaimer-remove.html'; import disclaimerUpdateTemplate from '../disclaimer/update/disclaimer-update.html'; import disclaimerAddTemplate from '../disclaimer/add/disclaimer-add.html'; -import groupAliasRemoveTemplate from '../group/alias/remove/group-alias-remove.html'; -import groupAliasAddTemplate from '../group/alias/add/group-alias-add.html'; import groupRemoveTemplate from '../group/remove/group-remove.html'; import groupUpdateTemplate from '../group/update/group-update.html'; import groupMemberRemoveTemplate from '../group/member/remove/group-member-remove.html'; @@ -49,9 +47,6 @@ import externalContactAddTemplate from '../external-contact/add/external-contact import officeAttachDialogTemplate from '../office-attach/dialog/office-attach-dialog.html'; import officeAttachTemplate from '../office-attach/office-attach.html'; import accountOrderTemplate from '../account/order/account-order.html'; -import accountAliasRemoveTemplate from '../account/alias/remove/account-alias-remove.html'; -import accountAliasTemplate from '../account/alias/account-alias.html'; -import accountAliasAddTemplate from '../account/alias/add/account-alias-add.html'; import accountRemoveTemplate from '../account/remove/account-remove.html'; import accountTemplate from '../account/account.html'; import accountDelegationTemplate from '../account/delegation/account-delegation.html'; @@ -111,14 +106,6 @@ export default /* @ngInject */ ($templateCache) => { 'exchange/disclaimer/add/disclaimer-add.html', disclaimerAddTemplate, ); - $templateCache.put( - 'exchange/group/alias/remove/group-alias-remove.html', - groupAliasRemoveTemplate, - ); - $templateCache.put( - 'exchange/group/alias/add/group-alias-add.html', - groupAliasAddTemplate, - ); $templateCache.put( 'exchange/group/remove/group-remove.html', groupRemoveTemplate, @@ -281,18 +268,6 @@ export default /* @ngInject */ ($templateCache) => { 'exchange/account/order/account-order.html', accountOrderTemplate, ); - $templateCache.put( - 'exchange/account/alias/remove/account-alias-remove.html', - accountAliasRemoveTemplate, - ); - $templateCache.put( - 'exchange/account/alias/account-alias.html', - accountAliasTemplate, - ); - $templateCache.put( - 'exchange/account/alias/add/account-alias-add.html', - accountAliasAddTemplate, - ); $templateCache.put( 'exchange/account/remove/account-remove.html', accountRemoveTemplate, diff --git a/packages/manager/modules/exchange/src/dashboard/exchangeControllers.module.js b/packages/manager/modules/exchange/src/dashboard/exchangeControllers.module.js index fec69c51c860..7014a1237da0 100644 --- a/packages/manager/modules/exchange/src/dashboard/exchangeControllers.module.js +++ b/packages/manager/modules/exchange/src/dashboard/exchangeControllers.module.js @@ -7,9 +7,6 @@ import ExchangeExternalContactsDeleteCtrl from '../external-contact/remove/exter import ExchangeExternalContactsModifyCtrl from '../external-contact/update/external-contact-update.controller'; import ExchangeGroupAccountsCtrl from '../group/accounts/group-accounts.controller'; import ExchangeAddGroupCtrl from '../group/add/group-add.controller'; -import ExchangeAddGroupAliasCtrl from '../group/alias/add/group-alias-add.controller'; -import ExchangeTabGroupAliasCtrl from '../group/alias/group-alias.controller'; -import ExchangeRemoveGroupAliasCtrl from '../group/alias/remove/group-alias-remove.controller'; import ExchangeMailingListDelegationCtrl from '../group/delegation/group-delegation.controller'; import ExchangeTabGroupsCtrl from '../group/group.controller'; import ExchangeTabManagersByGroupsCtrl from '../group/manager/group-manager.controller'; @@ -34,8 +31,6 @@ import ExchangeUpdateResourceController from '../resource/update/resource-update import ExchangeAddSharedAccountCtrl from '../shared-account/add/shared-account-add.controller'; import ExchangeSharedAccountDelegationCtrl from '../shared-account/delegation/shared-account-delegation.controller'; import exchangeAccountCtlr from '../account/account.controller'; -import ExchangeAddAccountAliasCtrl from '../account/alias/add/account-alias-add.controller'; -import ExchangeRemoveAliasCtrl from '../account/alias/remove/account-alias-remove.controller'; import ExchangeAccountDelegationCtrl from '../account/delegation/account-delegation.controller'; import ExchangeExportToCsvAccountsCtrl from '../account/export-as-csv/account-export-as-csv.controller'; import ExchangeExportAsPstCtrl from '../account/export-as-pst/account-export-as-pst.controller'; @@ -63,7 +58,6 @@ import ExchangeDomainSpfAutoconfigCtrl from '../domain/spf-autoconfig/domain-spf import ExchangeDomainDkimAutoconfigCtrl from '../domain/dkim-autoconfig/domain-dkim-autoconfig.controller'; import ExchangeUpdateDomainCtrl from '../domain/update/domain-update.controller'; import ExchangeDeleteSharedAccountCtrl from '../shared-account/delete/shared-account-delete.controller'; -import ExchangeTabSharedAccountsCtrl from '../shared-account/shared-account.controller'; import ExchangeUpdateSharedAccountCtrl from '../shared-account/update/shared-account-update.controller'; import ExchangeAddPublicFolderCtrl from '../shared/add/shared-add.controller'; import ExchangeRemovePublicFolderPermissionCtrl from '../shared/permission/remove/shared-permission-remove.controller'; @@ -101,9 +95,6 @@ angular ) .controller('ExchangeGroupAccountsCtrl', ExchangeGroupAccountsCtrl) .controller('ExchangeAddGroupCtrl', ExchangeAddGroupCtrl) - .controller('ExchangeAddGroupAliasCtrl', ExchangeAddGroupAliasCtrl) - .controller('ExchangeTabGroupAliasCtrl', ExchangeTabGroupAliasCtrl) - .controller('ExchangeRemoveGroupAliasCtrl', ExchangeRemoveGroupAliasCtrl) .controller( 'ExchangeMailingListDelegationCtrl', ExchangeMailingListDelegationCtrl, @@ -140,8 +131,6 @@ angular ExchangeSharedAccountDelegationCtrl, ) .controller('exchangeAccountCtlr', exchangeAccountCtlr) - .controller('ExchangeAddAccountAliasCtrl', ExchangeAddAccountAliasCtrl) - .controller('ExchangeRemoveAliasCtrl', ExchangeRemoveAliasCtrl) .controller('ExchangeAccountDelegationCtrl', ExchangeAccountDelegationCtrl) .controller( 'ExchangeExportToCsvAccountsCtrl', @@ -187,7 +176,6 @@ angular 'ExchangeDeleteSharedAccountCtrl', ExchangeDeleteSharedAccountCtrl, ) - .controller('ExchangeTabSharedAccountsCtrl', ExchangeTabSharedAccountsCtrl) .controller( 'ExchangeUpdateSharedAccountCtrl', ExchangeUpdateSharedAccountCtrl, diff --git a/packages/manager/modules/exchange/src/dashboard/translations/Messages_de_DE.json b/packages/manager/modules/exchange/src/dashboard/translations/Messages_de_DE.json index eb8fd20eb190..4bc0d4ce2670 100644 --- a/packages/manager/modules/exchange/src/dashboard/translations/Messages_de_DE.json +++ b/packages/manager/modules/exchange/src/dashboard/translations/Messages_de_DE.json @@ -233,8 +233,8 @@ "exchange_tab_ALIAS_add_alias_step2_account_label": "Dazugehöriger Account", "exchange_tab_ALIAS_add_alias_valid_smtp": "Achtung, einige Sonderzeichen können nicht in einem Alias-Namen verwendet werden, zum Beispiel + ? / () [] ;", "exchange_tab_ALIAS_add_alias_valid_x500": "Bitte beachten Sie: Das Sonderzeichen „@“ ist für eine X500-Adresse unzulässig.", - "exchange_tab_ALIAS_add_alias_success_message": "Alias wird hinzugefügt.", - "exchange_tab_ALIAS_add_alias_error_message": "Bei der Erstellung Ihres Alias ist ein Fehler aufgetreten.", + "exchange_tab_ALIAS_add_alias_success_message": "Der Alias wird hinzugefügt.", + "exchange_tab_ALIAS_add_alias_error_message": "Bei der Erstellung Ihres Alias ist ein Fehler aufgetreten. {{ error }}", "exchange_tab_ALIAS_add_no_domains": "Sie haben noch keine Domain hinzugefügt oder diese wurde noch nicht validiert.
Sie müssen zuerst eine Domain hinzufügen und deren Validierung abwarten, um einen Alias für Ihren Exchange Account erstellen zu können.", "exchange_tab_ALIAS_domain_loading_failure": "Beim Laden Ihrer Domains ist ein Fehler aufgetreten.", "exchange_tab_ALIAS_add_alias_limit_tooltip": "Sie haben das Limit von {0} Alias pro Exchange Account erreicht.", diff --git a/packages/manager/modules/exchange/src/dashboard/translations/Messages_en_GB.json b/packages/manager/modules/exchange/src/dashboard/translations/Messages_en_GB.json index 16be2962747e..c232292dcbfb 100644 --- a/packages/manager/modules/exchange/src/dashboard/translations/Messages_en_GB.json +++ b/packages/manager/modules/exchange/src/dashboard/translations/Messages_en_GB.json @@ -234,7 +234,7 @@ "exchange_tab_ALIAS_add_alias_valid_smtp": "Important: Some special symbols are not accepted in alias names, for example: + ? / () [] ;", "exchange_tab_ALIAS_add_alias_valid_x500": "Please note that the special character '@' is not accepted for an X500 address", "exchange_tab_ALIAS_add_alias_success_message": "The alias will be added.", - "exchange_tab_ALIAS_add_alias_error_message": "An error has occurred creating your alias.", + "exchange_tab_ALIAS_add_alias_error_message": "An error has occurred creating your alias {{ error }}", "exchange_tab_ALIAS_add_no_domains": "You haven't added a domain yet, or it still hasn't been validated.
You must enter a domain and wait for it to be validated before you can create an Exchange account.", "exchange_tab_ALIAS_domain_loading_failure": "An error has occurred when loading your domains.", "exchange_tab_ALIAS_add_alias_limit_tooltip": "You have reached the limit of {0} aliases per Exchange account.", diff --git a/packages/manager/modules/exchange/src/dashboard/translations/Messages_es_ES.json b/packages/manager/modules/exchange/src/dashboard/translations/Messages_es_ES.json index 038199ce04bc..c931ef07f19e 100644 --- a/packages/manager/modules/exchange/src/dashboard/translations/Messages_es_ES.json +++ b/packages/manager/modules/exchange/src/dashboard/translations/Messages_es_ES.json @@ -233,8 +233,8 @@ "exchange_tab_ALIAS_add_alias_step2_account_label": "Cuenta asociada", "exchange_tab_ALIAS_add_alias_valid_smtp": "Atención, algunos caracteres especiales no están permitidos en el nombre de un alias, por ejemplo + ? / () [] ;", "exchange_tab_ALIAS_add_alias_valid_x500": "Atención, el carácter especial «@» no es compatible con las direcciones X500.", - "exchange_tab_ALIAS_add_alias_success_message": "Va a añadirse el alias.", - "exchange_tab_ALIAS_add_alias_error_message": "Se ha producido un error al crear el alias.", + "exchange_tab_ALIAS_add_alias_success_message": "Se va a añadir el alias.", + "exchange_tab_ALIAS_add_alias_error_message": "Se ha producido un error al crear el alias. {{ error }}", "exchange_tab_ALIAS_add_no_domains": "Aún no ha añadido un dominio o este todavía no ha sido validado.
Para crear un alias para su cuenta Exchange, es necesario añadir primero un dominio y esperar a que sea validado.", "exchange_tab_ALIAS_domain_loading_failure": "Se ha producido un error al cargar los dominios.", "exchange_tab_ALIAS_add_alias_limit_tooltip": "Ha alcanzado el límite de {0} alias por cuenta Exchange.", diff --git a/packages/manager/modules/exchange/src/dashboard/translations/Messages_fr_CA.json b/packages/manager/modules/exchange/src/dashboard/translations/Messages_fr_CA.json index b4dc41d78695..585329a32152 100644 --- a/packages/manager/modules/exchange/src/dashboard/translations/Messages_fr_CA.json +++ b/packages/manager/modules/exchange/src/dashboard/translations/Messages_fr_CA.json @@ -233,8 +233,8 @@ "exchange_tab_ALIAS_add_alias_step2_account_label": "Compte attaché", "exchange_tab_ALIAS_add_alias_valid_smtp": "Attention, certains caractères spéciaux ne sont pas acceptés dans le nom d'un alias, par exemple + ? / () [] ;", "exchange_tab_ALIAS_add_alias_valid_x500": "Attention, le caractère spécial « @ » n'est pas accepté dans le cadre d'une adresse X500", - "exchange_tab_ALIAS_add_alias_success_message": "L’alias va être ajouté.", - "exchange_tab_ALIAS_add_alias_error_message": "Une erreur est survenue lors de la création de votre alias.", + "exchange_tab_ALIAS_add_alias_success_message": "L'alias va être ajouté.", + "exchange_tab_ALIAS_add_alias_error_message": "Une erreur est survenue lors de la création de votre alias. {{ error }}", "exchange_tab_ALIAS_add_no_domains": "Vous n'avez pas encore ajouté de domaine ou il n'a pas encore été validé.
Vous devez d'abord ajouter un domaine et attendre qu'il soit validé pour créer un alias à votre compte Exchange.", "exchange_tab_ALIAS_domain_loading_failure": "Une erreur est survenue lors du chargement de vos domaines.", "exchange_tab_ALIAS_add_alias_limit_tooltip": "Vous avez atteint la limite de {0} alias par compte Exchange.", diff --git a/packages/manager/modules/exchange/src/dashboard/translations/Messages_fr_FR.json b/packages/manager/modules/exchange/src/dashboard/translations/Messages_fr_FR.json index b4dc41d78695..585329a32152 100644 --- a/packages/manager/modules/exchange/src/dashboard/translations/Messages_fr_FR.json +++ b/packages/manager/modules/exchange/src/dashboard/translations/Messages_fr_FR.json @@ -233,8 +233,8 @@ "exchange_tab_ALIAS_add_alias_step2_account_label": "Compte attaché", "exchange_tab_ALIAS_add_alias_valid_smtp": "Attention, certains caractères spéciaux ne sont pas acceptés dans le nom d'un alias, par exemple + ? / () [] ;", "exchange_tab_ALIAS_add_alias_valid_x500": "Attention, le caractère spécial « @ » n'est pas accepté dans le cadre d'une adresse X500", - "exchange_tab_ALIAS_add_alias_success_message": "L’alias va être ajouté.", - "exchange_tab_ALIAS_add_alias_error_message": "Une erreur est survenue lors de la création de votre alias.", + "exchange_tab_ALIAS_add_alias_success_message": "L'alias va être ajouté.", + "exchange_tab_ALIAS_add_alias_error_message": "Une erreur est survenue lors de la création de votre alias. {{ error }}", "exchange_tab_ALIAS_add_no_domains": "Vous n'avez pas encore ajouté de domaine ou il n'a pas encore été validé.
Vous devez d'abord ajouter un domaine et attendre qu'il soit validé pour créer un alias à votre compte Exchange.", "exchange_tab_ALIAS_domain_loading_failure": "Une erreur est survenue lors du chargement de vos domaines.", "exchange_tab_ALIAS_add_alias_limit_tooltip": "Vous avez atteint la limite de {0} alias par compte Exchange.", diff --git a/packages/manager/modules/exchange/src/dashboard/translations/Messages_it_IT.json b/packages/manager/modules/exchange/src/dashboard/translations/Messages_it_IT.json index 7afa62427c0f..ca833f074068 100644 --- a/packages/manager/modules/exchange/src/dashboard/translations/Messages_it_IT.json +++ b/packages/manager/modules/exchange/src/dashboard/translations/Messages_it_IT.json @@ -233,8 +233,8 @@ "exchange_tab_ALIAS_add_alias_step2_account_label": "Account associato", "exchange_tab_ALIAS_add_alias_valid_smtp": "Attenzione, alcuni caratteri speciali non sono accettati nel nome di un alias, come ad esempio + ? / () [] ;", "exchange_tab_ALIAS_add_alias_valid_x500": "Attenzione: il carattere speciale \"@\" non è accettato per gli indirizzi X500", - "exchange_tab_ALIAS_add_alias_success_message": "L'alias sta per essere aggiunto", - "exchange_tab_ALIAS_add_alias_error_message": "Si è verificato un errore nella creazione del tuo alias.", + "exchange_tab_ALIAS_add_alias_success_message": "L'alias verrà aggiunto.", + "exchange_tab_ALIAS_add_alias_error_message": "Si è verificato un errore durante la creazione dell'alias: {{ error }}", "exchange_tab_ALIAS_add_no_domains": "Non hai ancora aggiunto un dominio o non è ancora stato validato.
Aggiungi un dominio e aspetta che venga validato prima di creare un alias per il tuo account Exchange.", "exchange_tab_ALIAS_domain_loading_failure": "Si è verificato un errore nel caricamento dei tuoi domini", "exchange_tab_ALIAS_add_alias_limit_tooltip": "Hai raggiunto il limite di {0} alias per account Exchange.", diff --git a/packages/manager/modules/exchange/src/dashboard/translations/Messages_pl_PL.json b/packages/manager/modules/exchange/src/dashboard/translations/Messages_pl_PL.json index bd371c3e456b..d5506cfe147b 100644 --- a/packages/manager/modules/exchange/src/dashboard/translations/Messages_pl_PL.json +++ b/packages/manager/modules/exchange/src/dashboard/translations/Messages_pl_PL.json @@ -234,7 +234,7 @@ "exchange_tab_ALIAS_add_alias_valid_smtp": "Uwaga, niektóre znaki specjalne nie są dozwolone w nazwie aliasu, na przykład + ? / () [] ;", "exchange_tab_ALIAS_add_alias_valid_x500": "Uwaga: znak „@” nie jest akceptowany w adresie X500", "exchange_tab_ALIAS_add_alias_success_message": "Alias zostanie dodany.", - "exchange_tab_ALIAS_add_alias_error_message": "Wystąpił błąd podczas tworzenia aliasu.", + "exchange_tab_ALIAS_add_alias_error_message": "Wystąpił błąd podczas tworzenia aliasu. {{error}}", "exchange_tab_ALIAS_add_no_domains": "Nie dodałeś jeszcze domeny lub domena nie została jeszcze zatwierdzona.
Najpierw dodaj domenę i poczekaj na jej zatwierdzenie, aby utworzyć alias dla konta Exchange.", "exchange_tab_ALIAS_domain_loading_failure": "Wystąpił błąd podczas wyświetlania domen.", "exchange_tab_ALIAS_add_alias_limit_tooltip": "Osiągnąłeś limit {0} aliasów przewidziany dla konta Exchange.", diff --git a/packages/manager/modules/exchange/src/dashboard/translations/Messages_pt_PT.json b/packages/manager/modules/exchange/src/dashboard/translations/Messages_pt_PT.json index 520b8af8723c..434080320337 100644 --- a/packages/manager/modules/exchange/src/dashboard/translations/Messages_pt_PT.json +++ b/packages/manager/modules/exchange/src/dashboard/translations/Messages_pt_PT.json @@ -234,7 +234,7 @@ "exchange_tab_ALIAS_add_alias_valid_smtp": "Atenção, certos caracteres especiais não são aceites no nome de um alias, por exemplo + ? / () [] ;", "exchange_tab_ALIAS_add_alias_valid_x500": "Atenção: o caráter especial \"@\" não é aceite no âmbito de um endereço X500", "exchange_tab_ALIAS_add_alias_success_message": "O alias vai ser adicionado.", - "exchange_tab_ALIAS_add_alias_error_message": "Ocorreu um erro aquando da criação do seu alias.", + "exchange_tab_ALIAS_add_alias_error_message": "Ocorreu um erro aquando da criação do seu alias. {{ error }}", "exchange_tab_ALIAS_add_no_domains": "Ainda não adicionou um domínio ou o mesmo ainda não foi validado.
Deve de seguida adicionar um domínio e aguardar que o mesmo esteja válido para que possa criar um alias na sua conta Exchange.", "exchange_tab_ALIAS_domain_loading_failure": "Ocorreu um erro aquando do carregamento dos seus domínios.", "exchange_tab_ALIAS_add_alias_limit_tooltip": "Já atingiu o limite de {0} alias por cada conta Exchange.", diff --git a/packages/manager/modules/exchange/src/group/alias/add/group-alias-add.controller.js b/packages/manager/modules/exchange/src/group/alias/add/group-alias-add.controller.js deleted file mode 100644 index 38fad4cf5562..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/add/group-alias-add.controller.js +++ /dev/null @@ -1,124 +0,0 @@ -import has from 'lodash/has'; -import head from 'lodash/head'; -import includes from 'lodash/includes'; -import isEmpty from 'lodash/isEmpty'; -import isString from 'lodash/isString'; - -export default class ExchangeAddGroupAliasCtrl { - /* @ngInject */ - constructor($scope, wucExchange, navigation, messaging, $translate) { - this.services = { - $scope, - wucExchange, - navigation, - messaging, - $translate, - }; - - this.$routerParams = wucExchange.getParams(); - this.selectedMailingList = navigation.currentActionData; - this.availableDomains = null; - this.model = {}; - - $scope.addGroupAlias = () => this.addGroupAlias(); - $scope.aliasIsValid = () => this.aliasIsValid(); - $scope.loadDomainData = () => this.loadDomainData(); - } - - loadDomainData() { - this.services.wucExchange - .getNewAliasOptions( - this.$routerParams.organization, - this.$routerParams.productId, - this.selectedMailingList.mailingListName, - 'MAILING_LIST', - ) - .then((data) => { - if (isEmpty(data.availableDomains)) { - this.services.messaging.writeError( - this.services.$translate.instant( - 'exchange_tab_ALIAS_add_no_domains', - ), - ); - this.services.navigation.resetAction(); - } else { - this.availableDomains = data.availableDomains; - this.takenEmails = data.takenEmails; - this.model.domain = head(data.availableDomains); - } - }) - .catch((err) => { - this.services.messaging.writeError( - this.services.$translate.instant( - 'exchange_tab_ALIAS_domain_loading_failure', - ), - err.data, - ); - this.services.navigation.resetAction(); - }); - } - - checkTakenEmails() { - this.takenEmailError = false; - const modelIsWellFormed = - !isEmpty(this.model) && - isString(this.model.alias) && - has(this.model, 'domain.name'); - - if (modelIsWellFormed) { - const emailIsAlreadyUsed = - !isEmpty(this.takenEmails) && - includes( - this.takenEmails, - `${this.model.alias.toLowerCase()}@${this.model.domain.name}`, - ); - - if (emailIsAlreadyUsed) { - this.takenEmailError = true; - } - } - } - - addGroupAlias() { - this.services.wucExchange - .addGroupAlias( - this.$routerParams.organization, - this.$routerParams.productId, - this.selectedMailingList.mailingListName, - this.model, - ) - .then((data) => { - this.services.messaging.writeSuccess( - this.services.$translate.instant( - 'exchange_tab_ALIAS_add_alias_success_message', - ), - data, - ); - }) - .catch((err) => { - this.services.messaging.writeError( - this.services.$translate.instant( - 'exchange_tab_ALIAS_add_alias_error_message', - ), - err, - ); - }) - .finally(() => { - this.services.navigation.resetAction(); - }); - } - - aliasIsValid() { - if (isEmpty(this.model)) { - return false; - } - - const aliasIsValid = - !isEmpty(this.model.alias) && - isString(this.model.alias) && - this.model.alias.length <= 64; - const hasDomain = !isEmpty(this.model.domain); - - return aliasIsValid && hasDomain && !this.takenEmailError; - } -} diff --git a/packages/manager/modules/exchange/src/group/alias/add/group-alias-add.html b/packages/manager/modules/exchange/src/group/alias/add/group-alias-add.html deleted file mode 100644 index c69e367d067c..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/add/group-alias-add.html +++ /dev/null @@ -1,89 +0,0 @@ -
-
-
- - -
-

- -
-
-
- - @ - -
- - -
-
- - -
-
- -
-

-
-
-
- -
-
-
-
-
-
diff --git a/packages/manager/modules/exchange/src/group/alias/alias.module.js b/packages/manager/modules/exchange/src/group/alias/add/group-alias-add.module.js similarity index 75% rename from packages/manager/modules/exchange/src/group/alias/alias.module.js rename to packages/manager/modules/exchange/src/group/alias/add/group-alias-add.module.js index a0c9e27b7c50..3df47885542d 100644 --- a/packages/manager/modules/exchange/src/group/alias/alias.module.js +++ b/packages/manager/modules/exchange/src/group/alias/add/group-alias-add.module.js @@ -3,9 +3,9 @@ import 'angular-translate'; import '@ovh-ux/ui-kit'; import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; -import routing from './alias.routing'; +import routing from './group-alias-add.routing'; -const moduleName = 'ovhManagerExchangeDashboardGroupAlias'; +const moduleName = 'ovhManagerExchangeDashboardGroupAliasAdd'; angular .module(moduleName, [ngTranslateAsyncLoader, 'oui', 'pascalprecht.translate']) diff --git a/packages/manager/modules/exchange/src/group/alias/add/group-alias-add.routing.js b/packages/manager/modules/exchange/src/group/alias/add/group-alias-add.routing.js new file mode 100644 index 000000000000..bc71b9ebb223 --- /dev/null +++ b/packages/manager/modules/exchange/src/group/alias/add/group-alias-add.routing.js @@ -0,0 +1,15 @@ +export default /* @ngInject */ ($stateProvider) => { + $stateProvider.state('exchange.dashboard.group.mailing-list.alias.add', { + url: '/add', + views: { + modal: { + component: 'exchangeAliasAdd', + }, + }, + layout: 'modal', + resolve: { + breadcrumb: /* @ngInject */ ($translate) => + $translate.instant('exchange_account_alias'), + }, + }); +}; diff --git a/packages/manager/modules/exchange/src/group/alias/alias.routing.js b/packages/manager/modules/exchange/src/group/alias/alias.routing.js deleted file mode 100644 index 84801b12cbaf..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/alias.routing.js +++ /dev/null @@ -1,19 +0,0 @@ -import template from './group-alias.html'; - -export default /* @ngInject */ ($stateProvider) => { - $stateProvider.state('exchange.dashboard.group.mailing-list.alias', { - url: '/alias', - controller: 'ExchangeTabGroupAliasCtrl', - controllerAs: 'ctrl', - template, - params: { - mailingList: {}, - }, - resolve: { - mailingList: /* @ngInject */ ($transition$) => - $transition$.params().mailingList, - breadcrumb: /* @ngInject */ ($translate) => - $translate.instant('exchange_group_alias'), - }, - }); -}; diff --git a/packages/manager/modules/exchange/src/group/alias/group-alias.controller.js b/packages/manager/modules/exchange/src/group/alias/group-alias.controller.js deleted file mode 100644 index 696854ed11b7..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/group-alias.controller.js +++ /dev/null @@ -1,138 +0,0 @@ -import has from 'lodash/has'; - -export default class ExchangeTabGroupAliasCtrl { - /* @ngInject */ - constructor( - $scope, - wucExchange, - goToGroup, - mailingList, - navigation, - messaging, - $translate, - exchangeStates, - ) { - this.services = { - $scope, - wucExchange, - navigation, - messaging, - $translate, - exchangeStates, - }; - - this.$routerParams = wucExchange.getParams(); - this.aliasMaxLimit = this.services.wucExchange.aliasMaxLimit; - this.aliasesParams = {}; - this.goToGroup = goToGroup; - this.mailingList = mailingList; - - $scope.$on(this.services.wucExchange.events.groupsChanged, () => - this.refreshList(), - ); - $scope.getAliases = (pageSize, offset) => this.getAliases(pageSize, offset); - $scope.getAliaseObjects = () => this.getAliaseObjects(); - } - - getAliases({ pageSize, offset }) { - this.aliasesParams.pageSize = pageSize; - this.aliasesParams.offset = offset; - - return this.services.wucExchange - .getGroupAliasList( - this.$routerParams.organization, - this.$routerParams.productId, - this.mailingList.mailingListAddress, - pageSize, - offset - 1, - ) - .then((data) => { - this.aliases = data.list.results; - this.aliasesParams.results = { - data: data.list.results, - meta: { - totalCount: data.count, - }, - }; - return this.aliasesParams.results; - }) - .catch((err) => - this.services.messaging.writeError( - this.services.$translate.instant('exchange_tab_ALIAS_error_message'), - err, - ), - ); - } - - refreshList() { - this.services.wucExchange - .getGroupAliasList( - this.$routerParams.organization, - this.$routerParams.productId, - this.mailingList.mailingListAddress, - this.aliasesParams.pageSize, - this.aliasesParams.offset - 1, - ) - .then((data) => { - this.aliasesParams.results.meta.totalCount = data.count; - for (let i = 0; i < data.list.results.length; i += 1) { - this.aliases.splice(i, 1, data.list.results[i]); - } - for ( - let i = data.list.results.length; - i < this.aliases.length; - i += 1 - ) { - this.aliases.splice(i, 1); - } - }) - .catch((err) => - this.services.messaging.writeError( - this.services.$translate.instant('exchange_tab_ALIAS_error_message'), - err, - ), - ); - } - - deleteGroupAlias(alias) { - if (!alias.taskPendingId) { - this.services.navigation.setAction( - 'exchange/group/alias/remove/group-alias-remove', - { - selectedGroup: this.mailingList, - alias, - }, - ); - } - } - - addGroupAlias() { - if ( - this.mailingList && - this.mailingList.aliases <= this.aliasMaxLimit && - this.services.exchangeStates.constructor.isOk(this.mailingList) - ) { - this.services.navigation.setAction( - 'exchange/group/alias/add/group-alias-add', - this.mailingList, - ); - } - } - - getAddAliasTooltip() { - if ( - has(this.mailingList, 'aliases') && - this.mailingList.aliases >= this.aliasMaxLimit - ) { - return this.services.$translate.instant( - 'exchange_tab_ALIAS_add_alias_limit_tooltip', - ); - } - - return null; - } - - getAliaseObjects() { - return this.aliases; - } -} diff --git a/packages/manager/modules/exchange/src/group/alias/group-alias.html b/packages/manager/modules/exchange/src/group/alias/group-alias.html deleted file mode 100644 index 46e86071193e..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/group-alias.html +++ /dev/null @@ -1,54 +0,0 @@ -
-
- - - -

- - - - - - - - - - - - -
- -
- - - -
-
diff --git a/packages/manager/modules/exchange/src/group/alias/group-alias.module.js b/packages/manager/modules/exchange/src/group/alias/group-alias.module.js new file mode 100644 index 000000000000..6979d42c42b4 --- /dev/null +++ b/packages/manager/modules/exchange/src/group/alias/group-alias.module.js @@ -0,0 +1,23 @@ +import angular from 'angular'; +import 'angular-translate'; +import '@ovh-ux/ui-kit'; +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; + +import routing from './group-alias.routing'; +import aliasAddModule from './add/group-alias-add.module'; +import aliasRemoveModule from './remove/group-alias-remove.module'; + +const moduleName = 'ovhManagerExchangeDashboardGroupAlias'; + +angular + .module(moduleName, [ + ngTranslateAsyncLoader, + 'oui', + 'pascalprecht.translate', + aliasAddModule, + aliasRemoveModule, + ]) + .config(routing) + .run(/* @ngTranslationsInject:json ./translations */); + +export default moduleName; diff --git a/packages/manager/modules/exchange/src/group/alias/group-alias.routing.js b/packages/manager/modules/exchange/src/group/alias/group-alias.routing.js new file mode 100644 index 000000000000..60a5e5099d47 --- /dev/null +++ b/packages/manager/modules/exchange/src/group/alias/group-alias.routing.js @@ -0,0 +1,18 @@ +export default /* @ngInject */ ($stateProvider) => { + $stateProvider.state('exchange.dashboard.group.mailing-list.alias', { + url: '/alias', + component: 'exchangeAlias', + resolve: { + aliasType: /* @ngInject */ () => 'group', + goBack: /* @ngInject */ ($state) => () => $state.go('^'), + goToAliasAdd: /* @ngInject */ ($state) => () => + $state.go('exchange.dashboard.group.mailing-list.alias.add'), + goToAliasRemove: /* @ngInject */ ($state) => (alias) => + $state.go('exchange.dashboard.group.mailing-list.alias.remove', { + alias, + }), + breadcrumb: /* @ngInject */ ($translate) => + $translate.instant('exchange_account_alias'), + }, + }); +}; diff --git a/packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.controller.js b/packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.controller.js deleted file mode 100644 index f3758bfd253e..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.controller.js +++ /dev/null @@ -1,50 +0,0 @@ -export default class ExchangeRemoveGroupAliasCtrl { - /* @ngInject */ - constructor($scope, wucExchange, navigation, $translate, messaging) { - this.services = { - $scope, - wucExchange, - navigation, - $translate, - messaging, - }; - - this.$routerParams = wucExchange.getParams(); - } - - $onInit() { - this.selectedGroup = this.services.navigation.currentActionData.selectedGroup; - this.alias = this.services.navigation.currentActionData.alias; - - this.services.$scope.submit = () => this.submit(); - } - - submit() { - this.services.wucExchange - .deleteGroupAlias( - this.$routerParams.organization, - this.$routerParams.productId, - this.selectedGroup.mailingListAddress, - this.alias.alias, - ) - .then((success) => { - this.services.messaging.writeSuccess( - this.services.$translate.instant( - 'exchange_tab_ALIAS_delete_success_message', - ), - success, - ); - }) - .catch((err) => { - this.services.messaging.writeError( - this.services.$translate.instant( - 'exchange_tab_ALIAS_delete_error_message', - ), - err, - ); - }) - .finally(() => { - this.services.navigation.resetAction(); - }); - } -} diff --git a/packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.html b/packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.html deleted file mode 100644 index ba89af79693d..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.html +++ /dev/null @@ -1,27 +0,0 @@ -
-
-
-

-
-
-
- -
-
-
-
-
-
diff --git a/packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.module.js b/packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.module.js new file mode 100644 index 000000000000..8dc8c3da7fc3 --- /dev/null +++ b/packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.module.js @@ -0,0 +1,15 @@ +import angular from 'angular'; +import 'angular-translate'; +import '@ovh-ux/ui-kit'; +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; + +import routing from './group-alias-remove.routing'; + +const moduleName = 'ovhManagerExchangeDashboardGroupAliasRemove'; + +angular + .module(moduleName, [ngTranslateAsyncLoader, 'oui', 'pascalprecht.translate']) + .config(routing) + .run(/* @ngTranslationsInject:json ./translations */); + +export default moduleName; diff --git a/packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.routing.js b/packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.routing.js new file mode 100644 index 000000000000..c214f1734b20 --- /dev/null +++ b/packages/manager/modules/exchange/src/group/alias/remove/group-alias-remove.routing.js @@ -0,0 +1,15 @@ +export default /* @ngInject */ ($stateProvider) => { + $stateProvider.state('exchange.dashboard.group.mailing-list.alias.remove', { + url: '/remove?alias', + views: { + modal: { + component: 'exchangeAliasRemove', + }, + }, + layout: 'modal', + resolve: { + breadcrumb: /* @ngInject */ ($translate) => + $translate.instant('exchange_account_alias'), + }, + }); +}; diff --git a/packages/manager/modules/exchange/src/group/alias/translations/Messages_de_DE.json b/packages/manager/modules/exchange/src/group/alias/translations/Messages_de_DE.json deleted file mode 100644 index ba05b0cffcc0..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/translations/Messages_de_DE.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exchange_group_alias": "Liste der Alias" -} diff --git a/packages/manager/modules/exchange/src/group/alias/translations/Messages_en_GB.json b/packages/manager/modules/exchange/src/group/alias/translations/Messages_en_GB.json deleted file mode 100644 index 16618b535bd5..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/translations/Messages_en_GB.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exchange_group_alias": "List of aliases" -} diff --git a/packages/manager/modules/exchange/src/group/alias/translations/Messages_es_ES.json b/packages/manager/modules/exchange/src/group/alias/translations/Messages_es_ES.json deleted file mode 100644 index 5ee942885e85..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/translations/Messages_es_ES.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exchange_group_alias": "Lista de alias" -} diff --git a/packages/manager/modules/exchange/src/group/alias/translations/Messages_fr_CA.json b/packages/manager/modules/exchange/src/group/alias/translations/Messages_fr_CA.json deleted file mode 100644 index 596bcd1f2436..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/translations/Messages_fr_CA.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exchange_group_alias": "Liste des alias" -} diff --git a/packages/manager/modules/exchange/src/group/alias/translations/Messages_fr_FR.json b/packages/manager/modules/exchange/src/group/alias/translations/Messages_fr_FR.json deleted file mode 100644 index 596bcd1f2436..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/translations/Messages_fr_FR.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exchange_group_alias": "Liste des alias" -} diff --git a/packages/manager/modules/exchange/src/group/alias/translations/Messages_it_IT.json b/packages/manager/modules/exchange/src/group/alias/translations/Messages_it_IT.json deleted file mode 100644 index d214d95dcd72..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/translations/Messages_it_IT.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exchange_group_alias": "Elenco degli alias" -} diff --git a/packages/manager/modules/exchange/src/group/alias/translations/Messages_pl_PL.json b/packages/manager/modules/exchange/src/group/alias/translations/Messages_pl_PL.json deleted file mode 100644 index 6086909b038b..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/translations/Messages_pl_PL.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exchange_group_alias": "Lista aliasów" -} diff --git a/packages/manager/modules/exchange/src/group/alias/translations/Messages_pt_PT.json b/packages/manager/modules/exchange/src/group/alias/translations/Messages_pt_PT.json deleted file mode 100644 index 6af3e962b87f..000000000000 --- a/packages/manager/modules/exchange/src/group/alias/translations/Messages_pt_PT.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exchange_group_alias": "Lista dos alias" -} diff --git a/packages/manager/modules/exchange/src/group/group.controller.js b/packages/manager/modules/exchange/src/group/group.controller.js index e4a5d7061880..e8ed988712f2 100644 --- a/packages/manager/modules/exchange/src/group/group.controller.js +++ b/packages/manager/modules/exchange/src/group/group.controller.js @@ -70,14 +70,7 @@ export default class ExchangeTabGroupsCtrl { } displayAliasesByGroup(ml) { - this.search = null; this.goToAlias(ml); - this.services.navigation.selectedGroup = ml; - this.services.$scope.$broadcast( - 'paginationServerSide.loadPage', - 1, - 'groupAliasTable', - ); } getLoading() { diff --git a/packages/manager/modules/exchange/src/group/group.html b/packages/manager/modules/exchange/src/group/group.html index 096480010fef..f51d9b297c1b 100644 --- a/packages/manager/modules/exchange/src/group/group.html +++ b/packages/manager/modules/exchange/src/group/group.html @@ -236,6 +236,14 @@ data-translate="exchange_tab_GROUPS_menu_delegation" >
+ + + { goToAlias: /* @ngInject */ ($state, $transition$) => (mailingList) => $state.go('exchange.dashboard.group.mailing-list.alias', { ...$transition$.params(), - mailingList, - address: mailingList.mailingListAddress, + group: mailingList.mailingListAddress, }), goToGroup: /* @ngInject */ ($state, $transition$) => () => $state.go('exchange.dashboard.group', $transition$.params()), goToManager: /* @ngInject */ ($state, $transition$) => (mailingList) => $state.go('exchange.dashboard.group.mailing-list.manager', { ...$transition$.params(), - mailingList, - address: mailingList.mailingListAddress, + group: mailingList.mailingListAddress, }), goToMembers: /* @ngInject */ ($state, $transition$) => (mailingList) => $state.go('exchange.dashboard.group.mailing-list.member', { ...$transition$.params(), - mailingList, - address: mailingList.mailingListAddress, + group: mailingList.mailingListAddress, }), breadcrumb: /* @ngInject */ ($translate) => $translate.instant('exchange_group'), @@ -33,12 +30,11 @@ export default /* @ngInject */ ($stateProvider) => { }); $stateProvider.state('exchange.dashboard.group.mailing-list', { - url: '/:address', + url: '/:group', redirectTo: 'exchange.dashboard.group', template: '
', resolve: { - address: /* @ngInject */ ($transition$) => $transition$.params().address, - breadcrumb: /* @ngInject */ (address) => address, + breadcrumb: /* @ngInject */ ($transition$) => $transition$.params().group, }, }); }; diff --git a/packages/manager/modules/exchange/src/group/manager/group-manager.controller.js b/packages/manager/modules/exchange/src/group/manager/group-manager.controller.js index 6211dc0611be..8dfa24a6e0c0 100644 --- a/packages/manager/modules/exchange/src/group/manager/group-manager.controller.js +++ b/packages/manager/modules/exchange/src/group/manager/group-manager.controller.js @@ -4,7 +4,6 @@ export default class ExchangeTabManagersByGroupsCtrl { $scope, wucExchange, navigation, - mailingList, messaging, $translate, goToGroup, @@ -22,7 +21,6 @@ export default class ExchangeTabManagersByGroupsCtrl { this.$routerParams = wucExchange.getParams(); this.groupParams = {}; this.goToGroup = goToGroup; - this.mailingList = mailingList; $scope.$on(wucExchange.events.accountsChanged, () => this.refreshList()); $scope.getManagersList = () => this.managersList; @@ -39,7 +37,7 @@ export default class ExchangeTabManagersByGroupsCtrl { .retrievingManagersByGroup( this.$routerParams.organization, this.$routerParams.productId, - this.mailingList.mailingListName, + this.$routerParams.group, pageSize, offset - 1, ) @@ -67,7 +65,7 @@ export default class ExchangeTabManagersByGroupsCtrl { .retrievingManagersByGroup( this.$routerParams.organization, this.$routerParams.productId, - this.mailingList.mailingListName, + this.$routerParams.group, this.groupParams.pageSize, this.groupParams.offset - 1, ) @@ -97,7 +95,6 @@ export default class ExchangeTabManagersByGroupsCtrl { this.services.navigation.setAction( 'exchange/group/manager/remove/group-manager-remove', { - group: this.mailingList, manager, }, ); diff --git a/packages/manager/modules/exchange/src/group/manager/group-manager.html b/packages/manager/modules/exchange/src/group/manager/group-manager.html index 3a935c5d713b..b774e732f70d 100644 --- a/packages/manager/modules/exchange/src/group/manager/group-manager.html +++ b/packages/manager/modules/exchange/src/group/manager/group-manager.html @@ -1,7 +1,5 @@
- - - +

diff --git a/packages/manager/modules/exchange/src/group/manager/manager.routing.js b/packages/manager/modules/exchange/src/group/manager/manager.routing.js index 0337b9e8db13..c4f2b94885b4 100644 --- a/packages/manager/modules/exchange/src/group/manager/manager.routing.js +++ b/packages/manager/modules/exchange/src/group/manager/manager.routing.js @@ -6,12 +6,7 @@ export default /* @ngInject */ ($stateProvider) => { controller: 'ExchangeTabManagersByGroupsCtrl', controllerAs: 'ctrl', template, - params: { - mailingList: {}, - }, resolve: { - mailingList: /* @ngInject */ ($transition$) => - $transition$.params().mailingList, breadcrumb: /* @ngInject */ ($translate) => $translate.instant('exchange_group_manager'), }, diff --git a/packages/manager/modules/exchange/src/group/manager/remove/group-manager-remove.controller.js b/packages/manager/modules/exchange/src/group/manager/remove/group-manager-remove.controller.js index 8a2e3df2f7aa..0d05e6adb49e 100644 --- a/packages/manager/modules/exchange/src/group/manager/remove/group-manager-remove.controller.js +++ b/packages/manager/modules/exchange/src/group/manager/remove/group-manager-remove.controller.js @@ -10,7 +10,6 @@ export default class ExchangeRemoveManagerCtrl { }; this.$routerParams = wucExchange.getParams(); - this.group = navigation.currentActionData.group; this.manager = navigation.currentActionData.manager; $scope.submit = () => this.submit(); @@ -25,7 +24,7 @@ export default class ExchangeRemoveManagerCtrl { .removeManager( this.$routerParams.organization, this.$routerParams.productId, - this.group.mailingListName, + this.$routerParams.group, this.manager.id, ) .then((success) => { @@ -34,7 +33,7 @@ export default class ExchangeRemoveManagerCtrl { 'exchange_GROUPS_remove_manager_success_message', { t0: this.manager.primaryEmailAddress, - t1: this.group.mailingListDisplayName, + t1: this.$routerParams.group, }, ), success, @@ -46,7 +45,7 @@ export default class ExchangeRemoveManagerCtrl { 'exchange_GROUPS_remove_manager_error_message', { t0: this.manager.primaryEmailAddress, - t1: this.group.mailingListDisplayName, + t1: this.$routerParams.group, }, ), failure, diff --git a/packages/manager/modules/exchange/src/group/manager/remove/group-manager-remove.html b/packages/manager/modules/exchange/src/group/manager/remove/group-manager-remove.html index 2633680cabae..71f4b3f991d8 100644 --- a/packages/manager/modules/exchange/src/group/manager/remove/group-manager-remove.html +++ b/packages/manager/modules/exchange/src/group/manager/remove/group-manager-remove.html @@ -14,7 +14,7 @@ >
this.refreshList()); $scope.getMembersList = () => this.membersList; @@ -41,7 +39,7 @@ export default class ExchangeTabMembersByGroupsCtrl { .retrievingMembersByGroup( this.$routerParams.organization, this.$routerParams.productId, - this.mailingList.mailingListName, + this.$routerParams.group, pageSize, offset - 1, ) @@ -69,7 +67,7 @@ export default class ExchangeTabMembersByGroupsCtrl { .retrievingMembersByGroup( this.$routerParams.organization, this.$routerParams.productId, - this.mailingList.mailingListName, + this.$routerParams.group, this.groupParams.pageSize, this.groupParams.offset - 1, ) @@ -99,7 +97,6 @@ export default class ExchangeTabMembersByGroupsCtrl { this.services.navigation.setAction( 'exchange/group/member/remove/group-member-remove', { - group: this.mailingList, member, }, ); diff --git a/packages/manager/modules/exchange/src/group/member/group-member.html b/packages/manager/modules/exchange/src/group/member/group-member.html index efbdb045a5cd..e4837d08aba3 100644 --- a/packages/manager/modules/exchange/src/group/member/group-member.html +++ b/packages/manager/modules/exchange/src/group/member/group-member.html @@ -1,7 +1,5 @@
- - - +

diff --git a/packages/manager/modules/exchange/src/group/member/member.routing.js b/packages/manager/modules/exchange/src/group/member/member.routing.js index 5e576beeb627..4219217a2edc 100644 --- a/packages/manager/modules/exchange/src/group/member/member.routing.js +++ b/packages/manager/modules/exchange/src/group/member/member.routing.js @@ -6,12 +6,7 @@ export default /* @ngInject */ ($stateProvider) => { controller: 'ExchangeTabMembersByGroupsCtrl', controllerAs: 'ctrl', template, - params: { - mailingList: {}, - }, resolve: { - mailingList: /* @ngInject */ ($transition$) => - $transition$.params().mailingList, breadcrumb: /* @ngInject */ ($translate) => $translate.instant('exchange_group_member'), }, diff --git a/packages/manager/modules/exchange/src/group/member/remove/group-member-remove.controller.js b/packages/manager/modules/exchange/src/group/member/remove/group-member-remove.controller.js index f4d30e7fdddc..17c07425ac8a 100644 --- a/packages/manager/modules/exchange/src/group/member/remove/group-member-remove.controller.js +++ b/packages/manager/modules/exchange/src/group/member/remove/group-member-remove.controller.js @@ -11,7 +11,6 @@ export default class ExchangeRemoveMemberCtrl { this.$routerParams = wucExchange.getParams(); - this.group = navigation.currentActionData.group; this.member = navigation.currentActionData.member; $scope.submit = () => this.submit(); @@ -26,7 +25,7 @@ export default class ExchangeRemoveMemberCtrl { .removeMember( this.$routerParams.organization, this.$routerParams.productId, - this.group.mailingListName, + this.$routerParams.group, this.member.id, this.member.type, ) @@ -36,7 +35,7 @@ export default class ExchangeRemoveMemberCtrl { 'exchange_GROUPS_remove_member_success_message', { t0: this.member.primaryEmailAddress, - t1: this.group.mailingListDisplayName, + t1: this.$routerParams.group, }, ), success, @@ -48,7 +47,7 @@ export default class ExchangeRemoveMemberCtrl { 'exchange_GROUPS_remove_member_error_message', { t0: this.member.primaryEmailAddress, - t1: this.group.mailingListDisplayName, + t1: this.$routerParams.group, }, ), failure, diff --git a/packages/manager/modules/exchange/src/group/member/remove/group-member-remove.html b/packages/manager/modules/exchange/src/group/member/remove/group-member-remove.html index 3738256c1b23..7e4fb91f4d87 100644 --- a/packages/manager/modules/exchange/src/group/member/remove/group-member-remove.html +++ b/packages/manager/modules/exchange/src/group/member/remove/group-member-remove.html @@ -14,7 +14,7 @@ >
{ + $stateProvider.state('exchange.dashboard.shared-account.shared.alias.add', { + url: '/add', + views: { + modal: { + component: 'exchangeAliasAdd', + }, + }, + layout: 'modal', + resolve: { + breadcrumb: /* @ngInject */ ($translate) => + $translate.instant('exchange_account_alias'), + }, + }); +}; diff --git a/packages/manager/modules/exchange/src/shared-account/alias/remove/shared-account-alias-remove.module.js b/packages/manager/modules/exchange/src/shared-account/alias/remove/shared-account-alias-remove.module.js new file mode 100644 index 000000000000..499837269900 --- /dev/null +++ b/packages/manager/modules/exchange/src/shared-account/alias/remove/shared-account-alias-remove.module.js @@ -0,0 +1,15 @@ +import angular from 'angular'; +import 'angular-translate'; +import '@ovh-ux/ui-kit'; +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; + +import routing from './shared-account-alias-remove.routing'; + +const moduleName = 'ovhManagerExchangeDashboardSharedAccountAliasRemove'; + +angular + .module(moduleName, [ngTranslateAsyncLoader, 'oui', 'pascalprecht.translate']) + .config(routing) + .run(/* @ngTranslationsInject:json ./translations */); + +export default moduleName; diff --git a/packages/manager/modules/exchange/src/shared-account/alias/remove/shared-account-alias-remove.routing.js b/packages/manager/modules/exchange/src/shared-account/alias/remove/shared-account-alias-remove.routing.js new file mode 100644 index 000000000000..32796c61a9e1 --- /dev/null +++ b/packages/manager/modules/exchange/src/shared-account/alias/remove/shared-account-alias-remove.routing.js @@ -0,0 +1,18 @@ +export default /* @ngInject */ ($stateProvider) => { + $stateProvider.state( + 'exchange.dashboard.shared-account.shared.alias.remove', + { + url: '/remove?alias', + views: { + modal: { + component: 'exchangeAliasRemove', + }, + }, + layout: 'modal', + resolve: { + breadcrumb: /* @ngInject */ ($translate) => + $translate.instant('exchange_account_alias'), + }, + }, + ); +}; diff --git a/packages/manager/modules/exchange/src/shared-account/alias/shared-account-alias.module.js b/packages/manager/modules/exchange/src/shared-account/alias/shared-account-alias.module.js new file mode 100644 index 000000000000..a0203961540b --- /dev/null +++ b/packages/manager/modules/exchange/src/shared-account/alias/shared-account-alias.module.js @@ -0,0 +1,22 @@ +import angular from 'angular'; +import 'angular-translate'; +import '@ovh-ux/ui-kit'; +import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; + +import routing from './shared-account-alias.routing'; +import aliasAddModule from './add/shared-account-alias-add.module'; +import aliasRemoveModule from './remove/shared-account-alias-remove.module'; + +const moduleName = 'ovhManagerExchangeDashboardSharedAccountAlias'; + +angular + .module(moduleName, [ + ngTranslateAsyncLoader, + 'oui', + 'pascalprecht.translate', + aliasAddModule, + aliasRemoveModule, + ]) + .config(routing); + +export default moduleName; diff --git a/packages/manager/modules/exchange/src/shared-account/alias/shared-account-alias.routing.js b/packages/manager/modules/exchange/src/shared-account/alias/shared-account-alias.routing.js new file mode 100644 index 000000000000..991b997017dd --- /dev/null +++ b/packages/manager/modules/exchange/src/shared-account/alias/shared-account-alias.routing.js @@ -0,0 +1,18 @@ +export default /* @ngInject */ ($stateProvider) => { + $stateProvider.state('exchange.dashboard.shared-account.shared.alias', { + url: '/alias', + component: 'exchangeAlias', + resolve: { + aliasType: /* @ngInject */ () => 'shared', + goBack: /* @ngInject */ ($state) => () => $state.go('^'), + goToAliasAdd: /* @ngInject */ ($state) => () => + $state.go('exchange.dashboard.shared-account.shared.alias.add'), + goToAliasRemove: /* @ngInject */ ($state) => (alias) => + $state.go('exchange.dashboard.shared-account.shared.alias.remove', { + alias, + }), + breadcrumb: /* @ngInject */ ($translate) => + $translate.instant('exchange_account_alias'), + }, + }); +}; diff --git a/packages/manager/modules/exchange/src/shared-account/shared-account.component.js b/packages/manager/modules/exchange/src/shared-account/shared-account.component.js new file mode 100644 index 000000000000..570638cc6460 --- /dev/null +++ b/packages/manager/modules/exchange/src/shared-account/shared-account.component.js @@ -0,0 +1,12 @@ +import controller from './shared-account.controller'; +import template from './shared-account.html'; + +export default { + bindings: { + productId: '<', + organization: '<', + goToAliasManagement: '<', + }, + controller, + template, +}; diff --git a/packages/manager/modules/exchange/src/shared-account/shared-account.controller.js b/packages/manager/modules/exchange/src/shared-account/shared-account.controller.js index 8ed8c9354fd0..49018b6a7920 100644 --- a/packages/manager/modules/exchange/src/shared-account/shared-account.controller.js +++ b/packages/manager/modules/exchange/src/shared-account/shared-account.controller.js @@ -227,4 +227,8 @@ export default class ExchangeTabSharedAccountsCtrl { ); } } + + displayAliasManagementView(account) { + this.goToAliasManagement(account); + } } diff --git a/packages/manager/modules/exchange/src/shared-account/shared-account.html b/packages/manager/modules/exchange/src/shared-account/shared-account.html index 8914d79c6cf0..b71bea146967 100644 --- a/packages/manager/modules/exchange/src/shared-account/shared-account.html +++ b/packages/manager/modules/exchange/src/shared-account/shared-account.html @@ -1,243 +1,262 @@ -
-
-
+
+
+
+
- + -
-
- -
- -
- + +
+ + +
- - -
-
- - -
- - - - - - - - - + - - - - - +
+
- -
+ + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + - + + + + + - + + + + + + + + + + + + + + + - - - - -
+ +
- - - - - - - - -
- - - - - - - - +
+ + + + + + + + + + - - - -
- - -
-
+ + + + + + + + +
-
-
+
+
-
- - +
+ + +
diff --git a/packages/manager/modules/exchange/src/shared-account/shared-account.module.js b/packages/manager/modules/exchange/src/shared-account/shared-account.module.js index d08823eb15a9..4f6a2e360709 100644 --- a/packages/manager/modules/exchange/src/shared-account/shared-account.module.js +++ b/packages/manager/modules/exchange/src/shared-account/shared-account.module.js @@ -4,11 +4,19 @@ import '@ovh-ux/ui-kit'; import ngTranslateAsyncLoader from '@ovh-ux/ng-translate-async-loader'; import routing from './shared-account.routing'; +import component from './shared-account.component'; +import alias from './alias/shared-account-alias.module'; const moduleName = 'ovhManagerExchangeDashboardSharedAccount'; angular - .module(moduleName, [ngTranslateAsyncLoader, 'oui', 'pascalprecht.translate']) + .module(moduleName, [ + ngTranslateAsyncLoader, + 'oui', + 'pascalprecht.translate', + alias, + ]) + .component('exchangeSharedAccountHome', component) .config(routing) .run(/* @ngTranslationsInject:json ./translations */); diff --git a/packages/manager/modules/exchange/src/shared-account/shared-account.routing.js b/packages/manager/modules/exchange/src/shared-account/shared-account.routing.js index 57afaef90c56..9028e4f8af7c 100644 --- a/packages/manager/modules/exchange/src/shared-account/shared-account.routing.js +++ b/packages/manager/modules/exchange/src/shared-account/shared-account.routing.js @@ -1,14 +1,28 @@ -import template from './shared-account.html'; - export default /* @ngInject */ ($stateProvider) => { $stateProvider.state('exchange.dashboard.shared-account', { url: '/shared-account', - controller: 'ExchangeTabSharedAccountsCtrl', - controllerAs: 'ctrl', - template, + component: 'exchangeSharedAccountHome', resolve: { + goToAliasManagement: /* @ngInject */ ($state, $transition$) => ( + account, + ) => + $state.go('exchange.dashboard.shared-account.shared.alias', { + ...$transition$.params(), + account, + shared: account.primaryEmailAddress, + }), breadcrumb: /* @ngInject */ ($translate) => $translate.instant('exchange_dashboard_shared_account'), }, }); + + $stateProvider.state('exchange.dashboard.shared-account.shared', { + url: '/:shared', + template: '
', + redirectTo: 'exchange.dashboard.shared-account', + resolve: { + shared: /* @ngInject */ ($transition$) => $transition$.params().shared, + breadcrumb: /* @ngInject */ (shared) => shared, + }, + }); }; diff --git a/packages/manager/modules/web-universe-components/src/exchange/exchange.service.js b/packages/manager/modules/web-universe-components/src/exchange/exchange.service.js index 1076107794e3..e82617ee62c1 100644 --- a/packages/manager/modules/web-universe-components/src/exchange/exchange.service.js +++ b/packages/manager/modules/web-universe-components/src/exchange/exchange.service.js @@ -799,20 +799,34 @@ export default class Exchange { getAliases( organizationName, exchangeService, - account, - count = 10, + email, + aliasType, offset = 0, + pageSize = 25, + sort = { name: 'alias', dir: 'asc' }, + filters = null, ) { - return this.services.OvhHttp.get( - `/sws/exchange/${organizationName}/${exchangeService}/accounts/${account}/alias`, - { - rootPath: '2api', - params: { - count, - offset, - }, + let res = this.services + .iceberg( + `/email/exchange/${organizationName}/service/${exchangeService}/${aliasType}/${email}/alias`, + ) + .query() + .expand('CachedObjectList-Pages') + .limit(pageSize) + .offset(offset) + .sort(sort.name, sort.dir); + if (filters !== null) { + filters.forEach((item) => { + res = res.addFilter(item.name, item.operator, item.value); + }); + } + return res.execute(null, true).$promise.then((response) => ({ + data: response.data, + meta: { + totalCount: + parseInt(response.headers['x-pagination-elements'], 10) || 0, }, - ); + })); } /** @@ -841,49 +855,26 @@ export default class Exchange { /** * Add an account alias */ - addAlias(organization, serviceName, account, alias) { - return this.services.OvhHttp.post( - '/email/exchange/{organization}/service/{exchange}/account/{account}/alias', - { - rootPath: 'apiv6', - urlParams: { - organization, - exchange: serviceName, - account, - }, - data: { + addAlias(organization, productId, email, aliasType, alias) { + return this.services.$http + .post( + `/email/exchange/${organization}/service/${productId}/${aliasType}/${email}/alias`, + { alias, }, - }, - ).then((data) => { - this.resetAccounts(); - this.resetTasks(); - - return data; - }); + ) + .then((data) => data); } /** * Delete an account alias */ - deleteAlias(organization, productId, account, alias) { - return this.services.OvhHttp.delete( - '/email/exchange/{organization}/service/{exchange}/account/{account}/alias/{alias}', - { - rootPath: 'apiv6', - urlParams: { - organization, - exchange: productId, - account, - alias, - }, - }, - ).then((data) => { - this.resetAccounts(); - this.resetTasks(); - - return data; - }); + deleteAlias(organization, productId, email, aliasType, alias) { + return this.services.$http + .delete( + `/email/exchange/${organization}/service/${productId}/${aliasType}/${email}/alias/${alias}`, + ) + .then((data) => data); } getGroupManagerList(organization, serviceName, groupName, count, offset) { From ae3236abe33a32416992297c1ab6e6f1aea0fa44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phanie=20MOALLIC?= Date: Thu, 14 Nov 2024 18:10:36 +0100 Subject: [PATCH 4/8] feat(overthebox): add deprecated label in release channel version (#13958) ref: UXCT-628 Signed-off-by: Stephanie Moallic Co-authored-by: CDS Translator Agent --- .../details/overTheBox-details.constant.js | 2 + .../details/overTheBox-details.controller.js | 38 +++++++++++-------- .../details/translations/Messages_de_DE.json | 4 +- .../details/translations/Messages_en_GB.json | 4 +- .../details/translations/Messages_es_ES.json | 4 +- .../details/translations/Messages_fr_CA.json | 7 ++-- .../details/translations/Messages_fr_FR.json | 7 ++-- .../details/translations/Messages_it_IT.json | 4 +- .../details/translations/Messages_pl_PL.json | 4 +- .../details/translations/Messages_pt_PT.json | 4 +- 10 files changed, 49 insertions(+), 29 deletions(-) diff --git a/packages/manager/modules/overthebox/src/overthebox/details/overTheBox-details.constant.js b/packages/manager/modules/overthebox/src/overthebox/details/overTheBox-details.constant.js index 50e009d89274..7a55e5772ebb 100644 --- a/packages/manager/modules/overthebox/src/overthebox/details/overTheBox-details.constant.js +++ b/packages/manager/modules/overthebox/src/overthebox/details/overTheBox-details.constant.js @@ -74,4 +74,6 @@ export default { unknown: 'unknown', }, pattern: /[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}/, + deprecated: '_deprecated', + version: 'v', }; diff --git a/packages/manager/modules/overthebox/src/overthebox/details/overTheBox-details.controller.js b/packages/manager/modules/overthebox/src/overthebox/details/overTheBox-details.controller.js index 5d65bccda27d..52aff02fcf75 100644 --- a/packages/manager/modules/overthebox/src/overthebox/details/overTheBox-details.controller.js +++ b/packages/manager/modules/overthebox/src/overthebox/details/overTheBox-details.controller.js @@ -384,6 +384,27 @@ export default class OverTheBoxDetailsCtrl { }); } + /** + * Translate channel with deprecated translation managed + * @param {*} channel channel to be translate + * @returns translated channel + */ + translateReleaseChannel(channel) { + if (channel.includes(this.OVERTHEBOX_DETAILS.deprecated)) { + // Remove deprecated part + const version = channel.split(this.OVERTHEBOX_DETAILS.deprecated)[0]; + return this.$translate.instant('overTheBox_release_channel_deprecated', { + version, + }); + } + if (channel.includes(this.OVERTHEBOX_DETAILS.version)) { + return this.$translate.instant('overTheBox_release_channel', { + version: channel, + }); + } + return this.$translate.instant(`overTheBox_release_channel_${channel}`); + } + /** * Get available release channels * @returns {Promise} @@ -397,23 +418,10 @@ export default class OverTheBoxDetailsCtrl { .$promise.then((channels) => { this.releaseChannels = channels.map((channel) => ({ name: channel, - label: this.$translate.instant( - `overTheBox_release_channel_${channel.replace('.', '_')}`, - ), + label: this.translateReleaseChannel(channel), })); - const result = this.releaseChannels.find( - (channel) => this.releaseChannel === channel.name, - ); - - if (result) { - this.releaseChannel = this.$translate.instant( - `overTheBox_release_channel_${this.releaseChannel.replace( - '.', - '_', - )}`, - ); - } + this.releaseChannel = this.translateReleaseChannel(this.releaseChannel); }); } diff --git a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_de_DE.json b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_de_DE.json index f451e33944d7..af234e6767ab 100644 --- a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_de_DE.json +++ b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_de_DE.json @@ -98,5 +98,7 @@ "overTheBox_cancel": "Abbrechen", "overTheBox_confirm_unlink_device": "Dieses Gerät kann keine Verbindung mehr mit diesem Dienst herstellen, sind Sie sicher?", "overTheBox_unlink_device_error": "Das Gerät konnte nicht getrennt werden: {{errorMessage}}", - "overTheBox_unlink_device_success": "Die Zuordnung des Geräts wurde erfolgreich aufgehoben." + "overTheBox_unlink_device_success": "Die Zuordnung des Geräts wurde erfolgreich aufgehoben.", + "overTheBox_release_channel_deprecated": "Veraltete Version {{version}}", + "overTheBox_release_channel": "Version {{version}}" } diff --git a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_en_GB.json b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_en_GB.json index b893f6381a89..75101e76eddc 100644 --- a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_en_GB.json +++ b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_en_GB.json @@ -98,5 +98,7 @@ "overTheBox_cancel": "Cancel", "overTheBox_confirm_unlink_device": "This device will no longer be able to connect to this service, are you sure?", "overTheBox_unlink_device_error": "Unable to unlink the device: {{errorMessage}}", - "overTheBox_unlink_device_success": "Your device has been successfully detached." + "overTheBox_unlink_device_success": "Your device has been successfully detached.", + "overTheBox_release_channel_deprecated": "Deprecated version {{version}}", + "overTheBox_release_channel": "Version {{version}}" } diff --git a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_es_ES.json b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_es_ES.json index ad330b057fb0..a17a06925e94 100644 --- a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_es_ES.json +++ b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_es_ES.json @@ -98,5 +98,7 @@ "overTheBox_cancel": "Cancelar", "overTheBox_confirm_unlink_device": "Este dispositivo ya no podrá conectarse a este servicio, ¿está seguro?", "overTheBox_unlink_device_error": "No se pudo desasociar el dispositivo: {{errorMessage}}", - "overTheBox_unlink_device_success": "El dispositivo se ha desvinculado correctamente." + "overTheBox_unlink_device_success": "El dispositivo se ha desvinculado correctamente.", + "overTheBox_release_channel_deprecated": "Versión obsoleta {{version}}", + "overTheBox_release_channel": "Versión {{version}}" } diff --git a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_fr_CA.json b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_fr_CA.json index 517eb08a589c..a6342e3e0f7e 100644 --- a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_fr_CA.json +++ b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_fr_CA.json @@ -73,9 +73,7 @@ "overTheBox_change_release_channel_error": "Nous n'avons pas pu effectuer le changement de la version : {{errorMessage}}", "overTheBox_release_channel_stable": "Version stable avec mise à jour automatique", "overTheBox_release_channel_beta": "Version beta avec mise à jour automatique", - "overTheBox_release_channel_v0_8": "Version v0.8", - "overTheBox_release_channel_v0_9": "Version v0.9", - "overTheBox_release_channel_v1_0": "Version v1.0", + "overTheBox_release_channel": "Version {{version}}", "overTheBox_version_system": "Version du système d'exploitation", "overTheBox_last_seen": "Dernière connexion du périphérique", "overTheBox_last_seen_few_seconds": "Il y a quelques secondes", @@ -98,5 +96,6 @@ "overTheBox_confirm_unlink_device": "Ce périphérique ne pourra plus se connecter ce service, en êtes-vous sûr?", "overTheBox_unlink_device_error": "Nous n'avons pas pu dissocier le périphérique : {{errorMessage}}", "overTheBox_unlink_device_success": "Votre périphérique a été dissocié avec succès.", - "overTheBox_change_offer": "Changer d'offre" + "overTheBox_change_offer": "Changer d'offre", + "overTheBox_release_channel_deprecated": "Version dépréciée {{version}}" } diff --git a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_fr_FR.json b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_fr_FR.json index 517eb08a589c..a6342e3e0f7e 100644 --- a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_fr_FR.json +++ b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_fr_FR.json @@ -73,9 +73,7 @@ "overTheBox_change_release_channel_error": "Nous n'avons pas pu effectuer le changement de la version : {{errorMessage}}", "overTheBox_release_channel_stable": "Version stable avec mise à jour automatique", "overTheBox_release_channel_beta": "Version beta avec mise à jour automatique", - "overTheBox_release_channel_v0_8": "Version v0.8", - "overTheBox_release_channel_v0_9": "Version v0.9", - "overTheBox_release_channel_v1_0": "Version v1.0", + "overTheBox_release_channel": "Version {{version}}", "overTheBox_version_system": "Version du système d'exploitation", "overTheBox_last_seen": "Dernière connexion du périphérique", "overTheBox_last_seen_few_seconds": "Il y a quelques secondes", @@ -98,5 +96,6 @@ "overTheBox_confirm_unlink_device": "Ce périphérique ne pourra plus se connecter ce service, en êtes-vous sûr?", "overTheBox_unlink_device_error": "Nous n'avons pas pu dissocier le périphérique : {{errorMessage}}", "overTheBox_unlink_device_success": "Votre périphérique a été dissocié avec succès.", - "overTheBox_change_offer": "Changer d'offre" + "overTheBox_change_offer": "Changer d'offre", + "overTheBox_release_channel_deprecated": "Version dépréciée {{version}}" } diff --git a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_it_IT.json b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_it_IT.json index d81d5d7aedc4..4c6c9f3abf8e 100644 --- a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_it_IT.json +++ b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_it_IT.json @@ -98,5 +98,7 @@ "overTheBox_cancel": "Annullare", "overTheBox_confirm_unlink_device": "Il dispositivo non sarà in grado di connettersi al servizio?", "overTheBox_unlink_device_error": "Impossibile dissociare la periferica: {{errorMessage}}", - "overTheBox_unlink_device_success": "Il dispositivo è stato scollegato correttamente." + "overTheBox_unlink_device_success": "Il dispositivo è stato scollegato correttamente.", + "overTheBox_release_channel_deprecated": "Versione deprezzata {{version}}", + "overTheBox_release_channel": "Versione {{version}}" } diff --git a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_pl_PL.json b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_pl_PL.json index 87d274c45b89..9cb426001806 100644 --- a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_pl_PL.json +++ b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_pl_PL.json @@ -98,5 +98,7 @@ "overTheBox_cancel": "Anuluj", "overTheBox_confirm_unlink_device": "To urządzenie nie będzie już mogło łączyć się z tą usługą, czy na pewno?", "overTheBox_unlink_device_error": "Nie można odłączyć urządzenia: {{errorMessage}}", - "overTheBox_unlink_device_success": "Urządzenie zostało pomyślnie odłączone." + "overTheBox_unlink_device_success": "Urządzenie zostało pomyślnie odłączone.", + "overTheBox_release_channel_deprecated": "Wersja przestarzała {{version}}", + "overTheBox_release_channel": "Wersja {{version}}" } diff --git a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_pt_PT.json b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_pt_PT.json index 5984743d9dff..58462bb35e43 100644 --- a/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_pt_PT.json +++ b/packages/manager/modules/overthebox/src/overthebox/details/translations/Messages_pt_PT.json @@ -98,5 +98,7 @@ "overTheBox_cancel": "Anular", "overTheBox_confirm_unlink_device": "Este dispositivo já não conseguirá estabelecer ligação, tem a certeza?", "overTheBox_unlink_device_error": "Não foi possível desassociar o dispositivo: {{errorMessage}}", - "overTheBox_unlink_device_success": "O dispositivo foi dissociado com sucesso." + "overTheBox_unlink_device_success": "O dispositivo foi dissociado com sucesso.", + "overTheBox_release_channel_deprecated": "Versão com imparidade {{version}}", + "overTheBox_release_channel": "Versão {{version}}" } From 1f5730606b645da05d23a862dcfa71de2a965fc9 Mon Sep 17 00:00:00 2001 From: Steeve Vanderstocken <92584997+stif59100@users.noreply.github.com> Date: Thu, 14 Nov 2024 18:11:47 +0100 Subject: [PATCH 5/8] feat(web.domain): add tracking for domain optim (#13539) ref: MANAGER-15599 Signed-off-by: stif59100 --- .../web/client/app/domain/domains.routing.js | 9 ++++- .../export-csv/domains-export-to-csv.html | 1 - .../list/list-domain-layout.controller.js | 26 +++++++++++++ .../domain/list/restore-renew/controller.js | 22 ++++++++++- .../app/domain/list/restore-renew/routing.js | 5 +++ .../domain/list/restore-renew/template.html | 5 ++- .../web/client/app/domain/list/template.html | 35 +++++++++++++---- .../client/app/domains/domains.constant.js | 39 +++++++++++++++++++ .../web/client/app/domains/domains.routes.js | 5 +++ .../domains-export-to-csv.controller.js | 32 ++++++++++++++- 10 files changed, 163 insertions(+), 16 deletions(-) create mode 100644 packages/manager/apps/web/client/app/domains/domains.constant.js diff --git a/packages/manager/apps/web/client/app/domain/domains.routing.js b/packages/manager/apps/web/client/app/domain/domains.routing.js index 0b8670219b81..0ad40a14fcf6 100644 --- a/packages/manager/apps/web/client/app/domain/domains.routing.js +++ b/packages/manager/apps/web/client/app/domain/domains.routing.js @@ -1,5 +1,9 @@ import { ListLayoutHelper } from '@ovh-ux/manager-ng-layout-helpers'; import { getDomainOrderUrl } from './domains.order'; +import { + DOMAIN_PREFIX_PAGE_BUTTON_GO_TO_ORDER, + DOMAIN_PREFIX_LISTING_MANAGE_DOMAINS, +} from '../domains/domains.constant'; export default /* @ngInject */ ($stateProvider) => { $stateProvider.state('app.domain.index', { @@ -65,7 +69,7 @@ export default /* @ngInject */ ($stateProvider) => { value: $translate.instant('domains_order'), onClick: () => { atInternet.trackClick({ - name: 'web::domain::index::order', + name: `${DOMAIN_PREFIX_PAGE_BUTTON_GO_TO_ORDER}`, type: 'action', }); $window.open( @@ -79,5 +83,8 @@ export default /* @ngInject */ ($stateProvider) => { $state.go('app.domain.index.restore-renew', { domains }), hideBreadcrumb: () => true, }, + atInternet: { + rename: DOMAIN_PREFIX_LISTING_MANAGE_DOMAINS, + }, }); }; diff --git a/packages/manager/apps/web/client/app/domain/list/export-csv/domains-export-to-csv.html b/packages/manager/apps/web/client/app/domain/list/export-csv/domains-export-to-csv.html index e098e2c9370c..c7ca05f8fa76 100644 --- a/packages/manager/apps/web/client/app/domain/list/export-csv/domains-export-to-csv.html +++ b/packages/manager/apps/web/client/app/domain/list/export-csv/domains-export-to-csv.html @@ -11,7 +11,6 @@

-
domain.domain).join(' '), diff --git a/packages/manager/apps/web/client/app/domain/list/restore-renew/routing.js b/packages/manager/apps/web/client/app/domain/list/restore-renew/routing.js index c60dd0306aab..d937f0943122 100644 --- a/packages/manager/apps/web/client/app/domain/list/restore-renew/routing.js +++ b/packages/manager/apps/web/client/app/domain/list/restore-renew/routing.js @@ -1,3 +1,5 @@ +import { DOMAIN_PREFIX_POPUP_RENEW_RESTORE } from '../../../domains/domains.constant'; + export default /* @ngInject */ ($stateProvider) => { $stateProvider.state('app.domain.index.restore-renew', { url: '/restore-renew', @@ -21,6 +23,9 @@ export default /* @ngInject */ ($stateProvider) => { component: 'webdomainRestoreRenewModale', }, }, + atInternet: { + rename: DOMAIN_PREFIX_POPUP_RENEW_RESTORE, + }, layout: 'modal', }); }; diff --git a/packages/manager/apps/web/client/app/domain/list/restore-renew/template.html b/packages/manager/apps/web/client/app/domain/list/restore-renew/template.html index b22c385df1d1..3b64ea033368 100644 --- a/packages/manager/apps/web/client/app/domain/list/restore-renew/template.html +++ b/packages/manager/apps/web/client/app/domain/list/restore-renew/template.html @@ -4,14 +4,15 @@ data-primary-action="$ctrl.redirectToRenew()" data-primary-label="{{:: 'domains_restore_renew_modal_confirm' | translate }}" data-primary-disabled="!$ctrl.domains.length" - data-secondary-action="$ctrl.goBack()" + data-secondary-action="$ctrl.closeModal()" data-secondary-label="{{:: 'domains_restore_renew_modal_cancel' | translate }}" - data-on-dismiss="$ctrl.goBack()" + data-on-dismiss="$ctrl.closeModal()" >

+

test

- - - - +
+