Sha256: 9ff70e1a570aa7976ca9370670a4d361a91f028cf41fd13e55676b4a405dda71

Contents?: true

Size: 1.85 KB

Versions: 51

Compression:

Stored size: 1.85 KB

Contents

import React from 'react';
import { number, select, action } from '@theforeman/stories';

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';

export default {
  title: 'TasksDashboard/TasksCardsGrid/Cards/StoppedTasksCard',
  component: StoppedTasksCard,
  decorators: [withCardsDecorator],
  parameters: {
    centered: { disable: true },
  },
};

export const Basic = () => {
  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

51 entries across 51 versions & 1 rubygems

Version Path
foreman-tasks-8.1.4 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-8.1.3 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-8.1.2 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-8.1.1 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-8.1.0 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-8.0.2 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-8.0.1 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-8.0.0 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-7.2.1 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-7.1.1 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-7.2.0 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-7.1.0 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-6.0.3 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-7.0.0 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-6.0.2 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-4.1.6 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-5.2.3 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-6.0.1 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-5.2.2 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
foreman-tasks-6.0.0 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js