foreman_acd 0.9.7 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -19
  3. data/app/controllers/ui_acd_controller.rb +1 -1
  4. data/db/migrate/20210503122809_add_git_url_to_ansible_playbooks.rb +1 -1
  5. data/lib/foreman_acd/engine.rb +4 -10
  6. data/lib/foreman_acd/plugin.rb +1 -1
  7. data/lib/foreman_acd/version.rb +1 -1
  8. data/package.json +5 -3
  9. data/test/controllers/ui_acd_controller_test.rb +1 -1
  10. data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +210 -121
  11. data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +79 -91
  12. data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +30 -15
  13. data/webpack/components/ApplicationDefinition/ApplicationDefinitionHelper.js +15 -15
  14. data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +96 -63
  15. data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +22 -11
  16. data/webpack/components/ApplicationDefinition/__fixtures__/{applicationDefinitionConfData_1.fixtures.js → applicationDefinitionConfData1.fixtures.js} +77 -105
  17. data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionReducer.fixtures.js +49 -29
  18. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinition.test.js +4 -4
  19. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionHelper.test.js +16 -0
  20. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionReducer.test.js +0 -5
  21. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionSelectors.test.js +25 -25
  22. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionReducer.test.js.snap +9 -1
  23. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionSelectors.test.js.snap +11 -11
  24. data/webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js +30 -25
  25. data/webpack/components/ApplicationDefinition/components/__tests__/AnsiblePlaybookSelector.test.js +3 -3
  26. data/webpack/components/ApplicationDefinition/index.js +0 -1
  27. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.js +91 -105
  28. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportActions.js +59 -84
  29. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportConstants.js +12 -6
  30. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportReducer.js +21 -27
  31. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportSelectors.js +14 -7
  32. data/webpack/components/ApplicationDefinitionImport/__fixtures__/{applicationDefinitionImportConfData_1.fixtures.js → applicationDefinitionImportConfData1.fixtures.js} +32 -40
  33. data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportReducer.fixtures.js +14 -16
  34. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImport.test.js +38 -8
  35. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportReducer.test.js +0 -2
  36. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportSelectors.test.js +9 -9
  37. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImport.test.js.snap +116 -2
  38. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportSelectors.test.js.snap +3 -3
  39. data/webpack/components/ApplicationInstance/ApplicationInstance.js +344 -193
  40. data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +92 -105
  41. data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +34 -17
  42. data/webpack/components/ApplicationInstance/ApplicationInstanceHelper.js +4 -7
  43. data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +114 -74
  44. data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +18 -9
  45. data/webpack/components/ApplicationInstance/__fixtures__/{applicationInstanceConfData_1.fixtures.js → applicationInstanceConfData1.fixtures.js} +68 -86
  46. data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceReducer.fixtures.js +24 -32
  47. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstance.test.js +75 -10
  48. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceReducer.test.js +0 -8
  49. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceSelectors.test.js +27 -27
  50. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstance.test.js.snap +606 -2
  51. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceSelectors.test.js.snap +12 -12
  52. data/webpack/components/ApplicationInstance/components/AppDefinitionSelector.js +32 -25
  53. data/webpack/components/ApplicationInstance/components/Service.js +7 -18
  54. data/webpack/components/ApplicationInstance/components/ServiceCounter.js +25 -18
  55. data/webpack/components/ApplicationInstance/index.js +0 -1
  56. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js +167 -110
  57. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +20 -25
  58. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +10 -5
  59. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +9 -12
  60. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +12 -6
  61. data/webpack/components/ApplicationInstanceReport/__fixtures__/{applicationInstanceReportData_1.fixtures.js → applicationInstanceReportData1.fixtures.js} +154 -101
  62. data/webpack/components/ApplicationInstanceReport/__fixtures__/applicationInstanceReportReducer.fixtures.js +3 -10
  63. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReport.test.js +28 -22
  64. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportSelectors.test.js +5 -7
  65. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportReducer.test.js.snap +0 -1
  66. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportSelectors.test.js.snap +2 -2
  67. data/webpack/components/ApplicationInstanceReport/components/ReportViewer.js +9 -5
  68. data/webpack/components/ApplicationInstanceReport/components/__tests__/ReportViewer.test.js +1 -3
  69. data/webpack/components/ExistingHostSelection/ExistingHostSelection.js +35 -56
  70. data/webpack/components/ExistingHostSelection/ExistingHostSelectionActions.js +21 -28
  71. data/webpack/components/ExistingHostSelection/ExistingHostSelectionConstants.js +6 -3
  72. data/webpack/components/ExistingHostSelection/ExistingHostSelectionReducer.js +16 -19
  73. data/webpack/components/ExistingHostSelection/ExistingHostSelectionSelectors.js +8 -4
  74. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData1.fixtures.js +187 -0
  75. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionReducer.fixtures.js +13 -24
  76. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelection.test.js +3 -2
  77. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionSelectors.test.js +11 -14
  78. data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionSelectors.test.js.snap +5 -5
  79. data/webpack/components/ExistingHostSelection/components/ServiceSelector.js +31 -25
  80. data/webpack/components/ExistingHostSelection/components/__tests__/ServiceSelector.test.js +3 -9
  81. data/webpack/components/ParameterSelection/ParameterSelection.js +258 -174
  82. data/webpack/components/ParameterSelection/ParameterSelectionActions.js +110 -100
  83. data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +22 -11
  84. data/webpack/components/ParameterSelection/ParameterSelectionHelper.js +13 -11
  85. data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +63 -49
  86. data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +10 -5
  87. data/webpack/components/ParameterSelection/__fixtures__/{parameterSelectionData_1.fixtures.js → parameterSelectionData1.fixtures.js} +67 -104
  88. data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionReducer.fixtures.js +22 -26
  89. data/webpack/components/ParameterSelection/__tests__/ParameterSelection.test.js +50 -36
  90. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionHelper.test.js +76 -0
  91. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +0 -2
  92. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +23 -25
  93. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +100 -0
  94. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +99 -112
  95. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +18 -19
  96. data/webpack/components/ParameterSelection/index.js +1 -4
  97. data/webpack/components/SyncGitRepo/SyncGitRepo.js +124 -117
  98. data/webpack/components/SyncGitRepo/SyncGitRepoActions.js +64 -74
  99. data/webpack/components/SyncGitRepo/SyncGitRepoReducer.js +17 -17
  100. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoConfData1.fixtures.js +7 -0
  101. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoReducer.fixtures.js +10 -18
  102. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepo.test.js +80 -6
  103. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoSelectors.test.js +9 -11
  104. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepo.test.js.snap +192 -1
  105. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoSelectors.test.js.snap +4 -4
  106. data/webpack/components/SyncGitRepo/components/FormTextInput.js +26 -21
  107. data/webpack/components/SyncGitRepo/components/ScmTypeSelector.js +29 -24
  108. data/webpack/components/SyncGitRepo/index.js +2 -5
  109. data/webpack/components/common/AddTableEntry.js +3 -10
  110. data/webpack/components/common/DeleteTableEntry.js +7 -15
  111. data/webpack/components/common/EditTableEntry.js +7 -7
  112. data/webpack/components/common/ExtSelect.js +12 -8
  113. data/webpack/components/common/ExtTextInput.js +12 -7
  114. data/webpack/components/common/LockTableEntry.js +6 -6
  115. data/webpack/components/common/RailsData.js +6 -16
  116. data/webpack/components/common/__tests__/ExtSelect.test.js +2 -2
  117. data/webpack/components/common/__tests__/RailsData.test.js +0 -2
  118. data/webpack/global_test_setup.js +11 -0
  119. data/webpack/helper.js +10 -21
  120. data/webpack/helper.test.js +17 -29
  121. data/webpack/index.js +25 -7
  122. data/webpack/js-yaml.js +1563 -1135
  123. data/webpack/reducer.js +52 -27
  124. metadata +16 -14
  125. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData_1.fixtures.js +0 -191
  126. data/webpack/components/ParameterSelection/__fixtures__/parameterSelection.fixtures.js +0 -153
  127. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoConfData_1.fixtures.js +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09ab4e9efcf497cbf601a6aa065f7451d7eeabde67ed6b9f256f74e305ac7fd2'
