open-vault/ui/stories/http-requests-dropdown.stories.js
Noelle Daley 5cd7e924fe
Http request volume/dropdown (#7016)
* init dropdown

* add dropdown to storybook

* move http requests components into container

* add event handler for selecting new time window

* no need for this. in the template

* filter bar chart and table

* add bar chart transitions

* handle Last 12 Months in dropdown

* don't use fake data

* start tests

* add jsdoc and notes for storybook

* add container to storybook

* compute filteredCounters when counters change

* move static dropdown options to template

* add tests

* style the dropdown

* use this.elementId

* fix linting errors

* use ember array extensions

* use fillIn instead of page object and make dom assertions consistent

* calculate the correct percent change between months

* use data-test selector instead of id

* show plus or minus next to percent change
2019-07-03 10:46:40 -07:00

29 lines
845 B
JavaScript

/* eslint-disable import/extensions */
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import { withKnobs, object } from '@storybook/addon-knobs';
import notes from './http-requests-dropdown.md';
const COUNTERS = [
{ start_time: '2019-04-01T00:00:00Z', total: 5500 },
{ start_time: '2019-05-01T00:00:00Z', total: 4500 },
{ start_time: '2019-06-01T00:00:00Z', total: 5000 },
];
storiesOf('HttpRequests/Dropdown/', module)
.addParameters({ options: { showPanel: true } })
.addDecorator(withKnobs())
.add(
`HttpRequestsDropdown`,
() => ({
template: hbs`
<h5 class="title is-5">Http Requests Dropdown</h5>
<HttpRequestsDropdown @counters={{counters}}/>
`,
context: {
counters: object('counters', COUNTERS),
},
}),
{ notes }
);