foreman_templates 10.0.10 → 11.0.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.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_templates/locale/cs_CZ/foreman_templates.js +1 -1
  3. data/app/assets/javascripts/foreman_templates/locale/de/foreman_templates.js +3 -3
  4. data/app/assets/javascripts/foreman_templates/locale/en_GB/foreman_templates.js +1 -1
  5. data/app/assets/javascripts/foreman_templates/locale/es/foreman_templates.js +1 -1
  6. data/app/assets/javascripts/foreman_templates/locale/fr/foreman_templates.js +1 -1
  7. data/app/assets/javascripts/foreman_templates/locale/gl/foreman_templates.js +1 -1
  8. data/app/assets/javascripts/foreman_templates/locale/it/foreman_templates.js +1 -1
  9. data/app/assets/javascripts/foreman_templates/locale/ja/foreman_templates.js +1 -1
  10. data/app/assets/javascripts/foreman_templates/locale/ka/foreman_templates.js +1 -1
  11. data/app/assets/javascripts/foreman_templates/locale/ko/foreman_templates.js +1 -1
  12. data/app/assets/javascripts/foreman_templates/locale/pt_BR/foreman_templates.js +1 -1
  13. data/app/assets/javascripts/foreman_templates/locale/ru/foreman_templates.js +1 -1
  14. data/app/assets/javascripts/foreman_templates/locale/sv_SE/foreman_templates.js +1 -1
  15. data/app/assets/javascripts/foreman_templates/locale/zh_CN/foreman_templates.js +1 -1
  16. data/app/assets/javascripts/foreman_templates/locale/zh_TW/foreman_templates.js +1 -1
  17. data/app/controllers/ui_template_syncs_controller.rb +8 -1
  18. data/app/views/ui_template_syncs/sync_config.json.rabl +32 -0
  19. data/config/routes.rb +1 -3
  20. data/lib/foreman_templates/engine.rb +9 -7
  21. data/lib/foreman_templates/version.rb +1 -1
  22. data/locale/cs_CZ/LC_MESSAGES/foreman_templates.mo +0 -0
  23. data/locale/cs_CZ/foreman_templates.po +1 -1
  24. data/locale/de/LC_MESSAGES/foreman_templates.mo +0 -0
  25. data/locale/de/foreman_templates.po +4 -3
  26. data/locale/en_GB/LC_MESSAGES/foreman_templates.mo +0 -0
  27. data/locale/en_GB/foreman_templates.po +1 -1
  28. data/locale/es/LC_MESSAGES/foreman_templates.mo +0 -0
  29. data/locale/es/foreman_templates.po +1 -1
  30. data/locale/fr/LC_MESSAGES/foreman_templates.mo +0 -0
  31. data/locale/fr/foreman_templates.po +1 -1
  32. data/locale/gl/LC_MESSAGES/foreman_templates.mo +0 -0
  33. data/locale/gl/foreman_templates.po +1 -1
  34. data/locale/it/LC_MESSAGES/foreman_templates.mo +0 -0
  35. data/locale/it/foreman_templates.po +1 -1
  36. data/locale/ja/LC_MESSAGES/foreman_templates.mo +0 -0
  37. data/locale/ja/foreman_templates.po +1 -1
  38. data/locale/ka/LC_MESSAGES/foreman_templates.mo +0 -0
  39. data/locale/ka/foreman_templates.po +1 -1
  40. data/locale/ko/LC_MESSAGES/foreman_templates.mo +0 -0
  41. data/locale/ko/foreman_templates.po +1 -1
  42. data/locale/pt_BR/LC_MESSAGES/foreman_templates.mo +0 -0
  43. data/locale/pt_BR/foreman_templates.po +1 -1
  44. data/locale/ru/LC_MESSAGES/foreman_templates.mo +0 -0
  45. data/locale/ru/foreman_templates.po +1 -1
  46. data/locale/sv_SE/LC_MESSAGES/foreman_templates.mo +0 -0
  47. data/locale/sv_SE/foreman_templates.po +1 -1
  48. data/locale/zh_CN/LC_MESSAGES/foreman_templates.mo +0 -0
  49. data/locale/zh_CN/foreman_templates.po +1 -1
  50. data/locale/zh_TW/LC_MESSAGES/foreman_templates.mo +0 -0
  51. data/locale/zh_TW/foreman_templates.po +1 -1
  52. data/webpack/ProtectedComponent.js +49 -0
  53. data/webpack/__mocks__/foremanReact/common/I18n.js +2 -0
  54. data/webpack/__mocks__/foremanReact/components/Pagination.js +4 -0
  55. data/webpack/__mocks__/foremanReact/redux/API.js +10 -0
  56. data/webpack/components/NewTemplateSync/__tests__/NewTemplateSync.test.js +101 -31
  57. data/webpack/components/NewTemplateSync/__tests__/testData.js +303 -0
  58. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncForm.js +139 -71
  59. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncForm.scss +5 -0
  60. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormHelpers.js +15 -48
  61. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncForm.test.js +120 -0
  62. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncFormHelpers.test.js +79 -0
  63. data/webpack/components/NewTemplateSync/components/SyncSettingField.js +131 -33
  64. data/webpack/components/NewTemplateSync/components/SyncSettingFields.js +76 -50
  65. data/webpack/components/NewTemplateSync/components/__tests__/SyncSettingField.test.js +107 -32
  66. data/webpack/components/NewTemplateSync/components/__tests__/SyncSettingFields.test.js +142 -32
  67. data/webpack/components/NewTemplateSync/index.js +51 -25
  68. data/webpack/components/TemplateSyncResult/TemplateSyncResult.js +29 -34
  69. data/webpack/components/TemplateSyncResult/TemplateSyncResult.scss +30 -28
  70. data/webpack/components/TemplateSyncResult/__tests__/TemplateSyncResult.test.js +132 -34
  71. data/webpack/components/TemplateSyncResult/components/EmptySyncResult.js +26 -12
  72. data/webpack/components/TemplateSyncResult/components/FinishedSyncResult.js +25 -28
  73. data/webpack/components/TemplateSyncResult/components/SyncResultList.js +68 -38
  74. data/webpack/components/TemplateSyncResult/components/SyncedTemplate/helpers.js +145 -51
  75. data/webpack/components/TemplateSyncResult/components/SyncedTemplate/index.js +31 -19
  76. data/webpack/components/TemplateSyncResult/components/__tests__/SyncResultList.test.js +81 -25
  77. data/webpack/components/TemplateSyncResult/components/__tests__/SyncedTemplate.test.js +260 -29
  78. data/webpack/components/TemplateSyncResult/components/__tests__/helpers.test.js +218 -0
  79. data/webpack/components/TemplateSyncResult/index.js +1 -11
  80. data/webpack/consts.js +4 -5
  81. data/webpack/global_index.js +14 -0
  82. data/webpack/index.js +3 -9
  83. metadata +12 -70
  84. data/app/controllers/template_syncs_controller.rb +0 -13
  85. data/app/views/template_syncs/index.html.erb +0 -21
  86. data/webpack/ForemanTemplates.js +0 -33
  87. data/webpack/Routes.js +0 -33
  88. data/webpack/__mocks__/foremanReact/Root/Context/ForemanContext.js +0 -2
  89. data/webpack/__mocks__/foremanReact/components/Layout/LayoutSelectors.js +0 -4
  90. data/webpack/__mocks__/foremanReact/components/Pagination/index.js +0 -2
  91. data/webpack/__mocks__/foremanReact/components/common/forms/CommonForm.js +0 -2
  92. data/webpack/__mocks__/foremanReact/components/common/forms/ForemanForm.js +0 -2
  93. data/webpack/__mocks__/foremanReact/components/common/forms/TextField.js +0 -2
  94. data/webpack/__mocks__/foremanReact/redux/actions/common/forms.js +0 -1
  95. data/webpack/__mocks__/foremanReact/routes/common/PageLayout/PageLayout.js +0 -2
  96. data/webpack/__tests__/__snapshots__/helpers.test.js.snap +0 -5
  97. data/webpack/__tests__/helpers.test.js +0 -17
  98. data/webpack/components/NewTemplateSync/NewTemplateSync.js +0 -61
  99. data/webpack/components/NewTemplateSync/NewTemplateSync.scss +0 -19
  100. data/webpack/components/NewTemplateSync/NewTemplateSyncActions.js +0 -39
  101. data/webpack/components/NewTemplateSync/NewTemplateSyncReducer.js +0 -34
  102. data/webpack/components/NewTemplateSync/NewTemplateSyncSelectors.js +0 -7
  103. data/webpack/components/NewTemplateSync/__fixtures__/templateSyncSettings.fixtures.js +0 -78
  104. data/webpack/components/NewTemplateSync/__tests__/NewTemplateSyncReducer.test.js +0 -55
  105. data/webpack/components/NewTemplateSync/__tests__/NewTemplateSyncSelectors.test.js +0 -28
  106. data/webpack/components/NewTemplateSync/__tests__/__snapshots__/NewTemplateSync.test.js.snap +0 -53
  107. data/webpack/components/NewTemplateSync/__tests__/__snapshots__/NewTemplateSyncReducer.test.js.snap +0 -79
  108. data/webpack/components/NewTemplateSync/__tests__/__snapshots__/NewTemplateSyncSelectors.test.js.snap +0 -64
  109. data/webpack/components/NewTemplateSync/components/ButtonTooltip.js +0 -17
  110. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js +0 -21
  111. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncFormSelectors.test.js +0 -19
  112. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/__snapshots__/NewTemplateSyncFormSelectors.test.js.snap +0 -15
  113. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/index.js +0 -28
  114. data/webpack/components/NewTemplateSync/components/ProxySettingField.js +0 -44
  115. data/webpack/components/NewTemplateSync/components/ProxySettingFields.js +0 -89
  116. data/webpack/components/NewTemplateSync/components/SyncTypeRadios.js +0 -52
  117. data/webpack/components/NewTemplateSync/components/TextButtonField/BlankOption.js +0 -19
  118. data/webpack/components/NewTemplateSync/components/TextButtonField/CheckboxField.js +0 -15
  119. data/webpack/components/NewTemplateSync/components/TextButtonField/FieldType.js +0 -46
  120. data/webpack/components/NewTemplateSync/components/TextButtonField/InputField.js +0 -14
  121. data/webpack/components/NewTemplateSync/components/TextButtonField/RenderField.js +0 -74
  122. data/webpack/components/NewTemplateSync/components/TextButtonField/SelectField.js +0 -24
  123. data/webpack/components/NewTemplateSync/components/TextButtonField/index.js +0 -76
  124. data/webpack/components/NewTemplateSync/components/__tests__/SyncTypeRadios.test.js +0 -20
  125. data/webpack/components/NewTemplateSync/components/__tests__/TextButtonField.test.js +0 -65
  126. data/webpack/components/NewTemplateSync/components/__tests__/__snapshots__/SyncSettingField.test.js.snap +0 -149
  127. data/webpack/components/NewTemplateSync/components/__tests__/__snapshots__/SyncSettingFields.test.js.snap +0 -115
  128. data/webpack/components/NewTemplateSync/components/__tests__/__snapshots__/SyncTypeRadios.test.js.snap +0 -46
  129. data/webpack/components/NewTemplateSync/components/__tests__/__snapshots__/TextButtonField.test.js.snap +0 -29
  130. data/webpack/components/PageNotFound.js +0 -14
  131. data/webpack/components/PermissionDenied.js +0 -34
  132. data/webpack/components/TemplateSyncResult/TemplateSyncResultActions.js +0 -4
  133. data/webpack/components/TemplateSyncResult/TemplateSyncResultHelpers.js +0 -6
  134. data/webpack/components/TemplateSyncResult/TemplateSyncResultReducer.js +0 -33
  135. data/webpack/components/TemplateSyncResult/TemplateSyncResultSelectors.js +0 -1
  136. data/webpack/components/TemplateSyncResult/__fixtures__/templateSyncResult.fixtures.js +0 -86
  137. data/webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js +0 -48
  138. data/webpack/components/TemplateSyncResult/__tests__/__snapshots__/TemplateSyncResult.test.js.snap +0 -114
  139. data/webpack/components/TemplateSyncResult/__tests__/__snapshots__/TemplateSyncResultReducer.test.js.snap +0 -90
  140. data/webpack/components/TemplateSyncResult/components/ListViewHeader.js +0 -38
  141. data/webpack/components/TemplateSyncResult/components/SyncedTemplate/EmptyInfoItem.js +0 -16
  142. data/webpack/components/TemplateSyncResult/components/SyncedTemplate/IconInfoItem.js +0 -21
  143. data/webpack/components/TemplateSyncResult/components/SyncedTemplate/InfoItem.js +0 -30
  144. data/webpack/components/TemplateSyncResult/components/SyncedTemplate/LinkInfoItem.js +0 -37
  145. data/webpack/components/TemplateSyncResult/components/SyncedTemplate/StringInfoItem.js +0 -37
  146. data/webpack/components/TemplateSyncResult/components/SyncedTemplate/__snapshots__/helpers.test.js.snap +0 -37
  147. data/webpack/components/TemplateSyncResult/components/SyncedTemplate/helpers.test.js +0 -21
  148. data/webpack/components/TemplateSyncResult/components/__tests__/__snapshots__/SyncResultList.test.js.snap +0 -100
  149. data/webpack/components/TemplateSyncResult/components/__tests__/__snapshots__/SyncedTemplate.test.js.snap +0 -564
  150. data/webpack/reducer.js +0 -6
  151. data/webpack/withProtectedView.js +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c7eeae2d2984fa4674c78bf270589d2bfb43df9ff8309e3413676a74d615bc6
