@blaze-cms/plugin-data-ui 0.134.0-project-admin-customisations.0 → 0.135.0-core-styles.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 +12 -22
- 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 +5 -18
- 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/EntityManager/Entity/actions-handlers/update/submit.js +2 -2
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib/components/EntityManager/EntityManager.js +2 -2
- package/lib/components/EntityManager/EntityManager.js.map +1 -1
- package/lib/components/EntityManager/utils/data-mappers.js +2 -2
- package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib/components/EntityManager/utils/entity.js +2 -2
- package/lib/components/EntityManager/utils/entity.js.map +1 -1
- package/lib/components/ListingTable/ListingTable.js +82 -115
- 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 +28 -94
- 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 +5 -18
- 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/EntityManager/Entity/actions-handlers/update/submit.js +2 -2
- package/lib-es/components/EntityManager/EntityManager.js +2 -2
- package/lib-es/components/EntityManager/utils/data-mappers.js +2 -2
- package/lib-es/components/EntityManager/utils/entity.js +2 -2
- package/lib-es/components/ListingTable/ListingTable.js +51 -48
- 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 +26 -78
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"populate-rows.js","names":["React","Link","TableActions","ACTIONS","formatRows","rows","url","toggleModal","label","firstColumn","
|
|
1
|
+
{"version":3,"file":"populate-rows.js","names":["React","Link","TableActions","ACTIONS","formatRows","rows","url","toggleModal","label","firstColumn","map","data","editUrl","id","_objectSpread","createElement","to","role","actions","showDeleteModal","getSanitizedColumnLabel","columnProp","sanitizedChar","index","length","toUpperCase","toLowerCase","getColumnLabels","listingProperties","properties","dynamicProperties","allProperties","reduce","acc","listingProperty","populateRows","entitySchema","formProperties","columns","labels","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';\n\nconst formatRows = ({ rows, url, toggleModal, label, firstColumn = 'name' }) =>\n rows.map(data => {\n const editUrl = `${url}/update/${data.id}`;\n return {\n ...data,\n [firstColumn]: (\n <Link to={editUrl} role=\"button\">\n {data[firstColumn]}\n </Link>\n ),\n actions: <TableActions editUrl={editUrl} data={data} showDeleteModal={toggleModal} />\n };\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 getColumnLabels = (listingProperties, properties, dynamicProperties) => {\n const allProperties = { ...properties, ...dynamicProperties };\n return listingProperties.reduce((acc, listingProperty) => {\n const label = allProperties[listingProperty].label || getSanitizedColumnLabel(listingProperty);\n return { ...acc, ...{ [listingProperty]: label } };\n }, {});\n};\n\nconst populateRows = ({ toggleModal, url, entitySchema, rows }) => {\n const { listingProperties, properties, dynamicProperties = {}, formProperties } = entitySchema;\n const columns = [...listingProperties, ACTIONS];\n const [firstColumn] = columns;\n const labels = {\n ...getColumnLabels(listingProperties, properties, dynamicProperties),\n [ACTIONS]: ACTIONS\n };\n\n return {\n identification: 'id',\n sort: null,\n columns,\n labels,\n orderBy: [...formProperties],\n rows: formatRows({ firstColumn, rows, url, toggleModal })\n };\n};\n\nexport { populateRows, formatRows };\n"],"mappings":"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"}
|
|
@@ -1,80 +1,22 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
1
|
import buildListingQuery from '../../../utils/build-listing-query';
|
|
5
|
-
function buildVariables({
|
|
6
|
-
entitySchema,
|
|
7
|
-
isSearchQuery,
|
|
8
|
-
listFilters = [],
|
|
9
|
-
queryParams = {}
|
|
10
|
-
}) {
|
|
11
|
-
const {
|
|
12
|
-
identifier
|
|
13
|
-
} = entitySchema;
|
|
14
|
-
const {
|
|
15
|
-
sort,
|
|
16
|
-
offset,
|
|
17
|
-
limit,
|
|
18
|
-
where
|
|
19
|
-
} = queryParams;
|
|
20
|
-
const [{
|
|
21
|
-
property,
|
|
22
|
-
direction
|
|
23
|
-
}] = sort;
|
|
24
|
-
const parsedOffset = `${property}:${direction}`;
|
|
25
|
-
if (!isSearchQuery) return _objectSpread(_objectSpread({}, queryParams), {}, {
|
|
26
|
-
where: !Array.isArray(listFilters) ? listFilters : where
|
|
27
|
-
});
|
|
28
|
-
const rawQuery = {
|
|
29
|
-
bool: {
|
|
30
|
-
must: listFilters || [],
|
|
31
|
-
filter: [{
|
|
32
|
-
term: {
|
|
33
|
-
entityIdentifier: identifier
|
|
34
|
-
}
|
|
35
|
-
}]
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
return {
|
|
39
|
-
limit,
|
|
40
|
-
offset,
|
|
41
|
-
sort: parsedOffset,
|
|
42
|
-
where: JSON.stringify(rawQuery)
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
2
|
const fetchData = async ({
|
|
46
3
|
client,
|
|
47
4
|
querySettings: {
|
|
48
5
|
entitySchema,
|
|
49
6
|
queryParams
|
|
50
|
-
}
|
|
51
|
-
listFilters
|
|
7
|
+
}
|
|
52
8
|
}) => {
|
|
9
|
+
const query = buildListingQuery(entitySchema);
|
|
53
10
|
const {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
source
|
|
58
|
-
} = {}
|
|
59
|
-
} = {}
|
|
60
|
-
} = {}
|
|
61
|
-
} = entitySchema;
|
|
62
|
-
const isSearchQuery = source === 'search';
|
|
63
|
-
const query = buildListingQuery(entitySchema, isSearchQuery);
|
|
64
|
-
const variables = buildVariables({
|
|
65
|
-
entitySchema,
|
|
66
|
-
listFilters,
|
|
67
|
-
queryParams,
|
|
68
|
-
isSearchQuery
|
|
69
|
-
});
|
|
70
|
-
const {
|
|
71
|
-
data = {}
|
|
11
|
+
data: {
|
|
12
|
+
listingData
|
|
13
|
+
}
|
|
72
14
|
} = await client.query({
|
|
73
15
|
query,
|
|
74
|
-
variables,
|
|
16
|
+
variables: queryParams,
|
|
75
17
|
fetchPolicy: 'network-only'
|
|
76
18
|
});
|
|
77
|
-
return
|
|
19
|
+
return listingData;
|
|
78
20
|
};
|
|
79
21
|
export { fetchData };
|
|
80
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["buildListingQuery","
|
|
1
|
+
{"version":3,"file":"index.js","names":["buildListingQuery","fetchData","client","querySettings","entitySchema","queryParams","query","data","listingData","variables","fetchPolicy"],"sources":["../../../../src/components/ListingTable/service/index.js"],"sourcesContent":["import buildListingQuery from '../../../utils/build-listing-query';\n\nconst fetchData = async ({ client, querySettings: { entitySchema, queryParams } }) => {\n const query = buildListingQuery(entitySchema);\n const {\n data: { listingData }\n } = await client.query({ query, variables: queryParams, fetchPolicy: 'network-only' });\n\n return listingData;\n};\n\nexport { fetchData };\n"],"mappings":"AAAA,OAAOA,iBAAiB,MAAM,oCAAoC;AAElE,MAAMC,SAAS,GAAG,MAAAA,CAAO;EAAEC,MAAM;EAAEC,aAAa,EAAE;IAAEC,YAAY;IAAEC;EAAY;AAAE,CAAC,KAAK;EACpF,MAAMC,KAAK,GAAGN,iBAAiB,CAACI,YAAY,CAAC;EAC7C,MAAM;IACJG,IAAI,EAAE;MAAEC;IAAY;EACtB,CAAC,GAAG,MAAMN,MAAM,CAACI,KAAK,CAAC;IAAEA,KAAK;IAAEG,SAAS,EAAEJ,WAAW;IAAEK,WAAW,EAAE;EAAe,CAAC,CAAC;EAEtF,OAAOF,WAAW;AACpB,CAAC;AAED,SAASP,SAAS"}
|
package/lib-es/index.js
CHANGED
|
@@ -6,7 +6,15 @@ import getAddContentMenuItems from './utils/add-content-menu-items';
|
|
|
6
6
|
const EntityDataListing = React.lazy(() => import( /* webpackChunkName: 'EntityDataListing' */'./components/EntityDataListing'));
|
|
7
7
|
const EntityManager = React.lazy(() => import( /* webpackChunkName: 'EntityManager' */'./components/EntityManager'));
|
|
8
8
|
export default async function load(app) {
|
|
9
|
-
|
|
9
|
+
// To load different plugin information into menu
|
|
10
|
+
const sectionKey = 'content';
|
|
11
|
+
app.events.once('load:menu-section', addSection => {
|
|
12
|
+
addSection(sectionKey, {
|
|
13
|
+
header: 'content',
|
|
14
|
+
order: 100
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
app.events.once('load:menu-items', getAddContentMenuItems(app, sectionKey));
|
|
10
18
|
app.events.once('load:custom:field:type', addFieldType => {
|
|
11
19
|
Object.keys(formFieldTypes).forEach(type => {
|
|
12
20
|
addFieldType({
|
package/lib-es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getFormBuilderLookup","formFieldTypes","React","pkg","DATA_LISTING_PREFIX","PLUGIN_NAME","getAddContentMenuItems","EntityDataListing","lazy","EntityManager","load","app","events","once","addFieldType","Object","keys","forEach","type","component","emitAsync","entityDataListingRoute","path","key","exact","editEntityRoute","addEntityRoute","addRoute","name","version","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import { getFormBuilderLookup, formFieldTypes } from '@blaze-cms/react-form-builder';\nimport React from 'react';\nimport pkg from '../package.json';\nimport { DATA_LISTING_PREFIX, PLUGIN_NAME } from './constants';\nimport getAddContentMenuItems from './utils/add-content-menu-items';\n\nconst EntityDataListing = React.lazy(() =>\n import(/* webpackChunkName: 'EntityDataListing' */ './components/EntityDataListing')\n);\nconst EntityManager = React.lazy(() =>\n import(/* webpackChunkName: 'EntityManager' */ './components/EntityManager')\n);\n\nexport default async function load(app) {\n app.events.once('
|
|
1
|
+
{"version":3,"file":"index.js","names":["getFormBuilderLookup","formFieldTypes","React","pkg","DATA_LISTING_PREFIX","PLUGIN_NAME","getAddContentMenuItems","EntityDataListing","lazy","EntityManager","load","app","sectionKey","events","once","addSection","header","order","addFieldType","Object","keys","forEach","type","component","emitAsync","entityDataListingRoute","path","key","exact","editEntityRoute","addEntityRoute","addRoute","name","version","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import { getFormBuilderLookup, formFieldTypes } from '@blaze-cms/react-form-builder';\nimport React from 'react';\nimport pkg from '../package.json';\nimport { DATA_LISTING_PREFIX, PLUGIN_NAME } from './constants';\nimport getAddContentMenuItems from './utils/add-content-menu-items';\n\nconst EntityDataListing = React.lazy(() =>\n import(/* webpackChunkName: 'EntityDataListing' */ './components/EntityDataListing')\n);\nconst EntityManager = React.lazy(() =>\n import(/* webpackChunkName: 'EntityManager' */ './components/EntityManager')\n);\n\nexport default async function load(app) {\n // To load different plugin information into menu\n const sectionKey = 'content';\n\n app.events.once('load:menu-section', addSection => {\n addSection(sectionKey, { header: 'content', order: 100 });\n });\n\n app.events.once('load:menu-items', getAddContentMenuItems(app, sectionKey));\n\n app.events.once('load:custom:field:type', addFieldType => {\n Object.keys(formFieldTypes).forEach(type => {\n addFieldType({ type, component: formFieldTypes[type] });\n });\n });\n\n app.events.once('plugin:data-ui:load:loaded', async () => {\n await app.events.emitAsync('load:custom:field:type', getFormBuilderLookup.addFieldType);\n });\n\n const entityDataListingRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier`,\n key: 'entityDataListing',\n component: EntityDataListing,\n exact: true\n };\n\n const editEntityRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action/:id`,\n key: 'editEntity',\n component: EntityManager,\n exact: true\n };\n\n const addEntityRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action`,\n key: 'createEntity',\n component: EntityManager,\n exact: true\n };\n\n app.addRoute(entityDataListingRoute);\n app.addRoute(editEntityRoute);\n app.addRoute(addEntityRoute);\n\n return {\n name: PLUGIN_NAME,\n version: pkg.version\n };\n}\n\nload.pluginName = PLUGIN_NAME;\n"],"mappings":"AAAA,SAASA,oBAAoB,EAAEC,cAAc,QAAQ,+BAA+B;AACpF,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,GAAG,MAAM,iBAAiB;AACjC,SAASC,mBAAmB,EAAEC,WAAW,QAAQ,aAAa;AAC9D,OAAOC,sBAAsB,MAAM,gCAAgC;AAEnE,MAAMC,iBAAiB,GAAGL,KAAK,CAACM,IAAI,CAAC,MACnC,MAAM,EAAC,2CAA4C,gCAAgC,CACrF,CAAC;AACD,MAAMC,aAAa,GAAGP,KAAK,CAACM,IAAI,CAAC,MAC/B,MAAM,EAAC,uCAAwC,4BAA4B,CAC7E,CAAC;AAED,eAAe,eAAeE,IAAIA,CAACC,GAAG,EAAE;EACtC;EACA,MAAMC,UAAU,GAAG,SAAS;EAE5BD,GAAG,CAACE,MAAM,CAACC,IAAI,CAAC,mBAAmB,EAAEC,UAAU,IAAI;IACjDA,UAAU,CAACH,UAAU,EAAE;MAAEI,MAAM,EAAE,SAAS;MAAEC,KAAK,EAAE;IAAI,CAAC,CAAC;EAC3D,CAAC,CAAC;EAEFN,GAAG,CAACE,MAAM,CAACC,IAAI,CAAC,iBAAiB,EAAER,sBAAsB,CAACK,GAAG,EAAEC,UAAU,CAAC,CAAC;EAE3ED,GAAG,CAACE,MAAM,CAACC,IAAI,CAAC,wBAAwB,EAAEI,YAAY,IAAI;IACxDC,MAAM,CAACC,IAAI,CAACnB,cAAc,CAAC,CAACoB,OAAO,CAACC,IAAI,IAAI;MAC1CJ,YAAY,CAAC;QAAEI,IAAI;QAAEC,SAAS,EAAEtB,cAAc,CAACqB,IAAI;MAAE,CAAC,CAAC;IACzD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFX,GAAG,CAACE,MAAM,CAACC,IAAI,CAAC,4BAA4B,EAAE,YAAY;IACxD,MAAMH,GAAG,CAACE,MAAM,CAACW,SAAS,CAAC,wBAAwB,EAAExB,oBAAoB,CAACkB,YAAY,CAAC;EACzF,CAAC,CAAC;EAEF,MAAMO,sBAAsB,GAAG;IAC7BC,IAAI,EAAG,GAAEtB,mBAAoB,oBAAmB;IAChDuB,GAAG,EAAE,mBAAmB;IACxBJ,SAAS,EAAEhB,iBAAiB;IAC5BqB,KAAK,EAAE;EACT,CAAC;EAED,MAAMC,eAAe,GAAG;IACtBH,IAAI,EAAG,GAAEtB,mBAAoB,gCAA+B;IAC5DuB,GAAG,EAAE,YAAY;IACjBJ,SAAS,EAAEd,aAAa;IACxBmB,KAAK,EAAE;EACT,CAAC;EAED,MAAME,cAAc,GAAG;IACrBJ,IAAI,EAAG,GAAEtB,mBAAoB,4BAA2B;IACxDuB,GAAG,EAAE,cAAc;IACnBJ,SAAS,EAAEd,aAAa;IACxBmB,KAAK,EAAE;EACT,CAAC;EAEDjB,GAAG,CAACoB,QAAQ,CAACN,sBAAsB,CAAC;EACpCd,GAAG,CAACoB,QAAQ,CAACF,eAAe,CAAC;EAC7BlB,GAAG,CAACoB,QAAQ,CAACD,cAAc,CAAC;EAE5B,OAAO;IACLE,IAAI,EAAE3B,WAAW;IACjB4B,OAAO,EAAE9B,GAAG,CAAC8B;EACf,CAAC;AACH;AAEAvB,IAAI,CAACwB,UAAU,GAAG7B,WAAW"}
|
|
@@ -2,10 +2,8 @@ import { getQuery } from '@blaze-cms/admin-ui-utils';
|
|
|
2
2
|
const {
|
|
3
3
|
MENU_PERMISSIONS
|
|
4
4
|
} = require('../constants');
|
|
5
|
-
function getAddContentMenuItems(app) {
|
|
6
|
-
return async
|
|
7
|
-
addConfig
|
|
8
|
-
}) => {
|
|
5
|
+
function getAddContentMenuItems(app, sectionKey) {
|
|
6
|
+
return async addItem => {
|
|
9
7
|
const client = app.getClient();
|
|
10
8
|
const {
|
|
11
9
|
data: {
|
|
@@ -18,57 +16,15 @@ function getAddContentMenuItems(app) {
|
|
|
18
16
|
canDoActions: MENU_PERMISSIONS
|
|
19
17
|
}
|
|
20
18
|
});
|
|
21
|
-
if (!getEntitySchemas || !getEntitySchemas.length) return; // no items so don't add section
|
|
22
|
-
|
|
23
|
-
const menuItems = {};
|
|
24
|
-
const sectionMenuItems = {
|
|
25
|
-
content: {}
|
|
26
|
-
};
|
|
27
|
-
getEntitySchemas.forEach(({
|
|
28
|
-
id,
|
|
29
|
-
displayName,
|
|
30
|
-
displayProperties
|
|
31
|
-
}) => {
|
|
32
|
-
if (!displayProperties) return null;
|
|
33
|
-
const {
|
|
34
|
-
adminMenu: {
|
|
35
|
-
sectionKey = 'content'
|
|
36
|
-
} = {}
|
|
37
|
-
} = displayProperties;
|
|
38
|
-
const sectionItems = sectionMenuItems[sectionKey] || {};
|
|
39
|
-
sectionItems[id] = {
|
|
40
|
-
label: displayName,
|
|
41
|
-
uri: `/data-listing/${id}`
|
|
42
|
-
};
|
|
43
|
-
sectionMenuItems[sectionKey] = sectionItems;
|
|
44
|
-
});
|
|
45
|
-
const menuConfig = {
|
|
46
|
-
main: {
|
|
47
|
-
items: {
|
|
48
|
-
content: {
|
|
49
|
-
label: 'Content',
|
|
50
|
-
loadOpen: true,
|
|
51
|
-
order: 10,
|
|
52
|
-
items: menuItems
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
Object.entries(sectionMenuItems).forEach(([sectionKey, sectionItems]) => {
|
|
58
|
-
const sectionConfig = menuConfig.main.items[sectionKey] || {};
|
|
59
|
-
sectionConfig.items = sectionItems;
|
|
60
|
-
menuConfig.main.items[sectionKey] = sectionConfig;
|
|
61
|
-
});
|
|
62
19
|
getEntitySchemas.forEach(({
|
|
63
20
|
id,
|
|
64
21
|
displayName
|
|
65
22
|
}) => {
|
|
66
|
-
|
|
67
|
-
|
|
23
|
+
addItem({
|
|
24
|
+
name: displayName,
|
|
68
25
|
uri: `/data-listing/${id}`
|
|
69
|
-
};
|
|
26
|
+
}, sectionKey);
|
|
70
27
|
});
|
|
71
|
-
addConfig(menuConfig);
|
|
72
28
|
};
|
|
73
29
|
}
|
|
74
30
|
export default getAddContentMenuItems;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-content-menu-items.js","names":["getQuery","MENU_PERMISSIONS","require","getAddContentMenuItems","app","
|
|
1
|
+
{"version":3,"file":"add-content-menu-items.js","names":["getQuery","MENU_PERMISSIONS","require","getAddContentMenuItems","app","sectionKey","addItem","client","getClient","data","getEntitySchemas","query","variables","canDoActions","forEach","id","displayName","name","uri"],"sources":["../../src/utils/add-content-menu-items.js"],"sourcesContent":["import { getQuery } from '@blaze-cms/admin-ui-utils';\n\nconst { MENU_PERMISSIONS } = require('../constants');\n\nfunction getAddContentMenuItems(app, sectionKey) {\n return async addItem => {\n const client = app.getClient();\n const {\n data: { getEntitySchemas }\n } = await client.query({\n query: getQuery('GET_USER_EDITABLE_ENTITIES'),\n variables: {\n // only return entities that the current user can do the following actions on\n canDoActions: MENU_PERMISSIONS\n }\n });\n getEntitySchemas.forEach(({ id, displayName }) => {\n addItem({ name: displayName, uri: `/data-listing/${id}` }, sectionKey);\n });\n };\n}\n\nexport default getAddContentMenuItems;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,2BAA2B;AAEpD,MAAM;EAAEC;AAAiB,CAAC,GAAGC,OAAO,CAAC,cAAc,CAAC;AAEpD,SAASC,sBAAsBA,CAACC,GAAG,EAAEC,UAAU,EAAE;EAC/C,OAAO,MAAMC,OAAO,IAAI;IACtB,MAAMC,MAAM,GAAGH,GAAG,CAACI,SAAS,CAAC,CAAC;IAC9B,MAAM;MACJC,IAAI,EAAE;QAAEC;MAAiB;IAC3B,CAAC,GAAG,MAAMH,MAAM,CAACI,KAAK,CAAC;MACrBA,KAAK,EAAEX,QAAQ,CAAC,4BAA4B,CAAC;MAC7CY,SAAS,EAAE;QACT;QACAC,YAAY,EAAEZ;MAChB;IACF,CAAC,CAAC;IACFS,gBAAgB,CAACI,OAAO,CAAC,CAAC;MAAEC,EAAE;MAAEC;IAAY,CAAC,KAAK;MAChDV,OAAO,CAAC;QAAEW,IAAI,EAAED,WAAW;QAAEE,GAAG,EAAG,iBAAgBH,EAAG;MAAE,CAAC,EAAEV,UAAU,CAAC;IACxE,CAAC,CAAC;EACJ,CAAC;AACH;AAEA,eAAeF,sBAAsB"}
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import { gql } from '@apollo/client';
|
|
2
2
|
import { BlazeError } from '@blaze-cms/core-errors';
|
|
3
|
-
|
|
4
|
-
const buildAdminSearchQuery = entitySchema => {
|
|
5
|
-
const {
|
|
6
|
-
listingProperties = []
|
|
7
|
-
} = entitySchema || {};
|
|
8
|
-
const parsedProperties = `id, ${listingProperties.join(' ') || 'id name'}`;
|
|
9
|
-
return getDynamicQuery('ADMIN_SEARCH')([entitySchema], parsedProperties, true);
|
|
10
|
-
};
|
|
11
|
-
function buildListingQuery(entitySchema, isSearchQuery) {
|
|
3
|
+
function buildListingQuery(entitySchema) {
|
|
12
4
|
if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {
|
|
13
5
|
throw new BlazeError('Listing query requires getAll action and listingProperties from entity schema');
|
|
14
6
|
}
|
|
15
|
-
if (isSearchQuery) return buildAdminSearchQuery(entitySchema);
|
|
16
7
|
const sortType = entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);
|
|
17
8
|
return gql`
|
|
18
9
|
query ${entitySchema.actions.getAll}($where: JSON, $limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-listing-query.js","names":["gql","BlazeError","
|
|
1
|
+
{"version":3,"file":"build-listing-query.js","names":["gql","BlazeError","buildListingQuery","entitySchema","actions","getAll","listingProperties","sortType","toUpperCase","substr","join"],"sources":["../../src/utils/build-listing-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nfunction buildListingQuery(entitySchema) {\n if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {\n throw new BlazeError(\n 'Listing query requires getAll action and listingProperties from entity schema'\n );\n }\n\n const sortType =\n entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);\n\n return gql`\n query ${\n entitySchema.actions.getAll\n }($where: JSON, $limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {\n listingData: ${\n entitySchema.actions.getAll\n }(where: $where, limit: $limit, offset:$offset, sort:$sort){\n id,\n ${entitySchema.listingProperties.join(',\\n')}\n }\n }\n `;\n}\n\nexport default buildListingQuery;\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,iBAAiBA,CAACC,YAAY,EAAE;EACvC,IAAI,CAACA,YAAY,CAACC,OAAO,IAAI,CAACD,YAAY,CAACC,OAAO,CAACC,MAAM,IAAI,CAACF,YAAY,CAACG,iBAAiB,EAAE;IAC5F,MAAM,IAAIL,UAAU,CAClB,+EACF,CAAC;EACH;EAEA,MAAMM,QAAQ,GACZJ,YAAY,CAACC,OAAO,CAACC,MAAM,CAAC,CAAC,CAAC,CAACG,WAAW,CAAC,CAAC,GAAGL,YAAY,CAACC,OAAO,CAACC,MAAM,CAACI,MAAM,CAAC,CAAC,CAAC;EAEtF,OAAOT,GAAI;AACb,YACMG,YAAY,CAACC,OAAO,CAACC,MACtB,oDAAmDE,QAAS;AACjE,qBACQJ,YAAY,CAACC,OAAO,CAACC,MACtB;AACP;AACA,UAAUF,YAAY,CAACG,iBAAiB,CAACI,IAAI,CAAC,KAAK,CAAE;AACrD;AACA;AACA,GAAG;AACH;AAEA,eAAeR,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","schema","updated","properties","adminDefaultListingFilter","where","displayProperties","limit","offset","sort","property","direction"],"sources":["../../src/utils/get-default-query-params.js"],"sourcesContent":["const getDefaultQueryParams = schema => {\n const updated = schema.properties && schema.properties.updated;\n const { adminDefaultListingFilter: where } = schema.displayProperties || {};\n\n return {\n where,\n limit: 40,\n offset: 0,\n sort: updated\n ? [\n {\n property: 'updated',\n direction: 'desc'\n }\n ]\n : []\n };\n};\n\nexport { getDefaultQueryParams };\n"],"mappings":"AAAA,MAAMA,qBAAqB,
|
|
1
|
+
{"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","schema","updated","properties","adminDefaultListingFilter","where","displayProperties","limit","offset","sort","property","direction"],"sources":["../../src/utils/get-default-query-params.js"],"sourcesContent":["const getDefaultQueryParams = ({ schema }) => {\n const updated = schema.properties && schema.properties.updated;\n const { adminDefaultListingFilter: where } = schema.displayProperties || {};\n\n return {\n where,\n limit: 40,\n offset: 0,\n sort: updated\n ? [\n {\n property: 'updated',\n direction: 'desc'\n }\n ]\n : []\n };\n};\n\nexport { getDefaultQueryParams };\n"],"mappings":"AAAA,MAAMA,qBAAqB,GAAGA,CAAC;EAAEC;AAAO,CAAC,KAAK;EAC5C,MAAMC,OAAO,GAAGD,MAAM,CAACE,UAAU,IAAIF,MAAM,CAACE,UAAU,CAACD,OAAO;EAC9D,MAAM;IAAEE,yBAAyB,EAAEC;EAAM,CAAC,GAAGJ,MAAM,CAACK,iBAAiB,IAAI,CAAC,CAAC;EAE3E,OAAO;IACLD,KAAK;IACLE,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAEP,OAAO,GACT,CACE;MACEQ,QAAQ,EAAE,SAAS;MACnBC,SAAS,EAAE;IACb,CAAC,CACF,GACD;EACN,CAAC;AACH,CAAC;AAED,SAASX,qBAAqB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/plugin-data-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.135.0-core-styles.0",
|
|
4
4
|
"description": "Blaze plugin data ui",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -27,13 +27,12 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/admin-ui-utils": "0.
|
|
31
|
-
"@blaze-cms/core-errors": "0.
|
|
32
|
-
"@blaze-cms/
|
|
33
|
-
"@blaze-cms/react-
|
|
34
|
-
"@blaze-cms/
|
|
35
|
-
"@blaze-cms/
|
|
36
|
-
"@blaze-cms/versioning-ui": "0.134.0-project-admin-customisations.0",
|
|
30
|
+
"@blaze-cms/admin-ui-utils": "0.135.0-core-styles.0",
|
|
31
|
+
"@blaze-cms/core-errors": "0.135.0-core-styles.0",
|
|
32
|
+
"@blaze-cms/react-form-builder": "0.135.0-core-styles.0",
|
|
33
|
+
"@blaze-cms/react-page-builder": "0.135.0-core-styles.0",
|
|
34
|
+
"@blaze-cms/setup-ui": "0.135.0-core-styles.0",
|
|
35
|
+
"@blaze-cms/versioning-ui": "0.135.0-core-styles.0",
|
|
37
36
|
"@blaze-react/button": "0.5.19",
|
|
38
37
|
"@blaze-react/more": "0.5.19",
|
|
39
38
|
"@blaze-react/multiselect": "0.6.6",
|
|
@@ -54,7 +53,7 @@
|
|
|
54
53
|
"uuid": "^3.3.3"
|
|
55
54
|
},
|
|
56
55
|
"devDependencies": {
|
|
57
|
-
"@blaze-cms/core-ui": "0.
|
|
56
|
+
"@blaze-cms/core-ui": "0.135.0-core-styles.0"
|
|
58
57
|
},
|
|
59
58
|
"peerDependencies": {
|
|
60
59
|
"@apollo/client": "3.x",
|
|
@@ -66,5 +65,5 @@
|
|
|
66
65
|
"lib/*",
|
|
67
66
|
"lib-es/*"
|
|
68
67
|
],
|
|
69
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "be7767749bb94961477aec86f65e3b40127ca40b"
|
|
70
69
|
}
|
|
@@ -6,22 +6,31 @@ import { getQuery } from '@blaze-cms/admin-ui-utils';
|
|
|
6
6
|
import ListingTable from '../ListingTable/ListingTable';
|
|
7
7
|
import { withContext } from '../../utils/hoc/withContext';
|
|
8
8
|
|
|
9
|
-
const EntityDataListing = ({ match }) => {
|
|
9
|
+
const EntityDataListing = ({ match, menuItems }) => {
|
|
10
10
|
const {
|
|
11
11
|
params: { entityIdentifier: identifier }
|
|
12
12
|
} = match;
|
|
13
13
|
|
|
14
|
+
const [[selectedMenuItem]] = menuItems
|
|
15
|
+
.map(([_, { items }]) => {
|
|
16
|
+
const item = items.filter(({ uri }) => uri.endsWith(`/${identifier}`));
|
|
17
|
+
|
|
18
|
+
return item.length ? item : null;
|
|
19
|
+
})
|
|
20
|
+
.filter(Boolean);
|
|
21
|
+
|
|
14
22
|
const { data: { getEntitySchemas = [] } = {} } = useQuery(getQuery('GET_ENTITY_SCHEMA'), {
|
|
15
23
|
variables: { identifier }
|
|
16
24
|
});
|
|
17
25
|
|
|
18
26
|
if (!getEntitySchemas.length) return '';
|
|
19
27
|
|
|
20
|
-
return <ListingTable entitySchema={getEntitySchemas[0]} />;
|
|
28
|
+
return <ListingTable entitySchema={getEntitySchemas[0]} selectedMenuItem={selectedMenuItem} />;
|
|
21
29
|
};
|
|
22
30
|
|
|
23
31
|
EntityDataListing.propTypes = {
|
|
24
|
-
match: PropTypes.object.isRequired
|
|
32
|
+
match: PropTypes.object.isRequired,
|
|
33
|
+
menuItems: PropTypes.array.isRequired
|
|
25
34
|
};
|
|
26
35
|
|
|
27
36
|
export default withContext(EntityDataListing);
|
|
@@ -3,7 +3,6 @@ import React, { useEffect, useState, useRef } from 'react';
|
|
|
3
3
|
import { withRouter, Prompt } from 'react-router-dom';
|
|
4
4
|
import { useApolloClient } from '@apollo/client';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { RenderHook } from '@blaze-cms/plugin-render-hooks-ui';
|
|
7
6
|
import { getQuery, GET_CURRENT_TAB_ID } from '@blaze-cms/admin-ui-utils';
|
|
8
7
|
import { FormBuilder, parseFormValues } from '@blaze-cms/react-form-builder';
|
|
9
8
|
import { DeleteAction, CopyDataFromAction } from '@blaze-cms/admin';
|
|
@@ -35,7 +34,6 @@ import {
|
|
|
35
34
|
checkFulfilConditions
|
|
36
35
|
} from '../utils/entity';
|
|
37
36
|
import useToggle from '../../../utils/hooks/useToggle';
|
|
38
|
-
import InfoBoxes from '../../InfoBoxes/InfoBoxes';
|
|
39
37
|
|
|
40
38
|
const Entity = ({
|
|
41
39
|
formData,
|
|
@@ -442,8 +440,6 @@ const Entity = ({
|
|
|
442
440
|
<div className="page__content--fixed">
|
|
443
441
|
<div className="page__content">
|
|
444
442
|
<div className="content">
|
|
445
|
-
<RenderHook hookKey={`entity:${action}:main:top`} entity={entity} schema={schema} />
|
|
446
|
-
<InfoBoxes id={entity.id} schema={schema} />
|
|
447
443
|
<Tabs
|
|
448
444
|
enabled={showPageBuilderTabs}
|
|
449
445
|
onTabChange={tabId => {
|
|
@@ -465,17 +461,12 @@ const Entity = ({
|
|
|
465
461
|
isNewEntity={isNewEntity}
|
|
466
462
|
/>
|
|
467
463
|
</Tabs>
|
|
468
|
-
<RenderHook
|
|
469
|
-
hookKey={`entity:${action}:main:bottom`}
|
|
470
|
-
entity={entity}
|
|
471
|
-
schema={schema}
|
|
472
|
-
/>
|
|
473
464
|
</div>
|
|
474
465
|
</div>
|
|
475
466
|
</div>
|
|
476
467
|
</div>
|
|
477
468
|
|
|
478
|
-
<div className="column column--one-third page-sidebar
|
|
469
|
+
<div className="column column--one-third page-sidebar">
|
|
479
470
|
{showSideBarRelations && (
|
|
480
471
|
<SideBarRelations
|
|
481
472
|
entity={entity}
|
|
@@ -7,8 +7,6 @@ import { formFieldTypes } from '@blaze-cms/react-form-builder';
|
|
|
7
7
|
import classnames from 'classnames';
|
|
8
8
|
import { VersionsList } from '@blaze-cms/versioning-ui';
|
|
9
9
|
import { PUBLISHED, UNPUBLISHED } from '../../../../constants';
|
|
10
|
-
import CustomSidebarInfoContainer from './container/CustomSidebarInfoContainer';
|
|
11
|
-
import EntityNavLinks from '../EntitiyNavLinks';
|
|
12
10
|
|
|
13
11
|
const SideBarRelations = ({ schema, onChange, formData, entity }) => {
|
|
14
12
|
const { relation: RelationComponent } = formFieldTypes;
|
|
@@ -20,9 +18,7 @@ const SideBarRelations = ({ schema, onChange, formData, entity }) => {
|
|
|
20
18
|
status
|
|
21
19
|
} = formData;
|
|
22
20
|
const client = useApolloClient();
|
|
23
|
-
|
|
24
21
|
const [relationsComponents, setRelationsComponents] = useState(null);
|
|
25
|
-
|
|
26
22
|
useEffect(
|
|
27
23
|
() => {
|
|
28
24
|
(async () => {
|
|
@@ -68,42 +64,28 @@ const SideBarRelations = ({ schema, onChange, formData, entity }) => {
|
|
|
68
64
|
return (
|
|
69
65
|
<div className="sidebar" data-testid="sideBarRelations-main-div">
|
|
70
66
|
<div className="sidebar__content">
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<div className="
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
<span className={statusClassName}>{formattedStatus}</span>
|
|
77
|
-
</div>
|
|
78
|
-
{formattedStatus === PUBLISHED && (
|
|
79
|
-
<p>
|
|
80
|
-
{formattedStatus} on: <span> {formattedPublished}</span>
|
|
81
|
-
</p>
|
|
82
|
-
)}
|
|
67
|
+
{formattedCreated && (
|
|
68
|
+
<div className="sidebar__status">
|
|
69
|
+
<div className="sidebar__status__wrapper">
|
|
70
|
+
<b>Status</b>
|
|
71
|
+
<span className={statusClassName}>{formattedStatus}</span>
|
|
83
72
|
</div>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
{!schema.displayProperties.adminMainInfoProperty && (
|
|
87
|
-
<>
|
|
73
|
+
{formattedStatus === PUBLISHED && (
|
|
88
74
|
<p>
|
|
89
|
-
|
|
75
|
+
{formattedStatus} on: <span> {formattedPublished}</span>
|
|
90
76
|
</p>
|
|
91
|
-
|
|
92
|
-
Updated: <span>{formattedUpdated}</span>
|
|
93
|
-
</p>
|
|
94
|
-
</>
|
|
95
|
-
)}
|
|
77
|
+
)}
|
|
96
78
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
79
|
+
<p>
|
|
80
|
+
Created: <span>{formattedCreated}</span>
|
|
81
|
+
</p>
|
|
82
|
+
<p>
|
|
83
|
+
Updated: <span>{formattedUpdated}</span>
|
|
84
|
+
</p>
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
103
87
|
|
|
104
88
|
<VersionsList itemEntity={itemEntity} itemId={itemId} interfaces={interfaces} />
|
|
105
|
-
<EntityNavLinks schema={schema} />
|
|
106
|
-
|
|
107
89
|
{relationsComponents &&
|
|
108
90
|
relationsComponents.map(({ id, staticData, schema: entitySchema }) => (
|
|
109
91
|
<RelationComponent
|