@blaze-cms/plugin-data-ui 0.127.0-project-admin-customisations.2 → 0.127.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 (82) hide show
  1. package/CHANGELOG.md +1 -33
  2. package/README.md +0 -2
  3. package/lib/components/EntityDataListing/EntityDataListing.js +4 -4
  4. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  5. package/lib/components/EntityManager/Entity/Entity.js +190 -194
  6. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  7. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  8. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +28 -26
  9. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  10. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +89 -89
  11. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  12. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -40
  13. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  14. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +33 -31
  15. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  16. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +42 -40
  17. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  18. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +45 -43
  19. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  20. package/lib/components/EntityManager/EntityManager.js +69 -65
  21. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  22. package/lib/components/EntityManager/utils/entity.js +12 -10
  23. package/lib/components/EntityManager/utils/entity.js.map +1 -1
  24. package/lib/components/EntityManager/utils/entityAvailableActions.js +66 -62
  25. package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  26. package/lib/components/ListingTable/ListingTable.js +129 -121
  27. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  28. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  29. package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
  30. package/lib/components/ListingTable/service/index.js +19 -17
  31. package/lib/components/ListingTable/service/index.js.map +1 -1
  32. package/lib/index.js +60 -56
  33. package/lib/index.js.map +1 -1
  34. package/lib/utils/add-content-menu-items.js +27 -25
  35. package/lib/utils/add-content-menu-items.js.map +1 -1
  36. package/lib-es/components/EntityManager/Entity/Entity.js +18 -29
  37. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  38. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  39. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  40. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +7 -13
  41. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  42. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  43. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  44. package/lib-es/components/ListingTable/TableActions/TableActions.js.map +1 -1
  45. package/package.json +9 -10
  46. package/src/components/EntityManager/Entity/Entity.js +59 -65
  47. package/src/components/EntityManager/Entity/SideBarRelations/index.js +9 -23
  48. package/lib/components/InfoBoxes/InfoBoxes.js +0 -36
  49. package/lib/components/InfoBoxes/InfoBoxes.js.map +0 -1
  50. package/lib/components/InfoBoxes/container/InfoBoxContainer.js +0 -44
  51. package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +0 -1
  52. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +0 -25
  53. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +0 -1
  54. package/lib/components/InfoBoxes/hooks/useData.js +0 -42
  55. package/lib/components/InfoBoxes/hooks/useData.js.map +0 -1
  56. package/lib/components/InfoBoxes/hooks/useInfoBox.js +0 -26
  57. package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +0 -1
  58. package/lib/components/InfoBoxes/index.js +0 -12
  59. package/lib/components/InfoBoxes/index.js.map +0 -1
  60. package/lib/components/InfoBoxes/presentational/InfoBox.js +0 -46
  61. package/lib/components/InfoBoxes/presentational/InfoBox.js.map +0 -1
  62. package/lib-es/components/InfoBoxes/InfoBoxes.js +0 -28
  63. package/lib-es/components/InfoBoxes/InfoBoxes.js.map +0 -1
  64. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js +0 -30
  65. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +0 -1
  66. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +0 -25
  67. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +0 -1
  68. package/lib-es/components/InfoBoxes/hooks/useData.js +0 -37
  69. package/lib-es/components/InfoBoxes/hooks/useData.js.map +0 -1
  70. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js +0 -19
  71. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +0 -1
  72. package/lib-es/components/InfoBoxes/index.js +0 -3
  73. package/lib-es/components/InfoBoxes/index.js.map +0 -1
  74. package/lib-es/components/InfoBoxes/presentational/InfoBox.js +0 -31
  75. package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +0 -1
  76. package/src/components/InfoBoxes/InfoBoxes.js +0 -24
  77. package/src/components/InfoBoxes/container/InfoBoxContainer.js +0 -22
  78. package/src/components/InfoBoxes/helpers/build-dynamic-query.js +0 -25
  79. package/src/components/InfoBoxes/hooks/useData.js +0 -20
  80. package/src/components/InfoBoxes/hooks/useInfoBox.js +0 -13
  81. package/src/components/InfoBoxes/index.js +0 -3
  82. package/src/components/InfoBoxes/presentational/InfoBox.js +0 -34
