-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* change the story blueprint so that using -ir will generate a story in the expected place for in-repo addons and engines * update gen-story-md script to do output md to stories folder inside of in-repo addons and engines * update storybook config to look for story files in /lib * add story for list-view component * add list view page object * add kmip page objects and tests * update storybook commands in the README * split tests up more * update var name in storybook
- Loading branch information
Showing
27 changed files
with
495 additions
and
42 deletions.
There are no files selected for viewing
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
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
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,32 @@ | ||
<!--THIS FILE IS AUTO GENERATED. This file is generated from JSDoc comments in lib/core/addon/components/list-view.js. To make changes, first edit that file and run "yarn gen-story-md list-view" to re-generate the content.--> | ||
|
||
## ListView | ||
`ListView` components are used in conjuction with `ListItem` for rendering a list. | ||
|
||
|
||
| Param | Type | Default | Description | | ||
| --- | --- | --- | --- | | ||
| items | <code>Array</code> | <code></code> | An array of items to render as a list | | ||
| [itemNoun] | <code>String</code> | <code></code> | A noun to use in the empty state of message and title. | | ||
| [message] | <code>String</code> | <code></code> | The message to display within the banner. | | ||
|
||
**Example** | ||
|
||
```js | ||
<ListView @items={{model}} @itemNoun="role" @paginationRouteName="scope.roles" as |list|> | ||
{{#if list.empty}} | ||
<list.empty @title="No roles here" /> | ||
{{else}} | ||
<div> | ||
{{list.item.id}} | ||
</div> | ||
{{/if}} | ||
</ListView> | ||
``` | ||
|
||
**See** | ||
|
||
- [Uses of ListView](https://github.com/hashicorp/vault/search?l=Handlebars&q=ListView+OR+list-view) | ||
- [ListView Source Code](https://github.com/hashicorp/vault/blob/master/ui/lib/core/addon/components/list-view.js) | ||
|
||
--- |
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,58 @@ | ||
/* eslint-disable import/extensions */ | ||
import hbs from 'htmlbars-inline-precompile'; | ||
import { storiesOf } from '@storybook/ember'; | ||
import { withKnobs, select } from '@storybook/addon-knobs'; | ||
import notes from './list-view.md'; | ||
|
||
import ArrayProxy from '@ember/array/proxy'; | ||
|
||
let filtered = ArrayProxy.create({ content: [] }); | ||
filtered.set('meta', { | ||
lastPage: 1, | ||
currentPage: 1, | ||
total: 100, | ||
}); | ||
|
||
let paginated = ArrayProxy.create({ | ||
content: [{ id: 'middle' }, { id: 'of' }, { id: 'the' }, { id: 'list' }], | ||
}); | ||
paginated.set('meta', { | ||
lastPage: 10, | ||
currentPage: 4, | ||
total: 100, | ||
}); | ||
|
||
let options = { | ||
list: [{ id: 'one' }, { id: 'two' }], | ||
empty: [], | ||
filtered, | ||
paginated, | ||
}; | ||
|
||
storiesOf('ListView/', module) | ||
.addParameters({ options: { showPanel: true } }) | ||
.addDecorator(withKnobs()) | ||
.add( | ||
`ListView`, | ||
() => ({ | ||
template: hbs` | ||
<h5 class="title is-5">{{title}}</h5> | ||
<ListView @items={{items}} @itemNoun={{or noun "role"}} @paginationRouteName="vault" as |list|> | ||
{{#if list.empty}} | ||
<list.empty @title="No roles here" /> | ||
{{else if list.item}} | ||
<div class="box is-marginless"> | ||
{{list.item.id}} | ||
</div> | ||
{{else}} | ||
<div class="box">There aren't any items in this filter</div> | ||
{{/if}} | ||
</ListView> | ||
`, | ||
context: { | ||
title: 'ListView', | ||
items: select('items', options, options['list']), | ||
}, | ||
}), | ||
{ notes } | ||
); |
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
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.