4
- data.tar.gz: c06f24dec49ab349e81a7e7aa9154a6206c2908e0fefca8ec5b092e35691c88f
3
+ metadata.gz: e801bbc7d2afe1beb1bf1ae085da26645c4bc6bde93e71b92d7eca7f828695ee
4
+ data.tar.gz: 3c3e646b286434aece5fcaa47c07198fce525dfccd2e20afa1fa7085fb439825
5
5
  SHA512:
6
- metadata.gz: '07873627094af9b017b739b5f506106553e19f768f447003900e244f955fe9de4a646d50e22970e0dfef792132f54d20acda4cf0c4f3b40bf256d21bac4bfb70'
7
- data.tar.gz: 7a345823e2556c7f6f3eb746cd8eb3ec379e6214bb47633f439ed2ca4d6b5c5e6d789908ecf02919da20c23748e6387f29989cfc31a60de985039b0a31d5e3a2
6
+ metadata.gz: cb406235af1fc2014dc21553995808229fc9bfca8e6a812557be1601e921948560cd549ed8c53f3781156ae26fcf2ff5adcdf26646dc82ba9743a62e3dab1193
7
+ data.tar.gz: 44225cff9f14f72852c71c4fbac057688b59166f566179279501017c787c3b5ddc7e49ece0a80aab0a02abef8848da6ad5e3d95d8054427fe56f8956835dfe73
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "Pavel Borecki <pavel.borecki@gmail.com>, 2024",
@@ -3,10 +3,10 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
- "Last-Translator": "Bryan Kearney <bryan.kearney@gmail.com>, 2024",
9
+ "Last-Translator": "Donien, 2026",
10
10
  "Language-Team": "German (https://app.transifex.com/foreman/teams/114/de/)",
