Skip to content

Commit

Permalink
feat(zimbra): intialize diagnostics page
Browse files Browse the repository at this point in the history
ref: MANAGER-16089

Signed-off-by: Tristan WAGNER <[email protected]>
  • Loading branch information
tristanwagner committed Dec 10, 2024
1 parent b08a50f commit c725fd1
Show file tree
Hide file tree
Showing 33 changed files with 1,097 additions and 276 deletions.
4 changes: 2 additions & 2 deletions packages/manager/apps/zimbra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"vitest": "^2.1.2"
},
"regions": [
"CA",
"EU"
"EU",
"CA"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"zimbra_dashboard_domains_add": "Ajouter un domaine",
"zimbra_dashboard_domains_edit": "Configuration du domaine",
"zimbra_dashboard_domains_delete": "Supprimer un domaine",
"zimbra_dashboard_domains_diagnostic": "Diagnostique",
"zimbra_dashboard_domains_diagnostics": "Diagnostics",
"zimbra_dashboard_email_accounts": "Compte email",
"zimbra_dashboard_email_accounts_add": "Créer un compte email",
"zimbra_dashboard_email_accounts_edit": "Modifier le compte",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"zimbra_domains_add_domain_title": "Ajouter un domaine",
"zimbra_domains_datagrid_account_label": "Nombre de comptes",
"zimbra_domains_datagrid_diagnostic_label": "Diagnostique",
"zimbra_domains_datagrid_diagnostic_configuration_ok": "Configuration OK",
"zimbra_domains_datagrid_diagnostic_tooltip_title": "Diagnostic {{ diagType }}",
"zimbra_domains_datagrid_domain_label": "Domaine",
"zimbra_domains_datagrid_organization_label": "Organisation",
"zimbra_domains_datagrid_status_label": "Statut",
"zimbra_domains_datagrid_account_number": "Nombre de comptes",
"zimbra_domains_tooltip_configure": "Configurer",
"zimbra_domains_tooltip_delete": "Supprimer",
"zimbra_domains_tooltip_diagnostics": "Diagnostics",
"zimbra_domains_tooltip_need_organization": "Veuillez d'abord configurer une organisation"
}
Original file line number Diff line number Diff line change
@@ -1,37 +1,27 @@
{
"zimbra_domain_modal_diagnostic_guide": "guide",
"zimbra_domain_modal_diagnostic_srv_title": "Diagnostique SRV",
"zimbra_domain_modal_diagnostic_srv_content_header": "Pour faciliter la configuration des boites mails sur vos terminaux, veuillez ajouter cette configuration à votre DNS (consulter notre <guide/>)",
"zimbra_domain_modal_diagnostic_srv_content_header_ovh_hosted_domain_part1": "La configuration SRV permet la configuration automatique de vos boites mails sur vos clients de messagerie.",
"zimbra_domain_modal_diagnostic_srv_content_header_ovh_hosted_domain_part2": "Votre domaine est hébergé chez OVH Cloud, nous allons procéder à la configuration de votre champ SRV.",
"zimbra_domain_modal_diagnostic_srv_domain": "Domaine",
"zimbra_domain_modal_diagnostic_fields": "Champs",
"zimbra_domain_modal_diagnostic_srv_action_validate": "Valider",
"zimbra_domain_modal_diagnostic_srv_action_cancel": "Annuler",
"zimbra_domain_modal_diagnostic_srv_action_close": "Fermer",
"zimbra_domain_modal_diagnostic_field_subdomain": "Sous domaine :",
"zimbra_domain_modal_diagnostic_field_priority": "Priorité :",
"zimbra_domain_modal_diagnostic_field_weight": "Poids :",
"zimbra_domain_modal_diagnostic_field_port": "Port :",
"zimbra_domain_modal_diagnostic_field_target": "Cible :",
"zimbra_domain_modal_diagnostic_mx_title": "Diagnostique MX",
"zimbra_domain_modal_diagnostic_mx_content_header_part1": "La configuration de l'enregistrement MX permet de recevoir vos emails dans vos boites mail.",
"zimbra_domain_modal_diagnostic_mx_content_header_part2": "Votre domaine n'étant pas géré par OVH Cloud, cette action doit être effectuée manuellement.",
"zimbra_domain_modal_diagnostic_mx_content_header_part3": "Veuillez créer les champs MX sur ce domaine en donnant les mêmes informations que ci-dessous.",
"zimbra_domain_modal_diagnostic_mx_content_header_ovh_hosted_domain_part1": "La configuration de l'enregistrement MX permet de recevoir vos emails dans vos boites mail.",
"zimbra_domain_modal_diagnostic_mx_content_header_ovh_hosted_domain_part2": "Votre domaine étant hébergé chez OVH Cloud, nous allons effectuer la configuration pour vous.",
"zimbra_domain_modal_diagnostic_mx_content_header_ovh_hosted_domain_part3": "Souhaitez-vous commencer à recevoir les mails du domaine <strong>{{domain}}</strong> sur ce service ?",
"zimbra_domain_modal_diagnostic_mx_content_footer": "En cas de problème, consultez la documentation de votre fournisseur de domaine.",
"zimbra_domain_modal_diagnostic_mx_action_validate": "Confirmer",
"zimbra_domain_modal_diagnostic_mx_action_test": "Tester",
"zimbra_domain_modal_diagnostic_mx_action_cancel": "Annuler",
"zimbra_domain_modal_diagnostic_mx_action_close": "Fermer",
"zimbra_domain_modal_diagnostic_spf_title": "Diagnostique SPF",
"zimbra_domain_modal_diagnostic_spf_content_header": "Si le domaine n'est pas géré par le même identifiant client que le service Exchange ou si votre domaine n'est pas hébergé chez OVHcloud, la configuration automatique n'est pas possible. Veuillez créer le champ SPF sur ce domaine manuellement en donnant les mêmes informations que ci-dessous.",
"zimbra_domain_modal_diagnostic_spf_content_header_ovh_hosted_domain_part1": "SPF permet de valider qu'OVHCloud est un émetteur légitime de mails avec votre nom de domaine.",
"zimbra_domain_modal_diagnostic_spf_content_header_ovh_hosted_domain_part2": "Votre domaine étant hébergé chez OVHCloud, nous pouvons procéder à la configuration automatique.",
"zimbra_domain_modal_diagnostic_spf_content_header_ovh_hosted_domain_part3": "Souhaitez-vous effectuer la configuration ?",
"zimbra_domain_modal_diagnostic_spf_action_cancel": "Annuler",
"zimbra_domain_modal_diagnostic_spf_action_close": "Fermer",
"zimbra_domain_modal_diagnostic_spf_action_validate": "Ok"
"zimbra_domain_diagnostic_cta_back": "Retour aux domaines",
"zimbra_domain_diagnostic_cta_refresh": "Rafraîchir",
"zimbra_domain_diagnostic_cta_auto_configure": "Auto-configurer",
"zimbra_domain_diagnostics_loading_error": "Une erreur est survenue lors du chargement des diagnostics de votre domaine. Veuillez nous excuser et réessayer plus tard.",
"zimbra_domain_diagnostic_loading_error": "Aucune information à afficher pour ce diagnostic.",
"zimbra_domain_diagnostic_status": "Statut :",
"zimbra_domain_diagnostic_status_ok": "Configuration OK",
"zimbra_domain_diagnostic_status_error": "Erreur de configuration",
"zimbra_domain_diagnostic_status_updating": "En cours de configuration",
"zimbra_domain_diagnostic_status_to_configure": "Pas configuré",
"zimbra_domain_diagnostic_status_disabled": "Désactivé",
"zimbra_domain_diagnostic_information_message_mx_ok": "La configuration de votre compte Zimbra sur OVHcloud est fonctionnelle: les emails adressés à votre domaine sont correctement acheminés vers vos boîtes aux lettres Zimbra.<br/> N'hésitez pas à consulter régulièrement les diagnostics pour vous assurer du bon fonctionnement de votre service.",
"zimbra_domain_diagnostic_information_message_mx_error": "Nous constatons une configuration {{recordType}} qui ne correspond pas à celle attendue par votre service email.<br/>Si vous ne recevez pas vos emails dans les boites de destination, merci de procéder à une reconfiguration de votre Zone DNS avec les informations ci-dessous.",
"zimbra_domain_diagnostic_information_message_mx_updating": "Nous configurons actuellement votre domaine pour recevoir vos emails sur votre service Zimbra OVHCloud.<br/> Cliquez sur \"Rafraîchir\" pour actualiser le statut.",
"zimbra_domain_diagnostic_information_message_mx_to_configure": "Votre champ {{recordType}} n'étant pas configuré, vos emails ne peuvent pas être correctement acheminés vers vos boîtes aux lettres.<br/>Veuillez procéder à la configuration de votre domaine.",
"zimbra_domain_diagnostic_information_message_mx_disabled": "TO BE DEFINED",
"zimbra_domain_diagnostic_type": "Type :",
"zimbra_domain_diagnostic_access_guide": "Accéder au guide",
"zimbra_domain_diagnostic_subtitle": "Diagnostics du domaine {{domain}}",
"zimbra_domain_diagnostic_field_host": "Nom/Hôte :",
"zimbra_domain_diagnostic_field_subdomain": "Sous domaine :",
"zimbra_domain_diagnostic_field_priority": "Priorité :",
"zimbra_domain_diagnostic_field_weight": "Poids :",
"zimbra_domain_diagnostic_field_port": "Port :",
"zimbra_domain_diagnostic_field_target": "Cible :"
}
49 changes: 48 additions & 1 deletion packages/manager/apps/zimbra/src/api/_mock_/domain.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DomainType } from '@/api/domain';
import { DiagnosticResponse, DomainType } from '@/api/domain';
import { ResourceStatus } from '@/api/api.type';

