foreman-tasks 2.0.3 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/js_tests.yml +31 -0
- data/.github/workflows/ruby_tests.yml +74 -0
- data/.rubocop.yml +12 -4
- data/.rubocop_todo.yml +32 -25
- data/Gemfile +5 -0
- data/app/controllers/foreman_tasks/api/tasks_controller.rb +50 -63
- data/app/controllers/foreman_tasks/concerns/parameters/triggering.rb +1 -1
- data/app/controllers/foreman_tasks/recurring_logics_controller.rb +7 -0
- data/app/helpers/foreman_tasks/foreman_tasks_helper.rb +3 -3
- data/app/models/foreman_tasks/recurring_logic.rb +1 -1
- data/app/models/foreman_tasks/task.rb +11 -0
- data/app/models/foreman_tasks/task/dynflow_task.rb +27 -33
- data/app/models/foreman_tasks/task/search.rb +1 -1
- data/app/models/foreman_tasks/task/status_explicator.rb +1 -1
- data/app/models/foreman_tasks/triggering.rb +1 -1
- data/app/models/setting/foreman_tasks.rb +9 -9
- data/app/services/foreman_tasks/dashboard_table_filter.rb +5 -1
- data/app/views/foreman_tasks/api/tasks/index.json.rabl +2 -0
- data/app/views/foreman_tasks/layouts/react.html.erb +1 -2
- data/app/views/foreman_tasks/recurring_logics/index.html.erb +3 -1
- data/app/views/foreman_tasks/tasks/dashboard/_latest_tasks_in_error_warning.html.erb +1 -1
- data/app/views/foreman_tasks/tasks/dashboard/_tasks_status.html.erb +1 -1
- data/app/views/foreman_tasks/tasks/show.html.erb +1 -6
- data/config/routes.rb +2 -1
- data/db/migrate/20200517215015_rename_bookmarks_controller.rb +2 -2
- data/db/seeds.d/30-notification_blueprints.rb +7 -7
- data/db/seeds.d/61-foreman_tasks_bookmarks.rb +1 -1
- data/foreman-tasks.gemspec +1 -0
- data/lib/foreman_tasks/cleaner.rb +4 -6
- data/lib/foreman_tasks/dynflow/configuration.rb +1 -1
- data/lib/foreman_tasks/dynflow/persistence.rb +4 -6
- data/lib/foreman_tasks/engine.rb +2 -2
- data/lib/foreman_tasks/version.rb +1 -1
- data/package.json +0 -1
- data/test/controllers/api/recurring_logics_controller_test.rb +1 -1
- data/test/controllers/api/tasks_controller_test.rb +17 -7
- data/test/controllers/tasks_controller_test.rb +6 -6
- data/test/core/unit/runner_test.rb +20 -20
- data/test/core/unit/task_launcher_test.rb +8 -8
- data/test/helpers/foreman_tasks/foreman_tasks_helper_test.rb +7 -7
- data/test/helpers/foreman_tasks/tasks_helper_test.rb +3 -3
- data/test/lib/actions/middleware/keep_current_request_id_test.rb +3 -3
- data/test/support/history_tasks_builder.rb +1 -1
- data/test/tasks/generate_task_actions_test.rb +1 -1
- data/test/unit/actions/action_with_sub_plans_test.rb +2 -2
- data/test/unit/actions/bulk_action_test.rb +6 -6
- data/test/unit/actions/proxy_action_test.rb +20 -20
- data/test/unit/actions/recurring_action_test.rb +30 -32
- data/test/unit/cleaner_test.rb +24 -24
- data/test/unit/dashboard_table_filter_test.rb +5 -5
- data/test/unit/otp_manager_test.rb +2 -2
- data/test/unit/proxy_selector_test.rb +9 -9
- data/test/unit/recurring_logic_test.rb +32 -32
- data/test/unit/remote_task_test.rb +2 -2
- data/test/unit/task_groups_test.rb +4 -4
- data/test/unit/task_test.rb +26 -18
- data/test/unit/triggering_test.rb +8 -8
- data/test/unit/troubleshooting_help_generator_test.rb +6 -6
- data/test/unit/ui_notifications_test.rb +11 -11
- data/webpack/ForemanTasks/Components/TaskDetails/Components/RunningSteps.js +3 -3
- data/webpack/ForemanTasks/Components/TaskDetails/Components/Task.js +8 -157
- data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskButtons.js +168 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js +6 -7
- data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskSkeleton.js +48 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/RunningSteps.test.js +1 -1
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Task.test.js +12 -70
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskButtons.test.js +95 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Task.test.js.snap +78 -225
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskButtons.test.js.snap +212 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap +8 -4
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.js +87 -70
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.scss +10 -0
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsActions.js +48 -125
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsConstants.js +3 -16
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js +55 -29
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.fixtures.js +2 -2
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.test.js +6 -0
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js +2 -18
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetails.test.js.snap +77 -27
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsActions.test.js.snap +14 -101
- data/webpack/ForemanTasks/Components/TaskDetails/index.js +6 -3
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/ScheduledTasksCard/ScheduledTasksCard.scss +4 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/OtherInfo.js +53 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/OtherInfo.test.js +14 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.js +27 -19
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.scss +14 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js +1 -34
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/{StoppedTasksCardHelper.js → StoppedTasksCardTable.js} +28 -1
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCardTable.test.js +54 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/__snapshots__/OtherInfo.test.js.snap +48 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/__snapshots__/StoppedTasksCard.test.js.snap +60 -1367
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/__snapshots__/StoppedTasksCardTable.test.js.snap +960 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/__snapshots__/TasksCardsGrid.test.js.snap +14 -11
- data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboardConstants.js +2 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboardSelectors.js +17 -11
- data/webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js +26 -14
- data/webpack/ForemanTasks/Components/TasksDashboard/__tests__/__snapshots__/TasksDashboard.test.js.snap +14 -11
- data/webpack/ForemanTasks/Components/TasksDashboard/__tests__/__snapshots__/TasksDashboardSelectors.test.js.snap +38 -22
- data/webpack/ForemanTasks/Components/TasksTable/TasksTableHelpers.js +0 -8
- data/webpack/ForemanTasks/Components/TasksTable/TasksTablePage.js +13 -4
- data/webpack/ForemanTasks/Components/TasksTable/TasksTablePage.scss +0 -10
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTablePage.test.js.snap +0 -2
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/actionNameCellFormatter.test.js.snap +3 -1
- data/webpack/ForemanTasks/Components/TasksTable/formatters/actionNameCellFormatter.js +6 -1
- data/webpack/ForemanTasks/Components/common/urlHelpers.js +7 -0
- data/webpack/ForemanTasks/ForemanTasksReducers.js +0 -2
- data/webpack/__mocks__/foremanReact/common/helpers.js +2 -0
- data/webpack/__mocks__/foremanReact/redux/API/APISelectors.js +10 -0
- data/webpack/__mocks__/foremanReact/redux/API/index.js +10 -0
- data/webpack/__mocks__/foremanReact/redux/middlewares/IntervalMiddleware.js +5 -0
- metadata +21 -13
- data/.travis.yml +0 -7
- data/app/assets/stylesheets/foreman_tasks/tasks.scss +0 -9
- data/script/travis_run_js_tests.sh +0 -7
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsReducer.js +0 -38
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsReducer.test.js +0 -33
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsReducer.test.js.snap +0 -26
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/integration.test.js.snap +0 -122
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/integration.test.js +0 -72
- data/webpack/__mocks__/foremanReact/redux/API.js +0 -7
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:
|
|
4
|
+
version: 3.0.4
|
|
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: 2021-
|
|
11
|
+
date: 2021-02-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dynflow
|
|
@@ -122,12 +122,13 @@ extra_rdoc_files:
|
|
|
122
122
|
- LICENSE
|
|
123
123
|
files:
|
|
124
124
|
- ".eslintrc"
|
|
125
|
+
- ".github/workflows/js_tests.yml"
|
|
126
|
+
- ".github/workflows/ruby_tests.yml"
|
|
125
127
|
- ".gitignore"
|
|
126
128
|
- ".prettierrc"
|
|
127
129
|
- ".rubocop.yml"
|
|
128
130
|
- ".rubocop_todo.yml"
|
|
129
131
|
- ".stylelintrc"
|
|
130
|
-
- ".travis.yml"
|
|
131
132
|
- ".tx/config"
|
|
132
133
|
- ".yo-rc.json"
|
|
133
134
|
- Gemfile
|
|
@@ -136,7 +137,6 @@ files:
|
|
|
136
137
|
- app/assets/javascripts/foreman_tasks/foreman_tasks.js
|
|
137
138
|
- app/assets/javascripts/foreman_tasks/trigger_form.js
|
|
138
139
|
- app/assets/stylesheets/foreman_tasks/foreman_tasks.css
|
|
139
|
-
- app/assets/stylesheets/foreman_tasks/tasks.scss
|
|
140
140
|
- app/assets/stylesheets/foreman_tasks/trigger_form.css
|
|
141
141
|
- app/controllers/foreman_tasks/api/recurring_logics_controller.rb
|
|
142
142
|
- app/controllers/foreman_tasks/api/tasks_controller.rb
|
|
@@ -210,6 +210,7 @@ files:
|
|
|
210
210
|
- app/views/foreman_tasks/api/recurring_logics/show.json.rabl
|
|
211
211
|
- app/views/foreman_tasks/api/recurring_logics/update.json.rabl
|
|
212
212
|
- app/views/foreman_tasks/api/tasks/details.json.rabl
|
|
213
|
+
- app/views/foreman_tasks/api/tasks/index.json.rabl
|
|
213
214
|
- app/views/foreman_tasks/api/tasks/show.json.rabl
|
|
214
215
|
- app/views/foreman_tasks/layouts/react.html.erb
|
|
215
216
|
- app/views/foreman_tasks/recurring_logics/_tab_related.html.erb
|
|
@@ -292,7 +293,6 @@ files:
|
|
|
292
293
|
- package.json
|
|
293
294
|
- script/npm_link_foreman_js.sh
|
|
294
295
|
- script/rails
|
|
295
|
-
- script/travis_run_js_tests.sh
|
|
296
296
|
- test/controllers/api/recurring_logics_controller_test.rb
|
|
297
297
|
- test/controllers/api/tasks_controller_test.rb
|
|
298
298
|
- test/controllers/recurring_logics_controller_test.rb
|
|
@@ -353,13 +353,16 @@ files:
|
|
|
353
353
|
- webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
|
|
354
354
|
- webpack/ForemanTasks/Components/TaskDetails/Components/RunningSteps.js
|
|
355
355
|
- webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
|
|
356
|
+
- webpack/ForemanTasks/Components/TaskDetails/Components/TaskButtons.js
|
|
356
357
|
- webpack/ForemanTasks/Components/TaskDetails/Components/TaskHelper.js
|
|
357
358
|
- webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js
|
|
359
|
+
- webpack/ForemanTasks/Components/TaskDetails/Components/TaskSkeleton.js
|
|
358
360
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Errors.test.js
|
|
359
361
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Locks.test.js
|
|
360
362
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Raw.test.js
|
|
361
363
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/RunningSteps.test.js
|
|
362
364
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Task.test.js
|
|
365
|
+
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskButtons.test.js
|
|
363
366
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskHelper.test.js
|
|
364
367
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskInfo.test.js
|
|
365
368
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Errors.test.js.snap
|
|
@@ -367,24 +370,20 @@ files:
|
|
|
367
370
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Raw.test.js.snap
|
|
368
371
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/RunningSteps.test.js.snap
|
|
369
372
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Task.test.js.snap
|
|
373
|
+
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskButtons.test.js.snap
|
|
370
374
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap
|
|
371
375
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetails.js
|
|
372
376
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetails.scss
|
|
373
377
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetails.stories.js
|
|
374
378
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetailsActions.js
|
|
375
379
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetailsConstants.js
|
|
376
|
-
- webpack/ForemanTasks/Components/TaskDetails/TaskDetailsReducer.js
|
|
377
380
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js
|
|
378
381
|
- webpack/ForemanTasks/Components/TaskDetails/TasksDetailsHelper.js
|
|
379
382
|
- webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.fixtures.js
|
|
380
383
|
- webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.test.js
|
|
381
384
|
- webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js
|
|
382
|
-
- webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsReducer.test.js
|
|
383
385
|
- webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetails.test.js.snap
|
|
384
386
|
- webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsActions.test.js.snap
|
|
385
|
-
- webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsReducer.test.js.snap
|
|
386
|
-
- webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/integration.test.js.snap
|
|
387
|
-
- webpack/ForemanTasks/Components/TaskDetails/__tests__/integration.test.js
|
|
388
387
|
- webpack/ForemanTasks/Components/TaskDetails/index.js
|
|
389
388
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/PausedTasksCard/PausedTasksCard.js
|
|
390
389
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/PausedTasksCard/PausedTasksCard.stories.js
|
|
@@ -399,12 +398,17 @@ files:
|
|
|
399
398
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/ScheduledTasksCard/ScheduledTasksCard.stories.js
|
|
400
399
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/ScheduledTasksCard/ScheduledTasksCard.test.js
|
|
401
400
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/ScheduledTasksCard/__snapshots__/ScheduledTasksCard.test.js.snap
|
|
401
|
+
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/OtherInfo.js
|
|
402
|
+
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/OtherInfo.test.js
|
|
402
403
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.js
|
|
403
404
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.scss
|
|
404
405
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.stories.js
|
|
405
406
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js
|
|
406
|
-
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/
|
|
407
|
+
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCardTable.js
|
|
408
|
+
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCardTable.test.js
|
|
409
|
+
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/__snapshots__/OtherInfo.test.js.snap
|
|
407
410
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/__snapshots__/StoppedTasksCard.test.js.snap
|
|
411
|
+
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/__snapshots__/StoppedTasksCardTable.test.js.snap
|
|
408
412
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/TasksDonutCard/TasksDonutCard.js
|
|
409
413
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/TasksDonutCard/TasksDonutCard.scss
|
|
410
414
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/TasksDonutCard/TasksDonutCard.stories.js
|
|
@@ -538,6 +542,7 @@ files:
|
|
|
538
542
|
- webpack/ForemanTasks/Components/common/ClickConfirmation/index.js
|
|
539
543
|
- webpack/ForemanTasks/Components/common/ToastsHelpers/ToastTypesConstants.js
|
|
540
544
|
- webpack/ForemanTasks/Components/common/ToastsHelpers/index.js
|
|
545
|
+
- webpack/ForemanTasks/Components/common/urlHelpers.js
|
|
541
546
|
- webpack/ForemanTasks/ForemanTasks.js
|
|
542
547
|
- webpack/ForemanTasks/ForemanTasks.test.js
|
|
543
548
|
- webpack/ForemanTasks/ForemanTasksReducers.js
|
|
@@ -570,15 +575,18 @@ files:
|
|
|
570
575
|
- webpack/__mocks__/foremanReact/components/common/table.js
|
|
571
576
|
- webpack/__mocks__/foremanReact/components/common/table/actionsHelpers/actionTypeCreator.js
|
|
572
577
|
- webpack/__mocks__/foremanReact/constants.js
|
|
573
|
-
- webpack/__mocks__/foremanReact/redux/API.js
|
|
578
|
+
- webpack/__mocks__/foremanReact/redux/API/APISelectors.js
|
|
579
|
+
- webpack/__mocks__/foremanReact/redux/API/index.js
|
|
574
580
|
- webpack/__mocks__/foremanReact/redux/actions/toasts.js
|
|
581
|
+
- webpack/__mocks__/foremanReact/redux/middlewares/IntervalMiddleware.js
|
|
575
582
|
- webpack/__mocks__/foremanReact/routes/common/PageLayout/PageLayout.js
|
|
576
583
|
- webpack/__mocks__/foremanReact/routes/common/PageLayout/components/ExportButton/ExportButton.js
|
|
577
584
|
- webpack/index.js
|
|
578
585
|
- webpack/stories/decorators/index.js
|
|
579
586
|
- webpack/stories/decorators/withCardsDecorator.js
|
|
580
587
|
homepage: https://github.com/theforeman/foreman-tasks
|
|
581
|
-
licenses:
|
|
588
|
+
licenses:
|
|
589
|
+
- GPL-3.0
|
|
582
590
|
metadata: {}
|
|
583
591
|
post_install_message:
|
|
584
592
|
rdoc_options: []
|
data/.travis.yml
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import Immutable from 'seamless-immutable';
|
|
2
|
-
import {
|
|
3
|
-
FOREMAN_TASK_DETAILS_FETCH_TASK_REQUEST,
|
|
4
|
-
FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS,
|
|
5
|
-
FOREMAN_TASK_DETAILS_STOP_POLLING,
|
|
6
|
-
FOREMAN_TASK_DETAILS_START_POLLING,
|
|
7
|
-
} from './TaskDetailsConstants';
|
|
8
|
-
|
|
9
|
-
const initialState = Immutable({});
|
|
10
|
-
|
|
11
|
-
export default (state = initialState, action) => {
|
|
12
|
-
const { type, payload } = action;
|
|
13
|
-
let { taskReload, timeoutId } = state;
|
|
14
|
-
|
|
15
|
-
switch (type) {
|
|
16
|
-
case FOREMAN_TASK_DETAILS_FETCH_TASK_REQUEST:
|
|
17
|
-
return state.set('loading', true);
|
|
18
|
-
case FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS:
|
|
19
|
-
if (payload.state === 'stopped') {
|
|
20
|
-
clearTimeout(state.timeoutId);
|
|
21
|
-
taskReload = false;
|
|
22
|
-
timeoutId = null;
|
|
23
|
-
}
|
|
24
|
-
return state.merge({
|
|
25
|
-
loading: false,
|
|
26
|
-
...payload,
|
|
27
|
-
taskReload,
|
|
28
|
-
timeoutId,
|
|
29
|
-
});
|
|
30
|
-
case FOREMAN_TASK_DETAILS_STOP_POLLING:
|
|
31
|
-
return state.merge({ taskReload: false, timeoutId: null });
|
|
32
|
-
case FOREMAN_TASK_DETAILS_START_POLLING:
|
|
33
|
-
clearTimeout(state.timeoutId);
|
|
34
|
-
return state.merge({ taskReload: true, timeoutId: payload.timeoutId });
|
|
35
|
-
default:
|
|
36
|
-
return state;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { testReducerSnapshotWithFixtures } from '@theforeman/test';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS,
|
|
5
|
-
FOREMAN_TASK_DETAILS_STOP_POLLING,
|
|
6
|
-
FOREMAN_TASK_DETAILS_START_POLLING,
|
|
7
|
-
} from '../TaskDetailsConstants';
|
|
8
|
-
import reducer from '../TaskDetailsReducer';
|
|
9
|
-
|
|
10
|
-
const fixtures = {
|
|
11
|
-
'should return the initial state': {},
|
|
12
|
-
'should handle FOREMAN_TASK_DETAILS_START_POLLING': {
|
|
13
|
-
action: {
|
|
14
|
-
type: FOREMAN_TASK_DETAILS_START_POLLING,
|
|
15
|
-
payload: { timeoutId: 1 },
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
'should handle FOREMAN_TASK_DETAILS_STOP_POLLING': {
|
|
19
|
-
action: {
|
|
20
|
-
type: FOREMAN_TASK_DETAILS_STOP_POLLING,
|
|
21
|
-
payload: { timeoutId: 1 },
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
'should handle FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS': {
|
|
25
|
-
action: {
|
|
26
|
-
type: FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS,
|
|
27
|
-
payload: { data: 'some-payload' },
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
describe('TaskDetails - Reducer', () =>
|
|
33
|
-
testReducerSnapshotWithFixtures(reducer, fixtures));
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`TaskDetails - Reducer should handle FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"data": "some-payload",
|
|
6
|
-
"loading": false,
|
|
7
|
-
"taskReload": undefined,
|
|
8
|
-
"timeoutId": undefined,
|
|
9
|
-
}
|
|
10
|
-
`;
|
|
11
|
-
|
|
12
|
-
exports[`TaskDetails - Reducer should handle FOREMAN_TASK_DETAILS_START_POLLING 1`] = `
|
|
13
|
-
Object {
|
|
14
|
-
"taskReload": true,
|
|
15
|
-
"timeoutId": 1,
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
exports[`TaskDetails - Reducer should handle FOREMAN_TASK_DETAILS_STOP_POLLING 1`] = `
|
|
20
|
-
Object {
|
|
21
|
-
"taskReload": false,
|
|
22
|
-
"timeoutId": null,
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
exports[`TaskDetails - Reducer should return the initial state 1`] = `Object {}`;
|
data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/integration.test.js.snap
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`TaskDetails integration test should change the data after reload: task details data should change 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"action": Array [
|
|
6
|
-
Array [
|
|
7
|
-
Object {
|
|
8
|
-
"payload": Object {
|
|
9
|
-
"timeoutId": 1,
|
|
10
|
-
},
|
|
11
|
-
"type": "FOREMAN_TASK_DETAILS_START_POLLING",
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
],
|
|
15
|
-
"state": Object {
|
|
16
|
-
"taskDetails": Object {
|
|
17
|
-
"label": "new-label",
|
|
18
|
-
"loading": false,
|
|
19
|
-
"taskReload": true,
|
|
20
|
-
"timeoutId": 1,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
exports[`TaskDetails integration test should change the data after reload: task details reload start without error 1`] = `
|
|
27
|
-
Array [
|
|
28
|
-
Array [
|
|
29
|
-
Object {
|
|
30
|
-
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_REQUEST",
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
Array [
|
|
34
|
-
Object {
|
|
35
|
-
"payload": Object {
|
|
36
|
-
"timeoutId": 1,
|
|
37
|
-
},
|
|
38
|
-
"type": "FOREMAN_TASK_DETAILS_START_POLLING",
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
Array [
|
|
42
|
-
Object {
|
|
43
|
-
"payload": Object {
|
|
44
|
-
"label": "new-label",
|
|
45
|
-
},
|
|
46
|
-
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS",
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
Array [
|
|
50
|
-
Object {
|
|
51
|
-
"payload": Object {
|
|
52
|
-
"timeoutId": 1,
|
|
53
|
-
},
|
|
54
|
-
"type": "FOREMAN_TASK_DETAILS_START_POLLING",
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
]
|
|
58
|
-
`;
|
|
59
|
-
|
|
60
|
-
exports[`TaskDetails integration test should flow: initial state 1`] = `
|
|
61
|
-
Object {
|
|
62
|
-
"taskDetails": Object {
|
|
63
|
-
"loading": true,
|
|
64
|
-
},
|
|
65
|
-
}
|
|
66
|
-
`;
|
|
67
|
-
|
|
68
|
-
exports[`TaskDetails integration test should flow: task details reload start with error 1`] = `
|
|
69
|
-
Array [
|
|
70
|
-
Array [
|
|
71
|
-
Object {
|
|
72
|
-
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_REQUEST",
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
Array [
|
|
76
|
-
Object {
|
|
77
|
-
"payload": Object {
|
|
78
|
-
"timeoutId": 1,
|
|
79
|
-
},
|
|
80
|
-
"type": "FOREMAN_TASK_DETAILS_START_POLLING",
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
Array [
|
|
84
|
-
Object {
|
|
85
|
-
"payload": [TypeError: Cannot read property 'data' of undefined],
|
|
86
|
-
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_FAILURE",
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
]
|
|
90
|
-
`;
|
|
91
|
-
|
|
92
|
-
exports[`TaskDetails integration test should flow: task details reload stop 1`] = `
|
|
93
|
-
Array [
|
|
94
|
-
Array [
|
|
95
|
-
Object {
|
|
96
|
-
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_REQUEST",
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
Array [
|
|
100
|
-
Object {
|
|
101
|
-
"payload": Object {
|
|
102
|
-
"timeoutId": 1,
|
|
103
|
-
},
|
|
104
|
-
"type": "FOREMAN_TASK_DETAILS_START_POLLING",
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
Array [
|
|
108
|
-
Object {
|
|
109
|
-
"payload": [TypeError: Cannot read property 'data' of undefined],
|
|
110
|
-
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_FAILURE",
|
|
111
|
-
},
|
|
112
|
-
],
|
|
113
|
-
Array [
|
|
114
|
-
Object {
|
|
115
|
-
"payload": Object {
|
|
116
|
-
"timeoutId": 1,
|
|
117
|
-
},
|
|
118
|
-
"type": "FOREMAN_TASK_DETAILS_STOP_POLLING",
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
]
|
|
122
|
-
`;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { API } from 'foremanReact/redux/API';
|
|
4
|
-
import { IntegrationTestHelper } from '@theforeman/test';
|
|
5
|
-
|
|
6
|
-
import TaskDetails, { reducers } from '../index';
|
|
7
|
-
import { selectForemanTasks } from '../../../ForemanTasksSelectors';
|
|
8
|
-
import { minProps } from './TaskDetails.fixtures';
|
|
9
|
-
|
|
10
|
-
jest.mock('../../../ForemanTasksSelectors');
|
|
11
|
-
jest.mock('foremanReact/redux/API');
|
|
12
|
-
selectForemanTasks.mockImplementation(state => state);
|
|
13
|
-
describe('TaskDetails integration test', () => {
|
|
14
|
-
beforeEach(() => {
|
|
15
|
-
jest.useFakeTimers();
|
|
16
|
-
const expectedIntervalId = 1;
|
|
17
|
-
jest.useFakeTimers();
|
|
18
|
-
setInterval.mockImplementation(() => expectedIntervalId);
|
|
19
|
-
delete window.location;
|
|
20
|
-
window.location = new URL(
|
|
21
|
-
'https://foreman.com/foreman_tasks/tasks/a15dd820-32f1-4ced-9ab7-c0fab8234c47/'
|
|
22
|
-
);
|
|
23
|
-
});
|
|
24
|
-
it('should flow', async () => {
|
|
25
|
-
window.location.reload = jest.fn();
|
|
26
|
-
|
|
27
|
-
API.get.mockImplementationOnce();
|
|
28
|
-
const integrationTestHelper = new IntegrationTestHelper(reducers);
|
|
29
|
-
|
|
30
|
-
const component = integrationTestHelper.mount(
|
|
31
|
-
<TaskDetails {...minProps} id="test" />
|
|
32
|
-
);
|
|
33
|
-
integrationTestHelper.takeStoreSnapshot('initial state');
|
|
34
|
-
|
|
35
|
-
const reloadButton = component.find('.reload-button').at(0);
|
|
36
|
-
reloadButton.simulate('click');
|
|
37
|
-
await IntegrationTestHelper.flushAllPromises();
|
|
38
|
-
|
|
39
|
-
integrationTestHelper.takeActionsSnapshot(
|
|
40
|
-
'task details reload start with error'
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
reloadButton.simulate('click');
|
|
44
|
-
await IntegrationTestHelper.flushAllPromises();
|
|
45
|
-
jest.advanceTimersByTime(1);
|
|
46
|
-
integrationTestHelper.takeActionsSnapshot('task details reload stop');
|
|
47
|
-
jest.useRealTimers();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('should change the data after reload', async () => {
|
|
51
|
-
API.get.mockImplementationOnce(() => ({
|
|
52
|
-
data: { label: 'new-label' },
|
|
53
|
-
}));
|
|
54
|
-
const integrationTestHelper = new IntegrationTestHelper(reducers);
|
|
55
|
-
|
|
56
|
-
const component = integrationTestHelper.mount(
|
|
57
|
-
<TaskDetails {...minProps} id="test" />
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
const reloadButton = component.find('.reload-button').at(0);
|
|
61
|
-
reloadButton.simulate('click');
|
|
62
|
-
|
|
63
|
-
await IntegrationTestHelper.flushAllPromises();
|
|
64
|
-
integrationTestHelper.takeActionsSnapshot(
|
|
65
|
-
'task details reload start without error'
|
|
66
|
-
);
|
|
67
|
-
integrationTestHelper.takeStoreAndLastActionSnapshot(
|
|
68
|
-
'task details data should change'
|
|
69
|
-
);
|
|
70
|
-
jest.useRealTimers();
|
|
71
|
-
});
|
|
72
|
-
});
|