Skip to content

Commit

Permalink
Backport of Cc 5545: Upgrade HDS packages and modifiers into release/…
Browse files Browse the repository at this point in the history
…1.17.x (#19245)

* server: run the api checks against the path without params (#19205)

* Clone proto into deepcopy correctly (#19204)

* chore: update version and nightly CI for 1.17 (#19208)

Update version file to 1.18-dev, and replace 1.13 nightly test with
1.17.

* mesh: add validation hook to proxy configuration (#19186)

* mesh: add more validations to Destinations resource (#19202)

* catalog, mesh: implement missing ACL hooks (#19143)

This change adds ACL hooks to the remaining catalog and mesh resources, excluding any computed ones. Those will for now continue using the default operator:x permissions.

It refactors a lot of the common testing functions so that they can be re-used between resources.

There are also some types that we don't yet support (e.g. virtual IPs) that this change adds ACL hooks to for future-proofing.

* NET-5073 - ProxyConfiguration: implement various connection options (#19187)

* NET-5073 - ProxyConfiguration: implement various connection options

* PR feedback - LocalConnection and InboundConnection do not affect exposed routes. configure L7 route destinations. fix connection proto sequence numbers.

* add timeout to L7 Route Destinations

* Relplat 897 copywrite bot workarounds (#19200)

Co-authored-by: Ronald Ekambi <[email protected]>

* mesh: add xRoute ACL hook tenancy tests (#19177)

Enhance the xRoute ACL hook tests to cover tenanted situations.
These tests will only execute in enterprise.

* resource: enforce lowercase v2 resource names (#19218)

* mesh: add DestinationPolicy ACL hook tenancy tests (#19178)

Enhance the DestinationPolicy ACL hook tests to cover tenanted situations.
These tests will only execute in enterprise.

* catalog: add FailoverPolicy ACL hook tenancy test (#19179)

* Upgrade @hashicorp/design-system-tokens to 1.9.0

* Upgrade @hashicorp/design-system-components to 1.8.1

* Upgrade @hashicorp/design-system-components and ember-in-viewport

* Explicitly install [email protected]

* rename copy-button

* backport of commit 1a1b951

* backport of commit b7295ee

* backport of commit 73089ed

* backport of commit cea2ab9

* backport of commit 964ef50

* backport of commit 0fd98e7

* backport of commit 0519b9b

* backport of commit 50cbd00

* backport of commit 838a8a9

* backport of commit 4882490

* backport of commit 42a9f03

* backport of commit bbedb3f

* backport of commit 4576fbe

* backport of commit 07584fa

* backport of commit ef39122

* backport of commit c77d8a0

* backport of commit 13e3d1c

---------

Co-authored-by: R.B. Boyer <[email protected]>
Co-authored-by: Ashwin Venkatesh <[email protected]>
Co-authored-by: Michael Zalimeni <[email protected]>
Co-authored-by: Iryna Shustava <[email protected]>
Co-authored-by: John Murret <[email protected]>
Co-authored-by: modrake <[email protected]>
Co-authored-by: Ronald Ekambi <[email protected]>
Co-authored-by: Semir Patel <[email protected]>
Co-authored-by: wenincode <[email protected]>
Co-authored-by: Chris Hut <[email protected]>
  • Loading branch information
11 people authored Oct 17, 2023
1 parent 24f2d0b commit bf42dd6
Show file tree
Hide file tree
Showing 36 changed files with 525 additions and 308 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ as |item index|>
{{else}}
<span>
{{item.ID}}
<CopyButton
<ConsulCopyButton
@value={{item.ID}}
@name="ID"
/>
Expand All @@ -28,7 +28,7 @@ as |item index|>
ID
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{item.ID}}
@name="ID"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div
class="hds-typography-display-300 text-hds-foreground-strong hds-font-weight-semibold"
>{{address}}</div>
<CopyButton
<ConsulCopyButton
@value={{address}}
@name="Address"
class="opacity-0 group-hover:opacity-100"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ A code-editor with syntax highlighting supporting multiple languages (JSON, HCL,
| Name | Description | Behaviour if empty |
| --- | --- | --- |
| `:label` | Used to define the title that's displayed on the left inside the toolbar above the CodeEditor | Nothing is displayed |
| `:tools` | Used to define tools, buttons, widgets that will be displayed on the right inside the toolbar above the CodeEditor | By default it renders a `language selector` dropdown (if `readonly`== false and `syntax` is falsy) and a `CopyButton`
| `:tools` | Used to define tools, buttons, widgets that will be displayed on the right inside the toolbar above the CodeEditor | By default it renders a `language selector` dropdown (if `readonly`== false and `syntax` is falsy) and a `ConsulCopyButton`
| `:content` | Used to display specific content such as code templates inside the CodeEditor | if the block is defined, @value will be displayed instead |


Expand Down
2 changes: 1 addition & 1 deletion ui/packages/consul-ui/app/components/code-editor/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{mode.name}}
</PowerSelect>
<div class="toolbar-separator"></div>
<CopyButton
<ConsulCopyButton
@value={{value}}
@name="value"
/>
Expand Down
32 changes: 17 additions & 15 deletions ui/packages/consul-ui/app/components/code-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,24 @@ export default Component.extend({
}
},
setMode: function (mode) {
let options = {
...DEFAULTS,
mode: mode.mime,
readOnly: this.readonly,
};
if (mode.name === 'XML') {
options.htmlMode = mode.htmlMode;
options.matchClosing = mode.matchClosing;
options.alignCDATA = mode.alignCDATA;
}
set(this, 'options', options);
if (!this.isDestroying && !this.isDestroyed) {
let options = {
...DEFAULTS,
mode: mode.mime,
readOnly: this.readonly,
};
if (mode.name === 'XML') {
options.htmlMode = mode.htmlMode;
options.matchClosing = mode.matchClosing;
options.alignCDATA = mode.alignCDATA;
}
set(this, 'options', options);

const editor = this.editor;
editor.setOption('mode', mode.mime);
this.helper.lint(editor, mode.mode);
set(this, 'mode', mode);
const editor = this.editor;
editor.setOption('mode', mode.mime);
this.helper.lint(editor, mode.mode);
set(this, 'mode', mode);
}
},
willDestroyElement: function () {
this._super(...arguments);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CopyButton
# ConsulCopyButton

Button component used for copy-to-clipboard functionality so the user can easily copy specified text to their clipboard, along with tooltip-like notifications so the user has some sort of feedback to know the value has been copied.

Expand All @@ -10,7 +10,7 @@ Can be used inline to render only a small icon for the button with no other text
<figure>
<figcaption>Icon only</figcaption>
<CopyButton
<ConsulCopyButton
@value={{'stringToCopy'}}
@name="Thing"
/>
Expand All @@ -20,12 +20,12 @@ Can be used inline to render only a small icon for the button with no other text
<figure>
<figcaption>Icon and text</figcaption>
<CopyButton
<ConsulCopyButton
@value={{'stringToCopy'}}
@name="Thing"
>
Copy me!
</CopyButton>
</ConsulCopyButton>
</figure>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
{{#let (fn dispatch 'SUCCESS') (fn dispatch 'ERROR') (fn dispatch 'RESET') as |success error reset|}}
<button
{{with-copyable @value success=success error=error}}
aria-label={{t 'components.copy-button.title' name=@name}}
aria-label={{t 'components.consul-copy-button.title' name=@name}}
type="button"
class="copy-btn"
...attributes
{{tooltip
(if (state-matches state 'success') (t 'components.copy-button.success' name=@name) (t 'components.copy-button.error'))
(if (state-matches state 'success') (t 'components.consul-copy-button.success' name=@name) (t 'components.consul-copy-button.error'))
options=(hash
trigger='manual'
showOnCreate=(not (state-matches state 'idle'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import Component from '@glimmer/component';
import chart from './chart.xstate';

export default class CopyButton extends Component {
export default class ConsulCopyButton extends Component {
constructor() {
super(...arguments);
this.chart = chart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<span>
{{combinedAddress}}
</span>
<CopyButton
<ConsulCopyButton
@value={{combinedAddress}}
@name="Address"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<dt>Output</dt>
<dd>
<pre><code>{{item.Output}}</code></pre>
<CopyButton @value={{item.Output}} @name="output" />
<ConsulCopyButton @value={{item.Output}} @name="output" />
</dd>
</dl>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ as |item index|>
<span>Address</span>
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{item.Address}}
@name="Address"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ as |item|>
</BlockSlot>
<BlockSlot @name="actions" as |Actions|>
{{#if item.hasSecretID}}
<CopyButton
<ConsulCopyButton
@value={{item.SecretID}}
@name={{t "components.consul.token.secretID"}}
>
{{t "components.consul.token.secretID"}}
</CopyButton>
</ConsulCopyButton>
{{/if}}
<Actions as |Action|>
<Action data-test-edit-action @href={{href-to 'dc.acls.tokens.edit' item.AccessorID}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
Local bind socket path
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{item.LocalBindSocketPath}}
@name="Local bind socket path"
/>
Expand All @@ -73,7 +73,7 @@
Address
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{combinedAddress}}
@name="Address"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ as |item index|>
Address
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{address}}
@name="Address"
/>
Expand Down
4 changes: 2 additions & 2 deletions ui/packages/consul-ui/app/components/copyable-code/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
</disclosure.Details>
</Disclosure>

<CopyButton
<ConsulCopyButton
@value={{@value}}
@name={{@name}}
/>

{{else}}
<pre><code
>{{@value}}</code></pre>
<CopyButton
<ConsulCopyButton
@value={{@value}}
@name={{@name}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,21 @@
}}

<@disclosure.Details as |details|>
<PagedCollection
@items={{or @items (array)}}
as |pager|>
<PagedCollection @items={{or @items (array)}} as |pager|>
<div
{{on-outside 'click' @disclosure.close}}
{{did-insert pager.viewport}}
{{on-resize pager.resize}}
{{css-prop '--paged-row-height' returns=pager.rowHeight}}
{{css-prop 'max-height' returns=pager.maxHeight}}
class={{class-map
(array 'paged-collection-scroll' (includes pager.type (array 'virtual-scroll' 'native-scroll')))
(array
'paged-collection-scroll' (includes pager.type (array 'virtual-scroll' 'native-scroll'))
)
}}
...attributes
>
{{yield (hash
Menu=(component 'menu'
disclosure=@disclosure
pager=pager
)
)}}
{{yield (hash Menu=(component 'menu' disclosure=@disclosure pager=pager))}}
</div>
</PagedCollection>
</@disclosure.Details>

</@disclosure.Details>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ to provide a textual tooltip for the icon. Using the `{{tooltip}}` modifier
with no arguments will make it use the text/DOM content of the DOM element it
is attached to, see below for a full usage example.

`<CopyButton />` components are commonly added to the value, and can be added
`<ConsulCopyButton />` components are commonly added to the value, and can be added
to the left or right of the value.

```hbs preview-template
Expand Down Expand Up @@ -49,7 +49,7 @@ to the left or right of the value.
TTL
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{"1m30s10ms"}}
@name="TTL"
/>
Expand Down Expand Up @@ -96,7 +96,7 @@ to the left or right of the value.
</dt>
<dd>
1m30s10ms
<CopyButton
<ConsulCopyButton
@value={{"1m30s10ms"}}
@name="TTL"
/>
Expand Down Expand Up @@ -147,7 +147,7 @@ to the left or right of the value.
TTL
</dt>
<dd>
<CopyButton
<ConsulCopyButton
@value={{"1m30s10ms"}}
@name="TTL"
/>
Expand Down
25 changes: 13 additions & 12 deletions ui/packages/consul-ui/app/components/menu/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@
}}

<ul
role="menu"
role='menu'
style={{{style-map
(array 'height' (if (and @pager (not-eq @pager.type 'native-scroll')) @pager.totalHeight) 'px')
(array '--paged-start' (if (and @pager (not-eq @pager.type 'native-scroll')) @pager.startHeight) 'px')
(array
'--paged-start' (if (and @pager (not-eq @pager.type 'native-scroll')) @pager.startHeight) 'px'
)
}}}
{{did-insert (optional @pager.pane)}}
{{aria-menu
onclose=(or @onclose @disclosure.close)
openEvent=(or @event @disclosure.event)
}}
{{aria-menu onclose=(or @onclose @disclosure.close) openEvent=(or @event @disclosure.event)}}
>
{{yield (hash
Action=(component 'menu/action' disclosure=@disclosure)
Item=(component 'menu/item')
Separator=(component 'menu/separator')
items=@pager.items
)}}
{{yield
(hash
Action=(component 'menu/action' disclosure=@disclosure)
Item=(component 'menu/item')
Separator=(component 'menu/separator')
items=@pager.items
)
}}
</ul>
Loading

0 comments on commit bf42dd6

Please sign in to comment.