ui: Reorganize Tabs CSS (#9313)

This commit is contained in:
John Cowen 2020-12-02 15:48:06 +00:00 committed by GitHub
parent a814338374
commit 89a70502e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 14 additions and 55 deletions

View File

@ -1,5 +1,16 @@
@import './skin';
@import './layout';
.tab-nav {
@extend %tab-nav;
}
%tab-nav.animatable {
@extend %with-animated-tab-selection;
}
.tab-section {
@extend %tab-section;
/* this keeps in-tab-section toolbars flush to the top, see Node Detail > Services */
margin-top: 0 !important;
}
%with-animated-tab-selection ul::after,
%tab-button-selected {
@extend %frame-brand-300;

View File

@ -1,5 +1,6 @@
%tab-nav {
clear: both;
overflow: scroll;
}
%tab-nav ul {
display: inline-flex;

View File

@ -1,4 +0,0 @@
<input onchange={{action onchange}} type="radio" name="radiogroup_{{name}}" id="radiogroup_{{name}}_{{slugify id}}" value={{id}} checked={{if selected 'checked'}} />
<div role="tabpanel" id="radiogroup_{{name}}_{{id}}_panel">
{{yield}}
</div>

View File

@ -1,11 +0,0 @@
import Component from '@ember/component';
import { computed } from '@ember/object';
export default Component.extend({
classNames: ['tab-section'],
'data-test-radiobutton': computed('name,id', function() {
return `${this.name}_${this.id}`;
}),
name: 'tab',
onchange: function() {},
});

View File

@ -11,5 +11,4 @@
@import './radio-group/index';
@import './sliding-toggle/index';
@import './table/index';
@import './tabs/index';
@import './toggle-button/index';

View File

@ -14,7 +14,6 @@
@import './components/buttons';
@import './components/composite-row';
@import './components/secret-button';
@import './components/tabs';
@import './components/pill';
@import './components/table';
@import './components/tag-list';
@ -53,6 +52,7 @@
@import 'consul-ui/components/filter-bar';
@import 'consul-ui/components/freetext-filter';
@import 'consul-ui/components/informed-action';
@import 'consul-ui/components/tab-nav';
@import 'consul-ui/components/consul/tomography/graph';
@import 'consul-ui/components/consul/discovery-chain';

View File

@ -1,11 +0,0 @@
.tab-nav {
@extend %tab-nav;
}
%tab-nav.animatable {
@extend %with-animated-tab-selection;
}
.tab-section {
@extend %tab-section;
/* this keeps in-tab-section toolbars flush to the top, see Node Detail > Services */
margin-top: 0 !important;
}

View File

@ -1,4 +1,4 @@
<div id="tags" class="tab-section">
<div id="topology" class="tab-section">
<div role="tabpanel">
{{#if topology.FilteredByACLs}}
<TopologyMetrics::Notice::LimitedAccess />

View File

@ -1,26 +0,0 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | tab section', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
await render(hbs`{{tab-section}}`);
assert.dom('*').hasText('');
// Template block usage:
await render(hbs`
{{#tab-section}}
template block text
{{/tab-section}}
`);
assert.dom('*').hasText('template block text');
});
});