open-vault/ui/stories/http-requests-table.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

30 lines
885 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-table.md';
const COUNTERS = [
{ start_time: '2018-12-01T00:00:00Z', total: 5500 },
{ start_time: '2019-01-01T00:00:00Z', total: 4500 },
{ start_time: '2019-02-01T00:00:00Z', total: 5000 },
{ start_time: '2019-03-01T00:00:00Z', total: 5000 },
];
storiesOf('HttpRequests/Table/', module)
.addParameters({ options: { showPanel: true } })
.addDecorator(withKnobs())
.add(
`HttpRequestsTable`,
() => ({
template: hbs`
<h5 class="title is-5">Http Requests Table</h5>
<HttpRequestsTable @counters={{counters}}/>
`,
context: {
counters: object('counters', COUNTERS),
},
}),
{ notes }
);