Skip to content

Commit

Permalink
[EC-556] feat: remove and replace submit button
Browse files Browse the repository at this point in the history
  • Loading branch information
coroiu committed Sep 20, 2022
1 parent 7b541be commit 2e2375b
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@

<div class="tw-mb-3 tw-flex">
<ng-container *ngIf="!accountCreated">
<bit-submit-button [loading]="form.loading">{{ "createAccount" | i18n }}</bit-submit-button>
<button type="submit" bitButton [loading]="form.loading">
{{ "createAccount" | i18n }}
</button>
<a
bitButton
buttonType="secondary"
Expand All @@ -126,7 +128,7 @@
</a>
</ng-container>
<ng-container *ngIf="accountCreated">
<bit-submit-button [loading]="form.loading">{{ "logIn" | i18n }}</bit-submit-button>
<button type="submit" bitButton [loading]="form.loading">{{ "logIn" | i18n }}</button>
</ng-container>
</div>
<bit-error-summary *ngIf="showErrorSummary" [formGroup]="formGroup"></bit-error-summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h2 class="tw-mb-3 tw-text-base tw-font-semibold">{{ "paymentType" | i18n }}</h2
</div>

<div class="tw-flex tw-space-x-2">
<bit-submit-button [loading]="form.loading">{{ "startTrial" | i18n }}</bit-submit-button>
<button type="submit" bitButton [loading]="form.loading">{{ "startTrial" | i18n }}</button>

