Skip to content

Commit

Permalink
Merge pull request #951 from carloslancha/issue-899-add-label-to-mana…
Browse files Browse the repository at this point in the history
…gement-checkbox

Add label to checkbox on Management Toolbar | Fixes #899
  • Loading branch information
matuzalemsteles authored May 29, 2018
2 parents 0964626 + c69abcd commit 8e81163
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 1 deletion.
16 changes: 16 additions & 0 deletions packages/clay-management-toolbar/demos/a11y.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ <h4>Without Search</h4>
</div>
</div>

<div class="row row-spacing">
<div class="col">
<h4>Without Filters, Sorting and Search</h4>
<div id="without-filter-sorting-search-block"></div>
</div>
</div>

<div class="row row-spacing">
<div class="col">
<h4>With search results bar</h4>
Expand Down Expand Up @@ -486,6 +493,15 @@ <h4>With search results bar with active state</h4>
},
'#without-search-block');

//Without Filters, Sorting and Search
new metal.ClayManagementToolbar({
showSearch: false,
selectable: true,
spritemap: spritemap,
viewTypes: viewTypes,
},
'#without-filter-sorting-search-block');

//With search results bar
new metal.ClayManagementToolbar({
creationMenu: true,
Expand Down
16 changes: 16 additions & 0 deletions packages/clay-management-toolbar/demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ <h4>Without Search</h4>
</div>
</div>

<div class="row row-spacing">
<div class="col">
<h4>Without Filters, Sorting and Search</h4>
<div id="without-filter-sorting-search-block"></div>
</div>
</div>

<div class="row row-spacing">
<div class="col">
<h4>With search results bar</h4>
Expand Down Expand Up @@ -560,6 +567,15 @@ <h4>With search results bar with active state</h4>
},
'#without-search-block');

//Without Filters, Sorting and Search
new metal.ClayManagementToolbar({
showSearch: false,
selectable: true,
spritemap: spritemap,
viewTypes: viewTypes,
},
'#without-filter-sorting-search-block');

//With search results bar
new metal.ClayManagementToolbar({
events: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@
{/param}

{param ref: 'selectPageCheckbox' /}
{param showLabel: false /}
{param showLabel: not $filterItems and not $sortingOrder and not $showSearch /}
{/call}
</li>
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ describe('ClayManagementToolbar', function() {
expect(managementToolbar).toMatchSnapshot();
});

it('should render a management toolbar with selection enabled and no filters, sorting and search', () => {
managementToolbar = new ClayManagementToolbar({
selectable: true,
showSearch: false,
spritemap: spritemap,
});

expect(managementToolbar).toMatchSnapshot();
});

it('should render a management toolbar with ascending sorting', () => {
managementToolbar = new ClayManagementToolbar({
sortingOrder: 'asc',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2181,6 +2181,37 @@ exports[`ClayManagementToolbar should render a management toolbar with selection
</div>
`;

exports[`ClayManagementToolbar should render a management toolbar with selection enabled and no filters, sorting and search 1`] = `
<div>
<nav class="management-bar management-bar-light navbar navbar-expand-md">
<div class="container-fluid container-fluid-max-xl">
<ul class="navbar-nav">
<li class="nav-item">
<div class="custom-control custom-checkbox">
<label>
<input class="custom-control-input" ref="input" type="checkbox">
<span class="custom-control-label">
<span class="custom-control-label-text">select-page</span>
</span>
</label>
</div>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item">
<button class="btn nav-btn nav-btn-monospaced btn-primary" aria-label="plus" type="button">
<svg aria-hidden="true" class="lexicon-icon lexicon-icon-plus" focusable="false">
<title>plus</title>
<use xlink:href="../node_modules/clay-css/lib/images/icons/icons.svg#plus"></use>
</svg>
</button>
</li>
</ul>
</div>
</nav>
</div>
`;

exports[`ClayManagementToolbar should render a management toolbar with sorting href 1`] = `
<div>
<nav class="management-bar management-bar-light navbar navbar-expand-md">
Expand Down

0 comments on commit 8e81163

Please sign in to comment.