mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-07 23:07:45 +00:00
fix(console): update Twilio sms provider settings (#6732)
fix: update sms provider settings Co-authored-by: Elio Bischof <elio@zitadel.com>
This commit is contained in:
parent
b4fd566746
commit
36eeae1071
@ -18,7 +18,7 @@
|
|||||||
<input cnslInput name="senderNumber" formControlName="senderNumber" />
|
<input cnslInput name="senderNumber" formControlName="senderNumber" />
|
||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
|
|
||||||
<button *ngIf="twilio" type="button" mat-stroked-button (click)="changeToken()">
|
<button *ngIf="twilio" type="button" mat-stroked-button (click)="changeToken()" data-e2e="edit-sms-token-button">
|
||||||
{{ 'SETTING.SMS.TWILIO.CHANGETOKEN' | translate }}
|
{{ 'SETTING.SMS.TWILIO.CHANGETOKEN' | translate }}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
@ -61,15 +61,14 @@ export class DialogAddSMSProviderComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public closeDialogWithRequest(): void {
|
public closeDialogWithRequest(): void {
|
||||||
if (!!this.twilio) {
|
if (!!this.twilio && this.twilioProvider && this.twilioProvider.id) {
|
||||||
this.req = new UpdateSMSProviderTwilioRequest();
|
this.req = new UpdateSMSProviderTwilioRequest();
|
||||||
|
this.req.setId(this.twilioProvider.id);
|
||||||
this.req.setSid(this.sid?.value);
|
this.req.setSid(this.sid?.value);
|
||||||
this.req.setSenderNumber(this.senderNumber?.value);
|
this.req.setSenderNumber(this.senderNumber?.value);
|
||||||
this.dialogRef.close(this.req);
|
this.dialogRef.close(this.req);
|
||||||
} else {
|
} else {
|
||||||
this.req = new AddSMSProviderTwilioRequest();
|
this.req = new AddSMSProviderTwilioRequest();
|
||||||
|
|
||||||
this.req.setSid(this.sid?.value);
|
this.req.setSid(this.sid?.value);
|
||||||
this.req.setToken(this.token?.value);
|
this.req.setToken(this.token?.value);
|
||||||
this.req.setSenderNumber(this.senderNumber?.value);
|
this.req.setSenderNumber(this.senderNumber?.value);
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
*ngIf="twilio && twilio.id"
|
*ngIf="twilio && twilio.id"
|
||||||
[disabled]="(['iam.write'] | hasRole | async) === false"
|
[disabled]="(['iam.write'] | hasRole | async) === false"
|
||||||
mat-stroked-button
|
mat-stroked-button
|
||||||
|
data-e2e="activate-sms-provider-button"
|
||||||
(click)="toggleSMSProviderState(twilio.id)"
|
(click)="toggleSMSProviderState(twilio.id)"
|
||||||
>
|
>
|
||||||
<span *ngIf="twilio.state === SMSProviderConfigState.SMS_PROVIDER_CONFIG_ACTIVE">{{
|
<span *ngIf="twilio.state === SMSProviderConfigState.SMS_PROVIDER_CONFIG_ACTIVE">{{
|
||||||
|
@ -33,6 +33,7 @@ export class NotificationSMSProviderComponent implements OnInit {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
}
|
}
|
||||||
|
|
||||||
private fetchData(): void {
|
private fetchData(): void {
|
||||||
this.smsProvidersLoading = true;
|
this.smsProvidersLoading = true;
|
||||||
this.service
|
this.service
|
||||||
@ -63,7 +64,7 @@ export class NotificationSMSProviderComponent implements OnInit {
|
|||||||
this.service
|
this.service
|
||||||
.updateSMSProviderTwilio(req as UpdateSMSProviderTwilioRequest)
|
.updateSMSProviderTwilio(req as UpdateSMSProviderTwilioRequest)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.toast.showInfo('SETTING.SMS.TWILIO.ADDED', true);
|
this.toast.showInfo('SETTING.SMS.TWILIO.UPDATED', true);
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
@ -1085,6 +1085,7 @@
|
|||||||
"TOKEN": "Токен",
|
"TOKEN": "Токен",
|
||||||
"SENDERNUMBER": "Номер на изпращача",
|
"SENDERNUMBER": "Номер на изпращача",
|
||||||
"ADDED": "Twilio добави успешно.",
|
"ADDED": "Twilio добави успешно.",
|
||||||
|
"UPDATED": "Twilio се актуализира успешно.",
|
||||||
"REMOVED": "Twilio премахнат",
|
"REMOVED": "Twilio премахнат",
|
||||||
"CHANGETOKEN": "Промяна на токена",
|
"CHANGETOKEN": "Промяна на токена",
|
||||||
"SETTOKEN": "Задаване на токен",
|
"SETTOKEN": "Задаване на токен",
|
||||||
|
@ -1091,6 +1091,7 @@
|
|||||||
"TOKEN": "Token",
|
"TOKEN": "Token",
|
||||||
"SENDERNUMBER": "Sender Number",
|
"SENDERNUMBER": "Sender Number",
|
||||||
"ADDED": "Twilio erfolgreich hinzugefügt.",
|
"ADDED": "Twilio erfolgreich hinzugefügt.",
|
||||||
|
"UPDATED": "Twilio wurde erfolgreich aktualisiert.",
|
||||||
"REMOVED": "Twilio entfernt",
|
"REMOVED": "Twilio entfernt",
|
||||||
"CHANGETOKEN": "Token ändern",
|
"CHANGETOKEN": "Token ändern",
|
||||||
"SETTOKEN": "Token setzen",
|
"SETTOKEN": "Token setzen",
|
||||||
|
@ -1092,6 +1092,7 @@
|
|||||||
"TOKEN": "Token",
|
"TOKEN": "Token",
|
||||||
"SENDERNUMBER": "Sender Number",
|
"SENDERNUMBER": "Sender Number",
|
||||||
"ADDED": "Twilio added successfully.",
|
"ADDED": "Twilio added successfully.",
|
||||||
|
"UPDATED": "Twilio updated successfully.",
|
||||||
"REMOVED": "Twilio removed",
|
"REMOVED": "Twilio removed",
|
||||||
"CHANGETOKEN": "Change Token",
|
"CHANGETOKEN": "Change Token",
|
||||||
"SETTOKEN": "Set Token",
|
"SETTOKEN": "Set Token",
|
||||||
|
@ -1092,6 +1092,7 @@
|
|||||||
"TOKEN": "Token",
|
"TOKEN": "Token",
|
||||||
"SENDERNUMBER": "Número de emisor",
|
"SENDERNUMBER": "Número de emisor",
|
||||||
"ADDED": "Twilio añadido con éxito.",
|
"ADDED": "Twilio añadido con éxito.",
|
||||||
|
"UPDATED": "Twilio actualizado con éxito",
|
||||||
"REMOVED": "Twilio eliminado",
|
"REMOVED": "Twilio eliminado",
|
||||||
"CHANGETOKEN": "Cambiar token",
|
"CHANGETOKEN": "Cambiar token",
|
||||||
"SETTOKEN": "Establecer token",
|
"SETTOKEN": "Establecer token",
|
||||||
|
@ -1091,6 +1091,7 @@
|
|||||||
"TOKEN": "Jeton",
|
"TOKEN": "Jeton",
|
||||||
"SENDERNUMBER": "Numéro d'expéditeur",
|
"SENDERNUMBER": "Numéro d'expéditeur",
|
||||||
"ADDED": "Twilio a été ajouté avec succès.",
|
"ADDED": "Twilio a été ajouté avec succès.",
|
||||||
|
"UPDATED": "Twilio a été mis à jour avec succès.",
|
||||||
"REMOVED": "Twilio a été supprimé avec succès",
|
"REMOVED": "Twilio a été supprimé avec succès",
|
||||||
"CHANGETOKEN": "Changer de Token",
|
"CHANGETOKEN": "Changer de Token",
|
||||||
"SETTOKEN": "Définir le jeton",
|
"SETTOKEN": "Définir le jeton",
|
||||||
|
@ -1091,6 +1091,7 @@
|
|||||||
"TOKEN": "Token",
|
"TOKEN": "Token",
|
||||||
"SENDERNUMBER": "Sender Number",
|
"SENDERNUMBER": "Sender Number",
|
||||||
"ADDED": "Twilio aggiunto con successo.",
|
"ADDED": "Twilio aggiunto con successo.",
|
||||||
|
"UPDATED": "Twilio aggiornato correttamente.",
|
||||||
"REMOVED": "Twilio rimosso con successo.",
|
"REMOVED": "Twilio rimosso con successo.",
|
||||||
"CHANGETOKEN": "Cambia Token",
|
"CHANGETOKEN": "Cambia Token",
|
||||||
"SETTOKEN": "Cambia Token",
|
"SETTOKEN": "Cambia Token",
|
||||||
|
@ -1092,6 +1092,7 @@
|
|||||||
"TOKEN": "トークン",
|
"TOKEN": "トークン",
|
||||||
"SENDERNUMBER": "送信者番号",
|
"SENDERNUMBER": "送信者番号",
|
||||||
"ADDED": "Twilioは正常に追加されました。",
|
"ADDED": "Twilioは正常に追加されました。",
|
||||||
|
"UPDATED": "Twilio が正常に更新されました。",
|
||||||
"REMOVED": "Twilioが削除されました",
|
"REMOVED": "Twilioが削除されました",
|
||||||
"CHANGETOKEN": "トークンを変更する",
|
"CHANGETOKEN": "トークンを変更する",
|
||||||
"SETTOKEN": "トークンを設定する",
|
"SETTOKEN": "トークンを設定する",
|
||||||
|
@ -1093,6 +1093,7 @@
|
|||||||
"TOKEN": "Токен",
|
"TOKEN": "Токен",
|
||||||
"SENDERNUMBER": "Број на испраќач",
|
"SENDERNUMBER": "Број на испраќач",
|
||||||
"ADDED": "Twilio e успешно додаден.",
|
"ADDED": "Twilio e успешно додаден.",
|
||||||
|
"UPDATED": "Twilio се ажурираше успешно.",
|
||||||
"REMOVED": "Twilio отстранет",
|
"REMOVED": "Twilio отстранет",
|
||||||
"CHANGETOKEN": "Смени токен",
|
"CHANGETOKEN": "Смени токен",
|
||||||
"SETTOKEN": "Постави токен",
|
"SETTOKEN": "Постави токен",
|
||||||
|
@ -1091,6 +1091,7 @@
|
|||||||
"TOKEN": "Token",
|
"TOKEN": "Token",
|
||||||
"SENDERNUMBER": "Numer nadawcy",
|
"SENDERNUMBER": "Numer nadawcy",
|
||||||
"ADDED": "Twilio dodano pomyślnie.",
|
"ADDED": "Twilio dodano pomyślnie.",
|
||||||
|
"UPDATED": "Twilio zostało pomyślnie zaktualizowane.",
|
||||||
"REMOVED": "Twilio usunięte",
|
"REMOVED": "Twilio usunięte",
|
||||||
"CHANGETOKEN": "Zmień Token",
|
"CHANGETOKEN": "Zmień Token",
|
||||||
"SETTOKEN": "Ustaw Token",
|
"SETTOKEN": "Ustaw Token",
|
||||||
|
@ -1093,6 +1093,7 @@
|
|||||||
"TOKEN": "Token",
|
"TOKEN": "Token",
|
||||||
"SENDERNUMBER": "Número do remetente",
|
"SENDERNUMBER": "Número do remetente",
|
||||||
"ADDED": "Twilio adicionado com sucesso.",
|
"ADDED": "Twilio adicionado com sucesso.",
|
||||||
|
"UPDATED": "Twilio atualizado com sucesso.",
|
||||||
"REMOVED": "Twilio removido",
|
"REMOVED": "Twilio removido",
|
||||||
"CHANGETOKEN": "Alterar token",
|
"CHANGETOKEN": "Alterar token",
|
||||||
"SETTOKEN": "Definir token",
|
"SETTOKEN": "Definir token",
|
||||||
|
@ -1091,6 +1091,7 @@
|
|||||||
"TOKEN": "令牌",
|
"TOKEN": "令牌",
|
||||||
"SENDERNUMBER": "发件人号码",
|
"SENDERNUMBER": "发件人号码",
|
||||||
"ADDED": "Twilio 添加成功。",
|
"ADDED": "Twilio 添加成功。",
|
||||||
|
"UPDATED": "Twilio 更新成功。",
|
||||||
"REMOVED": "Twilio 已删除",
|
"REMOVED": "Twilio 已删除",
|
||||||
"CHANGETOKEN": "更改令牌",
|
"CHANGETOKEN": "更改令牌",
|
||||||
"SETTOKEN": "设置令牌",
|
"SETTOKEN": "设置令牌",
|
||||||
|
@ -19,7 +19,6 @@ describe('instance notifications', () => {
|
|||||||
cy.visit(smtpPath);
|
cy.visit(smtpPath);
|
||||||
cy.contains('SMTP Settings');
|
cy.contains('SMTP Settings');
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should add SMTP provider settings`, () => {
|
it(`should add SMTP provider settings`, () => {
|
||||||
cy.visit(smtpPath);
|
cy.visit(smtpPath);
|
||||||
cy.get('[formcontrolname="senderAddress"]').clear().type('sender@example.com');
|
cy.get('[formcontrolname="senderAddress"]').clear().type('sender@example.com');
|
||||||
@ -33,7 +32,6 @@ describe('instance notifications', () => {
|
|||||||
cy.get('[formcontrolname="hostAndPort"]').should('have.value', 'smtp.mailtrap.io:2525');
|
cy.get('[formcontrolname="hostAndPort"]').should('have.value', 'smtp.mailtrap.io:2525');
|
||||||
cy.get('[formcontrolname="user"]').should('have.value', 'user@example.com');
|
cy.get('[formcontrolname="user"]').should('have.value', 'user@example.com');
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should add SMTP provider password`, () => {
|
it(`should add SMTP provider password`, () => {
|
||||||
cy.visit(smtpPath);
|
cy.visit(smtpPath);
|
||||||
cy.get('[data-e2e="add-smtp-password-button"]').click();
|
cy.get('[data-e2e="add-smtp-password-button"]').click();
|
||||||
@ -60,5 +58,56 @@ describe('instance notifications', () => {
|
|||||||
cy.get('h4').contains('Twilio');
|
cy.get('h4').contains('Twilio');
|
||||||
cy.get('.state').contains('Inactive');
|
cy.get('.state').contains('Inactive');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it(`should activate SMS provider`, () => {
|
||||||
|
cy.visit(smsPath);
|
||||||
|
cy.get('h4').contains('Twilio');
|
||||||
|
cy.get('.state').contains('Inactive');
|
||||||
|
cy.get('[data-e2e="activate-sms-provider-button"]').click();
|
||||||
|
cy.shouldConfirmSuccess();
|
||||||
|
cy.get('.state').contains('Active');
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should edit SMS provider`, () => {
|
||||||
|
cy.visit(smsPath);
|
||||||
|
cy.get('h4').contains('Twilio');
|
||||||
|
cy.get('.state').contains('Active');
|
||||||
|
cy.get('[data-e2e="new-twilio-button"]').click();
|
||||||
|
cy.get('[formcontrolname="sid"]').should('have.value', 'test');
|
||||||
|
cy.get('[formcontrolname="senderNumber"]').should('have.value', '2312123132');
|
||||||
|
cy.get('[formcontrolname="sid"]').clear().type('test2');
|
||||||
|
cy.get('[formcontrolname="senderNumber"]').clear().type('6666666666');
|
||||||
|
cy.get('[data-e2e="save-sms-settings-button"]').click();
|
||||||
|
cy.shouldConfirmSuccess();
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should contain edited values`, () => {
|
||||||
|
cy.visit(smsPath);
|
||||||
|
cy.get('h4').contains('Twilio');
|
||||||
|
cy.get('.state').contains('Active');
|
||||||
|
cy.get('[data-e2e="new-twilio-button"]').click();
|
||||||
|
cy.get('[formcontrolname="sid"]').should('have.value', 'test2');
|
||||||
|
cy.get('[formcontrolname="senderNumber"]').should('have.value', '6666666666');
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should edit SMS provider token`, () => {
|
||||||
|
cy.visit(smsPath);
|
||||||
|
cy.get('h4').contains('Twilio');
|
||||||
|
cy.get('.state').contains('Active');
|
||||||
|
cy.get('[data-e2e="new-twilio-button"]').click();
|
||||||
|
cy.get('[data-e2e="edit-sms-token-button"]').click();
|
||||||
|
cy.get('[data-e2e="notification-setting-password"]').clear().type('newsupertoken');
|
||||||
|
cy.get('[data-e2e="save-notification-setting-password-button"]').click();
|
||||||
|
cy.shouldConfirmSuccess();
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should remove SMS provider`, () => {
|
||||||
|
cy.visit(smsPath);
|
||||||
|
cy.get('h4').contains('Twilio');
|
||||||
|
cy.get('.state').contains('Active');
|
||||||
|
cy.get('[data-e2e="remove-sms-provider-button"]').click();
|
||||||
|
cy.get('[data-e2e="confirm-dialog-button"]').click();
|
||||||
|
cy.shouldConfirmSuccess();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user