@blaze-cms/plugin-data-ui 0.127.0-project-admin-customisations.3 → 0.127.3

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 (120) hide show
  1. package/CHANGELOG.md +2 -34
  2. package/README.md +0 -2
  3. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  4. package/lib/components/EntityDataListing/index.js.map +1 -1
  5. package/lib/components/EntityManager/Entity/Entity.js +19 -29
  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.map +1 -1
  9. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  10. package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  11. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +6 -12
  12. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  13. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  14. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  15. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  16. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  17. package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  18. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  19. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  20. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  21. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  22. package/lib/components/EntityManager/Entity/index.js.map +1 -1
  23. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  24. package/lib/components/EntityManager/index.js.map +1 -1
  25. package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
  26. package/lib/components/EntityManager/utils/entity.js.map +1 -1
  27. package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  28. package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
  29. package/lib/components/EntityManager/utils/query.js.map +1 -1
  30. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  31. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  32. package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
  33. package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
  34. package/lib/components/ListingTable/TableActions/index.js.map +1 -1
  35. package/lib/components/ListingTable/index.js.map +1 -1
  36. package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
  37. package/lib/components/ListingTable/service/index.js.map +1 -1
  38. package/lib/components/Tabs/index.js.map +1 -1
  39. package/lib/constants.js.map +1 -1
  40. package/lib/index.js.map +1 -1
  41. package/lib/utils/add-content-menu-items.js.map +1 -1
  42. package/lib/utils/build-create-entity-mutation.js.map +1 -1
  43. package/lib/utils/build-delete-entity-mutation.js.map +1 -1
  44. package/lib/utils/build-listing-query.js.map +1 -1
  45. package/lib/utils/build-update-data-query.js.map +1 -1
  46. package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  47. package/lib/utils/get-default-query-params.js.map +1 -1
  48. package/lib/utils/hoc/withContext.js.map +1 -1
  49. package/lib/utils/hooks/useToggle.js.map +1 -1
  50. package/lib/utils/index.js.map +1 -1
  51. package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
  52. package/lib-es/components/EntityManager/Entity/Entity.js +18 -29
  53. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  54. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  55. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  56. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +7 -13
  57. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  58. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  59. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  60. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  61. package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  62. package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
  63. package/lib-es/components/EntityManager/utils/data-mappers.js.map +1 -1
  64. package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
  65. package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  66. package/lib-es/components/EntityManager/utils/query.js.map +1 -1
  67. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  68. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  69. package/lib-es/components/ListingTable/TableActions/TableActions.js.map +1 -1
  70. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
  71. package/lib-es/components/ListingTable/service/index.js.map +1 -1
  72. package/lib-es/components/Tabs/index.js.map +1 -1
  73. package/lib-es/index.js.map +1 -1
  74. package/lib-es/utils/add-content-menu-items.js.map +1 -1
  75. package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
  76. package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
  77. package/lib-es/utils/build-listing-query.js.map +1 -1
  78. package/lib-es/utils/build-update-data-query.js.map +1 -1
  79. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  80. package/lib-es/utils/get-default-query-params.js.map +1 -1
  81. package/lib-es/utils/hoc/withContext.js.map +1 -1
  82. package/lib-es/utils/hooks/useToggle.js.map +1 -1
  83. package/package.json +9 -10
  84. package/src/components/EntityManager/Entity/Entity.js +59 -65
  85. package/src/components/EntityManager/Entity/SideBarRelations/index.js +9 -23
  86. package/lib/components/InfoBoxes/InfoBoxes.js +0 -36
  87. package/lib/components/InfoBoxes/InfoBoxes.js.map +0 -1
  88. package/lib/components/InfoBoxes/container/InfoBoxContainer.js +0 -44
  89. package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +0 -1
  90. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +0 -25
  91. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +0 -1
  92. package/lib/components/InfoBoxes/hooks/useData.js +0 -42
  93. package/lib/components/InfoBoxes/hooks/useData.js.map +0 -1
  94. package/lib/components/InfoBoxes/hooks/useInfoBox.js +0 -26
  95. package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +0 -1
  96. package/lib/components/InfoBoxes/index.js +0 -12
  97. package/lib/components/InfoBoxes/index.js.map +0 -1
  98. package/lib/components/InfoBoxes/presentational/InfoBox.js +0 -46
  99. package/lib/components/InfoBoxes/presentational/InfoBox.js.map +0 -1
  100. package/lib-es/components/InfoBoxes/InfoBoxes.js +0 -28
  101. package/lib-es/components/InfoBoxes/InfoBoxes.js.map +0 -1
  102. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js +0 -30
  103. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +0 -1
  104. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +0 -25
  105. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +0 -1
  106. package/lib-es/components/InfoBoxes/hooks/useData.js +0 -37
  107. package/lib-es/components/InfoBoxes/hooks/useData.js.map +0 -1
  108. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js +0 -19
  109. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +0 -1
  110. package/lib-es/components/InfoBoxes/index.js +0 -3
  111. package/lib-es/components/InfoBoxes/index.js.map +0 -1
  112. package/lib-es/components/InfoBoxes/presentational/InfoBox.js +0 -31
  113. package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +0 -1
  114. package/src/components/InfoBoxes/InfoBoxes.js +0 -24
  115. package/src/components/InfoBoxes/container/InfoBoxContainer.js +0 -22
  116. package/src/components/InfoBoxes/helpers/build-dynamic-query.js +0 -25
  117. package/src/components/InfoBoxes/hooks/useData.js +0 -20
  118. package/src/components/InfoBoxes/hooks/useInfoBox.js +0 -13
  119. package/src/components/InfoBoxes/index.js +0 -3
  120. package/src/components/InfoBoxes/presentational/InfoBox.js +0 -34
