Sha256: 6cd729cb5e8e83bc7f74dc96b621fdd5f12a0bec8b2245c6145d831a70a2c01c

Contents?: true

Size: 1.52 KB

Versions: 51

Compression:

Stored size: 1.52 KB

Contents

import { Meta, Story, Preview, Props, action } from '@theforeman/stories';

import { TASKS_DASHBOARD_AVAILABLE_TIMES } from '../../../../TasksDashboardConstants';
import TimeDropDown from './TimeDropDown';

<Meta
  title="TasksDashboard/TasksTimeRow/TimeDropDown"
  component={TimeDropDown}
/>

# TimeDropDown

Render a dropdown with the available dashboard times to render.

<Props of={TimeDropDown} />

The available-times defined as a constant at `Components/TasksDashboard/TasksDashboardConstants.js`:

```js
import { TASKS_DASHBOARD_AVAILABLE_TIMES } from './Components/TasksDashboard/TasksDashboardConstants';
```

To set the current selected time, set the `selectedTime` prop to `TASKS_DASHBOARD_AVAILABLE_TIMES.H24`.

<Preview>
  <Story name="24 hours">
    <TimeDropDown
      id="time-period-dropdown"
      selectedTime={TASKS_DASHBOARD_AVAILABLE_TIMES.H24}
      onChange={action('onChange')}
    />
  </Story>
</Preview>

To set the current selected time, set the `selectedTime` prop to `TASKS_DASHBOARD_AVAILABLE_TIMES.H12`.

<Preview>
  <Story name="12 hours">
    <TimeDropDown
      id="time-period-dropdown"
      selectedTime={TASKS_DASHBOARD_AVAILABLE_TIMES.H12}
      onChange={action('onChange')}
    />
  </Story>
</Preview>

To set the current selected time, set the `selectedTime` prop to `TASKS_DASHBOARD_AVAILABLE_TIMES.WEEK`.

<Preview>
  <Story name="week">
    <TimeDropDown
      id="time-period-dropdown"
      selectedTime={TASKS_DASHBOARD_AVAILABLE_TIMES.WEEK}
      onChange={action('onChange')}
    />
  </Story>
</Preview>

Version data entries

51 entries across 51 versions & 1 rubygems

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