-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web.email-domaine): add dkim feature (#14362)
ref: MANAGER-16163 Signed-off-by: Guillaume Hyenne <[email protected]> Co-authored-by: CDS Translator Agent <[email protected]>
- Loading branch information
Showing
26 changed files
with
527 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...manager/modules/email-domain/src/general-informations/dkim/email-domain-dkim.component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import controller from './email-domain-dkim.controller'; | ||
import template from './email-domain-dkim.html'; | ||
|
||
export default { | ||
bindings: { | ||
serviceName: '<', | ||
goBack: '<', | ||
dkim: '<', | ||
}, | ||
controller, | ||
template, | ||
}; |
90 changes: 90 additions & 0 deletions
90
...manager/modules/email-domain/src/general-informations/dkim/email-domain-dkim.constants.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
const DKIM_TRANSLATION_PREFIX = 'email_domain_dkim_'; | ||
|
||
export const DKIM_STATUS = { | ||
ENABLED: 'enabled', | ||
DISABLED: 'disabled', | ||
DISABLED_NO_SET: 'error', | ||
ERROR: 'error', | ||
TO_CONFIGURE: 'toConfigure', | ||
MODIFYING: 'modifying', | ||
}; | ||
|
||
export const DKIM_STATUS_TEXT = { | ||
[DKIM_STATUS.ENABLED]: `${DKIM_TRANSLATION_PREFIX}deactivation`, | ||
[DKIM_STATUS.DISABLED]: `${DKIM_TRANSLATION_PREFIX}activation`, | ||
[DKIM_STATUS.MODIFYING]: `${DKIM_TRANSLATION_PREFIX}in_progress`, | ||
}; | ||
|
||
export const DKIM_STATUS_CLASS = { | ||
[DKIM_STATUS.ENABLED]: 'oui-badge_success', | ||
[DKIM_STATUS.DISABLED]: 'oui-badge_warning', | ||
[DKIM_STATUS.DISABLED_NO_SET]: 'oui-badge_error', | ||
[DKIM_STATUS.TO_CONFIGURE]: 'oui-badge_error', | ||
[DKIM_STATUS.MODIFYING]: 'oui-badge_info', | ||
[DKIM_STATUS.ERROR]: 'oui-badge_error', | ||
}; | ||
|
||
export const DKIM_MODAL_TITLE = { | ||
[DKIM_STATUS.ENABLED]: `${DKIM_TRANSLATION_PREFIX}title_desactivation `, | ||
[DKIM_STATUS.DISABLED]: `${DKIM_TRANSLATION_PREFIX}title_activation`, | ||
[DKIM_STATUS.MODIFYING]: `${DKIM_TRANSLATION_PREFIX}title_configuration`, | ||
}; | ||
|
||
export const DKIM_PRIMARY_BUTTON_LABEL = { | ||
[DKIM_STATUS.ENABLED]: `${DKIM_TRANSLATION_PREFIX}deactivate`, | ||
[DKIM_STATUS.DISABLED]: `${DKIM_TRANSLATION_PREFIX}activate`, | ||
[DKIM_STATUS.MODIFYING]: 'wizard_close', | ||
}; | ||
|
||
export const DKIM_SECONDARY_BUTTON_LABEL = { | ||
[DKIM_STATUS.ENABLED]: 'common_cancel', | ||
[DKIM_STATUS.DISABLED]: 'common_cancel', | ||
[DKIM_STATUS.MODIFYING]: null, | ||
}; | ||
|
||
export const DKIM_CONFIGURATION_GUIDE_NO_OVH = { | ||
US: | ||
'https://help.ovhcloud.com/csm/en-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058258#configuring-dkim-for-an-email-solution-outside-of-your-ovhcloud-account', | ||
DE: | ||
'https://help.ovhcloud.com/csm/de-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058380#dkim-fur-einen-e-mail-dienst-auerhalb-ihres-ovhcloud-kunden-accounts-konfigurieren', | ||
ES: | ||
'https://help.ovhcloud.com/csm/es-es-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058253#configurar-el-dkim-para-una-solucion-de-correo-electronico-fuera-de-su-cuenta-de-ovhcloud', | ||
FR: | ||
'https://help.ovhcloud.com/csm/fr-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058101#configurer-le-dkim-pour-une-offre-e-mail-hors-de-votre-compte-ovhcloud', | ||
IE: | ||
'https://help.ovhcloud.com/csm/en-ie-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058259#configuring-dkim-for-an-email-solution-outside-of-your-ovhcloud-account', | ||
IT: | ||
'https://help.ovhcloud.com/csm/it-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058256#configurare-il-dkim-per-unofferta-email-al-di-fuori-del-tuo-account-ovhcloud', | ||
NL: | ||
'https://help.ovhcloud.com/csm/en-ie-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058259#external-dkim', | ||
PL: | ||
'https://help.ovhcloud.com/csm/pl-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058254#konfiguracja-dkim-w-przypadku-oferty-e-mail-poza-twoim-kontem-ovhcloud', | ||
PT: | ||
'https://help.ovhcloud.com/csm/pt-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058255#configurar-o-dkim-para-uma-oferta-de-e-mail-fora-da-sua-conta-ovhcloud', | ||
GB: | ||
'https://help.ovhcloud.com/csm/en-gb-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058238#configuring-dkim-for-an-email-solution-outside-of-your-ovhcloud-account', | ||
CA: | ||
'https://help.ovhcloud.com/csm/en-ca-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058260#external-dkim', | ||
QC: | ||
'https://help.ovhcloud.com/csm/fr-ca-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058257#external-dkim', | ||
MA: | ||
'https://help.ovhcloud.com/csm/fr-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058101#external-dkim', | ||
SN: | ||
'https://help.ovhcloud.com/csm/fr-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058101#external-dkim', | ||
TN: | ||
'https://help.ovhcloud.com/csm/fr-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058101#external-dkim', | ||
WE: | ||
'https://help.ovhcloud.com/csm/en-ie-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058259#external-dkim', | ||
DEFAULT: | ||
'https://help.ovhcloud.com/csm/en-dns-zone-dkim?id=kb_article_view&sysparm_article=KB0058258#configuring-dkim-for-an-email-solution-outside-of-your-ovhcloud-account', | ||
}; | ||
|
||
export default { | ||
DKIM_STATUS, | ||
DKIM_STATUS_TEXT, | ||
DKIM_STATUS_CLASS, | ||
DKIM_MODAL_TITLE, | ||
DKIM_PRIMARY_BUTTON_LABEL, | ||
DKIM_SECONDARY_BUTTON_LABEL, | ||
DKIM_CONFIGURATION_GUIDE_NO_OVH, | ||
}; |
82 changes: 82 additions & 0 deletions
82
...anager/modules/email-domain/src/general-informations/dkim/email-domain-dkim.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { | ||
DKIM_STATUS, | ||
DKIM_STATUS_TEXT, | ||
DKIM_MODAL_TITLE, | ||
DKIM_PRIMARY_BUTTON_LABEL, | ||
DKIM_SECONDARY_BUTTON_LABEL, | ||
DKIM_CONFIGURATION_GUIDE_NO_OVH, | ||
} from './email-domain-dkim.constants'; | ||
|
||
export default class EmailDomainDkimCtrl { | ||
/* @ngInject */ | ||
constructor($translate, WucEmails, coreConfig) { | ||
this.$translate = $translate; | ||
this.WucEmails = WucEmails; | ||
this.DKIM_PRIMARY_BUTTON_LABEL = DKIM_PRIMARY_BUTTON_LABEL; | ||
this.DKIM_SECONDARY_BUTTON_LABEL = DKIM_SECONDARY_BUTTON_LABEL; | ||
this.DKIM_STATUS_TEXT = DKIM_STATUS_TEXT; | ||
this.DKIM_MODAL_TITLE = DKIM_MODAL_TITLE; | ||
this.dkimGuideLinkNoOvh = | ||
DKIM_CONFIGURATION_GUIDE_NO_OVH[coreConfig.getUser().ovhSubsidiary] || | ||
DKIM_CONFIGURATION_GUIDE_NO_OVH.DEFAULT; | ||
} | ||
|
||
$onInit() { | ||
if (!this.dkim.autoconfig) { | ||
this.initContext(); | ||
} | ||
} | ||
|
||
getPrimaryAction() { | ||
if ( | ||
[DKIM_STATUS.ENABLED, DKIM_STATUS.DISABLED].includes(this.dkim.status) | ||
) { | ||
this.isSubmitting = true; | ||
const promise = | ||
this.dkim.status === DKIM_STATUS.DISABLED | ||
? this.WucEmails.enableDkim(this.serviceName) | ||
: this.WucEmails.disableDkim(this.serviceName); | ||
return promise | ||
.then(() => { | ||
return this.goBack( | ||
this.$translate.instant('email_domain_dkim_activation_success'), | ||
'success', | ||
true, | ||
); | ||
}) | ||
.catch(({ data }) => { | ||
return this.goBack( | ||
this.$translate.instant('email_domain_dkim_error', { | ||
message: data?.message, | ||
}), | ||
'danger', | ||
); | ||
}); | ||
} | ||
return this.goBack(); | ||
} | ||
|
||
initContext() { | ||
this.selector1NoDomain = { | ||
customerRecord: this.dkim.selectors[0].selectorName, | ||
targetRecord: this.dkim.selectors[0].cname, | ||
}; | ||
|
||
this.selector1RecordInfos = this.getDkimRecord(1); | ||
this.selector2NoDomain = { | ||
customerRecord: this.dkim.selectors[1].selectorName, | ||
targetRecord: this.dkim.selectors[1].cname, | ||
}; | ||
|
||
this.selector2RecordInfos = this.getDkimRecord(2); | ||
} | ||
|
||
getDkimRecord(index) { | ||
return [ | ||
`<b>${this.$translate.instant('email_domain_dkim_cname', { | ||
value: index, | ||
})}</b>: `, | ||
this[`selector${index}NoDomain`].targetRecord, | ||
].join(''); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
packages/manager/modules/email-domain/src/general-informations/dkim/email-domain-dkim.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<oui-modal | ||
data-heading="{{ :: $ctrl.DKIM_MODAL_TITLE[$ctrl.dkim.status] | translate }}" | ||
data-primary-label="{{ :: $ctrl.DKIM_PRIMARY_BUTTON_LABEL[$ctrl.dkim.status] | translate }}" | ||
data-primary-action="$ctrl.getPrimaryAction()" | ||
data-on-dismiss="$ctrl.goBack()" | ||
data-secondary-action="$ctrl.goBack()" | ||
data-secondary-label="{{ :: $ctrl.DKIM_SECONDARY_BUTTON_LABEL[$ctrl.dkim.status] | translate }}" | ||
data-primary-disabled="$ctrl.isSubmitting" | ||
> | ||
<p | ||
data-ng-if="$ctrl.dkim.autoconfig" | ||
data-translate="{{ $ctrl.DKIM_STATUS_TEXT[$ctrl.dkim.status] }}" | ||
></p> | ||
|
||
<div data-ng-if="!$ctrl.dkim.autoconfig"> | ||
<p data-translate="email_domain_dkim_configurate_dns_records_info"></p> | ||
|
||
<dl class="dl-horizontal dl-md"> | ||
<dt data-translate="email_domain_dkim_text_field"></dt> | ||
<dd> | ||
<span data-ng-bind-html="$ctrl.selector1RecordInfos"></span> | ||
</dd> | ||
<dd> | ||
<span data-ng-bind-html="$ctrl.selector2RecordInfos"></span> | ||
</dd> | ||
</dl> | ||
|
||
<p | ||
data-translate="email_domain_dkim_configurate_activation_guide" | ||
data-translate-values="{ url: $ctrl.dkimGuideLinkNoOvh }" | ||
class="mb-0" | ||
></p> | ||
<p data-translate="email_domain_dkim_no_ovhcloud_extra_step"></p> | ||
</div> | ||
</oui-modal> |
22 changes: 22 additions & 0 deletions
22
...es/manager/modules/email-domain/src/general-informations/dkim/email-domain-dkim.module.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 component from './email-domain-dkim.component'; | ||
import routing from './email-domain-dkim.routes'; | ||
|
||
const moduleName = 'ovhManagerEmailDomainDkim'; | ||
|
||
angular | ||
.module(moduleName, [ | ||
ngTranslateAsyncLoader, | ||
'oui', | ||
'pascalprecht.translate', | ||
'ui.router', | ||
]) | ||
.component('emailDomainDkimComponent', component) | ||
.config(routing) | ||
.run(/* @ngTranslationsInject:json ./translations */); | ||
|
||
export default moduleName; |
44 changes: 44 additions & 0 deletions
44
...es/manager/modules/email-domain/src/general-informations/dkim/email-domain-dkim.routes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
export default /* @ngInject */ ($stateProvider) => { | ||
$stateProvider.state('app.email.domain.information.dkim', { | ||
url: '/dkim', | ||
layout: 'modal', | ||
views: { | ||
modal: { | ||
component: 'emailDomainDkimComponent', | ||
}, | ||
}, | ||
params: { | ||
dkim: null, | ||
}, | ||
resolve: { | ||
breadcrumb: () => null, | ||
goBack: /* @ngInject */ ($state, setMessage, serviceName) => ( | ||
message, | ||
type = 'success', | ||
reload = false, | ||
) => { | ||
const promise = $state.go( | ||
'app.email.domain.information', | ||
{ productId: serviceName }, | ||
{ | ||
reload, | ||
}, | ||
); | ||
|
||
if (message) { | ||
promise.then(() => setMessage(message, type)); | ||
} | ||
|
||
return promise; | ||
}, | ||
setMessage: /* @ngInject */ (Alerter, $timeout) => (message, type) => | ||
$timeout(() => Alerter.set(`alert-${type}`, message, null), 1000), | ||
serviceName: /* @ngInject */ ($transition$) => | ||
$transition$.params().productId, | ||
dkim: /* @ngInject */ ($transition$, WucEmails, serviceName) => | ||
!$transition$.params().dkim | ||
? WucEmails.getDkim(serviceName).then((dkim) => dkim) | ||
: $transition$.params().dkim, | ||
}, | ||
}); | ||
}; |
17 changes: 17 additions & 0 deletions
17
...nager/modules/email-domain/src/general-informations/dkim/translations/Messages_de_DE.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"email_domain_dkim_title_activation": "DKIM aktivieren", | ||
"email_domain_dkim_title_desactivation": "DKIM deaktivieren", | ||
"email_domain_dkim_title_configuration": "DKIM-Konfiguration", | ||
"email_domain_dkim_activate": "Aktivieren", | ||
"email_domain_dkim_deactivate": "Deaktivieren", | ||
"email_domain_dkim_activation": "Ihr DKIM ist konfiguriert, aber nicht aktiviert. Möchten Sie es aktivieren?", | ||
"email_domain_dkim_deactivation": "DKIM ist derzeit für Ihre Domain aktiv. Möchten Sie es deaktivieren? (nicht empfohlen)", | ||
"email_domain_dkim_in_progress": "Für Ihr DKIM wird aktuell ein Vorgang ausgeführt.", | ||
"email_domain_dkim_activation_success": "Die DKIM-Konfiguration wird ausgeführt. Beachten Sie, dass es bis zu 24 Stunden dauern kann, bis die Änderung übernommen wird.", | ||
"email_domain_dkim_error": "Bei der DKIM-Konfiguration ist ein Fehler aufgetreten. {{message}}", | ||
"email_domain_dkim_configurate_dns_records_info": "Für die DKIM-Konfiguration müssen Sie Ihren DNS die folgenden beiden Einträge hinzufügen.", | ||
"email_domain_dkim_text_field": "Textfeld", | ||
"email_domain_dkim_cname": "CNAME {{ value }}", | ||
"email_domain_dkim_configurate_activation_guide": "Weitere Informationen finden Sie in der Dokumentation Ihres Domain-Anbieters. Unterstützung erhalten Sie in unserer <a href=\"{{url}}\" target=\"_blank\">Anleitung</a>.", | ||
"email_domain_dkim_no_ovhcloud_extra_step": "Warten Sie nach der Änderung einige Minuten und klicken Sie auf „Aktivieren“." | ||
} |
17 changes: 17 additions & 0 deletions
17
...nager/modules/email-domain/src/general-informations/dkim/translations/Messages_en_GB.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"email_domain_dkim_title_activation": "Enable DKIM", | ||
"email_domain_dkim_title_desactivation": "Disable DKIM", | ||
"email_domain_dkim_title_configuration": "DKIM configuration", | ||
"email_domain_dkim_activate": "Enable", | ||
"email_domain_dkim_deactivate": "Disable", | ||
"email_domain_dkim_activation": "Your DKIM is configured but not enabled. Do you want to enable it?", | ||
"email_domain_dkim_deactivation": "DKIM is currently enabled on your domain name. Do you want to disable it? (not recommended)", | ||
"email_domain_dkim_in_progress": "An operation pertaining to your DKIM is currently in progress.", | ||
"email_domain_dkim_activation_success": "DKIM configuration in progress. Please note that the update may take up to 24 hours to propagate.", | ||
"email_domain_dkim_error": "An error has occurred configuring DKIM. {{message}}", | ||
"email_domain_dkim_configurate_dns_records_info": "To configure your DKIM, you will need to add these two records to your DNS", | ||
"email_domain_dkim_text_field": "Text field", | ||
"email_domain_dkim_cname": "CNAME {{ value }}", | ||
"email_domain_dkim_configurate_activation_guide": "Please refer to your domain provider’s documentation. You can find helpful information in our <a href=\"{{url}}\" target=\"_blank\">guide</a>.", | ||
"email_domain_dkim_no_ovhcloud_extra_step": "After modifying it, wait a few minutes, then click “Enable”." | ||
} |
Oops, something went wrong.