Skip to content

Commit

Permalink
Merge branch 'main' into docs/envoy-extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
im2nguyen authored Feb 22, 2023
2 parents 495bfd6 + 0c66bbf commit 1cc8a32
Show file tree
Hide file tree
Showing 91 changed files with 1,491 additions and 843 deletions.
3 changes: 3 additions & 0 deletions .changelog/16251.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
ui: update from <button> and <a> to design-system-components button <Hds::Button>
```
2 changes: 1 addition & 1 deletion .github/workflows/nightly-test-1.15.x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
EMBER_PARTITION_TOTAL: 4 # Has to be changed in tandem with the matrix.partition
BRANCH: "release/1.15.x"
BRANCH_NAME: "release/1.15.x" # Used for naming artifacts
BRANCH_NAME: "release-1.15.x" # Used for naming artifacts

jobs:
frontend-test-workspace-node:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
</AuthForm>
</BlockSlot>
<BlockSlot @name="actions">
<Action
{{on "click" modal.close}}
>
Continue without logging in
</Action>
<Hds::Button
@color='secondary'
@text='Continue without logging in'
{{on 'click' modal.close}}
/>
</BlockSlot>
</ModalDialog>
</:unauthorized>
Expand Down Expand Up @@ -106,11 +106,11 @@
</AuthForm>
</BlockSlot>
<BlockSlot @name="actions">
<Action
<Hds::Button
@color='secondary'
@text='Continue without logging in'
{{on 'click' modal.close}}
>
Continue without logging in
</Action>
/>
</BlockSlot>
</ModalDialog>
<Portal @target="app-before-skip-links">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@
<dd>{{@item.ID}}</dd>
<dt>Node</dt>
<dd>
<a
href={{href-to 'dc.nodes.show' @item.Node}}
>
{{@item.Node}}
</a>
<Hds::Button
@text={{@item.Node}}
@icon='git-commit'
@href={{href-to 'dc.nodes.show' @item.Node}}
@isHrefExternal={{false}}
@size='small'
@color='tertiary'
/>
</dd>
<dt>Delay</dt>
<dd>{{duration-from @item.LockDelay}}</dd>
Expand All @@ -74,30 +77,30 @@
{{#if (can 'delete session' item=@item)}}
<ConfirmationDialog @message="Are you sure you want to invalidate this Lock Session?">
<BlockSlot @name="action" as |confirm|>
<Action
<Hds::Button
@text='Invalidate Session'
@color='critical'
data-test-delete
class="type-delete"
{{on 'click' (fn confirm (fn writer.delete @item))}}
>
Invalidate Session
</Action>
/>
</BlockSlot>
<BlockSlot @name="dialog" as |execute cancel message|>
<p>
{{message}}
</p>
<Action
class="type-delete"
{{on 'click' (fn execute)}}
>
Confirm Invalidation
</Action>
<Action
class="type-cancel"
{{on 'click' (fn cancel)}}
>
Cancel
</Action>
<Hds::ButtonSet>
<Hds::Button
@text='Confirm Invalidation'
@color='critical'
data-test-delete
{{on 'click' (fn execute)}}
/>
<Hds::Button
@text='Cancel'
@color='secondary'
{{on 'click' (fn cancel)}}
/>
</Hds::ButtonSet>
</BlockSlot>
</ConfirmationDialog>
{{/if}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,30 +81,30 @@ as |item index|>
@message="Are you sure you want to invalidate this session?"
>
<BlockSlot @name="action" as |confirm|>
<Action
<Hds::Button
@text='Invalidate'
@color='critical'
data-test-delete
class="type-delete"
{{on 'click' (fn confirm (fn @ondelete item))}}
>
Invalidate
</Action>
/>
</BlockSlot>
<BlockSlot @name="dialog" as |execute cancel message|>
<p>
{{message}}
</p>
<Action
class="type-delete"
{{on 'click' (fn execute)}}
>
Confirm Invalidate
</Action>
<Action
class="type-cancel"
{{on 'click' (fn cancel)}}
>
Cancel
</Action>
<Hds::ButtonSet>
<Hds::Button
@text='Confirm Invalidate'
@color='critical'
data-test-delete
{{on 'click' (fn execute)}}
/>
<Hds::Button
@text='Cancel'
@color='secondary'
{{on 'click' (fn cancel)}}
/>
</Hds::ButtonSet>
</BlockSlot>
</ConfirmationDialog>
</BlockSlot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,23 @@ as |route|>
</BlockSlot>

<BlockSlot @name="actions">
<li class="docs-link">
<Action
<li>
<Hds::Link::Standalone
@text='Documentation on Lock Sessions'
@href="{{env 'CONSUL_DOCS_URL'}}/internals/sessions.html"
@external={{true}}
>
Documentation on Lock Sessions
</Action>
@icon='docs-link'
@iconPosition='trailing'
@size='small'
/>
</li>
<li class="learn-link">
<Action
@href="{{env 'CONSUL_DOCS_LEARN_URL'}}/tutorials/consul/distributed-semaphore"
@external={{true}}
>
Take the tutorial
</Action>
<li>
<Hds::Link::Standalone
@text='Take the tutorial'
@href='{{env 'CONSUL_DOCS_LEARN_URL'}}/tutorials/consul/distributed-semaphore'
@icon='learn-link'
@iconPosition='trailing'
@size='small'
/>
</li>
</BlockSlot>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,25 +102,29 @@
</fieldset>
{{/if}}
<div>
<Hds::ButtonSet>
{{#if (and (is "new nspace" item=item) (can "create nspaces"))}}
<Action
@type="submit"
{{disabled
(or
<Hds::Button
type="submit"
disabled={{or
(is "pristine nspace" item=item)
(state-matches state "error")
)
}}
>
Save
</Action>
@text='Save'
/>
{{else if (can "write nspace" item=item)}}
<Action @type="submit">Save</Action>
<Hds::Button
type='submit'
@text='Save'
/>
{{/if}}

<Action @type="reset" {{on "click" (fn this.onCancel item)}}>
Cancel
</Action>
<Hds::Button
type='reset'
@color='secondary'
@text='Cancel'
{{on 'click' (fn this.onCancel item)}}
/>

{{#if
(and
Expand All @@ -132,13 +136,12 @@
@message="Are you sure you want to delete this Namespace?"
>
<BlockSlot @name="action" as |confirm|>
<Action
<Hds::Button
data-test-delete
class="type-delete"
@color='critical'
@text='Delete'
{{on "click" (fn confirm (fn writer.delete item))}}
>
Delete
</Action>
/>
</BlockSlot>
<BlockSlot @name="dialog" as |execute cancel message|>
<DeleteConfirmation
Expand All @@ -149,7 +152,7 @@
</BlockSlot>
</ConfirmationDialog>
{{/if}}

</Hds::ButtonSet>
</div>
</StateChart>
</form>
Expand Down
26 changes: 21 additions & 5 deletions ui/packages/consul-nspaces/app/templates/dc/nspaces/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ as |route|>
</BlockSlot>
<BlockSlot @name="actions">
{{#if (can "create nspaces")}}
<a data-test-create href="{{href-to 'dc.nspaces.create'}}" class="type-create">Create</a>
<Hds::Button
@text='Create'
@route='dc.nspaces.create'
data-test-create
/>
{{/if}}
</BlockSlot>
<BlockSlot @name="toolbar">
Expand Down Expand Up @@ -117,11 +121,23 @@ as |route|>
</p>
</BlockSlot>
<BlockSlot @name="actions">
<li class="docs-link">
<a href="{{env 'CONSUL_DOCS_URL'}}/commands/namespace" rel="noopener noreferrer" target="_blank">Documentation on namespaces</a>
<li>
<Hds::Link::Standalone
@text='Documentation on namespaces'
@href="{{env 'CONSUL_DOCS_URL'}}/commands/namespace"
@icon='docs-link'
@iconPosition='trailing'
@size='small'
/>
</li>
<li class="learn-link">
<a href="{{env 'CONSUL_DOCS_LEARN_URL'}}/consul/namespaces/secure-namespaces" rel="noopener noreferrer" target="_blank">Read the guide</a>
<li>
<Hds::Link::Standalone
@text='Read the guide'
@href="{{env 'CONSUL_DOCS_LEARN_URL'}}/consul/namespaces/secure-namespaces"
@icon='learn-link'
@iconPosition='trailing'
@size='small'
/>
</li>
</BlockSlot>
</EmptyState>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,34 +84,37 @@ as |State Guard ChartAction dispatch state|>
</fieldset>

<div>
<Hds::ButtonSet>


{{#if (and (is "new partition" item=item) (can "create partitions")) }}
<Action
@type="submit"
{{disabled (or (is "pristine partition" item=item) (state-matches state "error"))}}
>
Save
</Action>
<Hds::Button
@text='Save'
type='submit'
disabled={{or (is "pristine partition" item=item) (state-matches state "error")}}
/>
{{else if (not readOnly)}}
<Action @type="submit">Save</Action>
<Hds::Button
@text='Save'
type='submit'
/>
{{/if}}

<Action
@type="reset"
{{on 'click' (if @oncancel (fn @oncancel item) (fn @onsubmit item))}}
>
Cancel
</Action>
<Hds::Button
@text='Cancel'
type='reset'
@color='secondary'
{{on 'click' (if @oncancel (fn (optional @oncancel item)) (fn (optional @onsubmit item)))}}
/>

{{#if (and (not (is "new partition" item=item)) (can "delete partition" item=item))}}
<ConfirmationDialog @message="Are you sure you want to delete this Partition?">
<BlockSlot @name="action" as |confirm|>
<Action
<Hds::Button
@text='Delete'
data-test-delete
class="type-delete"
@color='critical'
{{on 'click' (fn confirm (fn writer.delete item))}}
>
Delete
</Action>
/>
</BlockSlot>
<BlockSlot @name="dialog" as |execute cancel message|>
<DeleteConfirmation
Expand All @@ -122,7 +125,7 @@ as |State Guard ChartAction dispatch state|>
</BlockSlot>
</ConfirmationDialog>
{{/if}}

</Hds::ButtonSet>
</div>

</StateChart>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,11 @@ as |route|>
</BlockSlot>
<BlockSlot @name="actions">
{{#if (can 'create partitions')}}
<a
data-test-create
class="type-create"
href="{{href-to 'dc.partitions.create'}}"
>
Create
</a>
<Hds::Button
@text='Create'
@route='dc.partitions.create'
data-test-create
/>
{{/if}}
</BlockSlot>
<BlockSlot @name="toolbar">
Expand Down
Loading

0 comments on commit 1cc8a32

Please sign in to comment.