<button bitButton type="button" buttonType="secondary" (click)="stepBack()">Back</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ <h1>{{ "myOrganization" | i18n }}</h1>
<app-avatar data="{{ org.name }}" dynamic="true" size="75" fontSize="35"></app-avatar>
</div>
</div>
<bit-submit-button [loading]="form.loading">
<button type="submit" bitButton [loading]="form.loading">
{{ "save" | i18n }}
</bit-submit-button>
</button>
</form>
<ng-container *ngIf="canUseApi">
<div class="secondary-header border-0 mb-0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ <h2 class="modal-title" id="enrollMasterPasswordResetTitle">
<app-user-verification [(ngModel)]="verification" name="secret"> </app-user-verification>
</div>
<div class="modal-footer">
<bit-submit-button [loading]="form.loading">
<button type="submit" bitButton [loading]="form.loading">
{{ "submit" | i18n }}
</bit-submit-button>
</button>
<button
bitButton
buttonType="secondary"
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/reports/pages/breach-report.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ <h1>{{ "dataBreachReport" | i18n }}</h1>
<small class="form-text text-muted">{{ "breachCheckUsernameEmail" | i18n }}</small>
</div>
</div>
<bit-submit-button [loading]="form.loading">
<button type="submit" bitButton [loading]="form.loading">
{{ "checkBreaches" | i18n }}
</bit-submit-button>
</button>
</form>
<div class="mt-4" *ngIf="!form.loading && checkedUsername">
<p *ngIf="error">{{ "reportError" | i18n }}...</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<h1>{{ "exposedPasswordsReport" | i18n }}</h1>
</div>
<p>{{ "exposedPasswordsReportDesc" | i18n }}</p>
<bit-submit-button [loading]="loading" (click)="load()">
<button type="submit" bitButton [loading]="loading" (click)="load()">
{{ "checkExposedPasswords" | i18n }}
</bit-submit-button>
</button>
<div class="mt-4" *ngIf="hasLoaded">
<app-callout type="success" title="{{ 'goodNews' | i18n }}" *ngIf="!ciphers.length">
{{ "noExposedPasswords" | i18n }}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/settings/change-kdf.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h1>{{ "encKeySettings" | i18n }}</h1>
</div>
</div>
</div>
<bit-submit-button [loading]="form.loading">
<button type="submit" bitButton [loading]="form.loading">
{{ "changeKdf" | i18n }}
</bit-submit-button>
</button>
</form>
4 changes: 2 additions & 2 deletions apps/web/src/app/settings/change-password.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ <h1>{{ "changeMasterPassword" | i18n }}</h1>
</a>
</div>
</div>
<bit-submit-button [loading]="form.loading">
<button type="submit" bitButton [loading]="form.loading">
{{ "changeMasterPassword" | i18n }}
</bit-submit-button>
</button>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ <h3>
</div>
</div>
<div class="modal-footer">
<bit-submit-button [loading]="loading || form.loading" [disabled]="readOnly">
<button type="submit" bitButton [loading]="loading || form.loading" [disabled]="readOnly">
{{ "save" | i18n }}
</bit-submit-button>
</button>
<button bitButton buttonType="secondary" type="button" data-dismiss="modal">
{{ "cancel" | i18n }}
</button>
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/app/settings/organization-plans.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ <h2 class="spaced-header mb-4">
<app-callout [type]="'error'">{{ "singleOrgBlockCreateMessage" | i18n }}</app-callout>
</div>
<div class="mt-4">
<bit-submit-button [loading]="form.loading" [disabled]="!formGroup.valid">{{
"submit" | i18n
}}</bit-submit-button>
<button type="submit" bitButton [loading]="form.loading" [disabled]="!formGroup.valid">
{{ "submit" | i18n }}
</button>
<button type="button" class="btn btn-outline-secondary" (click)="cancel()" *ngIf="showCancel">
{{ "cancel" | i18n }}
</button>
Expand Down
8 changes: 4 additions & 4 deletions apps/web/src/app/settings/premium.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ <h1>{{ "goPremium" | i18n }}</h1>
"licenseFileDesc" | i18n: "bitwarden_premium_license.json"
}}</small>
</div>
<bit-submit-button [loading]="form.loading">
<button type="submit" bitButton [loading]="form.loading">
{{ "submit" | i18n }}
</bit-submit-button>
</button>
</form>
</ng-container>
<form #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate *ngIf="!selfHosted">
Expand Down Expand Up @@ -118,7 +118,7 @@ <h2 class="spaced-header mb-4">{{ "paymentInformation" | i18n }}</h2>
</p>
</div>
<small class="text-muted font-italic">{{ "paymentChargedAnnually" | i18n }}</small>
<bit-submit-button [loading]="form.loading">
<button type="submit" bitButton [loading]="form.loading">
{{ "submit" | i18n }}
</bit-submit-button>
</button>
</form>
9 changes: 7 additions & 2 deletions apps/web/src/app/settings/two-factor-setup.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,14 @@ <h2 class="mt-5 spaced-header">
</div>
<small class="form-text text-muted">{{ "deviceVerificationDesc" | i18n }}</small>
</div>
<bit-submit-button [loading]="form.loading" *ngIf="isDeviceVerificationSectionEnabled">
<button
type="submit"
bitButton
[loading]="form.loading"
*ngIf="isDeviceVerificationSectionEnabled"
>
{{ "save" | i18n }}
</bit-submit-button>
</button>
</div>
</div>
</form>
Expand Down
3 changes: 0 additions & 3 deletions apps/web/src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
ButtonModule,
CalloutModule,
FormFieldModule,
SubmitButtonModule,
MenuModule,
IconModule,
} from "@bitwarden/components";
Expand Down Expand Up @@ -44,7 +43,6 @@ import "./locales";
ButtonModule,
MenuModule,
FormFieldModule,
SubmitButtonModule,
IconModule,
],
exports: [
Expand All @@ -63,7 +61,6 @@ import "./locales";
ButtonModule,
MenuModule,
FormFieldModule,
SubmitButtonModule,
IconModule,
],
providers: [DatePipe],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ <h1>{{ "scim" | i18n }}</h1>
<bit-hint>{{ "scimApiKeyHelperText" | i18n }}</bit-hint>
</bit-form-field>

<bit-submit-button buttonType="primary" [loading]="form.loading" [disabled]="form.loading">
<button
type="submit"
bitButton
buttonType="primary"
[loading]="form.loading"
[disabled]="form.loading"
>
{{ "save" | i18n }}
</bit-submit-button>
</button>
</form>
1 change: 0 additions & 1 deletion libs/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export * from "./icon";
export * from "./icon-button";
export * from "./menu";
export * from "./dialog";
export * from "./submit-button";
export * from "./link";
export * from "./tabs";
export * from "./toggle-group";
Expand Down
1 change: 0 additions & 1 deletion libs/components/src/submit-button/index.ts

This file was deleted.

10 changes: 0 additions & 10 deletions libs/components/src/submit-button/submit-button.component.html

This file was deleted.

19 changes: 0 additions & 19 deletions libs/components/src/submit-button/submit-button.component.ts

This file was deleted.

13 changes: 0 additions & 13 deletions libs/components/src/submit-button/submit-button.module.ts

This file was deleted.

45 changes: 0 additions & 45 deletions libs/components/src/submit-button/submit-button.stories.ts

This file was deleted.

0 comments on commit 2e2375b

Please sign in to comment.