foreman_ansible 2.3.4 → 2.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/app/helpers/foreman_ansible/ansible_roles_helper.rb +0 -4
  3. data/app/models/ansible_role.rb +0 -1
  4. data/app/views/foreman_ansible/ansible_roles/_select_tab_content.html.erb +13 -21
  5. data/config/routes.rb +1 -3
  6. data/lib/foreman_ansible/register.rb +1 -2
  7. data/lib/foreman_ansible/version.rb +1 -1
  8. data/locale/de/LC_MESSAGES/foreman_ansible.mo +0 -0
  9. data/locale/de/foreman_ansible.edit.po +696 -0
  10. data/locale/de/foreman_ansible.po.time_stamp +0 -0
  11. data/locale/en/LC_MESSAGES/foreman_ansible.mo +0 -0
  12. data/locale/en/foreman_ansible.edit.po +694 -0
  13. data/locale/en/foreman_ansible.po.time_stamp +0 -0
  14. data/locale/es/LC_MESSAGES/foreman_ansible.mo +0 -0
  15. data/locale/es/foreman_ansible.edit.po +696 -0
  16. data/locale/es/foreman_ansible.po.time_stamp +0 -0
  17. data/locale/fr/LC_MESSAGES/foreman_ansible.mo +0 -0
  18. data/locale/fr/foreman_ansible.edit.po +696 -0
  19. data/locale/fr/foreman_ansible.po.time_stamp +0 -0
  20. data/locale/it/LC_MESSAGES/foreman_ansible.mo +0 -0
  21. data/locale/it/foreman_ansible.edit.po +696 -0
  22. data/locale/it/foreman_ansible.po.time_stamp +0 -0
  23. data/locale/ja/LC_MESSAGES/foreman_ansible.mo +0 -0
  24. data/locale/ja/foreman_ansible.edit.po +696 -0
  25. data/locale/ja/foreman_ansible.po.time_stamp +0 -0
  26. data/locale/ko/LC_MESSAGES/foreman_ansible.mo +0 -0
  27. data/locale/ko/foreman_ansible.edit.po +696 -0
  28. data/locale/ko/foreman_ansible.po.time_stamp +0 -0
  29. data/locale/pt_BR/LC_MESSAGES/foreman_ansible.mo +0 -0
  30. data/locale/pt_BR/foreman_ansible.edit.po +696 -0
  31. data/locale/pt_BR/foreman_ansible.po.time_stamp +0 -0
  32. data/locale/ru/LC_MESSAGES/foreman_ansible.mo +0 -0
  33. data/locale/ru/foreman_ansible.edit.po +697 -0
  34. data/locale/ru/foreman_ansible.po.time_stamp +0 -0
  35. data/locale/zh_CN/LC_MESSAGES/foreman_ansible.mo +0 -0
  36. data/locale/zh_CN/foreman_ansible.edit.po +696 -0
  37. data/locale/zh_CN/foreman_ansible.po.time_stamp +0 -0
  38. data/locale/zh_TW/LC_MESSAGES/foreman_ansible.mo +0 -0
  39. data/locale/zh_TW/foreman_ansible.edit.po +696 -0
  40. data/locale/zh_TW/foreman_ansible.po.time_stamp +0 -0
  41. data/package.json +9 -50
  42. data/webpack/components/ReportJsonViewer.js +7 -11
  43. data/webpack/index.js +1 -25
  44. metadata +65 -73
  45. data/app/controllers/ui_ansible_roles_controller.rb +0 -14
  46. data/app/views/ui_ansible_roles/index.json.rabl +0 -3
  47. data/app/views/ui_ansible_roles/main.json.rabl +0 -3
  48. data/app/views/ui_ansible_roles/show.json.rabl +0 -3
  49. data/test/functional/ui_ansible_roles_controller_test.rb +0 -14
  50. data/webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js +0 -2
  51. data/webpack/__mocks__/foremanReact/components/common/EmptyState.js +0 -5
  52. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.js +0 -140
  53. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.scss +0 -45
  54. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherActions.js +0 -69
  55. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherConstants.js +0 -7
  56. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherHelpers.js +0 -7
  57. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherReducer.js +0 -69
  58. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherSelectors.js +0 -68
  59. data/webpack/components/AnsibleRolesSwitcher/__fixtures__/ansibleRolesData.fixtures.js +0 -20
  60. data/webpack/components/AnsibleRolesSwitcher/__fixtures__/ansibleRolesSwitcherReducer.fixtures.js +0 -36
  61. data/webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcher.test.js +0 -30
  62. data/webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherReducer.test.js +0 -73
  63. data/webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js +0 -43
  64. data/webpack/components/AnsibleRolesSwitcher/__tests__/__snapshots__/AnsibleRolesSwitcher.test.js.snap +0 -79
  65. data/webpack/components/AnsibleRolesSwitcher/__tests__/__snapshots__/AnsibleRolesSwitcherReducer.test.js.snap +0 -399
  66. data/webpack/components/AnsibleRolesSwitcher/__tests__/__snapshots__/AnsibleRolesSwitcherSelectors.test.js.snap +0 -60
  67. data/webpack/components/AnsibleRolesSwitcher/components/AnsiblePermissionDenied.js +0 -33
  68. data/webpack/components/AnsibleRolesSwitcher/components/AnsiblePermissionDenied.test.js +0 -9
  69. data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.js +0 -56
  70. data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.test.js +0 -26
  71. data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRoleActionButton.js +0 -16
  72. data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js +0 -32
  73. data/webpack/components/AnsibleRolesSwitcher/components/AssignedRolesList.js +0 -67
  74. data/webpack/components/AnsibleRolesSwitcher/components/AssignedRolesList.test.js +0 -19
  75. data/webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js +0 -52
  76. data/webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.test.js +0 -22
  77. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsiblePermissionDenied.test.js.snap +0 -26
  78. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsibleRole.test.js.snap +0 -108
  79. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AssignedRolesList.test.js.snap +0 -64
  80. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AvailableRolesList.test.js.snap +0 -54
  81. data/webpack/components/AnsibleRolesSwitcher/components/withProtectedView.js +0 -14
  82. data/webpack/components/AnsibleRolesSwitcher/index.js +0 -44
  83. data/webpack/reducer.js +0 -7
  84. data/webpack/test_setup.js +0 -11
