Sha256: 7bde0109de8675d7fc95f812436a419a0e5149205ae154165fce98e293a251be

Contents?: true

Size: 1.37 KB

Versions: 51

Compression:

Stored size: 1.37 KB

Contents

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

import { withCardsDecorator } from '../../../../../../../stories/decorators';

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

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

export const Basic = () => {
  const selectTime = select(
    'time',
    TASKS_DASHBOARD_AVAILABLE_TIMES,
    RunningTasksCard.defaultProps.time
  );

  const selectMode = select(
    'mode',
    { ...TASKS_DASHBOARD_AVAILABLE_QUERY_MODES, NONE: 'none', TOTAL: null },
    'none'
  );
  return (
    <RunningTasksCard
      data={{
        last: number('data.last', 3),
        older: number('data.older', 5),
      }}
      time={selectTime}
      query={{
        state: select(
          'query.state',
          {
            ...TASKS_DASHBOARD_AVAILABLE_QUERY_STATES,
            NONE: null,
          },
          TASKS_DASHBOARD_AVAILABLE_QUERY_STATES.RUNNING
        ),
        mode: selectMode,
        time: selectTime,
      }}
      updateQuery={action('updateQuery')}
    />
  );
};

Version data entries

51 entries across 51 versions & 1 rubygems

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