foreman_webhooks 4.0.1 → 5.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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_webhooks/locale/ca/foreman_webhooks.js +1 -1
  3. data/app/assets/javascripts/foreman_webhooks/locale/cs_CZ/foreman_webhooks.js +1 -1
  4. data/app/assets/javascripts/foreman_webhooks/locale/de/foreman_webhooks.js +1 -1
  5. data/app/assets/javascripts/foreman_webhooks/locale/en/foreman_webhooks.js +6 -6
  6. data/app/assets/javascripts/foreman_webhooks/locale/en_GB/foreman_webhooks.js +11 -11
  7. data/app/assets/javascripts/foreman_webhooks/locale/es/foreman_webhooks.js +1 -1
  8. data/app/assets/javascripts/foreman_webhooks/locale/fr/foreman_webhooks.js +74 -74
  9. data/app/assets/javascripts/foreman_webhooks/locale/it/foreman_webhooks.js +1 -1
  10. data/app/assets/javascripts/foreman_webhooks/locale/ja/foreman_webhooks.js +75 -75
  11. data/app/assets/javascripts/foreman_webhooks/locale/ka/foreman_webhooks.js +9 -9
  12. data/app/assets/javascripts/foreman_webhooks/locale/ko/foreman_webhooks.js +80 -80
  13. data/app/assets/javascripts/foreman_webhooks/locale/pl/foreman_webhooks.js +1 -1
  14. data/app/assets/javascripts/foreman_webhooks/locale/pt_BR/foreman_webhooks.js +1 -1
  15. data/app/assets/javascripts/foreman_webhooks/locale/ru/foreman_webhooks.js +1 -1
  16. data/app/assets/javascripts/foreman_webhooks/locale/zh_CN/foreman_webhooks.js +78 -78
  17. data/app/assets/javascripts/foreman_webhooks/locale/zh_TW/foreman_webhooks.js +1 -1
  18. data/lib/foreman_webhooks/engine.rb +1 -1
  19. data/lib/foreman_webhooks/version.rb +1 -1
  20. data/locale/ca/LC_MESSAGES/foreman_webhooks.mo +0 -0
  21. data/locale/ca/foreman_webhooks.po +1 -1
  22. data/locale/cs_CZ/LC_MESSAGES/foreman_webhooks.mo +0 -0
  23. data/locale/cs_CZ/foreman_webhooks.po +1 -1
  24. data/locale/de/LC_MESSAGES/foreman_webhooks.mo +0 -0
  25. data/locale/de/foreman_webhooks.po +1 -1
  26. data/locale/en/LC_MESSAGES/foreman_webhooks.mo +0 -0
  27. data/locale/en/foreman_webhooks.po +9 -9
  28. data/locale/en_GB/LC_MESSAGES/foreman_webhooks.mo +0 -0
  29. data/locale/en_GB/foreman_webhooks.po +12 -12
  30. data/locale/es/LC_MESSAGES/foreman_webhooks.mo +0 -0
  31. data/locale/es/foreman_webhooks.po +1 -1
  32. data/locale/fr/LC_MESSAGES/foreman_webhooks.mo +0 -0
  33. data/locale/fr/foreman_webhooks.po +77 -74
  34. data/locale/it/LC_MESSAGES/foreman_webhooks.mo +0 -0
  35. data/locale/it/foreman_webhooks.po +2 -2
  36. data/locale/ja/LC_MESSAGES/foreman_webhooks.mo +0 -0
  37. data/locale/ja/foreman_webhooks.po +77 -75
  38. data/locale/ka/LC_MESSAGES/foreman_webhooks.mo +0 -0
  39. data/locale/ka/foreman_webhooks.po +9 -9
  40. data/locale/ko/LC_MESSAGES/foreman_webhooks.mo +0 -0
  41. data/locale/ko/foreman_webhooks.po +82 -81
  42. data/locale/pl/LC_MESSAGES/foreman_webhooks.mo +0 -0
  43. data/locale/pl/foreman_webhooks.po +1 -1
  44. data/locale/pt_BR/LC_MESSAGES/foreman_webhooks.mo +0 -0
  45. data/locale/pt_BR/foreman_webhooks.po +1 -1
  46. data/locale/ru/LC_MESSAGES/foreman_webhooks.mo +0 -0
  47. data/locale/ru/foreman_webhooks.po +1 -1
  48. data/locale/zh_CN/LC_MESSAGES/foreman_webhooks.mo +0 -0
  49. data/locale/zh_CN/foreman_webhooks.po +80 -78
  50. data/locale/zh_TW/LC_MESSAGES/foreman_webhooks.mo +0 -0
  51. data/locale/zh_TW/foreman_webhooks.po +1 -1
  52. data/test/integration/webhooks_test.rb +234 -0
  53. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/Components/FieldConstructor.js +321 -0
  54. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/Components/WebhookFormTabs.css +23 -4
  55. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/Components/WebhookFormTabs.js +191 -149
  56. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/Components/__tests__/FieldConstructor.test.js +216 -0
  57. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/WebhookForm.js +55 -26
  58. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js +253 -37
  59. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/index.js +3 -4
  60. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookCreateModal.js +30 -19
  61. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookDeleteModal.js +52 -18
  62. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModal.js +37 -26
  63. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookTestModal.js +57 -32
  64. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/NameToEditCell.js +8 -1
  65. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/__tests__/__snapshots__/EnabledCell.test.js.snap +2 -14
  66. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/WebhooksTable.js +24 -11
  67. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/__tests__/__snapshots__/WebhooksTable.test.js.snap +64 -0
  68. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/index.js +21 -22
  69. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/WebhooksIndexPage.js +9 -15
  70. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/__tests__/integration.test.js +0 -3
  71. metadata +8 -9
  72. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/Components/ForemanFormikField.js +0 -152
  73. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/__snapshots__/WebhookForm.test.js.snap +0 -512
  74. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/__tests__/__snapshots__/integration.test.js.snap +0 -31
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_webhooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Goebel
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-02-18 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -175,18 +174,19 @@ files:
175
174
  - test/graphql/foreman_webhooks/queries/webhook_template_query_test.rb
176
175
  - test/graphql/foreman_webhooks/queries/webhook_templates_query_test.rb
177
176
  - test/graphql/foreman_webhooks/queries/webhooks_query_test.rb
177
+ - test/integration/webhooks_test.rb
178
178
  - test/jobs/foreman_webhooks/deliver_webhook_job_test.rb
179
179
  - test/models/webhook_test.rb
180
180
  - test/test_plugin_helper.rb
181
181
  - test/unit/foreman_webhooks/webhook_service_test.rb
182
182
  - webpack/ForemanWebhooks/Routes/ForemanWebhooksRoutes.js
183
- - webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/Components/ForemanFormikField.js
183
+ - webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/Components/FieldConstructor.js
184
184
  - webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/Components/WebhookFormTabs.css
185
185
  - webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/Components/WebhookFormTabs.js
186
+ - webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/Components/__tests__/FieldConstructor.test.js
186
187
  - webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/WebhookForm.js
187
188
  - webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/WebhookFormSelectors.js
188
189
  - webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
189
- - webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/__snapshots__/WebhookForm.test.js.snap
190
190
  - webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/constants.js
191
191
  - webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/index.js
192
192
  - webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookCreateModal.js
@@ -216,7 +216,6 @@ files:
216
216
  - webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/__tests__/WebhooksIndexPage.fixtures.js
217
217
  - webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/__tests__/WebhooksIndexPage.test.js
218
218
  - webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/__tests__/__snapshots__/WebhooksIndexPage.test.js.snap
219
- - webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/__tests__/__snapshots__/integration.test.js.snap
220
219
  - webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/__tests__/integration.test.js
221
220
  - webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/index.js
222
221
  - webpack/ForemanWebhooks/Routes/Webhooks/WebhooksPageActions.js
@@ -259,7 +258,6 @@ licenses:
259
258
  - GPL-3.0
260
259
  metadata:
261
260
  is_foreman_plugin: 'true'
262
- post_install_message:
263
261
  rdoc_options: []
264
262
  require_paths:
265
263
  - lib
@@ -274,8 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
274
272
  - !ruby/object:Gem::Version
275
273
  version: '0'
276
274
  requirements: []
277
- rubygems_version: 3.2.33
278
- signing_key:
275
+ rubygems_version: 4.0.3
279
276
  specification_version: 4
280
277
  summary: Configure webhooks for Foreman.
281
278
  test_files:
@@ -287,10 +284,12 @@ test_files:
287
284
  - test/graphql/foreman_webhooks/queries/webhook_template_query_test.rb
288
285
  - test/graphql/foreman_webhooks/queries/webhook_templates_query_test.rb
289
286
  - test/graphql/foreman_webhooks/queries/webhooks_query_test.rb
287
+ - test/integration/webhooks_test.rb
290
288
  - test/jobs/foreman_webhooks/deliver_webhook_job_test.rb
291
289
  - test/models/webhook_test.rb
292
290
  - test/test_plugin_helper.rb
293
291
  - test/unit/foreman_webhooks/webhook_service_test.rb
292
+ - webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/Components/__tests__/FieldConstructor.test.js
294
293
  - webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
295
294
  - webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/Formatters/__tests__/enabledCellFormatter.test.js
296
295
  - webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/__tests__/EnabledCell.test.js
@@ -1,152 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Field as FormikField } from 'formik';
4
- import { Spinner } from '@patternfly/react-core';
5
- import { TypeAheadSelect } from 'patternfly-react';
6
- import { filter } from 'lodash';
7
-
8
- import { translate as __ } from 'foremanReact/common/I18n';
9
-
10
- import FormField from 'foremanReact/components/common/forms/FormField';
11
-
12
- const ForemanFormikField = ({
13
- name,
14
- type,
15
- required,
16
- label,
17
- labelHelp,
18
- inputSizeClass,
19
- labelSizeClass,
20
- rows,
21
- placeholder,
22
- options,
23
- isLoading,
24
- disabled,
25
- setDisabled,
26
- }) => (
27
- <FormikField name={name}>
28
- {({
29
- field, // { name, value, onChange, onBlur }
30
- form: { touched, errors, setFieldValue, setFieldTouched }, // also values, setXXXX, handleXXXX, dirty, isValid, status, etc.
31
- }) => {
32
- const defaultSelection = (fieldValue, initialOptions) => {
33
- if (!fieldValue) return [];
34
-
35
- return filter(initialOptions, o => o.value === fieldValue);
36
- };
37
- const passwordInput = (
38
- <input
39
- {...field}
40
- placeholder={disabled ? '********' : ''}
41
- type={type}
42
- disabled={disabled}
43
- className="form-control"
44
- />
45
- );
46
- let content = null;
47
- switch (type) {
48
- case 'textarea':
49
- content = (
50
- <textarea
51
- {...field}
52
- className="form-control"
53
- rows={rows}
54
- placeholder={placeholder}
55
- />
56
- );
57
- break;
58
- case 'select':
59
- content = isLoading ? (
60
- <Spinner size="md" aria-label="loading icon" />
61
- ) : (
62
- <TypeAheadSelect
63
- id={name}
64
- options={options}
65
- placeholder={__('Start typing to search')}
66
- selected={defaultSelection(field.value, options)}
67
- onChange={selected =>
68
- setFieldValue(field.name, selected[0]?.value)
69
- }
70
- />
71
- );
72
- break;
73
- case 'password':
74
- content = setDisabled ? (
75
- <div className="input-group">
76
- {passwordInput}
77
- <span className="input-group-btn">
78
- <button
79
- className="btn btn-default"
80
- onClick={e => {
81
- e.preventDefault();
82
- setDisabled(!disabled);
83
- }}
84
- title={__('Change the password')}
85
- >
86
- <span className="pficon pficon-edit" />
87
- </button>
88
- </span>
89
- </div>
90
- ) : (
91
- passwordInput
92
- );
93
- break;
94
- default:
95
- content = (
96
- <input
97
- {...field}
98
- type={type}
99
- checked={type === 'checkbox' ? field.value || '' : undefined}
100
- className={type === 'checkbox' ? '' : 'form-control'}
101
- />
102
- );
103
- }
104
- return (
105
- <FormField
106
- {...field}
107
- error={touched[name] ? errors[name] : undefined}
108
- type={type}
109
- inputSizeClass={inputSizeClass}
110
- labelSizeClass={labelSizeClass}
111
- required={required}
112
- label={label}
113
- labelHelp={labelHelp}
114
- options={options}
115
- >
116
- {content}
117
- </FormField>
118
- );
119
- }}
120
- </FormikField>
121
- );
122
-
123
- ForemanFormikField.propTypes = {
124
- name: PropTypes.string.isRequired,
125
- type: PropTypes.string.isRequired,
126
- required: PropTypes.bool,
127
- label: PropTypes.string.isRequired,
128
- labelHelp: PropTypes.string,
129
- inputSizeClass: PropTypes.string,
130
- labelSizeClass: PropTypes.string,
131
- rows: PropTypes.number,
132
- placeholder: PropTypes.string,
133
- options: PropTypes.array,
134
- isLoading: PropTypes.bool,
135
- disabled: PropTypes.bool,
136
- setDisabled: PropTypes.func,
137
- };
138
-
139
- ForemanFormikField.defaultProps = {
140
- required: false,
141
- labelHelp: null,
142
- inputSizeClass: 'col-md-8',
143
- labelSizeClass: 'col-md-3',
144
- rows: 1,
145
- placeholder: '',
146
- options: null,
147
- isLoading: false,
148
- disabled: false,
149
- setDisabled: undefined,
150
- };
151
-
152
- export default ForemanFormikField;