Sha256: eeeda824164406a9c7a8397798f1815f6daa28c328f974a59a0d34f528fde037

Contents?: true

Size: 1.97 KB

Versions: 17

Compression:

Stored size: 1.97 KB

Contents

import React from 'react';
import { storiesOf } from '@storybook/react';
import { withKnobs, number, select } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import { withCardsDecorator } from '../../../../../../../stories/decorators';

import {
  TASKS_DASHBOARD_AVAILABLE_TIMES,
  TASKS_DASHBOARD_AVAILABLE_QUERY_STATES,
  TASKS_DASHBOARD_AVAILABLE_QUERY_RESULTS,
  TASKS_DASHBOARD_AVAILABLE_QUERY_MODES,
} from '../../../../TasksDashboardConstants';
import StoppedTasksCard from './StoppedTasksCard';

storiesOf('TasksDashboard/TasksCardsGrid', module)
  .addDecorator(withKnobs)
  .addDecorator(withCardsDecorator)
  .add('StoppedTasksCard', () => {
    const selectTime = select(
      'time',
      TASKS_DASHBOARD_AVAILABLE_TIMES,
      StoppedTasksCard.defaultProps.time
    );
    const selectState = select(
      'query.state',
      { ...TASKS_DASHBOARD_AVAILABLE_QUERY_STATES, NONE: null },
      TASKS_DASHBOARD_AVAILABLE_QUERY_STATES.STOPPED
    );
    const selectResult = select(
      'query.result',
      { ...TASKS_DASHBOARD_AVAILABLE_QUERY_RESULTS, NONE: null },
      null
    );
    const selectMode = select(
      'query.mode',
      { ...TASKS_DASHBOARD_AVAILABLE_QUERY_MODES, NONE: null },
      null
    );
    return (
      <div>
        <StoppedTasksCard
          data={{
            error: {
              total: number('errorTotal', 8),
              last: number('errorLast', 1),
            },
            warning: {
              total: number('warningTotal', 20),
              last: number('warningLast', 2),
            },
            success: {
              total: number('successTotal', 25),
              last: number('successLast', 3),
            },
          }}
          time={selectTime}
          query={{
            state: selectState,
            result: selectResult,
            mode: selectMode,
            time: selectTime,
          }}
          updateQuery={action('updateQuery')}
        />
      </div>
    );
  });

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
foreman-tasks-0.17.6 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-1.0.0 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.17.5 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.17.4 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.17.3 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.17.2 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.16.3 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.17.1 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.15.11 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.16.2 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.15.10 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.16.1 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.17.0 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.15.9 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.15.8 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.15.7 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-0.16.0 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js