@blaze-cms/plugin-data-ui 0.131.0-project-admin-customisations.2 → 0.132.0-admin-updates.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 (123) hide show
  1. package/CHANGELOG.md +9 -47
  2. package/README.md +0 -42
  3. package/lib/components/EntityDataListing/EntityDataListing.js +24 -3
  4. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  5. package/lib/components/EntityManager/Entity/Entity.js +3 -16
  6. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  7. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +2 -12
  8. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  9. package/lib/components/ListingTable/ListingTable.js +80 -113
  10. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  11. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +20 -8
  12. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  13. package/lib/components/ListingTable/mappers/populate-rows.js +26 -92
  14. package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
  15. package/lib/components/ListingTable/service/index.js +11 -73
  16. package/lib/components/ListingTable/service/index.js.map +1 -1
  17. package/lib/index.js +11 -3
  18. package/lib/index.js.map +1 -1
  19. package/lib/utils/add-content-menu-items.js +13 -64
  20. package/lib/utils/add-content-menu-items.js.map +1 -1
  21. package/lib/utils/build-listing-query.js +2 -11
  22. package/lib/utils/build-listing-query.js.map +1 -1
  23. package/lib/utils/get-default-query-params.js +4 -3
  24. package/lib/utils/get-default-query-params.js.map +1 -1
  25. package/lib-es/components/EntityDataListing/EntityDataListing.js +14 -3
  26. package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
  27. package/lib-es/components/EntityManager/Entity/Entity.js +3 -16
  28. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  29. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +2 -12
  30. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  31. package/lib-es/components/ListingTable/ListingTable.js +49 -46
  32. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  33. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +19 -11
  34. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  35. package/lib-es/components/ListingTable/mappers/populate-rows.js +24 -76
  36. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
  37. package/lib-es/components/ListingTable/service/index.js +7 -65
  38. package/lib-es/components/ListingTable/service/index.js.map +1 -1
  39. package/lib-es/index.js +9 -1
  40. package/lib-es/index.js.map +1 -1
  41. package/lib-es/utils/add-content-menu-items.js +5 -49
  42. package/lib-es/utils/add-content-menu-items.js.map +1 -1
  43. package/lib-es/utils/build-listing-query.js +1 -10
  44. package/lib-es/utils/build-listing-query.js.map +1 -1
  45. package/lib-es/utils/get-default-query-params.js +3 -1
  46. package/lib-es/utils/get-default-query-params.js.map +1 -1
  47. package/package.json +9 -10
  48. package/src/components/EntityDataListing/EntityDataListing.js +12 -3
  49. package/src/components/EntityManager/Entity/Entity.js +1 -10
  50. package/src/components/EntityManager/Entity/SideBarRelations/index.js +16 -34
  51. package/src/components/ListingTable/ListingTable.js +38 -57
  52. package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +22 -8
  53. package/src/components/ListingTable/mappers/populate-rows.js +18 -83
  54. package/src/components/ListingTable/service/index.js +5 -42
  55. package/src/index.js +8 -1
  56. package/src/utils/add-content-menu-items.js +3 -45
  57. package/src/utils/build-listing-query.js +1 -11
  58. package/src/utils/get-default-query-params.js +1 -1
  59. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +0 -39
  60. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +0 -1
  61. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +0 -12
  62. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +0 -1
  63. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +0 -44
  64. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +0 -1
  65. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +0 -32
  66. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +0 -1
  67. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +0 -45
  68. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +0 -1
  69. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +0 -38
  70. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +0 -1
  71. package/lib/components/InfoBoxes/InfoBoxes.js +0 -36
  72. package/lib/components/InfoBoxes/InfoBoxes.js.map +0 -1
  73. package/lib/components/InfoBoxes/container/InfoBoxContainer.js +0 -44
  74. package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +0 -1
  75. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +0 -25
  76. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +0 -1
  77. package/lib/components/InfoBoxes/hooks/useData.js +0 -42
  78. package/lib/components/InfoBoxes/hooks/useData.js.map +0 -1
  79. package/lib/components/InfoBoxes/hooks/useInfoBox.js +0 -26
  80. package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +0 -1
  81. package/lib/components/InfoBoxes/index.js +0 -12
  82. package/lib/components/InfoBoxes/index.js.map +0 -1
  83. package/lib/components/InfoBoxes/presentational/InfoBox.js +0 -46
  84. package/lib/components/InfoBoxes/presentational/InfoBox.js.map +0 -1
  85. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +0 -30
  86. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +0 -1
  87. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js +0 -3
  88. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +0 -1
  89. package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +0 -30
  90. package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +0 -1
  91. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +0 -26
  92. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +0 -1
  93. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +0 -39
  94. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +0 -1
  95. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +0 -24
  96. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +0 -1
  97. package/lib-es/components/InfoBoxes/InfoBoxes.js +0 -28
  98. package/lib-es/components/InfoBoxes/InfoBoxes.js.map +0 -1
  99. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js +0 -30
  100. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +0 -1
  101. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +0 -25
  102. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +0 -1
  103. package/lib-es/components/InfoBoxes/hooks/useData.js +0 -37
  104. package/lib-es/components/InfoBoxes/hooks/useData.js.map +0 -1
  105. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js +0 -19
  106. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +0 -1
  107. package/lib-es/components/InfoBoxes/index.js +0 -3
  108. package/lib-es/components/InfoBoxes/index.js.map +0 -1
  109. package/lib-es/components/InfoBoxes/presentational/InfoBox.js +0 -31
  110. package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +0 -1
  111. package/src/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +0 -26
  112. package/src/components/EntityManager/Entity/EntitiyNavLinks/index.js +0 -3
  113. package/src/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +0 -22
  114. package/src/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +0 -33
  115. package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +0 -28
  116. package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +0 -33
  117. package/src/components/InfoBoxes/InfoBoxes.js +0 -24
  118. package/src/components/InfoBoxes/container/InfoBoxContainer.js +0 -22
  119. package/src/components/InfoBoxes/helpers/build-dynamic-query.js +0 -25
  120. package/src/components/InfoBoxes/hooks/useData.js +0 -20
  121. package/src/components/InfoBoxes/hooks/useInfoBox.js +0 -13
  122. package/src/components/InfoBoxes/index.js +0 -3
  123. package/src/components/InfoBoxes/presentational/InfoBox.js +0 -34