export const domainDetailMock: DomainType = {
Expand Down Expand Up @@ -118,3 +118,50 @@ export const domainsMock: DomainType[] = [
];

export const domainZone: string[] = ['test.fr', 'mydomain.fr', 'domain.fr'];

export const domainDiagnosticMock = {
expectedDNSConfig: {
mx: [
{
priority: 5,
target: 'mx0.mail.ovh.net',
},
],
ownership: {
cname: 'mycname',
},
},
diagnostic: {
dkim: {
errorCode: 'INCORRECT_CNAME_RECORD',
errorMessage: 'string',
recordsFound: ['string'],
status: 'ERROR',
},
errorCode: 'DNS_TIMEOUT',
errorMessage: 'string',
mx: {
errorCode: 'MISSING_VALID_MX_RECORD',
errorMessage: 'string',
recordsFound: [
{
priority: 0,
target: 'string',
},
],
status: 'ERROR',
},
spf: {
recordFound: 'string',
status: 'OK',
},
status: 'ERROR',
},
domainId: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
domainName: 'string',
id: '19386dad-2e50-4000-86d3-0698199f4a01',
} as DiagnosticResponse;

export const domainsDiagnosticMock = [
domainDiagnosticMock,
] as DiagnosticResponse[];
33 changes: 32 additions & 1 deletion packages/manager/apps/zimbra/src/api/domain/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { fetchIcebergV2, v2, v6 } from '@ovh-ux/manager-core-api';
import { DomainBodyParamsType, DomainType } from './type';
import {
DiagnosticResponse,
DomainBodyParamsType,
DomainType,
ZoneWithIAM,
} from './type';
import { getApiPath } from '../utils/apiPath';
import { domainDiagnosticMock } from '../_mock_';

// GET

Expand All @@ -26,6 +32,11 @@ export const getDomainsZoneList = async () => {
return data;
};

export const getDomainZoneByName = async (name: string) => {
const { data } = await v6.get<ZoneWithIAM>(`/domain/zone/${name}`);
return data;
};

export const getZimbraPlatformDomainDetail = async (
platformId: string,
domainId: string,
Expand All @@ -38,6 +49,26 @@ export const getZimbraPlatformDomainDetail = async (

// POST

export const postZimbraPlatformDomainsDiagnostic = async (
platformId: string,
domainIds: string[],
mock = true,
) => {
if (mock) {
return new Promise((resolve) => {
setTimeout(() => {
const [domainId] = domainIds;
resolve([{ ...domainDiagnosticMock, domainId }]);
}, 1000);
});
}
const { data } = await v2.post<DiagnosticResponse[]>(
`${getApiPath(platformId)}domain/diagnostic`,
domainIds,
);
return data;
};

export const postZimbraDomain = async (
platformId: string,
params: DomainBodyParamsType,
Expand Down
20 changes: 15 additions & 5 deletions packages/manager/apps/zimbra/src/api/domain/key.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
export const getZimbraPlatformDomainsQueryKey = (
platformId: string,
organizationId?: string,
) => [
`get/zimbra/platform/${platformId}/domain?organizationId=${organizationId}`,
];
) => ['get', 'domain', 'zimbra', platformId, organizationId];

export const getZimbraPlatformDomainsDiagnosticQueryKey = (
platformId: string,
domainIds: string[],
) => ['get', 'domain', 'zimbra', platformId, 'diagnostic', ...domainIds];

export const getZimbraPlatformDomainQueryKey = (
platformId: string,
domainId: string,
) => [`get/zimbra/platform/${platformId}/domain/${domainId}`];
) => ['get', 'domain', 'zimbra', platformId, domainId];

export const getDomainsZoneListQueryKey = ['get/domain/zone'];
export const getDomainsZoneListQueryKey = ['get', 'domain', 'zones'];

export const getDomainZoneByNameQueryKey = (name: string) => [
'get',
'domain',
'zone',
name,
];
Loading

0 comments on commit c725fd1

Please sign in to comment.