@@ -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,UAAU,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","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,GAAG,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,oBACE;MAAK,SAAS,EAAC,gBAAgB;MAAC,GAAG,EAAG,GAAER,UAAW,IAAGM,IAAI,CAACC,KAAK,CAACE,WAAW,EAAG;IAAE,gBAC/E;MAAK,SAAS,EAAC;IAAiB,GAAEH,IAAI,CAACC,KAAK,EAAC,IAAE,CAAM,eACrD;MAAK,SAAS,EAAC;IAAiB,GAAED,IAAI,CAACE,KAAK,CAAO,CAC/C;EAEV,CAAC,CAAC,CACDE,MAAM,CAACC,OAAO,CAAC,CACnB;EAED,oBACE;IAAK,SAAS,EAAC,UAAU;IAAC,GAAG,EAAEX;EAAW,gBACxC;IAAK,SAAS,EAAC;EAAqB,GAAEC,YAAY,CAAO,CACrD;AAEV,CAAC;AAED,eAAeH,OAAO;AAEtBA,OAAO,CAACc,SAAS,GAAG;EAClBZ,UAAU,EAAEJ,SAAS,CAACiB,MAAM,CAACC,UAAU;EACvCf,KAAK,EAAEH,SAAS,CAACmB,KAAK,CAACD;AACzB,CAAC"}
@@ -1,24 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import InfoBoxContainer from './container/InfoBoxContainer';
4
-
5
- const InfoBoxes = ({ id, schema }) => {
6
- const {
7
- displayProperties: { adminInfoBoxes = [] }
8
- } = schema;
9
-
10
- if (adminInfoBoxes.length <= 0) {
11
- return null;
12
- }
13
-
14
- return adminInfoBoxes.map(infoBox => (
15
- <InfoBoxContainer id={id} schema={schema} key={infoBox.key} infoBox={infoBox} />
16
- ));
17
- };
18
-
19
- export default InfoBoxes;
20
-
21
- InfoBoxes.propTypes = {
22
- id: PropTypes.string.isRequired,
23
- schema: PropTypes.object.isRequired
24
- };
@@ -1,22 +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
-
6
- const InfoBoxContainer = ({ id, schema, infoBox }) => {
7
- const { data } = useData({ id, schema, infoBox });
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 <InfoBox items={items} infoBoxKey={infoBox.key} />;
14
- };
15
-
16
- export default InfoBoxContainer;
17
-
18
- InfoBoxContainer.propTypes = {
19
- id: PropTypes.string.isRequired,
20
- infoBox: PropTypes.object.isRequired,
21
- schema: PropTypes.object.isRequired
22
- };
@@ -1,25 +0,0 @@
1
- import { gql } from '@apollo/client';
2
- import { BlazeError } from '@blaze-cms/core-errors';
3
-
4
- export default function buildDynamicQuery({ id, schema, infoBox }) {
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
- const fields = `${infoBox.property} {
12
- label
13
- value
14
- }`;
15
-
16
- return {
17
- query: gql`query getInfoBoxData($id: String!){
18
- ${schema.actions.get}( id: $id ) {
19
- id
20
- ${fields}
21
- __typename
22
- }
23
- }`
24
- };
25
- }
@@ -1,20 +0,0 @@
1
- import { useQuery, gql } from '@apollo/client';
2
- import useInfoBoxData from './useInfoBox';
3
-
4
- function useData({ id, schema, infoBox }) {
5
- const { query } = useInfoBoxData({ id, schema, infoBox });
6
-
7
- const infoBoxQuery =
8
- query ||
9
- gql`
10
- query {
11
- __typename
12
- }
13
- `;
14
-
15
- const { data = {}, loading, error } = useQuery(infoBoxQuery, { variables: { id }, skip: !query });
16
-
17
- return { data: data.__typename !== 'Query' ? data : null, loading, error };
18
- }
19
-
20
- export default useData;
@@ -1,13 +0,0 @@
1
- import buildDynamicQuery from '../helpers/build-dynamic-query';
2
-
3
- function useInfoBox({ id, schema, infoBox }) {
4
- const { query } = buildDynamicQuery({
5
- id,
6
- schema,
7
- infoBox
8
- });
9
-
10
- return { query: query || null };
11
- }
12
-
13
- export default useInfoBox;
@@ -1,3 +0,0 @@
1
- import InfoBoxes from './InfoBoxes';
2
-
3
- export default InfoBoxes;
@@ -1,34 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
-
4
- const InfoBox = ({ items, infoBoxKey }) => {
5
- if (!items) return null;
6
-
7
- const infoBoxItems = items.map(item =>
8
- Object.values(item)
9
- .map(info => {
10
- if (!info.label || !info.value) return null;
11
-
12
- return (
13
- <div className="info-box--item" key={`${infoBoxKey}-${info.label.toLowerCase()}`}>
14
- <div className="info-box--label">{info.label}: </div>
15
- <div className="info-box--value">{info.value}</div>
16
- </div>
17
- );
18
- })
19
- .filter(Boolean)
20
- );
21
-
22
- return (
23
- <div className="info-box" key={infoBoxKey}>
24
- <div className="info-box--container">{infoBoxItems}</div>
25
- </div>
26
- );
27
- };
28
-
29
- export default InfoBox;
30
-
31
- InfoBox.propTypes = {
32
- infoBoxKey: PropTypes.string.isRequired,
33
- items: PropTypes.array.isRequired
34
- };