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

UI: HDS adoption replace <ConfirmAction> component #21520

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3ba8b36
replace confirm-action dropdown with button+modal
hellobontempo Jun 30, 2023
9c69e5d
add modal frame to sidebar
hellobontempo Jun 30, 2023
4d26f12
fix weird paragraph indent
hellobontempo Jun 30, 2023
8ef70fe
pass button text as arg
hellobontempo Jun 30, 2023
e956d34
add warning color to rotate modals
hellobontempo Jun 30, 2023
c61423d
Merge branch 'main' into ui/VAULT-17329/replace-confirm-action-dropdo…
hellobontempo Jul 12, 2023
bb75f54
Merge branch 'main' into ui/VAULT-17329/replace-confirm-action-dropdo…
hellobontempo Nov 16, 2023
4395212
update seal action and config ssh
hellobontempo Nov 16, 2023
b879604
cleanup confirm action
hellobontempo Nov 16, 2023
3e3ea30
edit form
hellobontempo Nov 16, 2023
ffd2c5a
add dropdown arg
hellobontempo Nov 16, 2023
1c81900
put back seal text
hellobontempo Nov 16, 2023
2c73e4a
put back confirm button text
hellobontempo Nov 16, 2023
8b59da6
fix toolbar stylinggp
hellobontempo Nov 16, 2023
72be6c9
popup member group
hellobontempo Nov 16, 2023
9fc8854
move up title
hellobontempo Nov 16, 2023
a0be23b
finish popup- components
hellobontempo Nov 16, 2023
93419be
keymgmt
hellobontempo Nov 16, 2023
4225667
fix modal button logic
hellobontempo Nov 16, 2023
3c75577
remaining app template components
hellobontempo Nov 16, 2023
de38317
add period for angel
hellobontempo Nov 16, 2023
65917e4
vault cluster items
hellobontempo Nov 16, 2023
89ab510
add button text assertion
hellobontempo Nov 16, 2023
3210bf4
remaining instances
hellobontempo Nov 16, 2023
6b9ed16
remove arg for passing confirm text
hellobontempo Nov 16, 2023
5b6c0e7
contextual confirm action components
hellobontempo Nov 16, 2023
16fbe1a
delete old components
hellobontempo Nov 16, 2023
69f2952
update docs
hellobontempo Nov 16, 2023
44904ce
ammend dropdown loading states, add getter for confirm button color
hellobontempo Nov 16, 2023
ff4fcc9
address feedback
hellobontempo Nov 16, 2023
0f1c938
remove @disabled arg and add @disabledMessage
hellobontempo Nov 16, 2023
365992a
add changelog;
hellobontempo Nov 16, 2023
7059e1a
mfa tests
hellobontempo Nov 16, 2023
e975a28
update test selectors
hellobontempo Nov 16, 2023
8afc847
lol cleanup selectors
hellobontempo Nov 16, 2023
4a33842
start confirm action tests WIP
hellobontempo Nov 16, 2023
b60b6c0
Merge branch 'main' into ui/VAULT-17329/replace-confirm-action-dropdo…
hellobontempo Nov 17, 2023
e3b5222
move dropdown class directly to component
hellobontempo Nov 17, 2023
56f212f
add default color of isInDropdown
hellobontempo Nov 17, 2023
eda92ea
final cleanup
hellobontempo Nov 17, 2023
d085494
add tests
hellobontempo Nov 17, 2023
8b2d558
remove @buttonColor as arg for dropdown
hellobontempo Nov 17, 2023
009ddfb
update confirm action tests
hellobontempo Nov 17, 2023
8642aad
updae modals with disabled message
hellobontempo Nov 17, 2023
d490985
refactor provider edit test
hellobontempo Nov 17, 2023
de200d3
Merge branch 'main' into ui/VAULT-17329/replace-confirm-action-dropdo…
hellobontempo Nov 17, 2023
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
2 changes: 1 addition & 1 deletion ui/lib/core/addon/components/confirm-action.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
data-test-confirm-button
disabled={{or @disabled @isRunning}}
@icon={{if @isRunning "loading"}}
@color={{if (or (not @modalColor) (eq @modalColor "critical")) "critical" "primary"}}
@color={{this.confirmButtonColor}}
hellobontempo marked this conversation as resolved.
Show resolved Hide resolved
@text="Confirm"
{{on "click" this.onConfirm}}
/>
Expand Down
5 changes: 5 additions & 0 deletions ui/lib/core/addon/components/confirm-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ export default class ConfirmActionComponent extends Component {
return this.args.confirmMessage || 'You will not be able to recover it later.';
}

