Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icu 15713 address deprecation warning for dropdown interactive element #2561

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
{{#if (can 'delete account' @model)}}
<Hds::Dropdown data-test-manage-account-auth-method as |dd|>
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
<dd.Interactive
@text={{t 'resources.account.actions.delete'}}
@color='critical'
{{on 'click' (fn @delete @model)}}
/>
<dd.Interactive @color='critical' {{on 'click' (fn @delete @model)}}>{{t
'resources.account.actions.delete'
}}</dd.Interactive>
</Hds::Dropdown>
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -43,39 +43,37 @@
<Hds::Dropdown data-test-manage-auth-method as |dd|>
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
{{#if @model.isPrimary}}
<dd.Interactive
@text={{t 'resources.auth-method.actions.remove-as-primary'}}
{{on 'click' (fn @removeAsPrimary @model)}}
/>
<dd.Interactive {{on 'click' (fn @removeAsPrimary @model)}}>
{{t 'resources.auth-method.actions.remove-as-primary'}}
</dd.Interactive>
{{else}}
<dd.Interactive
@text={{t 'resources.auth-method.actions.make-primary'}}
{{on 'click' (fn @makePrimary @model)}}
/>
<dd.Interactive {{on 'click' (fn @makePrimary @model)}}>
{{t 'resources.auth-method.actions.make-primary'}}
</dd.Interactive>
{{/if}}
{{#if (can 'create model' @model collection='accounts')}}
<dd.Interactive
@text={{t 'resources.account.actions.create'}}
@route='scopes.scope.auth-methods.auth-method.accounts.new'
@model={{@model}}
/>
>
{{t 'resources.account.actions.create'}}
</dd.Interactive>
{{/if}}
{{#if (can 'create model' @model collection='managed-groups')}}
{{#if (or @model.isOIDC @model.isLDAP)}}
<dd.Interactive
@text={{t 'resources.managed-group.actions.create'}}
@route='scopes.scope.auth-methods.auth-method.managed-groups.new'
@model={{@model}}
/>
>
{{t 'resources.managed-group.actions.create'}}
</dd.Interactive>
{{/if}}
{{/if}}

{{#if (can 'delete auth-method' @model)}}
<dd.Separator />
<dd.Interactive
@text={{t 'resources.auth-method.actions.delete'}}
@color='critical'
{{on 'click' (fn @delete @model)}}
/>
<dd.Interactive @color='critical' {{on 'click' (fn @delete @model)}}>
{{t 'resources.auth-method.actions.delete'}}
</dd.Interactive>
{{/if}}
</Hds::Dropdown>
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
{{#if (can 'delete model' @model)}}
<Hds::Dropdown data-test-managed-group-dropdown as |dd|>
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
<dd.Interactive
@text={{t 'resources.managed-group.actions.delete'}}
@color='critical'
{{on 'click' (fn @delete @model)}}
/>
<dd.Interactive @color='critical' {{on 'click' (fn @delete @model)}}>{{t
'resources.managed-group.actions.delete'
}}</dd.Interactive>
</Hds::Dropdown>
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
{{#if (can 'create model' @model collection='credential-libraries')}}
<dd.Interactive
@route='scopes.scope.credential-stores.credential-store.credential-libraries.new'
@text={{t 'resources.credential-library.actions.create'}}
/>
>
{{t 'resources.credential-library.actions.create'}}
</dd.Interactive>
{{/if}}
{{#if (can 'create model' @model collection='credentials')}}
<dd.Interactive
@route='scopes.scope.credential-stores.credential-store.credentials.new'
@text={{t 'resources.credential.actions.create'}}
/>
>
{{t 'resources.credential.actions.create'}}
</dd.Interactive>
{{/if}}
{{#if (can 'delete model' @model)}}
<dd.Separator />
<dd.Interactive
@text={{t 'resources.credential-store.actions.delete'}}
@color='critical'
{{on 'click' @delete}}
/>
<dd.Interactive @color='critical' {{on 'click' @delete}}>
{{t 'resources.credential-store.actions.delete'}}
</dd.Interactive>
{{/if}}
</Hds::Dropdown>
12 changes: 6 additions & 6 deletions ui/admin/app/components/groups/group/actions/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
<Hds::Dropdown data-test-manage-group-dropdown as |dd|>
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
{{#if (can 'addMembers group' @model)}}
<dd.Interactive
@route='scopes.scope.groups.group.add-members'
@text={{t 'resources.group.actions.add-members'}}
/>
<dd.Interactive @route='scopes.scope.groups.group.add-members'>
{{t 'resources.group.actions.add-members'}}
</dd.Interactive>
{{/if}}
{{#if (can 'delete model' @model)}}
<dd.Separator />
<dd.Interactive
@color='critical'
@disabled={{@model.canSave}}
@text={{t 'resources.group.actions.delete'}}
{{on 'click' @delete}}
/>
>
{{t 'resources.group.actions.delete'}}
</dd.Interactive>
{{/if}}
</Hds::Dropdown>
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
<dd.Interactive
@route='scopes.scope.host-catalogs.host-catalog.hosts.new'
@model={{@model}}
@text={{t 'resources.host.actions.create'}}
/>
>
{{t 'resources.host.actions.create'}}
</dd.Interactive>
{{/if}}
{{#if (can 'create model' @model collection='host-sets')}}
<dd.Interactive
@route='scopes.scope.host-catalogs.host-catalog.host-sets.new'
@model={{@model}}
@text={{t 'resources.host-set.actions.create'}}
/>
>
{{t 'resources.host-set.actions.create'}}
</dd.Interactive>
{{/if}}
{{#if (can 'delete model' @model)}}
<dd.Separator />
<dd.Interactive
@text={{t 'resources.host-catalog.actions.delete'}}
@color='critical'
{{on 'click' (fn @delete @model)}}
/>
<dd.Interactive @color='critical' {{on 'click' (fn @delete @model)}}>
{{t 'resources.host-catalog.actions.delete'}}
</dd.Interactive>
{{/if}}
</Hds::Dropdown>
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@

{{#if (can 'addHosts hostSet' @model)}}
<dd.Interactive
@text={{t 'resources.host-set.actions.create-and-add-host'}}
@route='scopes.scope.host-catalogs.host-catalog.host-sets.host-set.create-and-add-host'
/>
>
{{t 'resources.host-set.actions.create-and-add-host'}}
</dd.Interactive>
<dd.Interactive
@text={{t 'resources.host-set.actions.add-hosts'}}
@route='scopes.scope.host-catalogs.host-catalog.host-sets.host-set.add-hosts'
/>
>
{{t 'resources.host-set.actions.add-hosts'}}
</dd.Interactive>
<dd.Separator />
{{/if}}
{{#if (can 'delete model' @model)}}
<dd.Interactive
@text={{t 'resources.host-set.actions.delete'}}
@color='critical'
{{on 'click' (fn @delete @model)}}
/>
<dd.Interactive @color='critical' {{on 'click' (fn @delete @model)}}>
{{t 'resources.host-set.actions.delete'}}
</dd.Interactive>
{{/if}}
</Hds::Dropdown>
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
{{#if (can 'delete model' @model)}}
<Hds::Dropdown data-test-manage-hosts-dropdown as |dd|>
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
<dd.Interactive
@text={{t 'resources.host.actions.delete'}}
@color='critical'
{{on 'click' (fn @delete @model)}}
/>
<dd.Interactive @color='critical' {{on 'click' (fn @delete @model)}}>{{t
'resources.host.actions.delete'
}}</dd.Interactive>
</Hds::Dropdown>
{{/if}}
15 changes: 9 additions & 6 deletions ui/admin/app/components/roles/role/actions/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,28 @@
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
{{#if (can 'addPrincipals role' @model)}}
<dd.Interactive
@text={{t 'resources.role.principal.actions.add-principals'}}
@route='scopes.scope.roles.role.add-principals'
data-test-manage-dropdown-principals
/>
>
{{t 'resources.role.principal.actions.add-principals'}}
</dd.Interactive>
{{/if}}
{{#if (can 'setGrantScopes role' @model)}}
<dd.Interactive
@text={{t 'resources.role.scope.actions.manage-scopes'}}
@route='scopes.scope.roles.role.manage-scopes'
data-test-manage-dropdown-scopes
/>
>
{{t 'resources.role.scope.actions.manage-scopes'}}
</dd.Interactive>
{{/if}}
{{#if (can 'delete model' @model)}}
<dd.Separator />
<dd.Interactive
@text={{t 'resources.role.actions.delete'}}
@color='critical'
@disabled={{@model.canSave}}
{{on 'click' (fn @delete @model)}}
/>
>
{{t 'resources.role.actions.delete'}}
</dd.Interactive>
{{/if}}
</Hds::Dropdown>
27 changes: 13 additions & 14 deletions ui/admin/app/components/targets/target/actions/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,34 @@
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />

{{#if (can 'addHostSources target' @model)}}
<dd.Interactive
@route='scopes.scope.targets.target.add-host-sources'
@text={{t 'resources.target.actions.add-host-sources'}}
/>
<dd.Interactive @route='scopes.scope.targets.target.add-host-sources'>
{{t 'resources.target.actions.add-host-sources'}}
</dd.Interactive>
{{/if}}
{{#if (can 'addBrokeredCredentialSources target' @model)}}
<dd.Interactive
@route='scopes.scope.targets.target.add-brokered-credential-sources'
@text={{t 'resources.target.actions.add-brokered-credential-sources'}}
data-test-add-brokered-cred-sources-action
/>
>
{{t 'resources.target.actions.add-brokered-credential-sources'}}
</dd.Interactive>
{{/if}}
{{#if (can 'addInjectedApplicationCredentialSources target' @model)}}
<dd.Interactive
@route='scopes.scope.targets.target.add-injected-application-credential-sources'
@text={{t
data-test-add-injected-cred-sources-action
>
{{t
'resources.target.actions.add-injected-application-credential-sources'
}}
data-test-add-injected-cred-sources-action
/>
</dd.Interactive>
{{/if}}

{{#if (can 'delete model' @model)}}
<dd.Separator />
<dd.Interactive
@text={{t 'resources.target.actions.delete'}}
@color='critical'
{{on 'click' (fn @delete @model)}}
/>
<dd.Interactive @color='critical' {{on 'click' (fn @delete @model)}}>
{{t 'resources.target.actions.delete'}}
</dd.Interactive>
{{/if}}

</Hds::Dropdown>
12 changes: 6 additions & 6 deletions ui/admin/app/components/users/user/actions/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />

{{#if (can 'addAccounts user' @model)}}
<dd.Interactive
@route='scopes.scope.users.user.add-accounts'
@text={{t 'resources.user.actions.add-accounts'}}
/>
<dd.Interactive @route='scopes.scope.users.user.add-accounts'>
{{t 'resources.user.actions.add-accounts'}}
</dd.Interactive>
{{/if}}

{{#if (can 'delete model' @model)}}
<dd.Separator />
<dd.Interactive
@color='critical'
@disabled={{@model.canSave}}
@text={{t 'resources.user.actions.delete'}}
{{on 'click' (fn @delete @model)}}
/>
>
{{t 'resources.user.actions.delete'}}
</dd.Interactive>
{{/if}}
</Hds::Dropdown>
12 changes: 6 additions & 6 deletions ui/admin/app/components/workers/worker/actions/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
<Hds::Dropdown data-test-manage-worker-dropdown as |dd|>
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
{{#if (can 'setWorkerTags worker' @model)}}
<dd.Interactive
@text={{t 'resources.worker.actions.create_tags'}}
@route='scopes.scope.workers.worker.create-tags'
/>
<dd.Interactive @route='scopes.scope.workers.worker.create-tags'>
{{t 'resources.worker.actions.create_tags'}}
</dd.Interactive>
{{/if}}
{{#if (can 'delete worker' @model)}}
<dd.Interactive
@icon='trash'
@text={{t 'resources.worker.actions.delete'}}
@color='critical'
{{on 'click' (fn @delete @model)}}
/>
>
{{t 'resources.worker.actions.delete'}}
</dd.Interactive>
{{/if}}
</Hds::Dropdown>
10 changes: 6 additions & 4 deletions ui/admin/app/templates/scopes/scope/aliases/alias/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,19 @@
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
{{#if (and perms.canUpdate @model.destination_id)}}
<dd.Interactive
@text={{t 'actions.clear'}}
@color='action'
{{on 'click' (fn this.aliases.clearAlias @model)}}
/>
>
{{t 'actions.clear'}}
</dd.Interactive>
{{/if}}
{{#if perms.canDelete}}
<dd.Interactive
@color='critical'
@text={{t 'actions.delete'}}
{{on 'click' (fn this.aliases.deleteAlias @model)}}
/>
>
{{t 'actions.delete'}}
</dd.Interactive>
{{/if}}
</Hds::Dropdown>

Expand Down
Loading