foreman_openbolt 1.4.0 → 1.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71f5e8b870d9c27a1314ab3b2567fab231b6c23b460b615a10053003513ce619
4
- data.tar.gz: b1454607486de4a76b8d2a9cf230f25d9ca5c47cbd70ae24384eddd9328fbbe2
3
+ metadata.gz: 37171790fefde34897e4dfdbe3779e4680184ed30fc0e40e641c96bc333c556d
4
+ data.tar.gz: 6f00eab4409198f55d5dbbd1ac2c7996bd698cda17728df3c4d07fb6a3fd11b9
5
5
  SHA512:
6
- metadata.gz: 9fbb0751b94c7173b802ff6a267f2e1ceaf5a8d34f6f1c1e93fe61e5561015623bc3dd9fd4d35af629ee8d8f3b48e6c060abc3a1b87bcc34eaf9e03ace4716db
7
- data.tar.gz: 296caaa91415bddec17f00197ed7dcfdeff7ebe3dda78995e288e7ac3398d053422e0e8b2035270dcbb3c86bc589c2b6016c4e6cb830e19a079e2bb86b8a8d47
6
+ metadata.gz: 4d55d4db6008a4dff12b3717e6c81382ddb3fe1cdab4880df7bdebfb89a9eed6d889e339561e0be36169123e639e065e801ca77b8d2f1f65bc0c1090a13d75e7
7
+ data.tar.gz: 21986d2aa6037f8e40679d166dcce8534ac1e1aaf795dba56fe9b9187b760f36023a6a1ae73186bfb0bc20bf1f83e9cad065e59382262489da24878be6d98be1
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanOpenbolt
4
- VERSION = '1.4.0'
4
+ VERSION = '1.5.0'
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_openbolt",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "OpenBolt integration into Foreman",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -46,8 +46,12 @@ const HostSelector = ({
46
46
  const [errorText, setErrorText] = useState('');
47
47
  const [hostsSearchQuery, setHostsSearchQuery] = useState('');
48
48
  const [selectedTargets, setSelectedTargets] = useState({
49
- hosts: [],
50
- hostGroups: [],
49
+ hosts: selectedHosts?.map(name => ({ id: -1, name })) || [],
50
+ hostGroups:
51
+ selectedHostGroups?.map(name => ({
52
+ id: -1,
53
+ name,
54
+ })) || [],
51
55
  });
52
56
  const [isLoading, setIsLoading] = useState(false);
53
57
  const [fetchError, setFetchError] = useState('');
@@ -174,13 +178,6 @@ const HostSelector = ({
174
178
  </MenuToggle>
175
179
  );
176
180
 
177
- useEffect(() => {
178
- setSelectedTargets({
179
- hosts: selectedHosts?.map(name => ({ id: -1, name })),
180
- hostGroups: selectedHostGroups?.map(name => ({ id: -1, name })),
181
- });
182
- }, [selectedHosts, selectedHostGroups]);
183
-
184
181
  return (
185
182
  <div className="host-selector">
186
183
  <FormGroup fieldId="host-selector" label={__('Hosts')}>
@@ -37,8 +37,8 @@ const LaunchTask = () => {
37
37
 
38
38
  /* States */
39
39
  const [selectedProxy, setSelectedProxy] = useState('');
40
- const [targets, setTargets] = useState([]);
41
- const [hostGroups, setHostGroups] = useState([]);
40
+ const [targets, setTargets] = useState(state?.targets || []);
41
+ const [hostGroups, setHostGroups] = useState(state?.hostGroups || []);
42
42
  const [isSubmitting, setIsSubmitting] = useState(false);
43
43
 
44
44
  /* Custom hooks for data fetching */
@@ -213,8 +213,6 @@ const LaunchTask = () => {
213
213
  handleProxyChange(null, String(state.smartProxy.id));
214
214
  if (state?.taskName) handleTaskChange(null, state.taskName);
215
215
  if (state?.taskParameters) setTaskParameters(state.taskParameters);
216
- if (state?.targets) setTargets(state.targets);
217
- if (state?.hostGroups) setHostGroups(state.hostGroups);
218
216
  }, []);
219
217
 
220
218
  /* Rendering */
@@ -75,6 +75,11 @@ const TaskExecution = () => {
75
75
  ? `OpenBolt command: ${jobCommand}\n${stripAnsi(jobData.log)}`
76
76
  : '';
77
77
 
78
+ const failedTargets =
79
+ jobResult?.items
80
+ ?.filter(item => item?.status !== 'success')
81
+ ?.map(item => item?.target) || null;
82
+
78
83
  return (
79
84
  <Stack hasGutter>
80
85
  <StackItem>
@@ -111,6 +116,27 @@ const TaskExecution = () => {
111
116
  {__('Re-Run Task')}
112
117
  </Button>
113
118
  </FlexItem>
119
+ {failedTargets ? (
120
+ <FlexItem>
121
+ <Button
122
+ variant="secondary"
123
+ onClick={() =>
124
+ history.push({
125
+ pathname: ROUTES.PAGES.LAUNCH_TASK,
126
+ state: {
127
+ smartProxy,
128
+ taskName,
129
+ taskParameters,
130
+ targets: failedTargets,
131
+ },
132
+ })
133
+ }
134
+ className="pf-v5-u-mb-md"
135
+ >
136
+ {__('Re-Run failed targets')}
137
+ </Button>
138
+ </FlexItem>
139
+ ) : null}
114
140
  </Flex>
115
141
  </StackItem>
116
142
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_openbolt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Overlook InfraTech