foreman-tasks 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc +2 -22
  3. data/app/controllers/foreman_tasks/api/tasks_controller.rb +1 -1
  4. data/{.babelrc.js → babel.config.js} +0 -0
  5. data/lib/foreman_tasks/engine.rb +1 -1
  6. data/lib/foreman_tasks/version.rb +1 -1
  7. data/package.json +17 -69
  8. data/test/controllers/api/tasks_controller_test.rb +9 -0
  9. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Errors.test.js +1 -1
  10. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Locks.test.js +1 -1
  11. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Raw.test.js +1 -1
  12. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/RunningSteps.test.js +1 -1
  13. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Task.test.js +1 -1
  14. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskInfo.test.js +1 -1
  15. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.stories.js +6 -2
  16. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.test.js +1 -1
  17. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js +1 -1
  18. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsReducer.test.js +1 -1
  19. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/integration.test.js +1 -1
  20. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/PausedTasksCard/PausedTasksCard.stories.js +44 -40
  21. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/PausedTasksCard/PausedTasksCard.test.js +1 -1
  22. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/RunningTasksCard/RunningTasksCard.stories.js +45 -40
  23. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/RunningTasksCard/RunningTasksCard.test.js +1 -1
  24. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/ScheduledTasksCard/ScheduledTasksCard.stories.js +27 -22
  25. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/ScheduledTasksCard/ScheduledTasksCard.test.js +1 -1
  26. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js +61 -56
  27. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js +1 -1
  28. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/TasksDonutCard/TasksDonutCard.stories.js +40 -35
  29. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/TasksDonutCard/TasksDonutCard.test.js +1 -1
  30. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/TasksDonutChart/TasksDonutChart.stories.js +21 -20
  31. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/TasksDonutChart/TasksDonutChart.test.js +1 -1
  32. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/TasksCardsGrid.stories.js +40 -39
  33. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/TasksCardsGrid.test.js +1 -1
  34. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksLabelsRow/TasksLabelsRow.stories.js +16 -17
  35. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksLabelsRow/TasksLabelsRow.test.js +1 -2
  36. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/Components/TimeDropDown/TimeDropDown.stories.mdx +57 -0
  37. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/Components/TimeDropDown/TimeDropDown.test.js +1 -1
  38. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/TasksTimeRow.stories.js +36 -18
  39. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/TasksTimeRow.test.js +1 -1
  40. data/webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboard.test.js +1 -1
  41. data/webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js +1 -1
  42. data/webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardReducer.test.js +1 -1
  43. data/webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js +1 -1
  44. data/webpack/ForemanTasks/Components/TasksTable/Components/CancelConfirm.js +53 -0
  45. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmationModals.js +56 -0
  46. data/webpack/ForemanTasks/Components/TasksTable/Components/ResumeConfirm.js +52 -0
  47. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/ActionSelectButton.test.js +1 -1
  48. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/CancelConfirm.test.js +26 -0
  49. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/ConfirmationModals.test.js +24 -0
  50. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/ResumeConfirm.test.js +26 -0
  51. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionCell.test.js +1 -1
  52. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionHeaderCell.test.js +1 -1
  53. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/CancelConfirm.test.js.snap +65 -0
  54. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ConfirmationModals.test.js.snap +30 -0
  55. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ResumeConfirm.test.js.snap +63 -0
  56. data/webpack/ForemanTasks/Components/TasksTable/TasksTable.js +22 -12
  57. data/webpack/ForemanTasks/Components/TasksTable/TasksTableActions.js +15 -18
  58. data/webpack/ForemanTasks/Components/TasksTable/TasksTableConstants.js +6 -2
  59. data/webpack/ForemanTasks/Components/TasksTable/TasksTablePage.js +54 -18
  60. data/webpack/ForemanTasks/Components/TasksTable/TasksTableReducer.js +5 -7
  61. data/webpack/ForemanTasks/Components/TasksTable/TasksTableSelectors.js +18 -16
  62. data/webpack/ForemanTasks/Components/TasksTable/__tests__/SubTasksPage.test.js +1 -1
  63. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksIndexPage.test.js +1 -1
  64. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTable.fixtures.js +7 -3
  65. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTable.test.js +1 -1
  66. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableActions.test.js +1 -1
  67. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTablePage.test.js +1 -1
  68. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableReducer.test.js +6 -7
  69. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/SubTasksPage.test.js.snap +9 -3
  70. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksIndexPage.test.js.snap +9 -3
  71. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTablePage.test.js.snap +116 -18
  72. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableReducer.test.js.snap +9 -16
  73. data/webpack/ForemanTasks/Components/TasksTable/index.js +3 -2
  74. data/webpack/ForemanTasks/Components/common/ActionButtons/ActionButton.js +4 -4
  75. data/webpack/ForemanTasks/Components/common/ActionButtons/ActionButton.test.js +1 -1
  76. data/webpack/ForemanTasks/Components/common/ActionButtons/CancelButton.test.js +1 -2
  77. data/webpack/ForemanTasks/Components/common/ActionButtons/ResumeButton.test.js +2 -2
  78. data/webpack/ForemanTasks/Components/common/ActionButtons/__snapshots__/ActionButton.test.js.snap +3 -3
  79. data/webpack/ForemanTasks/ForemanTasks.test.js +1 -1
  80. data/webpack/ForemanTasks/Routes/ForemanTasksRouter.test.js +1 -1
  81. data/webpack/ForemanTasks/Routes/ForemanTasksRoutes.test.js +2 -3
  82. data/webpack/ForemanTasks/Routes/ShowTask/__tests__/ShowTask.test.js +1 -1
  83. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +2 -0
  84. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalHooks.js +10 -0
  85. data/webpack/__mocks__/foremanReact/components/ForemanModal/index.js +4 -0
  86. metadata +16 -16
  87. data/.storybook/addons.js +0 -2
  88. data/.storybook/config.js +0 -7
  89. data/.storybook/webpack.config.js +0 -84
  90. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/Components/TimeDropDown/TimeDropDown.stories.js +0 -23
  91. data/webpack/ForemanTasks/Components/TasksTable/Components/ActionConfirmation.js +0 -49
  92. data/webpack/ForemanTasks/Components/TasksTable/Components/CancelResumeConfirm.js +0 -51
  93. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/ActionConfirmation.test.js +0 -18
  94. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/CancelResumeConfirm.test.js +0 -28
  95. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ActionConfirmation.test.js.snap +0 -89
  96. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/CancelResumeConfirm.test.js.snap +0 -37
  97. data/webpack/stories/index.js +0 -10
  98. data/webpack/stories/index.scss +0 -7
  99. data/webpack/test_setup.js +0 -7
