foreman_webhooks 5.0.3 → 5.1.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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -15
  3. data/app/models/webhook.rb +1 -1
  4. data/lib/foreman_webhooks/version.rb +1 -1
  5. data/webpack/ForemanWebhooks/Routes/ForemanWebhooksRoutes.js +1 -1
  6. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookTable/Components/Formatters/__tests__/actionCellFormatter.test.js +109 -0
  7. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookTable/Components/Formatters/__tests__/enabledCellFormatter.test.js +38 -0
  8. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookTable/Components/Formatters/__tests__/nameToEditFormatter.test.js +82 -0
  9. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookTable/Components/Formatters/actionCellFormatter.js +23 -0
  10. data/webpack/ForemanWebhooks/Routes/Webhooks/{WebhooksIndexPage/Components/WebhooksTable/Components/EnabledCell.js → Components/WebhookTable/Components/Formatters/enabledCellFormatter.js} +6 -1
  11. data/webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookTable/Components/Formatters/nameToEditFormatter.js +33 -0
  12. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookCreateModal.js +1 -0
  13. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookDeleteModal.js +5 -1
  14. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModal.js +1 -0
  15. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/WebhooksIndexPage.js +120 -16
  16. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/__tests__/WebhooksIndexPage.test.js +130 -22
  17. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/__tests__/integration.test.js +10 -3
  18. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/__tests__/mocks/MockForemanTableIndexPage.js +37 -0
  19. data/webpack/ForemanWebhooks/Routes/Webhooks/constants.js +3 -3
  20. data/webpack/test_setup.js +3 -0
  21. metadata +18 -93
  22. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/EmptyWebhooksTable/index.js +0 -29
  23. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/Formatters/__tests__/__snapshots__/enabledCellFormatter.test.js.snap +0 -7
  24. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/Formatters/__tests__/enabledCellFormatter.test.js +0 -7
  25. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/Formatters/actionCellFormatter.js +0 -20
  26. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/Formatters/enabledCellFormatter.js +0 -6
  27. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/Formatters/index.js +0 -3
  28. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/Formatters/nameToEditFormatter.js +0 -19
  29. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/NameToEditCell.js +0 -42
  30. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/__tests__/EnabledCell.test.js +0 -14
  31. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/Components/__tests__/__snapshots__/EnabledCell.test.js.snap +0 -5
  32. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/WebhooksTable.js +0 -121
  33. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/WebhooksTableSchema.js +0 -48
  34. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/__tests__/WebhooksTable.test.js +0 -64
  35. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/__tests__/__snapshots__/WebhooksTable.test.js.snap +0 -250
  36. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhooksTable/index.js +0 -76
  37. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/__tests__/__snapshots__/WebhooksIndexPage.test.js.snap +0 -17
  38. data/webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/index.js +0 -3
  39. data/webpack/__mocks__/foremanReact/Root/Context/ForemanContext.js +0 -1
  40. data/webpack/__mocks__/foremanReact/common/HOC.js +0 -30
  41. data/webpack/__mocks__/foremanReact/common/I18n.js +0 -7
  42. data/webpack/__mocks__/foremanReact/common/helpers.js +0 -7
  43. data/webpack/__mocks__/foremanReact/common/urlHelpers.js +0 -8
  44. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +0 -2
  45. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalHooks.js +0 -10
  46. data/webpack/__mocks__/foremanReact/components/ForemanModal/index.js +0 -23
  47. data/webpack/__mocks__/foremanReact/components/Layout/LayoutActions.js +0 -2
  48. data/webpack/__mocks__/foremanReact/components/Loading/Loading.js +0 -2
  49. data/webpack/__mocks__/foremanReact/components/Loading/index.js +0 -3
  50. data/webpack/__mocks__/foremanReact/components/PF4/TableIndexPage/TableIndexPage.js +0 -10
  51. data/webpack/__mocks__/foremanReact/components/Pagination/index.js +0 -4
  52. data/webpack/__mocks__/foremanReact/components/common/ActionButtons/ActionButtons.js +0 -3
  53. data/webpack/__mocks__/foremanReact/components/common/EmptyState.js +0 -5
  54. data/webpack/__mocks__/foremanReact/components/common/forms/ForemanForm.js +0 -9
  55. data/webpack/__mocks__/foremanReact/components/common/forms/FormField.js +0 -3
  56. data/webpack/__mocks__/foremanReact/components/common/table.js +0 -26
  57. data/webpack/__mocks__/foremanReact/constants.js +0 -24
  58. data/webpack/__mocks__/foremanReact/history.js +0 -3
  59. data/webpack/__mocks__/foremanReact/redux/API/APISelectors.js +0 -6
  60. data/webpack/__mocks__/foremanReact/redux/API/index.js +0 -10
  61. data/webpack/__mocks__/foremanReact/redux/actions/common/forms.js +0 -1
  62. data/webpack/__mocks__/foremanReact/redux/actions/toasts.js +0 -8
  63. data/webpack/__mocks__/foremanReact/routes/common/PageLayout/PageLayout.js +0 -10
  64. /data/webpack/ForemanWebhooks/Routes/Webhooks/{WebhooksIndexPage/Components/WebhooksTable → Components/WebhookTable}/Components/ActionButtons/ActionButton.js +0 -0
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
-
4
- const TableIndexPage = ({ children }) => <div>{children}</div>;
5
-
6
- TableIndexPage.propTypes = {
7
- children: PropTypes.node.isRequired,
8
- };
9
-
10
- export default TableIndexPage;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
-
3
- const Pagination = () => <></>;
4
- export default Pagination;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
-
3
- export const ActionButtons = () => <div />;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
-
3
- export const DefaultEmptyState = () => (
4
- <div className="empty-state-description" />
5
- );
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
-
3
- const ForemanForm = () => (
4
- <React.Fragment>
5
- <form />
6
- </React.Fragment>
7
- );
8
-
9
- export default ForemanForm;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
-
3
- export const ForemanField = props => <div />;
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
-
3
- export const Table = () => <div className="table" />;
4
- export const createTableReducer = jest.fn(controller => controller);
5
- export const cellFormatter = cell => cell;
6
- export const deleteActionCellFormatter = cell => cell;
7
- export const sortableColumn = jest.fn();
8
- export const column = (
9
- property,
10
- label,
11
- headFormat,
12
- cellFormat,
13
- headProps = {},
14
- cellProps = {}
15
- ) => ({
16
- property,
17
- header: {
18
- label,
19
- props: headProps,
20
- formatters: headFormat,
21
- },
22
- cell: {
23
- props: cellProps,
24
- formatters: cellFormat,
25
- },
26
- });
@@ -1,24 +0,0 @@
1
- export const STATUS = {
2
- PENDING: 'PENDING',
3
- RESOLVED: 'RESOLVED',
4
- ERROR: 'ERROR',
5
- };
6
-
7
- export const getControllerSearchProps = (
8
- controller,
9
- id = 'searchBar',
10
- canCreateBookmarks = true
11
- ) => ({
12
- controller,
13
- autocomplete: {
14
- id,
15
- searchQuery: '',
16
- url: `${controller}/auto_complete_search`,
17
- useKeyShortcuts: true,
18
- },
19
- bookmarks: {
20
- url: '/api/bookmarks',
21
- canCreateBookmarks,
22
- documentationUrl: `4.1.5Searching`,
23
- },
24
- });
@@ -1,3 +0,0 @@
1
- import { createMemoryHistory } from 'history';
2
-
3
- export const history = createMemoryHistory();
@@ -1,6 +0,0 @@
1
- export const selectAPIResponse = (state, key) =>
2
- selectAPIByKey(state, key).response;
3
-
4
- export const selectAPIStatus = (state, key) => 'PENDING';
5
- export const selectAPIByKey = (state, key) => state.API[key];
6
- export const selectAPIError = (state, key) => ({ error: `${key} ERRROR` });
@@ -1,10 +0,0 @@
1
- export const API = {
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 });
@@ -1 +0,0 @@
1
- export const submitForm = jest.fn(() => '');
@@ -1,8 +0,0 @@
1
- export const addToast = toast => ({
2
- type: 'TOASTS_ADD',
3
- payload: {
4
- message: toast,
5
- },
6
- });
7
-
8
- export default addToast;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
-
4
- const PageLayout = ({ children }) => <div>{children}</div>;
5
-
6
- PageLayout.propTypes = {
7
- children: PropTypes.node.isRequired,
8
- };
9
-
10
- export default PageLayout;