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: Add Toolbar #6626

Merged
merged 14 commits into from May 10, 2019
Merged

UI: Add Toolbar #6626

merged 14 commits into from May 10, 2019

Conversation

joshuaogle
Copy link
Contributor

This PR consolidates many of the actions across the Vault UI within a toolbar.

Simple example

Here you can see we move the page-level actions below the tabs, which also gives us an opportunity to remove the line between the page title and the tabs, which cleans up the page quite a bit.

Before:
image

After:
image


Complicated example

This example highlights what a big problem we had. The toolbar component comes with clear rules from our Design System, and helps make sense of the many actions on this page.

Before:
image

After:
image


Not in this PR

The confirm-action component has been redesigned to work (and look) better in Toolbars, but that redesign is not included in this PR. It looks a little ridiculous for the moment.

image

This PR also does not add these Toolbar components to the Storybook yet. Since there are several new components, they will need a fair amount of documentation about how they fit together. We plan to add them in a follow-up PR.

@joshuaogle joshuaogle requested a review from a team April 22, 2019 21:18

&:hover,
&:active {
border-color: $grey-light;
}

&:hover {
background-color: $ui-gray-050;
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 hover state has been a part of the design system for a while but hadn't been updated yet in Vault

@@ -1,5 +1,5 @@
<form {{action (perform lookup) on="submit"}}>
<div class="field has-addons">
<div class="field is-flex">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Better for how the Toolbar handles small screens

@@ -22,6 +22,7 @@ module('Acceptance | secrets/pki/list', function(hooks) {
await mountAndNav(assert);
assert.equal(currentRouteName(), 'vault.cluster.secrets.backend.list-root', 'redirects from the index');
assert.ok(page.createIsPresent, 'create button is present');
await click('[data-test-configuration-tab]');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added these because the Configure link is now only shown when you are viewing the Configuration tab

ui/app/components/toolbar-download-button.js Show resolved Hide resolved
@@ -1,20 +1,17 @@
{{#if (eq selectedAction 'rotate')}}
{{#if key.canRotate}}
<div class="field is-grouped is-grouped-split box is-fullwidth is-bottomless">
Copy link
Contributor

Choose a reason for hiding this comment

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

👏 for removing this!

Copy link
Contributor

@meirish meirish left a comment

Choose a reason for hiding this comment

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

This is awesome! I left some inline comments / suggestions - let me know and I can help implement them!

I also had a few questions about design - I saw we're using the + icon some places and the > other places, is there any rule for that? I guess the one place it felt weird was enable engine had a + and enable auth method had a > - I would expect those to be the same. (This feels kinda like the create vs. add discussion we had a while back).

Did we want a toolbar on top of the Policy code mirror when you're creating a new policy?
Screen Shot 2019-04-24 at 10 25 07 AM

And the last one - the toolbar button components are blue instead of black in the entity and group show pages:
Screen Shot 2019-04-24 at 10 31 17 AM
Screen Shot 2019-04-24 at 10 31 30 AM

@joshuaogle
Copy link
Contributor Author

@meirish Phew! Still have one Ember question, but I think everything else is there:
✓ Switched the Toolbar components to OuterHTML
✓ Combined ToolbarButton and ToolbarAddButton, renamed to ToolbarLink
✓ Moved the Namespace picker toolbar back to where it was
✓ Moved conditional logic to SecretsListHeader controller

Here's what is still causing failing tests: The attributes being passed to the ToolbarLink and ToolbarSecretLink components are showing up on the container but are also on the link. The tests are trying to click on the container, so they can't get to the page they want to. Is there a way to stop it from putting those attributes on the container, or should I take those off of the inner template and have the tests click on [data-whatever] .toolbar-link instead?

@@ -37,6 +37,7 @@ export const GLYPHS_WITH_SVG_TAG = [
'neutral-circled-outline',
'perf-replication',
'person',
'plus-plain',
Copy link
Contributor

Choose a reason for hiding this comment

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

won't need this 🔜😂

@@ -1,3 +1,7 @@
.page-header + .tabs-container {
Copy link
Contributor

Choose a reason for hiding this comment

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

fancy + 💅!

class="input"
type="text"
/>
<Toolbar @class="toolbar-namespace-picker">
Copy link
Contributor

Choose a reason for hiding this comment

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

You shouldn't need @ on class for angle bracket components (I know we had some because of an old polyfill we were using that needed it - should be fine to use w/o it though).

<ToolbarActions>
<ToolbarLink
@params={{array "vault.cluster.access.method" model.id}}
@data-test-backend-view-link=true
Copy link
Contributor

Choose a reason for hiding this comment

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

data attributes don't need the @ those and class and others (aria-*) attributes get treated as normal HTML attributes with angle bracket syntax, they just get passed through and bound automatically - that's something you'd have to set up in curly bracket syntax

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing the @ from these instances actually does stop it from feeding through, but that may be because of how we're passing them along in the template. I was able to remove them in the ToolbarLink component, but something about the ToolbarSecretLink component still needs them there to be able to pass them along to SecretLink. Oh well, at least we cleaned it up where we could.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I bet that has to do with this being tag-less - no tag so it probably skips the binding making these just regular component attrs. Sorry for the bad info!

@@ -51,8 +51,6 @@ const OIDC_AUTH_RESPONSE = {
},
};

const WAIT_TIME = 50;
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh ha, that must've got left in somehow - I guess that means ESLint failure isn't failing the tests either... need to look at that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah, I meant to ask about that. I was just trusting that we weren't using it like the warning said, but I can put it back if we want to figure that out separately

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope, it's good that it's not there! Just should make sure ESLint is working as expected in CI.

meirish
meirish previously approved these changes May 9, 2019
Copy link
Contributor

@meirish meirish left a comment

Choose a reason for hiding this comment

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

Looks great ✨! I left a few comments, but I don't think they're blockers - I'll leave it up to you if you want to change anything!

@joshuaogle
Copy link
Contributor Author

Merging! Toolbars incoming 🔨 📊

@joshuaogle joshuaogle merged commit 8bfc86d into master May 10, 2019
@joshuaogle joshuaogle deleted the ui-toolbar branch May 10, 2019 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants