fix(console): start verification flow on domain create, show verification if token is requested (#907)

* start verification flow on add, show v if token req

* fix: sem
This commit is contained in:
Max Peintner 2020-10-27 10:30:16 +01:00 committed by GitHub
parent 78e5c26015
commit 9d009beb36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 10 deletions

View File

@ -5,13 +5,14 @@
<p class="desc warn">{{ 'ORG.PAGES.ORGDOMAIN.VERIFICATION_VALIDATION_DESC' | translate }}</p>
<p *ngIf="domain.validationType !== OrgDomainValidationType.ORGDOMAINVALIDATIONTYPE_UNSPECIFIED" class="desc">
<p *ngIf="domain.validationType !== OrgDomainValidationType.ORGDOMAINVALIDATIONTYPE_UNSPECIFIED && !(dns || http)"
class="desc">
{{'ORG.PAGES.ORGDOMAIN.VERIFICATION_VALIDATION_ONGOING' | translate: domain }}
{{'ORG.PAGES.ORGDOMAIN.VERIFICATION_VALIDATION_ONGOING_TYPE' | translate}}
{{'ORG.PAGES.ORGDOMAIN.TYPES.'+ domain.validationType | translate}}</p>
<div *ngIf="domain.validationType !== OrgDomainValidationType.ORGDOMAINVALIDATIONTYPE_UNSPECIFIED"
class="btn-container">
<button color="primary" type="submit" mat-raised-button
<button color="primary" type="submit" mat-raised-button *ngIf="!(dns || http)"
(click)="validate()">{{ 'ACTIONS.VERIFY' | translate }}</button>
<button *ngIf="!showNew" mat-stroked-button color="primary"
@ -33,6 +34,8 @@
<div class="btn-container">
<button mat-stroked-button (click)="saveFile()"
color="primary">{{ 'ORG.PAGES.DOWNLOAD_FILE' | translate }}</button>
<button color="primary" type="submit" mat-raised-button
(click)="validate()">{{ 'ACTIONS.VERIFY' | translate }}</button>
</div>
</div>
@ -45,6 +48,8 @@
<i *ngIf="copied != dns.token" class="las la-clipboard"></i>
<i *ngIf="copied == dns.token" class="las la-clipboard-check"></i>
</button>
<button color="primary" type="submit" mat-raised-button
(click)="validate()">{{ 'ACTIONS.VERIFY' | translate }}</button>
</div>
<p class="entry">{{dns?.url}}</p>
</div>

View File

@ -13,7 +13,7 @@
font-size: .9rem;
&.warn {
color: rgb(201, 51, 71);
color: rgb(201, 51, 72);
}
}

View File

@ -28,22 +28,25 @@ export class DomainVerificationComponent {
private mgmtService: ManagementService,
) {
this.domain = data.domain;
console.log(data);
if (this.domain.validationType === OrgDomainValidationType.ORGDOMAINVALIDATIONTYPE_UNSPECIFIED) {
this.showNew = true;
}
}
async loadHttpToken(): Promise<void> {
this.http = (await this.mgmtService.GenerateMyOrgDomainValidation(
this.mgmtService.GenerateMyOrgDomainValidation(
this.domain.domain,
OrgDomainValidationType.ORGDOMAINVALIDATIONTYPE_HTTP)).toObject();
OrgDomainValidationType.ORGDOMAINVALIDATIONTYPE_HTTP).then((http) => {
this.http = http.toObject();
});
}
async loadDnsToken(): Promise<void> {
this.dns = (await this.mgmtService.GenerateMyOrgDomainValidation(
this.mgmtService.GenerateMyOrgDomainValidation(
this.domain.domain,
OrgDomainValidationType.ORGDOMAINVALIDATIONTYPE_DNS)).toObject();
OrgDomainValidationType.ORGDOMAINVALIDATIONTYPE_DNS).then((dns) => {
this.dns = dns.toObject();
});
}
public closeDialog(): void {

View File

@ -134,6 +134,8 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
newDomainView.setVerified(newDomain.getVerified());
this.domains.push(newDomainView.toObject());
this.verifyDomain(newDomainView.toObject());
this.toast.showInfo('ORG.TOAST.DOMAINADDED', true);
});
}
@ -204,6 +206,7 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
data: {
domain: domain,
},
width: '500px',
});
}

View File

@ -381,8 +381,8 @@
"VERIFICATION_SKIP":"Du kannst die Überprüfung vorerst überspringen und Deine Organisation erstellen. Um Deine Organisation jedoch verwenden zu können, muss dieser Schritt abgeschlossen sein.",
"VERIFICATION_VALIDATION_DESC":"Die Tokens werden regelmässig überprüft, um sicherzustellen, dass Du weiterhin im Besitz der Domain bist.",
"VERIFICATION_NEWTOKEN_TITLE":"Neues Token anfordern",
"VERIFICATION_NEWTOKEN_DESC":"Wenn Du ein neues Token anfordern willst, klicke auf die gewünschte Methode. Wenn Du ein vorhandenes Token validieren möchtest, klicke auf \"Validieren\".",
"VERIFICATION_VALIDATION_ONGOING":"Ein Token zur Validierung wurde bereits angefragt. Klicke auf \"Validieren\", um dieses Token zu validieren.",
"VERIFICATION_NEWTOKEN_DESC":"Wenn Du ein neues Token anfordern willst, klicke auf die gewünschte Methode. Wenn Du ein vorhandenes Token validieren möchtest, klicke auf \"Verifizieren\".",
"VERIFICATION_VALIDATION_ONGOING":"Ein Token zur Validierung wurde bereits angefragt. Klicke auf \"Verifizieren\", um dieses Token zu validieren.",
"VERIFICATION_VALIDATION_ONGOING_TYPE":"Typ des Tokens:",
"REQUESTNEWTOKEN":"Neues Token anfordern",
"TYPES": {