ui: Fix nspace spacing issue (#10157)

This fixes the spacing bug in nspaces only by only showing Description if the namespace has one, and removing the extra 2 pixel margin of dds for when dts aren't rendered/don't exist.
This commit is contained in:
John Cowen 2021-05-10 11:19:11 +01:00 committed by GitHub
parent 255fbf1d51
commit 4fc8f93f92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

3
.changelog/10157.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
ui: Don't render a DOM element for empty namespace descriptions
```

View File

@ -14,12 +14,14 @@ as |item|>
{{/if}} {{/if}}
</BlockSlot> </BlockSlot>
<BlockSlot @name="details"> <BlockSlot @name="details">
{{#if item.Description}}
<dl> <dl>
<dt>Description</dt> <dt>Description</dt>
<dd data-test-description> <dd data-test-description>
{{item.Description}} {{item.Description}}
</dd> </dd>
</dl> </dl>
{{/if}}
{{#if (env 'CONSUL_ACLS_ENABLED')}} {{#if (env 'CONSUL_ACLS_ENABLED')}}
<Consul::Token::Ruleset::List @item={{item}} /> <Consul::Token::Ruleset::List @item={{item}} />
{{/if}} {{/if}}

View File

@ -16,14 +16,20 @@
.consul-lock-session-list ul > li:not(:first-child) { .consul-lock-session-list ul > li:not(:first-child) {
@extend %with-one-action-row; @extend %with-one-action-row;
} }
// TODO: This hides the icons-less dt's in the below lists as they don't have // TODO: This hides the iconless dt's in the below lists as they don't have
// tooltips the todo would be to wrap these texts in spans // tooltips the todo would be to wrap these texts in spans
.consul-nspace-list > ul > li:not(:first-child) dt, .consul-nspace-list > ul > li:not(:first-child) dt,
.consul-token-list > ul > li:not(:first-child) dt, .consul-token-list > ul > li:not(:first-child) dt,
.consul-policy-list > ul li:not(:first-child) dl:not(.datacenter) dt, .consul-policy-list > ul li:not(:first-child) dl:not(.datacenter) dt,
.consul-role-list > ul > li:not(:first-child) dt { .consul-role-list > ul > li:not(:first-child) dt {
@extend %iconless-dt;
}
%iconless-dt {
display: none; display: none;
} }
%iconless-dt + dd {
margin-left: 0 !important;
}
/* TODO: the service list has a 1px offset */ /* TODO: the service list has a 1px offset */
.consul-policy-list dl.datacenter dt, .consul-policy-list dl.datacenter dt,
.consul-service-list li > div:first-child > dl:first-child dd { .consul-service-list li > div:first-child > dl:first-child dd {