foreman_remote_execution 11.1.0 → 12.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.packit.yaml +1 -1
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +0 -8
- data/.tx/config +2 -2
- data/app/assets/javascripts/foreman_remote_execution/locale/de/foreman_remote_execution.js +1587 -1
- data/app/assets/javascripts/foreman_remote_execution/locale/en/foreman_remote_execution.js +1578 -1
- data/app/assets/javascripts/foreman_remote_execution/locale/en_GB/foreman_remote_execution.js +1587 -1
- data/app/assets/javascripts/foreman_remote_execution/locale/es/foreman_remote_execution.js +1588 -1
- data/app/assets/javascripts/foreman_remote_execution/locale/fr/foreman_remote_execution.js +1589 -1
- data/app/assets/javascripts/foreman_remote_execution/locale/ja/foreman_remote_execution.js +1585 -1
- data/app/assets/javascripts/foreman_remote_execution/locale/ka/foreman_remote_execution.js +1587 -0
- data/app/assets/javascripts/foreman_remote_execution/locale/ko/foreman_remote_execution.js +1586 -1
- data/app/assets/javascripts/foreman_remote_execution/locale/pt_BR/foreman_remote_execution.js +1588 -1
- data/app/assets/javascripts/foreman_remote_execution/locale/ru/foreman_remote_execution.js +1589 -1
- data/app/assets/javascripts/foreman_remote_execution/locale/zh_CN/foreman_remote_execution.js +1585 -1
- data/app/assets/javascripts/foreman_remote_execution/locale/zh_TW/foreman_remote_execution.js +1587 -1
- data/app/helpers/remote_execution_helper.rb +5 -0
- data/app/lib/actions/remote_execution/event_helpers.rb +42 -0
- data/app/lib/actions/remote_execution/run_host_job.rb +3 -16
- data/app/lib/actions/remote_execution/run_hosts_job.rb +7 -5
- data/app/models/concerns/api/v2/hosts_controller_extensions.rb +12 -0
- data/app/views/api/v2/job_invocations/base.json.rabl +14 -0
- data/app/views/templates/script/convert2rhel_analyze.erb +1 -6
- data/config/routes.rb +2 -0
- data/db/migrate/20151215114631_add_host_id_to_template_invocation.rb +1 -1
- data/db/migrate/20151217092555_migrate_to_task_groups.rb +1 -1
- data/db/migrate/20160113162007_expand_all_template_invocations.rb +2 -2
- data/db/migrate/20160114125628_rename_job_name_to_job_category.rb +2 -2
- data/db/migrate/20200623073022_rename_sudo_password_to_effective_user_password.rb +2 -2
- data/db/migrate/20220321101835_rename_ssh_provider_to_script.rb +1 -1
- data/extra/cockpit/foreman-cockpit-session +1 -1
- data/foreman_remote_execution.gemspec +3 -1
- data/lib/foreman_remote_execution/engine.rb +12 -3
- data/lib/foreman_remote_execution/version.rb +1 -1
- data/locale/Makefile +3 -4
- data/locale/action_names.rb +0 -3
- data/locale/de/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/de/foreman_remote_execution.po +71 -23
- data/locale/en/foreman_remote_execution.po +71 -23
- data/locale/en_GB/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/en_GB/foreman_remote_execution.po +71 -23
- data/locale/es/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/es/foreman_remote_execution.po +72 -24
- data/locale/foreman_remote_execution.pot +239 -176
- data/locale/fr/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/fr/foreman_remote_execution.po +72 -24
- data/locale/ja/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/ja/foreman_remote_execution.po +72 -24
- data/locale/ka/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/ka/foreman_remote_execution.po +1576 -0
- data/locale/ko/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/ko/foreman_remote_execution.po +71 -23
- data/locale/pt_BR/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/pt_BR/foreman_remote_execution.po +72 -24
- data/locale/ru/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/ru/foreman_remote_execution.po +71 -23
- data/locale/zh_CN/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/zh_CN/foreman_remote_execution.po +72 -24
- data/locale/zh_TW/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/zh_TW/foreman_remote_execution.po +71 -23
- data/test/unit/actions/run_hosts_job_test.rb +1 -1
- data/test/unit/api_params_test.rb +2 -10
- data/webpack/JobInvocationDetail/JobInvocationActions.js +22 -0
- data/webpack/JobInvocationDetail/JobInvocationConstants.js +7 -0
- data/webpack/JobInvocationDetail/JobInvocationOverview.js +104 -0
- data/webpack/JobInvocationDetail/JobInvocationSelectors.js +5 -0
- data/webpack/JobInvocationDetail/index.js +77 -0
- data/webpack/JobWizard/JobWizardPageRerun.js +10 -25
- data/webpack/JobWizard/index.js +9 -18
- data/webpack/JobWizard/steps/HostsAndInputs/hostgroups.gql +1 -1
- data/webpack/Routes/routes.js +6 -0
- data/webpack/react_app/components/FeaturesDropdown/actions.js +4 -2
- data/webpack/react_app/components/FeaturesDropdown/constants.js +5 -0
- data/webpack/react_app/components/FeaturesDropdown/index.js +53 -14
- data/webpack/react_app/components/FeaturesDropdown/index.scss +11 -0
- data/webpack/react_app/extend/Fills.js +6 -0
- metadata +24 -10
- data/webpack/react_app/components/FeaturesDropdown/constant.js +0 -3
- /data/test/graphql/mutations/job_invocations/{create.rb → create_test.rb} +0 -0
- /data/test/unit/{renderer_scope_input.rb → renderer_scope_input_test.rb} +0 -0
@@ -11,58 +11,83 @@ import { push } from 'connected-react-router';
|
|
11
11
|
|
12
12
|
import { useAPI } from 'foremanReact/common/hooks/API/APIHooks';
|
13
13
|
import { translate as __ } from 'foremanReact/common/I18n';
|
14
|
-
import { foremanUrl } from 'foremanReact/common/helpers';
|
14
|
+
import { foremanUrl, propsToCamelCase } from 'foremanReact/common/helpers';
|
15
15
|
import { STATUS } from 'foremanReact/constants';
|
16
16
|
|
17
|
-
import {
|
17
|
+
import {
|
18
|
+
REX_FEATURES_HOST_URL,
|
19
|
+
ALL_REX_FEATURES_URL,
|
20
|
+
NEW_JOB_PAGE,
|
21
|
+
ALL_HOSTS_NEW_JOB_PAGE,
|
22
|
+
} from './constants';
|
18
23
|
import { runFeature } from './actions';
|
24
|
+
import './index.scss';
|
19
25
|
|
20
|
-
const FeaturesDropdown = ({
|
26
|
+
const FeaturesDropdown = ({
|
27
|
+
hostId,
|
28
|
+
hostSearch,
|
29
|
+
hostResponse,
|
30
|
+
selectedCount,
|
31
|
+
}) => {
|
21
32
|
const [isOpen, setIsOpen] = useState(false);
|
22
|
-
const
|
23
|
-
|
24
|
-
|
25
|
-
|
33
|
+
const isSingleHost = !!hostId; // identifies whether we're on the host details or host overview page
|
34
|
+
const rexFeaturesUrl = isSingleHost
|
35
|
+
? REX_FEATURES_HOST_URL(hostId)
|
36
|
+
: ALL_REX_FEATURES_URL;
|
37
|
+
const { response, status } = useAPI('get', foremanUrl(rexFeaturesUrl));
|
26
38
|
const dispatch = useDispatch();
|
27
|
-
|
28
|
-
|
39
|
+
const permissions = propsToCamelCase(
|
40
|
+
(isSingleHost ? response?.permissions : hostResponse?.response) || {}
|
41
|
+
);
|
42
|
+
const canRunJob = isSingleHost
|
43
|
+
? permissions.canRunJob
|
44
|
+
: permissions.canCreateJobInvocations;
|
29
45
|
if (!canRunJob) {
|
30
46
|
return null;
|
31
47
|
}
|
32
|
-
|
33
|
-
const features =
|
48
|
+
|
49
|
+
const features = isSingleHost
|
50
|
+
? response?.remote_execution_features // eslint-disable-line camelcase
|
51
|
+
: response?.results;
|
34
52
|
const dropdownItems = features
|
35
53
|
?.filter(feature => feature.host_action_button)
|
36
54
|
?.map(({ name, label, id, description }) => (
|
37
55
|
<DropdownItem
|
38
|
-
onClick={() => dispatch(runFeature(hostId, label, name))}
|
56
|
+
onClick={() => dispatch(runFeature(hostId, label, name, hostSearch))}
|
39
57
|
key={id}
|
40
58
|
description={description}
|
41
59
|
>
|
42
60
|
{name}
|
43
61
|
</DropdownItem>
|
44
62
|
));
|
63
|
+
const newJobPageUrl = hostId
|
64
|
+
? `${NEW_JOB_PAGE}=${hostId}`
|
65
|
+
: `${ALL_HOSTS_NEW_JOB_PAGE}=${hostSearch}`;
|
45
66
|
const scheduleJob = [
|
46
67
|
<DropdownToggleAction
|
47
|
-
onClick={() => dispatch(push(
|
68
|
+
onClick={() => dispatch(push(newJobPageUrl))}
|
48
69
|
key="schedule-job-action"
|
49
70
|
>
|
50
71
|
{__('Schedule a job')}
|
51
72
|
</DropdownToggleAction>,
|
52
73
|
];
|
53
74
|
|
75
|
+
const disableDropdown = !isSingleHost && selectedCount === 0;
|
76
|
+
|
54
77
|
return (
|
55
78
|
<Dropdown
|
56
79
|
ouiaId="schedule-a-job-dropdown"
|
80
|
+
id="schedule-a-job-dropdown"
|
57
81
|
alignments={{ default: 'right' }}
|
58
82
|
onSelect={() => setIsOpen(false)}
|
59
83
|
toggle={
|
60
84
|
<DropdownToggle
|
61
85
|
ouiaId="schedule-a-job-dropdown-toggle"
|
86
|
+
id="schedule-a-job-dropdown-toggle"
|
62
87
|
splitButtonItems={scheduleJob}
|
63
88
|
toggleVariant="secondary"
|
64
89
|
onToggle={() => setIsOpen(prev => !prev)}
|
65
|
-
isDisabled={status === STATUS.PENDING}
|
90
|
+
isDisabled={status === STATUS.PENDING || disableDropdown}
|
66
91
|
splitButtonVariant="action"
|
67
92
|
/>
|
68
93
|
}
|
@@ -74,9 +99,23 @@ const FeaturesDropdown = ({ hostId }) => {
|
|
74
99
|
|
75
100
|
FeaturesDropdown.propTypes = {
|
76
101
|
hostId: PropTypes.number,
|
102
|
+
hostSearch: PropTypes.string,
|
103
|
+
selectedCount: PropTypes.number,
|
104
|
+
hostResponse: PropTypes.shape({
|
105
|
+
response: PropTypes.shape({
|
106
|
+
results: PropTypes.arrayOf(
|
107
|
+
PropTypes.shape({
|
108
|
+
can_create_job_invocations: PropTypes.bool,
|
109
|
+
})
|
110
|
+
),
|
111
|
+
}),
|
112
|
+
}),
|
77
113
|
};
|
78
114
|
FeaturesDropdown.defaultProps = {
|
79
115
|
hostId: undefined,
|
116
|
+
hostSearch: undefined,
|
117
|
+
selectedCount: 0,
|
118
|
+
hostResponse: undefined,
|
80
119
|
};
|
81
120
|
|
82
121
|
export default FeaturesDropdown;
|
@@ -38,6 +38,12 @@ const fills = [
|
|
38
38
|
component: props => <FeaturesDropdown {...props} />,
|
39
39
|
weight: 1000,
|
40
40
|
},
|
41
|
+
{
|
42
|
+
slot: '_all-hosts-schedule-a-job',
|
43
|
+
name: '_all-hosts-schedule-a-job',
|
44
|
+
component: props => <FeaturesDropdown {...props} />,
|
45
|
+
weight: 1000,
|
46
|
+
},
|
41
47
|
];
|
42
48
|
|
43
49
|
const registerFills = () => {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_remote_execution
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 12.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Foreman Remote Execution team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|
@@ -50,14 +50,14 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 8.
|
53
|
+
version: 8.3.0
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 8.
|
60
|
+
version: 8.3.0
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: factory_bot_rails
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- app/assets/javascripts/foreman_remote_execution/locale/es/foreman_remote_execution.js
|
121
121
|
- app/assets/javascripts/foreman_remote_execution/locale/fr/foreman_remote_execution.js
|
122
122
|
- app/assets/javascripts/foreman_remote_execution/locale/ja/foreman_remote_execution.js
|
123
|
+
- app/assets/javascripts/foreman_remote_execution/locale/ka/foreman_remote_execution.js
|
123
124
|
- app/assets/javascripts/foreman_remote_execution/locale/ko/foreman_remote_execution.js
|
124
125
|
- app/assets/javascripts/foreman_remote_execution/locale/pt_BR/foreman_remote_execution.js
|
125
126
|
- app/assets/javascripts/foreman_remote_execution/locale/ru/foreman_remote_execution.js
|
@@ -162,6 +163,7 @@ files:
|
|
162
163
|
- app/helpers/job_invocations_helper.rb
|
163
164
|
- app/helpers/remote_execution_helper.rb
|
164
165
|
- app/lib/actions/middleware/bind_job_invocation.rb
|
166
|
+
- app/lib/actions/remote_execution/event_helpers.rb
|
165
167
|
- app/lib/actions/remote_execution/proxy_action.rb
|
166
168
|
- app/lib/actions/remote_execution/run_host_job.rb
|
167
169
|
- app/lib/actions/remote_execution/run_hosts_job.rb
|
@@ -171,6 +173,7 @@ files:
|
|
171
173
|
- app/lib/proxy_api/remote_execution_ssh.rb
|
172
174
|
- app/mailers/.gitkeep
|
173
175
|
- app/mailers/rex_job_mailer.rb
|
176
|
+
- app/models/concerns/api/v2/hosts_controller_extensions.rb
|
174
177
|
- app/models/concerns/api/v2/interfaces_controller_extensions.rb
|
175
178
|
- app/models/concerns/foreman_remote_execution/bookmark_extensions.rb
|
176
179
|
- app/models/concerns/foreman_remote_execution/errors_flattener.rb
|
@@ -381,6 +384,8 @@ files:
|
|
381
384
|
- locale/gemspec.rb
|
382
385
|
- locale/ja/LC_MESSAGES/foreman_remote_execution.mo
|
383
386
|
- locale/ja/foreman_remote_execution.po
|
387
|
+
- locale/ka/LC_MESSAGES/foreman_remote_execution.mo
|
388
|
+
- locale/ka/foreman_remote_execution.po
|
384
389
|
- locale/ko/LC_MESSAGES/foreman_remote_execution.mo
|
385
390
|
- locale/ko/foreman_remote_execution.po
|
386
391
|
- locale/pt_BR/LC_MESSAGES/foreman_remote_execution.mo
|
@@ -405,7 +410,7 @@ files:
|
|
405
410
|
- test/functional/job_invocations_controller_test.rb
|
406
411
|
- test/functional/job_templates_controller_test.rb
|
407
412
|
- test/functional/ui_job_wizard_controller_test.rb
|
408
|
-
- test/graphql/mutations/job_invocations/
|
413
|
+
- test/graphql/mutations/job_invocations/create_test.rb
|
409
414
|
- test/graphql/queries/job_invocation_query_test.rb
|
410
415
|
- test/graphql/queries/job_invocations_query_test.rb
|
411
416
|
- test/helpers/remote_execution_helper_test.rb
|
@@ -426,9 +431,14 @@ files:
|
|
426
431
|
- test/unit/job_template_test.rb
|
427
432
|
- test/unit/remote_execution_feature_test.rb
|
428
433
|
- test/unit/remote_execution_provider_test.rb
|
429
|
-
- test/unit/
|
434
|
+
- test/unit/renderer_scope_input_test.rb
|
430
435
|
- test/unit/targeting_test.rb
|
431
436
|
- test/unit/template_invocation_input_value_test.rb
|
437
|
+
- webpack/JobInvocationDetail/JobInvocationActions.js
|
438
|
+
- webpack/JobInvocationDetail/JobInvocationConstants.js
|
439
|
+
- webpack/JobInvocationDetail/JobInvocationOverview.js
|
440
|
+
- webpack/JobInvocationDetail/JobInvocationSelectors.js
|
441
|
+
- webpack/JobInvocationDetail/index.js
|
432
442
|
- webpack/JobWizard/Footer.js
|
433
443
|
- webpack/JobWizard/JobWizard.js
|
434
444
|
- webpack/JobWizard/JobWizard.scss
|
@@ -513,8 +523,9 @@ files:
|
|
513
523
|
- webpack/helpers.js
|
514
524
|
- webpack/index.js
|
515
525
|
- webpack/react_app/components/FeaturesDropdown/actions.js
|
516
|
-
- webpack/react_app/components/FeaturesDropdown/
|
526
|
+
- webpack/react_app/components/FeaturesDropdown/constants.js
|
517
527
|
- webpack/react_app/components/FeaturesDropdown/index.js
|
528
|
+
- webpack/react_app/components/FeaturesDropdown/index.scss
|
518
529
|
- webpack/react_app/components/HostKebab/KebabItems.js
|
519
530
|
- webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
|
520
531
|
- webpack/react_app/components/RecentJobsCard/RecentJobsCard.js
|
@@ -572,7 +583,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
572
583
|
requirements:
|
573
584
|
- - ">="
|
574
585
|
- !ruby/object:Gem::Version
|
575
|
-
version: '
|
586
|
+
version: '2.7'
|
587
|
+
- - "<"
|
588
|
+
- !ruby/object:Gem::Version
|
589
|
+
version: '4'
|
576
590
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
577
591
|
requirements:
|
578
592
|
- - ">="
|
@@ -598,7 +612,7 @@ test_files:
|
|
598
612
|
- test/functional/job_invocations_controller_test.rb
|
599
613
|
- test/functional/job_templates_controller_test.rb
|
600
614
|
- test/functional/ui_job_wizard_controller_test.rb
|
601
|
-
- test/graphql/mutations/job_invocations/
|
615
|
+
- test/graphql/mutations/job_invocations/create_test.rb
|
602
616
|
- test/graphql/queries/job_invocation_query_test.rb
|
603
617
|
- test/graphql/queries/job_invocations_query_test.rb
|
604
618
|
- test/helpers/remote_execution_helper_test.rb
|
@@ -619,6 +633,6 @@ test_files:
|
|
619
633
|
- test/unit/job_template_test.rb
|
620
634
|
- test/unit/remote_execution_feature_test.rb
|
621
635
|
- test/unit/remote_execution_provider_test.rb
|
622
|
-
- test/unit/
|
636
|
+
- test/unit/renderer_scope_input_test.rb
|
623
637
|
- test/unit/targeting_test.rb
|
624
638
|
- test/unit/template_invocation_input_value_test.rb
|
File without changes
|
File without changes
|