foreman_ansible 8.0.0 → 8.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/db/migrate/20200421201839_update_ansible_inv_template_name.rb +1 -5
- data/lib/foreman_ansible/version.rb +1 -1
- data/webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/EditRolesForm.js +10 -8
- data/webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/index.js +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ae2b6a17514b657c6d7fa74889675aff19f214da4f923d8bca2bc02e62a8b45
|
4
|
+
data.tar.gz: c51baa9cc8ab0ae30c86e9dcc4353f9696ec4dc999d2a1b37a37d1196f8fdb53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21cd91f053a0f88fd02e8b312bba23da2b3d0d8f28b578f8a14c6b66294198c336cbdf6eb69ea31c3f75e762c503b36710629870fce900a772ddfbe1fcb60fd3
|
7
|
+
data.tar.gz: 373026d1e7cfea4c30f715dfbb409ce6159081cc321fe315c35c89de5bc3a9b132b1e317b192caab40f24238e22cbfa331cec5d4ef26e3f19de56cf5b901e6fa
|
@@ -1,9 +1,5 @@
|
|
1
1
|
class UpdateAnsibleInvTemplateName < ActiveRecord::Migration[5.2]
|
2
2
|
def up
|
3
|
-
Setting
|
4
|
-
end
|
5
|
-
|
6
|
-
def down
|
7
|
-
Setting.where(:name => 'ansible_inventory_template').update_all(:default => 'Ansible Inventory')
|
3
|
+
# Setting defaults are updated automatically now
|
8
4
|
end
|
9
5
|
end
|
data/webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/EditRolesForm.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useState } from 'react';
|
2
2
|
import { translate as __ } from 'foremanReact/common/I18n';
|
3
3
|
import PropTypes from 'prop-types';
|
4
|
-
|
4
|
+
import { isEqual } from 'lodash';
|
5
5
|
import { useMutation } from '@apollo/client';
|
6
6
|
|
7
7
|
import { Button, Modal, Spinner } from '@patternfly/react-core';
|
@@ -21,12 +21,10 @@ const EditRolesForm = props => {
|
|
21
21
|
actions,
|
22
22
|
} = props;
|
23
23
|
|
24
|
-
const
|
25
|
-
|
26
|
-
);
|
27
|
-
const [chosenOptions, setChosenOptions] = useState(
|
28
|
-
assignedRoles.map(item => item.name)
|
29
|
-
);
|
24
|
+
const initAvailableOpt = availableRoles.map(item => item.name);
|
25
|
+
const initChosenOpt = assignedRoles.map(item => item.name);
|
26
|
+
const [availableOptions, setAvailableOptions] = useState(initAvailableOpt);
|
27
|
+
const [chosenOptions, setChosenOptions] = useState(initChosenOpt);
|
30
28
|
|
31
29
|
const onListChange = (nextAvailable, nextChosen) => {
|
32
30
|
setAvailableOptions(nextAvailable);
|
@@ -45,12 +43,16 @@ const EditRolesForm = props => {
|
|
45
43
|
ansibleRoleIds: roleNamesToIds(allRoles, chosenOptions),
|
46
44
|
};
|
47
45
|
|
46
|
+
const didNotModifyOptions = () =>
|
47
|
+
isEqual(initAvailableOpt.sort(), availableOptions.sort()) &&
|
48
|
+
isEqual(initChosenOpt, chosenOptions); // The order of the chosen options is important.
|
49
|
+
|
48
50
|
const formActions = [
|
49
51
|
<Button
|
50
52
|
key="confirm"
|
51
53
|
variant="primary"
|
52
54
|
onClick={() => callMutation({ variables })}
|
53
|
-
isDisabled={loading}
|
55
|
+
isDisabled={loading || didNotModifyOptions()}
|
54
56
|
aria-label="submit ansible roles"
|
55
57
|
>
|
56
58
|
{__('Confirm')}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_ansible
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.0.
|
4
|
+
version: 8.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Lobato Garcia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: acts_as_list
|