Skip to content

Commit

Permalink
Update the ClayDatasetDisplay use of ClayManagementToolbar | Fixes li…
Browse files Browse the repository at this point in the history
  • Loading branch information
matuzalemsteles committed Feb 16, 2018
1 parent 078b112 commit 2addee5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
18 changes: 11 additions & 7 deletions packages/clay-dataset-display/src/ClayDatasetDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,19 @@ ClayDatasetDisplay.STATE = {
* Configuration of the management bar plus button.
* @instance
* @memberof ClayDatasetDisplay
* @type {?object|undefined}
* @type {?object|string|bool|undefined}
* @default undefined
*/
creationMenu: Config.shapeOf({
button: Config.object(),
caption: Config.string(),
helpText: Config.string(),
items: actionItemsValidator,
}),
creationMenu: Config.oneOfType([
Config.bool().value(false),
Config.string(),
Config.shapeOf({
button: Config.object(),
caption: Config.string(),
helpText: Config.string(),
items: actionItemsValidator,
}),
]),

/**
* CSS classes to be applied to the element.
Expand Down
4 changes: 2 additions & 2 deletions packages/clay-dataset-display/src/ClayDatasetDisplay.soy
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
separator: bool,
type: string
]>}
{@param? creationMenu: [
{@param? creationMenu: bool|string|[
button: ?,
caption: string,
helpText: string,
Expand Down Expand Up @@ -212,4 +212,4 @@
{/call}
</form>
</div>
{/deltemplate}
{/deltemplate}
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ describe('ClayDatasetDisplay', function() {
it('should render a ClayDatasetDisplay and emit an event on management toolbar plus button click', () => {
jest.useFakeTimers();

defaultConfig.creationMenu = undefined;
defaultConfig.creationMenu = true;

component = new ClayDatasetDisplay(defaultConfig);

Expand Down

0 comments on commit 2addee5

Please sign in to comment.