Skip to content

Commit

Permalink
UI: [VAULT-17700] Part 3 HDS button (#23830)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiannaquach authored Oct 27, 2023
1 parent 2b51e09 commit 04676c0
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 74 deletions.
23 changes: 10 additions & 13 deletions ui/app/components/policy-form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,22 @@
{{/each}}
</div>
<div class="field is-grouped box is-fullwidth is-bottomless">
<div class="control">
<button
<Hds::ButtonSet>
<Hds::Button
@text={{if @model.isNew "Create policy" "Save"}}
@icon={{if this.save.isRunning "loading"}}
type="submit"
class="button is-primary {{if this.save.isRunning 'is-loading'}}"
disabled={{this.save.isRunning}}
data-test-policy-save
>
{{if @model.isNew "Create policy" "Save"}}
</button>
<button
type="button"
class="button has-left-margin-s"
/>
<Hds::Button
@text="Cancel"
@color="secondary"
disabled={{this.save.isRunning}}
{{on "click" this.cancel}}
data-test-policy-cancel
>
Cancel
</button>
</div>
/>
</Hds::ButtonSet>
</div>
</form>

Expand Down
1 change: 1 addition & 0 deletions ui/app/components/sidebar/user-menu.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
{{#if (is-before (now interval=1000) this.auth.tokenExpirationDate)}}
{{#if this.auth.authData.renewable}}
<li class="action">
{{! TODO Hds::Button replacement skipped in favor of updating it when there is a Hds::Dropdown swapout }}
<button
type="button"
{{on "click" this.renewToken}}
Expand Down
4 changes: 1 addition & 3 deletions ui/app/templates/vault/cluster/access/control-groups.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
</div>
</div>
<div class="field is-grouped box is-fullwidth is-bottomless">
<button type="submit" class="button is-primary" disabled={{not this.model.id}}>
Lookup
</button>
<Hds::Button @text="Lookup" type="submit" disabled={{not this.model.id}} />
</div>
</form>
{{else}}
Expand Down
1 change: 1 addition & 0 deletions ui/app/templates/vault/cluster/access/identity/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
</li>
<li class="action">
{{#if item.disabled}}
{{! TODO Hds::Button replacement skipped in favor of updating it when there is a Hds::Dropdown swapout }}
<button type="button" {{action "toggleDisabled" item}} class="link">
Enable
</button>
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/vault/cluster/access/leases/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</div>
<div class="field is-grouped box is-fullwidth is-bottomless">
<div class="control">
<button type="submit" class="button is-primary">Lookup</button>
<Hds::Button @text="Lookup" type="submit" />
</div>
</div>
</form>
4 changes: 1 addition & 3 deletions ui/app/templates/vault/cluster/access/leases/show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@
/>
<div class="field has-top-margin-s">
<div class="control">
<button type="submit" class="button is-primary">
Renew lease
</button>
<Hds::Button @text="Renew lease" type="submit" />
</div>
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@
</div>
<Toolbar>
<ToolbarActions>
<button
class="toolbar-link"
onclick={{action (mut this.showDeleteConfirmation) true}}
type="button"
<Hds::Button
@text="Delete"
@color="secondary"
class="toolbar-button"
{{on "click" (action (mut this.showDeleteConfirmation) true)}}
data-test-enforcement-delete
>
Delete
</button>
/>
<div class="toolbar-separator"></div>
<ToolbarLink
@route="vault.cluster.access.mfa.enforcements.enforcement.edit"
Expand Down
9 changes: 1 addition & 8 deletions ui/app/templates/vault/cluster/access/mfa/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@
Learn more
</DocLink>
</p>
<button
type="submit"
class="button is-primary"
{{on "click" (transition-to "vault.cluster.access.mfa.methods.create")}}
data-test-mfa-configure
>
Configure MFA
</button>
<Hds::Button @text="Configure MFA" @route="vault.cluster.access.mfa.methods.create" data-test-mfa-configure />
</div>
<div class="box is-fullwidth is-shadowless">
<p>
Expand Down
14 changes: 5 additions & 9 deletions ui/app/templates/vault/cluster/access/mfa/methods/create.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,12 @@
<div class="has-top-margin-l has-border-top-light">
<div class="has-top-margin-l has-bottom-margin-l">
{{#if this.showForms}}
<button class="button is-primary" type="button" {{on "click" (perform this.save)}} data-test-mfa-create-save>
Continue
</button>
<button class="button has-left-margin-xs" type="button" {{on "click" this.cancel}}>
Cancel
</button>
<Hds::ButtonSet>
<Hds::Button @text="Continue" {{on "click" (perform this.save)}} data-test-mfa-create-save />
<Hds::Button @text="Cancel" @color="secondary" {{on "click" this.cancel}} />
</Hds::ButtonSet>
{{else if this.type}}
<button class="button is-primary" type="button" {{on "click" this.createModels}} data-test-mfa-create-next>
Next
</button>
<Hds::Button @text="Next" {{on "click" this.createModels}} data-test-mfa-create-next />
{{/if}}
</div>
</div>
Expand Down
11 changes: 4 additions & 7 deletions ui/app/templates/vault/cluster/access/oidc.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@
</DocLink>
</p>
{{#if this.isCta}}
<button
type="submit"
class="button is-primary"
{{on "click" (transition-to "vault.cluster.access.oidc.clients.create")}}
<Hds::Button
@text="Create your first app"
@route="vault.cluster.access.oidc.clients.create"
data-test-oidc-configure
>
Create your first app
</button>
/>
{{/if}}
</div>
{{#unless this.isCta}}
Expand Down
25 changes: 15 additions & 10 deletions ui/app/templates/vault/cluster/auth.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
@subTitle={{join ". " this.mfaErrors}}
class="is-shadowless"
>
<button type="button" class="button is-ghost is-transparent" {{on "click" (action "onMfaErrorDismiss")}}>
<Icon @name="chevron-left" />
Go back
</button>
<Hds::Button @text="Go back" @icon="chevron-left" @color="tertiary" {{on "click" (action "onMfaErrorDismiss")}} />
</EmptyState>
</div>
</Page.altContent>
Expand All @@ -34,13 +31,21 @@
</div>
<div class="is-flex-row">
{{#if this.mfaAuthData}}
<button type="button" class="icon-button" {{on "click" (fn (mut this.mfaAuthData) null)}}>
<Icon @name="arrow-left" @size="24" aria-label="Back to login" class="icon-blue" />
</button>
<Hds::Button
@text="Back to login"
@icon="arrow-left"
@isIconOnly={{true}}
@color="tertiary"
{{on "click" (fn (mut this.mfaAuthData) null)}}
/>
{{else if this.waitingForOktaNumberChallenge}}
<button type="button" class="icon-button" {{on "click" (action "cancelAuthentication")}}>
<Icon @name="arrow-left" @size="24" aria-label="Back to login" class="icon-blue" />
</button>
<Hds::Button
@text="Back to login"
@icon="arrow-left"
@isIconOnly={{true}}
@color="tertiary"
{{on "click" (action "cancelAuthentication")}}
/>
{{/if}}
<h1 class="title is-3">
{{if (or this.mfaAuthData this.waitingForOktaNumberChallenge) "Authenticate" "Sign in to Vault"}}
Expand Down
9 changes: 4 additions & 5 deletions ui/app/templates/vault/cluster/init.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,13 @@
{{/if}}
</div>
<div class="box is-marginless is-shadowless">
<button
<Hds::Button
@text="Initialize"
@icon={{if this.loading "loading"}}
data-test-init-submit
type="submit"
class="button is-primary {{if this.loading 'is-loading'}}"
disabled={{this.loading}}
>
Initialize
</button>
/>
<div class="init-illustration">
{{svg-jar "initialize"}}
</div>
Expand Down
18 changes: 10 additions & 8 deletions ui/app/templates/vault/cluster/secrets/backend/sign.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@
</div>
{{/if}}
<div class="control">
<button type="button" {{action "newModel"}} class="button" data-test-secret-generate-back={{true}}>
Back
</button>
<Hds::Button
@text="Back"
@color="secondary"
{{on "click" (action "newModel")}}
data-test-secret-generate-back={{true}}
/>
</div>
</div>
{{else}}
Expand Down Expand Up @@ -105,14 +108,13 @@
</div>
<div class="field is-grouped box is-fullwidth is-bottomless">
<div class="control">
<button
<Hds::Button
@text="Sign"
@icon={{if this.loading "loading"}}
type="submit"
disabled={{this.loading}}
class="button is-primary {{if this.loading 'is-loading'}}"
data-test-secret-generate={{true}}
>
Sign
</button>
/>
</div>
<div class="control">
<LinkTo
Expand Down

0 comments on commit 04676c0

Please sign in to comment.