File without changes
data/package.json CHANGED
@@ -7,75 +7,34 @@
7
7
  "test": "test"
8
8
  },
9
9
  "dependencies": {
10
- "babel-polyfill": "^6.26.0",
11
- "classnames": "^2.2.6",
12
- "lodash": "4.17.10",
13
- "patternfly": "^3.58.0",
14
- "patternfly-react": "^2.25.4",
15
- "prop-types": "^15.7.2",
16
- "react": "^16.6.3",
17
- "react-bootstrap": "^0.32.4",
18
- "react-dom": "^16.6.3",
19
- "react-json-tree": "^0.11.0",
20
- "reselect": "^3.0.1",
21
- "seamless-immutable": "7.1.2"
10
+ "react-json-tree": "^0.11.0"
22
11
  },
23
12
  "devDependencies": {
24
13
  "babel-eslint": "^8.2.1",
14
+ "babel-preset-env": "^1.6.0",
15
+ "babel-preset-react": "^6.24.1",
25
16
  "babel-plugin-lodash": "^3.3.2",
26
- "babel-plugin-transform-class-properties": "^6.24.1",
27
17
  "babel-plugin-transform-object-assign": "^6.22.0",
18
+ "babel-plugin-transform-class-properties": "^6.24.1",
28
19
  "babel-plugin-transform-object-rest-spread": "^6.26.0",
29
- "babel-preset-env": "^1.6.0",
30
- "babel-preset-react": "^6.24.1",
31
- "enzyme": "^3.7.0",
32
- "enzyme-adapter-react-16": "^1.7.0",
33
- "enzyme-to-json": "^3.3.5",
34
20
  "eslint": "^4.18.1",
35
21
  "eslint-config-airbnb": "^16.0.0",
36
22
  "eslint-plugin-import": "^2.8.0",
37
23
  "eslint-plugin-jest": "^21.2.0",
38
24
  "eslint-plugin-jsx-a11y": "^6.0.2",
39
- "eslint-plugin-patternfly-react": "^0.2.1",
40
- "eslint-plugin-react": "^7.4.0",
41
- "identity-obj-proxy": "^3.0.0",
42
- "jest": "^23.6.0",
43
- "prettier": "^1.16.4",
44
- "react-redux": "^6.0.0",
45
- "react-redux-test-utils": "^0.1.1",
46
- "redux": "^4.0.1",
47
- "redux-thunk": "^2.3.0"
25
+ "eslint-plugin-react": "^7.4.0"
48
26
  },