get confirmButtonColor() {
// only change from default of primary if modal is 'critical'
return this.args.modalColor === 'critical' ? 'critical' : 'primary';
}

@action
async onConfirm() {
await this.args.onConfirmAction();
Expand Down
12 changes: 0 additions & 12 deletions ui/lib/core/addon/components/menu-loader.hbs

This file was deleted.

6 changes: 0 additions & 6 deletions ui/lib/core/app/components/menu-loader.js

This file was deleted.

48 changes: 23 additions & 25 deletions ui/lib/kmip/addon/templates/credentials/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -70,31 +70,29 @@
View credentials
</LinkTo>
</li>
{{#if list.item.deletePath.canDelete}}
{{#if list.item.deletePath.isPending}}
<li class="action">
<LoadingDropdownOption />
</li>
{{else}}
<ConfirmAction
class="hds-confirm-action-critical"
@buttonColor="critical"
@isInDropdown={{true}}
@buttonText="Revoke credentials"
@confirmTitle="Revoke this?"
@confirmMessage="Any client using these credentials will no longer be able to."
@onConfirmAction={{action
(perform
Item.callMethod
"destroyRecord"
list.item
"Successfully revoked credentials"
"There was an error revoking the credentials"
(action "refresh")
)
}}
/>
{{/if}}
{{#if list.item.deletePath.isPending}}
<li class="action">
<LoadingDropdownOption />
</li>
{{else if list.item.deletePath.canDelete}}
<ConfirmAction
class="hds-confirm-action-critical"
@buttonColor="critical"
@isInDropdown={{true}}
@buttonText="Revoke credentials"
@confirmTitle="Revoke this?"
@confirmMessage="Any client using these credentials will no longer be able to."
@onConfirmAction={{action
(perform
Item.callMethod
"destroyRecord"
list.item
"Successfully revoked credentials"
"There was an error revoking the credentials"
(action "refresh")
)
}}
/>
{{/if}}
</Item.menu>
</ListItem>
Expand Down
18 changes: 8 additions & 10 deletions ui/lib/kmip/addon/templates/scope/roles.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,17 @@
View role
</LinkTo>
</li>
{{#if list.item.updatePath.canUpdate}}
<MenuLoader @loadingParam={{list.item.updatePath.isPending}}>
{{#if list.item.updatePath.isPending}}
<li class="action">
<LoadingDropdownOption />
</li>
{{else}}
{{#if list.item.updatePath.canUpdate}}
<LinkTo @route="role.edit" @models={{array this.scope list.item.id}} class="is-block">
Edit role
</LinkTo>
</MenuLoader>
{{/if}}
{{#if list.item.updatePath.canDelete}}
{{#if list.item.updatePath.isPending}}
<li class="action">
<LoadingDropdownOption />
</li>
{{else}}
{{/if}}
{{#if list.item.updatePath.canDelete}}
<ConfirmAction
class="hds-confirm-action-critical"
@buttonColor="critical"
Expand Down
50 changes: 24 additions & 26 deletions ui/lib/kmip/addon/templates/scopes/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,30 @@
View scope
</LinkTo>
</li>
{{#if list.item.updatePath.canDelete}}
{{#if list.item.updatePath.isPending}}
<li class="action">
<LoadingDropdownOption />
</li>
{{else}}
<ConfirmAction
class="hds-confirm-action-critical"
@buttonColor="critical"
@isInDropdown={{true}}
@buttonText="Delete scope"
@confirmTitle="Delete scope {{list.item.id}}?"
@confirmMessage="This will permanently delete this scope and all roles and credentials contained within"
@onConfirmAction={{action
(perform
Item.callMethod
"destroyRecord"
list.item
(concat "Successfully deleted scope " list.item.id)
(concat "There was an error deleting the scope " list.item.id)
(action "refresh")
)
}}
data-test-scope-delete
/>
{{/if}}
{{#if list.item.updatePath.isPending}}
<li class="action">
<LoadingDropdownOption />
</li>
{{else if list.item.updatePath.canDelete}}
<ConfirmAction
class="hds-confirm-action-critical"
@buttonColor="critical"
@isInDropdown={{true}}
@buttonText="Delete scope"
@confirmTitle="Delete scope {{list.item.id}}?"
@confirmMessage="This will permanently delete this scope and all roles and credentials contained within"
@onConfirmAction={{action
(perform
Item.callMethod
"destroyRecord"
list.item
(concat "Successfully deleted scope " list.item.id)
(concat "There was an error deleting the scope " list.item.id)
(action "refresh")
)
}}
data-test-scope-delete
/>
{{/if}}
</Item.menu>
</ListItem>
Expand Down
Loading