@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.
- package/CHANGELOG.md +9 -47
- package/README.md +0 -42
- package/lib/components/EntityDataListing/EntityDataListing.js +24 -3
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityManager/Entity/Entity.js +3 -16
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +2 -12
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/ListingTable/ListingTable.js +80 -113
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +20 -8
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +26 -92
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +11 -73
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/index.js +11 -3
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +13 -64
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-listing-query.js +2 -11
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/get-default-query-params.js +4 -3
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib-es/components/EntityDataListing/EntityDataListing.js +14 -3
- package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/Entity.js +3 -16
- package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +2 -12
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTable.js +49 -46
- package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +19 -11
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib-es/components/ListingTable/mappers/populate-rows.js +24 -76
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib-es/components/ListingTable/service/index.js +7 -65
- package/lib-es/components/ListingTable/service/index.js.map +1 -1
- package/lib-es/index.js +9 -1
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/add-content-menu-items.js +5 -49
- package/lib-es/utils/add-content-menu-items.js.map +1 -1
- package/lib-es/utils/build-listing-query.js +1 -10
- package/lib-es/utils/build-listing-query.js.map +1 -1
- package/lib-es/utils/get-default-query-params.js +3 -1
- package/lib-es/utils/get-default-query-params.js.map +1 -1
- package/package.json +9 -10
- package/src/components/EntityDataListing/EntityDataListing.js +12 -3
- package/src/components/EntityManager/Entity/Entity.js +1 -10
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +16 -34
- package/src/components/ListingTable/ListingTable.js +38 -57
- package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +22 -8
- package/src/components/ListingTable/mappers/populate-rows.js +18 -83
- package/src/components/ListingTable/service/index.js +5 -42
- package/src/index.js +8 -1
- package/src/utils/add-content-menu-items.js +3 -45
- package/src/utils/build-listing-query.js +1 -11
- package/src/utils/get-default-query-params.js +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +0 -39
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +0 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +0 -12
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +0 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +0 -44
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +0 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +0 -32
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +0 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +0 -45
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +0 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +0 -38
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +0 -1
- 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/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +0 -30
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js +0 -3
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +0 -30
- package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +0 -26
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +0 -39
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +0 -24
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.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/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +0 -26
- package/src/components/EntityManager/Entity/EntitiyNavLinks/index.js +0 -3
- package/src/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +0 -22
- package/src/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +0 -33
- package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +0 -28
- package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +0 -33
- 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,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
|
-
};
|