49
27
  "scripts": {
50
- "test": "node node_modules/.bin/jest webpack",
51
- "lint": "./node_modules/.bin/eslint -c .eslintrc webpack/ || exit 0"
28
+ "test": "echo \"Error: no test specified\" && exit 1"
52
29
  },
53
30
  "repository": {
54
31
  "type": "git",
55
- "url": "git+https://github.com/theforeman/foreman_ansible.git"
32
+ "url": "git+https://github.com/bastilian/foreman_ansible.git"
56
33
  },
57
34
  "author": "",
58
35
  "license": "ISC",
59
36
  "bugs": {
60
- "url": "https://projects.theforeman.org/projects/ansible"
37
+ "url": "https://github.com/bastilian/foreman_ansible/issues"
61
38
  },
62
- "homepage": "https://theforeman.org/plugins/foreman_ansible/",
63
- "jest": {
64
- "verbose": true,
65
- "moduleDirectories": [
66
- "node_modules",
67
- "webpack"
68
- ],
69
- "setupFiles": [
70
- "raf/polyfill",
71
- "./webpack/test_setup.js"
72
- ],
73
- "testPathIgnorePatterns": [
74
- "/node_modules/",
75
- "<rootDir>/foreman/"
76
- ],
77
- "moduleNameMapper": {
78
- "^.+\\.(css|scss)$": "identity-obj-proxy"
79
- }
80
- }
39
+ "homepage": "https://github.com/bastilian/foreman_ansible#readme"
81
40
  }
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import JSONTree from 'react-json-tree';
3
- import PropTypes from 'prop-types';
4
3
 
