-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PM-2411] Update
billing-sync-api-key
to use Dialog (#6537)
* Update billing-sync-api-key dialog * Oscar's feedback
- Loading branch information
1 parent
c3856ce
commit b1a92ba
Showing
3 changed files
with
124 additions
and
166 deletions.
There are no files selected for viewing
186 changes: 72 additions & 114 deletions
186
apps/web/src/app/billing/organizations/billing-sync-api-key.component.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 |
---|---|---|
@@ -1,117 +1,75 @@ | ||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="billingSyncApiKeyTitle"> | ||
<div class="modal-dialog modal-dialog-scrollable" role="document"> | ||
<form | ||
class="modal-content" | ||
#form | ||
(ngSubmit)="submit()" | ||
[appApiAction]="formPromise" | ||
ngNativeValidate | ||
> | ||
<div class="modal-header"> | ||
<h1 class="modal-title" id="billingSyncApiKeyTitle"> | ||
{{ (hasBillingToken ? "viewBillingSyncToken" : "generateBillingSyncToken") | i18n }} | ||
</h1> | ||
<button | ||
type="button" | ||
class="close" | ||
data-dismiss="modal" | ||
appA11yTitle="{{ 'close' | i18n }}" | ||
> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div class="modal-body"> | ||
<app-user-verification | ||
[(ngModel)]="masterPassword" | ||
ngDefaultControl | ||
name="secret" | ||
*ngIf="!clientSecret" | ||
> | ||
</app-user-verification> | ||
<ng-container *ngIf="clientSecret && showRotateScreen"> | ||
<p>{{ "rotateBillingSyncTokenTitle" | i18n }}</p> | ||
<app-callout type="warning"> | ||
{{ "rotateBillingSyncTokenWarning" | i18n }} | ||
</app-callout> | ||
</ng-container> | ||
<form [formGroup]="formGroup" [bitSubmit]="submit"> | ||
<bit-dialog> | ||
<h1 bitDialogTitle> | ||
{{ (hasBillingToken ? "viewBillingSyncToken" : "generateBillingSyncToken") | i18n }} | ||
</h1> | ||
<div bitDialogContent> | ||
<app-user-verification formControlName="verification" *ngIf="!clientSecret"> | ||
</app-user-verification> | ||
|
||
<ng-container *ngIf="clientSecret && showRotateScreen"> | ||
<p>{{ "rotateBillingSyncTokenTitle" | i18n }}</p> | ||
<bit-callout type="warning"> | ||
{{ "rotateBillingSyncTokenWarning" | i18n }} | ||
</bit-callout> | ||
</ng-container> | ||
|
||
<div *ngIf="clientSecret && !showRotateScreen"> | ||
<p>{{ "copyPasteBillingSync" | i18n }}</p> | ||
<label for="clientSecret">{{ "billingSyncKey" | i18n }}</label> | ||
<div class="input-group"> | ||
<input | ||
id="clientSecret" | ||
class="form-control text-monospace" | ||
type="text" | ||
[(ngModel)]="clientSecret" | ||
name="clientSecret" | ||
disabled | ||
/> | ||
<div class="input-group-append"> | ||
<button | ||
type="button" | ||
class="btn btn-outline-secondary" | ||
(click)="copy()" | ||
[appA11yTitle]="'copy' | i18n" | ||
> | ||
<i class="bwi bwi-lg bwi-clone" aria-hidden="true"></i> | ||
</button> | ||
</div> | ||
</div> | ||
<div class="small text-muted mt-2" *ngIf="showLastSyncText"> | ||
<b class="font-weight-semibold">{{ "lastSync" | i18n }}:</b> | ||
{{ lastSyncDate | date : "medium" }} | ||
</div> | ||
<div class="small text-danger mt-2" *ngIf="showAwaitingSyncText"> | ||
<i class="bwi bwi-error"></i> | ||
{{ | ||
(daysBetween === 1 ? "awaitingSyncSingular" : "awaitingSyncPlural") | ||
| i18n : daysBetween | ||
}} | ||
</div> | ||
<div *ngIf="clientSecret && !showRotateScreen"> | ||
<p>{{ "copyPasteBillingSync" | i18n }}</p> | ||
<bit-form-field> | ||
<bit-label>{{ "billingSyncKey" | i18n }}</bit-label> | ||
<input | ||
bitInput | ||
id="clientSecret" | ||
type="text" | ||
[value]="clientSecret" | ||
class="tw-font-mono" | ||
disabled | ||
/> | ||
<button | ||
bitIconButton="bwi-clone" | ||
bitSuffix | ||
type="button" | ||
[appCopyClick]="clientSecret" | ||
[appA11yTitle]="'copyValue' | i18n" | ||
></button> | ||
</bit-form-field> | ||
<div class="tw-mt-2 tw-text-sm tw-text-muted" *ngIf="showLastSyncText"> | ||
<b class="tw-font-semibold">{{ "lastSync" | i18n }}:</b> | ||
{{ lastSyncDate | date : "medium" }} | ||
</div> | ||
<div class="tw-mt-2 tw-text-sm tw-text-danger" *ngIf="showAwaitingSyncText"> | ||
<i class="bwi bwi-error"></i> | ||
{{ | ||
(daysBetween === 1 ? "awaitingSyncSingular" : "awaitingSyncPlural") | i18n : daysBetween | ||
}} | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button | ||
type="submit" | ||
class="btn btn-primary btn-submit" | ||
[disabled]="form.loading" | ||
*ngIf="!clientSecret || showRotateScreen" | ||
> | ||
<i | ||
class="bwi bwi-spinner bwi-spin" | ||
title="{{ 'loading' | i18n }}" | ||
*ngIf="form.loading" | ||
></i> | ||
<span> | ||
{{ submitButtonText }} | ||
</span> | ||
</button> | ||
<button | ||
type="button" | ||
class="btn btn-outline-secondary" | ||
data-dismiss="modal" | ||
*ngIf="!showRotateScreen" | ||
> | ||
{{ "close" | i18n }} | ||
</button> | ||
<button | ||
type="button" | ||
class="btn btn-outline-secondary" | ||
*ngIf="showRotateScreen" | ||
(click)="cancelRotate()" | ||
> | ||
{{ "cancel" | i18n }} | ||
</button> | ||
<button | ||
type="button" | ||
class="btn btn-outline-secondary" | ||
*ngIf="clientSecret && !showRotateScreen" | ||
(click)="rotateToken()" | ||
> | ||
{{ "rotateToken" | i18n }} | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
<ng-container bitDialogFooter> | ||
<button | ||
type="submit" | ||
bitButton | ||
bitFormButton | ||
buttonType="primary" | ||
*ngIf="!clientSecret || showRotateScreen" | ||
> | ||
{{ submitButtonText }} | ||
</button> | ||
<button bitButton bitDialogClose type="button" *ngIf="!showRotateScreen"> | ||
{{ "close" | i18n }} | ||
</button> | ||
<button bitButton type="button" *ngIf="showRotateScreen" (click)="cancelRotate()"> | ||
{{ "cancel" | i18n }} | ||
</button> | ||
<button | ||
bitButton | ||
type="button" | ||
*ngIf="clientSecret && !showRotateScreen" | ||
(click)="rotateToken()" | ||
> | ||
{{ "rotateToken" | i18n }} | ||
</button> | ||
</ng-container> | ||
</bit-dialog> | ||
</form> |
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