@@ -1,46 +0,0 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.object.define-property.js");
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
- require("core-js/modules/es.array.map.js");
10
- require("core-js/modules/es.array.filter.js");
11
- require("core-js/modules/es.object.to-string.js");
12
- require("core-js/modules/es.object.values.js");
13
- require("core-js/modules/es.array.concat.js");
14
- var _propTypes = _interopRequireDefault(require("prop-types"));
15
- var _react = _interopRequireDefault(require("react"));
16
- var InfoBox = function InfoBox(_ref) {
17
- var items = _ref.items,
18
- infoBoxKey = _ref.infoBoxKey;
19
- if (!items) return null;
20
- var infoBoxItems = items.map(function (item) {
21
- return Object.values(item).map(function (info) {
22
- if (!info.label || !info.value) return null;
23
- return /*#__PURE__*/_react["default"].createElement("div", {
24
- className: "info-box--item",
25
- key: "".concat(infoBoxKey, "-").concat(info.label.toLowerCase())
26
- }, /*#__PURE__*/_react["default"].createElement("div", {
27
- className: "info-box--label"
28
- }, info.label, ": "), /*#__PURE__*/_react["default"].createElement("div", {
29
- className: "info-box--value"
30
- }, info.value));
31
- }).filter(Boolean);
32
- });
33
- return /*#__PURE__*/_react["default"].createElement("div", {
34
- className: "info-box",
35
- key: infoBoxKey
36
- }, /*#__PURE__*/_react["default"].createElement("div", {
37
- className: "info-box--container"
38
- }, infoBoxItems));
39
- };
40
- var _default = InfoBox;
41
- exports["default"] = _default;
42
- InfoBox.propTypes = {
43
- infoBoxKey: _propTypes["default"].string.isRequired,
44
- items: _propTypes["default"].array.isRequired
45
- };
46
- //# sourceMappingURL=InfoBox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InfoBox.js","names":["_propTypes","_interopRequireDefault","require","_react","InfoBox","_ref","items","infoBoxKey","infoBoxItems","map","item","Object","values","info","label","value","createElement","className","key","concat","toLowerCase","filter","Boolean","_default","exports","propTypes","PropTypes","string","isRequired","array"],"sources":["../../../../src/components/InfoBoxes/presentational/InfoBox.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nconst InfoBox = ({ items, infoBoxKey }) => {\n if (!items) return null;\n\n const infoBoxItems = items.map(item =>\n Object.values(item)\n .map(info => {\n if (!info.label || !info.value) return null;\n\n return (\n <div className=\"info-box--item\" key={`${infoBoxKey}-${info.label.toLowerCase()}`}>\n <div className=\"info-box--label\">{info.label}: </div>\n <div className=\"info-box--value\">{info.value}</div>\n </div>\n );\n })\n .filter(Boolean)\n );\n\n return (\n <div className=\"info-box\" key={infoBoxKey}>\n <div className=\"info-box--container\">{infoBoxItems}</div>\n </div>\n );\n};\n\nexport default InfoBox;\n\nInfoBox.propTypes = {\n infoBoxKey: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAME,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAA8B;EAAA,IAAxBC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,UAAU,GAAAF,IAAA,CAAVE,UAAU;EAClC,IAAI,CAACD,KAAK,EAAE,OAAO,IAAI;EAEvB,IAAME,YAAY,GAAGF,KAAK,CAACG,GAAG,CAAC,UAAAC,IAAI;IAAA,OACjCC,MAAM,CAACC,MAAM,CAACF,IAAI,CAAC,CAChBD,GAAG,CAAC,UAAAI,IAAI,EAAI;MACX,IAAI,CAACA,IAAI,CAACC,KAAK,IAAI,CAACD,IAAI,CAACE,KAAK,EAAE,OAAO,IAAI;MAE3C,oBACEZ,MAAA,YAAAa,aAAA;QAAKC,SAAS,EAAC,gBAAgB;QAACC,GAAG,KAAAC,MAAA,CAAKZ,UAAU,OAAAY,MAAA,CAAIN,IAAI,CAACC,KAAK,CAACM,WAAW,CAAC,CAAC;MAAG,gBAC/EjB,MAAA,YAAAa,aAAA;QAAKC,SAAS,EAAC;MAAiB,GAAEJ,IAAI,CAACC,KAAK,EAAC,IAAO,CAAC,eACrDX,MAAA,YAAAa,aAAA;QAAKC,SAAS,EAAC;MAAiB,GAAEJ,IAAI,CAACE,KAAW,CAC/C,CAAC;IAEV,CAAC,CAAC,CACDM,MAAM,CAACC,OAAO,CAAC;EAAA,CACpB,CAAC;EAED,oBACEnB,MAAA,YAAAa,aAAA;IAAKC,SAAS,EAAC,UAAU;IAACC,GAAG,EAAEX;EAAW,gBACxCJ,MAAA,YAAAa,aAAA;IAAKC,SAAS,EAAC;EAAqB,GAAET,YAAkB,CACrD,CAAC;AAEV,CAAC;AAAC,IAAAe,QAAA,GAEanB,OAAO;AAAAoB,OAAA,cAAAD,QAAA;AAEtBnB,OAAO,CAACqB,SAAS,GAAG;EAClBlB,UAAU,EAAEmB,qBAAS,CAACC,MAAM,CAACC,UAAU;EACvCtB,KAAK,EAAEoB,qBAAS,CAACG,KAAK,CAACD;AACzB,CAAC"}
@@ -1,30 +0,0 @@
1
- import { Link } from 'react-router-dom';
2
- import React from 'react';
3
- const EntityNavLinks = ({
4
- schema
5
- }) => {
6
- if (!schema) return null;
7
- const {
8
- displayProperties: {
9
- adminSectionNavigation
10
- }
11
- } = schema;
12
- if (!adminSectionNavigation) return null;
13
- const links = Object.entries(adminSectionNavigation).map(([k, v]) => {
14
- const {
15
- label,
16
- uri
17
- } = v;
18
- const Wrapper = uri.startsWith('#') ? 'a' : Link;
19
- return /*#__PURE__*/React.createElement(Wrapper, {
20
- className: "entity-section-link",
21
- href: uri,
22
- to: uri
23
- }, label);
24
- });
25
- return /*#__PURE__*/React.createElement("div", {
26
- className: "entity-section-links"
27
- }, links);
28
- };
29
- export default EntityNavLinks;
30
- //# sourceMappingURL=EntityNavLinks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EntityNavLinks.js","names":["Link","React","EntityNavLinks","schema","displayProperties","adminSectionNavigation","links","Object","entries","map","k","v","label","uri","Wrapper","startsWith","createElement","className","href","to"],"sources":["../../../../../src/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js"],"sourcesContent":["import { Link } from 'react-router-dom';\nimport React from 'react';\n\nconst EntityNavLinks = ({ schema }) => {\n if (!schema) return null;\n\n const {\n displayProperties: { adminSectionNavigation }\n } = schema;\n\n if (!adminSectionNavigation) return null;\n\n const links = Object.entries(adminSectionNavigation).map(([k, v]) => {\n const { label, uri } = v;\n const Wrapper = uri.startsWith('#') ? 'a' : Link;\n return (\n <Wrapper className=\"entity-section-link\" href={uri} to={uri}>\n {label}\n </Wrapper>\n );\n });\n\n return <div className=\"entity-section-links\">{links}</div>;\n};\n\nexport default EntityNavLinks;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,kBAAkB;AACvC,OAAOC,KAAK,MAAM,OAAO;AAEzB,MAAMC,cAAc,GAAGA,CAAC;EAAEC;AAAO,CAAC,KAAK;EACrC,IAAI,CAACA,MAAM,EAAE,OAAO,IAAI;EAExB,MAAM;IACJC,iBAAiB,EAAE;MAAEC;IAAuB;EAC9C,CAAC,GAAGF,MAAM;EAEV,IAAI,CAACE,sBAAsB,EAAE,OAAO,IAAI;EAExC,MAAMC,KAAK,GAAGC,MAAM,CAACC,OAAO,CAACH,sBAAsB,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,KAAK;IACnE,MAAM;MAAEC,KAAK;MAAEC;IAAI,CAAC,GAAGF,CAAC;IACxB,MAAMG,OAAO,GAAGD,GAAG,CAACE,UAAU,CAAC,GAAG,CAAC,GAAG,GAAG,GAAGf,IAAI;IAChD,oBACEC,KAAA,CAAAe,aAAA,CAACF,OAAO;MAACG,SAAS,EAAC,qBAAqB;MAACC,IAAI,EAAEL,GAAI;MAACM,EAAE,EAAEN;IAAI,GACzDD,KACM,CAAC;EAEd,CAAC,CAAC;EAEF,oBAAOX,KAAA,CAAAe,aAAA;IAAKC,SAAS,EAAC;EAAsB,GAAEX,KAAW,CAAC;AAC5D,CAAC;AAED,eAAeJ,cAAc"}
@@ -1,3 +0,0 @@
1
- import EntityNavLinks from './EntityNavLinks';
2
- export default EntityNavLinks;
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["EntityNavLinks"],"sources":["../../../../../src/components/EntityManager/Entity/EntitiyNavLinks/index.js"],"sourcesContent":["import EntityNavLinks from './EntityNavLinks';\n\nexport default EntityNavLinks;\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAE7C,eAAeA,cAAc"}
@@ -1,30 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import useCustomSidebarData from '../hooks/useCustomSidebarData';
4
- import CustomSidebarInfo from '../presentational/CustomSidebarInfo';
5
- const CustomSibebarInfoContainer = ({
6
- id,
7
- schema,
8
- displayProperties
9
- }) => {
10
- const {
11
- data
12
- } = useCustomSidebarData({
13
- id,
14
- schema,
15
- displayProperties
16
- });
17
- if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;
18
- const items = Object.values(data).flatMap(item => Object.values(item));
19
- return /*#__PURE__*/React.createElement(CustomSidebarInfo, {
20
- items: items,
21
- customSidebarInfoKey: displayProperties.key
22
- });
23
- };
24
- export default CustomSibebarInfoContainer;
25
- CustomSibebarInfoContainer.propTypes = {
26
- id: PropTypes.string.isRequired,
27
- displayProperties: PropTypes.object.isRequired,
28
- schema: PropTypes.object.isRequired
29
- };
30
- //# sourceMappingURL=CustomSidebarInfoContainer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CustomSidebarInfoContainer.js","names":["PropTypes","React","useCustomSidebarData","CustomSidebarInfo","CustomSibebarInfoContainer","id","schema","displayProperties","data","Object","keys","length","items","values","flatMap","item","createElement","customSidebarInfoKey","key","propTypes","string","isRequired","object"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport useCustomSidebarData from '../hooks/useCustomSidebarData';\nimport CustomSidebarInfo from '../presentational/CustomSidebarInfo';\n\nconst CustomSibebarInfoContainer = ({ id, schema, displayProperties }) => {\n const { data } = useCustomSidebarData({ id, schema, displayProperties });\n\n if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;\n\n const items = Object.values(data).flatMap(item => Object.values(item));\n\n return <CustomSidebarInfo items={items} customSidebarInfoKey={displayProperties.key} />;\n};\n\nexport default CustomSibebarInfoContainer;\n\nCustomSibebarInfoContainer.propTypes = {\n id: PropTypes.string.isRequired,\n displayProperties: PropTypes.object.isRequired,\n schema: PropTypes.object.isRequired\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,oBAAoB,MAAM,+BAA+B;AAChE,OAAOC,iBAAiB,MAAM,qCAAqC;AAEnE,MAAMC,0BAA0B,GAAGA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAkB,CAAC,KAAK;EACxE,MAAM;IAAEC;EAAK,CAAC,GAAGN,oBAAoB,CAAC;IAAEG,EAAE;IAAEC,MAAM;IAAEC;EAAkB,CAAC,CAAC;EAExE,IAAI,CAACC,IAAI,IAAI,CAACC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,CAACG,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAE9E,MAAMC,KAAK,GAAGH,MAAM,CAACI,MAAM,CAACL,IAAI,CAAC,CAACM,OAAO,CAACC,IAAI,IAAIN,MAAM,CAACI,MAAM,CAACE,IAAI,CAAC,CAAC;EAEtE,oBAAOd,KAAA,CAAAe,aAAA,CAACb,iBAAiB;IAACS,KAAK,EAAEA,KAAM;IAACK,oBAAoB,EAAEV,iBAAiB,CAACW;EAAI,CAAE,CAAC;AACzF,CAAC;AAED,eAAed,0BAA0B;AAEzCA,0BAA0B,CAACe,SAAS,GAAG;EACrCd,EAAE,EAAEL,SAAS,CAACoB,MAAM,CAACC,UAAU;EAC/Bd,iBAAiB,EAAEP,SAAS,CAACsB,MAAM,CAACD,UAAU;EAC9Cf,MAAM,EAAEN,SAAS,CAACsB,MAAM,CAACD;AAC3B,CAAC"}
@@ -1,26 +0,0 @@
1
- import { gql } from '@apollo/client';
2
- import { BlazeError } from '@blaze-cms/core-errors';
3
- export default function buildDynamicQuery({
4
- id,
5
- schema,
6
- displayProperties
7
- }) {
8
- if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
9
- throw new BlazeError('DataEntity query requires get action, properties and fields from entity schema');
10
- }
11
- if (displayProperties.adminMainInfoProperty && Array.isArray(displayProperties.adminMainInfoProperty)) {
12
- const fields = displayProperties.adminMainInfoProperty.map(infoProperty => `${infoProperty} {
13
- label
14
- value
15
- }`);
16
- return gql`query getInfoBoxData($id: String!){
17
- ${schema.actions.get}( id: $id ) {
18
- id
19
- ${fields.map(field => field)}
20
- __typename
21
- }
22
- }`;
23
- }
24
- return null;
25
- }
26
- //# sourceMappingURL=build-dynamic-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-dynamic-query.js","names":["gql","BlazeError","buildDynamicQuery","id","schema","displayProperties","actions","get","properties","adminMainInfoProperty","Array","isArray","fields","map","infoProperty","field"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nexport default function buildDynamicQuery({ id, schema, displayProperties }) {\n if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {\n throw new BlazeError(\n 'DataEntity query requires get action, properties and fields from entity schema'\n );\n }\n\n if (\n displayProperties.adminMainInfoProperty &&\n Array.isArray(displayProperties.adminMainInfoProperty)\n ) {\n const fields = displayProperties.adminMainInfoProperty.map(\n infoProperty =>\n `${infoProperty} {\n label\n value\n }`\n );\n\n return gql`query getInfoBoxData($id: String!){\n ${schema.actions.get}( id: $id ) {\n id\n ${fields.map(field => field)}\n __typename\n }\n }`;\n }\n\n return null;\n}\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,eAAe,SAASC,iBAAiBA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAkB,CAAC,EAAE;EAC3E,IAAI,CAACD,MAAM,IAAI,CAACA,MAAM,CAACE,OAAO,IAAI,CAACF,MAAM,CAACE,OAAO,CAACC,GAAG,IAAI,CAACH,MAAM,CAACI,UAAU,EAAE;IAC3E,MAAM,IAAIP,UAAU,CAClB,gFACF,CAAC;EACH;EAEA,IACEI,iBAAiB,CAACI,qBAAqB,IACvCC,KAAK,CAACC,OAAO,CAACN,iBAAiB,CAACI,qBAAqB,CAAC,EACtD;IACA,MAAMG,MAAM,GAAGP,iBAAiB,CAACI,qBAAqB,CAACI,GAAG,CACxDC,YAAY,IACT,GAAEA,YAAa;AACxB;AACA;AACA,QACI,CAAC;IAED,OAAOd,GAAI;AACf,QAAQI,MAAM,CAACE,OAAO,CAACC,GAAI;AAC3B;AACA,SAASK,MAAM,CAACC,GAAG,CAACE,KAAK,IAAIA,KAAK,CAAE;AACpC;AACA;AACA,MAAM;EACJ;EAEA,OAAO,IAAI;AACb"}
@@ -1,39 +0,0 @@
1
- import ProptTypes from 'prop-types';
2
- import { useQuery, gql } from '@apollo/client';
3
- import buildDynamicQuery from '../helpers/build-dynamic-query';
4
- const useCustomSidebarData = ({
5
- id,
6
- schema,
7
- displayProperties
8
- }) => {
9
- const query = buildDynamicQuery({
10
- id,
11
- schema,
12
- displayProperties
13
- });
14
- const customSidebarInfoQuery = query || gql`
15
- query {
16
- __typename
17
- }
18
- `;
19
- const {
20
- data = {},
21
- loading,
22
- error
23
- } = useQuery(customSidebarInfoQuery, {
24
- variables: {
25
- id
26
- },
27
- skip: !query
28
- });
29
- return {
30
- data: data.__typename !== 'Query' ? data : null,
31
- loading,
32
- error
33
- };
34
- };
35
- export default useCustomSidebarData;
36
- useCustomSidebarData.propTypes = {
37
- displayProperties: ProptTypes.object.isRequired
38
- };
39
- //# sourceMappingURL=useCustomSidebarData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCustomSidebarData.js","names":["ProptTypes","useQuery","gql","buildDynamicQuery","useCustomSidebarData","id","schema","displayProperties","query","customSidebarInfoQuery","data","loading","error","variables","skip","__typename","propTypes","object","isRequired"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js"],"sourcesContent":["import ProptTypes from 'prop-types';\nimport { useQuery, gql } from '@apollo/client';\nimport buildDynamicQuery from '../helpers/build-dynamic-query';\n\nconst useCustomSidebarData = ({ id, schema, displayProperties }) => {\n const query = buildDynamicQuery({ id, schema, displayProperties });\n\n const customSidebarInfoQuery =\n query ||\n gql`\n query {\n __typename\n }\n `;\n\n const { data = {}, loading, error } = useQuery(customSidebarInfoQuery, {\n variables: { id },\n skip: !query\n });\n\n return { data: data.__typename !== 'Query' ? data : null, loading, error };\n};\n\nexport default useCustomSidebarData;\n\nuseCustomSidebarData.propTypes = {\n displayProperties: ProptTypes.object.isRequired\n};\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,SAASC,QAAQ,EAAEC,GAAG,QAAQ,gBAAgB;AAC9C,OAAOC,iBAAiB,MAAM,gCAAgC;AAE9D,MAAMC,oBAAoB,GAAGA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAkB,CAAC,KAAK;EAClE,MAAMC,KAAK,GAAGL,iBAAiB,CAAC;IAAEE,EAAE;IAAEC,MAAM;IAAEC;EAAkB,CAAC,CAAC;EAElE,MAAME,sBAAsB,GAC1BD,KAAK,IACLN,GAAI;AACR;AACA;AACA;AACA,KAAK;EAEH,MAAM;IAAEQ,IAAI,GAAG,CAAC,CAAC;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGX,QAAQ,CAACQ,sBAAsB,EAAE;IACrEI,SAAS,EAAE;MAAER;IAAG,CAAC;IACjBS,IAAI,EAAE,CAACN;EACT,CAAC,CAAC;EAEF,OAAO;IAAEE,IAAI,EAAEA,IAAI,CAACK,UAAU,KAAK,OAAO,GAAGL,IAAI,GAAG,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC;AAC5E,CAAC;AAED,eAAeR,oBAAoB;AAEnCA,oBAAoB,CAACY,SAAS,GAAG;EAC/BT,iBAAiB,EAAEP,UAAU,CAACiB,MAAM,CAACC;AACvC,CAAC"}
@@ -1,24 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- const CustomSidebarInfo = ({
4
- items,
5
- customSidebarInfoKey
6
- }) => {
7
- if (!items) return null;
8
- const customSidebarInfoItems = items.map(item => Object.values(item).map(info => {
9
- if (!info.label || !info.value) return null;
10
- return /*#__PURE__*/React.createElement("p", null, info.label, ": ", /*#__PURE__*/React.createElement("span", null, info.value));
11
- }).filter(Boolean));
12
- return /*#__PURE__*/React.createElement("div", {
13
- className: "custom-sidebar-info",
14
- key: customSidebarInfoKey
15
- }, /*#__PURE__*/React.createElement("div", {
16
- className: "custom-sidebar-info--container"
17
- }, customSidebarInfoItems));
18
- };
19
- export default CustomSidebarInfo;
20
- CustomSidebarInfo.propTypes = {
21
- customSidebarInfoKey: PropTypes.string.isRequired,
22
- items: PropTypes.array.isRequired
23
- };
24
- //# sourceMappingURL=CustomSidebarInfo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CustomSidebarInfo.js","names":["PropTypes","React","CustomSidebarInfo","items","customSidebarInfoKey","customSidebarInfoItems","map","item","Object","values","info","label","value","createElement","filter","Boolean","className","key","propTypes","string","isRequired","array"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nconst CustomSidebarInfo = ({ items, customSidebarInfoKey }) => {\n if (!items) return null;\n\n const customSidebarInfoItems = items.map(item =>\n Object.values(item)\n .map(info => {\n if (!info.label || !info.value) return null;\n\n return (\n <p>\n {info.label}: <span>{info.value}</span>\n </p>\n );\n })\n .filter(Boolean)\n );\n\n return (\n <div className=\"custom-sidebar-info\" key={customSidebarInfoKey}>\n <div className=\"custom-sidebar-info--container\">{customSidebarInfoItems}</div>\n </div>\n );\n};\n\nexport default CustomSidebarInfo;\n\nCustomSidebarInfo.propTypes = {\n customSidebarInfoKey: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;AAEzB,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAqB,CAAC,KAAK;EAC7D,IAAI,CAACD,KAAK,EAAE,OAAO,IAAI;EAEvB,MAAME,sBAAsB,GAAGF,KAAK,CAACG,GAAG,CAACC,IAAI,IAC3CC,MAAM,CAACC,MAAM,CAACF,IAAI,CAAC,CAChBD,GAAG,CAACI,IAAI,IAAI;IACX,IAAI,CAACA,IAAI,CAACC,KAAK,IAAI,CAACD,IAAI,CAACE,KAAK,EAAE,OAAO,IAAI;IAE3C,oBACEX,KAAA,CAAAY,aAAA,YACGH,IAAI,CAACC,KAAK,EAAC,IAAE,eAAAV,KAAA,CAAAY,aAAA,eAAOH,IAAI,CAACE,KAAY,CACrC,CAAC;EAER,CAAC,CAAC,CACDE,MAAM,CAACC,OAAO,CACnB,CAAC;EAED,oBACEd,KAAA,CAAAY,aAAA;IAAKG,SAAS,EAAC,qBAAqB;IAACC,GAAG,EAAEb;EAAqB,gBAC7DH,KAAA,CAAAY,aAAA;IAAKG,SAAS,EAAC;EAAgC,GAAEX,sBAA4B,CAC1E,CAAC;AAEV,CAAC;AAED,eAAeH,iBAAiB;AAEhCA,iBAAiB,CAACgB,SAAS,GAAG;EAC5Bd,oBAAoB,EAAEJ,SAAS,CAACmB,MAAM,CAACC,UAAU;EACjDjB,KAAK,EAAEH,SAAS,CAACqB,KAAK,CAACD;AACzB,CAAC"}
@@ -1,28 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import InfoBoxContainer from './container/InfoBoxContainer';
4
- const InfoBoxes = ({
5
- id,
6
- schema
7
- }) => {
8
- const {
9
- displayProperties: {
10
- adminInfoBoxes = []
11
- }
12
- } = schema;
13
- if (adminInfoBoxes.length <= 0) {
14
- return null;
15
- }
16
- return adminInfoBoxes.map(infoBox => /*#__PURE__*/React.createElement(InfoBoxContainer, {
17
- id: id,
18
- schema: schema,
19
- key: infoBox.key,
20
- infoBox: infoBox
21
- }));
22
- };
23
- export default InfoBoxes;
24
- InfoBoxes.propTypes = {
25
- id: PropTypes.string.isRequired,
26
- schema: PropTypes.object.isRequired
27
- };
28
- //# sourceMappingURL=InfoBoxes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InfoBoxes.js","names":["PropTypes","React","InfoBoxContainer","InfoBoxes","id","schema","displayProperties","adminInfoBoxes","length","map","infoBox","createElement","key","propTypes","string","isRequired","object"],"sources":["../../../src/components/InfoBoxes/InfoBoxes.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport InfoBoxContainer from './container/InfoBoxContainer';\n\nconst InfoBoxes = ({ id, schema }) => {\n const {\n displayProperties: { adminInfoBoxes = [] }\n } = schema;\n\n if (adminInfoBoxes.length <= 0) {\n return null;\n }\n\n return adminInfoBoxes.map(infoBox => (\n <InfoBoxContainer id={id} schema={schema} key={infoBox.key} infoBox={infoBox} />\n ));\n};\n\nexport default InfoBoxes;\n\nInfoBoxes.propTypes = {\n id: PropTypes.string.isRequired,\n schema: PropTypes.object.isRequired\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,gBAAgB,MAAM,8BAA8B;AAE3D,MAAMC,SAAS,GAAGA,CAAC;EAAEC,EAAE;EAAEC;AAAO,CAAC,KAAK;EACpC,MAAM;IACJC,iBAAiB,EAAE;MAAEC,cAAc,GAAG;IAAG;EAC3C,CAAC,GAAGF,MAAM;EAEV,IAAIE,cAAc,CAACC,MAAM,IAAI,CAAC,EAAE;IAC9B,OAAO,IAAI;EACb;EAEA,OAAOD,cAAc,CAACE,GAAG,CAACC,OAAO,iBAC/BT,KAAA,CAAAU,aAAA,CAACT,gBAAgB;IAACE,EAAE,EAAEA,EAAG;IAACC,MAAM,EAAEA,MAAO;IAACO,GAAG,EAAEF,OAAO,CAACE,GAAI;IAACF,OAAO,EAAEA;EAAQ,CAAE,CAChF,CAAC;AACJ,CAAC;AAED,eAAeP,SAAS;AAExBA,SAAS,CAACU,SAAS,GAAG;EACpBT,EAAE,EAAEJ,SAAS,CAACc,MAAM,CAACC,UAAU;EAC/BV,MAAM,EAAEL,SAAS,CAACgB,MAAM,CAACD;AAC3B,CAAC"}
@@ -1,30 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import useData from '../hooks/useData';
4
- import InfoBox from '../presentational/InfoBox';
5
- const InfoBoxContainer = ({
6
- id,
7
- schema,
8
- infoBox
9
- }) => {
10
- const {
11
- data
12
- } = useData({
13
- id,
14
- schema,
15
- infoBox
16
- });
17
- if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;
18
- const items = Object.values(data).flatMap(item => Object.values(item));
19
- return /*#__PURE__*/React.createElement(InfoBox, {
20
- items: items,
21
- infoBoxKey: infoBox.key
22
- });
23
- };
24
- export default InfoBoxContainer;
25
- InfoBoxContainer.propTypes = {
26
- id: PropTypes.string.isRequired,
27
- infoBox: PropTypes.object.isRequired,
28
- schema: PropTypes.object.isRequired
29
- };
30
- //# sourceMappingURL=InfoBoxContainer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InfoBoxContainer.js","names":["PropTypes","React","useData","InfoBox","InfoBoxContainer","id","schema","infoBox","data","Object","keys","length","items","values","flatMap","item","createElement","infoBoxKey","key","propTypes","string","isRequired","object"],"sources":["../../../../src/components/InfoBoxes/container/InfoBoxContainer.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport useData from '../hooks/useData';\nimport InfoBox from '../presentational/InfoBox';\n\nconst InfoBoxContainer = ({ id, schema, infoBox }) => {\n const { data } = useData({ id, schema, infoBox });\n\n if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;\n\n const items = Object.values(data).flatMap(item => Object.values(item));\n\n return <InfoBox items={items} infoBoxKey={infoBox.key} />;\n};\n\nexport default InfoBoxContainer;\n\nInfoBoxContainer.propTypes = {\n id: PropTypes.string.isRequired,\n infoBox: PropTypes.object.isRequired,\n schema: PropTypes.object.isRequired\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,OAAO,MAAM,kBAAkB;AACtC,OAAOC,OAAO,MAAM,2BAA2B;AAE/C,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAQ,CAAC,KAAK;EACpD,MAAM;IAAEC;EAAK,CAAC,GAAGN,OAAO,CAAC;IAAEG,EAAE;IAAEC,MAAM;IAAEC;EAAQ,CAAC,CAAC;EAEjD,IAAI,CAACC,IAAI,IAAI,CAACC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,CAACG,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAE9E,MAAMC,KAAK,GAAGH,MAAM,CAACI,MAAM,CAACL,IAAI,CAAC,CAACM,OAAO,CAACC,IAAI,IAAIN,MAAM,CAACI,MAAM,CAACE,IAAI,CAAC,CAAC;EAEtE,oBAAOd,KAAA,CAAAe,aAAA,CAACb,OAAO;IAACS,KAAK,EAAEA,KAAM;IAACK,UAAU,EAAEV,OAAO,CAACW;EAAI,CAAE,CAAC;AAC3D,CAAC;AAED,eAAed,gBAAgB;AAE/BA,gBAAgB,CAACe,SAAS,GAAG;EAC3Bd,EAAE,EAAEL,SAAS,CAACoB,MAAM,CAACC,UAAU;EAC/Bd,OAAO,EAAEP,SAAS,CAACsB,MAAM,CAACD,UAAU;EACpCf,MAAM,EAAEN,SAAS,CAACsB,MAAM,CAACD;AAC3B,CAAC"}
@@ -1,25 +0,0 @@
1
- import { gql } from '@apollo/client';
2
- import { BlazeError } from '@blaze-cms/core-errors';
3
- export default function buildDynamicQuery({
4
- id,
5
- schema,
6
- infoBox
7
- }) {
8
- if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
9
- throw new BlazeError('DataEntity query requires get action, properties and fields from entity schema');
10
- }
11
- const fields = `${infoBox.property} {
12
- label
13
- value
14
- }`;
15
- return {
16
- query: gql`query getInfoBoxData($id: String!){
17
- ${schema.actions.get}( id: $id ) {
18
- id
19
- ${fields}
20
- __typename
21
- }
22
- }`
23
- };
24
- }
25
- //# sourceMappingURL=build-dynamic-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-dynamic-query.js","names":["gql","BlazeError","buildDynamicQuery","id","schema","infoBox","actions","get","properties","fields","property","query"],"sources":["../../../../src/components/InfoBoxes/helpers/build-dynamic-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nexport default function buildDynamicQuery({ id, schema, infoBox }) {\n if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {\n throw new BlazeError(\n 'DataEntity query requires get action, properties and fields from entity schema'\n );\n }\n\n const fields = `${infoBox.property} {\n label\n value\n }`;\n\n return {\n query: gql`query getInfoBoxData($id: String!){\n ${schema.actions.get}( id: $id ) {\n id\n ${fields}\n __typename\n }\n }`\n };\n}\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,eAAe,SAASC,iBAAiBA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAQ,CAAC,EAAE;EACjE,IAAI,CAACD,MAAM,IAAI,CAACA,MAAM,CAACE,OAAO,IAAI,CAACF,MAAM,CAACE,OAAO,CAACC,GAAG,IAAI,CAACH,MAAM,CAACI,UAAU,EAAE;IAC3E,MAAM,IAAIP,UAAU,CAClB,gFACF,CAAC;EACH;EAEA,MAAMQ,MAAM,GAAI,GAAEJ,OAAO,CAACK,QAAS;AACrC;AACA;AACA,MAAM;EAEJ,OAAO;IACLC,KAAK,EAAEX,GAAI;AACf,MAAMI,MAAM,CAACE,OAAO,CAACC,GAAI;AACzB;AACA,OAAOE,MAAO;AACd;AACA;AACA;EACE,CAAC;AACH"}
@@ -1,37 +0,0 @@
1
- import { useQuery, gql } from '@apollo/client';
2
- import useInfoBoxData from './useInfoBox';
3
- function useData({
4
- id,
5
- schema,
6
- infoBox
7
- }) {
8
- const {
9
- query
10
- } = useInfoBoxData({
11
- id,
12
- schema,
13
- infoBox
14
- });
15
- const infoBoxQuery = query || gql`
16
- query {
17
- __typename
18
- }
19
- `;
20
- const {
21
- data = {},
22
- loading,
23
- error
24
- } = useQuery(infoBoxQuery, {
25
- variables: {
26
- id
27
- },
28
- skip: !query
29
- });
30
- return {
31
- data: data.__typename !== 'Query' ? data : null,
32
- loading,
33
- error
34
- };
35
- }
36
- export default useData;
37
- //# sourceMappingURL=useData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useData.js","names":["useQuery","gql","useInfoBoxData","useData","id","schema","infoBox","query","infoBoxQuery","data","loading","error","variables","skip","__typename"],"sources":["../../../../src/components/InfoBoxes/hooks/useData.js"],"sourcesContent":["import { useQuery, gql } from '@apollo/client';\nimport useInfoBoxData from './useInfoBox';\n\nfunction useData({ id, schema, infoBox }) {\n const { query } = useInfoBoxData({ id, schema, infoBox });\n\n const infoBoxQuery =\n query ||\n gql`\n query {\n __typename\n }\n `;\n\n const { data = {}, loading, error } = useQuery(infoBoxQuery, { variables: { id }, skip: !query });\n\n return { data: data.__typename !== 'Query' ? data : null, loading, error };\n}\n\nexport default useData;\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,GAAG,QAAQ,gBAAgB;AAC9C,OAAOC,cAAc,MAAM,cAAc;AAEzC,SAASC,OAAOA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAQ,CAAC,EAAE;EACxC,MAAM;IAAEC;EAAM,CAAC,GAAGL,cAAc,CAAC;IAAEE,EAAE;IAAEC,MAAM;IAAEC;EAAQ,CAAC,CAAC;EAEzD,MAAME,YAAY,GAChBD,KAAK,IACLN,GAAI;AACR;AACA;AACA;AACA,KAAK;EAEH,MAAM;IAAEQ,IAAI,GAAG,CAAC,CAAC;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGX,QAAQ,CAACQ,YAAY,EAAE;IAAEI,SAAS,EAAE;MAAER;IAAG,CAAC;IAAES,IAAI,EAAE,CAACN;EAAM,CAAC,CAAC;EAEjG,OAAO;IAAEE,IAAI,EAAEA,IAAI,CAACK,UAAU,KAAK,OAAO,GAAGL,IAAI,GAAG,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC;AAC5E;AAEA,eAAeR,OAAO"}
@@ -1,19 +0,0 @@
1
- import buildDynamicQuery from '../helpers/build-dynamic-query';
2
- function useInfoBox({
3
- id,
4
- schema,
5
- infoBox
6
- }) {
7
- const {
8
- query
9
- } = buildDynamicQuery({
10
- id,
11
- schema,
12
- infoBox
13
- });
14
- return {
15
- query: query || null
16
- };
17
- }
18
- export default useInfoBox;
19
- //# sourceMappingURL=useInfoBox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useInfoBox.js","names":["buildDynamicQuery","useInfoBox","id","schema","infoBox","query"],"sources":["../../../../src/components/InfoBoxes/hooks/useInfoBox.js"],"sourcesContent":["import buildDynamicQuery from '../helpers/build-dynamic-query';\n\nfunction useInfoBox({ id, schema, infoBox }) {\n const { query } = buildDynamicQuery({\n id,\n schema,\n infoBox\n });\n\n return { query: query || null };\n}\n\nexport default useInfoBox;\n"],"mappings":"AAAA,OAAOA,iBAAiB,MAAM,gCAAgC;AAE9D,SAASC,UAAUA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAQ,CAAC,EAAE;EAC3C,MAAM;IAAEC;EAAM,CAAC,GAAGL,iBAAiB,CAAC;IAClCE,EAAE;IACFC,MAAM;IACNC;EACF,CAAC,CAAC;EAEF,OAAO;IAAEC,KAAK,EAAEA,KAAK,IAAI;EAAK,CAAC;AACjC;AAEA,eAAeJ,UAAU"}
@@ -1,3 +0,0 @@
1
- import InfoBoxes from './InfoBoxes';
2
- export default InfoBoxes;
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["InfoBoxes"],"sources":["../../../src/components/InfoBoxes/index.js"],"sourcesContent":["import InfoBoxes from './InfoBoxes';\n\nexport default InfoBoxes;\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,aAAa;AAEnC,eAAeA,SAAS"}
@@ -1,31 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- const InfoBox = ({
4
- items,
5
- infoBoxKey
6
- }) => {
7
- if (!items) return null;
8
- const infoBoxItems = items.map(item => Object.values(item).map(info => {
9
- if (!info.label || !info.value) return null;
10
- return /*#__PURE__*/React.createElement("div", {
11
- className: "info-box--item",
12
- key: `${infoBoxKey}-${info.label.toLowerCase()}`
13
- }, /*#__PURE__*/React.createElement("div", {
14
- className: "info-box--label"
15
- }, info.label, ": "), /*#__PURE__*/React.createElement("div", {
16
- className: "info-box--value"
17
- }, info.value));
18
- }).filter(Boolean));
19
- return /*#__PURE__*/React.createElement("div", {
20
- className: "info-box",
21
- key: infoBoxKey
22
- }, /*#__PURE__*/React.createElement("div", {
23
- className: "info-box--container"
24
- }, infoBoxItems));
25
- };
26
- export default InfoBox;
27
- InfoBox.propTypes = {
28
- infoBoxKey: PropTypes.string.isRequired,
29
- items: PropTypes.array.isRequired
30
- };
31
- //# sourceMappingURL=InfoBox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InfoBox.js","names":["PropTypes","React","InfoBox","items","infoBoxKey","infoBoxItems","map","item","Object","values","info","label","value","createElement","className","key","toLowerCase","filter","Boolean","propTypes","string","isRequired","array"],"sources":["../../../../src/components/InfoBoxes/presentational/InfoBox.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nconst InfoBox = ({ items, infoBoxKey }) => {\n if (!items) return null;\n\n const infoBoxItems = items.map(item =>\n Object.values(item)\n .map(info => {\n if (!info.label || !info.value) return null;\n\n return (\n <div className=\"info-box--item\" key={`${infoBoxKey}-${info.label.toLowerCase()}`}>\n <div className=\"info-box--label\">{info.label}: </div>\n <div className=\"info-box--value\">{info.value}</div>\n </div>\n );\n })\n .filter(Boolean)\n );\n\n return (\n <div className=\"info-box\" key={infoBoxKey}>\n <div className=\"info-box--container\">{infoBoxItems}</div>\n </div>\n );\n};\n\nexport default InfoBox;\n\nInfoBox.propTypes = {\n infoBoxKey: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;AAEzB,MAAMC,OAAO,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAW,CAAC,KAAK;EACzC,IAAI,CAACD,KAAK,EAAE,OAAO,IAAI;EAEvB,MAAME,YAAY,GAAGF,KAAK,CAACG,GAAG,CAACC,IAAI,IACjCC,MAAM,CAACC,MAAM,CAACF,IAAI,CAAC,CAChBD,GAAG,CAACI,IAAI,IAAI;IACX,IAAI,CAACA,IAAI,CAACC,KAAK,IAAI,CAACD,IAAI,CAACE,KAAK,EAAE,OAAO,IAAI;IAE3C,oBACEX,KAAA,CAAAY,aAAA;MAAKC,SAAS,EAAC,gBAAgB;MAACC,GAAG,EAAG,GAAEX,UAAW,IAAGM,IAAI,CAACC,KAAK,CAACK,WAAW,CAAC,CAAE;IAAE,gBAC/Ef,KAAA,CAAAY,aAAA;MAAKC,SAAS,EAAC;IAAiB,GAAEJ,IAAI,CAACC,KAAK,EAAC,IAAO,CAAC,eACrDV,KAAA,CAAAY,aAAA;MAAKC,SAAS,EAAC;IAAiB,GAAEJ,IAAI,CAACE,KAAW,CAC/C,CAAC;EAEV,CAAC,CAAC,CACDK,MAAM,CAACC,OAAO,CACnB,CAAC;EAED,oBACEjB,KAAA,CAAAY,aAAA;IAAKC,SAAS,EAAC,UAAU;IAACC,GAAG,EAAEX;EAAW,gBACxCH,KAAA,CAAAY,aAAA;IAAKC,SAAS,EAAC;EAAqB,GAAET,YAAkB,CACrD,CAAC;AAEV,CAAC;AAED,eAAeH,OAAO;AAEtBA,OAAO,CAACiB,SAAS,GAAG;EAClBf,UAAU,EAAEJ,SAAS,CAACoB,MAAM,CAACC,UAAU;EACvClB,KAAK,EAAEH,SAAS,CAACsB,KAAK,CAACD;AACzB,CAAC"}
@@ -1,26 +0,0 @@
1
- import { Link } from 'react-router-dom';
2
- import React from 'react';
3
-
4
- const EntityNavLinks = ({ schema }) => {
5
- if (!schema) return null;
6
-
7
- const {
8
- displayProperties: { adminSectionNavigation }
9
- } = schema;
10
-
11
- if (!adminSectionNavigation) return null;
12
-
13
- const links = Object.entries(adminSectionNavigation).map(([k, v]) => {
14
- const { label, uri } = v;
15
- const Wrapper = uri.startsWith('#') ? 'a' : Link;
16
- return (
17
- <Wrapper className="entity-section-link" href={uri} to={uri}>
18
- {label}
19
- </Wrapper>
20
- );
21
- });
22
-
23
- return <div className="entity-section-links">{links}</div>;
24
- };
25
-
26
- export default EntityNavLinks;
@@ -1,3 +0,0 @@
1
- import EntityNavLinks from './EntityNavLinks';
2
-
3
- export default EntityNavLinks;
@@ -1,22 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import useCustomSidebarData from '../hooks/useCustomSidebarData';
4
- import CustomSidebarInfo from '../presentational/CustomSidebarInfo';
5
-
6
- const CustomSibebarInfoContainer = ({ id, schema, displayProperties }) => {
7
- const { data } = useCustomSidebarData({ id, schema, displayProperties });
8
-
9
- if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;
10
-
11
- const items = Object.values(data).flatMap(item => Object.values(item));
12
-
13
- return <CustomSidebarInfo items={items} customSidebarInfoKey={displayProperties.key} />;
14
- };
15
-
16
- export default CustomSibebarInfoContainer;
17
-
18
- CustomSibebarInfoContainer.propTypes = {
19
- id: PropTypes.string.isRequired,
20
- displayProperties: PropTypes.object.isRequired,
21
- schema: PropTypes.object.isRequired
22
- };
@@ -1,33 +0,0 @@
1
- import { gql } from '@apollo/client';
2
- import { BlazeError } from '@blaze-cms/core-errors';
3
-
4
- export default function buildDynamicQuery({ id, schema, displayProperties }) {
5
- if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
6
- throw new BlazeError(
7
- 'DataEntity query requires get action, properties and fields from entity schema'
8
- );
9
- }
10
-
11
- if (
12
- displayProperties.adminMainInfoProperty &&
13
- Array.isArray(displayProperties.adminMainInfoProperty)
14
- ) {
15
- const fields = displayProperties.adminMainInfoProperty.map(
16
- infoProperty =>
17
- `${infoProperty} {
18
- label
19
- value
20
- }`
21
- );
22
-
23
- return gql`query getInfoBoxData($id: String!){
24
- ${schema.actions.get}( id: $id ) {
25
- id
26
- ${fields.map(field => field)}
27
- __typename
28
- }
29
- }`;
30
- }
31
-
32
- return null;
33
- }
@@ -1,28 +0,0 @@
1
- import ProptTypes from 'prop-types';
2
- import { useQuery, gql } from '@apollo/client';
3
- import buildDynamicQuery from '../helpers/build-dynamic-query';
4
-
5
- const useCustomSidebarData = ({ id, schema, displayProperties }) => {
6
- const query = buildDynamicQuery({ id, schema, displayProperties });
7
-
8
- const customSidebarInfoQuery =
9
- query ||
10
- gql`
11
- query {
12
- __typename
13
- }
14
- `;
15
-
16
- const { data = {}, loading, error } = useQuery(customSidebarInfoQuery, {
17
- variables: { id },
18
- skip: !query
19
- });
20
-
21
- return { data: data.__typename !== 'Query' ? data : null, loading, error };
22
- };
23
-
24
- export default useCustomSidebarData;
25
-
26
- useCustomSidebarData.propTypes = {
27
- displayProperties: ProptTypes.object.isRequired
28
- };
@@ -1,33 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
-
4
- const CustomSidebarInfo = ({ items, customSidebarInfoKey }) => {
5
- if (!items) return null;
6
-
7
- const customSidebarInfoItems = items.map(item =>
8
- Object.values(item)
9
- .map(info => {
10
- if (!info.label || !info.value) return null;
11
-
12
- return (
13
- <p>
14
- {info.label}: <span>{info.value}</span>
15
- </p>
16
- );
17
- })
18
- .filter(Boolean)
19
- );
20
-
21
- return (
22
- <div className="custom-sidebar-info" key={customSidebarInfoKey}>
23
- <div className="custom-sidebar-info--container">{customSidebarInfoItems}</div>
24
- </div>
25
- );
26
- };
27
-
28
- export default CustomSidebarInfo;
29
-
30
- CustomSidebarInfo.propTypes = {
31
- customSidebarInfoKey: PropTypes.string.isRequired,
32
- items: PropTypes.array.isRequired
33
- };