UI: [VAULT-17700] Part 3 HDS button (#23830)

This commit is contained in:
Kianna 2023-10-27 10:13:44 -07:00 committed by GitHub
parent 2b51e09bda
commit 04676c0eb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 60 additions and 74 deletions

View file

@ -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>

View file

@ -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}}

View file

@ -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}}

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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"

View file

@ -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>

View file

@ -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>

View file

@ -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}}

View file

@ -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>
@ -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"}}

View file

@ -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>

View file

@ -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}}
@ -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