@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.
- package/CHANGELOG.md +2 -34
- package/README.md +0 -2
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityDataListing/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/Entity.js +19 -29
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +6 -12
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/index.js.map +1 -1
- package/lib/components/EntityManager/EntityManager.js.map +1 -1
- package/lib/components/EntityManager/index.js.map +1 -1
- package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib/components/EntityManager/utils/entity.js.map +1 -1
- package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
- package/lib/components/EntityManager/utils/query.js.map +1 -1
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
- package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
- package/lib/components/ListingTable/TableActions/index.js.map +1 -1
- package/lib/components/ListingTable/index.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/constants.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-create-entity-mutation.js.map +1 -1
- package/lib/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/build-update-data-query.js.map +1 -1
- package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib/utils/hoc/withContext.js.map +1 -1
- package/lib/utils/hooks/useToggle.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/Entity.js +18 -29
- package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +7 -13
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
- package/lib-es/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
- package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib-es/components/EntityManager/utils/query.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib-es/components/ListingTable/TableActions/TableActions.js.map +1 -1
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib-es/components/ListingTable/service/index.js.map +1 -1
- package/lib-es/components/Tabs/index.js.map +1 -1
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/add-content-menu-items.js.map +1 -1
- package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
- package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib-es/utils/build-listing-query.js.map +1 -1
- package/lib-es/utils/build-update-data-query.js.map +1 -1
- package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib-es/utils/get-default-query-params.js.map +1 -1
- package/lib-es/utils/hoc/withContext.js.map +1 -1
- package/lib-es/utils/hooks/useToggle.js.map +1 -1
- package/package.json +9 -10
- package/src/components/EntityManager/Entity/Entity.js +59 -65
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +9 -23
- package/lib/components/InfoBoxes/InfoBoxes.js +0 -36
- package/lib/components/InfoBoxes/InfoBoxes.js.map +0 -1
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js +0 -44
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +0 -1
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +0 -25
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +0 -1
- package/lib/components/InfoBoxes/hooks/useData.js +0 -42
- package/lib/components/InfoBoxes/hooks/useData.js.map +0 -1
- package/lib/components/InfoBoxes/hooks/useInfoBox.js +0 -26
- package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +0 -1
- package/lib/components/InfoBoxes/index.js +0 -12
- package/lib/components/InfoBoxes/index.js.map +0 -1
- package/lib/components/InfoBoxes/presentational/InfoBox.js +0 -46
- package/lib/components/InfoBoxes/presentational/InfoBox.js.map +0 -1
- package/lib-es/components/InfoBoxes/InfoBoxes.js +0 -28
- package/lib-es/components/InfoBoxes/InfoBoxes.js.map +0 -1
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js +0 -30
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +0 -1
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +0 -25
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +0 -1
- package/lib-es/components/InfoBoxes/hooks/useData.js +0 -37
- package/lib-es/components/InfoBoxes/hooks/useData.js.map +0 -1
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js +0 -19
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +0 -1
- package/lib-es/components/InfoBoxes/index.js +0 -3
- package/lib-es/components/InfoBoxes/index.js.map +0 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js +0 -31
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +0 -1
- package/src/components/InfoBoxes/InfoBoxes.js +0 -24
- package/src/components/InfoBoxes/container/InfoBoxContainer.js +0 -22
- package/src/components/InfoBoxes/helpers/build-dynamic-query.js +0 -25
- package/src/components/InfoBoxes/hooks/useData.js +0 -20
- package/src/components/InfoBoxes/hooks/useInfoBox.js +0 -13
- package/src/components/InfoBoxes/index.js +0 -3
- 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 +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,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
|
-
};
|