-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #1467 - Send useful filter label item data through components to Management Toolbar #1470
Merged
carloslancha
merged 10 commits into
liferay:develop
from
carloslancha:issue-1467-filterLabels
Jan 24, 2019
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2ad2cad
Fixes #1467 - Do not send useless data on label close button click
512cc71
Fixes #1467 - Reword jsdoc
6068bf1
Fixes #1467 - Add data property to filter label validator
9f71be1
Fixes #1467 - Send label item data on close button click thorugh comp…
69bca0d
Fixes #1467 - SF
9f6a208
Fixes #1467 - Update test
096cd82
Fixes #1467 - Regen snapshots
777a784
Fixes #1467 - Regen isomorphic snapshots
32a21cf
Fixes #1467 - SF
bdebd19
Fixes #1467 - Regen isomorphic snapshots
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
960 changes: 528 additions & 432 deletions
960
packages/clay-dataset-display/src/__tests__/__snapshots__/ClayDatasetDisplay.js.snap
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/clay-isomorphic/fixtures/expected/ClayFilterLabel.render
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<li class="tbar-item"><div class="tbar-section"><span class="label label-dismissible component-label tbar-label"><span class="label-item label-item-expand"><div class="label-section">Category: Label 3</div></span><span class="label-item label-item-after"><button class="btn close"aria-label="close"type="button"><svg class="lexicon-icon lexicon-icon-times"focusable="false"role="presentation"><use xlink:href="icons.svg#times" /></svg></button></span></span></div></li> | ||
<div ><span class="label label-dismissible component-label tbar-label"><span class="label-item label-item-expand"><div class="label-section">Category: Label 3</div></span><span class="label-item label-item-after"><button class="btn close"aria-label="close"type="button"><svg class="lexicon-icon lexicon-icon-times"focusable="false"role="presentation"><use xlink:href="icons.svg#times" /></svg></button></span></span></div> |
2 changes: 1 addition & 1 deletion
2
packages/clay-isomorphic/fixtures/expected/ClayResultsBar.filterLabels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<li class="tbar-item"><div class="tbar-section"><span class="label label-dismissible component-label tbar-label"><span class="label-item label-item-expand"><div class="label-section">Label 1</div></span><span class="label-item label-item-after"><button class="btn close"aria-label="close"type="button"><svg class="lexicon-icon lexicon-icon-times"focusable="false"role="presentation"><use xlink:href="spritemap.svg#times" /></svg></button></span></span></div></li><li class="tbar-item tbar-item-expand"><div class="tbar-section"><span class="label label-dismissible component-label tbar-label"><span class="label-item label-item-expand"><div class="label-section">Label 2</div></span><span class="label-item label-item-after"><button class="btn close"aria-label="close"type="button"><svg class="lexicon-icon lexicon-icon-times"focusable="false"role="presentation"><use xlink:href="spritemap.svg#times" /></svg></button></span></span></div></li> | ||
<li class="tbar-item"><div class="tbar-section"><div ><span class="label label-dismissible component-label tbar-label"><span class="label-item label-item-expand"><div class="label-section">Label 1</div></span><span class="label-item label-item-after"><button class="btn close"aria-label="close"type="button"><svg class="lexicon-icon lexicon-icon-times"focusable="false"role="presentation"><use xlink:href="spritemap.svg#times" /></svg></button></span></span></div></div></li><li class="tbar-item tbar-item-expand"><div class="tbar-section"><div ><span class="label label-dismissible component-label tbar-label"><span class="label-item label-item-expand"><div class="label-section">Label 2</div></span><span class="label-item label-item-after"><button class="btn close"aria-label="close"type="button"><svg class="lexicon-icon lexicon-icon-times"focusable="false"role="presentation"><use xlink:href="spritemap.svg#times" /></svg></button></span></span></div></div></li> |
2 changes: 1 addition & 1 deletion
2
packages/clay-isomorphic/fixtures/expected/ClayResultsBar.render
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<nav class="tbar tbar-inline-xs-down subnav-tbar subnav-tbar-primary"><div class="container-fluid container-fluid-max-xl"><ul class="tbar-nav tbar-nav-wrap"><li class="tbar-item"><div class="tbar-section"><span class="component-text text-truncate-inline"><span class="text-truncate">10-results-for-my search</span></span></div></li><li class="tbar-item"><div class="tbar-section"><span class="label label-dismissible component-label tbar-label"><span class="label-item label-item-expand"><div class="label-section">Label 1</div></span><span class="label-item label-item-after"><button class="btn close"aria-label="close"type="button"><svg class="lexicon-icon lexicon-icon-times"focusable="false"role="presentation"><use xlink:href="spritemap.svg#times" /></svg></button></span></span></div></li><li class="tbar-item tbar-item-expand"><div class="tbar-section"><span class="label label-dismissible component-label tbar-label"><span class="label-item label-item-expand"><div class="label-section">Label 2</div></span><span class="label-item label-item-after"><button class="btn close"aria-label="close"type="button"><svg class="lexicon-icon lexicon-icon-times"focusable="false"role="presentation"><use xlink:href="spritemap.svg#times" /></svg></button></span></span></div></li><li class="tbar-item"><div class="tbar-section"><a class=" component-link tbar-link"href="url">clear</a></div></li></ul></div></nav> | ||
<nav class="tbar tbar-inline-xs-down subnav-tbar subnav-tbar-primary"><div class="container-fluid container-fluid-max-xl"><ul class="tbar-nav tbar-nav-wrap"><li class="tbar-item"><div class="tbar-section"><span class="component-text text-truncate-inline"><span class="text-truncate">10-results-for-my search</span></span></div></li><li class="tbar-item"><div class="tbar-section"><div ><span class="label label-dismissible component-label tbar-label"><span class="label-item label-item-expand"><div class="label-section">Label 1</div></span><span class="label-item label-item-after"><button class="btn close"aria-label="close"type="button"><svg class="lexicon-icon lexicon-icon-times"focusable="false"role="presentation"><use xlink:href="spritemap.svg#times" /></svg></button></span></span></div></div></li><li class="tbar-item tbar-item-expand"><div class="tbar-section"><div ><span class="label label-dismissible component-label tbar-label"><span class="label-item label-item-expand"><div class="label-section">Label 2</div></span><span class="label-item label-item-after"><button class="btn close"aria-label="close"type="button"><svg class="lexicon-icon lexicon-icon-times"focusable="false"role="presentation"><use xlink:href="spritemap.svg#times" /></svg></button></span></span></div></div></li><li class="tbar-item"><div class="tbar-section"><a class=" component-link tbar-link"href="url">clear</a></div></li></ul></div></nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import 'clay-label'; | ||
import {Config} from 'metal-state'; | ||
import ClayComponent from 'clay-component'; | ||
import Soy from 'metal-soy'; | ||
|
||
import templates from './ClayFilterLabel.soy.js'; | ||
|
||
/** | ||
* Metal ClayFilterLabel component. | ||
* @extends ClayComponent | ||
*/ | ||
class ClayFilterLabel extends ClayComponent { | ||
/** | ||
* Continues the propagation of the filter label close clicked event | ||
* @param {!Event} event | ||
* @private | ||
* @return {Boolean} If the event has been prevented or not. | ||
*/ | ||
_handleFilterLabelCloseClicked(event) { | ||
return !this.emit({ | ||
name: 'filterLabelCloseClicked', | ||
originalEvent: event, | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* State definition. | ||
* @static | ||
* @type {!Object} | ||
*/ | ||
ClayFilterLabel.STATE = { | ||
/** | ||
* Flag to indicate if the label is closeable. | ||
* @default false | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?bool} | ||
*/ | ||
closeable: Config.bool().value(false), | ||
|
||
/** | ||
* Data to add to the element. | ||
* @default undefined | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?object} | ||
*/ | ||
data: Config.object(), | ||
|
||
/** | ||
* Data to add pass to label component. | ||
* @default undefined | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?object} | ||
*/ | ||
filterData: Config.object(), | ||
|
||
/** | ||
* CSS classes to be applied to the element. | ||
* @default undefined | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?(string|undefined)} | ||
*/ | ||
elementClasses: Config.string(), | ||
|
||
/** | ||
* The label of the badge element. | ||
* @default undefined | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?(html|string|undefined)} | ||
*/ | ||
label: Config.any().required(), | ||
|
||
/** | ||
* The path to the SVG spritemap file containing the icons. | ||
* @default undefined | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?(string|undefined)} | ||
*/ | ||
spritemap: Config.string().required(), | ||
}; | ||
|
||
Soy.register(ClayFilterLabel, templates); | ||
|
||
export {ClayFilterLabel}; | ||
export default ClayFilterLabel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will likely need more than the label value, as that can be localized or who know what else. We would be better off passing down the
id
, the whole list oflabel
and any additional information we might need.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is already the entire label object.