@@ -12,7 +12,7 @@ import {
12
12
  selectSort,
13
13
  selectActionName,
14
14
  selectSelectedRows,
15
- selectModalStatus,
15
+ selectClicked,
16
16
  } from './TasksTableSelectors';
17
17
 
18
18
  const mapStateToProps = state => ({
@@ -24,8 +24,9 @@ const mapStateToProps = state => ({
24
24
  itemCount: selectItemCount(state),
25
25
  actionName: selectActionName(state),
26
26
  selectedRows: selectSelectedRows(state),
27
- modalStatus: selectModalStatus(state),
27
+ clicked: selectClicked(state),
28
28
  });
29
+
29
30
  const mapDispatchToProps = dispatch => bindActionCreators(actions, dispatch);
30
31
 
31
32
  export const reducers = { tasksTable: reducer };
@@ -10,7 +10,7 @@ export const ActionButton = ({ id, name, availableActions, taskActions }) => {
10
10
  <ResumeButton
11
11
  id={id}
12
12
  name={name}
13
- onClick={taskActions.resume}
13
+ onClick={taskActions.resumeTask}
14
14
  disabled={false}
15
15
  />
16
16
  );
@@ -20,7 +20,7 @@ export const ActionButton = ({ id, name, availableActions, taskActions }) => {
20
20
  id={id}
21
21
  name={name}
22
22
  disabled={!availableActions.cancellable}
23
- onClick={taskActions.cancel}
23
+ onClick={taskActions.cancelTask}
24
24
  />
25
25
  );
26
26
  };
@@ -33,7 +33,7 @@ ActionButton.propTypes = {
33
33
  resumable: PropTypes.bool,
34
34
  }).isRequired,