package/CHANGELOG.md CHANGED
@@ -3,19 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # [0.127.0-project-admin-customisations.2](https://github.com/thebyte9/blaze/compare/v0.127.0-project-admin-customisations.1...v0.127.0-project-admin-customisations.2) (2023-01-26)
7
-
8
-
9
- ### Features
10
-
11
- * add initial admin renderhook plugin with first hook ([#3785](https://github.com/thebyte9/blaze/issues/3785)) ([c535036](https://github.com/thebyte9/blaze/commit/c5350369d28e870afe8a10de1a284fd63592be33))
12
- * support accordion rendering for form categories in FormBuilder ([#3784](https://github.com/thebyte9/blaze/issues/3784)) ([76d8421](https://github.com/thebyte9/blaze/commit/76d842153fa68bebb70ecf7c62fea1efaf839a88))
13
-
14
-
15
-
16
-
17
-
18
- # [0.127.0-project-admin-customisations.1](https://github.com/thebyte9/blaze/compare/v0.127.0-project-admin-customisations.0...v0.127.0-project-admin-customisations.1) (2023-01-25)
6
+ # [0.127.0](https://github.com/thebyte9/blaze/compare/v0.126.1...v0.127.0) (2023-02-10)
19
7
 
20
8
  **Note:** Version bump only for package @blaze-cms/plugin-data-ui
21
9
 
@@ -23,26 +11,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
23
11
 
24
12
 
25
13
 
26
- # [0.127.0-project-admin-customisations.0](https://github.com/thebyte9/blaze/compare/v0.126.1...v0.127.0-project-admin-customisations.0) (2023-01-25)
27
-
28
-
29
- ### Bug Fixes
30
-
31
- * admin updates feedback ([0e69cbb](https://github.com/thebyte9/blaze/commit/0e69cbb0337df371c3e1cfc2f43c0d4ce666f33b))
32
- * update snapshots ([c88c8be](https://github.com/thebyte9/blaze/commit/c88c8bec58af59a5707d15f5e212e6b515706676))
33
- * update snapshots ([d490e17](https://github.com/thebyte9/blaze/commit/d490e1746d63ed5842799d15d6696c287f9b0d10))
34
-
35
-
36
- ### Features
37
-
38
- * add admin style feedback ([3f8b9a1](https://github.com/thebyte9/blaze/commit/3f8b9a1416a8a7977631583cff62fddb43cd2e9d))
39
- * admin-ui info box component ([#3770](https://github.com/thebyte9/blaze/issues/3770)) ([01dff01](https://github.com/thebyte9/blaze/commit/01dff01c8bd2a9e522abf1c98ff32e4a1ca15fd1))
40
- * style sidebar and add updated snapshots. Bz2 2870 ([#3539](https://github.com/thebyte9/blaze/issues/3539)) ([60640e5](https://github.com/thebyte9/blaze/commit/60640e5b65b4ed426ceefabc00c3beddb2113676))
41
-
42
-
43
-
44
-
45
-
46
14
  # [0.126.0](https://github.com/thebyte9/blaze/compare/v0.126.0-alpha.6...v0.126.0) (2023-01-17)
47
15
 
48
16
  **Note:** Version bump only for package @blaze-cms/plugin-data-ui
package/README.md CHANGED
@@ -38,5 +38,3 @@ The `displayProperties` property can be set on entity schema in the api to provi
38
38
  - adminDefaultListingFilter: this is a where query that will be passed to the api to filter records from the admin listing
39
39
  - adminLabel: properties to build label when record is showing search listings
40
40
  - adminHeader: properties to build admin header
41
-
42
- -
@@ -41,10 +41,10 @@ var EntityDataListing = function EntityDataListing(_ref) {
41
41
  identifier: identifier
42
42
  }
43
43
  }),
44
- _useQuery$data = _useQuery.data,
45
- _useQuery$data2 = _useQuery$data === void 0 ? {} : _useQuery$data,
46
- _useQuery$data2$getEn = _useQuery$data2.getEntitySchemas,
47
- getEntitySchemas = _useQuery$data2$getEn === void 0 ? [] : _useQuery$data2$getEn;
44
+ _useQuery$data = _useQuery.data;
45
+ _useQuery$data = _useQuery$data === void 0 ? {} : _useQuery$data;
46
+ var _useQuery$data$getEnt = _useQuery$data.getEntitySchemas,
47
+ getEntitySchemas = _useQuery$data$getEnt === void 0 ? [] : _useQuery$data$getEnt;
48
48
  if (!getEntitySchemas.length) return '';
49
49
  return /*#__PURE__*/_react["default"].createElement(_ListingTable["default"], {
50
50
  entitySchema: getEntitySchemas[0],
@@ -1 +1 @@
1
- {"version":3,"file":"EntityDataListing.js","names":["EntityDataListing","match","menuItems","identifier","params","entityIdentifier","map","_","items","item","filter","uri","endsWith","length","Boolean","selectedMenuItem","useQuery","getQuery","variables","data","getEntitySchemas","propTypes","PropTypes","object","isRequired","array","withContext"],"sources":["../../../src/components/EntityDataListing/EntityDataListing.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\n\nimport ListingTable from '../ListingTable/ListingTable';\nimport { withContext } from '../../utils/hoc/withContext';\n\nconst EntityDataListing = ({ match, menuItems }) => {\n const {\n params: { entityIdentifier: identifier }\n } = match;\n\n const [[selectedMenuItem]] = menuItems\n .map(([_, { items }]) => {\n const item = items.filter(({ uri }) => uri.endsWith(`/${identifier}`));\n\n return item.length ? item : null;\n })\n .filter(Boolean);\n\n const { data: { getEntitySchemas = [] } = {} } = useQuery(getQuery('GET_ENTITY_SCHEMA'), {\n variables: { identifier }\n });\n\n if (!getEntitySchemas.length) return '';\n\n return <ListingTable entitySchema={getEntitySchemas[0]} selectedMenuItem={selectedMenuItem} />;\n};\n\nEntityDataListing.propTypes = {\n match: PropTypes.object.isRequired,\n menuItems: PropTypes.array.isRequired\n};\n\nexport default withContext(EntityDataListing);\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiB,OAA6B;EAAA,IAAvBC,KAAK,QAALA,KAAK;IAAEC,SAAS,QAATA,SAAS;EAC3C,IAC8BC,UAAU,GACpCF,KAAK,CADPG,MAAM,CAAIC,gBAAgB;EAG5B,4BAA6BH,SAAS,CACnCI,GAAG,CAAC,iBAAoB;MAAA;QAAlBC,CAAC;QAAIC,KAAK,YAALA,KAAK;MACf,IAAMC,IAAI,GAAGD,KAAK,CAACE,MAAM,CAAC;QAAA,IAAGC,GAAG,SAAHA,GAAG;QAAA,OAAOA,GAAG,CAACC,QAAQ,YAAKT,UAAU,EAAG;MAAA,EAAC;MAEtE,OAAOM,IAAI,CAACI,MAAM,GAAGJ,IAAI,GAAG,IAAI;IAClC,CAAC,CAAC,CACDC,MAAM,CAACI,OAAO,CAAC;IAAA;IAAA;IANVC,gBAAgB;EAQxB,gBAAiD,IAAAC,gBAAQ,EAAC,IAAAC,sBAAQ,EAAC,mBAAmB,CAAC,EAAE;MACvFC,SAAS,EAAE;QAAEf,UAAU,EAAVA;MAAW;IAC1B,CAAC,CAAC;IAAA,2BAFMgB,IAAI;IAAA,8CAA8B,CAAC,CAAC;IAAA,wCAA5BC,gBAAgB;IAAhBA,gBAAgB,sCAAG,EAAE;EAIrC,IAAI,CAACA,gBAAgB,CAACP,MAAM,EAAE,OAAO,EAAE;EAEvC,oBAAO,gCAAC,wBAAY;IAAC,YAAY,EAAEO,gBAAgB,CAAC,CAAC,CAAE;IAAC,gBAAgB,EAAEL;EAAiB,EAAG;AAChG,CAAC;AAEDf,iBAAiB,CAACqB,SAAS,GAAG;EAC5BpB,KAAK,EAAEqB,qBAAS,CAACC,MAAM,CAACC,UAAU;EAClCtB,SAAS,EAAEoB,qBAAS,CAACG,KAAK,CAACD;AAC7B,CAAC;AAAC,eAEa,IAAAE,wBAAW,EAAC1B,iBAAiB,CAAC;AAAA"}
1
+ {"version":3,"file":"EntityDataListing.js","names":["EntityDataListing","match","menuItems","identifier","params","entityIdentifier","map","_","items","item","filter","uri","endsWith","length","Boolean","selectedMenuItem","useQuery","getQuery","variables","data","getEntitySchemas","propTypes","PropTypes","object","isRequired","array","withContext"],"sources":["../../../src/components/EntityDataListing/EntityDataListing.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\n\nimport ListingTable from '../ListingTable/ListingTable';\nimport { withContext } from '../../utils/hoc/withContext';\n\nconst EntityDataListing = ({ match, menuItems }) => {\n const {\n params: { entityIdentifier: identifier }\n } = match;\n\n const [[selectedMenuItem]] = menuItems\n .map(([_, { items }]) => {\n const item = items.filter(({ uri }) => uri.endsWith(`/${identifier}`));\n\n return item.length ? item : null;\n })\n .filter(Boolean);\n\n const { data: { getEntitySchemas = [] } = {} } = useQuery(getQuery('GET_ENTITY_SCHEMA'), {\n variables: { identifier }\n });\n\n if (!getEntitySchemas.length) return '';\n\n return <ListingTable entitySchema={getEntitySchemas[0]} selectedMenuItem={selectedMenuItem} />;\n};\n\nEntityDataListing.propTypes = {\n match: PropTypes.object.isRequired,\n menuItems: PropTypes.array.isRequired\n};\n\nexport default withContext(EntityDataListing);\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiB,OAA6B;EAAA,IAAvBC,KAAK,QAALA,KAAK;IAAEC,SAAS,QAATA,SAAS;EAC3C,IAC8BC,UAAU,GACpCF,KAAK,CADPG,MAAM,CAAIC,gBAAgB;EAG5B,4BAA6BH,SAAS,CACnCI,GAAG,CAAC,iBAAoB;MAAA;QAAlBC,CAAC;QAAIC,KAAK,YAALA,KAAK;MACf,IAAMC,IAAI,GAAGD,KAAK,CAACE,MAAM,CAAC;QAAA,IAAGC,GAAG,SAAHA,GAAG;QAAA,OAAOA,GAAG,CAACC,QAAQ,YAAKT,UAAU,EAAG;MAAA,EAAC;MAEtE,OAAOM,IAAI,CAACI,MAAM,GAAGJ,IAAI,GAAG,IAAI;IAClC,CAAC,CAAC,CACDC,MAAM,CAACI,OAAO,CAAC;IAAA;IAAA;IANVC,gBAAgB;EAQxB,gBAAiD,IAAAC,gBAAQ,EAAC,IAAAC,sBAAQ,EAAC,mBAAmB,CAAC,EAAE;MACvFC,SAAS,EAAE;QAAEf,UAAU,EAAVA;MAAW;IAC1B,CAAC,CAAC;IAAA,2BAFMgB,IAAI;EAAZ,6CAA0C,CAAC,CAAC;EAA5C,2CAAgBC,gBAAgB;IAAhBA,gBAAgB,sCAAG,EAAE;EAIrC,IAAI,CAACA,gBAAgB,CAACP,MAAM,EAAE,OAAO,EAAE;EAEvC,oBAAO,gCAAC,wBAAY;IAAC,YAAY,EAAEO,gBAAgB,CAAC,CAAC,CAAE;IAAC,gBAAgB,EAAEL;EAAiB,EAAG;AAChG,CAAC;AAEDf,iBAAiB,CAACqB,SAAS,GAAG;EAC5BpB,KAAK,EAAEqB,qBAAS,CAACC,MAAM,CAACC,UAAU;EAClCtB,SAAS,EAAEoB,qBAAS,CAACG,KAAK,CAACD;AAC7B,CAAC;AAAC,eAEa,IAAAE,wBAAW,EAAC1B,iBAAiB,CAAC;AAAA"}
@@ -37,7 +37,6 @@ var _react = _interopRequireWildcard(require("react"));
37
37
  var _reactRouterDom = require("react-router-dom");
38
38
  var _client = require("@apollo/client");
39
39
  var _propTypes = _interopRequireDefault(require("prop-types"));
40
- var _pluginRenderHooksUi = require("@blaze-cms/plugin-render-hooks-ui");
41
40
  var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
42
41
  var _reactFormBuilder = require("@blaze-cms/react-form-builder");
43
42
  var _admin = require("@blaze-cms/admin");
@@ -52,7 +51,6 @@ var _constants = require("../../../constants");
52
51
  var _EntityHeader = _interopRequireDefault(require("./EntityHeader"));
53
52
  var _entity = require("../utils/entity");
54
53
  var _useToggle5 = _interopRequireDefault(require("../../../utils/hooks/useToggle"));
55
- var _InfoBoxes = _interopRequireDefault(require("../../InfoBoxes/InfoBoxes"));
56
54
  var _excluded = ["isValid", "fields", "isNewValueSet", "valuesChecked", "currentField", "value"];
57
55
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
58
56
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -191,31 +189,32 @@ var Entity = function Entity(_ref) {
191
189
  }, [client, entity, entityData, formData, formValues, pageBuilderTemplateStatus, previousQuery, schema, shouldUpdateState]);
192
190
  var getFullUrl = /*#__PURE__*/function () {
193
191
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
194
- var query, _yield$client$query, _yield$client$query$d, _yield$client$query$d2, _yield$client$query$d3, getEntityUrl;
192
+ var query, _yield$client$query, _yield$client$query$d, _yield$client$query$d2, getEntityUrl;
195
193
  return _regenerator["default"].wrap(function _callee$(_context) {
196
- while (1) switch (_context.prev = _context.next) {
197
- case 0:
198
- query = (0, _adminUiUtils.getQuery)('GET_ENTITY_URL');
199
- _context.next = 3;
200
- return client.query({
201
- query: query,
202
- variables: {
203
- itemId: entity.id,
204
- itemEntity: schema.id,
205
- fullUrl: true
206
- },
207
- fetchPolicy: 'network-only'
208
- });
209
- case 3:
210
- _yield$client$query = _context.sent;
211
- _yield$client$query$d = _yield$client$query.data;
212
- _yield$client$query$d2 = _yield$client$query$d === void 0 ? {} : _yield$client$query$d;
213
- _yield$client$query$d3 = _yield$client$query$d2.getEntityUrl;
214
- getEntityUrl = _yield$client$query$d3 === void 0 ? '' : _yield$client$query$d3;
215
- return _context.abrupt("return", getEntityUrl);
216
- case 9:
217
- case "end":
218
- return _context.stop();
194
+ while (1) {
195
+ switch (_context.prev = _context.next) {
196
+ case 0:
197
+ query = (0, _adminUiUtils.getQuery)('GET_ENTITY_URL');
198
+ _context.next = 3;
199
+ return client.query({
200
+ query: query,
201
+ variables: {
202
+ itemId: entity.id,
203
+ itemEntity: schema.id,
204
+ fullUrl: true
205
+ },
206
+ fetchPolicy: 'network-only'
207
+ });
208
+ case 3:
209
+ _yield$client$query = _context.sent;
210
+ _yield$client$query$d = _yield$client$query.data;
211
+ _yield$client$query$d = _yield$client$query$d === void 0 ? {} : _yield$client$query$d;
212
+ _yield$client$query$d2 = _yield$client$query$d.getEntityUrl, getEntityUrl = _yield$client$query$d2 === void 0 ? '' : _yield$client$query$d2;
213
+ return _context.abrupt("return", getEntityUrl);
214
+ case 8:
215
+ case "end":
216
+ return _context.stop();
217
+ }
219
218
  }
220
219
  }, _callee);
221
220
  }));
@@ -252,92 +251,94 @@ var Entity = function Entity(_ref) {
252
251
  var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_ref4) {
253
252
  var isValid, fields, isNewValueSet, valuesChecked, currentField, fieldValue, otherProps, updatedFormValues, pageBuilderTemplateId, pageBuilder, _yield$client$query2, _yield$client$query2$, data, itemsToAdd, _fields$filter, _fields$filter2, _fields$filter2$, updatedEntity, isValidAndNewValueSet, isNotValidOrNotNewValueSet;
254
253
  return _regenerator["default"].wrap(function _callee2$(_context2) {
255
- while (1) switch (_context2.prev = _context2.next) {
256
- case 0:
257
- isValid = _ref4.isValid, fields = _ref4.fields, isNewValueSet = _ref4.isNewValueSet, valuesChecked = _ref4.valuesChecked, currentField = _ref4.currentField, fieldValue = _ref4.value, otherProps = (0, _objectWithoutProperties2["default"])(_ref4, _excluded);
258
- updatedFormValues = valuesChecked ? valuesChecked.slice() : [];
259
- if (!(currentField === _constants.PAGE_BUILDER_TEMPLATE_FIELD_ID)) {
260
- _context2.next = 14;
261
- break;
262
- }
263
- pageBuilderTemplateId = fieldValue;
264
- client.writeQuery({
265
- query: (0, _adminUiUtils.getQuery)('GET_PB_TEMPLATE_STATUS'),
266
- data: {
267
- pageBuilderTemplateSet: !!pageBuilderTemplateId,
268
- pageBuilderTemplateId: pageBuilderTemplateId
254
+ while (1) {
255
+ switch (_context2.prev = _context2.next) {
256
+ case 0:
257
+ isValid = _ref4.isValid, fields = _ref4.fields, isNewValueSet = _ref4.isNewValueSet, valuesChecked = _ref4.valuesChecked, currentField = _ref4.currentField, fieldValue = _ref4.value, otherProps = (0, _objectWithoutProperties2["default"])(_ref4, _excluded);
258
+ updatedFormValues = valuesChecked ? valuesChecked.slice() : [];
259
+ if (!(currentField === _constants.PAGE_BUILDER_TEMPLATE_FIELD_ID)) {
260
+ _context2.next = 14;
261
+ break;
269
262
  }
270
- });
271
- if (componentIsMounted.current) {
272
- setPageBuilderTemplateStatus(false);
273
- }
274
- pageBuilder = updatedFormValues.filter(function (formValue) {
275
- return formValue.id === _constants.PAGE_BUILDER_FIELD_ID;
276
- });
277
- if (!pageBuilderTemplateId) {
278
- _context2.next = 14;
279
- break;
280
- }
281
- _context2.next = 10;
282
- return client.query({
283
- query: (0, _adminUiUtils.getQuery)('MERGE_PB_TEMPLATE_CHANGES'),
284
- variables: {
285
- parent: {
286
- pageBuilder: pageBuilder[0].value,
263
+ pageBuilderTemplateId = fieldValue;
264
+ client.writeQuery({
265
+ query: (0, _adminUiUtils.getQuery)('GET_PB_TEMPLATE_STATUS'),
266
+ data: {
267
+ pageBuilderTemplateSet: !!pageBuilderTemplateId,
287
268
  pageBuilderTemplateId: pageBuilderTemplateId
288
- },
289
- entityIdentifier: entityIdentifier
290
- }
291
- });
292
- case 10:
293
- _yield$client$query2 = _context2.sent;
294
- _yield$client$query2$ = _yield$client$query2.data;
295
- data = _yield$client$query2$ === void 0 ? {} : _yield$client$query2$;
296
- if (data && data.mergePageBuilderTemplateChanges) {
297
- updatedFormValues = updatedFormValues.map(function (updatedFormValue) {
298
- if (updatedFormValue.id === _constants.PAGE_BUILDER_FIELD_ID) {
299
- return _objectSpread(_objectSpread({}, updatedFormValue), {}, {
300
- value: data.mergePageBuilderTemplateChanges
301
- });
302
269
  }
303
- return updatedFormValue;
304
270
  });
305
- }
306
- case 14:
307
- itemsToAdd = [];
308
- if (formValues && formValues.length > updatedFormValues.length) {
309
- [].concat((0, _toConsumableArray2["default"])(updatedFormValues), (0, _toConsumableArray2["default"])(formValues)).forEach(function (item) {
310
- var index = updatedFormValues.findIndex(function (value) {
311
- return value.id === item.id;
312
- });
313
- if (index === -1) {
314
- itemsToAdd.push(item);
271
+ if (componentIsMounted.current) {
272
+ setPageBuilderTemplateStatus(false);
273
+ }
274
+ pageBuilder = updatedFormValues.filter(function (formValue) {
275
+ return formValue.id === _constants.PAGE_BUILDER_FIELD_ID;
276
+ });
277
+ if (!pageBuilderTemplateId) {
278
+ _context2.next = 14;
279
+ break;
280
+ }
281
+ _context2.next = 10;
282
+ return client.query({
283
+ query: (0, _adminUiUtils.getQuery)('MERGE_PB_TEMPLATE_CHANGES'),
284
+ variables: {
285
+ parent: {
286
+ pageBuilder: pageBuilder[0].value,
287
+ pageBuilderTemplateId: pageBuilderTemplateId
288
+ },
289
+ entityIdentifier: entityIdentifier
315
290
  }
316
291
  });
317
- }
318
- _fields$filter = fields.filter(function (_ref6) {
319
- var id = _ref6.id;
320
- return id === 'name';
321
- }), _fields$filter2 = (0, _slicedToArray2["default"])(_fields$filter, 1), _fields$filter2$ = _fields$filter2[0], updatedEntity = _fields$filter2$ === void 0 ? null : _fields$filter2$;
322
- updatedEntity && setPageTitle(updatedEntity.value);
323
- isValidAndNewValueSet = isValid && isNewValueSet;
324
- isNotValidOrNotNewValueSet = !isValid || !isNewValueSet;
325
- if (componentIsMounted.current) {
326
- setIsFormValid(isValid);
327
- }
328
- if (isValidAndNewValueSet && componentIsMounted.current) {
329
- setIsSaveButtonAvailable(true);
330
- setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.save);
331
- }
332
- if (isNotValidOrNotNewValueSet && componentIsMounted.current) {
333
- setIsSaveButtonAvailable(false);
334
- }
335
- if (componentIsMounted.current) {
336
- setFormValues([].concat((0, _toConsumableArray2["default"])(updatedFormValues), itemsToAdd));
337
- }
338
- case 24:
339
- case "end":
340
- return _context2.stop();
292
+ case 10:
293
+ _yield$client$query2 = _context2.sent;
294
+ _yield$client$query2$ = _yield$client$query2.data;
295
+ data = _yield$client$query2$ === void 0 ? {} : _yield$client$query2$;
296
+ if (data && data.mergePageBuilderTemplateChanges) {
297
+ updatedFormValues = updatedFormValues.map(function (updatedFormValue) {
298
+ if (updatedFormValue.id === _constants.PAGE_BUILDER_FIELD_ID) {
299
+ return _objectSpread(_objectSpread({}, updatedFormValue), {}, {
300
+ value: data.mergePageBuilderTemplateChanges
301
+ });
302
+ }
303
+ return updatedFormValue;
304
+ });
305
+ }
306
+ case 14:
307
+ itemsToAdd = [];
308
+ if (formValues && formValues.length > updatedFormValues.length) {
309
+ [].concat((0, _toConsumableArray2["default"])(updatedFormValues), (0, _toConsumableArray2["default"])(formValues)).forEach(function (item) {
310
+ var index = updatedFormValues.findIndex(function (value) {
311
+ return value.id === item.id;
312
+ });
313
+ if (index === -1) {
314
+ itemsToAdd.push(item);
315
+ }
316
+ });
317
+ }
318
+ _fields$filter = fields.filter(function (_ref6) {
319
+ var id = _ref6.id;
320
+ return id === 'name';
321
+ }), _fields$filter2 = (0, _slicedToArray2["default"])(_fields$filter, 1), _fields$filter2$ = _fields$filter2[0], updatedEntity = _fields$filter2$ === void 0 ? null : _fields$filter2$;
322
+ updatedEntity && setPageTitle(updatedEntity.value);
323
+ isValidAndNewValueSet = isValid && isNewValueSet;
324
+ isNotValidOrNotNewValueSet = !isValid || !isNewValueSet;
325
+ if (componentIsMounted.current) {
326
+ setIsFormValid(isValid);
327
+ }
328
+ if (isValidAndNewValueSet && componentIsMounted.current) {
329
+ setIsSaveButtonAvailable(true);
330
+ setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.save);
331
+ }
332
+ if (isNotValidOrNotNewValueSet && componentIsMounted.current) {
333
+ setIsSaveButtonAvailable(false);
334
+ }
335
+ if (componentIsMounted.current) {
336
+ setFormValues([].concat((0, _toConsumableArray2["default"])(updatedFormValues), itemsToAdd));
337
+ }
338
+ case 24:
339
+ case "end":
340
+ return _context2.stop();
341
+ }
341
342
  }
342
343
  }, _callee2);
343
344
  }));
@@ -389,25 +390,27 @@ var Entity = function Entity(_ref) {
389
390
  var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
390
391
  var id;
391
392
  return _regenerator["default"].wrap(function _callee3$(_context3) {
392
- while (1) switch (_context3.prev = _context3.next) {
393
- case 0:
394
- id = formData.values.id;
395
- if (componentIsMounted.current) {
396
- setIsSaveButtonAvailable(false);
397
- }
398
- _context3.next = 4;
399
- return _actionsHandlers["default"]["delete"].submit({
400
- entitySchema: entitySchema,
401
- client: client,
402
- parsedFormValues: {
403
- id: id
393
+ while (1) {
394
+ switch (_context3.prev = _context3.next) {
395
+ case 0:
396
+ id = formData.values.id;
397
+ if (componentIsMounted.current) {
398
+ setIsSaveButtonAvailable(false);
404
399
  }
405
- }, addToast);
406
- case 4:
407
- history.push("/data-listing/".concat(entitySchema.id));
408
- case 5:
409
- case "end":
410
- return _context3.stop();
400
+ _context3.next = 4;
401
+ return _actionsHandlers["default"]["delete"].submit({
402
+ entitySchema: entitySchema,
403
+ client: client,
404
+ parsedFormValues: {
405
+ id: id
406
+ }
407
+ }, addToast);
408
+ case 4:
409
+ history.push("/data-listing/".concat(entitySchema.id));
410
+ case 5:
411
+ case "end":
412
+ return _context3.stop();
413
+ }
411
414
  }
412
415
  }, _callee3);
413
416
  }));
@@ -444,49 +447,51 @@ var Entity = function Entity(_ref) {
444
447
  var _ref9 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(_ref8) {
445
448
  var textContent, isPublishButton, isPublished, isUnpublish, savedPageMessage;
446
449
  return _regenerator["default"].wrap(function _callee4$(_context4) {
447
- while (1) switch (_context4.prev = _context4.next) {
448
- case 0:
449
- textContent = _ref8.target.textContent;
450
- isPublishButton = textContent === _constants.TEXT_CONTENT_TYPE;
451
- isPublished = entityIsPublished === _constants.ENTITY_PUBLISHED;
452
- isUnpublish = (0, _entity.checkFulfilConditions)(!isPublishButton, !isPublished);
453
- if (!isUnpublish) {
454
- _context4.next = 6;
455
- break;
456
- }
457
- return _context4.abrupt("return", addToast(_constants.UNPUBLISHED_WARNING, {
458
- appearance: 'warning',
459
- autoDismiss: true
460
- }));
461
- case 6:
462
- if (!(0, _entity.checkFulfilConditions)(isPublishButton, isSaveButtonAvailable)) {
463
- _context4.next = 12;
464
- break;
465
- }
466
- _context4.next = 9;
467
- return onSubmit();
468
- case 9:
469
- savedPageMessage = _context4.sent;
470
- if (!(savedPageMessage === _constants.ERROR)) {
471
- _context4.next = 12;
472
- break;
473
- }
474
- return _context4.abrupt("return", addToast("Content not published", {
475
- appearance: _constants.ERROR,
476
- autoDismiss: true
477
- }));
478
- case 12:
479
- return _context4.abrupt("return", _actionsHandlers["default"].shared.triggerPublish({
480
- entityData: entityData,
481
- client: client,
482
- setEntityIsPublish: setEntityIsPublish,
483
- entitySchema: entitySchema,
484
- textContent: textContent,
485
- refetchRecord: refetchRecord
486
- }, addToast));
487
- case 13:
488
- case "end":
489
- return _context4.stop();
450
+ while (1) {
451
+ switch (_context4.prev = _context4.next) {
452
+ case 0:
453
+ textContent = _ref8.target.textContent;
454
+ isPublishButton = textContent === _constants.TEXT_CONTENT_TYPE;
455
+ isPublished = entityIsPublished === _constants.ENTITY_PUBLISHED;
456
+ isUnpublish = (0, _entity.checkFulfilConditions)(!isPublishButton, !isPublished);
457
+ if (!isUnpublish) {
458
+ _context4.next = 6;
459
+ break;
460
+ }
461
+ return _context4.abrupt("return", addToast(_constants.UNPUBLISHED_WARNING, {
462
+ appearance: 'warning',
463
+ autoDismiss: true
464
+ }));
465
+ case 6:
466
+ if (!(0, _entity.checkFulfilConditions)(isPublishButton, isSaveButtonAvailable)) {
467
+ _context4.next = 12;
468
+ break;
469
+ }
470
+ _context4.next = 9;
471
+ return onSubmit();
472
+ case 9:
473
+ savedPageMessage = _context4.sent;
474
+ if (!(savedPageMessage === _constants.ERROR)) {
475
+ _context4.next = 12;
476
+ break;
477
+ }
478
+ return _context4.abrupt("return", addToast("Content not published", {
479
+ appearance: _constants.ERROR,
480
+ autoDismiss: true
481
+ }));
482
+ case 12:
483
+ return _context4.abrupt("return", _actionsHandlers["default"].shared.triggerPublish({
484
+ entityData: entityData,
485
+ client: client,
486
+ setEntityIsPublish: setEntityIsPublish,
487
+ entitySchema: entitySchema,
488
+ textContent: textContent,
489
+ refetchRecord: refetchRecord
490
+ }, addToast));
491
+ case 13:
492
+ case "end":
493
+ return _context4.stop();
494
+ }
490
495
  }
491
496
  }, _callee4);
492
497
  }));
@@ -505,6 +510,21 @@ var Entity = function Entity(_ref) {
505
510
  var showPageBuilderTabs = (schema === null || schema === void 0 ? void 0 : (_schema$interfaces = schema.interfaces) === null || _schema$interfaces === void 0 ? void 0 : _schema$interfaces.includes('page-builder/page-builder-template')) || (schema === null || schema === void 0 ? void 0 : (_schema$interfaces2 = schema.interfaces) === null || _schema$interfaces2 === void 0 ? void 0 : _schema$interfaces2.includes('page-builder/page-builder'));
506
511
  return /*#__PURE__*/_react["default"].createElement("div", {
507
512
  className: "page"
513
+ }, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Prompt, {
514
+ when: hasToDisplayPrompt,
515
+ message: _constants.LEAVE_PAGE_MESSAGE
516
+ }), showModal && /*#__PURE__*/_react["default"].createElement(_admin.DeleteAction, {
517
+ onClose: setModalStatus,
518
+ deleteAction: onDelete,
519
+ itemName: formData.values.name
520
+ }), copyModalStatus && /*#__PURE__*/_react["default"].createElement(_admin.CopyDataFromAction, {
521
+ onClose: handleCopyDataFromClose,
522
+ copyAction: onCopy,
523
+ getFormData: getFormData
524
+ }), /*#__PURE__*/_react["default"].createElement("div", {
525
+ className: "row row--display-row"
526
+ }, /*#__PURE__*/_react["default"].createElement("div", {
527
+ className: "column column--three-quarters"
508
528
  }, /*#__PURE__*/_react["default"].createElement(_EntityHeader["default"], {
509
529
  entityData: entityData,
510
530
  entityIdentifier: entityIdentifier,
@@ -521,34 +541,10 @@ var Entity = function Entity(_ref) {
521
541
  onViewUrl: onViewUrlHandler,
522
542
  saveButtonText: saveButtonText
523
543
  }), /*#__PURE__*/_react["default"].createElement("div", {
524
- className: "page-wrapper__content"
525
- }, /*#__PURE__*/_react["default"].createElement("div", {
526
- className: "tabs-wrapper tabs-wrapper__tab"
527
- }, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Prompt, {
528
- when: hasToDisplayPrompt,
529
- message: _constants.LEAVE_PAGE_MESSAGE
530
- }), showModal && /*#__PURE__*/_react["default"].createElement(_admin.DeleteAction, {
531
- onClose: setModalStatus,
532
- deleteAction: onDelete,
533
- itemName: formData.values.name
534
- }), copyModalStatus && /*#__PURE__*/_react["default"].createElement(_admin.CopyDataFromAction, {
535
- onClose: handleCopyDataFromClose,
536
- copyAction: onCopy,
537
- getFormData: getFormData
538
- }), /*#__PURE__*/_react["default"].createElement("div", {
539
- className: "page__content--fixed"
540
- }, /*#__PURE__*/_react["default"].createElement("div", {
541
544
  className: "page__content"
542
545
  }, /*#__PURE__*/_react["default"].createElement("div", {
543
546
  className: "content"
544
- }, /*#__PURE__*/_react["default"].createElement(_pluginRenderHooksUi.RenderHook, {
545
- hookKey: "entity:".concat(action, ":main:top"),
546
- entity: entity,
547
- schema: schema
548
- }), /*#__PURE__*/_react["default"].createElement(_InfoBoxes["default"], {
549
- id: entity.id,
550
- schema: schema
551
- }), /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
547
+ }, /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
552
548
  enabled: showPageBuilderTabs,
553
549
  onTabChange: function onTabChange(tabId) {
554
550
  client.writeQuery({
@@ -569,8 +565,8 @@ var Entity = function Entity(_ref) {
569
565
  updateCopyData: updateCopyData,
570
566
  formValues: formValues,
571
567
  isNewEntity: isNewEntity
572
- })))))), /*#__PURE__*/_react["default"].createElement("div", {
573
- className: "column column--one-third page-sidebar"
568
+ }))))), /*#__PURE__*/_react["default"].createElement("div", {
569
+ className: "column column--one-third"
574
570
  }, showSideBarRelations && /*#__PURE__*/_react["default"].createElement(_SideBarRelations["default"], {
575
571
  entity: entity,
576
572
  formData: formData.values,