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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/foreman_templates/locale/cs_CZ/foreman_templates.js +1 -1
- data/app/assets/javascripts/foreman_templates/locale/de/foreman_templates.js +3 -3
- data/app/assets/javascripts/foreman_templates/locale/en_GB/foreman_templates.js +1 -1
- data/app/assets/javascripts/foreman_templates/locale/es/foreman_templates.js +1 -1
- data/app/assets/javascripts/foreman_templates/locale/fr/foreman_templates.js +1 -1
- data/app/assets/javascripts/foreman_templates/locale/gl/foreman_templates.js +1 -1
- data/app/assets/javascripts/foreman_templates/locale/it/foreman_templates.js +1 -1
- data/app/assets/javascripts/foreman_templates/locale/ja/foreman_templates.js +1 -1
- data/app/assets/javascripts/foreman_templates/locale/ka/foreman_templates.js +1 -1
- data/app/assets/javascripts/foreman_templates/locale/ko/foreman_templates.js +1 -1
- data/app/assets/javascripts/foreman_templates/locale/pt_BR/foreman_templates.js +1 -1
- data/app/assets/javascripts/foreman_templates/locale/ru/foreman_templates.js +1 -1
- data/app/assets/javascripts/foreman_templates/locale/sv_SE/foreman_templates.js +1 -1
- data/app/assets/javascripts/foreman_templates/locale/zh_CN/foreman_templates.js +1 -1
- data/app/assets/javascripts/foreman_templates/locale/zh_TW/foreman_templates.js +1 -1
- data/app/controllers/ui_template_syncs_controller.rb +8 -1
- data/app/views/ui_template_syncs/sync_config.json.rabl +32 -0
- data/config/routes.rb +1 -3
- data/lib/foreman_templates/engine.rb +9 -7
- data/lib/foreman_templates/version.rb +1 -1
- data/locale/cs_CZ/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/cs_CZ/foreman_templates.po +1 -1
- data/locale/de/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/de/foreman_templates.po +4 -3
- data/locale/en_GB/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/en_GB/foreman_templates.po +1 -1
- data/locale/es/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/es/foreman_templates.po +1 -1
- data/locale/fr/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/fr/foreman_templates.po +1 -1
- data/locale/gl/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/gl/foreman_templates.po +1 -1
- data/locale/it/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/it/foreman_templates.po +1 -1
- data/locale/ja/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/ja/foreman_templates.po +1 -1
- data/locale/ka/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/ka/foreman_templates.po +1 -1
- data/locale/ko/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/ko/foreman_templates.po +1 -1
- data/locale/pt_BR/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/pt_BR/foreman_templates.po +1 -1
- data/locale/ru/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/ru/foreman_templates.po +1 -1
- data/locale/sv_SE/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/sv_SE/foreman_templates.po +1 -1
- data/locale/zh_CN/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/zh_CN/foreman_templates.po +1 -1
- data/locale/zh_TW/LC_MESSAGES/foreman_templates.mo +0 -0
- data/locale/zh_TW/foreman_templates.po +1 -1
- data/webpack/ProtectedComponent.js +49 -0
- data/webpack/__mocks__/foremanReact/common/I18n.js +2 -0
- data/webpack/__mocks__/foremanReact/components/Pagination.js +4 -0
- data/webpack/__mocks__/foremanReact/redux/API.js +10 -0
- data/webpack/components/NewTemplateSync/__tests__/NewTemplateSync.test.js +101 -31
- data/webpack/components/NewTemplateSync/__tests__/testData.js +303 -0
- data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncForm.js +139 -71
- data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncForm.scss +5 -0
- data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormHelpers.js +15 -48
- data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncForm.test.js +120 -0
- data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncFormHelpers.test.js +79 -0
- data/webpack/components/NewTemplateSync/components/SyncSettingField.js +131 -33
- data/webpack/components/NewTemplateSync/components/SyncSettingFields.js +76 -50
- data/webpack/components/NewTemplateSync/components/__tests__/SyncSettingField.test.js +107 -32
- data/webpack/components/NewTemplateSync/components/__tests__/SyncSettingFields.test.js +142 -32
- data/webpack/components/NewTemplateSync/index.js +51 -25
- data/webpack/components/TemplateSyncResult/TemplateSyncResult.js +29 -34
- data/webpack/components/TemplateSyncResult/TemplateSyncResult.scss +30 -28
- data/webpack/components/TemplateSyncResult/__tests__/TemplateSyncResult.test.js +132 -34
- data/webpack/components/TemplateSyncResult/components/EmptySyncResult.js +26 -12
- data/webpack/components/TemplateSyncResult/components/FinishedSyncResult.js +25 -28
- data/webpack/components/TemplateSyncResult/components/SyncResultList.js +68 -38
- data/webpack/components/TemplateSyncResult/components/SyncedTemplate/helpers.js +145 -51
- data/webpack/components/TemplateSyncResult/components/SyncedTemplate/index.js +31 -19
- data/webpack/components/TemplateSyncResult/components/__tests__/SyncResultList.test.js +81 -25
- data/webpack/components/TemplateSyncResult/components/__tests__/SyncedTemplate.test.js +260 -29
- data/webpack/components/TemplateSyncResult/components/__tests__/helpers.test.js +218 -0
- data/webpack/components/TemplateSyncResult/index.js +1 -11
- data/webpack/consts.js +4 -5
- data/webpack/global_index.js +14 -0
- data/webpack/index.js +3 -9
- metadata +12 -70
- data/app/controllers/template_syncs_controller.rb +0 -13
- data/app/views/template_syncs/index.html.erb +0 -21
- data/webpack/ForemanTemplates.js +0 -33
- data/webpack/Routes.js +0 -33
- data/webpack/__mocks__/foremanReact/Root/Context/ForemanContext.js +0 -2
- data/webpack/__mocks__/foremanReact/components/Layout/LayoutSelectors.js +0 -4
- data/webpack/__mocks__/foremanReact/components/Pagination/index.js +0 -2
- data/webpack/__mocks__/foremanReact/components/common/forms/CommonForm.js +0 -2
- data/webpack/__mocks__/foremanReact/components/common/forms/ForemanForm.js +0 -2
- data/webpack/__mocks__/foremanReact/components/common/forms/TextField.js +0 -2
- data/webpack/__mocks__/foremanReact/redux/actions/common/forms.js +0 -1
- data/webpack/__mocks__/foremanReact/routes/common/PageLayout/PageLayout.js +0 -2
- data/webpack/__tests__/__snapshots__/helpers.test.js.snap +0 -5
- data/webpack/__tests__/helpers.test.js +0 -17
- data/webpack/components/NewTemplateSync/NewTemplateSync.js +0 -61
- data/webpack/components/NewTemplateSync/NewTemplateSync.scss +0 -19
- data/webpack/components/NewTemplateSync/NewTemplateSyncActions.js +0 -39
- data/webpack/components/NewTemplateSync/NewTemplateSyncReducer.js +0 -34
- data/webpack/components/NewTemplateSync/NewTemplateSyncSelectors.js +0 -7
- data/webpack/components/NewTemplateSync/__fixtures__/templateSyncSettings.fixtures.js +0 -78
- data/webpack/components/NewTemplateSync/__tests__/NewTemplateSyncReducer.test.js +0 -55
- data/webpack/components/NewTemplateSync/__tests__/NewTemplateSyncSelectors.test.js +0 -28
- data/webpack/components/NewTemplateSync/__tests__/__snapshots__/NewTemplateSync.test.js.snap +0 -53
- data/webpack/components/NewTemplateSync/__tests__/__snapshots__/NewTemplateSyncReducer.test.js.snap +0 -79
- data/webpack/components/NewTemplateSync/__tests__/__snapshots__/NewTemplateSyncSelectors.test.js.snap +0 -64
- data/webpack/components/NewTemplateSync/components/ButtonTooltip.js +0 -17
- data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js +0 -21
- data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncFormSelectors.test.js +0 -19
- data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/__snapshots__/NewTemplateSyncFormSelectors.test.js.snap +0 -15
- data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/index.js +0 -28
- data/webpack/components/NewTemplateSync/components/ProxySettingField.js +0 -44
- data/webpack/components/NewTemplateSync/components/ProxySettingFields.js +0 -89
- data/webpack/components/NewTemplateSync/components/SyncTypeRadios.js +0 -52
- data/webpack/components/NewTemplateSync/components/TextButtonField/BlankOption.js +0 -19
- data/webpack/components/NewTemplateSync/components/TextButtonField/CheckboxField.js +0 -15
- data/webpack/components/NewTemplateSync/components/TextButtonField/FieldType.js +0 -46
- data/webpack/components/NewTemplateSync/components/TextButtonField/InputField.js +0 -14
- data/webpack/components/NewTemplateSync/components/TextButtonField/RenderField.js +0 -74
- data/webpack/components/NewTemplateSync/components/TextButtonField/SelectField.js +0 -24
- data/webpack/components/NewTemplateSync/components/TextButtonField/index.js +0 -76
- data/webpack/components/NewTemplateSync/components/__tests__/SyncTypeRadios.test.js +0 -20
- data/webpack/components/NewTemplateSync/components/__tests__/TextButtonField.test.js +0 -65
- data/webpack/components/NewTemplateSync/components/__tests__/__snapshots__/SyncSettingField.test.js.snap +0 -149
- data/webpack/components/NewTemplateSync/components/__tests__/__snapshots__/SyncSettingFields.test.js.snap +0 -115
- data/webpack/components/NewTemplateSync/components/__tests__/__snapshots__/SyncTypeRadios.test.js.snap +0 -46
- data/webpack/components/NewTemplateSync/components/__tests__/__snapshots__/TextButtonField.test.js.snap +0 -29
- data/webpack/components/PageNotFound.js +0 -14
- data/webpack/components/PermissionDenied.js +0 -34
- data/webpack/components/TemplateSyncResult/TemplateSyncResultActions.js +0 -4
- data/webpack/components/TemplateSyncResult/TemplateSyncResultHelpers.js +0 -6
- data/webpack/components/TemplateSyncResult/TemplateSyncResultReducer.js +0 -33
- data/webpack/components/TemplateSyncResult/TemplateSyncResultSelectors.js +0 -1
- data/webpack/components/TemplateSyncResult/__fixtures__/templateSyncResult.fixtures.js +0 -86
- data/webpack/components/TemplateSyncResult/__tests__/TemplateSyncResultReducer.test.js +0 -48
- data/webpack/components/TemplateSyncResult/__tests__/__snapshots__/TemplateSyncResult.test.js.snap +0 -114
- data/webpack/components/TemplateSyncResult/__tests__/__snapshots__/TemplateSyncResultReducer.test.js.snap +0 -90
- data/webpack/components/TemplateSyncResult/components/ListViewHeader.js +0 -38
- data/webpack/components/TemplateSyncResult/components/SyncedTemplate/EmptyInfoItem.js +0 -16
- data/webpack/components/TemplateSyncResult/components/SyncedTemplate/IconInfoItem.js +0 -21
- data/webpack/components/TemplateSyncResult/components/SyncedTemplate/InfoItem.js +0 -30
- data/webpack/components/TemplateSyncResult/components/SyncedTemplate/LinkInfoItem.js +0 -37
- data/webpack/components/TemplateSyncResult/components/SyncedTemplate/StringInfoItem.js +0 -37
- data/webpack/components/TemplateSyncResult/components/SyncedTemplate/__snapshots__/helpers.test.js.snap +0 -37
- data/webpack/components/TemplateSyncResult/components/SyncedTemplate/helpers.test.js +0 -21
- data/webpack/components/TemplateSyncResult/components/__tests__/__snapshots__/SyncResultList.test.js.snap +0 -100
- data/webpack/components/TemplateSyncResult/components/__tests__/__snapshots__/SyncedTemplate.test.js.snap +0 -564
- data/webpack/reducer.js +0 -6
- data/webpack/withProtectedView.js +0 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e801bbc7d2afe1beb1bf1ae085da26645c4bc6bde93e71b92d7eca7f828695ee
|
|
4
|
+
data.tar.gz: 3c3e646b286434aece5fcaa47c07198fce525dfccd2e20afa1fa7085fb439825
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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.
|
|
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": "
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
@
|
|
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
|
|
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.
|
|
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
|
-
:
|
|
124
|
-
:
|
|
125
|
-
:
|
|
126
|
-
:
|
|
127
|
-
:
|
|
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
|
|
|
Binary file
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
#
|
|
9
9
|
msgid ""
|
|
10
10
|
msgstr ""
|
|
11
|
-
"Project-Id-Version: foreman_templates 10.0.
|
|
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"
|
|
Binary file
|
|
@@ -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.
|
|
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:
|
|
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 ""
|
|
Binary file
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
#
|
|
9
9
|
msgid ""
|
|
10
10
|
msgstr ""
|
|
11
|
-
"Project-Id-Version: foreman_templates 10.0.
|
|
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"
|
|
Binary file
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
#
|
|
11
11
|
msgid ""
|
|
12
12
|
msgstr ""
|
|
13
|
-
"Project-Id-Version: foreman_templates 10.0.
|
|
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"
|
|
Binary file
|
|
Binary file
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
#
|
|
9
9
|
msgid ""
|
|
10
10
|
msgstr ""
|
|
11
|
-
"Project-Id-Version: foreman_templates 10.0.
|
|
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"
|
|
Binary file
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
#
|
|
10
10
|
msgid ""
|
|
11
11
|
msgstr ""
|
|
12
|
-
"Project-Id-Version: foreman_templates 10.0.
|
|
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"
|
|
Binary file
|
|
Binary file
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
#
|
|
9
9
|
msgid ""
|
|
10
10
|
msgstr ""
|
|
11
|
-
"Project-Id-Version: foreman_templates 10.0.
|
|
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"
|
|
Binary file
|
|
Binary file
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
msgid ""
|
|
13
13
|
msgstr ""
|
|
14
|
-
"Project-Id-Version: foreman_templates 10.0.
|
|
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"
|
|
Binary file
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
msgid ""
|
|
13
13
|
msgstr ""
|
|
14
|
-
"Project-Id-Version: foreman_templates 10.0.
|
|
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"
|
|
Binary file
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
#
|
|
9
9
|
msgid ""
|
|
10
10
|
msgstr ""
|
|
11
|
-
"Project-Id-Version: foreman_templates 10.0.
|
|
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"
|
|
Binary file
|
|
Binary file
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
#
|
|
10
10
|
msgid ""
|
|
11
11
|
msgstr ""
|
|
12
|
-
"Project-Id-Version: foreman_templates 10.0.
|
|
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;
|
|
@@ -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 });
|