35
35
  taskActions: PropTypes.shape({
36
- cancel: PropTypes.func,
37
- resume: PropTypes.func,
36
+ cancelTask: PropTypes.func,
37
+ resumeTask: PropTypes.func,
38
38
  }).isRequired,
39
39
  };
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import { ActionButton } from './ActionButton';
4
4
 
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
3
- import { shallow } from 'enzyme';
2
+ import { testComponentSnapshotsWithFixtures, shallow } from '@theforeman/test';
4
3
  import { CancelButton } from './CancelButton';
5
4
 
6
5
  const fixtures = {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
3
- import { shallow } from 'enzyme';
2
+ import { testComponentSnapshotsWithFixtures, shallow } from '@theforeman/test';
3
+
4
4
  import { ResumeButton } from './ResumeButton';
5
5
 
6
6
  const fixtures = {
@@ -5,7 +5,7 @@ exports[`ActionButton render with cancellable false props 1`] = `
5
5
  disabled={true}
6
6
  id="id"
7
7
  name="some-name"
8
- onClick={[MockFunction]}
8
+ onClick={[Function]}
9
9
  />
10
10
  `;
11
11
 
@@ -14,7 +14,7 @@ exports[`ActionButton render with cancellable true props 1`] = `
14
14
  disabled={false}
15
15
  id="id"
16
16
  name="some-name"
17
- onClick={[MockFunction]}
17
+ onClick={[Function]}
18
18
  />
19
19
  `;
20
20
 
@@ -23,6 +23,6 @@ exports[`ActionButton render with resumable true props 1`] = `
23
23
  disabled={false}
24
24
  id="id"
25
25
  name="some-name"
26
- onClick={[MockFunction]}
26
+ onClick={[Function]}
27
27
  />
28
28
  `;
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import ForemanTasks from './ForemanTasks';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
2
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
3
3
 
4
4
  import ForemanTasksRouter from './ForemanTasksRouter';
5
5
 
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import toJson from 'enzyme-to-json';
2
+ import { shallow } from '@theforeman/test';
4
3
 
5
4
  import ForemanTasksRoutes from './ForemanTasksRoutes';
6
5
 
@@ -8,7 +7,7 @@ describe('ForemanTasksRoutes', () => {
8
7
  it('should create routes', () => {
9
8
  Object.entries(ForemanTasksRoutes).forEach(([key, Route]) => {
10
9
  const component = shallow(<Route.render history={{}} some="props" />);
11
- Route.renderResult = toJson(component);
10
+ Route.renderResult = component;
12
11
  });
13
12
 
14
13
  expect(ForemanTasksRoutes).toMatchSnapshot();
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import ShowTask from '../ShowTask';
4
4
 
@@ -0,0 +1,2 @@
1
+ const ForemanModalActions = () => jest.fn();
2
+ export default ForemanModalActions;
@@ -0,0 +1,10 @@
1
+ const modalOpen = true;
2
+ const setModalOpen = jest.fn();
3
+ const setModalClosed = jest.fn();
4
+
5
+ export const useForemanModal = () => ({
6
+ modalOpen,
7
+ setModalOpen,
8
+ setModalClosed,
9
+ });
10
+ export default useForemanModal;
@@ -0,0 +1,4 @@
1
+ const ForemanModal = () => jest.fn();
2
+ ForemanModal.Header = () => jest.fn();
3
+ ForemanModal.Footer = () => jest.fn();
4
+ export default ForemanModal;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-19 00:00:00.000000000 Z
11
+ date: 2020-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman-tasks-core
@@ -107,15 +107,11 @@ extra_rdoc_files:
107
107
  - README.md
108
108
  - LICENSE
109
109
  files:
110
- - ".babelrc.js"
111
110
  - ".eslintrc"
112
111
  - ".gitignore"
113
112
  - ".prettierrc"
114
113
  - ".rubocop.yml"
115
114
  - ".rubocop_todo.yml"
116
- - ".storybook/addons.js"
117
- - ".storybook/config.js"
118
- - ".storybook/webpack.config.js"
119
115
  - ".stylelintrc"
120
116
  - ".travis.yml"
121
117
  - ".tx/config"
@@ -208,6 +204,7 @@ files:
208
204
  - app/views/foreman_tasks/tasks/dashboard/_latest_tasks_in_error_warning.html.erb
209
205
  - app/views/foreman_tasks/tasks/dashboard/_tasks_status.html.erb
210
206
  - app/views/foreman_tasks/tasks/show.html.erb
207
+ - babel.config.js
211
208
  - bin/dynflow-executor
212
209
  - bin/foreman-tasks
213
210
  - config/foreman-tasks.yaml.example
@@ -392,7 +389,7 @@ files:
392
389
  - webpack/ForemanTasks/Components/TasksDashboard/Components/TasksLabelsRow/TasksLabelsRow.test.js
393
390
  - webpack/ForemanTasks/Components/TasksDashboard/Components/TasksLabelsRow/__snapshots__/TasksLabelsRow.test.js.snap
394
391
  - webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/Components/TimeDropDown/TimeDropDown.js
395
- - webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/Components/TimeDropDown/TimeDropDown.stories.js
392
+ - webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/Components/TimeDropDown/TimeDropDown.stories.mdx
396
393
  - webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/Components/TimeDropDown/TimeDropDown.test.js
397
394
  - webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/Components/TimeDropDown/__snapshots__/TimeDropDown.test.js.snap
398
395
  - webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/TasksTimeRow.js
@@ -419,19 +416,22 @@ files:
419
416
  - webpack/ForemanTasks/Components/TasksDashboard/__tests__/__snapshots__/TasksDashboardReducer.test.js.snap
420
417
  - webpack/ForemanTasks/Components/TasksDashboard/__tests__/__snapshots__/TasksDashboardSelectors.test.js.snap
421
418
  - webpack/ForemanTasks/Components/TasksDashboard/index.js
422
- - webpack/ForemanTasks/Components/TasksTable/Components/ActionConfirmation.js
423
419
  - webpack/ForemanTasks/Components/TasksTable/Components/ActionSelectButton.js
424
- - webpack/ForemanTasks/Components/TasksTable/Components/CancelResumeConfirm.js
420
+ - webpack/ForemanTasks/Components/TasksTable/Components/CancelConfirm.js
421
+ - webpack/ForemanTasks/Components/TasksTable/Components/ConfirmationModals.js
422
+ - webpack/ForemanTasks/Components/TasksTable/Components/ResumeConfirm.js
425
423
  - webpack/ForemanTasks/Components/TasksTable/Components/TableSelectionCell.js
426
424
  - webpack/ForemanTasks/Components/TasksTable/Components/TableSelectionHeaderCell.js
427
- - webpack/ForemanTasks/Components/TasksTable/Components/__test__/ActionConfirmation.test.js
428
425
  - webpack/ForemanTasks/Components/TasksTable/Components/__test__/ActionSelectButton.test.js
429
- - webpack/ForemanTasks/Components/TasksTable/Components/__test__/CancelResumeConfirm.test.js
426
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/CancelConfirm.test.js
427
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/ConfirmationModals.test.js
428
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/ResumeConfirm.test.js
430
429
  - webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionCell.test.js
431
430
  - webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionHeaderCell.test.js
432
- - webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ActionConfirmation.test.js.snap
433
431
  - webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ActionSelectButton.test.js.snap
434
- - webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/CancelResumeConfirm.test.js.snap
432
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/CancelConfirm.test.js.snap
433
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ConfirmationModals.test.js.snap
434
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ResumeConfirm.test.js.snap
435
435
  - webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/TableSelectionCell.test.js.snap
436
436
  - webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/TableSelectionHeaderCell.test.js.snap
437
437
  - webpack/ForemanTasks/Components/TasksTable/SubTasksPage.js
@@ -510,6 +510,9 @@ files:
510
510
  - webpack/__mocks__/foremanReact/common/I18n.js
511
511
  - webpack/__mocks__/foremanReact/common/helpers.js
512
512
  - webpack/__mocks__/foremanReact/common/urlHelpers.js
513
+ - webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js
514
+ - webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalHooks.js
515
+ - webpack/__mocks__/foremanReact/components/ForemanModal/index.js
513
516
  - webpack/__mocks__/foremanReact/components/Layout/LayoutActions.js
514
517
  - webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js
515
518
  - webpack/__mocks__/foremanReact/components/common/MessageBox.js
@@ -524,9 +527,6 @@ files:
524
527
  - webpack/index.js
525
528
  - webpack/stories/decorators/index.js
526
529
  - webpack/stories/decorators/withCardsDecorator.js
527
- - webpack/stories/index.js
528
- - webpack/stories/index.scss
529
- - webpack/test_setup.js
530
530
  homepage: https://github.com/theforeman/foreman-tasks
531
531
  licenses: []
532
532
  metadata: {}
data/.storybook/addons.js DELETED
@@ -1,2 +0,0 @@
1
- import '@storybook/addon-actions/register';
2
- import '@storybook/addon-knobs/register';
data/.storybook/config.js DELETED
@@ -1,7 +0,0 @@
1
- import { configure } from '@storybook/react';
2
-
3
- function loadStories() {
4
- require('../webpack/stories');
5
- }
6
-
7
- configure(loadStories, module);
@@ -1,84 +0,0 @@
1
- const babelOptions = require('../.babelrc.js');
2
- let path = require('path');
3
-
4
- module.exports = {
5
- module: {
6
- rules: [
7
- {
8
- test: /\.js$/,
9
- exclude: /node_modules/,
10
- loader: 'babel-loader',
11
- options: babelOptions,
12
- },
13
- {
14
- test: /(\.png|\.gif)$/,
15
- loader: 'url-loader?limit=32767',
16
- },
17
- {
18
- test: /\.css$/,
19
- loaders: ['style-loader', 'css-loader'],
20
- },
21
- {
22
- test: /\.scss$/,
23
- loaders: [
24
- 'style-loader',
25
- 'css-loader',
26
- {
27
- loader: 'sass-loader',
28
- options: {
29
- includePaths: [
30
- // teach webpack to resolve patternfly dependencies
31
- path.resolve(
32
- __dirname,
33
- '..',
34
- 'node_modules',
35
- 'patternfly',
36
- 'dist',
37
- 'sass'
38
- ),
39
- path.resolve(
40
- __dirname,
41
- '..',
42
- 'node_modules',
43
- 'bootstrap-sass',
44
- 'assets',
45
- 'stylesheets'
46
- ),
47
- path.resolve(
48
- __dirname,
49
- '..',
50
- 'node_modules',
51
- 'font-awesome-sass',
52
- 'assets',
53
- 'stylesheets'
54
- ),
55
- ],
56
- },
57
- },
58
- ],
59
- },
60
- {
61
- test: /\.md$/,
62
- loaders: ['raw-loader'],
63
- },
64
- {
65
- test: /(\.ttf|\.woff|\.woff2|\.eot|\.svg|\.jpg)$/,
66
- loaders: ['url-loader'],
67
- },
68
- ],
69
- },
70
-
71
- resolve: {
72
- alias: {
73
- foremanReact: path.join(
74
- __dirname,
75
- '../../foreman/webpack/assets/javascripts/react_app'
76
- ),
77
- },
78
- modules: [
79
- path.join(__dirname, '..', 'webpack'),
80
- path.join(__dirname, '..', 'node_modules'),
81
- 'node_modules/',
82
- ],
83
- },
84
- };
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { withKnobs, select } from '@storybook/addon-knobs';
4
- import { action } from '@storybook/addon-actions';
5
- import { withCardsDecorator } from '../../../../../../../stories/decorators';
6
-
7
- import { TASKS_DASHBOARD_AVAILABLE_TIMES } from '../../../../TasksDashboardConstants';
8
- import TimeDropDown from './TimeDropDown';
9
-
10
- storiesOf('TasksDashboard/TasksTimeRow', module)
11
- .addDecorator(withKnobs)
12
- .addDecorator(withCardsDecorator)
13
- .add('TimeDropDown', () => (
14
- <TimeDropDown
15
- id="time-period-dropdown"
16
- selectedTime={select(
17
- 'selectedTime',
18
- TASKS_DASHBOARD_AVAILABLE_TIMES,
19
- TASKS_DASHBOARD_AVAILABLE_TIMES.H24
20
- )}
21
- onChange={action('onChange')}
22
- />
23
- ));
@@ -1,49 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Modal, Button } from 'patternfly-react';
4
-
5
- export const ActionConfirmation = ({
6
- showModal,
7
- closeModal,
8
- title,
9
- message,
10
- onClick,
11
- confirmAction,
12
- abortAction,
13
- }) => (
14
- <Modal show={showModal} onHide={closeModal}>
15
- <Modal.Header>
16
- <Button
17
- className="close"
18
- onClick={closeModal}
19
- aria-hidden="true"
20
- aria-label="Close"
21
- >
22
- &times;
23
- </Button>
24
- <Modal.Title>
25
- <span className="glyphicon glyphicon-warning-sign" />
26
- {` ${title}`}
27
- </Modal.Title>
28
- </Modal.Header>
29
- <Modal.Body>{message}</Modal.Body>
30
- <Modal.Footer>
31
- <Button onClick={closeModal}>{abortAction}</Button>
32
- <Button bsStyle="primary" onClick={onClick}>
33
- {confirmAction}
34
- </Button>
35
- </Modal.Footer>
36
- </Modal>
37
- );
38
-
39
- ActionConfirmation.propTypes = {
40
- showModal: PropTypes.bool.isRequired,
41
- title: PropTypes.string.isRequired,
42
- message: PropTypes.string.isRequired,
43
- confirmAction: PropTypes.string.isRequired,
44
- abortAction: PropTypes.string.isRequired,
45
- closeModal: PropTypes.func.isRequired,
46
- onClick: PropTypes.func.isRequired,
47
- };
48
-
49
- export default ActionConfirmation;
@@ -1,51 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { sprintf, translate as __ } from 'foremanReact/common/I18n';
4
- import { ActionConfirmation } from './ActionConfirmation';
5
- import { CANCEL, RESUME, CLOSED } from '../TasksTableConstants';
6
-
7
- export const CancelResumeConfirm = ({
8
- closeModal,
9
- modalStatus,
10
- action,
11
- selected,
12
- selectedRowsLen,
13
- }) => (
14
- <ActionConfirmation
15
- showModal={modalStatus !== CLOSED}
16
- closeModal={closeModal}
17
- title={`${modalStatus === CANCEL ? __('Cancel') : __('Resume')} ${__(
18
- 'Selected Tasks'
19
- )}`}
20
- message={sprintf(
21
- __(
22
- `This will ${
23
- modalStatus === CANCEL ? 'stop' : 'resume'
24
- } %s tasks, putting them in the ${
25
- modalStatus === CANCEL ? 'canceled' : 'running'
26
- } state. Are you sure?`
27
- ),
28
- selectedRowsLen
29
- )}
30
- onClick={() => {
31
- if (modalStatus === CANCEL) {
32
- action(CANCEL, selected);
33
- } else if (modalStatus === RESUME) {
34
- action(RESUME, selected);
35
- }
36
- closeModal();
37
- }}
38
- confirmAction={__('Yes')}
39
- abortAction={__('No')}
40
- />
41
- );
42
-
43
- CancelResumeConfirm.propTypes = {
44
- closeModal: PropTypes.func.isRequired,
45
- modalStatus: PropTypes.oneOf([CANCEL, RESUME, CLOSED]).isRequired,
46
- selectedRowsLen: PropTypes.number.isRequired,
47
- action: PropTypes.func.isRequired,
48
- selected: PropTypes.array.isRequired,
49
- };
50
-
51
- export default CancelResumeConfirm;