@blaze-cms/plugin-data-ui 0.146.0-translations.8 → 0.147.0-rc-eagle.4
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/lib/components/EntityDataListing/EntityDataListing.js +21 -19
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityDataListing/index.js +2 -3
- package/lib/components/EntityDataListing/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +18 -19
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/Entity.js +284 -457
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +62 -66
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +32 -56
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +20 -26
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +20 -17
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +34 -32
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +95 -158
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +23 -30
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -56
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +29 -45
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/index.js +7 -8
- package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +36 -57
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +47 -66
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/index.js +2 -3
- package/lib/components/EntityManager/Entity/index.js.map +1 -1
- package/lib/components/EntityManager/EntityManager.js +91 -166
- package/lib/components/EntityManager/EntityManager.js.map +1 -1
- package/lib/components/EntityManager/index.js +2 -3
- package/lib/components/EntityManager/index.js.map +1 -1
- package/lib/components/EntityManager/utils/RecordEditContext/index.js +3 -4
- package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
- package/lib/components/EntityManager/utils/data-mappers.js +34 -46
- package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib/components/EntityManager/utils/entity.js +35 -80
- package/lib/components/EntityManager/utils/entity.js.map +1 -1
- package/lib/components/EntityManager/utils/entityAvailableActions.js +51 -110
- package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib/components/EntityManager/utils/is-form-empty.js +6 -10
- package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
- package/lib/components/EntityManager/utils/query.js +17 -10
- package/lib/components/EntityManager/utils/query.js.map +1 -1
- package/lib/components/InfoBoxes/InfoBoxTooltip.js +19 -16
- package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
- package/lib/components/InfoBoxes/InfoBoxes.js +19 -19
- package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js +26 -38
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +21 -16
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useData.js +33 -30
- package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useInfoBox.js +10 -10
- package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/index.js +2 -3
- package/lib/components/InfoBoxes/index.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBox.js +27 -34
- package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +11 -12
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +12 -12
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
- package/lib/components/ListingTable/ListingTable.js +155 -296
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +53 -58
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/index.js +2 -3
- package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js +436 -262
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js +30 -37
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/helpers.js +82 -71
- package/lib/components/ListingTable/SearchFilter/helpers.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/querys.js +5 -5
- package/lib/components/ListingTable/SearchFilter/querys.js.map +1 -1
- package/lib/components/ListingTable/TableActions/TableActions.js +27 -31
- package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
- package/lib/components/ListingTable/TableActions/index.js +2 -3
- package/lib/components/ListingTable/TableActions/index.js.map +1 -1
- package/lib/components/ListingTable/index.js +2 -3
- package/lib/components/ListingTable/index.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +103 -122
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +66 -83
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/components/Tabs/index.js +26 -42
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/hooks/useCallbackDebounce.js +5 -9
- package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
- package/lib/constants.js +30 -31
- package/lib/constants.js.map +1 -1
- package/lib/icons/ContentIcon.js +17 -20
- package/lib/icons/ContentIcon.js.map +1 -1
- package/lib/icons/SettingsIcon.js +12 -15
- package/lib/icons/SettingsIcon.js.map +1 -1
- package/lib/icons/TaxonomyIcon.js +15 -18
- package/lib/icons/TaxonomyIcon.js.map +1 -1
- package/lib/icons/UsersIcon.js +11 -14
- package/lib/icons/UsersIcon.js.map +1 -1
- package/lib/icons/index.js +8 -9
- package/lib/icons/index.js.map +1 -1
- package/lib/index.js +88 -121
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +67 -93
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-create-entity-mutation.js +12 -9
- package/lib/utils/build-create-entity-mutation.js.map +1 -1
- package/lib/utils/build-delete-entity-mutation.js +11 -8
- package/lib/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib/utils/build-listing-query.js +17 -14
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/build-update-data-query.js +15 -9
- package/lib/utils/build-update-data-query.js.map +1 -1
- package/lib/utils/build-update-publish-unpublish-mutation.js +15 -8
- package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib/utils/get-default-query-params.js +7 -6
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib/utils/hoc/withContext.js +4 -6
- package/lib/utils/hoc/withContext.js.map +1 -1
- package/lib/utils/hooks/useToggle.js +4 -12
- package/lib/utils/hooks/useToggle.js.map +1 -1
- package/lib/utils/index.js +2 -3
- package/lib/utils/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/Entity.js +8 -20
- 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/helpers/build-dynamic-query.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +6 -3
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.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/shared/publish.js.map +1 -1
- package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
- package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
- package/lib-es/components/EntityManager/utils/query.js.map +1 -1
- package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTable.js +2 -2
- package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +20 -17
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js +323 -51
- package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js +7 -3
- package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/helpers.js +39 -8
- package/lib-es/components/ListingTable/SearchFilter/helpers.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/querys.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 +6 -7
- package/lib-es/components/Tabs/index.js.map +1 -1
- package/lib-es/index.js +12 -3
- 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/hoc/withContext.js +1 -1
- package/lib-es/utils/hoc/withContext.js.map +1 -1
- package/package.json +27 -22
- package/src/components/EntityManager/Entity/Entity.js +59 -77
- package/src/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
- package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +9 -7
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +64 -59
- package/src/components/EntityManager/EntityManager.js +52 -45
- package/src/components/InfoBoxes/container/InfoBoxContainer.js +3 -6
- package/src/components/InfoBoxes/hooks/useData.js +6 -1
- package/src/components/ListingTable/ListingTable.js +13 -21
- package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +38 -44
- package/src/components/ListingTable/SearchFilter/SearchContainer.js +411 -134
- package/src/components/ListingTable/SearchFilter/SearchFilter.js +5 -2
- package/src/components/ListingTable/SearchFilter/helpers.js +56 -8
- package/src/components/ListingTable/service/index.js +2 -3
- package/src/components/Tabs/index.js +17 -21
- package/src/index.js +11 -7
- package/src/utils/hoc/withContext.js +5 -4
- package/CHANGELOG.md +0 -1947
- package/babel.config.js +0 -3
- package/jest.config.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_HeaderPreviewButton","_interopRequireDefault","require","_default","exports","HeaderPreviewButton"],"sources":["../../../../../../src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js"],"sourcesContent":["import HeaderPreviewButton from './HeaderPreviewButton';\n\nexport default HeaderPreviewButton;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_HeaderPreviewButton","_interopRequireDefault","require","_default","exports","default","HeaderPreviewButton"],"sources":["../../../../../../src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js"],"sourcesContent":["import HeaderPreviewButton from './HeaderPreviewButton';\n\nexport default HeaderPreviewButton;\n"],"mappings":";;;;;;;AAAA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAwD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEzCC,4BAAmB","ignoreList":[]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
7
|
+
exports.default = void 0;
|
|
9
8
|
var _EntityHeader = _interopRequireDefault(require("./EntityHeader"));
|
|
10
|
-
var _default = exports
|
|
9
|
+
var _default = exports.default = _EntityHeader.default;
|
|
11
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_EntityHeader","_interopRequireDefault","require","_default","exports","EntityHeader"],"sources":["../../../../../src/components/EntityManager/Entity/EntityHeader/index.js"],"sourcesContent":["import EntityHeader from './EntityHeader';\n\nexport default EntityHeader;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_EntityHeader","_interopRequireDefault","require","_default","exports","default","EntityHeader"],"sources":["../../../../../src/components/EntityManager/Entity/EntityHeader/index.js"],"sourcesContent":["import EntityHeader from './EntityHeader';\n\nexport default EntityHeader;\n"],"mappings":";;;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE3BC,qBAAY","ignoreList":[]}
|
package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js
CHANGED
|
@@ -1,43 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
9
|
-
require("core-js/modules/es.array.flat-map.js");
|
|
10
|
-
require("core-js/modules/es.array.unscopables.flat-map.js");
|
|
11
|
-
require("core-js/modules/es.object.keys.js");
|
|
12
|
-
require("core-js/modules/es.object.to-string.js");
|
|
13
|
-
require("core-js/modules/es.object.values.js");
|
|
7
|
+
exports.default = void 0;
|
|
14
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
9
|
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
var
|
|
10
|
+
var _useCustomSidebarData = _interopRequireDefault(require("../hooks/useCustomSidebarData"));
|
|
17
11
|
var _CustomSidebarInfo = _interopRequireDefault(require("../presentational/CustomSidebarInfo"));
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var items = Object.values(data).flatMap(function (item) {
|
|
30
|
-
return Object.values(item);
|
|
12
|
+
const CustomSibebarInfoContainer = ({
|
|
13
|
+
id,
|
|
14
|
+
schema,
|
|
15
|
+
displayProperties
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
data
|
|
19
|
+
} = (0, _useCustomSidebarData.default)({
|
|
20
|
+
id,
|
|
21
|
+
schema,
|
|
22
|
+
displayProperties
|
|
31
23
|
});
|
|
32
|
-
|
|
24
|
+
if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;
|
|
25
|
+
const items = Object.values(data).flatMap(item => Object.values(item));
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_CustomSidebarInfo.default, {
|
|
33
27
|
items: items,
|
|
34
28
|
customSidebarInfoKey: displayProperties.key
|
|
35
29
|
});
|
|
36
30
|
};
|
|
37
|
-
var _default = exports
|
|
31
|
+
var _default = exports.default = CustomSibebarInfoContainer;
|
|
38
32
|
CustomSibebarInfoContainer.propTypes = {
|
|
39
|
-
id: _propTypes
|
|
40
|
-
displayProperties: _propTypes
|
|
41
|
-
schema: _propTypes
|
|
33
|
+
id: _propTypes.default.string.isRequired,
|
|
34
|
+
displayProperties: _propTypes.default.object.isRequired,
|
|
35
|
+
schema: _propTypes.default.object.isRequired
|
|
42
36
|
};
|
|
43
37
|
//# sourceMappingURL=CustomSidebarInfoContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomSidebarInfoContainer.js","names":["_propTypes","_interopRequireDefault","require","_react","
|
|
1
|
+
{"version":3,"file":"CustomSidebarInfoContainer.js","names":["_propTypes","_interopRequireDefault","require","_react","_useCustomSidebarData","_CustomSidebarInfo","CustomSibebarInfoContainer","id","schema","displayProperties","data","useCustomSidebarData","Object","keys","length","items","values","flatMap","item","default","createElement","customSidebarInfoKey","key","_default","exports","propTypes","PropTypes","string","isRequired","object"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport useCustomSidebarData from '../hooks/useCustomSidebarData';\nimport CustomSidebarInfo from '../presentational/CustomSidebarInfo';\n\nconst CustomSibebarInfoContainer = ({ id, schema, displayProperties }) => {\n const { data } = useCustomSidebarData({ id, schema, displayProperties });\n\n if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;\n\n const items = Object.values(data).flatMap(item => Object.values(item));\n\n return <CustomSidebarInfo items={items} customSidebarInfoKey={displayProperties.key} />;\n};\n\nexport default CustomSibebarInfoContainer;\n\nCustomSibebarInfoContainer.propTypes = {\n id: PropTypes.string.isRequired,\n displayProperties: PropTypes.object.isRequired,\n schema: PropTypes.object.isRequired\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,qBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,kBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,MAAMI,0BAA0B,GAAGA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAkB,CAAC,KAAK;EACxE,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,6BAAoB,EAAC;IAAEJ,EAAE;IAAEC,MAAM;IAAEC;EAAkB,CAAC,CAAC;EAExE,IAAI,CAACC,IAAI,IAAI,CAACE,MAAM,CAACC,IAAI,CAACH,IAAI,CAAC,IAAIE,MAAM,CAACC,IAAI,CAACH,IAAI,CAAC,CAACI,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAE9E,MAAMC,KAAK,GAAGH,MAAM,CAACI,MAAM,CAACN,IAAI,CAAC,CAACO,OAAO,CAACC,IAAI,IAAIN,MAAM,CAACI,MAAM,CAACE,IAAI,CAAC,CAAC;EAEtE,oBAAOf,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACf,kBAAA,CAAAc,OAAiB;IAACJ,KAAK,EAAEA,KAAM;IAACM,oBAAoB,EAAEZ,iBAAiB,CAACa;EAAI,CAAE,CAAC;AACzF,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAL,OAAA,GAEab,0BAA0B;AAEzCA,0BAA0B,CAACmB,SAAS,GAAG;EACrClB,EAAE,EAAEmB,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC/BnB,iBAAiB,EAAEiB,kBAAS,CAACG,MAAM,CAACD,UAAU;EAC9CpB,MAAM,EAAEkB,kBAAS,CAACG,MAAM,CAACD;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
-
require("core-js/modules/es.array.is-array.js");
|
|
11
|
-
require("core-js/modules/es.array.map.js");
|
|
6
|
+
exports.default = buildDynamicQuery;
|
|
12
7
|
var _client = require("@apollo/client");
|
|
13
8
|
var _coreErrors = require("@blaze-cms/core-errors");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
function buildDynamicQuery({
|
|
10
|
+
id,
|
|
11
|
+
schema,
|
|
12
|
+
displayProperties
|
|
13
|
+
}) {
|
|
19
14
|
if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
|
|
20
15
|
throw new _coreErrors.BlazeError('DataEntity query requires get action, properties and fields from entity schema');
|
|
21
16
|
}
|
|
22
17
|
if (displayProperties.adminMainInfoProperty && Array.isArray(displayProperties.adminMainInfoProperty)) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
const fields = displayProperties.adminMainInfoProperty.map(infoProperty => `${infoProperty} {
|
|
19
|
+
label
|
|
20
|
+
value
|
|
21
|
+
showLabel
|
|
22
|
+
tooltipIcon
|
|
23
|
+
tooltipContent
|
|
24
|
+
}`);
|
|
25
|
+
return (0, _client.gql)`query getInfoBoxData($id: String!){
|
|
26
|
+
${schema.actions.get}( id: $id ) {
|
|
27
|
+
id
|
|
28
|
+
${fields.map(field => field)}
|
|
29
|
+
__typename
|
|
30
|
+
}
|
|
31
|
+
}`;
|
|
29
32
|
}
|
|
30
33
|
return null;
|
|
31
34
|
}
|
package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-dynamic-query.js","names":["_client","require","_coreErrors","
|
|
1
|
+
{"version":3,"file":"build-dynamic-query.js","names":["_client","require","_coreErrors","buildDynamicQuery","id","schema","displayProperties","actions","get","properties","BlazeError","adminMainInfoProperty","Array","isArray","fields","map","infoProperty","gql","field"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/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, displayProperties }) {\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 if (\n displayProperties.adminMainInfoProperty &&\n Array.isArray(displayProperties.adminMainInfoProperty)\n ) {\n const fields = displayProperties.adminMainInfoProperty.map(\n infoProperty =>\n `${infoProperty} {\n label\n value\n showLabel\n tooltipIcon\n tooltipContent\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\n return null;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEe,SAASE,iBAAiBA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAkB,CAAC,EAAE;EAC3E,IAAI,CAACD,MAAM,IAAI,CAACA,MAAM,CAACE,OAAO,IAAI,CAACF,MAAM,CAACE,OAAO,CAACC,GAAG,IAAI,CAACH,MAAM,CAACI,UAAU,EAAE;IAC3E,MAAM,IAAIC,sBAAU,CAClB,gFACF,CAAC;EACH;EAEA,IACEJ,iBAAiB,CAACK,qBAAqB,IACvCC,KAAK,CAACC,OAAO,CAACP,iBAAiB,CAACK,qBAAqB,CAAC,EACtD;IACA,MAAMG,MAAM,GAAGR,iBAAiB,CAACK,qBAAqB,CAACI,GAAG,CACxDC,YAAY,IACV,GAAGA,YAAY;AACvB;AACA;AACA;AACA;AACA;AACA,QACI,CAAC;IAED,OAAO,IAAAC,WAAG;AACd,QAAQZ,MAAM,CAACE,OAAO,CAACC,GAAG;AAC1B;AACA,SAASM,MAAM,CAACC,GAAG,CAACG,KAAK,IAAIA,KAAK,CAAC;AACnC;AACA;AACA,MAAM;EACJ;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
|
|
@@ -1,54 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
-
require("core-js/modules/es.array.is-array.js");
|
|
7
|
+
exports.default = void 0;
|
|
11
8
|
var _react = require("react");
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
10
|
var _client = require("@apollo/client");
|
|
14
11
|
var _buildDynamicQuery = _interopRequireDefault(require("../../../../InfoBoxes/helpers/build-dynamic-query"));
|
|
15
12
|
var _RecordEditContext = require("../../../utils/RecordEditContext");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
externalUpdateTime
|
|
23
|
-
updated
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
const useCustomSidebarData = ({
|
|
14
|
+
id,
|
|
15
|
+
schema,
|
|
16
|
+
displayProperties
|
|
17
|
+
}) => {
|
|
18
|
+
const {
|
|
19
|
+
externalUpdateTime,
|
|
20
|
+
updated
|
|
21
|
+
} = (0, _react.useContext)(_RecordEditContext.RecordEditContext);
|
|
22
|
+
const query = displayProperties.adminMainInfoProperty && Array.isArray(displayProperties.adminMainInfoProperty) ? (0, _buildDynamicQuery.default)({
|
|
23
|
+
id,
|
|
24
|
+
schema,
|
|
27
25
|
properties: displayProperties.adminMainInfoProperty
|
|
28
26
|
}) : null;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
const customSidebarInfoQuery = query || (0, _client.gql)`
|
|
28
|
+
query {
|
|
29
|
+
__typename
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const {
|
|
33
|
+
data = {},
|
|
34
|
+
loading,
|
|
35
|
+
error,
|
|
36
|
+
refetch
|
|
37
|
+
} = (0, _client.useQuery)(customSidebarInfoQuery, {
|
|
38
|
+
variables: {
|
|
39
|
+
id
|
|
40
|
+
},
|
|
41
|
+
skip: !query
|
|
42
|
+
});
|
|
43
|
+
(0, _react.useEffect)(() => {
|
|
42
44
|
refetch();
|
|
43
45
|
}, [externalUpdateTime, updated, refetch]);
|
|
44
46
|
return {
|
|
45
47
|
data: data.__typename !== 'Query' ? data : null,
|
|
46
|
-
loading
|
|
47
|
-
error
|
|
48
|
+
loading,
|
|
49
|
+
error
|
|
48
50
|
};
|
|
49
51
|
};
|
|
50
|
-
var _default = exports
|
|
52
|
+
var _default = exports.default = useCustomSidebarData;
|
|
51
53
|
useCustomSidebarData.propTypes = {
|
|
52
|
-
displayProperties: _propTypes
|
|
54
|
+
displayProperties: _propTypes.default.object.isRequired
|
|
53
55
|
};
|
|
54
56
|
//# sourceMappingURL=useCustomSidebarData.js.map
|
package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCustomSidebarData.js","names":["_react","require","_propTypes","_interopRequireDefault","_client","_buildDynamicQuery","_RecordEditContext","
|
|
1
|
+
{"version":3,"file":"useCustomSidebarData.js","names":["_react","require","_propTypes","_interopRequireDefault","_client","_buildDynamicQuery","_RecordEditContext","useCustomSidebarData","id","schema","displayProperties","externalUpdateTime","updated","useContext","RecordEditContext","query","adminMainInfoProperty","Array","isArray","buildDynamicQuery","properties","customSidebarInfoQuery","gql","data","loading","error","refetch","useQuery","variables","skip","useEffect","__typename","_default","exports","default","propTypes","ProptTypes","object","isRequired"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js"],"sourcesContent":["import { useContext, useEffect } from 'react';\nimport ProptTypes from 'prop-types';\nimport { useQuery, gql } from '@apollo/client';\nimport buildDynamicQuery from '../../../../InfoBoxes/helpers/build-dynamic-query';\nimport { RecordEditContext } from '../../../utils/RecordEditContext';\n\nconst useCustomSidebarData = ({ id, schema, displayProperties }) => {\n const { externalUpdateTime, updated } = useContext(RecordEditContext);\n\n const query =\n displayProperties.adminMainInfoProperty &&\n Array.isArray(displayProperties.adminMainInfoProperty)\n ? buildDynamicQuery({ id, schema, properties: displayProperties.adminMainInfoProperty })\n : null;\n\n const customSidebarInfoQuery =\n query ||\n gql`\n query {\n __typename\n }\n `;\n\n const {\n data = {},\n loading,\n error,\n refetch\n } = useQuery(customSidebarInfoQuery, {\n variables: { id },\n skip: !query\n });\n\n useEffect(() => {\n refetch();\n }, [externalUpdateTime, updated, refetch]);\n\n return { data: data.__typename !== 'Query' ? data : null, loading, error };\n};\n\nexport default useCustomSidebarData;\n\nuseCustomSidebarData.propTypes = {\n displayProperties: ProptTypes.object.isRequired\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AAEA,MAAMM,oBAAoB,GAAGA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAkB,CAAC,KAAK;EAClE,MAAM;IAAEC,kBAAkB;IAAEC;EAAQ,CAAC,GAAG,IAAAC,iBAAU,EAACC,oCAAiB,CAAC;EAErE,MAAMC,KAAK,GACTL,iBAAiB,CAACM,qBAAqB,IACvCC,KAAK,CAACC,OAAO,CAACR,iBAAiB,CAACM,qBAAqB,CAAC,GAClD,IAAAG,0BAAiB,EAAC;IAAEX,EAAE;IAAEC,MAAM;IAAEW,UAAU,EAAEV,iBAAiB,CAACM;EAAsB,CAAC,CAAC,GACtF,IAAI;EAEV,MAAMK,sBAAsB,GAC1BN,KAAK,IACL,IAAAO,WAAG;AACP;AACA;AACA;AACA,KAAK;EAEH,MAAM;IACJC,IAAI,GAAG,CAAC,CAAC;IACTC,OAAO;IACPC,KAAK;IACLC;EACF,CAAC,GAAG,IAAAC,gBAAQ,EAACN,sBAAsB,EAAE;IACnCO,SAAS,EAAE;MAAEpB;IAAG,CAAC;IACjBqB,IAAI,EAAE,CAACd;EACT,CAAC,CAAC;EAEF,IAAAe,gBAAS,EAAC,MAAM;IACdJ,OAAO,CAAC,CAAC;EACX,CAAC,EAAE,CAACf,kBAAkB,EAAEC,OAAO,EAAEc,OAAO,CAAC,CAAC;EAE1C,OAAO;IAAEH,IAAI,EAAEA,IAAI,CAACQ,UAAU,KAAK,OAAO,GAAGR,IAAI,GAAG,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC;AAC5E,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa3B,oBAAoB;AAEnCA,oBAAoB,CAAC4B,SAAS,GAAG;EAC/BzB,iBAAiB,EAAE0B,kBAAU,CAACC,MAAM,CAACC;AACvC,CAAC","ignoreList":[]}
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
5
|
-
require("core-js/modules/es.weak-map.js");
|
|
6
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
7
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
8
4
|
Object.defineProperty(exports, "__esModule", {
|
|
9
5
|
value: true
|
|
10
6
|
});
|
|
11
|
-
exports
|
|
12
|
-
require("core-js/modules/es.array.filter.js");
|
|
13
|
-
require("core-js/modules/es.array.iterator.js");
|
|
14
|
-
require("core-js/modules/es.array.map.js");
|
|
15
|
-
require("core-js/modules/es.function.name.js");
|
|
16
|
-
require("core-js/modules/es.object.to-string.js");
|
|
17
|
-
require("core-js/modules/es.promise.js");
|
|
18
|
-
require("core-js/modules/es.string.iterator.js");
|
|
19
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
20
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
21
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
22
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
7
|
+
exports.default = void 0;
|
|
23
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
24
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
10
|
var _v = _interopRequireDefault(require("uuid/v1"));
|
|
11
|
+
var _accordion = _interopRequireDefault(require("@blaze-react/accordion"));
|
|
26
12
|
var _client = require("@apollo/client");
|
|
27
13
|
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
28
14
|
var _reactFormBuilder = require("@blaze-cms/react-form-builder");
|
|
@@ -31,177 +17,128 @@ var _versioningUi = require("@blaze-cms/versioning-ui");
|
|
|
31
17
|
var _constants = require("../../../../constants");
|
|
32
18
|
var _CustomSidebarInfoContainer = _interopRequireDefault(require("./container/CustomSidebarInfoContainer"));
|
|
33
19
|
var _EntitiyNavLinks = _interopRequireDefault(require("../EntitiyNavLinks"));
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
(0, _react.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
case 9:
|
|
87
|
-
case "end":
|
|
88
|
-
return _context.stop();
|
|
89
|
-
}
|
|
90
|
-
}, _callee);
|
|
91
|
-
}));
|
|
92
|
-
return function fetchRelationSchema(_x) {
|
|
93
|
-
return _ref4.apply(this, arguments);
|
|
94
|
-
};
|
|
95
|
-
}();
|
|
96
|
-
if (!(!relationsComponents && schema)) {
|
|
97
|
-
_context3.next = 6;
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
_context3.next = 4;
|
|
101
|
-
return Promise.all(schema.relations.filter(function (_ref5) {
|
|
102
|
-
var showInForm = _ref5.showInForm,
|
|
103
|
-
foreignKey = _ref5.foreignKey;
|
|
104
|
-
return showInForm && schema.properties[foreignKey];
|
|
105
|
-
}).map( /*#__PURE__*/function () {
|
|
106
|
-
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(relation) {
|
|
107
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
108
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
109
|
-
case 0:
|
|
110
|
-
_context2.t0 = (0, _v["default"])();
|
|
111
|
-
_context2.t1 = relation;
|
|
112
|
-
_context2.next = 4;
|
|
113
|
-
return fetchRelationSchema(relation);
|
|
114
|
-
case 4:
|
|
115
|
-
_context2.t2 = _context2.sent;
|
|
116
|
-
return _context2.abrupt("return", {
|
|
117
|
-
id: _context2.t0,
|
|
118
|
-
staticData: _context2.t1,
|
|
119
|
-
schema: _context2.t2
|
|
120
|
-
});
|
|
121
|
-
case 6:
|
|
122
|
-
case "end":
|
|
123
|
-
return _context2.stop();
|
|
124
|
-
}
|
|
125
|
-
}, _callee2);
|
|
126
|
-
}));
|
|
127
|
-
return function (_x2) {
|
|
128
|
-
return _ref6.apply(this, arguments);
|
|
129
|
-
};
|
|
130
|
-
}()));
|
|
131
|
-
case 4:
|
|
132
|
-
allRelationComponents = _context3.sent;
|
|
133
|
-
setRelationsComponents(allRelationComponents);
|
|
134
|
-
case 6:
|
|
135
|
-
case "end":
|
|
136
|
-
return _context3.stop();
|
|
137
|
-
}
|
|
138
|
-
}, _callee3);
|
|
139
|
-
}))();
|
|
20
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
21
|
+
const SideBarRelations = ({
|
|
22
|
+
schema,
|
|
23
|
+
onChange,
|
|
24
|
+
formData,
|
|
25
|
+
entity,
|
|
26
|
+
isOpen,
|
|
27
|
+
onToggle
|
|
28
|
+
}) => {
|
|
29
|
+
const {
|
|
30
|
+
relation: RelationComponent
|
|
31
|
+
} = _reactFormBuilder.formFieldTypes;
|
|
32
|
+
const {
|
|
33
|
+
formattedStatus,
|
|
34
|
+
formattedUpdated,
|
|
35
|
+
formattedCreated,
|
|
36
|
+
formattedPublished,
|
|
37
|
+
updatedBy,
|
|
38
|
+
status
|
|
39
|
+
} = formData;
|
|
40
|
+
const client = (0, _client.useApolloClient)();
|
|
41
|
+
const [relationsComponents, setRelationsComponents] = (0, _react.useState)(null);
|
|
42
|
+
(0, _react.useEffect)(() => {
|
|
43
|
+
(async () => {
|
|
44
|
+
const fetchRelationSchema = async ({
|
|
45
|
+
entityIdentifier
|
|
46
|
+
}) => {
|
|
47
|
+
if (!entityIdentifier) return null;
|
|
48
|
+
const {
|
|
49
|
+
data: {
|
|
50
|
+
getEntitySchemas: [relationSchema]
|
|
51
|
+
}
|
|
52
|
+
} = await client.query({
|
|
53
|
+
query: (0, _adminUiUtils.getQuery)('GET_ENTITY_SCHEMA'),
|
|
54
|
+
variables: {
|
|
55
|
+
identifier: entityIdentifier
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return relationSchema;
|
|
59
|
+
};
|
|
60
|
+
if (!relationsComponents && schema) {
|
|
61
|
+
const allRelationComponents = await Promise.all(schema.relations.filter(({
|
|
62
|
+
showInForm,
|
|
63
|
+
foreignKey
|
|
64
|
+
}) => showInForm && schema.properties[foreignKey]).map(async relation => ({
|
|
65
|
+
id: (0, _v.default)(),
|
|
66
|
+
staticData: relation,
|
|
67
|
+
schema: await fetchRelationSchema(relation)
|
|
68
|
+
})));
|
|
69
|
+
setRelationsComponents(allRelationComponents);
|
|
70
|
+
}
|
|
71
|
+
})();
|
|
140
72
|
}, [client, relationsComponents, schema, schema.relations]);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
73
|
+
const {
|
|
74
|
+
id: itemId
|
|
75
|
+
} = entity;
|
|
76
|
+
const {
|
|
77
|
+
identifier: itemEntity,
|
|
78
|
+
interfaces
|
|
79
|
+
} = schema;
|
|
80
|
+
const statusClassName = (0, _classnames.default)('sidebar__status__badge', {
|
|
145
81
|
'sidebar__status__badge--published': status === _constants.PUBLISHED,
|
|
146
82
|
'sidebar__status__badge--unpublished': status === _constants.UNPUBLISHED
|
|
147
83
|
});
|
|
148
|
-
return /*#__PURE__*/_react
|
|
149
|
-
className: (0, _classnames
|
|
84
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
85
|
+
className: (0, _classnames.default)('sidebar', {
|
|
150
86
|
'sidebar--collapsed': !isOpen
|
|
151
87
|
}),
|
|
152
88
|
"data-testid": "sideBarRelations-main-div"
|
|
153
|
-
}, /*#__PURE__*/_react
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
154
90
|
className: "sidebar__toggle-button",
|
|
155
91
|
onClick: onToggle,
|
|
156
92
|
role: "button",
|
|
157
93
|
"aria-label": isOpen ? 'Collapse sidebar' : 'Expand sidebar'
|
|
158
|
-
}, /*#__PURE__*/_react
|
|
94
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
159
95
|
className: "material-icons"
|
|
160
|
-
}, isOpen ? 'keyboard_arrow_right' : 'keyboard_arrow_left')), /*#__PURE__*/_react
|
|
96
|
+
}, isOpen ? 'keyboard_arrow_right' : 'keyboard_arrow_left')), /*#__PURE__*/_react.default.createElement("div", {
|
|
161
97
|
className: "sidebar__content"
|
|
162
|
-
}, /*#__PURE__*/_react
|
|
98
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
163
99
|
className: "sidebar__status"
|
|
164
|
-
}, formattedCreated && /*#__PURE__*/_react
|
|
100
|
+
}, formattedCreated && /*#__PURE__*/_react.default.createElement("div", {
|
|
165
101
|
className: "sidebar__top"
|
|
166
|
-
}, /*#__PURE__*/_react
|
|
102
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
167
103
|
className: "sidebar__status__wrapper"
|
|
168
|
-
}, /*#__PURE__*/_react
|
|
104
|
+
}, /*#__PURE__*/_react.default.createElement("b", null, "Status"), /*#__PURE__*/_react.default.createElement("span", {
|
|
169
105
|
className: statusClassName
|
|
170
|
-
}, formattedStatus)), formattedStatus === _constants.PUBLISHED && /*#__PURE__*/_react
|
|
106
|
+
}, formattedStatus)), formattedStatus === _constants.PUBLISHED && /*#__PURE__*/_react.default.createElement("p", null, formattedStatus, " on: ", /*#__PURE__*/_react.default.createElement("span", null, " ", formattedPublished))), !schema.displayProperties.disableDefaultAdminInfo && formattedCreated && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Created: ", /*#__PURE__*/_react.default.createElement("span", null, formattedCreated)), /*#__PURE__*/_react.default.createElement("p", null, "Updated: ", /*#__PURE__*/_react.default.createElement("span", null, formattedUpdated)), updatedBy && /*#__PURE__*/_react.default.createElement("p", null, "Updated by: ", /*#__PURE__*/_react.default.createElement("span", null, updatedBy.name))), /*#__PURE__*/_react.default.createElement(_CustomSidebarInfoContainer.default, {
|
|
171
107
|
id: itemId,
|
|
172
108
|
schema: schema,
|
|
173
109
|
displayProperties: schema.displayProperties
|
|
174
|
-
})), /*#__PURE__*/_react
|
|
110
|
+
})), /*#__PURE__*/_react.default.createElement(_versioningUi.VersionsList, {
|
|
175
111
|
itemEntity: itemEntity,
|
|
176
112
|
itemId: itemId,
|
|
177
113
|
interfaces: interfaces
|
|
178
|
-
}), /*#__PURE__*/_react
|
|
114
|
+
}), /*#__PURE__*/_react.default.createElement(_EntitiyNavLinks.default, {
|
|
179
115
|
schema: schema
|
|
180
|
-
}), relationsComponents &&
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
116
|
+
}), relationsComponents && /*#__PURE__*/_react.default.createElement(_accordion.default, {
|
|
117
|
+
isOpen: true
|
|
118
|
+
}, /*#__PURE__*/_react.default.createElement(_accordion.default.Header, null, /*#__PURE__*/_react.default.createElement("b", null, "Classification")), /*#__PURE__*/_react.default.createElement(_accordion.default.Content, null, /*#__PURE__*/_react.default.createElement(_accordion.default.ContentDetails, null, relationsComponents.map(({
|
|
119
|
+
id,
|
|
120
|
+
staticData,
|
|
121
|
+
schema: entitySchema
|
|
122
|
+
}) => /*#__PURE__*/_react.default.createElement(RelationComponent, {
|
|
123
|
+
formData: formData,
|
|
124
|
+
schema: entitySchema,
|
|
125
|
+
key: id,
|
|
126
|
+
staticData: staticData,
|
|
127
|
+
onSelect: onChange
|
|
128
|
+
})))))));
|
|
192
129
|
};
|
|
193
130
|
SideBarRelations.propTypes = {
|
|
194
|
-
schema: _propTypes
|
|
195
|
-
onChange: _propTypes
|
|
196
|
-
formData: _propTypes
|
|
197
|
-
entity: _propTypes
|
|
198
|
-
isOpen: _propTypes
|
|
199
|
-
onToggle: _propTypes
|
|
131
|
+
schema: _propTypes.default.object.isRequired,
|
|
132
|
+
onChange: _propTypes.default.func.isRequired,
|
|
133
|
+
formData: _propTypes.default.object.isRequired,
|
|
134
|
+
entity: _propTypes.default.object,
|
|
135
|
+
isOpen: _propTypes.default.bool,
|
|
136
|
+
onToggle: _propTypes.default.func
|
|
200
137
|
};
|
|
201
138
|
SideBarRelations.defaultProps = {
|
|
202
139
|
entity: {},
|
|
203
140
|
isOpen: true,
|
|
204
|
-
onToggle:
|
|
141
|
+
onToggle: () => {}
|
|
205
142
|
};
|
|
206
|
-
var _default = exports
|
|
143
|
+
var _default = exports.default = SideBarRelations;
|
|
207
144
|
//# sourceMappingURL=index.js.map
|