Simpler list item rows

- Makes list items flush with sides, expands into gutter on hover
- Makes unclickable row items more distinguishable
This commit is contained in:
Joshua Ogle 2018-07-10 07:55:28 -06:00
parent 20faa2164c
commit 62adf73bcf
23 changed files with 128 additions and 112 deletions

View File

@ -1,10 +1,10 @@
import Ember from 'ember'; import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile'; import hbs from 'htmlbars-inline-precompile';
let LinkedBlockComponent = Ember.Component.extend({ let ListItemRowComponent = Ember.Component.extend({
layout: hbs`{{yield}}`, layout: hbs`{{yield}}`,
classNames: 'linked-block', classNames: 'list-item-row',
routing: Ember.inject.service('-routing'), routing: Ember.inject.service('-routing'),
queryParams: null, queryParams: null,
@ -28,8 +28,8 @@ let LinkedBlockComponent = Ember.Component.extend({
}, },
}); });
LinkedBlockComponent.reopenClass({ ListItemRowComponent.reopenClass({
positionalParams: 'params', positionalParams: 'params',
}); });
export default LinkedBlockComponent; export default ListItemRowComponent;

View File

@ -8,7 +8,7 @@ label.box-label {
@extend .is-gapless; @extend .is-gapless;
border-color: $grey-light; border-color: $grey-light;
border-radius: 3px; border-radius: 3px;
box-shadow: $box-link-shadow, $box-shadow-middle; box-shadow: $box-link-shadow;
text-decoration: none; text-decoration: none;
transition: box-shadow $speed; transition: box-shadow $speed;
width: 100%; width: 100%;

View File

@ -1,16 +0,0 @@
.linked-block {
cursor: pointer;
transition: box-shadow $speed;
will-change: box-shadow;
&:hover,
&:focus,
&:active {
position: relative;
box-shadow: 0 2px 0 -1px $grey-light, 0 -2px 0 -1px $grey-light, $box-link-hover-shadow, $box-shadow-middle;
}
}
.linked-block .columns {
@extend .is-flex-center;
}

View File

@ -0,0 +1,28 @@
.list-item-row {
@extend .box;
@extend .is-sideless;
@extend .is-marginless;
padding-left: 0;
padding-right: 0;
&.is-selectable {
cursor: pointer;
transition: box-shadow $speed, margin $speed, padding $speed;
will-change: box-shadow, margin, padding;
&:hover,
&:focus,
&:active {
margin-left: #{-$column-gap} !important;
margin-right: #{-$column-gap} !important;
padding-left: $column-gap;
padding-right: $column-gap;
position: relative;
box-shadow: 0 2px 0 -1px $grey-light, 0 -2px 0 -1px $grey-light, $box-link-hover-shadow, $box-shadow-middle;
}
}
}
.list-item-row .columns {
@extend .is-flex-center;
}

View File

@ -55,7 +55,7 @@
@import "./components/init-illustration"; @import "./components/init-illustration";
@import "./components/info-table-row"; @import "./components/info-table-row";
@import "./components/input-hint"; @import "./components/input-hint";
@import "./components/linked-block"; @import "./components/list-item-row";
@import "./components/list-pagination"; @import "./components/list-pagination";
@import "./components/loader"; @import "./components/loader";
@import "./components/login-form"; @import "./components/login-form";

View File

@ -77,7 +77,7 @@ $menu-item-hover-background-color: $grey-lightest;
$menu-item-active-color: $link; $menu-item-active-color: $link;
$menu-item-active-background-color: transparent; $menu-item-active-background-color: transparent;
$box-link-shadow: 0 0 0 1px $grey-light; $box-link-shadow: 0 0 0 1px $ui-gray-200;
$box-link-hover-shadow: 0 0 0 1px $grey-light; $box-link-hover-shadow: 0 0 0 1px $grey-light;
// animations // animations

View File

@ -17,6 +17,7 @@ $vault-gray-dark: $vault-gray-700;
// UI Gray // UI Gray
$ui-gray-050: #F7F8FA; $ui-gray-050: #F7F8FA;
$ui-gray-100: #EBEEF2; $ui-gray-100: #EBEEF2;
$ui-gray-200: #DCE0E6;
$ui-gray-300: #BAC1CC; $ui-gray-300: #BAC1CC;
$ui-gray-500: #6a7786; $ui-gray-500: #6a7786;
$ui-gray-700: #525761; $ui-gray-700: #525761;

View File

@ -1,9 +1,9 @@
{{#each (if model.alias.id (array model.alias) model.aliases) as |item|}} {{#each (if model.alias.id (array model.alias) model.aliases) as |item|}}
{{#linked-block {{#list-item-row
"vault.cluster.access.identity.aliases.show" "vault.cluster.access.identity.aliases.show"
item.id item.id
"details" "details"
class="box is-sideless is-marginless" class="is-selectable"
}} }}
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
@ -26,7 +26,7 @@
{{identity/popup-alias params=(array item)}} {{identity/popup-alias params=(array item)}}
</div> </div>
</div> </div>
{{/linked-block}} {{/list-item-row}}
{{else}} {{else}}
<div class="box is-bottomless has-background-white-bis"> <div class="box is-bottomless has-background-white-bis">
<div class="columns is-centered"> <div class="columns is-centered">

View File

@ -1,7 +1,7 @@
{{#if model.groupIds}} {{#if model.groupIds}}
{{#each model.directGroupIds as |gid|}} {{#each model.directGroupIds as |gid|}}
<a href={{href-to "vault.cluster.access.identity.show" "groups" gid "details" }} <a href={{href-to "vault.cluster.access.identity.show" "groups" gid "details" }}
class="box is-sideless is-marginless" class="list-item-row is-selectable"
>{{i-con >{{i-con
glyph='folder' glyph='folder'
size=14 size=14
@ -9,19 +9,20 @@
}}{{gid}}</a> }}{{gid}}</a>
{{/each}} {{/each}}
{{#each model.inheritedGroupIds as |gid|}} {{#each model.inheritedGroupIds as |gid|}}
{{#linked-block {{#list-item-row
"vault.cluster.access.identity.show" "groups" gid "details" "vault.cluster.access.identity.show" "groups" gid "details"
class="box is-sideless is-marginless" class="list-item-row is-selectable"
}} }}
<a href={{href-to "vault.cluster.access.identity.show" "groups" gid "details" }} <a href={{href-to "vault.cluster.access.identity.show" "groups" gid "details" }}
class="has-text-black" class="has-text-black"
>{{i-con >{{i-con
glyph='folder' glyph='folder'
size=14 size=14
class="has-text-grey-light" class="has-text-grey-light"
}}{{gid}}</a> }}{{gid}}
</a>
<span class="tag has-text-grey is-size-8">inherited</span> <span class="tag has-text-grey is-size-8">inherited</span>
{{/linked-block}} {{/list-item-row}}
{{/each}} {{/each}}
{{else}} {{else}}
<div class="box is-bottomless has-background-white-bis"> <div class="box is-bottomless has-background-white-bis">

View File

@ -1,38 +1,37 @@
{{#if model.hasMembers}} {{#if model.hasMembers}}
{{#each model.memberGroupIds as |gid|}} {{#each model.memberGroupIds as |gid|}}
{{#list-item-row
{{#linked-block
"vault.cluster.access.identity.show"
"groups"
gid
details
class="box is-sideless is-marginless"
}}
<div class="columns is-mobile">
<div class="column is-10">
<a href={{href-to "vault.cluster.access.identity.show" "groups" gid "details" }}
class="is-block has-text-black has-text-weight-semibold"
>{{i-con
glyph='folder'
size=14
class="has-text-grey-light"
}}{{gid}}</a>
</div>
<div class="column has-text-right">
{{#if model.canEdit}}
{{identity/popup-members params=(array model "memberGroupIds" gid)}}
{{/if}}
</div>
</div>
{{/linked-block}}
{{/each}}
{{#each model.memberEntityIds as |gid|}}
{{#linked-block
"vault.cluster.access.identity.show" "vault.cluster.access.identity.show"
"groups" "groups"
gid gid
details details
class="box is-sideless is-marginless" class="is-selectable"
}}
<div class="columns is-mobile">
<div class="column is-10">
<a href={{href-to "vault.cluster.access.identity.show" "groups" gid "details" }}
class="is-block has-text-black has-text-weight-semibold"
>{{i-con
glyph='folder'
size=14
class="has-text-grey-light"
}}{{gid}}</a>
</div>
<div class="column has-text-right">
{{#if model.canEdit}}
{{identity/popup-members params=(array model "memberGroupIds" gid)}}
{{/if}}
</div>
</div>
{{/list-item-row}}
{{/each}}
{{#each model.memberEntityIds as |gid|}}
{{#list-item-row
"vault.cluster.access.identity.show"
"groups"
gid
details
class="is-selectable"
}} }}
<div class="columns"> <div class="columns">
<div class="column is-10"> <div class="column is-10">
@ -50,7 +49,7 @@
{{/if}} {{/if}}
</div> </div>
</div> </div>
{{/linked-block}} {{/list-item-row}}
{{/each}} {{/each}}
{{else}} {{else}}
<div class="box is-bottomless has-background-white-bis"> <div class="box is-bottomless has-background-white-bis">

View File

@ -1,11 +1,11 @@
{{#if model.parentGroupIds.length}} {{#if model.parentGroupIds.length}}
{{#each model.parentGroupIds as |gid|}} {{#each model.parentGroupIds as |gid|}}
{{#linked-block {{#list-item-row
"vault.cluster.access.identity.show" "vault.cluster.access.identity.show"
"groups" "groups"
gid gid
details details
class="box is-sideless is-marginless" class="is-selectable"
}} }}
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
@ -20,7 +20,7 @@
<div class="column has-text-right"> <div class="column has-text-right">
</div> </div>
</div> </div>
{{/linked-block}} {{/list-item-row}}
{{/each}} {{/each}}
{{else}} {{else}}
<div class="box is-bottomless has-background-white-bis"> <div class="box is-bottomless has-background-white-bis">

View File

@ -1,9 +1,9 @@
{{#each model.policies as |policyName|}} {{#each model.policies as |policyName|}}
{{#linked-block {{#list-item-row
"vault.cluster.policy.show" "vault.cluster.policy.show"
"acl" "acl"
item item
class="box is-sideless is-marginless" class="is-selectable"
}} }}
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
@ -18,7 +18,7 @@
{{/if}} {{/if}}
</div> </div>
</div> </div>
{{/linked-block}} {{/list-item-row}}
{{else}} {{else}}
<div class="box is-bottomless has-background-white-bis"> <div class="box is-bottomless has-background-white-bis">
<div class="columns is-centered"> <div class="columns is-centered">
@ -32,4 +32,3 @@
</div> </div>
</div> </div>
{{/each}} {{/each}}

View File

@ -1,11 +1,11 @@
{{#linked-block {{#list-item-row
(concat (concat
"vault.cluster.secrets.backend." "vault.cluster.secrets.backend."
"credentials" "credentials"
(if (not item.id) "-root") (if (not item.id) "-root")
) )
item.id item.id
class="box is-sideless is-marginless" class="is-selectable"
data-test-secret-link=item.id data-test-secret-link=item.id
}} }}
<div class="columns is-mobile"> <div class="columns is-mobile">
@ -33,5 +33,4 @@
{{partial 'partials/role-aws/popup-menu'}} {{partial 'partials/role-aws/popup-menu'}}
</div> </div>
</div> </div>
{{/linked-block}} {{/list-item-row}}

View File

@ -1,11 +1,11 @@
{{#linked-block {{#list-item-row
(concat (concat
"vault.cluster.secrets.backend." "vault.cluster.secrets.backend."
(if item.isFolder "list" "show") (if item.isFolder "list" "show")
(if (not item.id) "-root") (if (not item.id) "-root")
) )
item.id item.id
class="box is-sideless is-marginless" class="is-selectable"
data-test-secret-link=item.id data-test-secret-link=item.id
}} }}
<div class="columns is-mobile"> <div class="columns is-mobile">
@ -25,4 +25,4 @@
<div class="column has-text-right"> <div class="column has-text-right">
</div> </div>
</div> </div>
{{/linked-block}} {{/list-item-row}}

View File

@ -1,11 +1,11 @@
{{#linked-block {{#list-item-row
(concat (concat
"vault.cluster.secrets.backend." "vault.cluster.secrets.backend."
"show" "show"
(if (not item.id) "-root") (if (not item.id) "-root")
) )
item.idForNav item.idForNav
class="box is-sideless is-marginless linked-block" class="is-selectable"
data-test-secret-link=item.id data-test-secret-link=item.id
tagName="div" tagName="div"
}} }}
@ -34,4 +34,4 @@
{{pki-cert-popup item=item}} {{pki-cert-popup item=item}}
</div> </div>
</div> </div>
{{/linked-block}} {{/list-item-row}}

View File

@ -1,4 +1,4 @@
{{#linked-block {{#list-item-row
(concat (concat
"vault.cluster.secrets.backend." "vault.cluster.secrets.backend."
"credentials" "credentials"
@ -7,7 +7,7 @@
item.backend item.backend
item.id item.id
queryParams=(hash action="issue") queryParams=(hash action="issue")
class="box is-sideless is-marginless" class="is-selectable"
data-test-secret-link=item.id data-test-secret-link=item.id
tagName="div" tagName="div"
}} }}
@ -37,4 +37,4 @@
{{partial "partials/role-pki/popup-menu"}} {{partial "partials/role-pki/popup-menu"}}
</div> </div>
</div> </div>
{{/linked-block}} {{/list-item-row}}

View File

@ -1,11 +1,11 @@
{{#linked-block {{#list-item-row
(concat (concat
"vault.cluster.secrets.backend." "vault.cluster.secrets.backend."
(if (eq item.keyType "ca") "sign" "credentials") (if (eq item.keyType "ca") "sign" "credentials")
(if (not item.id) "-root") (if (not item.id) "-root")
) )
item.id item.id
class="box is-sideless is-marginless" class="is-selectable"
data-test-secret-link=item.id data-test-secret-link=item.id
}} }}
<div class="columns is-mobile"> <div class="columns is-mobile">
@ -40,5 +40,4 @@
{{/if}} {{/if}}
</div> </div>
</div> </div>
{{/linked-block}} {{/list-item-row}}

View File

@ -1,11 +1,11 @@
{{identity/entity-nav identityType=identityType}} {{identity/entity-nav identityType=identityType}}
{{#if model.meta.total}} {{#if model.meta.total}}
{{#each model as |item|}} {{#each model as |item|}}
{{#linked-block {{#list-item-row
"vault.cluster.access.identity.aliases.show" "vault.cluster.access.identity.aliases.show"
item.id item.id
"details" "details"
class="box is-sideless is-marginless" class="is-selectable"
data-test-identity-row=true data-test-identity-row=true
}} }}
<div class="columns is-mobile"> <div class="columns is-mobile">
@ -34,7 +34,7 @@
{{identity/popup-alias params=(array item) onSuccess=(action "onDelete")}} {{identity/popup-alias params=(array item) onSuccess=(action "onDelete")}}
</div> </div>
</div> </div>
{{/linked-block}} {{/list-item-row}}
{{/each}} {{/each}}
{{else}} {{else}}
<div class="box is-bottomless has-background-white-bis"> <div class="box is-bottomless has-background-white-bis">

View File

@ -1,11 +1,11 @@
{{identity/entity-nav identityType=identityType}} {{identity/entity-nav identityType=identityType}}
{{#if model.meta.total}} {{#if model.meta.total}}
{{#each model as |item|}} {{#each model as |item|}}
{{#linked-block {{#list-item-row
"vault.cluster.access.identity.show" "vault.cluster.access.identity.show"
item.id item.id
"details" "details"
class="box is-sideless is-marginless" class="is-selectable"
data-test-identity-row=true data-test-identity-row=true
}} }}
<div class="columns is-mobile"> <div class="columns is-mobile">
@ -105,7 +105,7 @@
{{/popup-menu}} {{/popup-menu}}
</div> </div>
</div> </div>
{{/linked-block}} {{/list-item-row}}
{{/each}} {{/each}}
{{else}} {{else}}
<div class="box is-bottomless has-background-white-bis"> <div class="box is-bottomless has-background-white-bis">

View File

@ -99,7 +99,7 @@
(if item.isFolder "vault.cluster.access.leases.list" "vault.cluster.access.leases.show") (if item.isFolder "vault.cluster.access.leases.list" "vault.cluster.access.leases.show")
item.id item.id
}}" }}"
class="is-flex box is-sideless is-marginless" class="list-item-row is-selectable"
data-test-lease-link={{item.id}} data-test-lease-link={{item.id}}
> >
{{i-con {{i-con

View File

@ -14,13 +14,16 @@
{{#each (sort-by "path" model) as |method|}} {{#each (sort-by "path" model) as |method|}}
<div <div
class="box is-sideless is-marginless" class="list-item-row"
data-test-auth-backend-link={{method.id}} data-test-auth-backend-link={{method.id}}
> >
<div class="level is-mobile"> <div class="level is-mobile">
<div class="level-left"> <div class="level-left">
<div> <div>
{{i-con glyph="folder" size=14 class="has-text-grey-light"}} <span data-test-path data-test-id={{method.id}}>{{method.path}}</span> {{i-con glyph="folder" size=14 class="has-text-grey-light"}}
<span data-test-path data-test-id={{method.id}} class="has-text-weight-semibold has-text-grey">
{{method.path}}
</span>
<br /> <br />
<span class="tag"> <span class="tag">
{{#if (eq method.type 'plugin')}} {{#if (eq method.type 'plugin')}}

View File

@ -48,25 +48,28 @@
{{#if model.meta.total}} {{#if model.meta.total}}
{{#each model as |item|}} {{#each model as |item|}}
{{#if (eq item.id "root")}} {{#if (eq item.id "root")}}
<div class="is-flex box is-sideless is-marginless" data-test-policy-item> <div class="list-item-row is-flex" data-test-policy-item>
{{i-con {{i-con
glyph='file' glyph='file'
size=14 size=14
class="has-text-grey-light" class="has-text-grey-light"
}} }}
<div> <div>
<span class="has-text-weight-semibold" data-test-policy-name>{{item.id}}</span> <span class="has-text-weight-semibold has-text-grey" data-test-policy-name>
{{item.id}}
</span>
<p class="help has-text-grey"> <p class="help has-text-grey">
The <code>root</code> policy does not contain any rules but can do anything within Vault. It should be used with extreme care. The <code>root</code> policy does not contain any rules but can
do anything within Vault. It should be used with extreme care.
</p> </p>
</div> </div>
</div> </div>
{{else}} {{else}}
{{#linked-block {{#list-item-row
"vault.cluster.policy.show" "vault.cluster.policy.show"
policyType policyType
item.id item.id
class="box is-sideless is-marginless" class="is-selectable"
data-test-policy-link=item.id data-test-policy-link=item.id
}} }}
<div class="columns is-mobile"> <div class="columns is-mobile">
@ -135,7 +138,7 @@
{{/popup-menu}} {{/popup-menu}}
</div> </div>
</div> </div>
{{/linked-block}} {{/list-item-row}}
{{/if}} {{/if}}
{{else}} {{else}}
<div class="box is-sideless"> <div class="box is-sideless">

View File

@ -13,10 +13,10 @@
</PageHeader> </PageHeader>
{{#each supportedBackends as |backend|}} {{#each supportedBackends as |backend|}}
{{#linked-block {{#list-item-row
"vault.cluster.secrets.backend.list-root" "vault.cluster.secrets.backend.list-root"
backend.id backend.id
class="box is-sideless is-marginless has-pointer" class="is-selectable"
data-test-secret-backend-row=backend.id data-test-secret-backend-row=backend.id
}} }}
<div class="level is-mobile"> <div class="level is-mobile">
@ -65,16 +65,16 @@
</div> </div>
</div> </div>
</div> </div>
{{/linked-block}} {{/list-item-row}}
{{/each}} {{/each}}
{{#each unsupportedBackends as |backend|}} {{#each unsupportedBackends as |backend|}}
<div class="box is-sideless is-marginless" <div class="list-item-row"
data-test-secret-backend-row={{backend.id}} data-test-secret-backend-row={{backend.id}}
> >
<div class="level is-mobile"> <div class="level is-mobile">
<div class="level-left"> <div class="level-left">
<div> <div>
<div data-test-secret-path class="has-text-weight-semibold"> <div data-test-secret-path class="has-text-weight-semibold has-text-grey">
{{i-con glyph="folder" size=14 class="has-text-grey-light"}} {{backend.path}} {{i-con glyph="folder" size=14 class="has-text-grey-light"}} {{backend.path}}
</div> </div>
<span class="tag"> <span class="tag">