4
- data.tar.gz: 996d0f4628457e47e2afc8304e43ae4deef0ed4b362d4495ab7e26730448cbd1
3
+ metadata.gz: 3e8dc2917de1aa5ada0252edd2c3fb14615b804f3e39f58d237ef7b97ec52266
4
+ data.tar.gz: d38e9a064751be62eab34a5537ecce21f288535e42bd96934ac9047b4238630e
5
5
  SHA512:
6
- metadata.gz: 5c011fa3bf0b15c4c6b1a446f960e9cda7b6b9c72ad89776eb921f698d4312424d59e6a7de26fd9c6f9dab3878beae8606559e54617287217a324df8d1f47b9e
7
- data.tar.gz: ae6eaa22a91d8e100f57095165f09dbcb133fc42deb3201d83f3a32d8698ca685a889aae22984434dba6836e3968920fa7de9303d573dd66bb46f5fc0e70baa2
6
+ metadata.gz: 7e6b683a22c4554d476d5a51908aa00906f0351b5d0e7ca098a2184fd8c209444f3105cb1216156a2f496f51cb032b51c7b96b84df718f5892b7cf4734de5acb
7
+ data.tar.gz: 0b353179ccc1844bb71864dbf2af3e672563249a780ff8237f96639851fdb2bc14bf505bc0db5f50e96fa5a23fc1133e1f7c0f59fe19a7ec53b07fcdcac92e6d
data/README.md CHANGED
@@ -59,26 +59,12 @@ See [Deploying Hosts using Application Centric Deployment](https://docs.theforem
59
59
 
60
60
  ## Installation
61
61
 
62
- See the [installation](https://theforeman.org/plugins/#2.Installation) chapter of the Foreman plugins documentation on how to install Foreman plugins.
63
-
64
- ### TL;DR:
65
-
66
- yum install tfm-rubygem-foreman_acd
67
- foreman-maintain service restart
68
-
69
- In some cases, you need to manually run
70
-
71
- foreman-rake db:migrate
72
- foreman-rake db:seed
62
+ Check out the [Foreman documentation](https://docs.theforeman.org/nightly/Deploying_Hosts_AppCentric/index-katello.html#Installing_ACD_on_Server_application_centric_deployment) on how to install the foreman_acd plugin.
73
63
 
74
64
  ### Smart Proxy Installation
75
65
 
76
- You will need to install [Smart Proxy ACD](https://github.com/ATIX-AG/smart_proxy_acd), too.
77
-
78
- yum install tfm-rubygem-smart_proxy_acd tfm-rubygem-smart_proxy_acd_core
79
- foreman-maintain service restart
80
-
81
- You need to refresh the smart proxy features in *Infrastructure > Smart Proxies > Your Smart-Proxy > Actions > Refresh* after the installation of the Smart Proxy ACD components.
66
+ You need to install [Smart Proxy ACD](https://github.com/ATIX-AG/smart_proxy_acd), too.
67
+ Check out the [Foreman documentation](https://docs.theforeman.org/nightly/Deploying_Hosts_AppCentric/index-katello.html#Installing_ACD_on_Smart_Proxy_application_centric_deployment) on how to install the smart_proxy_acd plugin.
82
68
 
83
69
  ### Tips
84
70
 
@@ -98,7 +84,7 @@ Store it in `/var/lib/foreman/foreman_acd/ansible-playbooks/` so that SELinux is
98
84
  ### Application Definition (for Admins)
99
85
 
100
86
  * Create an Application Definition via *Applications > Application Definitions*.
101
- * Select the Ansible Playbook you want to use.
87
+ * Select the Ansible Playbook you want to use.
102
88
  * Add new services and specify the host group you want to use.
103
89
  * Specify any values a user will be allowed to overwrite.
104
90
  You may also set a default value.
@@ -128,7 +114,7 @@ Fork and send a Pull Request. Thank you.
128
114
 
129
115
  ## Copyright
130
116
 
131
- Copyright (c) 2021 ATIX AG
117
+ Copyright (c) 2024 ATIX AG
132
118
 
133
119
  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
134
120
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Controller to create JSON data to be used in react app
4
- class UiAcdController < ::Api::V2::BaseController
4
+ class UIAcdController < ::Api::V2::BaseController
5
5
  include ::ForemanAcd::Concerns::AppInstanceMixins
6
6
 
7
7
  def app
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Add git_url column to ansible_playbook
4
- class AddGitUrlToAnsiblePlaybooks < ActiveRecord::Migration[6.0]
4
+ class AddGitURLToAnsiblePlaybooks < ActiveRecord::Migration[6.0]
5
5
  def change
6
6
  add_column :acd_ansible_playbooks, :git_url, :string
7
7
  end
@@ -9,14 +9,6 @@ module ForemanAcd
9
9
  class Engine < ::Rails::Engine
10
10
  engine_name 'foreman_acd'
11
11
 
12
- config.autoload_paths += Dir["#{config.root}/app/controllers/foreman_acd/concerns"]
13
- config.autoload_paths += Dir["#{config.root}/app/models"]
14
- config.autoload_paths += Dir["#{config.root}/app/services"]
15
- config.autoload_paths += Dir["#{config.root}/app/helpers"]
16
- config.autoload_paths += Dir["#{config.root}/app/overrides"]
17
- config.autoload_paths += Dir["#{config.root}/app/lib"]
18
- config.autoload_paths += Dir["#{config.root}/lib"]
19
-
20
12
  # Add any db migrations
21
13
  initializer 'foreman_acd.load_app_instance_data' do |app|
22
14
  ForemanAcd::Engine.paths['db/migrate'].existent.each do |path|
@@ -40,8 +32,10 @@ module ForemanAcd
40
32
  Foreman::Gettext::Support.add_text_domain locale_domain, locale_dir
41
33
  end
42
34
 
43
- initializer 'foreman_acd.register_plugin', :before => :finisher_hook do
44
- require 'foreman_acd/plugin'
35
+ initializer 'foreman_acd.register_plugin', :before => :finisher_hook do |app|
36
+ app.reloader.to_prepare do
37
+ require 'foreman_acd/plugin'
38
+ end
45
39
  end
46
40
 
47
41
  initializer 'foreman_acd.register_actions', :before => :finisher_hook do |_app|
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  Foreman::Plugin.register :foreman_acd do
4
- requires_foreman '>= 2.1'
4
+ requires_foreman '>= 3.13'
5
5
 
6
6
  apipie_documented_controllers ["#{ForemanAcd::Engine.root}/app/controllers/foreman_acd/api/v2/*.rb"]
7
7
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanAcd
4
- VERSION = '0.9.7'
4
+ VERSION = '0.11.0'
5
5
  end
data/package.json CHANGED
@@ -9,12 +9,14 @@
9
9
  "devDependencies": {
10
10
  "@theforeman/builder": ">= 12.0.1",
11
11
  "@theforeman/eslint-plugin-foreman": ">= 12.0.1",
12
+ "@theforeman/find-foreman": "^13.0.0",
12
13
  "@theforeman/test": ">= 12.0.1",
13
14
  "@theforeman/vendor-dev": ">= 12.0.1",
14
15
  "babel-plugin-transform-class-properties": "^6.24.1",
15
16
  "babel-preset-env": "^1.6.0",
16
17
  "babel-preset-react": "^6.24.1",
17
18
  "eslint": "^6.7.2",
19
+ "eslint-plugin-react": "^7.34.1",
18
20
  "jest": "^23.6.0",
19
21
  "jest-prop-type-error": "^1.1.0",
20
22
  "lodash": "^4.17.11",
@@ -26,11 +28,11 @@
26
28
  "table-resolver": "^3.2.0"
27
29
  },
28
30
  "scripts": {
29
- "lint": "tfm-lint --plugin -d *.js,webpack",
30
- "lint-fix": "tfm-lint --plugin -d *.js,webpack --fix",
31
+ "lint": "eslint *.js webpack",
32
+ "lint-fix": "eslint --fix *.js webpack",
31
33
  "stylelint": "stylelint webpack/**/*.scss",
32
34
  "stylelint-fix": "stylelint webpack/**/*.scss --fix",
33
- "test": "jest --no-cache"
35
+ "test": "tfm-test --plugin --config jest.config.js"
34
36
  },
35
37
  "repository": {
36
38
  "type": "git",
@@ -13,7 +13,7 @@ module Katello
13
13
  end
14
14
 
15
15
  # UI Controller tests
16
- class UiAcdControllerTest < ActionController::TestCase
16
+ class UIAcdControllerTest < ActionController::TestCase
17
17
  test 'get app json' do
18
18
  app_def = FactoryBot.create(:app_definition)
19
19
  get :app, :params => { :id => app_def.id }, :session => set_session_user