@blaze-cms/plugin-data-ui 0.141.0 → 0.141.1-alpha.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.
- package/CHANGELOG.md +8 -0
- package/README.md +13 -0
- package/lib/components/EntityManager/Entity/Entity.js +3 -2
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +8 -6
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +7 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +9 -5
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useInfoBox.js +6 -7
- package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBox.js +8 -3
- package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +19 -0
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -0
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +37 -0
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -0
- package/lib/components/ListingTable/mappers/populate-rows.js +16 -17
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/Entity.js +3 -2
- package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +7 -6
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +7 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +8 -8
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js +2 -4
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js +8 -3
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js +12 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js +30 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -0
- package/lib-es/components/ListingTable/mappers/populate-rows.js +9 -11
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/package.json +2 -2
- package/src/components/EntityManager/Entity/Entity.js +1 -1
- package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +8 -4
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +13 -11
- package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +6 -1
- package/src/components/InfoBoxes/helpers/build-dynamic-query.js +12 -8
- package/src/components/InfoBoxes/hooks/useInfoBox.js +2 -2
- package/src/components/InfoBoxes/presentational/InfoBox.js +9 -3
- package/src/components/InfoBoxes/presentational/InfoBoxLabel.js +6 -0
- package/src/components/InfoBoxes/presentational/InfoBoxValue.js +29 -0
- package/src/components/ListingTable/mappers/populate-rows.js +9 -9
|
@@ -3,24 +3,24 @@ import { BlazeError } from '@blaze-cms/core-errors';
|
|
|
3
3
|
export default function buildDynamicQuery({
|
|
4
4
|
id,
|
|
5
5
|
schema,
|
|
6
|
-
|
|
6
|
+
properties
|
|
7
7
|
}) {
|
|
8
|
+
if (!id) return null;
|
|
8
9
|
if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
|
|
9
10
|
throw new BlazeError('DataEntity query requires get action, properties and fields from entity schema');
|
|
10
11
|
}
|
|
11
|
-
const fields = `${
|
|
12
|
+
const fields = properties.map(infoProperty => `${infoProperty} {
|
|
12
13
|
label
|
|
13
14
|
value
|
|
14
15
|
showLabel
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
url
|
|
17
|
+
}`);
|
|
18
|
+
return gql`query getInfoBoxData($id: String!){
|
|
18
19
|
${schema.actions.get}( id: $id ) {
|
|
19
20
|
id
|
|
20
|
-
|
|
21
|
+
${fields.map(field => field)}
|
|
21
22
|
__typename
|
|
22
23
|
}
|
|
23
|
-
}
|
|
24
|
-
};
|
|
24
|
+
}`;
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=build-dynamic-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-dynamic-query.js","names":["gql","BlazeError","buildDynamicQuery","id","schema","
|
|
1
|
+
{"version":3,"file":"build-dynamic-query.js","names":["gql","BlazeError","buildDynamicQuery","id","schema","properties","actions","get","fields","map","infoProperty","field"],"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, properties }) {\n if (!id) return null;\n\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 = properties.map(\n infoProperty =>\n `${infoProperty} {\n label\n value\n showLabel\n url\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"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,eAAe,SAASC,iBAAiBA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAW,CAAC,EAAE;EACpE,IAAI,CAACF,EAAE,EAAE,OAAO,IAAI;EAEpB,IAAI,CAACC,MAAM,IAAI,CAACA,MAAM,CAACE,OAAO,IAAI,CAACF,MAAM,CAACE,OAAO,CAACC,GAAG,IAAI,CAACH,MAAM,CAACC,UAAU,EAAE;IAC3E,MAAM,IAAIJ,UAAU,CAClB,gFACF,CAAC;EACH;EAEA,MAAMO,MAAM,GAAGH,UAAU,CAACI,GAAG,CAC3BC,YAAY,IACT,GAAEA,YAAa;AACtB;AACA;AACA;AACA;AACA,MACE,CAAC;EAED,OAAOV,GAAI;AACb,MAAMI,MAAM,CAACE,OAAO,CAACC,GAAI;AACzB;AACA,QAAQC,MAAM,CAACC,GAAG,CAACE,KAAK,IAAIA,KAAK,CAAE;AACnC;AACA;AACA,IAAI;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
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
|
|
1
|
+
{"version":3,"file":"useInfoBox.js","names":["buildDynamicQuery","useInfoBox","id","schema","infoBox","query","properties","property"],"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 properties: [infoBox.property]\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,MAAMC,KAAK,GAAGL,iBAAiB,CAAC;IAC9BE,EAAE;IACFC,MAAM;IACNG,UAAU,EAAE,CAACF,OAAO,CAACG,QAAQ;EAC/B,CAAC,CAAC;EAEF,OAAO;IAAEF,KAAK,EAAEA,KAAK,IAAI;EAAK,CAAC;AACjC;AAEA,eAAeJ,UAAU"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import InfoBoxValue from './InfoBoxValue';
|
|
4
|
+
import InfoBoxLabel from './InfoBoxLabel';
|
|
3
5
|
const InfoBox = ({
|
|
4
6
|
items,
|
|
5
7
|
infoBoxKey
|
|
@@ -7,15 +9,18 @@ const InfoBox = ({
|
|
|
7
9
|
if (!items) return null;
|
|
8
10
|
const infoBoxItems = items.map(item => Object.values(item).map(info => {
|
|
9
11
|
if (!info.label || !info.value) return null;
|
|
10
|
-
const label = info.showLabel === false ? '' : `${info.label}: `;
|
|
11
12
|
return /*#__PURE__*/React.createElement("div", {
|
|
12
13
|
className: "info-box--item",
|
|
13
14
|
key: `${infoBoxKey}-${info.label.toLowerCase()}`
|
|
14
15
|
}, /*#__PURE__*/React.createElement("div", {
|
|
15
16
|
className: "info-box--label"
|
|
16
|
-
},
|
|
17
|
+
}, /*#__PURE__*/React.createElement(InfoBoxLabel, {
|
|
18
|
+
item: info
|
|
19
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
17
20
|
className: "info-box--value"
|
|
18
|
-
},
|
|
21
|
+
}, /*#__PURE__*/React.createElement(InfoBoxValue, {
|
|
22
|
+
item: info
|
|
23
|
+
})));
|
|
19
24
|
}).filter(Boolean));
|
|
20
25
|
return /*#__PURE__*/React.createElement("div", {
|
|
21
26
|
className: "info-box",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoBox.js","names":["PropTypes","React","InfoBox","items","infoBoxKey","infoBoxItems","map","item","Object","values","info","label","value","
|
|
1
|
+
{"version":3,"file":"InfoBox.js","names":["PropTypes","React","InfoBoxValue","InfoBoxLabel","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';\nimport InfoBoxValue from './InfoBoxValue';\nimport InfoBoxLabel from './InfoBoxLabel';\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\">\n <InfoBoxLabel item={info} />\n </div>\n <div className=\"info-box--value\">\n <InfoBoxValue item={info} />\n </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;AACzB,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,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,oBACEb,KAAA,CAAAc,aAAA;MAAKC,SAAS,EAAC,gBAAgB;MAACC,GAAG,EAAG,GAAEX,UAAW,IAAGM,IAAI,CAACC,KAAK,CAACK,WAAW,CAAC,CAAE;IAAE,gBAC/EjB,KAAA,CAAAc,aAAA;MAAKC,SAAS,EAAC;IAAiB,gBAC9Bf,KAAA,CAAAc,aAAA,CAACZ,YAAY;MAACM,IAAI,EAAEG;IAAK,CAAE,CACxB,CAAC,eACNX,KAAA,CAAAc,aAAA;MAAKC,SAAS,EAAC;IAAiB,gBAC9Bf,KAAA,CAAAc,aAAA,CAACb,YAAY;MAACO,IAAI,EAAEG;IAAK,CAAE,CACxB,CACF,CAAC;EAEV,CAAC,CAAC,CACDO,MAAM,CAACC,OAAO,CACnB,CAAC;EAED,oBACEnB,KAAA,CAAAc,aAAA;IAAKC,SAAS,EAAC,UAAU;IAACC,GAAG,EAAEX;EAAW,gBACxCL,KAAA,CAAAc,aAAA;IAAKC,SAAS,EAAC;EAAqB,GAAET,YAAkB,CACrD,CAAC;AAEV,CAAC;AAED,eAAeH,OAAO;AAEtBA,OAAO,CAACiB,SAAS,GAAG;EAClBf,UAAU,EAAEN,SAAS,CAACsB,MAAM,CAACC,UAAU;EACvClB,KAAK,EAAEL,SAAS,CAACwB,KAAK,CAACD;AACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBoxLabel.js","names":["InfoBoxLabel","item","suffix","label","showLabel"],"sources":["../../../../src/components/InfoBoxes/presentational/InfoBoxLabel.js"],"sourcesContent":["const InfoBoxLabel = ({ item, suffix = ' ' }) => {\n const { label, showLabel = true } = item;\n return showLabel ? `${label}:${suffix}` : null;\n};\n\nexport default InfoBoxLabel;\n"],"mappings":"AAAA,MAAMA,YAAY,GAAGA,CAAC;EAAEC,IAAI;EAAEC,MAAM,GAAG;AAAI,CAAC,KAAK;EAC/C,MAAM;IAAEC,KAAK;IAAEC,SAAS,GAAG;EAAK,CAAC,GAAGH,IAAI;EACxC,OAAOG,SAAS,GAAI,GAAED,KAAM,IAAGD,MAAO,EAAC,GAAG,IAAI;AAChD,CAAC;AAED,eAAeF,YAAY"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Link } from 'react-router-dom';
|
|
4
|
+
const InfoBoxValue = ({
|
|
5
|
+
item = {}
|
|
6
|
+
}) => {
|
|
7
|
+
const {
|
|
8
|
+
url,
|
|
9
|
+
value
|
|
10
|
+
} = item;
|
|
11
|
+
if (url) {
|
|
12
|
+
if (url.startsWith('http')) {
|
|
13
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
14
|
+
href: url,
|
|
15
|
+
target: "_blank",
|
|
16
|
+
rel: "noopener noreferrer"
|
|
17
|
+
}, value);
|
|
18
|
+
}
|
|
19
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
20
|
+
to: url,
|
|
21
|
+
target: "_blank"
|
|
22
|
+
}, value);
|
|
23
|
+
}
|
|
24
|
+
return value;
|
|
25
|
+
};
|
|
26
|
+
InfoBoxValue.propTypes = {
|
|
27
|
+
item: PropTypes.object.isRequired
|
|
28
|
+
};
|
|
29
|
+
export default InfoBoxValue;
|
|
30
|
+
//# sourceMappingURL=InfoBoxValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBoxValue.js","names":["PropTypes","React","Link","InfoBoxValue","item","url","value","startsWith","createElement","href","target","rel","to","propTypes","object","isRequired"],"sources":["../../../../src/components/InfoBoxes/presentational/InfoBoxValue.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport { Link } from 'react-router-dom';\n\nconst InfoBoxValue = ({ item = {} }) => {\n const { url, value } = item;\n if (url) {\n if (url.startsWith('http')) {\n return (\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n {value}\n </a>\n );\n }\n return (\n <Link to={url} target=\"_blank\">\n {value}\n </Link>\n );\n }\n\n return value;\n};\n\nInfoBoxValue.propTypes = {\n item: PropTypes.object.isRequired\n};\n\nexport default InfoBoxValue;\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,kBAAkB;AAEvC,MAAMC,YAAY,GAAGA,CAAC;EAAEC,IAAI,GAAG,CAAC;AAAE,CAAC,KAAK;EACtC,MAAM;IAAEC,GAAG;IAAEC;EAAM,CAAC,GAAGF,IAAI;EAC3B,IAAIC,GAAG,EAAE;IACP,IAAIA,GAAG,CAACE,UAAU,CAAC,MAAM,CAAC,EAAE;MAC1B,oBACEN,KAAA,CAAAO,aAAA;QAAGC,IAAI,EAAEJ,GAAI;QAACK,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAqB,GACpDL,KACA,CAAC;IAER;IACA,oBACEL,KAAA,CAAAO,aAAA,CAACN,IAAI;MAACU,EAAE,EAAEP,GAAI;MAACK,MAAM,EAAC;IAAQ,GAC3BJ,KACG,CAAC;EAEX;EAEA,OAAOA,KAAK;AACd,CAAC;AAEDH,YAAY,CAACU,SAAS,GAAG;EACvBT,IAAI,EAAEJ,SAAS,CAACc,MAAM,CAACC;AACzB,CAAC;AAED,eAAeZ,YAAY"}
|
|
@@ -5,6 +5,8 @@ import React from 'react';
|
|
|
5
5
|
import { Link } from 'react-router-dom';
|
|
6
6
|
import TableActions from '../TableActions';
|
|
7
7
|
import { ACTIONS } from '../../../constants';
|
|
8
|
+
import InfoBoxValue from '../../InfoBoxes/presentational/InfoBoxValue';
|
|
9
|
+
import InfoBoxLabel from '../../InfoBoxes/presentational/InfoBoxLabel';
|
|
8
10
|
const formatRows = ({
|
|
9
11
|
rows,
|
|
10
12
|
url,
|
|
@@ -40,21 +42,17 @@ const buildArrayRowContent = rowData => /*#__PURE__*/React.createElement("div",
|
|
|
40
42
|
if (!rowGroup.length) return null;
|
|
41
43
|
return /*#__PURE__*/React.createElement("div", {
|
|
42
44
|
className: "table-row-list__group"
|
|
43
|
-
}, rowGroup.map(({
|
|
44
|
-
label,
|
|
45
|
-
value,
|
|
46
|
-
url
|
|
47
|
-
}) => /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
}, rowGroup.map(item => /*#__PURE__*/React.createElement("div", {
|
|
48
46
|
className: "table-row-list__group__item"
|
|
49
47
|
}, /*#__PURE__*/React.createElement("span", {
|
|
50
48
|
className: "table-row-list__group__item__label"
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
}, /*#__PURE__*/React.createElement(InfoBoxLabel, {
|
|
50
|
+
item: item
|
|
51
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
54
52
|
className: "table-row-list__group__item__value"
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
}
|
|
53
|
+
}, /*#__PURE__*/React.createElement(InfoBoxValue, {
|
|
54
|
+
item: item
|
|
55
|
+
})))));
|
|
58
56
|
}));
|
|
59
57
|
const buildArrayRowData = rowData => {
|
|
60
58
|
const dataGroups = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"populate-rows.js","names":["React","Link","TableActions","ACTIONS","formatRows","rows","url","toggleModal","label","firstColumn","isEnquiry","map","data","editUrl","id","rowProps","_objectSpread","createElement","to","role","actions","showDeleteModal","getSanitizedColumnLabel","columnProp","sanitizedChar","index","length","toUpperCase","toLowerCase","buildArrayRowContent","rowData","className","rowGroup","
|
|
1
|
+
{"version":3,"file":"populate-rows.js","names":["React","Link","TableActions","ACTIONS","InfoBoxValue","InfoBoxLabel","formatRows","rows","url","toggleModal","label","firstColumn","isEnquiry","map","data","editUrl","id","rowProps","_objectSpread","createElement","to","role","actions","showDeleteModal","getSanitizedColumnLabel","columnProp","sanitizedChar","index","length","toUpperCase","toLowerCase","buildArrayRowContent","rowData","className","rowGroup","item","buildArrayRowData","dataGroups","groups","Math","ceil","currentStart","slice","getParsedRowData","Object","keys","reduce","acc","key","parsedData","Array","isArray","getColumnsAndLabels","listingProperties","allProperties","columns","labels","forEach","listingProperty","propKey","includes","split","push","parsedRowData","populateRows","entitySchema","schemaId","properties","dynamicProperties","formProperties","columnOptions","identification","sort","orderBy"],"sources":["../../../../src/components/ListingTable/mappers/populate-rows.js"],"sourcesContent":["import React from 'react';\nimport { Link } from 'react-router-dom';\nimport TableActions from '../TableActions';\nimport { ACTIONS } from '../../../constants';\nimport InfoBoxValue from '../../InfoBoxes/presentational/InfoBoxValue';\nimport InfoBoxLabel from '../../InfoBoxes/presentational/InfoBoxLabel';\n\nconst formatRows = ({ rows, url, toggleModal, label, firstColumn = 'name', isEnquiry }) =>\n rows.map(data => {\n const editUrl = `${url}/update/${data.id}`;\n const rowProps = {\n ...data,\n [firstColumn]: (\n <Link to={editUrl} role=\"button\">\n {data[firstColumn]}\n </Link>\n )\n };\n if (!isEnquiry)\n rowProps.actions = (\n <TableActions editUrl={editUrl} data={data} showDeleteModal={toggleModal} />\n );\n return rowProps;\n });\n\nconst getSanitizedColumnLabel = columnProp => {\n let sanitizedChar = '';\n\n for (let index = 0; index < columnProp.length; index += 1) {\n if (index && columnProp[index] === columnProp[index].toUpperCase())\n sanitizedChar = `${sanitizedChar} ${columnProp[index].toLowerCase()}`;\n else sanitizedChar += columnProp[index];\n }\n return sanitizedChar;\n};\n\nconst buildArrayRowContent = rowData => (\n <div className=\"table-row-list\">\n {rowData.map(rowGroup => {\n if (!rowGroup.length) return null;\n return (\n <div className=\"table-row-list__group\">\n {rowGroup.map(item => (\n <div className=\"table-row-list__group__item\">\n <span className=\"table-row-list__group__item__label\">\n <InfoBoxLabel item={item} />\n </span>\n <span className=\"table-row-list__group__item__value\">\n <InfoBoxValue item={item} />\n </span>\n </div>\n ))}\n </div>\n );\n })}\n </div>\n);\n\nconst buildArrayRowData = rowData => {\n const dataGroups = [];\n const groups = Math.ceil(rowData.length / 3) || 1;\n for (let index = 0; index < groups; index += 1) {\n const currentStart = index * groups;\n dataGroups[index] = rowData.slice(currentStart, currentStart + 3);\n }\n\n return buildArrayRowContent(dataGroups);\n};\n\nconst getParsedRowData = rows =>\n rows.map(rowData =>\n Object.keys(rowData).reduce((acc, key) => {\n const parsedData = Array.isArray(rowData[key])\n ? buildArrayRowData(rowData[key])\n : rowData[key];\n return { ...acc, [key]: parsedData };\n }, {})\n );\n\nconst getColumnsAndLabels = (listingProperties, allProperties, rows) => {\n const columns = [];\n const labels = {};\n\n listingProperties.forEach(listingProperty => {\n const propKey = listingProperty.includes(' ') ? listingProperty.split(' ')[0] : listingProperty;\n const { label } = allProperties[propKey] || {};\n columns.push(propKey);\n labels[propKey] = label || getSanitizedColumnLabel(propKey);\n });\n const parsedRowData = getParsedRowData(rows);\n\n return { columns, labels, parsedRowData };\n};\n\nconst populateRows = ({ toggleModal, url, entitySchema, rows }) => {\n const {\n id: schemaId,\n listingProperties,\n properties,\n dynamicProperties = {},\n formProperties\n } = entitySchema;\n\n const isEnquiry = schemaId === 'enquiry';\n const columnOptions = !isEnquiry ? [...listingProperties, ACTIONS] : [...listingProperties];\n\n const allProperties = { ...properties, ...dynamicProperties };\n const { columns, labels, parsedRowData } = getColumnsAndLabels(\n columnOptions,\n allProperties,\n rows\n );\n const [firstColumn] = columns;\n\n return {\n identification: 'id',\n sort: null,\n columns,\n labels,\n orderBy: [...formProperties],\n rows: formatRows({ firstColumn, rows: parsedRowData, url, toggleModal, isEnquiry }),\n isEnquiry\n };\n};\n\nexport { populateRows, formatRows, getParsedRowData };\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,kBAAkB;AACvC,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,OAAOC,YAAY,MAAM,6CAA6C;AACtE,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Y;EAEhB,MAAMrD,SAAS,GAAGsD,QAAQ,KAAK,SAAS;EACxC,MAAMI,aAAa,GAAG,CAAC1D,SAAS,GAAG,CAAC,GAAGyC,iBAAiB,EAAElD,OAAO,CAAC,GAAG,CAAC,GAAGkD,iBAAiB,CAAC;EAE3F,MAAMC,aAAa,GAAApC,aAAA,CAAAA,aAAA,KAAQiD,UAAU,GAAKC,iBAAiB,CAAE;EAC7D,MAAM;IAAEb,OAAO;IAAEC,MAAM;IAAEO;EAAc,CAAC,GAAGX,mBAAmB,CAC5DkB,aAAa,EACbhB,aAAa,EACb/C,IACF,CAAC;EACD,MAAM,CAACI,WAAW,CAAC,GAAG4C,OAAO;EAE7B,OAAO;IACLgB,cAAc,EAAE,IAAI;IACpBC,IAAI,EAAE,IAAI;IACVjB,OAAO;IACPC,MAAM;IACNiB,OAAO,EAAE,CAAC,GAAGJ,cAAc,CAAC;IAC5B9D,IAAI,EAAED,UAAU,CAAC;MAAEK,WAAW;MAAEJ,IAAI,EAAEwD,aAAa;MAAEvD,GAAG;MAAEC,WAAW;MAAEG;IAAU,CAAC,CAAC;IACnFA;EACF,CAAC;AACH,CAAC;AAED,SAASoD,YAAY,EAAE1D,UAAU,EAAEqC,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/plugin-data-ui",
|
|
3
|
-
"version": "0.141.0",
|
|
3
|
+
"version": "0.141.1-alpha.0",
|
|
4
4
|
"description": "Blaze plugin data ui",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"lib/*",
|
|
68
68
|
"lib-es/*"
|
|
69
69
|
],
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "40fba7798d3b9c4d0426d23ef85288738ef00afa"
|
|
71
71
|
}
|
|
@@ -423,7 +423,7 @@ const Entity = ({
|
|
|
423
423
|
schema?.interfaces?.includes('page-builder/page-builder');
|
|
424
424
|
|
|
425
425
|
return (
|
|
426
|
-
<RecordEditContextProvider value={{ externalUpdateTime }}>
|
|
426
|
+
<RecordEditContextProvider value={{ externalUpdateTime, updated: formData?.values?.updated }}>
|
|
427
427
|
<div className="page">
|
|
428
428
|
<EntityHeader
|
|
429
429
|
entityData={entityData}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { useContext, useEffect } from 'react';
|
|
2
2
|
import ProptTypes from 'prop-types';
|
|
3
3
|
import { useQuery, gql } from '@apollo/client';
|
|
4
|
-
import buildDynamicQuery from '
|
|
4
|
+
import buildDynamicQuery from '../../../../InfoBoxes/helpers/build-dynamic-query';
|
|
5
5
|
import { RecordEditContext } from '../../../utils/RecordEditContext';
|
|
6
6
|
|
|
7
7
|
const useCustomSidebarData = ({ id, schema, displayProperties }) => {
|
|
8
|
-
const { externalUpdateTime } = useContext(RecordEditContext);
|
|
8
|
+
const { externalUpdateTime, updated } = useContext(RecordEditContext);
|
|
9
9
|
|
|
10
|
-
const query =
|
|
10
|
+
const query =
|
|
11
|
+
displayProperties.adminMainInfoProperty &&
|
|
12
|
+
Array.isArray(displayProperties.adminMainInfoProperty)
|
|
13
|
+
? buildDynamicQuery({ id, schema, properties: displayProperties.adminMainInfoProperty })
|
|
14
|
+
: null;
|
|
11
15
|
|
|
12
16
|
const customSidebarInfoQuery =
|
|
13
17
|
query ||
|
|
@@ -26,7 +30,7 @@ const useCustomSidebarData = ({ id, schema, displayProperties }) => {
|
|
|
26
30
|
() => {
|
|
27
31
|
refetch();
|
|
28
32
|
},
|
|
29
|
-
[externalUpdateTime, refetch]
|
|
33
|
+
[externalUpdateTime, updated, refetch]
|
|
30
34
|
);
|
|
31
35
|
|
|
32
36
|
return { data: data.__typename !== 'Query' ? data : null, loading, error };
|
|
@@ -82,17 +82,19 @@ const SideBarRelations = ({ schema, onChange, formData, entity }) => {
|
|
|
82
82
|
)}
|
|
83
83
|
</div>
|
|
84
84
|
)}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
{!schema.displayProperties.disableDefaultAdminInfo &&
|
|
86
|
+
formattedCreated && (
|
|
87
|
+
<>
|
|
88
|
+
<>
|
|
89
|
+
<p>
|
|
90
|
+
Created: <span>{formattedCreated}</span>
|
|
91
|
+
</p>
|
|
92
|
+
<p>
|
|
93
|
+
Updated: <span>{formattedUpdated}</span>
|
|
94
|
+
</p>
|
|
95
|
+
</>
|
|
96
|
+
</>
|
|
97
|
+
)}
|
|
96
98
|
|
|
97
99
|
<CustomSidebarInfoContainer
|
|
98
100
|
id={itemId}
|
package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import InfoBoxValue from '../../../../InfoBoxes/presentational/InfoBoxValue';
|
|
4
|
+
import InfoBoxLabel from '../../../../InfoBoxes/presentational/InfoBoxLabel';
|
|
3
5
|
|
|
4
6
|
const CustomSidebarInfo = ({ items, customSidebarInfoKey }) => {
|
|
5
7
|
if (!items) return null;
|
|
@@ -11,7 +13,10 @@ const CustomSidebarInfo = ({ items, customSidebarInfoKey }) => {
|
|
|
11
13
|
|
|
12
14
|
return (
|
|
13
15
|
<p>
|
|
14
|
-
{info
|
|
16
|
+
<InfoBoxLabel item={info} />
|
|
17
|
+
<span>
|
|
18
|
+
<InfoBoxValue item={info} />
|
|
19
|
+
</span>
|
|
15
20
|
</p>
|
|
16
21
|
);
|
|
17
22
|
})
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { gql } from '@apollo/client';
|
|
2
2
|
import { BlazeError } from '@blaze-cms/core-errors';
|
|
3
3
|
|
|
4
|
-
export default function buildDynamicQuery({ id, schema,
|
|
4
|
+
export default function buildDynamicQuery({ id, schema, properties }) {
|
|
5
|
+
if (!id) return null;
|
|
6
|
+
|
|
5
7
|
if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
|
|
6
8
|
throw new BlazeError(
|
|
7
9
|
'DataEntity query requires get action, properties and fields from entity schema'
|
|
8
10
|
);
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
const fields =
|
|
13
|
+
const fields = properties.map(
|
|
14
|
+
infoProperty =>
|
|
15
|
+
`${infoProperty} {
|
|
12
16
|
label
|
|
13
17
|
value
|
|
14
18
|
showLabel
|
|
15
|
-
|
|
19
|
+
url
|
|
20
|
+
}`
|
|
21
|
+
);
|
|
16
22
|
|
|
17
|
-
return {
|
|
18
|
-
query: gql`query getInfoBoxData($id: String!){
|
|
23
|
+
return gql`query getInfoBoxData($id: String!){
|
|
19
24
|
${schema.actions.get}( id: $id ) {
|
|
20
25
|
id
|
|
21
|
-
|
|
26
|
+
${fields.map(field => field)}
|
|
22
27
|
__typename
|
|
23
28
|
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
29
|
+
}`;
|
|
26
30
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import buildDynamicQuery from '../helpers/build-dynamic-query';
|
|
2
2
|
|
|
3
3
|
function useInfoBox({ id, schema, infoBox }) {
|
|
4
|
-
const
|
|
4
|
+
const query = buildDynamicQuery({
|
|
5
5
|
id,
|
|
6
6
|
schema,
|
|
7
|
-
infoBox
|
|
7
|
+
properties: [infoBox.property]
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
return { query: query || null };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import InfoBoxValue from './InfoBoxValue';
|
|
4
|
+
import InfoBoxLabel from './InfoBoxLabel';
|
|
3
5
|
|
|
4
6
|
const InfoBox = ({ items, infoBoxKey }) => {
|
|
5
7
|
if (!items) return null;
|
|
@@ -8,11 +10,15 @@ const InfoBox = ({ items, infoBoxKey }) => {
|
|
|
8
10
|
Object.values(item)
|
|
9
11
|
.map(info => {
|
|
10
12
|
if (!info.label || !info.value) return null;
|
|
11
|
-
|
|
13
|
+
|
|
12
14
|
return (
|
|
13
15
|
<div className="info-box--item" key={`${infoBoxKey}-${info.label.toLowerCase()}`}>
|
|
14
|
-
<div className="info-box--label">
|
|
15
|
-
|
|
16
|
+
<div className="info-box--label">
|
|
17
|
+
<InfoBoxLabel item={info} />
|
|
18
|
+
</div>
|
|
19
|
+
<div className="info-box--value">
|
|
20
|
+
<InfoBoxValue item={info} />
|
|
21
|
+
</div>
|
|
16
22
|
</div>
|
|
17
23
|
);
|
|
18
24
|
})
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Link } from 'react-router-dom';
|
|
4
|
+
|
|
5
|
+
const InfoBoxValue = ({ item = {} }) => {
|
|
6
|
+
const { url, value } = item;
|
|
7
|
+
if (url) {
|
|
8
|
+
if (url.startsWith('http')) {
|
|
9
|
+
return (
|
|
10
|
+
<a href={url} target="_blank" rel="noopener noreferrer">
|
|
11
|
+
{value}
|
|
12
|
+
</a>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
return (
|
|
16
|
+
<Link to={url} target="_blank">
|
|
17
|
+
{value}
|
|
18
|
+
</Link>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
InfoBoxValue.propTypes = {
|
|
26
|
+
item: PropTypes.object.isRequired
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default InfoBoxValue;
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { Link } from 'react-router-dom';
|
|
3
3
|
import TableActions from '../TableActions';
|
|
4
4
|
import { ACTIONS } from '../../../constants';
|
|
5
|
+
import InfoBoxValue from '../../InfoBoxes/presentational/InfoBoxValue';
|
|
6
|
+
import InfoBoxLabel from '../../InfoBoxes/presentational/InfoBoxLabel';
|
|
5
7
|
|
|
6
8
|
const formatRows = ({ rows, url, toggleModal, label, firstColumn = 'name', isEnquiry }) =>
|
|
7
9
|
rows.map(data => {
|
|
@@ -38,16 +40,14 @@ const buildArrayRowContent = rowData => (
|
|
|
38
40
|
if (!rowGroup.length) return null;
|
|
39
41
|
return (
|
|
40
42
|
<div className="table-row-list__group">
|
|
41
|
-
{rowGroup.map(
|
|
43
|
+
{rowGroup.map(item => (
|
|
42
44
|
<div className="table-row-list__group__item">
|
|
43
|
-
<span className="table-row-list__group__item__label">
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
value && <span className="table-row-list__group__item__value"> {value}</span>
|
|
50
|
-
)}
|
|
45
|
+
<span className="table-row-list__group__item__label">
|
|
46
|
+
<InfoBoxLabel item={item} />
|
|
47
|
+
</span>
|
|
48
|
+
<span className="table-row-list__group__item__value">
|
|
49
|
+
<InfoBoxValue item={item} />
|
|
50
|
+
</span>
|
|
51
51
|
</div>
|
|
52
52
|
))}
|
|
53
53
|
</div>
|