@blaze-cms/plugin-data-ui 0.134.0-project-admin-customisations.0 → 0.134.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 +4 -33
- 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 +17 -32
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +7 -23
- 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 +17 -32
- package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +8 -24
- 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 +57 -68
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +19 -51
- 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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomSidebarInfoContainer.js","names":["_propTypes","_interopRequireDefault","require","_react","_useCustomSidebarData2","_CustomSidebarInfo","CustomSibebarInfoContainer","_ref","id","schema","displayProperties","_useCustomSidebarData","useCustomSidebarData","data","Object","keys","length","items","values","flatMap","item","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,sBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,kBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAMI,0BAA0B,GAAG,SAA7BA,0BAA0BA,CAAAC,IAAA,EAA0C;EAAA,IAApCC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,iBAAiB,GAAAH,IAAA,CAAjBG,iBAAiB;EACjE,IAAAC,qBAAA,GAAiB,IAAAC,iCAAoB,EAAC;MAAEJ,EAAE,EAAFA,EAAE;MAAEC,MAAM,EAANA,MAAM;MAAEC,iBAAiB,EAAjBA;IAAkB,CAAC,CAAC;IAAhEG,IAAI,GAAAF,qBAAA,CAAJE,IAAI;EAEZ,IAAI,CAACA,IAAI,IAAI,CAACC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,CAACG,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAE9E,IAAMC,KAAK,GAAGH,MAAM,CAACI,MAAM,CAACL,IAAI,CAAC,CAACM,OAAO,CAAC,UAAAC,IAAI;IAAA,OAAIN,MAAM,CAACI,MAAM,CAACE,IAAI,CAAC;EAAA,EAAC;EAEtE,oBAAOjB,MAAA,YAAAkB,aAAA,CAAChB,kBAAA,WAAiB;IAACY,KAAK,EAAEA,KAAM;IAACK,oBAAoB,EAAEZ,iBAAiB,CAACa;EAAI,CAAE,CAAC;AACzF,CAAC;AAAC,IAAAC,QAAA,GAEalB,0BAA0B;AAAAmB,OAAA,cAAAD,QAAA;AAEzClB,0BAA0B,CAACoB,SAAS,GAAG;EACrClB,EAAE,EAAEmB,qBAAS,CAACC,MAAM,CAACC,UAAU;EAC/BnB,iBAAiB,EAAEiB,qBAAS,CAACG,MAAM,CAACD,UAAU;EAC9CpB,MAAM,EAAEkB,qBAAS,CAACG,MAAM,CAACD;AAC3B,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = buildDynamicQuery;
|
|
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");
|
|
12
|
-
var _client = require("@apollo/client");
|
|
13
|
-
var _coreErrors = require("@blaze-cms/core-errors");
|
|
14
|
-
var _templateObject;
|
|
15
|
-
function buildDynamicQuery(_ref) {
|
|
16
|
-
var id = _ref.id,
|
|
17
|
-
schema = _ref.schema,
|
|
18
|
-
displayProperties = _ref.displayProperties;
|
|
19
|
-
if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
|
|
20
|
-
throw new _coreErrors.BlazeError('DataEntity query requires get action, properties and fields from entity schema');
|
|
21
|
-
}
|
|
22
|
-
if (displayProperties.adminMainInfoProperty && Array.isArray(displayProperties.adminMainInfoProperty)) {
|
|
23
|
-
var fields = displayProperties.adminMainInfoProperty.map(function (infoProperty) {
|
|
24
|
-
return "".concat(infoProperty, " {\n label\n value\n }");
|
|
25
|
-
});
|
|
26
|
-
return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["query getInfoBoxData($id: String!){\n ", "( id: $id ) {\n id\n ", "\n __typename\n }\n }"])), schema.actions.get, fields.map(function (field) {
|
|
27
|
-
return field;
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=build-dynamic-query.js.map
|
package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-dynamic-query.js","names":["_client","require","_coreErrors","_templateObject","buildDynamicQuery","_ref","id","schema","displayProperties","actions","get","properties","BlazeError","adminMainInfoProperty","Array","isArray","fields","map","infoProperty","concat","gql","_taggedTemplateLiteral2","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 }`\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;AAAoD,IAAAE,eAAA;AAErC,SAASC,iBAAiBA,CAAAC,IAAA,EAAoC;EAAA,IAAjCC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,iBAAiB,GAAAH,IAAA,CAAjBG,iBAAiB;EACvE,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,IAAMG,MAAM,GAAGR,iBAAiB,CAACK,qBAAqB,CAACI,GAAG,CACxD,UAAAC,YAAY;MAAA,UAAAC,MAAA,CACPD,YAAY;IAAA,CAInB,CAAC;IAED,WAAOE,WAAG,EAAAjB,eAAA,KAAAA,eAAA,OAAAkB,uBAAA,6IACNd,MAAM,CAACE,OAAO,CAACC,GAAG,EAEjBM,MAAM,CAACC,GAAG,CAAC,UAAAK,KAAK;MAAA,OAAIA,KAAK;IAAA,EAAC;EAIjC;EAEA,OAAO,IAAI;AACb"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var _client = require("@apollo/client");
|
|
12
|
-
var _buildDynamicQuery = _interopRequireDefault(require("../helpers/build-dynamic-query"));
|
|
13
|
-
var _templateObject;
|
|
14
|
-
var useCustomSidebarData = function useCustomSidebarData(_ref) {
|
|
15
|
-
var id = _ref.id,
|
|
16
|
-
schema = _ref.schema,
|
|
17
|
-
displayProperties = _ref.displayProperties;
|
|
18
|
-
var query = (0, _buildDynamicQuery["default"])({
|
|
19
|
-
id: id,
|
|
20
|
-
schema: schema,
|
|
21
|
-
displayProperties: displayProperties
|
|
22
|
-
});
|
|
23
|
-
var customSidebarInfoQuery = query || (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n query {\n __typename\n }\n "])));
|
|
24
|
-
var _useQuery = (0, _client.useQuery)(customSidebarInfoQuery, {
|
|
25
|
-
variables: {
|
|
26
|
-
id: id
|
|
27
|
-
},
|
|
28
|
-
skip: !query
|
|
29
|
-
}),
|
|
30
|
-
_useQuery$data = _useQuery.data,
|
|
31
|
-
data = _useQuery$data === void 0 ? {} : _useQuery$data,
|
|
32
|
-
loading = _useQuery.loading,
|
|
33
|
-
error = _useQuery.error;
|
|
34
|
-
return {
|
|
35
|
-
data: data.__typename !== 'Query' ? data : null,
|
|
36
|
-
loading: loading,
|
|
37
|
-
error: error
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
var _default = useCustomSidebarData;
|
|
41
|
-
exports["default"] = _default;
|
|
42
|
-
useCustomSidebarData.propTypes = {
|
|
43
|
-
displayProperties: _propTypes["default"].object.isRequired
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=useCustomSidebarData.js.map
|
package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCustomSidebarData.js","names":["_propTypes","_interopRequireDefault","require","_client","_buildDynamicQuery","_templateObject","useCustomSidebarData","_ref","id","schema","displayProperties","query","buildDynamicQuery","customSidebarInfoQuery","gql","_taggedTemplateLiteral2","_useQuery","useQuery","variables","skip","_useQuery$data","data","loading","error","__typename","_default","exports","propTypes","ProptTypes","object","isRequired"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js"],"sourcesContent":["import ProptTypes from 'prop-types';\nimport { useQuery, gql } from '@apollo/client';\nimport buildDynamicQuery from '../helpers/build-dynamic-query';\n\nconst useCustomSidebarData = ({ id, schema, displayProperties }) => {\n const query = buildDynamicQuery({ id, schema, displayProperties });\n\n const customSidebarInfoQuery =\n query ||\n gql`\n query {\n __typename\n }\n `;\n\n const { data = {}, loading, error } = useQuery(customSidebarInfoQuery, {\n variables: { id },\n skip: !query\n });\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,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA+D,IAAAG,eAAA;AAE/D,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAA0C;EAAA,IAApCC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,iBAAiB,GAAAH,IAAA,CAAjBG,iBAAiB;EAC3D,IAAMC,KAAK,GAAG,IAAAC,6BAAiB,EAAC;IAAEJ,EAAE,EAAFA,EAAE;IAAEC,MAAM,EAANA,MAAM;IAAEC,iBAAiB,EAAjBA;EAAkB,CAAC,CAAC;EAElE,IAAMG,sBAAsB,GAC1BF,KAAK,QACLG,WAAG,EAAAT,eAAA,KAAAA,eAAA,OAAAU,uBAAA,sEAIF;EAEH,IAAAC,SAAA,GAAsC,IAAAC,gBAAQ,EAACJ,sBAAsB,EAAE;MACrEK,SAAS,EAAE;QAAEV,EAAE,EAAFA;MAAG,CAAC;MACjBW,IAAI,EAAE,CAACR;IACT,CAAC,CAAC;IAAAS,cAAA,GAAAJ,SAAA,CAHMK,IAAI;IAAJA,IAAI,GAAAD,cAAA,cAAG,CAAC,CAAC,GAAAA,cAAA;IAAEE,OAAO,GAAAN,SAAA,CAAPM,OAAO;IAAEC,KAAK,GAAAP,SAAA,CAALO,KAAK;EAKjC,OAAO;IAAEF,IAAI,EAAEA,IAAI,CAACG,UAAU,KAAK,OAAO,GAAGH,IAAI,GAAG,IAAI;IAAEC,OAAO,EAAPA,OAAO;IAAEC,KAAK,EAALA;EAAM,CAAC;AAC5E,CAAC;AAAC,IAAAE,QAAA,GAEanB,oBAAoB;AAAAoB,OAAA,cAAAD,QAAA;AAEnCnB,oBAAoB,CAACqB,SAAS,GAAG;EAC/BjB,iBAAiB,EAAEkB,qBAAU,CAACC,MAAM,CAACC;AACvC,CAAC"}
|
package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
require("core-js/modules/es.array.map.js");
|
|
10
|
-
require("core-js/modules/es.array.filter.js");
|
|
11
|
-
require("core-js/modules/es.object.to-string.js");
|
|
12
|
-
require("core-js/modules/es.object.values.js");
|
|
13
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
var CustomSidebarInfo = function CustomSidebarInfo(_ref) {
|
|
16
|
-
var items = _ref.items,
|
|
17
|
-
customSidebarInfoKey = _ref.customSidebarInfoKey;
|
|
18
|
-
if (!items) return null;
|
|
19
|
-
var customSidebarInfoItems = items.map(function (item) {
|
|
20
|
-
return Object.values(item).map(function (info) {
|
|
21
|
-
if (!info.label || !info.value) return null;
|
|
22
|
-
return /*#__PURE__*/_react["default"].createElement("p", null, info.label, ": ", /*#__PURE__*/_react["default"].createElement("span", null, info.value));
|
|
23
|
-
}).filter(Boolean);
|
|
24
|
-
});
|
|
25
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
26
|
-
className: "custom-sidebar-info",
|
|
27
|
-
key: customSidebarInfoKey
|
|
28
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
29
|
-
className: "custom-sidebar-info--container"
|
|
30
|
-
}, customSidebarInfoItems));
|
|
31
|
-
};
|
|
32
|
-
var _default = CustomSidebarInfo;
|
|
33
|
-
exports["default"] = _default;
|
|
34
|
-
CustomSidebarInfo.propTypes = {
|
|
35
|
-
customSidebarInfoKey: _propTypes["default"].string.isRequired,
|
|
36
|
-
items: _propTypes["default"].array.isRequired
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=CustomSidebarInfo.js.map
|
package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomSidebarInfo.js","names":["_propTypes","_interopRequireDefault","require","_react","CustomSidebarInfo","_ref","items","customSidebarInfoKey","customSidebarInfoItems","map","item","Object","values","info","label","value","createElement","filter","Boolean","className","key","_default","exports","propTypes","PropTypes","string","isRequired","array"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nconst CustomSidebarInfo = ({ items, customSidebarInfoKey }) => {\n if (!items) return null;\n\n const customSidebarInfoItems = items.map(item =>\n Object.values(item)\n .map(info => {\n if (!info.label || !info.value) return null;\n\n return (\n <p>\n {info.label}: <span>{info.value}</span>\n </p>\n );\n })\n .filter(Boolean)\n );\n\n return (\n <div className=\"custom-sidebar-info\" key={customSidebarInfoKey}>\n <div className=\"custom-sidebar-info--container\">{customSidebarInfoItems}</div>\n </div>\n );\n};\n\nexport default CustomSidebarInfo;\n\nCustomSidebarInfo.propTypes = {\n customSidebarInfoKey: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired\n};\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAME,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAAwC;EAAA,IAAlCC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,oBAAoB,GAAAF,IAAA,CAApBE,oBAAoB;EACtD,IAAI,CAACD,KAAK,EAAE,OAAO,IAAI;EAEvB,IAAME,sBAAsB,GAAGF,KAAK,CAACG,GAAG,CAAC,UAAAC,IAAI;IAAA,OAC3CC,MAAM,CAACC,MAAM,CAACF,IAAI,CAAC,CAChBD,GAAG,CAAC,UAAAI,IAAI,EAAI;MACX,IAAI,CAACA,IAAI,CAACC,KAAK,IAAI,CAACD,IAAI,CAACE,KAAK,EAAE,OAAO,IAAI;MAE3C,oBACEZ,MAAA,YAAAa,aAAA,YACGH,IAAI,CAACC,KAAK,EAAC,IAAE,eAAAX,MAAA,YAAAa,aAAA,eAAOH,IAAI,CAACE,KAAY,CACrC,CAAC;IAER,CAAC,CAAC,CACDE,MAAM,CAACC,OAAO,CAAC;EAAA,CACpB,CAAC;EAED,oBACEf,MAAA,YAAAa,aAAA;IAAKG,SAAS,EAAC,qBAAqB;IAACC,GAAG,EAAEb;EAAqB,gBAC7DJ,MAAA,YAAAa,aAAA;IAAKG,SAAS,EAAC;EAAgC,GAAEX,sBAA4B,CAC1E,CAAC;AAEV,CAAC;AAAC,IAAAa,QAAA,GAEajB,iBAAiB;AAAAkB,OAAA,cAAAD,QAAA;AAEhCjB,iBAAiB,CAACmB,SAAS,GAAG;EAC5BhB,oBAAoB,EAAEiB,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjDpB,KAAK,EAAEkB,qBAAS,CAACG,KAAK,CAACD;AACzB,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
require("core-js/modules/es.array.map.js");
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
var _InfoBoxContainer = _interopRequireDefault(require("./container/InfoBoxContainer"));
|
|
13
|
-
var InfoBoxes = function InfoBoxes(_ref) {
|
|
14
|
-
var id = _ref.id,
|
|
15
|
-
schema = _ref.schema;
|
|
16
|
-
var _schema$displayProper = schema.displayProperties.adminInfoBoxes,
|
|
17
|
-
adminInfoBoxes = _schema$displayProper === void 0 ? [] : _schema$displayProper;
|
|
18
|
-
if (adminInfoBoxes.length <= 0) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
return adminInfoBoxes.map(function (infoBox) {
|
|
22
|
-
return /*#__PURE__*/_react["default"].createElement(_InfoBoxContainer["default"], {
|
|
23
|
-
id: id,
|
|
24
|
-
schema: schema,
|
|
25
|
-
key: infoBox.key,
|
|
26
|
-
infoBox: infoBox
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
var _default = InfoBoxes;
|
|
31
|
-
exports["default"] = _default;
|
|
32
|
-
InfoBoxes.propTypes = {
|
|
33
|
-
id: _propTypes["default"].string.isRequired,
|
|
34
|
-
schema: _propTypes["default"].object.isRequired
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=InfoBoxes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InfoBoxes.js","names":["_propTypes","_interopRequireDefault","require","_react","_InfoBoxContainer","InfoBoxes","_ref","id","schema","_schema$displayProper","displayProperties","adminInfoBoxes","length","map","infoBox","createElement","key","_default","exports","propTypes","PropTypes","string","isRequired","object"],"sources":["../../../src/components/InfoBoxes/InfoBoxes.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport InfoBoxContainer from './container/InfoBoxContainer';\n\nconst InfoBoxes = ({ id, schema }) => {\n const {\n displayProperties: { adminInfoBoxes = [] }\n } = schema;\n\n if (adminInfoBoxes.length <= 0) {\n return null;\n }\n\n return adminInfoBoxes.map(infoBox => (\n <InfoBoxContainer id={id} schema={schema} key={infoBox.key} infoBox={infoBox} />\n ));\n};\n\nexport default InfoBoxes;\n\nInfoBoxes.propTypes = {\n id: PropTypes.string.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,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAMG,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAAuB;EAAA,IAAjBC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;EAC7B,IAAAC,qBAAA,GAEID,MAAM,CADRE,iBAAiB,CAAIC,cAAc;IAAdA,cAAc,GAAAF,qBAAA,cAAG,EAAE,GAAAA,qBAAA;EAG1C,IAAIE,cAAc,CAACC,MAAM,IAAI,CAAC,EAAE;IAC9B,OAAO,IAAI;EACb;EAEA,OAAOD,cAAc,CAACE,GAAG,CAAC,UAAAC,OAAO;IAAA,oBAC/BX,MAAA,YAAAY,aAAA,CAACX,iBAAA,WAAgB;MAACG,EAAE,EAAEA,EAAG;MAACC,MAAM,EAAEA,MAAO;MAACQ,GAAG,EAAEF,OAAO,CAACE,GAAI;MAACF,OAAO,EAAEA;IAAQ,CAAE,CAAC;EAAA,CACjF,CAAC;AACJ,CAAC;AAAC,IAAAG,QAAA,GAEaZ,SAAS;AAAAa,OAAA,cAAAD,QAAA;AAExBZ,SAAS,CAACc,SAAS,GAAG;EACpBZ,EAAE,EAAEa,qBAAS,CAACC,MAAM,CAACC,UAAU;EAC/Bd,MAAM,EAAEY,qBAAS,CAACG,MAAM,CAACD;AAC3B,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
require("core-js/modules/es.object.keys.js");
|
|
10
|
-
require("core-js/modules/es.array.flat-map.js");
|
|
11
|
-
require("core-js/modules/es.array.unscopables.flat-map.js");
|
|
12
|
-
require("core-js/modules/es.object.to-string.js");
|
|
13
|
-
require("core-js/modules/es.object.values.js");
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
var _useData2 = _interopRequireDefault(require("../hooks/useData"));
|
|
17
|
-
var _InfoBox = _interopRequireDefault(require("../presentational/InfoBox"));
|
|
18
|
-
var InfoBoxContainer = function InfoBoxContainer(_ref) {
|
|
19
|
-
var id = _ref.id,
|
|
20
|
-
schema = _ref.schema,
|
|
21
|
-
infoBox = _ref.infoBox;
|
|
22
|
-
var _useData = (0, _useData2["default"])({
|
|
23
|
-
id: id,
|
|
24
|
-
schema: schema,
|
|
25
|
-
infoBox: infoBox
|
|
26
|
-
}),
|
|
27
|
-
data = _useData.data;
|
|
28
|
-
if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;
|
|
29
|
-
var items = Object.values(data).flatMap(function (item) {
|
|
30
|
-
return Object.values(item);
|
|
31
|
-
});
|
|
32
|
-
return /*#__PURE__*/_react["default"].createElement(_InfoBox["default"], {
|
|
33
|
-
items: items,
|
|
34
|
-
infoBoxKey: infoBox.key
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
var _default = InfoBoxContainer;
|
|
38
|
-
exports["default"] = _default;
|
|
39
|
-
InfoBoxContainer.propTypes = {
|
|
40
|
-
id: _propTypes["default"].string.isRequired,
|
|
41
|
-
infoBox: _propTypes["default"].object.isRequired,
|
|
42
|
-
schema: _propTypes["default"].object.isRequired
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=InfoBoxContainer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InfoBoxContainer.js","names":["_propTypes","_interopRequireDefault","require","_react","_useData2","_InfoBox","InfoBoxContainer","_ref","id","schema","infoBox","_useData","useData","data","Object","keys","length","items","values","flatMap","item","createElement","infoBoxKey","key","_default","exports","propTypes","PropTypes","string","isRequired","object"],"sources":["../../../../src/components/InfoBoxes/container/InfoBoxContainer.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport useData from '../hooks/useData';\nimport InfoBox from '../presentational/InfoBox';\n\nconst InfoBoxContainer = ({ id, schema, infoBox }) => {\n const { data } = useData({ id, schema, infoBox });\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 <InfoBox items={items} infoBoxKey={infoBox.key} />;\n};\n\nexport default InfoBoxContainer;\n\nInfoBoxContainer.propTypes = {\n id: PropTypes.string.isRequired,\n infoBox: 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,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAMI,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAAgC;EAAA,IAA1BC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;EAC7C,IAAAC,QAAA,GAAiB,IAAAC,oBAAO,EAAC;MAAEJ,EAAE,EAAFA,EAAE;MAAEC,MAAM,EAANA,MAAM;MAAEC,OAAO,EAAPA;IAAQ,CAAC,CAAC;IAAzCG,IAAI,GAAAF,QAAA,CAAJE,IAAI;EAEZ,IAAI,CAACA,IAAI,IAAI,CAACC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,CAACG,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAE9E,IAAMC,KAAK,GAAGH,MAAM,CAACI,MAAM,CAACL,IAAI,CAAC,CAACM,OAAO,CAAC,UAAAC,IAAI;IAAA,OAAIN,MAAM,CAACI,MAAM,CAACE,IAAI,CAAC;EAAA,EAAC;EAEtE,oBAAOjB,MAAA,YAAAkB,aAAA,CAAChB,QAAA,WAAO;IAACY,KAAK,EAAEA,KAAM;IAACK,UAAU,EAAEZ,OAAO,CAACa;EAAI,CAAE,CAAC;AAC3D,CAAC;AAAC,IAAAC,QAAA,GAEalB,gBAAgB;AAAAmB,OAAA,cAAAD,QAAA;AAE/BlB,gBAAgB,CAACoB,SAAS,GAAG;EAC3BlB,EAAE,EAAEmB,qBAAS,CAACC,MAAM,CAACC,UAAU;EAC/BnB,OAAO,EAAEiB,qBAAS,CAACG,MAAM,CAACD,UAAU;EACpCpB,MAAM,EAAEkB,qBAAS,CAACG,MAAM,CAACD;AAC3B,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = buildDynamicQuery;
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
-
var _client = require("@apollo/client");
|
|
11
|
-
var _coreErrors = require("@blaze-cms/core-errors");
|
|
12
|
-
var _templateObject;
|
|
13
|
-
function buildDynamicQuery(_ref) {
|
|
14
|
-
var id = _ref.id,
|
|
15
|
-
schema = _ref.schema,
|
|
16
|
-
infoBox = _ref.infoBox;
|
|
17
|
-
if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
|
|
18
|
-
throw new _coreErrors.BlazeError('DataEntity query requires get action, properties and fields from entity schema');
|
|
19
|
-
}
|
|
20
|
-
var fields = "".concat(infoBox.property, " {\n label\n value\n }");
|
|
21
|
-
return {
|
|
22
|
-
query: (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["query getInfoBoxData($id: String!){\n ", "( id: $id ) {\n id\n ", "\n __typename\n }\n }"])), schema.actions.get, fields)
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=build-dynamic-query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-dynamic-query.js","names":["_client","require","_coreErrors","_templateObject","buildDynamicQuery","_ref","id","schema","infoBox","actions","get","properties","BlazeError","fields","concat","property","query","gql","_taggedTemplateLiteral2"],"sources":["../../../../src/components/InfoBoxes/helpers/build-dynamic-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nexport default function buildDynamicQuery({ id, schema, infoBox }) {\n if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {\n throw new BlazeError(\n 'DataEntity query requires get action, properties and fields from entity schema'\n );\n }\n\n const fields = `${infoBox.property} {\n label\n value\n }`;\n\n return {\n query: gql`query getInfoBoxData($id: String!){\n ${schema.actions.get}( id: $id ) {\n id\n ${fields}\n __typename\n }\n }`\n };\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAoD,IAAAE,eAAA;AAErC,SAASC,iBAAiBA,CAAAC,IAAA,EAA0B;EAAA,IAAvBC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;EAC7D,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,IAAMC,MAAM,MAAAC,MAAA,CAAMN,OAAO,CAACO,QAAQ,wCAG9B;EAEJ,OAAO;IACLC,KAAK,MAAEC,WAAG,EAAAd,eAAA,KAAAA,eAAA,OAAAe,uBAAA,iIACRX,MAAM,CAACE,OAAO,CAACC,GAAG,EAEjBG,MAAM;EAIX,CAAC;AACH"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
-
var _client = require("@apollo/client");
|
|
11
|
-
var _useInfoBox = _interopRequireDefault(require("./useInfoBox"));
|
|
12
|
-
var _templateObject;
|
|
13
|
-
function useData(_ref) {
|
|
14
|
-
var id = _ref.id,
|
|
15
|
-
schema = _ref.schema,
|
|
16
|
-
infoBox = _ref.infoBox;
|
|
17
|
-
var _useInfoBoxData = (0, _useInfoBox["default"])({
|
|
18
|
-
id: id,
|
|
19
|
-
schema: schema,
|
|
20
|
-
infoBox: infoBox
|
|
21
|
-
}),
|
|
22
|
-
query = _useInfoBoxData.query;
|
|
23
|
-
var infoBoxQuery = query || (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n query {\n __typename\n }\n "])));
|
|
24
|
-
var _useQuery = (0, _client.useQuery)(infoBoxQuery, {
|
|
25
|
-
variables: {
|
|
26
|
-
id: id
|
|
27
|
-
},
|
|
28
|
-
skip: !query
|
|
29
|
-
}),
|
|
30
|
-
_useQuery$data = _useQuery.data,
|
|
31
|
-
data = _useQuery$data === void 0 ? {} : _useQuery$data,
|
|
32
|
-
loading = _useQuery.loading,
|
|
33
|
-
error = _useQuery.error;
|
|
34
|
-
return {
|
|
35
|
-
data: data.__typename !== 'Query' ? data : null,
|
|
36
|
-
loading: loading,
|
|
37
|
-
error: error
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
var _default = useData;
|
|
41
|
-
exports["default"] = _default;
|
|
42
|
-
//# sourceMappingURL=useData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useData.js","names":["_client","require","_useInfoBox","_interopRequireDefault","_templateObject","useData","_ref","id","schema","infoBox","_useInfoBoxData","useInfoBoxData","query","infoBoxQuery","gql","_taggedTemplateLiteral2","_useQuery","useQuery","variables","skip","_useQuery$data","data","loading","error","__typename","_default","exports"],"sources":["../../../../src/components/InfoBoxes/hooks/useData.js"],"sourcesContent":["import { useQuery, gql } from '@apollo/client';\nimport useInfoBoxData from './useInfoBox';\n\nfunction useData({ id, schema, infoBox }) {\n const { query } = useInfoBoxData({ id, schema, infoBox });\n\n const infoBoxQuery =\n query ||\n gql`\n query {\n __typename\n }\n `;\n\n const { data = {}, loading, error } = useQuery(infoBoxQuery, { variables: { id }, skip: !query });\n\n return { data: data.__typename !== 'Query' ? data : null, loading, error };\n}\n\nexport default useData;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA0C,IAAAG,eAAA;AAE1C,SAASC,OAAOA,CAAAC,IAAA,EAA0B;EAAA,IAAvBC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;EACpC,IAAAC,eAAA,GAAkB,IAAAC,sBAAc,EAAC;MAAEJ,EAAE,EAAFA,EAAE;MAAEC,MAAM,EAANA,MAAM;MAAEC,OAAO,EAAPA;IAAQ,CAAC,CAAC;IAAjDG,KAAK,GAAAF,eAAA,CAALE,KAAK;EAEb,IAAMC,YAAY,GAChBD,KAAK,QACLE,WAAG,EAAAV,eAAA,KAAAA,eAAA,OAAAW,uBAAA,sEAIF;EAEH,IAAAC,SAAA,GAAsC,IAAAC,gBAAQ,EAACJ,YAAY,EAAE;MAAEK,SAAS,EAAE;QAAEX,EAAE,EAAFA;MAAG,CAAC;MAAEY,IAAI,EAAE,CAACP;IAAM,CAAC,CAAC;IAAAQ,cAAA,GAAAJ,SAAA,CAAzFK,IAAI;IAAJA,IAAI,GAAAD,cAAA,cAAG,CAAC,CAAC,GAAAA,cAAA;IAAEE,OAAO,GAAAN,SAAA,CAAPM,OAAO;IAAEC,KAAK,GAAAP,SAAA,CAALO,KAAK;EAEjC,OAAO;IAAEF,IAAI,EAAEA,IAAI,CAACG,UAAU,KAAK,OAAO,GAAGH,IAAI,GAAG,IAAI;IAAEC,OAAO,EAAPA,OAAO;IAAEC,KAAK,EAALA;EAAM,CAAC;AAC5E;AAAC,IAAAE,QAAA,GAEcpB,OAAO;AAAAqB,OAAA,cAAAD,QAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _buildDynamicQuery2 = _interopRequireDefault(require("../helpers/build-dynamic-query"));
|
|
10
|
-
function useInfoBox(_ref) {
|
|
11
|
-
var id = _ref.id,
|
|
12
|
-
schema = _ref.schema,
|
|
13
|
-
infoBox = _ref.infoBox;
|
|
14
|
-
var _buildDynamicQuery = (0, _buildDynamicQuery2["default"])({
|
|
15
|
-
id: id,
|
|
16
|
-
schema: schema,
|
|
17
|
-
infoBox: infoBox
|
|
18
|
-
}),
|
|
19
|
-
query = _buildDynamicQuery.query;
|
|
20
|
-
return {
|
|
21
|
-
query: query || null
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
var _default = useInfoBox;
|
|
25
|
-
exports["default"] = _default;
|
|
26
|
-
//# sourceMappingURL=useInfoBox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInfoBox.js","names":["_buildDynamicQuery2","_interopRequireDefault","require","useInfoBox","_ref","id","schema","infoBox","_buildDynamicQuery","buildDynamicQuery","query","_default","exports"],"sources":["../../../../src/components/InfoBoxes/hooks/useInfoBox.js"],"sourcesContent":["import buildDynamicQuery from '../helpers/build-dynamic-query';\n\nfunction useInfoBox({ id, schema, infoBox }) {\n const { query } = buildDynamicQuery({\n id,\n schema,\n infoBox\n });\n\n return { query: query || null };\n}\n\nexport default useInfoBox;\n"],"mappings":";;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,SAASC,UAAUA,CAAAC,IAAA,EAA0B;EAAA,IAAvBC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;EACvC,IAAAC,kBAAA,GAAkB,IAAAC,8BAAiB,EAAC;MAClCJ,EAAE,EAAFA,EAAE;MACFC,MAAM,EAANA,MAAM;MACNC,OAAO,EAAPA;IACF,CAAC,CAAC;IAJMG,KAAK,GAAAF,kBAAA,CAALE,KAAK;EAMb,OAAO;IAAEA,KAAK,EAAEA,KAAK,IAAI;EAAK,CAAC;AACjC;AAAC,IAAAC,QAAA,GAEcR,UAAU;AAAAS,OAAA,cAAAD,QAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _InfoBoxes = _interopRequireDefault(require("./InfoBoxes"));
|
|
10
|
-
var _default = _InfoBoxes["default"];
|
|
11
|
-
exports["default"] = _default;
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_InfoBoxes","_interopRequireDefault","require","_default","InfoBoxes","exports"],"sources":["../../../src/components/InfoBoxes/index.js"],"sourcesContent":["import InfoBoxes from './InfoBoxes';\n\nexport default InfoBoxes;\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoC,IAAAC,QAAA,GAErBC,qBAAS;AAAAC,OAAA,cAAAF,QAAA"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
require("core-js/modules/es.array.map.js");
|
|
10
|
-
require("core-js/modules/es.array.filter.js");
|
|
11
|
-
require("core-js/modules/es.object.to-string.js");
|
|
12
|
-
require("core-js/modules/es.object.values.js");
|
|
13
|
-
require("core-js/modules/es.array.concat.js");
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
var InfoBox = function InfoBox(_ref) {
|
|
17
|
-
var items = _ref.items,
|
|
18
|
-
infoBoxKey = _ref.infoBoxKey;
|
|
19
|
-
if (!items) return null;
|
|
20
|
-
var infoBoxItems = items.map(function (item) {
|
|
21
|
-
return Object.values(item).map(function (info) {
|
|
22
|
-
if (!info.label || !info.value) return null;
|
|
23
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
24
|
-
className: "info-box--item",
|
|
25
|
-
key: "".concat(infoBoxKey, "-").concat(info.label.toLowerCase())
|
|
26
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
27
|
-
className: "info-box--label"
|
|
28
|
-
}, info.label, ": "), /*#__PURE__*/_react["default"].createElement("div", {
|
|
29
|
-
className: "info-box--value"
|
|
30
|
-
}, info.value));
|
|
31
|
-
}).filter(Boolean);
|
|
32
|
-
});
|
|
33
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
34
|
-
className: "info-box",
|
|
35
|
-
key: infoBoxKey
|
|
36
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
37
|
-
className: "info-box--container"
|
|
38
|
-
}, infoBoxItems));
|
|
39
|
-
};
|
|
40
|
-
var _default = InfoBox;
|
|
41
|
-
exports["default"] = _default;
|
|
42
|
-
InfoBox.propTypes = {
|
|
43
|
-
infoBoxKey: _propTypes["default"].string.isRequired,
|
|
44
|
-
items: _propTypes["default"].array.isRequired
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=InfoBox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InfoBox.js","names":["_propTypes","_interopRequireDefault","require","_react","InfoBox","_ref","items","infoBoxKey","infoBoxItems","map","item","Object","values","info","label","value","createElement","className","key","concat","toLowerCase","filter","Boolean","_default","exports","propTypes","PropTypes","string","isRequired","array"],"sources":["../../../../src/components/InfoBoxes/presentational/InfoBox.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nconst InfoBox = ({ items, infoBoxKey }) => {\n if (!items) return null;\n\n const infoBoxItems = items.map(item =>\n Object.values(item)\n .map(info => {\n if (!info.label || !info.value) return null;\n\n return (\n <div className=\"info-box--item\" key={`${infoBoxKey}-${info.label.toLowerCase()}`}>\n <div className=\"info-box--label\">{info.label}: </div>\n <div className=\"info-box--value\">{info.value}</div>\n </div>\n );\n })\n .filter(Boolean)\n );\n\n return (\n <div className=\"info-box\" key={infoBoxKey}>\n <div className=\"info-box--container\">{infoBoxItems}</div>\n </div>\n );\n};\n\nexport default InfoBox;\n\nInfoBox.propTypes = {\n infoBoxKey: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAME,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAA8B;EAAA,IAAxBC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,UAAU,GAAAF,IAAA,CAAVE,UAAU;EAClC,IAAI,CAACD,KAAK,EAAE,OAAO,IAAI;EAEvB,IAAME,YAAY,GAAGF,KAAK,CAACG,GAAG,CAAC,UAAAC,IAAI;IAAA,OACjCC,MAAM,CAACC,MAAM,CAACF,IAAI,CAAC,CAChBD,GAAG,CAAC,UAAAI,IAAI,EAAI;MACX,IAAI,CAACA,IAAI,CAACC,KAAK,IAAI,CAACD,IAAI,CAACE,KAAK,EAAE,OAAO,IAAI;MAE3C,oBACEZ,MAAA,YAAAa,aAAA;QAAKC,SAAS,EAAC,gBAAgB;QAACC,GAAG,KAAAC,MAAA,CAAKZ,UAAU,OAAAY,MAAA,CAAIN,IAAI,CAACC,KAAK,CAACM,WAAW,CAAC,CAAC;MAAG,gBAC/EjB,MAAA,YAAAa,aAAA;QAAKC,SAAS,EAAC;MAAiB,GAAEJ,IAAI,CAACC,KAAK,EAAC,IAAO,CAAC,eACrDX,MAAA,YAAAa,aAAA;QAAKC,SAAS,EAAC;MAAiB,GAAEJ,IAAI,CAACE,KAAW,CAC/C,CAAC;IAEV,CAAC,CAAC,CACDM,MAAM,CAACC,OAAO,CAAC;EAAA,CACpB,CAAC;EAED,oBACEnB,MAAA,YAAAa,aAAA;IAAKC,SAAS,EAAC,UAAU;IAACC,GAAG,EAAEX;EAAW,gBACxCJ,MAAA,YAAAa,aAAA;IAAKC,SAAS,EAAC;EAAqB,GAAET,YAAkB,CACrD,CAAC;AAEV,CAAC;AAAC,IAAAe,QAAA,GAEanB,OAAO;AAAAoB,OAAA,cAAAD,QAAA;AAEtBnB,OAAO,CAACqB,SAAS,GAAG;EAClBlB,UAAU,EAAEmB,qBAAS,CAACC,MAAM,CAACC,UAAU;EACvCtB,KAAK,EAAEoB,qBAAS,CAACG,KAAK,CAACD;AACzB,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Link } from 'react-router-dom';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
const EntityNavLinks = ({
|
|
4
|
-
schema
|
|
5
|
-
}) => {
|
|
6
|
-
if (!schema) return null;
|
|
7
|
-
const {
|
|
8
|
-
displayProperties: {
|
|
9
|
-
adminSectionNavigation
|
|
10
|
-
}
|
|
11
|
-
} = schema;
|
|
12
|
-
if (!adminSectionNavigation) return null;
|
|
13
|
-
const links = Object.entries(adminSectionNavigation).map(([k, v]) => {
|
|
14
|
-
const {
|
|
15
|
-
label,
|
|
16
|
-
uri
|
|
17
|
-
} = v;
|
|
18
|
-
const Wrapper = uri.startsWith('#') ? 'a' : Link;
|
|
19
|
-
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
20
|
-
className: "entity-section-link",
|
|
21
|
-
href: uri,
|
|
22
|
-
to: uri
|
|
23
|
-
}, label);
|
|
24
|
-
});
|
|
25
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
-
className: "entity-section-links"
|
|
27
|
-
}, links);
|
|
28
|
-
};
|
|
29
|
-
export default EntityNavLinks;
|
|
30
|
-
//# sourceMappingURL=EntityNavLinks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EntityNavLinks.js","names":["Link","React","EntityNavLinks","schema","displayProperties","adminSectionNavigation","links","Object","entries","map","k","v","label","uri","Wrapper","startsWith","createElement","className","href","to"],"sources":["../../../../../src/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js"],"sourcesContent":["import { Link } from 'react-router-dom';\nimport React from 'react';\n\nconst EntityNavLinks = ({ schema }) => {\n if (!schema) return null;\n\n const {\n displayProperties: { adminSectionNavigation }\n } = schema;\n\n if (!adminSectionNavigation) return null;\n\n const links = Object.entries(adminSectionNavigation).map(([k, v]) => {\n const { label, uri } = v;\n const Wrapper = uri.startsWith('#') ? 'a' : Link;\n return (\n <Wrapper className=\"entity-section-link\" href={uri} to={uri}>\n {label}\n </Wrapper>\n );\n });\n\n return <div className=\"entity-section-links\">{links}</div>;\n};\n\nexport default EntityNavLinks;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,kBAAkB;AACvC,OAAOC,KAAK,MAAM,OAAO;AAEzB,MAAMC,cAAc,GAAGA,CAAC;EAAEC;AAAO,CAAC,KAAK;EACrC,IAAI,CAACA,MAAM,EAAE,OAAO,IAAI;EAExB,MAAM;IACJC,iBAAiB,EAAE;MAAEC;IAAuB;EAC9C,CAAC,GAAGF,MAAM;EAEV,IAAI,CAACE,sBAAsB,EAAE,OAAO,IAAI;EAExC,MAAMC,KAAK,GAAGC,MAAM,CAACC,OAAO,CAACH,sBAAsB,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,KAAK;IACnE,MAAM;MAAEC,KAAK;MAAEC;IAAI,CAAC,GAAGF,CAAC;IACxB,MAAMG,OAAO,GAAGD,GAAG,CAACE,UAAU,CAAC,GAAG,CAAC,GAAG,GAAG,GAAGf,IAAI;IAChD,oBACEC,KAAA,CAAAe,aAAA,CAACF,OAAO;MAACG,SAAS,EAAC,qBAAqB;MAACC,IAAI,EAAEL,GAAI;MAACM,EAAE,EAAEN;IAAI,GACzDD,KACM,CAAC;EAEd,CAAC,CAAC;EAEF,oBAAOX,KAAA,CAAAe,aAAA;IAAKC,SAAS,EAAC;EAAsB,GAAEX,KAAW,CAAC;AAC5D,CAAC;AAED,eAAeJ,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["EntityNavLinks"],"sources":["../../../../../src/components/EntityManager/Entity/EntitiyNavLinks/index.js"],"sourcesContent":["import EntityNavLinks from './EntityNavLinks';\n\nexport default EntityNavLinks;\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAE7C,eAAeA,cAAc"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import useCustomSidebarData from '../hooks/useCustomSidebarData';
|
|
4
|
-
import CustomSidebarInfo from '../presentational/CustomSidebarInfo';
|
|
5
|
-
const CustomSibebarInfoContainer = ({
|
|
6
|
-
id,
|
|
7
|
-
schema,
|
|
8
|
-
displayProperties
|
|
9
|
-
}) => {
|
|
10
|
-
const {
|
|
11
|
-
data
|
|
12
|
-
} = useCustomSidebarData({
|
|
13
|
-
id,
|
|
14
|
-
schema,
|
|
15
|
-
displayProperties
|
|
16
|
-
});
|
|
17
|
-
if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;
|
|
18
|
-
const items = Object.values(data).flatMap(item => Object.values(item));
|
|
19
|
-
return /*#__PURE__*/React.createElement(CustomSidebarInfo, {
|
|
20
|
-
items: items,
|
|
21
|
-
customSidebarInfoKey: displayProperties.key
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
export default CustomSibebarInfoContainer;
|
|
25
|
-
CustomSibebarInfoContainer.propTypes = {
|
|
26
|
-
id: PropTypes.string.isRequired,
|
|
27
|
-
displayProperties: PropTypes.object.isRequired,
|
|
28
|
-
schema: PropTypes.object.isRequired
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=CustomSidebarInfoContainer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomSidebarInfoContainer.js","names":["PropTypes","React","useCustomSidebarData","CustomSidebarInfo","CustomSibebarInfoContainer","id","schema","displayProperties","data","Object","keys","length","items","values","flatMap","item","createElement","customSidebarInfoKey","key","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,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,oBAAoB,MAAM,+BAA+B;AAChE,OAAOC,iBAAiB,MAAM,qCAAqC;AAEnE,MAAMC,0BAA0B,GAAGA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAkB,CAAC,KAAK;EACxE,MAAM;IAAEC;EAAK,CAAC,GAAGN,oBAAoB,CAAC;IAAEG,EAAE;IAAEC,MAAM;IAAEC;EAAkB,CAAC,CAAC;EAExE,IAAI,CAACC,IAAI,IAAI,CAACC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,CAACG,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAE9E,MAAMC,KAAK,GAAGH,MAAM,CAACI,MAAM,CAACL,IAAI,CAAC,CAACM,OAAO,CAACC,IAAI,IAAIN,MAAM,CAACI,MAAM,CAACE,IAAI,CAAC,CAAC;EAEtE,oBAAOd,KAAA,CAAAe,aAAA,CAACb,iBAAiB;IAACS,KAAK,EAAEA,KAAM;IAACK,oBAAoB,EAAEV,iBAAiB,CAACW;EAAI,CAAE,CAAC;AACzF,CAAC;AAED,eAAed,0BAA0B;AAEzCA,0BAA0B,CAACe,SAAS,GAAG;EACrCd,EAAE,EAAEL,SAAS,CAACoB,MAAM,CAACC,UAAU;EAC/Bd,iBAAiB,EAAEP,SAAS,CAACsB,MAAM,CAACD,UAAU;EAC9Cf,MAAM,EAAEN,SAAS,CAACsB,MAAM,CAACD;AAC3B,CAAC"}
|
package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { gql } from '@apollo/client';
|
|
2
|
-
import { BlazeError } from '@blaze-cms/core-errors';
|
|
3
|
-
export default function buildDynamicQuery({
|
|
4
|
-
id,
|
|
5
|
-
schema,
|
|
6
|
-
displayProperties
|
|
7
|
-
}) {
|
|
8
|
-
if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
|
|
9
|
-
throw new BlazeError('DataEntity query requires get action, properties and fields from entity schema');
|
|
10
|
-
}
|
|
11
|
-
if (displayProperties.adminMainInfoProperty && Array.isArray(displayProperties.adminMainInfoProperty)) {
|
|
12
|
-
const fields = displayProperties.adminMainInfoProperty.map(infoProperty => `${infoProperty} {
|
|
13
|
-
label
|
|
14
|
-
value
|
|
15
|
-
}`);
|
|
16
|
-
return gql`query getInfoBoxData($id: String!){
|
|
17
|
-
${schema.actions.get}( id: $id ) {
|
|
18
|
-
id
|
|
19
|
-
${fields.map(field => field)}
|
|
20
|
-
__typename
|
|
21
|
-
}
|
|
22
|
-
}`;
|
|
23
|
-
}
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=build-dynamic-query.js.map
|
package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-dynamic-query.js","names":["gql","BlazeError","buildDynamicQuery","id","schema","displayProperties","actions","get","properties","adminMainInfoProperty","Array","isArray","fields","map","infoProperty","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 }`\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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,eAAe,SAASC,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,IAAIP,UAAU,CAClB,gFACF,CAAC;EACH;EAEA,IACEI,iBAAiB,CAACI,qBAAqB,IACvCC,KAAK,CAACC,OAAO,CAACN,iBAAiB,CAACI,qBAAqB,CAAC,EACtD;IACA,MAAMG,MAAM,GAAGP,iBAAiB,CAACI,qBAAqB,CAACI,GAAG,CACxDC,YAAY,IACT,GAAEA,YAAa;AACxB;AACA;AACA,QACI,CAAC;IAED,OAAOd,GAAI;AACf,QAAQI,MAAM,CAACE,OAAO,CAACC,GAAI;AAC3B;AACA,SAASK,MAAM,CAACC,GAAG,CAACE,KAAK,IAAIA,KAAK,CAAE;AACpC;AACA;AACA,MAAM;EACJ;EAEA,OAAO,IAAI;AACb"}
|
package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import ProptTypes from 'prop-types';
|
|
2
|
-
import { useQuery, gql } from '@apollo/client';
|
|
3
|
-
import buildDynamicQuery from '../helpers/build-dynamic-query';
|
|
4
|
-
const useCustomSidebarData = ({
|
|
5
|
-
id,
|
|
6
|
-
schema,
|
|
7
|
-
displayProperties
|
|
8
|
-
}) => {
|
|
9
|
-
const query = buildDynamicQuery({
|
|
10
|
-
id,
|
|
11
|
-
schema,
|
|
12
|
-
displayProperties
|
|
13
|
-
});
|
|
14
|
-
const customSidebarInfoQuery = query || gql`
|
|
15
|
-
query {
|
|
16
|
-
__typename
|
|
17
|
-
}
|
|
18
|
-
`;
|
|
19
|
-
const {
|
|
20
|
-
data = {},
|
|
21
|
-
loading,
|
|
22
|
-
error
|
|
23
|
-
} = useQuery(customSidebarInfoQuery, {
|
|
24
|
-
variables: {
|
|
25
|
-
id
|
|
26
|
-
},
|
|
27
|
-
skip: !query
|
|
28
|
-
});
|
|
29
|
-
return {
|
|
30
|
-
data: data.__typename !== 'Query' ? data : null,
|
|
31
|
-
loading,
|
|
32
|
-
error
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export default useCustomSidebarData;
|
|
36
|
-
useCustomSidebarData.propTypes = {
|
|
37
|
-
displayProperties: ProptTypes.object.isRequired
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=useCustomSidebarData.js.map
|
package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCustomSidebarData.js","names":["ProptTypes","useQuery","gql","buildDynamicQuery","useCustomSidebarData","id","schema","displayProperties","query","customSidebarInfoQuery","data","loading","error","variables","skip","__typename","propTypes","object","isRequired"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js"],"sourcesContent":["import ProptTypes from 'prop-types';\nimport { useQuery, gql } from '@apollo/client';\nimport buildDynamicQuery from '../helpers/build-dynamic-query';\n\nconst useCustomSidebarData = ({ id, schema, displayProperties }) => {\n const query = buildDynamicQuery({ id, schema, displayProperties });\n\n const customSidebarInfoQuery =\n query ||\n gql`\n query {\n __typename\n }\n `;\n\n const { data = {}, loading, error } = useQuery(customSidebarInfoQuery, {\n variables: { id },\n skip: !query\n });\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,OAAOA,UAAU,MAAM,YAAY;AACnC,SAASC,QAAQ,EAAEC,GAAG,QAAQ,gBAAgB;AAC9C,OAAOC,iBAAiB,MAAM,gCAAgC;AAE9D,MAAMC,oBAAoB,GAAGA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAkB,CAAC,KAAK;EAClE,MAAMC,KAAK,GAAGL,iBAAiB,CAAC;IAAEE,EAAE;IAAEC,MAAM;IAAEC;EAAkB,CAAC,CAAC;EAElE,MAAME,sBAAsB,GAC1BD,KAAK,IACLN,GAAI;AACR;AACA;AACA;AACA,KAAK;EAEH,MAAM;IAAEQ,IAAI,GAAG,CAAC,CAAC;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGX,QAAQ,CAACQ,sBAAsB,EAAE;IACrEI,SAAS,EAAE;MAAER;IAAG,CAAC;IACjBS,IAAI,EAAE,CAACN;EACT,CAAC,CAAC;EAEF,OAAO;IAAEE,IAAI,EAAEA,IAAI,CAACK,UAAU,KAAK,OAAO,GAAGL,IAAI,GAAG,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC;AAC5E,CAAC;AAED,eAAeR,oBAAoB;AAEnCA,oBAAoB,CAACY,SAAS,GAAG;EAC/BT,iBAAiB,EAAEP,UAAU,CAACiB,MAAM,CAACC;AACvC,CAAC"}
|