11
11
  "MIME-Version": "1.0",
12
12
  "Content-Type": "text/plain; charset=UTF-8",
@@ -159,7 +159,7 @@
159
159
  ""
160
160
  ],
161
161
  "Permission Denied": [
162
- ""
162
+ "Zugriff verweigert"
163
163
  ],
164
164
  "Please check the access permissions/SELinux and make sure it is readable/writable for the web application user account, typically '%s'.": [
165
165
  ""
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "0868a4d1af5275b3f70b0a6dac4c99a4, 2022",
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "Ewoud Kohl van Wijngaarden <ewoud+transifex@kohlvanwijngaarden.nl>, 2025",
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "Ondřej Gajdušek, 2025",
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "Carmela Rubiños <carmela.rubinos@gmail.com>, 2023",
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "Bryan Kearney <bryan.kearney@gmail.com>, 2024",
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "Ondřej Gajdušek, 2025",
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "Temuri Doghonadze <temuri.doghonadze@gmail.com>, 2024",
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "Ondřej Gajdušek, 2025",
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "Bryan Kearney <bryan.kearney@gmail.com>, 2024",
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "Bryan Kearney <bryan.kearney@gmail.com>, 2024",
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "johnny.westerlund <johnny.westerlund@gmail.com>, 2023",
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "Ondřej Gajdušek, 2025",
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_templates": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_templates 10.0.9",
6
+ "Project-Id-Version": "foreman_templates 10.0.10",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2019-10-14 12:27+0000",
9
9
  "Last-Translator": "Bryan Kearney <bryan.kearney@gmail.com>, 2024",
@@ -2,6 +2,8 @@ require 'ostruct'
2
2
 
3
3
  class UITemplateSyncsController < ApplicationController
4
4
  include ::Foreman::Controller::Parameters::TemplateParams
5
+ include ::ApplicationHelper
6
+ helper :foreman_templates
5
7
 
6
8
  rescue_from ::ForemanTemplates::PathAccessException do |error|
7
9
  render_errors [error.message]
@@ -10,11 +12,16 @@ class UITemplateSyncsController < ApplicationController
10
12
  def sync_settings
11
13
  import_settings = setting_definitions(ForemanTemplates::IMPORT_SETTING_NAMES)
12
14
  export_settings = setting_definitions(ForemanTemplates::EXPORT_SETTING_NAMES)
13
- @results = OpenStruct.new(:import => import_settings, :export => export_settings)
15
+ @settings = OpenStruct.new(:import => import_settings, :export => export_settings)
16
+ @edit_paths = helpers.edit_paths
17
+
18
+ render :sync_config
14
19
  end
15
20
 
16
21
  def import
17
22
  @parse_result = OpenStruct.new ForemanTemplates::TemplateImporter.new(ui_template_import_params).import!
23
+ rescue StandardError => e
24
+ render :json => { :error => e.result.stderr }, :status => :internal_server_error and return
18
25
  end
19
26
 
20
27
  def export
@@ -0,0 +1,32 @@
1
+ object false
2
+
3
+ node(:apiUrls) do
4
+ {
5
+ exportUrl: export_ui_template_syncs_path,
6
+ syncSettingsUrl: sync_settings_ui_template_syncs_path,
7
+ importUrl: import_ui_template_syncs_path
8
+ }
9
+ end
10
+
11
+ node(:validationData) do
12
+ { repo: ::ForemanTemplates::Action.repo_start_with }
13
+ end
14
+
15
+ node(:editPaths) { @edit_paths }
16
+ node(:fileRepoStartWith) { ::ForemanTemplates::Action.file_repo_start_with }
17
+ node(:userPermissions) do
18
+ {
19
+ import: authorized_for(controller: :ui_template_syncs, action: :import),
20
+ export: authorized_for(controller: :ui_template_syncs, action: :export)
21
+ }
22
+ end
23
+
24
+ child @settings => :settings do
25
+ child :import => :import do
26
+ extends "template_sync_settings/show"
27
+ end
28
+
29
+ child :export => :export do
30
+ extends "template_sync_settings/show"
31
+ end
32
+ end
data/config/routes.rb CHANGED
@@ -1,6 +1,4 @@
1
1
  Rails.application.routes.draw do
2
- resources :template_syncs, :only => [:index]
3
-
4
2
  resources :ui_template_syncs, :only => [] do
5
3
  collection do
6
4
  get 'sync_settings'
@@ -9,7 +7,7 @@ Rails.application.routes.draw do
9
7
  end
10
8
  end
11
9
 
12
- match '/template_syncs/*page' => 'template_syncs#index', :via => [:get]
10
+ match '/template_syncs' => 'react#index', :via => [:get]
13
11
 
14
12
  namespace :api, :defaults => { :format => 'json' } do
15
13
  scope "(:apiv)", :module => :v2, :defaults => { :apiv => 'v2' }, :apiv => /v2/, :constraints => ApiConstraints.new(:version => 2, :default => true) do
@@ -22,11 +22,13 @@ module ForemanTemplates
22
22
  end
23
23
  end
24
24
 
25
- initializer 'foreman_templates.register_plugin', :before => :finisher_hook do
25
+ initializer 'foreman_templates.register_plugin', :before => :finisher_hook do |_app|
26
26
  Foreman::Plugin.register :foreman_templates do
27
- requires_foreman '>= 3.13'
27
+ requires_foreman '>= 3.15'
28
28
  register_gettext
29
29
 
30
+ register_global_js_file 'global'
31
+
30
32
  apipie_documented_controllers ["#{ForemanTemplates::Engine.root}/app/controllers/api/v2/*.rb"]
31
33
 
32
34
  settings do
@@ -120,11 +122,11 @@ module ForemanTemplates
120
122
  add_all_permissions_to_default_roles
121
123
 
122
124
  menu :top_menu, :template_sync,
123
- :url_hash => { :controller => :template_syncs, :action => :index },
124
- :caption => N_('Sync Templates'),
125
- :parent => :hosts_menu,
126
- :before => :ptables,
127
- :turbolinks => false
125
+ url_hash: { :controller => :template_syncs, :action => :index },
126
+ url: '/template_syncs',
127
+ caption: N_('Sync Templates'),
128
+ parent: :hosts_menu,
129
+ before: :ptables
128
130
  end
129
131
  end
130
132
 
@@ -1,3 +1,3 @@
1
1
  module ForemanTemplates
2
- VERSION = "10.0.10".freeze
2
+ VERSION = "11.0.0".freeze
3
3
  end
@@ -8,7 +8,7 @@
8
8
  #
9
9
  msgid ""
10
10
  msgstr ""
11
- "Project-Id-Version: foreman_templates 10.0.9\n"
11
+ "Project-Id-Version: foreman_templates 10.0.10\n"
12
12
  "Report-Msgid-Bugs-To: \n"
13
13
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
14
14
  "Last-Translator: Pavel Borecki <pavel.borecki@gmail.com>, 2024\n"
@@ -10,13 +10,14 @@
10
10
  # Ettore Atalan <atalanttore@googlemail.com>, 2023
11
11
  # pdolinic, 2023
12
12
  # Bryan Kearney <bryan.kearney@gmail.com>, 2024
13
+ # Donien, 2026
13
14
  #
14
15
  msgid ""
15
16
  msgstr ""
16
- "Project-Id-Version: foreman_templates 10.0.9\n"
17
+ "Project-Id-Version: foreman_templates 10.0.10\n"
17
18
  "Report-Msgid-Bugs-To: \n"
18
19
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
19
- "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>, 2024\n"
20
+ "Last-Translator: Donien, 2026\n"
20
21
  "Language-Team: German (https://app.transifex.com/foreman/teams/114/de/)\n"
21
22
  "MIME-Version: 1.0\n"
22
23
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -166,7 +167,7 @@ msgid "Page Not Found"
166
167
  msgstr ""
167
168
 
168
169
  msgid "Permission Denied"
169
- msgstr ""
170
+ msgstr "Zugriff verweigert"
170
171
 
171
172
  msgid "Please check the access permissions/SELinux and make sure it is readable/writable for the web application user account, typically '%s'."
172
173
  msgstr ""
@@ -8,7 +8,7 @@
8
8
  #
9
9
  msgid ""
10
10
  msgstr ""
11
- "Project-Id-Version: foreman_templates 10.0.9\n"
11
+ "Project-Id-Version: foreman_templates 10.0.10\n"
12
12
  "Report-Msgid-Bugs-To: \n"
13
13
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
14
14
  "Last-Translator: 0868a4d1af5275b3f70b0a6dac4c99a4, 2022\n"
@@ -10,7 +10,7 @@
10
10
  #
11
11
  msgid ""
12
12
  msgstr ""
13
- "Project-Id-Version: foreman_templates 10.0.9\n"
13
+ "Project-Id-Version: foreman_templates 10.0.10\n"
14
14
  "Report-Msgid-Bugs-To: \n"
15
15
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
16
16
  "Last-Translator: Ewoud Kohl van Wijngaarden <ewoud+transifex@kohlvanwijngaarde"
@@ -13,7 +13,7 @@
13
13
  #
14
14
  msgid ""
15
15
  msgstr ""
16
- "Project-Id-Version: foreman_templates 10.0.9\n"
16
+ "Project-Id-Version: foreman_templates 10.0.10\n"
17
17
  "Report-Msgid-Bugs-To: \n"
18
18
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
19
19
  "Last-Translator: Ondřej Gajdušek, 2025\n"
@@ -8,7 +8,7 @@
8
8
  #
9
9
  msgid ""
10
10
  msgstr ""
11
- "Project-Id-Version: foreman_templates 10.0.9\n"
11
+ "Project-Id-Version: foreman_templates 10.0.10\n"
12
12
  "Report-Msgid-Bugs-To: \n"
13
13
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
14
14
  "Last-Translator: Carmela Rubiños <carmela.rubinos@gmail.com>, 2023\n"
@@ -9,7 +9,7 @@
9
9
  #
10
10
  msgid ""
11
11
  msgstr ""
12
- "Project-Id-Version: foreman_templates 10.0.9\n"
12
+ "Project-Id-Version: foreman_templates 10.0.10\n"
13
13
  "Report-Msgid-Bugs-To: \n"
14
14
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
15
15
  "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>, 2024\n"
@@ -11,7 +11,7 @@
11
11
  #
12
12
  msgid ""
13
13
  msgstr ""
14
- "Project-Id-Version: foreman_templates 10.0.9\n"
14
+ "Project-Id-Version: foreman_templates 10.0.10\n"
15
15
  "Report-Msgid-Bugs-To: \n"
16
16
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
17
17
  "Last-Translator: Ondřej Gajdušek, 2025\n"
@@ -8,7 +8,7 @@
8
8
  #
9
9
  msgid ""
10
10
  msgstr ""
11
- "Project-Id-Version: foreman_templates 10.0.9\n"
11
+ "Project-Id-Version: foreman_templates 10.0.10\n"
12
12
  "Report-Msgid-Bugs-To: \n"
13
13
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
14
14
  "Last-Translator: Temuri Doghonadze <temuri.doghonadze@gmail.com>, 2024\n"
@@ -11,7 +11,7 @@
11
11
  #
12
12
  msgid ""
13
13
  msgstr ""
14
- "Project-Id-Version: foreman_templates 10.0.9\n"
14
+ "Project-Id-Version: foreman_templates 10.0.10\n"
15
15
  "Report-Msgid-Bugs-To: \n"
16
16
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
17
17
  "Last-Translator: Ondřej Gajdušek, 2025\n"
@@ -11,7 +11,7 @@
11
11
  #
12
12
  msgid ""
13
13
  msgstr ""
14
- "Project-Id-Version: foreman_templates 10.0.9\n"
14
+ "Project-Id-Version: foreman_templates 10.0.10\n"
15
15
  "Report-Msgid-Bugs-To: \n"
16
16
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
17
17
  "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>, 2024\n"
@@ -11,7 +11,7 @@
11
11
  #
12
12
  msgid ""
13
13
  msgstr ""
14
- "Project-Id-Version: foreman_templates 10.0.9\n"
14
+ "Project-Id-Version: foreman_templates 10.0.10\n"
15
15
  "Report-Msgid-Bugs-To: \n"
16
16
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
17
17
  "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>, 2024\n"
@@ -8,7 +8,7 @@
8
8
  #
9
9
  msgid ""
10
10
  msgstr ""
11
- "Project-Id-Version: foreman_templates 10.0.9\n"
11
+ "Project-Id-Version: foreman_templates 10.0.10\n"
12
12
  "Report-Msgid-Bugs-To: \n"
13
13
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
14
14
  "Last-Translator: johnny.westerlund <johnny.westerlund@gmail.com>, 2023\n"
@@ -12,7 +12,7 @@
12
12
  #
13
13
  msgid ""
14
14
  msgstr ""
15
- "Project-Id-Version: foreman_templates 10.0.9\n"
15
+ "Project-Id-Version: foreman_templates 10.0.10\n"
16
16
  "Report-Msgid-Bugs-To: \n"
17
17
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
18
18
  "Last-Translator: Ondřej Gajdušek, 2025\n"
@@ -9,7 +9,7 @@
9
9
  #
10
10
  msgid ""
11
11
  msgstr ""
12
- "Project-Id-Version: foreman_templates 10.0.9\n"
12
+ "Project-Id-Version: foreman_templates 10.0.10\n"
13
13
  "Report-Msgid-Bugs-To: \n"
14
14
  "PO-Revision-Date: 2019-10-14 12:27+0000\n"
15
15
  "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>, 2024\n"
@@ -0,0 +1,49 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { useDispatch } from 'react-redux';
3
+ import { APIActions } from 'foremanReact/redux/API';
4
+ import { deepPropsToCamelCase } from 'foremanReact/common/helpers';
5
+ import { Skeleton } from '@patternfly/react-core';
6
+ import PermissionDenied from 'foremanReact/components/PermissionDenied';
7
+ import { NewTemplateSync } from './components/NewTemplateSync';
8
+ import { SYNC_SETTINGS_REQUEST, SYNC_SETTINGS_URL } from './consts';
9
+
10
+ const ProtectedComponent = props => {
11
+ const [isLoading, setIsLoading] = useState(true);
12
+ const [apiResponse, setApiResponse] = useState(null);
13
+ const dispatch = useDispatch();
14
+
15
+ const requiredPermissions = ['import_templates', 'export_templates'];
16
+
17
+ useEffect(() => {
18
+ if (apiResponse !== null) return;
19
+ dispatch(
20
+ APIActions.get({
21
+ key: SYNC_SETTINGS_REQUEST,
22
+ url: `/${SYNC_SETTINGS_URL}`,
23
+ handleSuccess: response => {
24
+ const { editPaths } = response.data;
25
+ setApiResponse({
26
+ ...deepPropsToCamelCase(response.data),
27
+ editPaths,
28
+ });
29
+ setIsLoading(false);
30
+ },
31
+ handleError: () => setIsLoading(false),
32
+ })
33
+ );
34
+ // eslint-disable-next-line react-hooks/exhaustive-deps
35
+ }, []);
36
+
37
+ const perms = apiResponse?.userPermissions ?? true;
38
+
39
+ if (!perms || isLoading)
40
+ return <Skeleton height="100%" screenreaderText="Loading ..." />;
41
+
42
+ return perms?.import || perms?.export ? (
43
+ <NewTemplateSync apiResponse={apiResponse} />
44
+ ) : (
45
+ <PermissionDenied missingPermissions={requiredPermissions} />
46
+ );
47
+ };
48
+
49
+ export default ProtectedComponent;
@@ -1 +1,3 @@
1
+ export const sprintf = (string, ...args) => [string, ...args].join(' + ');
1
2
  export const translate = s => s;
3
+ export const documentLocale = () => 'en';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+
3
+ const Pagination = () => <div />;
4
+ export default Pagination;
@@ -0,0 +1,10 @@
1
+ export const APIActions = {
2
+ get: jest.fn(),
3
+ put: jest.fn(),
4
+ post: jest.fn(),
5
+ delete: jest.fn(),
6
+ patch: jest.fn(),
7
+ };
8
+
9
+ export const get = data => ({ type: 'get-some-type', ...data });
10
+ export const post = data => ({ type: 'post-some-type', ...data });