foreman_ansible 8.0.0 → 8.0.1

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: 47b85dc5fe69b87ea05703f75380a2387deb64674755903ec03c3cb55dcc3bdb
4
- data.tar.gz: ece7521c8b3f6da727abd6abad8be7384701a1598f6601dc5baf0b1f579931df
3
+ metadata.gz: 3ae2b6a17514b657c6d7fa74889675aff19f214da4f923d8bca2bc02e62a8b45
4
+ data.tar.gz: c51baa9cc8ab0ae30c86e9dcc4353f9696ec4dc999d2a1b37a37d1196f8fdb53
5
5
  SHA512:
6
- metadata.gz: f72ecf4fc7949815787bd4b93c1da3ee7df5baf2c2266950ddc6bd01b701ae38559896ae45b11995fa3574c84f041e01d7caf41ba1e18ba4b9c0c2cea397b752
7
- data.tar.gz: cee830b49ad5443db42d34e6e0910e0783b2d116f91b02745a8556e184b4e66535c3620b4e9c15b4329a35286d117df51a0bba3e7d7ae818ab1016a63636e61c
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.where(:name => 'ansible_inventory_template').update_all(:default => 'Ansible - Ansible Inventory')
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
@@ -4,5 +4,5 @@
4
4
  # This way other parts of Foreman can just call ForemanAnsible::VERSION
5
5
  # and detect what version the plugin is running.
6
6
  module ForemanAnsible
7
- VERSION = '8.0.0'
7
+ VERSION = '8.0.1'
8
8
  end
@@ -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 [availableOptions, setAvailableOptions] = useState(
25
- availableRoles.map(item => item.name)
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')}
@@ -20,7 +20,7 @@ const EditRolesModal = ({
20
20
  canEditHost,
21
21
  }) => {
22
22
  const baseModalProps = {
23
- width: '70%',
23
+ width: '50%',
24
24
  isOpen,
25
25
  className: 'foreman-modal',
26
26
  showClose: false,
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.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-05-16 00:00:00.000000000 Z
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