fix: missing ngOnInit fetch data (#6730)

* fix: missing ngoninit fetch data

* fix: e2e test for sms check setting has been added

---------

Co-authored-by: Elio Bischof <elio@zitadel.com>
This commit is contained in:
Miguel Cabrerizo 2023-10-24 14:26:24 +02:00 committed by GitHub
parent ab79855cf0
commit b4fd566746
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import { Component, Input } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { AddSMSProviderTwilioRequest, UpdateSMSProviderTwilioRequest } from 'src/app/proto/generated/zitadel/admin_pb'; import { AddSMSProviderTwilioRequest, UpdateSMSProviderTwilioRequest } from 'src/app/proto/generated/zitadel/admin_pb';
import { SMSProvider, SMSProviderConfigState } from 'src/app/proto/generated/zitadel/settings_pb'; import { SMSProvider, SMSProviderConfigState } from 'src/app/proto/generated/zitadel/settings_pb';
@ -15,7 +15,7 @@ import { DialogAddSMSProviderComponent } from './dialog-add-sms-provider/dialog-
templateUrl: './notification-sms-provider.component.html', templateUrl: './notification-sms-provider.component.html',
styleUrls: ['./notification-sms-provider.component.scss'], styleUrls: ['./notification-sms-provider.component.scss'],
}) })
export class NotificationSMSProviderComponent { export class NotificationSMSProviderComponent implements OnInit {
@Input() public serviceType!: PolicyComponentServiceType; @Input() public serviceType!: PolicyComponentServiceType;
public smsProviders: SMSProvider.AsObject[] = []; public smsProviders: SMSProvider.AsObject[] = [];
@ -30,6 +30,9 @@ export class NotificationSMSProviderComponent {
private toast: ToastService, private toast: ToastService,
) {} ) {}
ngOnInit(): void {
this.fetchData();
}
private fetchData(): void { private fetchData(): void {
this.smsProvidersLoading = true; this.smsProvidersLoading = true;
this.service this.service

View File

@ -57,6 +57,8 @@ describe('instance notifications', () => {
cy.get('[formcontrolname="senderNumber"]').clear().type('2312123132'); cy.get('[formcontrolname="senderNumber"]').clear().type('2312123132');
cy.get('[data-e2e="save-sms-settings-button"]').click(); cy.get('[data-e2e="save-sms-settings-button"]').click();
cy.shouldConfirmSuccess(); cy.shouldConfirmSuccess();
cy.get('h4').contains('Twilio');
cy.get('.state').contains('Inactive');
}); });
}); });
}); });