foreman_remote_execution 4.5.1 → 4.7.0
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/ruby_ci.yml +7 -0
- data/app/controllers/ui_job_wizard_controller.rb +7 -0
- data/app/graphql/types/job_invocation.rb +16 -0
- data/app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb +5 -1
- data/app/helpers/remote_execution_helper.rb +9 -3
- data/app/lib/actions/remote_execution/run_hosts_job.rb +1 -1
- data/app/models/job_invocation_composer.rb +3 -3
- data/app/models/job_template.rb +1 -1
- data/app/models/remote_execution_feature.rb +5 -1
- data/app/models/remote_execution_provider.rb +1 -1
- data/app/views/templates/ssh/module_action.erb +1 -0
- data/app/views/templates/ssh/power_action.erb +2 -0
- data/app/views/templates/ssh/puppet_run_once.erb +1 -0
- data/foreman_remote_execution.gemspec +2 -4
- data/lib/foreman_remote_execution/engine.rb +3 -0
- data/lib/foreman_remote_execution/version.rb +1 -1
- data/test/graphql/queries/job_invocation_query_test.rb +31 -0
- data/test/graphql/queries/job_invocations_query_test.rb +35 -0
- data/test/unit/concerns/host_extensions_test.rb +4 -4
- data/test/unit/input_template_renderer_test.rb +1 -89
- data/test/unit/job_invocation_composer_test.rb +1 -12
- data/webpack/JobWizard/JobWizard.js +28 -8
- data/webpack/JobWizard/JobWizard.scss +39 -0
- data/webpack/JobWizard/JobWizardConstants.js +10 -0
- data/webpack/JobWizard/JobWizardSelectors.js +9 -0
- data/webpack/JobWizard/__tests__/fixtures.js +104 -2
- data/webpack/JobWizard/__tests__/integration.test.js +13 -85
- data/webpack/JobWizard/steps/AdvancedFields/AdvancedFields.js +21 -4
- data/webpack/JobWizard/steps/AdvancedFields/DescriptionField.js +67 -0
- data/webpack/JobWizard/steps/AdvancedFields/Fields.js +73 -59
- data/webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js +135 -16
- data/webpack/JobWizard/steps/AdvancedFields/__tests__/DescriptionField.test.js +23 -0
- data/webpack/JobWizard/steps/CategoryAndTemplate/CategoryAndTemplate.test.js +122 -51
- data/webpack/JobWizard/steps/Schedule/QueryType.js +48 -0
- data/webpack/JobWizard/steps/Schedule/RepeatOn.js +61 -0
- data/webpack/JobWizard/steps/Schedule/ScheduleType.js +25 -0
- data/webpack/JobWizard/steps/Schedule/StartEndDates.js +51 -0
- data/webpack/JobWizard/steps/Schedule/__tests__/StartEndDates.test.js +22 -0
- data/webpack/JobWizard/steps/Schedule/index.js +41 -0
- data/webpack/JobWizard/steps/form/FormHelpers.js +1 -0
- data/webpack/JobWizard/steps/form/Formatter.js +149 -0
- data/webpack/JobWizard/steps/form/NumberInput.js +33 -0
- data/webpack/JobWizard/steps/form/SelectField.js +14 -2
- data/webpack/JobWizard/steps/form/__tests__/Formatter.test.js.example +76 -0
- data/webpack/__mocks__/foremanReact/components/SearchBar.js +18 -1
- data/webpack/react_app/components/RecentJobsCard/JobStatusIcon.js +43 -0
- data/webpack/react_app/components/RecentJobsCard/RecentJobsCard.js +72 -66
- data/webpack/react_app/components/RecentJobsCard/RecentJobsTable.js +98 -0
- data/webpack/react_app/components/RecentJobsCard/constants.js +11 -0
- data/webpack/react_app/components/RecentJobsCard/styles.scss +11 -0
- data/webpack/react_app/components/TargetingHosts/__tests__/__snapshots__/TargetingHostsPage.test.js.snap +1 -0
- data/webpack/react_app/extend/fillRecentJobsCard.js +1 -1
- metadata +23 -27
- data/webpack/JobWizard/__tests__/JobWizard.test.js +0 -13
- data/webpack/JobWizard/__tests__/__snapshots__/JobWizard.test.js.snap +0 -32
- data/webpack/JobWizard/steps/AdvancedFields/__tests__/__snapshots__/AdvancedFields.test.js.snap +0 -249
- data/webpack/JobWizard/steps/CategoryAndTemplate/__snapshots__/CategoryAndTemplate.test.js.snap +0 -113
- data/webpack/JobWizard/steps/form/__tests__/GroupedSelectField.test.js +0 -38
- data/webpack/JobWizard/steps/form/__tests__/SelectField.test.js +0 -23
- data/webpack/JobWizard/steps/form/__tests__/__snapshots__/GroupedSelectField.test.js.snap +0 -37
- data/webpack/JobWizard/steps/form/__tests__/__snapshots__/SelectField.test.js.snap +0 -23
- data/webpack/react_app/components/RecentJobsCard/styles.css +0 -15
data/webpack/JobWizard/steps/CategoryAndTemplate/__snapshots__/CategoryAndTemplate.test.js.snap
DELETED
@@ -1,113 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`CategoryAndTemplate rendering render with error 1`] = `
|
4
|
-
<Fragment>
|
5
|
-
<Title
|
6
|
-
headingLevel="h2"
|
7
|
-
>
|
8
|
-
Category and Template
|
9
|
-
</Title>
|
10
|
-
<Text
|
11
|
-
component="p"
|
12
|
-
>
|
13
|
-
All fields are required.
|
14
|
-
</Text>
|
15
|
-
<Form>
|
16
|
-
<SelectField
|
17
|
-
fieldId="job_category"
|
18
|
-
isDisabled={false}
|
19
|
-
label="Job category"
|
20
|
-
options={Array []}
|
21
|
-
placeholderText=""
|
22
|
-
setValue={[Function]}
|
23
|
-
value={null}
|
24
|
-
/>
|
25
|
-
<GroupedSelectField
|
26
|
-
fieldId="job_template"
|
27
|
-
groups={Array []}
|
28
|
-
isDisabled={true}
|
29
|
-
label="Job template"
|
30
|
-
placeholderText="Error"
|
31
|
-
selected={null}
|
32
|
-
setSelected={[MockFunction]}
|
33
|
-
/>
|
34
|
-
<Alert
|
35
|
-
title="Errors:"
|
36
|
-
variant="danger"
|
37
|
-
>
|
38
|
-
<span>
|
39
|
-
Templates list failed with:
|
40
|
-
|
41
|
-
I have an error
|
42
|
-
</span>
|
43
|
-
</Alert>
|
44
|
-
</Form>
|
45
|
-
</Fragment>
|
46
|
-
`;
|
47
|
-
|
48
|
-
exports[`CategoryAndTemplate rendering renders with props 1`] = `
|
49
|
-
<Fragment>
|
50
|
-
<Title
|
51
|
-
headingLevel="h2"
|
52
|
-
>
|
53
|
-
Category and Template
|
54
|
-
</Title>
|
55
|
-
<Text
|
56
|
-
component="p"
|
57
|
-
>
|
58
|
-
All fields are required.
|
59
|
-
</Text>
|
60
|
-
<Form>
|
61
|
-
<SelectField
|
62
|
-
fieldId="job_category"
|
63
|
-
isDisabled={false}
|
64
|
-
label="Job category"
|
65
|
-
options={
|
66
|
-
Array [
|
67
|
-
"Commands",
|
68
|
-
"Ansible Playbook",
|
69
|
-
"Ansible Galaxy",
|
70
|
-
"Ansible Roles Installation",
|
71
|
-
]
|
72
|
-
}
|
73
|
-
placeholderText=""
|
74
|
-
setValue={[Function]}
|
75
|
-
value="I am a category"
|
76
|
-
/>
|
77
|
-
<GroupedSelectField
|
78
|
-
fieldId="job_template"
|
79
|
-
groups={
|
80
|
-
Array [
|
81
|
-
Object {
|
82
|
-
"groupLabel": "SSH",
|
83
|
-
"options": Array [
|
84
|
-
Object {
|
85
|
-
"label": "ab Run Command - SSH Default clone",
|
86
|
-
"value": 190,
|
87
|
-
},
|
88
|
-
],
|
89
|
-
},
|
90
|
-
Object {
|
91
|
-
"groupLabel": "Ansible",
|
92
|
-
"options": Array [
|
93
|
-
Object {
|
94
|
-
"label": "Ansible Roles - Ansible Default",
|
95
|
-
"value": 168,
|
96
|
-
},
|
97
|
-
Object {
|
98
|
-
"label": "Ansible Roles - Install from git",
|
99
|
-
"value": 170,
|
100
|
-
},
|
101
|
-
],
|
102
|
-
},
|
103
|
-
]
|
104
|
-
}
|
105
|
-
isDisabled={false}
|
106
|
-
label="Job template"
|
107
|
-
placeholderText=""
|
108
|
-
selected="ab Run Command - SSH Default clone"
|
109
|
-
setSelected={[MockFunction]}
|
110
|
-
/>
|
111
|
-
</Form>
|
112
|
-
</Fragment>
|
113
|
-
`;
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import * as patternfly from '@patternfly/react-core';
|
3
|
-
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
4
|
-
import { GroupedSelectField } from '../GroupedSelectField';
|
5
|
-
|
6
|
-
jest.spyOn(patternfly, 'Select');
|
7
|
-
jest.spyOn(patternfly, 'SelectOption');
|
8
|
-
patternfly.Select.mockImplementation(props => <div>{props}</div>);
|
9
|
-
patternfly.SelectOption.mockImplementation(props => <div>{props}</div>);
|
10
|
-
|
11
|
-
const fixtures = {
|
12
|
-
'renders with props': {
|
13
|
-
label: 'grouped select',
|
14
|
-
fieldId: 'field-id',
|
15
|
-
groups: [
|
16
|
-
{
|
17
|
-
groupLabel: 'Ansible',
|
18
|
-
options: [
|
19
|
-
{
|
20
|
-
label: 'Ansible Roles - Ansible Default',
|
21
|
-
value: 168,
|
22
|
-
},
|
23
|
-
{
|
24
|
-
label: 'Ansible Roles - Install from git',
|
25
|
-
value: 170,
|
26
|
-
},
|
27
|
-
],
|
28
|
-
},
|
29
|
-
],
|
30
|
-
selected: 170,
|
31
|
-
setSelected: jest.fn(),
|
32
|
-
},
|
33
|
-
};
|
34
|
-
|
35
|
-
describe('GroupedSelectField', () => {
|
36
|
-
describe('rendering', () =>
|
37
|
-
testComponentSnapshotsWithFixtures(GroupedSelectField, fixtures));
|
38
|
-
});
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import * as patternfly from '@patternfly/react-core';
|
3
|
-
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
4
|
-
import { SelectField } from '../SelectField';
|
5
|
-
|
6
|
-
jest.spyOn(patternfly, 'Select');
|
7
|
-
jest.spyOn(patternfly, 'SelectOption');
|
8
|
-
patternfly.Select.mockImplementation(props => <div>{props}</div>);
|
9
|
-
patternfly.SelectOption.mockImplementation(props => <div>{props}</div>);
|
10
|
-
const fixtures = {
|
11
|
-
'renders with props': {
|
12
|
-
label: 'grouped select',
|
13
|
-
fieldId: 'field-id',
|
14
|
-
options: ['Commands'],
|
15
|
-
value: 'Commands',
|
16
|
-
setValue: jest.fn(),
|
17
|
-
},
|
18
|
-
};
|
19
|
-
|
20
|
-
describe('SelectField', () => {
|
21
|
-
describe('rendering', () =>
|
22
|
-
testComponentSnapshotsWithFixtures(SelectField, fixtures));
|
23
|
-
});
|
@@ -1,37 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`GroupedSelectField rendering renders with props 1`] = `
|
4
|
-
<FormGroup
|
5
|
-
fieldId="field-id"
|
6
|
-
label="grouped select"
|
7
|
-
>
|
8
|
-
<mockConstructor
|
9
|
-
className="without_select2"
|
10
|
-
isGrouped={true}
|
11
|
-
isOpen={false}
|
12
|
-
menuAppendTo={[Function]}
|
13
|
-
onClear={[Function]}
|
14
|
-
onFilter={[Function]}
|
15
|
-
onSelect={[Function]}
|
16
|
-
onToggle={[Function]}
|
17
|
-
selections={170}
|
18
|
-
variant="typeahead"
|
19
|
-
>
|
20
|
-
<SelectGroup
|
21
|
-
key="0"
|
22
|
-
label="Ansible"
|
23
|
-
>
|
24
|
-
<mockConstructor
|
25
|
-
key="0"
|
26
|
-
onClick={[Function]}
|
27
|
-
value="Ansible Roles - Ansible Default"
|
28
|
-
/>
|
29
|
-
<mockConstructor
|
30
|
-
key="1"
|
31
|
-
onClick={[Function]}
|
32
|
-
value="Ansible Roles - Install from git"
|
33
|
-
/>
|
34
|
-
</SelectGroup>
|
35
|
-
</mockConstructor>
|
36
|
-
</FormGroup>
|
37
|
-
`;
|
@@ -1,23 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`SelectField rendering renders with props 1`] = `
|
4
|
-
<FormGroup
|
5
|
-
fieldId="field-id"
|
6
|
-
label="grouped select"
|
7
|
-
>
|
8
|
-
<mockConstructor
|
9
|
-
className="without_select2"
|
10
|
-
isOpen={false}
|
11
|
-
maxHeight="45vh"
|
12
|
-
menuAppendTo={[Function]}
|
13
|
-
onSelect={[Function]}
|
14
|
-
onToggle={[Function]}
|
15
|
-
selections="Commands"
|
16
|
-
>
|
17
|
-
<mockConstructor
|
18
|
-
key="0"
|
19
|
-
value="Commands"
|
20
|
-
/>
|
21
|
-
</mockConstructor>
|
22
|
-
</FormGroup>
|
23
|
-
`;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
.properties-side-panel-pf-property-value {
|
2
|
-
font-size: 14px !important;
|
3
|
-
margin-top: 8px;
|
4
|
-
word-break: break-word;
|
5
|
-
}
|
6
|
-
|
7
|
-
.properties-side-panel-pf-property-label {
|
8
|
-
font-weight: 700 !important;
|
9
|
-
font-size: 14px !important;
|
10
|
-
margin: 0 !important;
|
11
|
-
}
|
12
|
-
|
13
|
-
.properties-side-panel-pf-property {
|
14
|
-
margin-top: 24px;
|
15
|
-
}
|