5
4
  const theme = {
6
5
  scheme: 'foreman',
@@ -8,14 +7,11 @@ const theme = {
8
7
  base00: 'rgba(0, 0, 0, 0)',
9
8
  };
10
9
 
11
- const ReportJsonViewer = ({ data }) => (
12
- <div className="report-json-viewer">
13
- <JSONTree data={this.props.data} hideRoot theme={theme} />
14
- </div>
15
- );
16
-
17
- ReportJsonViewer.propTypes = {
18
- data: PropTypes.object.isRequired,
19
- };
20
-
10
+ class ReportJsonViewer extends React.Component {
11
+ render() {
12
+ return <div className="report-json-viewer">
13
+ <JSONTree data={this.props.data} hideRoot theme={theme} />
14
+ </div>;
15
+ }
16
+ }
21
17
  export default ReportJsonViewer;
data/webpack/index.js CHANGED
@@ -1,28 +1,4 @@
1
1
  import componentRegistry from 'foremanReact/components/componentRegistry';
2
- import injectReducer from 'foremanReact/redux/reducers/registerReducer';
3
2
  import ReportJsonViewer from './components/ReportJsonViewer';
4
- import AnsibleRolesSwitcher from './components/AnsibleRolesSwitcher';
5
- import $ from 'jquery';
6
3
 
7
- import reducer from './reducer';
8
-
9
- componentRegistry.register({
10
- name: 'ReportJsonViewer',
11
- type: ReportJsonViewer,
12
- });
13
- componentRegistry.register({
14
- name: 'AnsibleRolesSwitcher',
15
- type: AnsibleRolesSwitcher,
16
- });
17
-
18
- injectReducer('foremanAnsible', reducer);
19
-
20
- window.tfm.initAnsibleRoleSwitcher = () => {
21
- $(document).on('ContentLoad', evt => {
22
- tfm.reactMounter.mount(
23
- 'AnsibleRolesSwitcher',
24
- '#ansible_roles_switcher',
25
- $('#ansible_roles_switcher').data('roles')
26
- );
27
- });
28
- }
4
+ componentRegistry.register({ name: 'ReportJsonViewer', type: ReportJsonViewer });
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: 2.3.4
4
+ version: 2.3.5
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: 2019-05-03 00:00:00.000000000 Z
11
+ date: 2019-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -134,7 +134,6 @@ files:
134
134
  - app/controllers/foreman_ansible/concerns/hosts_controller_extensions.rb
135
135
  - app/controllers/foreman_ansible/concerns/import_controller_helper.rb
136
136
  - app/controllers/foreman_ansible/concerns/job_invocation_helper.rb
137
- - app/controllers/ui_ansible_roles_controller.rb
138
137
  - app/helpers/foreman_ansible/ansible_plugin_helper.rb
139
138
  - app/helpers/foreman_ansible/ansible_reports_helper.rb
140
139
  - app/helpers/foreman_ansible/ansible_roles_helper.rb
@@ -213,9 +212,6 @@ files:
213
212
  - app/views/foreman_ansible/job_templates/puppet_run_once_-_ansible_default.erb
214
213
  - app/views/foreman_ansible/job_templates/run_command_-_ansible_default.erb
215
214
  - app/views/foreman_ansible/job_templates/service_action_-_ansible_default.erb
216
- - app/views/ui_ansible_roles/index.json.rabl
217
- - app/views/ui_ansible_roles/main.json.rabl
218
- - app/views/ui_ansible_roles/show.json.rabl
219
215
  - config/routes.rb
220
216
  - db/migrate/20160705082036_create_ansible_role.rb
221
217
  - db/migrate/20160706074540_create_join_table_hosts_ansible_roles.rb
@@ -237,19 +233,52 @@ files:
237
233
  - lib/foreman_ansible/version.rb
238
234
  - locale/Makefile
239
235
  - locale/action_names.rb
236
+ - locale/de/LC_MESSAGES/foreman_ansible.mo
237
+ - locale/de/foreman_ansible.edit.po
240
238
  - locale/de/foreman_ansible.po
239
+ - locale/de/foreman_ansible.po.time_stamp
240
+ - locale/en/LC_MESSAGES/foreman_ansible.mo
241
+ - locale/en/foreman_ansible.edit.po
241
242
  - locale/en/foreman_ansible.po
243
+ - locale/en/foreman_ansible.po.time_stamp
244
+ - locale/es/LC_MESSAGES/foreman_ansible.mo
245
+ - locale/es/foreman_ansible.edit.po
242
246
  - locale/es/foreman_ansible.po
247
+ - locale/es/foreman_ansible.po.time_stamp
243
248
  - locale/foreman_ansible.pot
249
+ - locale/fr/LC_MESSAGES/foreman_ansible.mo
250
+ - locale/fr/foreman_ansible.edit.po
244
251
  - locale/fr/foreman_ansible.po
252
+ - locale/fr/foreman_ansible.po.time_stamp
245
253
  - locale/gemspec.rb
254
+ - locale/it/LC_MESSAGES/foreman_ansible.mo
255
+ - locale/it/foreman_ansible.edit.po
246
256
  - locale/it/foreman_ansible.po
257
+ - locale/it/foreman_ansible.po.time_stamp
258
+ - locale/ja/LC_MESSAGES/foreman_ansible.mo
259
+ - locale/ja/foreman_ansible.edit.po
247
260
  - locale/ja/foreman_ansible.po
261
+ - locale/ja/foreman_ansible.po.time_stamp
262
+ - locale/ko/LC_MESSAGES/foreman_ansible.mo
263
+ - locale/ko/foreman_ansible.edit.po
248
264
  - locale/ko/foreman_ansible.po
265
+ - locale/ko/foreman_ansible.po.time_stamp
266
+ - locale/pt_BR/LC_MESSAGES/foreman_ansible.mo
267
+ - locale/pt_BR/foreman_ansible.edit.po
249
268
  - locale/pt_BR/foreman_ansible.po
269
+ - locale/pt_BR/foreman_ansible.po.time_stamp
270
+ - locale/ru/LC_MESSAGES/foreman_ansible.mo
271
+ - locale/ru/foreman_ansible.edit.po
250
272
  - locale/ru/foreman_ansible.po
273
+ - locale/ru/foreman_ansible.po.time_stamp
274
+ - locale/zh_CN/LC_MESSAGES/foreman_ansible.mo
275
+ - locale/zh_CN/foreman_ansible.edit.po
251
276
  - locale/zh_CN/foreman_ansible.po
277
+ - locale/zh_CN/foreman_ansible.po.time_stamp
278
+ - locale/zh_TW/LC_MESSAGES/foreman_ansible.mo
279
+ - locale/zh_TW/foreman_ansible.edit.po
252
280
  - locale/zh_TW/foreman_ansible.po
281
+ - locale/zh_TW/foreman_ansible.po.time_stamp
253
282
  - package.json
254
283
  - test/factories/ansible_proxy.rb
255
284
  - test/factories/ansible_roles.rb
@@ -264,7 +293,6 @@ files:
264
293
  - test/functional/api/v2/hostgroups_controller_test.rb
265
294
  - test/functional/api/v2/hosts_controller_test.rb
266
295
  - test/functional/hosts_controller_test.rb
267
- - test/functional/ui_ansible_roles_controller_test.rb
268
296
  - test/test_plugin_helper.rb
269
297
  - test/unit/actions/run_ansible_job_test.rb
270
298
  - test/unit/actions/run_proxy_ansible_command_test.rb
@@ -291,43 +319,8 @@ files:
291
319
  - test/unit/services/roles_importer_test.rb
292
320
  - test/unit/services/structured_fact_importer_test.rb
293
321
  - test/unit/services/ui_roles_importer_test.rb
294
- - webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js
295
- - webpack/__mocks__/foremanReact/components/common/EmptyState.js
296
- - webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.js
297
- - webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.scss
298
- - webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherActions.js
299
- - webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherConstants.js
300
- - webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherHelpers.js
301
- - webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherReducer.js
302
- - webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherSelectors.js
303
- - webpack/components/AnsibleRolesSwitcher/__fixtures__/ansibleRolesData.fixtures.js
304
- - webpack/components/AnsibleRolesSwitcher/__fixtures__/ansibleRolesSwitcherReducer.fixtures.js
305
- - webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcher.test.js
306
- - webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherReducer.test.js
307
- - webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
308
- - webpack/components/AnsibleRolesSwitcher/__tests__/__snapshots__/AnsibleRolesSwitcher.test.js.snap
309
- - webpack/components/AnsibleRolesSwitcher/__tests__/__snapshots__/AnsibleRolesSwitcherReducer.test.js.snap
310
- - webpack/components/AnsibleRolesSwitcher/__tests__/__snapshots__/AnsibleRolesSwitcherSelectors.test.js.snap
311
- - webpack/components/AnsibleRolesSwitcher/components/AnsiblePermissionDenied.js
312
- - webpack/components/AnsibleRolesSwitcher/components/AnsiblePermissionDenied.test.js
313
- - webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.js
314
- - webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.test.js
315
- - webpack/components/AnsibleRolesSwitcher/components/AnsibleRoleActionButton.js
316
- - webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
317
- - webpack/components/AnsibleRolesSwitcher/components/AssignedRolesList.js
318
- - webpack/components/AnsibleRolesSwitcher/components/AssignedRolesList.test.js
319
- - webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
320
- - webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.test.js
321
- - webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsiblePermissionDenied.test.js.snap
322
- - webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsibleRole.test.js.snap
323
- - webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AssignedRolesList.test.js.snap
324
- - webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AvailableRolesList.test.js.snap
325
- - webpack/components/AnsibleRolesSwitcher/components/withProtectedView.js
326
- - webpack/components/AnsibleRolesSwitcher/index.js
327
322
  - webpack/components/ReportJsonViewer.js
328
323
  - webpack/index.js
329
- - webpack/reducer.js
330
- - webpack/test_setup.js
331
324
  homepage: https://github.com/theforeman/foreman_ansible
332
325
  licenses:
333
326
  - GPL-3.0
@@ -348,48 +341,47 @@ required_rubygems_version: !ruby/object:Gem::Requirement
348
341
  version: '0'
349
342
  requirements: []
350
343
  rubyforge_project:
351
- rubygems_version: 2.6.13
344
+ rubygems_version: 2.6.8
352
345
  signing_key:
353
346
  specification_version: 4
354
347
  summary: Ansible integration with Foreman (theforeman.org)
355
348
  test_files:
356
- - test/factories/ansible_proxy.rb
357
- - test/factories/ansible_roles.rb
358
- - test/factories/ansible_variables.rb
359
- - test/fixtures/insights_playbook.yaml
360
- - test/fixtures/report.json
361
- - test/fixtures/sample_facts.json
362
- - test/functional/ansible_roles_controller_test.rb
363
- - test/functional/api/v2/ansible_roles_controller_test.rb
364
- - test/functional/api/v2/ansible_variables_controller_test.rb
365
- - test/functional/api/v2/hostgroups_controller_test.rb
366
- - test/functional/api/v2/hosts_controller_test.rb
367
- - test/functional/hosts_controller_test.rb
368
- - test/functional/ui_ansible_roles_controller_test.rb
369
- - test/functional/ansible_variables_controller_test.rb
370
- - test/test_plugin_helper.rb
371
- - test/unit/actions/run_ansible_job_test.rb
372
- - test/unit/actions/run_proxy_ansible_command_test.rb
373
- - test/unit/ansible_provider_test.rb
349
+ - test/unit/host_ansible_role_test.rb
350
+ - test/unit/helpers/ansible_reports_helper_test.rb
374
351
  - test/unit/ansible_role_test.rb
375
- - test/unit/ansible_variable_test.rb
376
352
  - test/unit/concerns/config_reports_extensions_test.rb
377
353
  - test/unit/concerns/host_managed_extensions_test.rb
378
354
  - test/unit/concerns/hostgroup_extensions_test.rb
379
- - test/unit/helpers/ansible_reports_helper_test.rb
380
- - test/unit/host_ansible_role_test.rb
381
- - test/unit/hostgroup_ansible_role_test.rb
382
355
  - test/unit/lib/foreman_ansible_core/command_creator_test.rb
383
356
  - test/unit/lib/foreman_ansible_core/playbook_runner_test.rb
384
357
  - test/unit/lib/proxy_api/ansible_test.rb
385
- - test/unit/services/ansible_report_importer_test.rb
386
- - test/unit/services/ansible_variables_importer_test.rb
387
- - test/unit/services/api_roles_importer_test.rb
358
+ - test/unit/ansible_provider_test.rb
359
+ - test/unit/ansible_variable_test.rb
360
+ - test/unit/hostgroup_ansible_role_test.rb
388
361
  - test/unit/services/fact_importer_test.rb
389
- - test/unit/services/fact_parser_test.rb
390
- - test/unit/services/fact_sparser_test.rb
391
- - test/unit/services/insights_plan_runner_test.rb
392
- - test/unit/services/roles_importer_test.rb
393
- - test/unit/services/structured_fact_importer_test.rb
394
362
  - test/unit/services/ui_roles_importer_test.rb
395
363
  - test/unit/services/inventory_creator_test.rb
364
+ - test/unit/services/roles_importer_test.rb
365
+ - test/unit/services/insights_plan_runner_test.rb
366
+ - test/unit/services/fact_parser_test.rb
367
+ - test/unit/services/ansible_variables_importer_test.rb
368
+ - test/unit/services/api_roles_importer_test.rb
369
+ - test/unit/services/structured_fact_importer_test.rb
370
+ - test/unit/services/fact_sparser_test.rb
371
+ - test/unit/services/ansible_report_importer_test.rb
372
+ - test/unit/actions/run_proxy_ansible_command_test.rb
373
+ - test/unit/actions/run_ansible_job_test.rb
374
+ - test/test_plugin_helper.rb
375
+ - test/functional/hosts_controller_test.rb
376
+ - test/functional/api/v2/hosts_controller_test.rb
377
+ - test/functional/api/v2/ansible_roles_controller_test.rb
378
+ - test/functional/api/v2/ansible_variables_controller_test.rb
379
+ - test/functional/api/v2/hostgroups_controller_test.rb
380
+ - test/functional/ansible_roles_controller_test.rb
381
+ - test/functional/ansible_variables_controller_test.rb
382
+ - test/factories/ansible_roles.rb
383
+ - test/factories/ansible_proxy.rb
384
+ - test/factories/ansible_variables.rb
385
+ - test/fixtures/report.json
386
+ - test/fixtures/sample_facts.json
387
+ - test/fixtures/insights_playbook.yaml
@@ -1,14 +0,0 @@
1
- class UiAnsibleRolesController < ::Api::V2::BaseController
2
- def resource_name(resource = 'AnsibleRole')
3
- super resource
4
- end
5
-
6
- def index
7
- @ui_ansible_roles = resource_scope_for_index(:permission => :view_ansible_roles)
8
- end
9
-
10
- # restore original method from find_common to ignore resource nesting
11
- def resource_scope(options = {})
12
- @resource_scope ||= scope_for(resource_class, options)
13
- end
14
- end
@@ -1,3 +0,0 @@
1
- collection @ui_ansible_roles
2
-
3
- extends "ui_ansible_roles/main"
@@ -1,3 +0,0 @@
1
- object @ansible_role
2
-
3
- extends "ui_ansible_roles/show"
@@ -1,3 +0,0 @@
1
- object @ansible_role
2
-
3
- extends "api/v2/ansible_roles/show"
@@ -1,14 +0,0 @@
1
- require 'test_plugin_helper'
2
-
3
- class UiAnsibleRolesControllerTest < ActionController::TestCase
4
- setup do
5
- @role = FactoryBot.create(:ansible_role)
6
- end
7
-
8
- test 'should respond with roles' do
9
- get :index, :params => {}, :session => set_session_user
10
- assert_response :success
11
- res = JSON.parse @response.body
12
- assert_equal res['total'], res['results'].size
13
- end
14
- end
@@ -1,2 +0,0 @@
1
- const PaginationWrapper = () => jest.fn();
2
- export default PaginationWrapper;
@@ -1,5 +0,0 @@
1
- const EmptyState = () => jest.fn();
2
-
3
- export const EmptyStatePattern = () => jest.fn();
4
-
5
- export default EmptyState;
@@ -1,140 +0,0 @@
1
- import React from 'react';
2
- import { Grid, Row, Col } from 'patternfly-react';
3
- import { lowerCase } from 'lodash';
4
- import PropTypes from 'prop-types';
5
-
6
- import AvailableRolesList from './components/AvailableRolesList';
7
- import AssignedRolesList from './components/AssignedRolesList';
8
- import AnsibleRolesSwitcherError from './components/AnsibleRolesSwitcherError';
9
- import { excludeAssignedRolesSearch } from './AnsibleRolesSwitcherHelpers';
10
-
11
- class AnsibleRolesSwitcher extends React.Component {
12
- componentDidMount() {
13
- const {
14
- initialAssignedRoles,
15
- availableRolesUrl,
16
- inheritedRoleIds,
17
- resourceId,
18
- resourceName,
19
- } = this.props.data;
20
-
21
- this.props.getAnsibleRoles(
22
- availableRolesUrl,
23
- initialAssignedRoles,
24
- inheritedRoleIds,
25
- resourceId,
26
- resourceName,
27
- { page: 1, perPage: 10 },
28
- excludeAssignedRolesSearch(initialAssignedRoles)
29
- );
30
- }
31
-
32
- render() {
33
- const {
34
- loading,
35
- pagination,
36
- itemCount,
37
- addAnsibleRole,
38
- removeAnsibleRole,
39
- getAnsibleRoles,
40
- changeAssignedPage,
41
- assignedPagination,
42
- assignedRolesCount,
43
- assignedRoles,
44
- allAssignedRoles,
45
- unassignedRoles,
46
- error,
47
- } = this.props;
48
-
49
- const {
50
- availableRolesUrl,
51
- inheritedRoleIds,
52
- resourceId,
53
- resourceName,
54
- } = this.props.data;
55
-
56
- const onListingChange = paginationArgs =>
57
- getAnsibleRoles(
58
- availableRolesUrl,
59
- allAssignedRoles,
60
- inheritedRoleIds,
61
- resourceId,
62
- resourceName,
63
- paginationArgs,
64
- excludeAssignedRolesSearch(allAssignedRoles)
65
- );
66
-
67
- return (
68
- <Grid bsClass="container-fluid" id="ansibleRolesSwitcher">
69
- <Row className="row-eq-height">
70
- <AnsibleRolesSwitcherError error={error} />
71
- <Col sm={6} className="available-roles-container">
72
- <div className="available-roles-header">
73
- <h2>{__('Available Ansible Roles')}</h2>
74
- </div>
75
- <AvailableRolesList
76
- unassignedRoles={unassignedRoles}
77
- pagination={pagination}
78
- itemCount={itemCount}
79
- onListingChange={onListingChange}
80
- onAddRole={addAnsibleRole}
81
- loading={loading}
82
- />
83
- </Col>
84
-
85
- <Col sm={6} className="assigned-roles-container">
86
- <div className="assigned-roles-header">
87
- <h2>{__('Assigned Ansible Roles')}</h2>
88
- </div>
89
- <AssignedRolesList
90
- assignedRoles={assignedRoles}
91
- pagination={assignedPagination}
92
- itemCount={assignedRolesCount}
93
- onPaginationChange={changeAssignedPage}
94
- onRemoveRole={removeAnsibleRole}
95
- resourceName={lowerCase(resourceName || '')}
96
- />
97
- </Col>
98
- </Row>
99
- </Grid>
100
- );
101
- }
102
- }
103
-
104
- AnsibleRolesSwitcher.propTypes = {
105
- data: PropTypes.shape({
106
- initialAssignedRoles: PropTypes.arrayOf(PropTypes.object),
107
- availableRolesUrl: PropTypes.string,
108
- inheritedRoleIds: PropTypes.arrayOf(PropTypes.number),
109
- resourceId: PropTypes.number,
110
- resourceName: PropTypes.string,
111
- }).isRequired,
112
- getAnsibleRoles: PropTypes.func.isRequired,
113
- loading: PropTypes.bool.isRequired,
114
- pagination: PropTypes.shape({
115
- page: PropTypes.number,
116
- perPage: PropTypes.number,
117
- }).isRequired,
118
- itemCount: PropTypes.number.isRequired,
119
- addAnsibleRole: PropTypes.func.isRequired,
120
- removeAnsibleRole: PropTypes.func.isRequired,
121
- changeAssignedPage: PropTypes.func.isRequired,
122
- assignedPagination: PropTypes.shape({
123
- page: PropTypes.number,
124
- perPage: PropTypes.number,
125
- }).isRequired,
126
- assignedRolesCount: PropTypes.number.isRequired,
127
- assignedRoles: PropTypes.arrayOf(PropTypes.object).isRequired,
128
- allAssignedRoles: PropTypes.arrayOf(PropTypes.object).isRequired,
129
- unassignedRoles: PropTypes.arrayOf(PropTypes.object).isRequired,
130
- error: PropTypes.shape({
131
- errorMsg: PropTypes.string,
132
- statusText: PropTypes.string,
133
- }),
134
- };
135
-
136
- AnsibleRolesSwitcher.defaultProps = {
137
- error: {},
138
- };
139
-
140
- export default AnsibleRolesSwitcher;