Skip to content

Commit

Permalink
Replace infoButton to showInfoButton and improve JSDOC| Fixes liferay…
Browse files Browse the repository at this point in the history
  • Loading branch information
matuzalemsteles authored and Kien Do committed Feb 21, 2018
1 parent 44135e7 commit 0121718
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/clay-management-toolbar/demos/a11y.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ <h4>Without Search</h4>
new metal.ClayManagementToolbar({
creationMenu: true,
filterItems: filterItems,
infoButton: true,
searchFormName: 'mySearchName',
searchInputName: 'mySearchInputName',
selectable: true,
showInfoButton: true,
sortingOrder: 'asc',
spritemap: spritemap,
viewTypes: viewTypes,
Expand Down
2 changes: 1 addition & 1 deletion packages/clay-management-toolbar/demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ <h4>Without Search</h4>
new metal.ClayManagementToolbar({
creationMenu: true,
filterItems: filterItems,
infoButton: true,
searchFormName: 'mySearchName',
searchInputName: 'mySearchInputName',
selectable: true,
showInfoButton: true,
sortingOrder: 'asc',
spritemap: spritemap,
viewTypes: viewTypes,
Expand Down
18 changes: 9 additions & 9 deletions packages/clay-management-toolbar/src/ClayManagementToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,6 @@ ClayManagementToolbar.STATE = {
*/
id: Config.string(),

/**
* Flag to indicate if the Info button is needed.
* @instance
* @memberof ClayManagementToolbar
* @type {?bool}
* @default false
*/
infoButton: Config.bool().value(false),

/**
* URL of the search form action
* @instance
Expand Down Expand Up @@ -303,6 +294,15 @@ ClayManagementToolbar.STATE = {
*/
selectedItems: Config.number(),

/**
* Flag to indicate if the Info button should be shown or not.
* @instance
* @memberof ClayManagementToolbar
* @type {?bool}
* @default false
*/
showInfoButton: Config.bool().value(false),

/**
* Flag to indicate if search should be shown or not.
* @instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@
]>}
{@param? hideFiltersDoneButton: bool}
{@param? id: string}
{@param? infoButton: bool}
{@param? searchActionURL: string}
{@param? searchFormName: string}
{@param? searchInputName: string}
{@param? selectable: bool}
{@param? selectedItems: number}
{@param? showInfoButton: bool}
{@param? showSearch: bool}
{@param? sortingOrder: string}
{@param? totalItems: number}
Expand Down Expand Up @@ -103,11 +103,11 @@
{param filterItems: $filterItems /}
{param hideFiltersDoneButton: $hideFiltersDoneButton /}
{param id: $id /}
{param infoButton: $infoButton /}
{param searchActionURL: $searchActionURL /}
{param searchFormName: $searchFormName /}
{param searchInputName: $searchInputName /}
{param selectable: $selectable /}
{param showInfoButton: $showInfoButton /}
{param showSearch: $showSearch != false /}
{param sortingOrder: $sortingOrder /}
{param spritemap: $spritemap /}
Expand Down Expand Up @@ -263,11 +263,11 @@
]>}
{@param? hideFiltersDoneButton: bool}
{@param? id: string}
{@param? infoButton: bool}
{@param? searchActionURL: string}
{@param? searchFormName: string}
{@param? searchInputName: string}
{@param? selectable: bool}
{@param? showInfoButton: bool}
{@param? showSearch: bool}
{@param? sortingOrder: string}
{@param? viewTypes: list<[
Expand Down Expand Up @@ -394,7 +394,7 @@
</li>
{/if}

{if $infoButton}
{if $showInfoButton}
<li class="nav-item">
{call ClayButton.render}
{param elementClasses: 'nav-link nav-link-monospaced' /}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ describe('ClayManagementToolbar', function() {
it('should render a management toolbar with info button', () => {
managementToolbar = new ClayManagementToolbar({
spritemap: spritemap,
infoButton: true,
showInfoButton: true,
});

expect(managementToolbar).toMatchSnapshot();
Expand Down Expand Up @@ -629,7 +629,7 @@ describe('ClayManagementToolbar', function() {
it('should render a management toolbar with info button and emit an event on infoButton click', () => {
managementToolbar = new ClayManagementToolbar({
spritemap: spritemap,
infoButton: true,
showInfoButton: true,
});

const spy = jest.spyOn(managementToolbar, 'emit');
Expand Down

0 comments on commit 0121718

Please sign in to comment.