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: Part 1 - hds adoption replace <Modal> #23363

Conversation

hellobontempo
Copy link
Contributor

@hellobontempo hellobontempo commented Sep 28, 2023

🔄 Replaces modal in

  • policy-form.hbs
  • clients/attribution.hbs
  • clients/config.hbs
  • database-connection.hbs
  • link-status.hbs * pending design questions with this one
  • scope-form.hbs
  • transformation-edit.hbs

@hellobontempo hellobontempo added this to the 1.16.0-rc1 milestone Sep 28, 2023
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Sep 28, 2023
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned up this view a bit while I was here 🧹

@@ -70,36 +82,6 @@
<span class="is-size-9 has-text-grey has-bottom-margin-l">
You can use Alt+Tab (Option+Tab on MacOS) in the code editor to skip to the next field.
</span>
{{! Only renders button (and modal) if not already in the "create policy" modal }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These links were incorrect - this copy and correct links already render below the example policy in the modal
Screenshot 2023-09-27 at 5 39 23 PM

@@ -23,11 +23,24 @@
</div>
{{/if}}
<div class="field">
{{#if @model.isNew}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

policy-old

<label class="has-text-weight-bold">Policy</label>
<ToolbarActions>
<div class="toolbar-separator"></div>
<Toolbar>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

policy-new

{{else}}
{{! EDITING - no file upload toggle}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to render another JsonEditor, the only difference between create/edit is create has a file upload toggle and edit renders a copy button

@@ -15,14 +15,12 @@
</div>
<div class="header-right">
{{#if this.hasCsvData}}
<button
<Hds::Button
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-09-27 at 5 41 54 PM

{{#if this.showCSVDownloadModal}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-09-27 at 5 42 15 PM

@@ -91,41 +89,40 @@
</div>

{{! MODAL FOR CSV DOWNLOAD }}
<Modal
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-09-27 at 5 42 29 PM

@@ -128,26 +110,26 @@
</div>
</div>
</form>
{{! SAMPLE POLICY MODAL. Only renders modal if not already in create policy modal }}
{{#if @renderPolicyExampleModal}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this arg is only used to hide/show the Modal toggle button in the toolbar above

@@ -47,47 +47,34 @@
</div>
</form>

<Modal
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-09-27 at 1 08 35 PM

</button>
</footer>
</Modal>
{{#if this.modalOpen}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-09-27 at 1 09 17 PM

@@ -29,6 +29,15 @@
Scope
</h1>
</p.levelLeft>
<p.levelRight>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Design recommended moving the button to the header (before it was an inline link below the JsonEditor)

There's a polish task to do the same for the policy form, but the header is in the route file which makes this change outside the scope of this PR - so it's in the Json editor toolbar for now.

Screenshot 2023-09-27 at 5 52 48 PM

>
<section class="modal-card-body">
<div class="is-flex-between is-flex-center has-bottom-margin-s">
{{#if this.showTemplateModal}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-09-27 at 5 56 29 PM

<p data-test-modal-text>
Example of a JSON template for scopes:
</p>
<Hds::Copy::Button
Copy link
Contributor Author

@hellobontempo hellobontempo Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this copy button and removed @showToolbar={{false}} from the JsonEditor to align with the other places we use the JsonEditor to render sample templates

@@ -78,40 +80,25 @@
{{/if}}
</form>

<Modal
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

styling changes are intentional, the floating copy button (with no toolbar) was anti-pattern
Screenshot 2023-09-27 at 5 59 16 PM

@github-actions
Copy link

github-actions bot commented Sep 28, 2023

Build Results:
Build failed for these jobs: test:failure. Please refer to this workflow to learn more: https://github.com/hashicorp/vault/actions/runs/6342623940

@@ -53,14 +53,12 @@
{{/if}}
{{#if this.capabilities.canUpdate}}
{{#if (gt this.model.allowed_roles.length 0)}}
<button
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-09-27 at 6 38 43 PM Screenshot 2023-09-27 at 6 38 49 PM

>
Edit transformation
</button>
<Hds::Button
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-09-27 at 6 39 00 PM Screenshot 2023-09-27 at 6 39 10 PM

@@ -96,30 +95,27 @@
<MessageError @model={{this.model}} @errorMessage={{this.error}} />
</ConfirmationModal>

<Modal
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-09-27 at 6 41 41 PM

{{#if this.isEditModalActive}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-09-27 at 6 41 27 PM

@@ -386,3 +386,17 @@ a.button.disabled {
}
}
}

.hds-button {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing the same thing as we did for copy button, making new classes to match structure. When we remove finally .button class we can audit these with design

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so this is to preserve the existing styling but ultimately we will want consistent HDS styling once the button component is adopted and this can be removed? If so a comment might be helpful just so it's easy to spot when it comes time to remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep - there's a comment for this section above the .hds-copy-button class changes. I can add another here

Copy link
Contributor

@zofskeez zofskeez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the screenshots they were helpful! LGTM but it might be a good idea to get another set of eyes. The diff view was a bit tough to compare at times.

@@ -386,3 +386,17 @@ a.button.disabled {
}
}
}

.hds-button {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so this is to preserve the existing styling but ultimately we will want consistent HDS styling once the button component is adopted and this can be removed? If so a comment might be helpful just so it's easy to spot when it comes time to remove.

@hellobontempo
Copy link
Contributor Author

Thanks for the screenshots they were helpful! LGTM but it might be a good idea to get another set of eyes. The diff view was a bit tough to compare at times.

Yeah - wrapping the new modals in conditionals really bonks up the diff 🥲

@@ -64,7 +64,6 @@ module('Integration | Component | client count config', function (hooks) {
this.createModel('disable');

await render(hbs`
<div id="modal-wormhole"></div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was talked about in one of the threads in our channel, but I can't seem to remember. With the adoption of hds modals, will all the modal-wormhole be removed in tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! Modals are renders in place, inside a conditional, so there's no "other" location for them! I was going to remove these divs all at the end, but figured if I'm updating tests I might as well remove them as I go

Copy link
Contributor

@kiannaquach kiannaquach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your pr also lgtm and the modals look sooo good!!! Thanks for tackling this Claire!

@hellobontempo hellobontempo merged commit fc7ded2 into ui/VAULT-17315-hds-adoption-replace-Modal Sep 28, 2023
54 of 56 checks passed
@hellobontempo hellobontempo deleted the ui/VAULT-20438/part-1-modal branch September 28, 2023 18:24
hellobontempo added a commit that referenced this pull request Oct 6, 2023
* UI: Part 1 - hds adoption replace <Modal> (#23363)

* replace policy-form modal

* replace clients/attribution modal

* clients/config modal

* scope form odal

* remove button type

* include toolbar to match other example templates

* rotate credentials modal

* add toolbar button class for hds buttons

* transformation-edit modal

* add back test selector

* add route arg to button!

* update link status

* fix link-status tests

* remove prevent default

* update db tests

* update tests

* use page alert for hcp link status banner

* fix scopy button selector

* fix sidebar test

* change to neutral banner

* UI: Part 2 - hds adoption replace <Modal>  (#23398)

* upgrade HDS library (adds support for snippet containers

* cleanup flight icons

* replace transit key action modals

* re-add deps as devDeps

* remove line

* address transit tests

* UI: Part 3 - hds adoption replace <Modal> (#23415)

* cleanup css

* cleanup extra type attr

* masked input download modal

* use Hds::Button in  download button"

* fix size of modal

* tiny icon fix

* refactor download button to always render download icon

* update tests

* UI: Part 3.5 - hds adoption replace <Modal> (#23448)

* replication-promote modal

* replication component modals

* replication add secondary modal

* move update text for diff

* UI: Part 4 - hds adoption replace <Modal>  (#23451)

* k8 configure modal

* kv delete modal

* ldap modals

* pki modals

* add trash icon

* move deps

* UI: Part 5 - hds adoption replace <Modal> (#23471)

* replace confirmation modals
---------

* UI: Part 6 - hds adoption replace <Modal>  (#23484)

* search select with modal

* policy search select modal

* replace date dropdown for client dashboard

* change padding to top

* update policy example args

* lolllll test typo wow

* update dropdown tests

* shamir flow modals!

* add one more container

* update test selectors

* UI: Final hds adoption replace <Modal> cleanup PR (#23522)

* search select with modal

* policy search select modal

* replace date dropdown for client dashboard

* change padding to top

* update policy example args

* lolllll test typo wow

* update dropdown tests

* shamir flow modals!

* add one more container

* update test selectors

* remove wormhole and modal component

* fix selectors

* uninstall wormhole

* remove shamir-modal-flow class

* fix confirm modal test

* fix pki and kv test

* fix toolbar selector kv

* client and download button test

* fix-confirmation-modal-padding

* fix replication modal tests so relevant modal opens (#23540)

* more confirmation modal tests

* adds changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants