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
@@ -1,512 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`WebhookForm rendering should render for edit page 1`] = `
4
- <ForemanForm
5
- enableReinitialize={true}
6
- initialValues={
7
- Object {
8
- "enabled": true,
9
- "event": "host_created.event.foreman",
10
- "http_content_type": "application/json",
11
- "http_method": "PUT",
12
- "id": 54,
13
- "name": "first webhook",
14
- "password": undefined,
15
- "ssl_ca_certs": undefined,
16
- "target_url": "https://foreman.example.com",
17
- "user": undefined,
18
- "verify_ssl": true,
19
- "webhook_template_id": 204,
20
- }
21
- }
22
- item="Webhook"
23
- onCancel={[MockFunction]}
24
- onSubmit={[MockFunction]}
25
- validationSchema={
26
- ObjectSchema {
27
- "_blacklist": RefSet {
28
- "list": Array [],
29
- "refs": Array [],
30
- },
31
- "_conditions": Array [],
32
- "_defaultDefault": [Function],
33
- "_deps": Array [],
34
- "_excludedEdges": Array [],
35
- "_exclusive": Object {},
36
- "_mutate": undefined,
37
- "_nodes": Array [
38
- "webhook_template_id",
39
- "event",
40
- "http_method",
41
- "target_url",
42
- "name",
43
- ],
44
- "_options": Object {
45
- "abortEarly": true,
46
- "recursive": true,
47
- },
48
- "_type": "object",
49
- "_typeError": [Function],
50
- "_whitelist": RefSet {
51
- "list": Array [],
52
- "refs": Array [],
53
- },
54
- "fields": Object {
55
- "event": StringSchema {
56
- "_blacklist": RefSet {
57
- "list": Array [],
58
- "refs": Array [],
59
- },
60
- "_conditions": Array [],
61
- "_deps": Array [],
62
- "_exclusive": Object {
63
- "required": true,
64
- },
65
- "_mutate": undefined,
66
- "_options": Object {
67
- "abortEarly": true,
68
- "recursive": true,
69
- },
70
- "_type": "string",
71
- "_typeError": [Function],
72
- "_whitelist": RefSet {
73
- "list": Array [],
74
- "refs": Array [],
75
- },
76
- "tests": Array [
77
- [Function],
78
- ],
79
- "transforms": Array [
80
- [Function],
81
- ],
82
- "type": "string",
83
- },
84
- "http_method": StringSchema {
85
- "_blacklist": RefSet {
86
- "list": Array [],
87
- "refs": Array [],
88
- },
89
- "_conditions": Array [],
90
- "_deps": Array [],
91
- "_exclusive": Object {
92
- "required": true,
93
- },
94
- "_mutate": undefined,
95
- "_options": Object {
96
- "abortEarly": true,
97
- "recursive": true,
98
- },
99
- "_type": "string",
100
- "_typeError": [Function],
101
- "_whitelist": RefSet {
102
- "list": Array [],
103
- "refs": Array [],
104
- },
105
- "tests": Array [
106
- [Function],
107
- ],
108
- "transforms": Array [
109
- [Function],
110
- ],
111
- "type": "string",
112
- },
113
- "name": StringSchema {
114
- "_blacklist": RefSet {
115
- "list": Array [],
116
- "refs": Array [],
117
- },
118
- "_conditions": Array [],
119
- "_deps": Array [],
120
- "_exclusive": Object {
121
- "required": true,
122
- },
123
- "_mutate": undefined,
124
- "_options": Object {
125
- "abortEarly": true,
126
- "recursive": true,
127
- },
128
- "_type": "string",
129
- "_typeError": [Function],
130
- "_whitelist": RefSet {
131
- "list": Array [],
132
- "refs": Array [],
133
- },
134
- "tests": Array [
135
- [Function],
136
- ],
137
- "transforms": Array [
138
- [Function],
139
- ],
140
- "type": "string",
141
- },
142
- "target_url": StringSchema {
143
- "_blacklist": RefSet {
144
- "list": Array [],
145
- "refs": Array [],
146
- },
147
- "_conditions": Array [],
148
- "_deps": Array [],
149
- "_exclusive": Object {
150
- "required": true,
151
- },
152
- "_mutate": undefined,
153
- "_options": Object {
154
- "abortEarly": true,
155
- "recursive": true,
156
- },
157
- "_type": "string",
158
- "_typeError": [Function],
159
- "_whitelist": RefSet {
160
- "list": Array [],
161
- "refs": Array [],
162
- },
163
- "tests": Array [
164
- [Function],
165
- ],
166
- "transforms": Array [
167
- [Function],
168
- ],
169
- "type": "string",
170
- },
171
- "webhook_template_id": StringSchema {
172
- "_blacklist": RefSet {
173
- "list": Array [],
174
- "refs": Array [],
175
- },
176
- "_conditions": Array [],
177
- "_deps": Array [],
178
- "_exclusive": Object {
179
- "required": true,
180
- },
181
- "_mutate": undefined,
182
- "_options": Object {
183
- "abortEarly": true,
184
- "recursive": true,
185
- },
186
- "_type": "string",
187
- "_typeError": [Function],
188
- "_whitelist": RefSet {
189
- "list": Array [],
190
- "refs": Array [],
191
- },
192
- "tests": Array [
193
- [Function],
194
- ],
195
- "transforms": Array [
196
- [Function],
197
- ],
198
- "type": "string",
199
- },
200
- },
201
- "tests": Array [],
202
- "transforms": Array [
203
- [Function],
204
- ],
205
- "type": "object",
206
- }
207
- }
208
- >
209
- <WebhookFormTabs
210
- activeTab={0}
211
- availableEvents={
212
- Array [
213
- "host_created",
214
- ]
215
- }
216
- disabled={false}
217
- formProps={Object {}}
218
- handleTabClick={[Function]}
219
- httpMethods={
220
- Array [
221
- Object {
222
- "label": "POST",
223
- "value": "POST",
224
- },
225
- Object {
226
- "label": "GET",
227
- "value": "GET",
228
- },
229
- Object {
230
- "label": "PUT",
231
- "value": "PUT",
232
- },
233
- Object {
234
- "label": "DELETE",
235
- "value": "DELETE",
236
- },
237
- Object {
238
- "label": "PATCH",
239
- "value": "PATCH",
240
- },
241
- ]
242
- }
243
- isEventsLoading={false}
244
- isPasswordDisabled={false}
245
- isTemplatesLoading={false}
246
- webhookTemplates={
247
- Array [
248
- Object {
249
- "label": "default template",
250
- "value": 204,
251
- },
252
- Object {
253
- "label": "default template clone",
254
- "value": 205,
255
- },
256
- ]
257
- }
258
- />
259
- </ForemanForm>
260
- `;
261
-
262
- exports[`WebhookForm rendering should render for new page 1`] = `
263
- <ForemanForm
264
- enableReinitialize={true}
265
- initialValues={
266
- Object {
267
- "enabled": true,
268
- "event": "host_created.event.foreman",
269
- "http_content_type": "application/json",
270
- "http_method": "POST",
271
- "verify_ssl": true,
272
- }
273
- }
274
- item="Webhook"
275
- onCancel={[MockFunction]}
276
- onSubmit={[MockFunction]}
277
- validationSchema={
278
- ObjectSchema {
279
- "_blacklist": RefSet {
280
- "list": Array [],
281
- "refs": Array [],
282
- },
283
- "_conditions": Array [],
284
- "_defaultDefault": [Function],
285
- "_deps": Array [],
286
- "_excludedEdges": Array [],
287
- "_exclusive": Object {},
288
- "_mutate": undefined,
289
- "_nodes": Array [
290
- "webhook_template_id",
291
- "event",
292
- "http_method",
293
- "target_url",
294
- "name",
295
- ],
296
- "_options": Object {
297
- "abortEarly": true,
298
- "recursive": true,
299
- },
300
- "_type": "object",
301
- "_typeError": [Function],
302
- "_whitelist": RefSet {
303
- "list": Array [],
304
- "refs": Array [],
305
- },
306
- "fields": Object {
307
- "event": StringSchema {
308
- "_blacklist": RefSet {
309
- "list": Array [],
310
- "refs": Array [],
311
- },
312
- "_conditions": Array [],
313
- "_deps": Array [],
314
- "_exclusive": Object {
315
- "required": true,
316
- },
317
- "_mutate": undefined,
318
- "_options": Object {
319
- "abortEarly": true,
320
- "recursive": true,
321
- },
322
- "_type": "string",
323
- "_typeError": [Function],
324
- "_whitelist": RefSet {
325
- "list": Array [],
326
- "refs": Array [],
327
- },
328
- "tests": Array [
329
- [Function],
330
- ],
331
- "transforms": Array [
332
- [Function],
333
- ],
334
- "type": "string",
335
- },
336
- "http_method": StringSchema {
337
- "_blacklist": RefSet {
338
- "list": Array [],
339
- "refs": Array [],
340
- },
341
- "_conditions": Array [],
342
- "_deps": Array [],
343
- "_exclusive": Object {
344
- "required": true,
345
- },
346
- "_mutate": undefined,
347
- "_options": Object {
348
- "abortEarly": true,
349
- "recursive": true,
350
- },
351
- "_type": "string",
352
- "_typeError": [Function],
353
- "_whitelist": RefSet {
354
- "list": Array [],
355
- "refs": Array [],
356
- },
357
- "tests": Array [
358
- [Function],
359
- ],
360
- "transforms": Array [
361
- [Function],
362
- ],
363
- "type": "string",
364
- },
365
- "name": StringSchema {
366
- "_blacklist": RefSet {
367
- "list": Array [],
368
- "refs": Array [],
369
- },
370
- "_conditions": Array [],
371
- "_deps": Array [],
372
- "_exclusive": Object {
373
- "required": true,
374
- },
375
- "_mutate": undefined,
376
- "_options": Object {
377
- "abortEarly": true,
378
- "recursive": true,
379
- },
380
- "_type": "string",
381
- "_typeError": [Function],
382
- "_whitelist": RefSet {
383
- "list": Array [],
384
- "refs": Array [],
385
- },
386
- "tests": Array [
387
- [Function],
388
- ],
389
- "transforms": Array [
390
- [Function],
391
- ],
392
- "type": "string",
393
- },
394
- "target_url": StringSchema {
395
- "_blacklist": RefSet {
396
- "list": Array [],
397
- "refs": Array [],
398
- },
399
- "_conditions": Array [],
400
- "_deps": Array [],
401
- "_exclusive": Object {
402
- "required": true,
403
- },
404
- "_mutate": undefined,
405
- "_options": Object {
406
- "abortEarly": true,
407
- "recursive": true,
408
- },
409
- "_type": "string",
410
- "_typeError": [Function],
411
- "_whitelist": RefSet {
412
- "list": Array [],
413
- "refs": Array [],
414
- },
415
- "tests": Array [
416
- [Function],
417
- ],
418
- "transforms": Array [
419
- [Function],
420
- ],
421
- "type": "string",
422
- },
423
- "webhook_template_id": StringSchema {
424
- "_blacklist": RefSet {
425
- "list": Array [],
426
- "refs": Array [],
427
- },
428
- "_conditions": Array [],
429
- "_deps": Array [],
430
- "_exclusive": Object {
431
- "required": true,
432
- },
433
- "_mutate": undefined,
434
- "_options": Object {
435
- "abortEarly": true,
436
- "recursive": true,
437
- },
438
- "_type": "string",
439
- "_typeError": [Function],
440
- "_whitelist": RefSet {
441
- "list": Array [],
442
- "refs": Array [],
443
- },
444
- "tests": Array [
445
- [Function],
446
- ],
447
- "transforms": Array [
448
- [Function],
449
- ],
450
- "type": "string",
451
- },
452
- },
453
- "tests": Array [],
454
- "transforms": Array [
455
- [Function],
456
- ],
457
- "type": "object",
458
- }
459
- }
460
- >
461
- <WebhookFormTabs
462
- activeTab={0}
463
- availableEvents={
464
- Array [
465
- "host_created",
466
- ]
467
- }
468
- disabled={false}
469
- formProps={Object {}}
470
- handleTabClick={[Function]}
471
- httpMethods={
472
- Array [
473
- Object {
474
- "label": "POST",
475
- "value": "POST",
476
- },
477
- Object {
478
- "label": "GET",
479
- "value": "GET",
480
- },
481
- Object {
482
- "label": "PUT",
483
- "value": "PUT",
484
- },
485
- Object {
486
- "label": "DELETE",
487
- "value": "DELETE",
488
- },
489
- Object {
490
- "label": "PATCH",
491
- "value": "PATCH",
492
- },
493
- ]
494
- }
495
- isEventsLoading={false}
496
- isPasswordDisabled={false}
497
- isTemplatesLoading={false}
498
- webhookTemplates={
499
- Array [
500
- Object {
501
- "label": "default template",
502
- "value": 204,
503
- },
504
- Object {
505
- "label": "default template clone",
506
- "value": 205,
507
- },
508
- ]
509
- }
510
- />
511
- </ForemanForm>
512
- `;
@@ -1,31 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`WebhooksIndexPage - Integration Test should flow: initial state 1`] = `
4
- Object {
5
- "action": Array [
6
- Array [
7
- Object {
8
- "key": "WEBHOOK_EVENTS",
9
- "type": "get-some-type",
10
- "url": "",
11
- },
12
- ],
13
- ],
14
- "state": Object {},
15
- }
16
- `;
17
-
18
- exports[`WebhooksIndexPage - Integration Test should flow: rendered 1`] = `
19
- Object {
20
- "action": Array [
21
- Array [
22
- Object {
23
- "key": "WEBHOOK_EVENTS",
24
- "type": "get-some-type",
25
- "url": "",
26
- },
27
- ],
28
- ],
29
- "state": Object {},
30
- }
31
- `;