@blaze-cms/plugin-data-ui 0.139.0-alpha.4 → 0.139.0-alpha.6
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 +48 -0
- package/README.md +42 -0
- package/lib/components/EntityDataListing/EntityDataListing.js +3 -24
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +38 -0
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -0
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +11 -0
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -0
- package/lib/components/EntityManager/Entity/Entity.js +16 -3
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +43 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +32 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +44 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +12 -2
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +37 -0
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -0
- package/lib/components/InfoBoxes/InfoBoxes.js +35 -0
- package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -0
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js +43 -0
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -0
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +25 -0
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -0
- package/lib/components/InfoBoxes/hooks/useData.js +41 -0
- package/lib/components/InfoBoxes/hooks/useData.js.map +1 -0
- package/lib/components/InfoBoxes/hooks/useInfoBox.js +25 -0
- package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -0
- package/lib/components/InfoBoxes/index.js +11 -0
- package/lib/components/InfoBoxes/index.js.map +1 -0
- package/lib/components/InfoBoxes/presentational/InfoBox.js +45 -0
- package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -0
- package/lib/components/ListingTable/ListingTable.js +124 -79
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +8 -20
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +91 -25
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +73 -11
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/constants.js +9 -1
- package/lib/constants.js.map +1 -1
- package/lib/icons/ContentIcon.js +90 -0
- package/lib/icons/ContentIcon.js.map +1 -0
- package/lib/icons/SettingsIcon.js +46 -0
- package/lib/icons/SettingsIcon.js.map +1 -0
- package/lib/icons/TaxonomyIcon.js +70 -0
- package/lib/icons/TaxonomyIcon.js.map +1 -0
- package/lib/icons/UsersIcon.js +43 -0
- package/lib/icons/UsersIcon.js.map +1 -0
- package/lib/icons/index.js +36 -0
- package/lib/icons/index.js.map +1 -0
- package/lib/index.js +38 -11
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +61 -13
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-listing-query.js +11 -2
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/get-default-query-params.js +3 -4
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib-es/components/EntityDataListing/EntityDataListing.js +3 -14
- package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +30 -0
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js +3 -0
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/Entity.js +16 -3
- package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +30 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +26 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +39 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +12 -2
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +24 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -0
- package/lib-es/components/InfoBoxes/InfoBoxes.js +28 -0
- package/lib-es/components/InfoBoxes/InfoBoxes.js.map +1 -0
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js +30 -0
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -0
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +25 -0
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -0
- package/lib-es/components/InfoBoxes/hooks/useData.js +37 -0
- package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -0
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js +19 -0
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +1 -0
- package/lib-es/components/InfoBoxes/index.js +3 -0
- package/lib-es/components/InfoBoxes/index.js.map +1 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js +31 -0
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -0
- package/lib-es/components/ListingTable/ListingTable.js +56 -50
- package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +11 -19
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib-es/components/ListingTable/mappers/populate-rows.js +76 -24
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib-es/components/ListingTable/service/index.js +65 -7
- package/lib-es/components/ListingTable/service/index.js.map +1 -1
- package/lib-es/constants.js +9 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/icons/ContentIcon.js +80 -0
- package/lib-es/icons/ContentIcon.js.map +1 -0
- package/lib-es/icons/SettingsIcon.js +36 -0
- package/lib-es/icons/SettingsIcon.js.map +1 -0
- package/lib-es/icons/TaxonomyIcon.js +60 -0
- package/lib-es/icons/TaxonomyIcon.js.map +1 -0
- package/lib-es/icons/UsersIcon.js +33 -0
- package/lib-es/icons/UsersIcon.js.map +1 -0
- package/lib-es/icons/index.js +6 -0
- package/lib-es/icons/index.js.map +1 -0
- package/lib-es/index.js +37 -9
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/add-content-menu-items.js +46 -5
- package/lib-es/utils/add-content-menu-items.js.map +1 -1
- package/lib-es/utils/build-listing-query.js +10 -1
- package/lib-es/utils/build-listing-query.js.map +1 -1
- package/lib-es/utils/get-default-query-params.js +1 -3
- package/lib-es/utils/get-default-query-params.js.map +1 -1
- package/package.json +6 -5
- package/src/components/EntityDataListing/EntityDataListing.js +3 -12
- package/src/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +26 -0
- package/src/components/EntityManager/Entity/EntitiyNavLinks/index.js +3 -0
- package/src/components/EntityManager/Entity/Entity.js +10 -1
- package/src/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +22 -0
- package/src/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +33 -0
- package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +28 -0
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +34 -16
- package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +33 -0
- package/src/components/InfoBoxes/InfoBoxes.js +24 -0
- package/src/components/InfoBoxes/container/InfoBoxContainer.js +22 -0
- package/src/components/InfoBoxes/helpers/build-dynamic-query.js +25 -0
- package/src/components/InfoBoxes/hooks/useData.js +20 -0
- package/src/components/InfoBoxes/hooks/useInfoBox.js +13 -0
- package/src/components/InfoBoxes/index.js +3 -0
- package/src/components/InfoBoxes/presentational/InfoBox.js +34 -0
- package/src/components/ListingTable/ListingTable.js +73 -39
- package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +8 -22
- package/src/components/ListingTable/mappers/populate-rows.js +83 -18
- package/src/components/ListingTable/service/index.js +42 -5
- package/src/constants.js +13 -1
- package/src/icons/ContentIcon.js +83 -0
- package/src/icons/SettingsIcon.js +41 -0
- package/src/icons/TaxonomyIcon.js +62 -0
- package/src/icons/UsersIcon.js +37 -0
- package/src/icons/index.js +6 -0
- package/src/index.js +36 -8
- package/src/utils/add-content-menu-items.js +42 -3
- package/src/utils/build-listing-query.js +11 -1
- package/src/utils/get-default-query-params.js +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
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 _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _constants = require("../constants");
|
|
11
|
+
function TaxonomyIcon(_ref) {
|
|
12
|
+
var _ref$width = _ref.width,
|
|
13
|
+
width = _ref$width === void 0 ? _constants.ICON_SIZE.WIDTH : _ref$width,
|
|
14
|
+
_ref$height = _ref.height,
|
|
15
|
+
height = _ref$height === void 0 ? _constants.ICON_SIZE.HEIGHT : _ref$height,
|
|
16
|
+
_ref$stroke = _ref.stroke,
|
|
17
|
+
stroke = _ref$stroke === void 0 ? _constants.ICON_COLOR.STROKE : _ref$stroke;
|
|
18
|
+
return /*#__PURE__*/_react["default"].createElement("svg", {
|
|
19
|
+
width: width,
|
|
20
|
+
height: height,
|
|
21
|
+
viewBox: "0 0 22 22",
|
|
22
|
+
version: "1.1",
|
|
23
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
24
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
25
|
+
}, /*#__PURE__*/_react["default"].createElement("title", null, "taxonomy"), /*#__PURE__*/_react["default"].createElement("g", {
|
|
26
|
+
id: "Page-1",
|
|
27
|
+
stroke: "none",
|
|
28
|
+
strokeWidth: "1",
|
|
29
|
+
fill: "none",
|
|
30
|
+
fillRule: "evenodd",
|
|
31
|
+
strokeLinecap: "round",
|
|
32
|
+
strokeLinejoin: "round"
|
|
33
|
+
}, /*#__PURE__*/_react["default"].createElement("g", {
|
|
34
|
+
id: "Group",
|
|
35
|
+
transform: "translate(1, 1)",
|
|
36
|
+
stroke: stroke
|
|
37
|
+
}, /*#__PURE__*/_react["default"].createElement("rect", {
|
|
38
|
+
id: "Rectangle",
|
|
39
|
+
x: "0",
|
|
40
|
+
y: "13.2173913",
|
|
41
|
+
width: "6.78260868",
|
|
42
|
+
height: "6.60869564",
|
|
43
|
+
rx: "1.5"
|
|
44
|
+
}), /*#__PURE__*/_react["default"].createElement("rect", {
|
|
45
|
+
id: "Rectangle",
|
|
46
|
+
x: "13.2173913",
|
|
47
|
+
y: "13.2173913",
|
|
48
|
+
width: "6.78260868",
|
|
49
|
+
height: "6.60869564",
|
|
50
|
+
rx: "1.5"
|
|
51
|
+
}), /*#__PURE__*/_react["default"].createElement("rect", {
|
|
52
|
+
id: "Rectangle",
|
|
53
|
+
x: "6.60869564",
|
|
54
|
+
y: "0",
|
|
55
|
+
width: "6.78260868",
|
|
56
|
+
height: "6.60869564",
|
|
57
|
+
rx: "1.5"
|
|
58
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
59
|
+
d: "M3.30434782,13.2173913 L3.30434782,12.115942 C3.30434782,10.8993147 4.2906191,9.91304346 5.50724637,9.91304346 L14.3188405,9.91304346 C15.5354678,9.91304346 16.5217391,10.8993147 16.5217391,12.115942 L16.5217391,13.2173913",
|
|
60
|
+
id: "Path"
|
|
61
|
+
}), /*#__PURE__*/_react["default"].createElement("line", {
|
|
62
|
+
x1: "9.91304346",
|
|
63
|
+
y1: "6.60869564",
|
|
64
|
+
x2: "9.91304346",
|
|
65
|
+
y2: "9.91304346",
|
|
66
|
+
id: "Path"
|
|
67
|
+
}))));
|
|
68
|
+
}
|
|
69
|
+
var _default = exports["default"] = TaxonomyIcon;
|
|
70
|
+
//# sourceMappingURL=TaxonomyIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaxonomyIcon.js","names":["_react","_interopRequireDefault","require","_constants","TaxonomyIcon","_ref","_ref$width","width","ICON_SIZE","WIDTH","_ref$height","height","HEIGHT","_ref$stroke","stroke","ICON_COLOR","STROKE","createElement","viewBox","version","xmlns","xmlnsXlink","id","strokeWidth","fill","fillRule","strokeLinecap","strokeLinejoin","transform","x","y","rx","d","x1","y1","x2","y2","_default","exports"],"sources":["../../src/icons/TaxonomyIcon.js"],"sourcesContent":["import React from 'react';\nimport { ICON_SIZE, ICON_COLOR } from '../constants';\n\nfunction TaxonomyIcon({\n width = ICON_SIZE.WIDTH,\n height = ICON_SIZE.HEIGHT,\n stroke = ICON_COLOR.STROKE\n}) {\n return (\n <svg\n width={width}\n height={height}\n viewBox=\"0 0 22 22\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\">\n <title>taxonomy</title>\n <g\n id=\"Page-1\"\n stroke=\"none\"\n strokeWidth=\"1\"\n fill=\"none\"\n fillRule=\"evenodd\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\">\n <g id=\"Group\" transform=\"translate(1, 1)\" stroke={stroke}>\n <rect\n id=\"Rectangle\"\n x=\"0\"\n y=\"13.2173913\"\n width=\"6.78260868\"\n height=\"6.60869564\"\n rx=\"1.5\"\n />\n <rect\n id=\"Rectangle\"\n x=\"13.2173913\"\n y=\"13.2173913\"\n width=\"6.78260868\"\n height=\"6.60869564\"\n rx=\"1.5\"\n />\n <rect\n id=\"Rectangle\"\n x=\"6.60869564\"\n y=\"0\"\n width=\"6.78260868\"\n height=\"6.60869564\"\n rx=\"1.5\"\n />\n <path\n d=\"M3.30434782,13.2173913 L3.30434782,12.115942 C3.30434782,10.8993147 4.2906191,9.91304346 5.50724637,9.91304346 L14.3188405,9.91304346 C15.5354678,9.91304346 16.5217391,10.8993147 16.5217391,12.115942 L16.5217391,13.2173913\"\n id=\"Path\"\n />\n <line x1=\"9.91304346\" y1=\"6.60869564\" x2=\"9.91304346\" y2=\"9.91304346\" id=\"Path\" />\n </g>\n </g>\n </svg>\n );\n}\n\nexport default TaxonomyIcon;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,SAASE,YAAYA,CAAAC,IAAA,EAIlB;EAAA,IAAAC,UAAA,GAAAD,IAAA,CAHDE,KAAK;IAALA,KAAK,GAAAD,UAAA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AAC,EAAC,YAAY;IACdC,CAAC,EAAC,GAAG;IACLvB,KAAK,EAAC,YAAY;IAClBI,MAAM,EAAC,YAAY;IACnBoB,EAAE,EAAC;EAAK,CACT,CAAC,eACF/B,MAAA,YAAAiB,aAAA;IACEe,CAAC,EAAC,gOAAgO;IAClOV,EAAE,EAAC;EAAM,CACV,CAAC,eACFtB,MAAA,YAAAiB,aAAA;IAAMgB,EAAE,EAAC,YAAY;IAACC,EAAE,EAAC,YAAY;IAACC,EAAE,EAAC,YAAY;IAACC,EAAE,EAAC,YAAY;IAACd,EAAE,EAAC;EAAM,CAAE,CAChF,CACF,CACA,CAAC;AAEV;AAAC,IAAAe,QAAA,GAAAC,OAAA,cAEclC,YAAY"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _constants = require("../constants");
|
|
11
|
+
function UserIcon(_ref) {
|
|
12
|
+
var _ref$width = _ref.width,
|
|
13
|
+
width = _ref$width === void 0 ? _constants.ICON_SIZE.WIDTH : _ref$width,
|
|
14
|
+
_ref$height = _ref.height,
|
|
15
|
+
height = _ref$height === void 0 ? _constants.ICON_SIZE.HEIGHT : _ref$height,
|
|
16
|
+
_ref$stroke = _ref.stroke,
|
|
17
|
+
stroke = _ref$stroke === void 0 ? _constants.ICON_COLOR.STROKE : _ref$stroke;
|
|
18
|
+
return /*#__PURE__*/_react["default"].createElement("svg", {
|
|
19
|
+
width: width,
|
|
20
|
+
height: height,
|
|
21
|
+
viewBox: "0 0 22 22",
|
|
22
|
+
version: "1.1",
|
|
23
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
24
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
25
|
+
}, /*#__PURE__*/_react["default"].createElement("title", null, "user"), /*#__PURE__*/_react["default"].createElement("g", {
|
|
26
|
+
id: "Page-1",
|
|
27
|
+
stroke: "none",
|
|
28
|
+
strokeWidth: 1,
|
|
29
|
+
fill: "none",
|
|
30
|
+
fillRule: "evenodd",
|
|
31
|
+
strokeLinecap: "round",
|
|
32
|
+
strokeLinejoin: "round"
|
|
33
|
+
}, /*#__PURE__*/_react["default"].createElement("g", {
|
|
34
|
+
id: "Group",
|
|
35
|
+
transform: "translate(1, 0.76)",
|
|
36
|
+
stroke: stroke
|
|
37
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
38
|
+
d: "M2.35666666,16.4488888 C4.68824079,15.1310199 7.32175438,14.4403878 10,14.4444089 C12.7777778,14.4444089 15.3855556,15.1722221 17.6433334,16.4488888 M13.3333334,7.7777776 C13.3333334,9.61872677 11.8409492,11.1111109 10,11.1111109 C8.15905083,11.1111109 6.66666666,9.61872677 6.66666666,7.7777776 C6.66666666,5.93682842 8.15905083,4.44444425 10,4.44444425 C11.8409492,4.44444425 13.3333334,5.93682842 13.3333334,7.7777776 L13.3333334,7.7777776 Z M20,10 C20,13.5726558 18.0940108,16.8739261 15,18.660254 C11.9059893,20.446582 8.09401075,20.446582 5,18.660254 C1.90598917,16.8739261 0,13.5726558 0,10 C0,4.47715239 4.47715258,0 10,0 C15.5228474,0 20,4.47715239 20,10 L20,10 Z",
|
|
39
|
+
id: "Shape"
|
|
40
|
+
}))));
|
|
41
|
+
}
|
|
42
|
+
var _default = exports["default"] = UserIcon;
|
|
43
|
+
//# sourceMappingURL=UsersIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UsersIcon.js","names":["_react","_interopRequireDefault","require","_constants","UserIcon","_ref","_ref$width","width","ICON_SIZE","WIDTH","_ref$height","height","HEIGHT","_ref$stroke","stroke","ICON_COLOR","STROKE","createElement","viewBox","version","xmlns","xmlnsXlink","id","strokeWidth","fill","fillRule","strokeLinecap","strokeLinejoin","transform","d","_default","exports"],"sources":["../../src/icons/UsersIcon.js"],"sourcesContent":["import React from 'react';\nimport { ICON_SIZE, ICON_COLOR } from '../constants';\n\nfunction UserIcon({\n width = ICON_SIZE.WIDTH,\n height = ICON_SIZE.HEIGHT,\n stroke = ICON_COLOR.STROKE\n}) {\n return (\n <svg\n width={width}\n height={height}\n viewBox=\"0 0 22 22\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\">\n <title>user</title>\n <g\n id=\"Page-1\"\n stroke=\"none\"\n strokeWidth={1}\n fill=\"none\"\n fillRule=\"evenodd\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\">\n <g id=\"Group\" transform=\"translate(1, 0.76)\" stroke={stroke}>\n <path\n d=\"M2.35666666,16.4488888 C4.68824079,15.1310199 7.32175438,14.4403878 10,14.4444089 C12.7777778,14.4444089 15.3855556,15.1722221 17.6433334,16.4488888 M13.3333334,7.7777776 C13.3333334,9.61872677 11.8409492,11.1111109 10,11.1111109 C8.15905083,11.1111109 6.66666666,9.61872677 6.66666666,7.7777776 C6.66666666,5.93682842 8.15905083,4.44444425 10,4.44444425 C11.8409492,4.44444425 13.3333334,5.93682842 13.3333334,7.7777776 L13.3333334,7.7777776 Z M20,10 C20,13.5726558 18.0940108,16.8739261 15,18.660254 C11.9059893,20.446582 8.09401075,20.446582 5,18.660254 C1.90598917,16.8739261 0,13.5726558 0,10 C0,4.47715239 4.47715258,0 10,0 C15.5228474,0 20,4.47715239 20,10 L20,10 Z\"\n id=\"Shape\"\n />\n </g>\n </g>\n </svg>\n );\n}\n\nexport default UserIcon;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,SAASE,QAAQA,CAAAC,IAAA,EAId;EAAA,IAAAC,UAAA,GAAAD,IAAA,CAHDE,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAGE,oBAAS,CAACC,KAAK,GAAAH,UAAA;IAAAI,WAAA,GAAAL,IAAA,CACvBM,MAAM;IAANA,MAAM,GAAAD,WAAA,cAAGF,oBAAS,CAACI,MAAM,GAAAF,WAAA;IAAAG,WAAA,GAAAR,IAAA,CACzBS,MAAM;IAANA,MAAM,GAAAD,WAAA,cAAGE,qBAAU,CAACC,MAAM,GAAAH,WAAA;EAE1B,oBACEb,MAAA,YAAAiB,aAAA;IACEV,KAAK,EAAEA,KAAM;IACbI,MAAM,EAAEA,MAAO;IACfO,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC,KAAK;IACbC,KAAK,EAAC,4BAA4B;IAClCC,UAAU,EAAC;EAA8B,gBACzCrB,MAAA,YAAAiB,aAAA,gBAAO,MAAW,CAAC,eACnBjB,MAAA,YAAAiB,aAAA;IACEK,EAAE,EAAC,QAAQ;IACXR,MAAM,EAAC,MAAM;IACbS,WAAW,EAAE,CAAE;IACfC,IAAI,EAAC,MAAM;IACXC,QAAQ,EAAC,SAAS;IAClBC,aAAa,EAAC,OAAO;IACrBC,cAAc,EAAC;EAAO,gBACtB3B,MAAA,YAAAiB,aAAA;IAAGK,EAAE,EAAC,OAAO;IAACM,SAAS,EAAC,oBAAoB;IAACd,MAAM,EAAEA;EAAO,gBAC1Dd,MAAA,YAAAiB,aAAA;IACEY,CAAC,EAAC,kqBAAkqB;IACpqBP,EAAE,EAAC;EAAO,CACX,CACA,CACF,CACA,CAAC;AAEV;AAAC,IAAAQ,QAAA,GAAAC,OAAA,cAEc3B,QAAQ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
Object.defineProperty(exports, "ContentIcon", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _ContentIcon["default"];
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "SettingsIcon", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _SettingsIcon["default"];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "TaxonomyIcon", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function get() {
|
|
23
|
+
return _TaxonomyIcon["default"];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "UserIcon", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function get() {
|
|
29
|
+
return _UsersIcon["default"];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
var _UsersIcon = _interopRequireDefault(require("./UsersIcon"));
|
|
33
|
+
var _TaxonomyIcon = _interopRequireDefault(require("./TaxonomyIcon"));
|
|
34
|
+
var _ContentIcon = _interopRequireDefault(require("./ContentIcon"));
|
|
35
|
+
var _SettingsIcon = _interopRequireDefault(require("./SettingsIcon"));
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_UsersIcon","_interopRequireDefault","require","_TaxonomyIcon","_ContentIcon","_SettingsIcon"],"sources":["../../src/icons/index.js"],"sourcesContent":["import UserIcon from './UsersIcon';\nimport TaxonomyIcon from './TaxonomyIcon';\nimport ContentIcon from './ContentIcon';\nimport SettingsIcon from './SettingsIcon';\n\nexport { UserIcon, TaxonomyIcon, ContentIcon, SettingsIcon };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,aAAA,GAAAJ,sBAAA,CAAAC,OAAA"}
|
package/lib/index.js
CHANGED
|
@@ -24,6 +24,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
24
24
|
var _package = _interopRequireDefault(require("../package.json"));
|
|
25
25
|
var _constants = require("./constants");
|
|
26
26
|
var _addContentMenuItems = _interopRequireDefault(require("./utils/add-content-menu-items"));
|
|
27
|
+
var _icons = require("./icons");
|
|
27
28
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
29
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2["default"])(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
29
30
|
var EntityDataListing = /*#__PURE__*/_react["default"].lazy(function () {
|
|
@@ -41,19 +42,11 @@ function load(_x) {
|
|
|
41
42
|
}
|
|
42
43
|
function _load() {
|
|
43
44
|
_load = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(app) {
|
|
44
|
-
var
|
|
45
|
+
var entityDataListingRoute, editEntityRoute, addEntityRoute;
|
|
45
46
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
46
47
|
while (1) switch (_context2.prev = _context2.next) {
|
|
47
48
|
case 0:
|
|
48
|
-
|
|
49
|
-
sectionKey = 'content';
|
|
50
|
-
app.events.once('load:menu-section', function (addSection) {
|
|
51
|
-
addSection(sectionKey, {
|
|
52
|
-
header: 'content',
|
|
53
|
-
order: 100
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
app.events.once('load:menu-items', (0, _addContentMenuItems["default"])(app, sectionKey));
|
|
49
|
+
app.events.once('admin:menu:config:load', (0, _addContentMenuItems["default"])(app));
|
|
57
50
|
app.events.once('load:custom:field:type', function (addFieldType) {
|
|
58
51
|
Object.keys(_reactFormBuilder.formFieldTypes).forEach(function (type) {
|
|
59
52
|
addFieldType({
|
|
@@ -74,6 +67,40 @@ function _load() {
|
|
|
74
67
|
}
|
|
75
68
|
}, _callee);
|
|
76
69
|
})));
|
|
70
|
+
app.events.once('admin:menu:config:load', function (_ref2) {
|
|
71
|
+
var addConfig = _ref2.addConfig;
|
|
72
|
+
addConfig({
|
|
73
|
+
main: {
|
|
74
|
+
items: {
|
|
75
|
+
content: {
|
|
76
|
+
label: 'content',
|
|
77
|
+
loadOpen: true,
|
|
78
|
+
items: {},
|
|
79
|
+
icon: _icons.ContentIcon,
|
|
80
|
+
order: 10
|
|
81
|
+
},
|
|
82
|
+
taxonomy: {
|
|
83
|
+
label: 'Taxonomy',
|
|
84
|
+
items: {},
|
|
85
|
+
icon: _icons.TaxonomyIcon,
|
|
86
|
+
order: 40
|
|
87
|
+
},
|
|
88
|
+
user: {
|
|
89
|
+
label: 'User',
|
|
90
|
+
items: {},
|
|
91
|
+
icon: _icons.UserIcon,
|
|
92
|
+
order: 90
|
|
93
|
+
},
|
|
94
|
+
settings: {
|
|
95
|
+
label: 'Settings',
|
|
96
|
+
items: {},
|
|
97
|
+
icon: _icons.SettingsIcon,
|
|
98
|
+
order: 100
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
77
104
|
entityDataListingRoute = {
|
|
78
105
|
path: "".concat(_constants.DATA_LISTING_PREFIX, "/:entityIdentifier"),
|
|
79
106
|
key: 'entityDataListing',
|
|
@@ -99,7 +126,7 @@ function _load() {
|
|
|
99
126
|
name: _constants.PLUGIN_NAME,
|
|
100
127
|
version: _package["default"].version
|
|
101
128
|
});
|
|
102
|
-
case
|
|
129
|
+
case 11:
|
|
103
130
|
case "end":
|
|
104
131
|
return _context2.stop();
|
|
105
132
|
}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_reactFormBuilder","require","_react","_interopRequireDefault","_package","_constants","_addContentMenuItems","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","_typeof2","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","EntityDataListing","React","lazy","Promise","resolve","then","EntityManager","load","_x","_load","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee2","app","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_reactFormBuilder","require","_react","_interopRequireDefault","_package","_constants","_addContentMenuItems","_icons","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","_typeof2","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","EntityDataListing","React","lazy","Promise","resolve","then","EntityManager","load","_x","_load","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee2","app","entityDataListingRoute","editEntityRoute","addEntityRoute","wrap","_callee2$","_context2","prev","next","events","once","getAddContentMenuItems","addFieldType","keys","formFieldTypes","forEach","type","component","_callee","_callee$","_context","emitAsync","getFormBuilderLookup","stop","_ref2","addConfig","main","items","content","label","loadOpen","icon","ContentIcon","order","taxonomy","TaxonomyIcon","user","UserIcon","settings","SettingsIcon","path","concat","DATA_LISTING_PREFIX","key","exact","addRoute","abrupt","name","PLUGIN_NAME","version","pkg","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import { getFormBuilderLookup, formFieldTypes } from '@blaze-cms/react-form-builder';\nimport React from 'react';\nimport pkg from '../package.json';\nimport { DATA_LISTING_PREFIX, PLUGIN_NAME } from './constants';\nimport getAddContentMenuItems from './utils/add-content-menu-items';\nimport { UserIcon, TaxonomyIcon, ContentIcon, SettingsIcon } from './icons';\n\nconst EntityDataListing = React.lazy(() =>\n import(/* webpackChunkName: 'EntityDataListing' */ './components/EntityDataListing')\n);\nconst EntityManager = React.lazy(() =>\n import(/* webpackChunkName: 'EntityManager' */ './components/EntityManager')\n);\n\nexport default async function load(app) {\n app.events.once('admin:menu:config:load', getAddContentMenuItems(app));\n\n app.events.once('load:custom:field:type', addFieldType => {\n Object.keys(formFieldTypes).forEach(type => {\n addFieldType({ type, component: formFieldTypes[type] });\n });\n });\n\n app.events.once('plugin:data-ui:load:loaded', async () => {\n await app.events.emitAsync('load:custom:field:type', getFormBuilderLookup.addFieldType);\n });\n\n app.events.once('admin:menu:config:load', ({ addConfig }) => {\n addConfig({\n main: {\n items: {\n content: {\n label: 'content',\n loadOpen: true,\n items: {},\n icon: ContentIcon,\n order: 10\n },\n taxonomy: {\n label: 'Taxonomy',\n items: {},\n icon: TaxonomyIcon,\n order: 40\n },\n user: {\n label: 'User',\n items: {},\n icon: UserIcon,\n order: 90\n },\n settings: {\n label: 'Settings',\n items: {},\n icon: SettingsIcon,\n order: 100\n }\n }\n }\n });\n });\n\n const entityDataListingRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier`,\n key: 'entityDataListing',\n component: EntityDataListing,\n exact: true\n };\n\n const editEntityRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action/:id`,\n key: 'editEntity',\n component: EntityManager,\n exact: true\n };\n\n const addEntityRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action`,\n key: 'createEntity',\n component: EntityManager,\n exact: true\n };\n\n app.addRoute(entityDataListingRoute);\n app.addRoute(editEntityRoute);\n app.addRoute(addEntityRoute);\n\n return {\n name: PLUGIN_NAME,\n version: pkg.version\n };\n}\n\nload.pluginName = PLUGIN_NAME;\n"],"mappings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F;YACF,CAAC,CAAC;UACJ,CAAC,CAAC;UAEIhC,sBAAsB,GAAG;YAC7BuC,IAAI,KAAAC,MAAA,CAAKC,8BAAmB,uBAAoB;YAChDC,GAAG,EAAE,mBAAmB;YACxB1B,SAAS,EAAEjC,iBAAiB;YAC5B4D,KAAK,EAAE;UACT,CAAC;UAEK1C,eAAe,GAAG;YACtBsC,IAAI,KAAAC,MAAA,CAAKC,8BAAmB,mCAAgC;YAC5DC,GAAG,EAAE,YAAY;YACjB1B,SAAS,EAAE3B,aAAa;YACxBsD,KAAK,EAAE;UACT,CAAC;UAEKzC,cAAc,GAAG;YACrBqC,IAAI,KAAAC,MAAA,CAAKC,8BAAmB,+BAA4B;YACxDC,GAAG,EAAE,cAAc;YACnB1B,SAAS,EAAE3B,aAAa;YACxBsD,KAAK,EAAE;UACT,CAAC;UAED5C,GAAG,CAAC6C,QAAQ,CAAC5C,sBAAsB,CAAC;UACpCD,GAAG,CAAC6C,QAAQ,CAAC3C,eAAe,CAAC;UAC7BF,GAAG,CAAC6C,QAAQ,CAAC1C,cAAc,CAAC;UAAC,OAAAG,SAAA,CAAAwC,MAAA,WAEtB;YACLC,IAAI,EAAEC,sBAAW;YACjBC,OAAO,EAAEC,mBAAG,CAACD;UACf,CAAC;QAAA;QAAA;UAAA,OAAA3C,SAAA,CAAAiB,IAAA;MAAA;IAAA,GAAAxB,QAAA;EAAA,CACF;EAAA,OAAAN,KAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAEDJ,IAAI,CAAC4D,UAAU,GAAGH,sBAAW"}
|
|
@@ -10,19 +10,22 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
10
10
|
require("core-js/modules/es.array.for-each.js");
|
|
11
11
|
require("core-js/modules/es.object.to-string.js");
|
|
12
12
|
require("core-js/modules/web.dom-collections.for-each.js");
|
|
13
|
+
require("core-js/modules/es.object.entries.js");
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
15
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
16
|
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
15
17
|
var _require = require('../constants'),
|
|
16
18
|
MENU_PERMISSIONS = _require.MENU_PERMISSIONS;
|
|
17
|
-
function getAddContentMenuItems(app
|
|
19
|
+
function getAddContentMenuItems(app) {
|
|
18
20
|
return /*#__PURE__*/function () {
|
|
19
|
-
var
|
|
20
|
-
var client, _yield$client$query, getEntitySchemas;
|
|
21
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
|
|
22
|
+
var addConfig, client, _yield$client$query, getEntitySchemas, menuItems, sectionMenuItems, menuConfig;
|
|
21
23
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
22
24
|
while (1) switch (_context.prev = _context.next) {
|
|
23
25
|
case 0:
|
|
26
|
+
addConfig = _ref.addConfig;
|
|
24
27
|
client = app.getClient();
|
|
25
|
-
_context.next =
|
|
28
|
+
_context.next = 4;
|
|
26
29
|
return client.query({
|
|
27
30
|
query: (0, _adminUiUtils.getQuery)('GET_USER_EDITABLE_ENTITIES'),
|
|
28
31
|
variables: {
|
|
@@ -30,25 +33,70 @@ function getAddContentMenuItems(app, sectionKey) {
|
|
|
30
33
|
canDoActions: MENU_PERMISSIONS
|
|
31
34
|
}
|
|
32
35
|
});
|
|
33
|
-
case
|
|
36
|
+
case 4:
|
|
34
37
|
_yield$client$query = _context.sent;
|
|
35
38
|
getEntitySchemas = _yield$client$query.data.getEntitySchemas;
|
|
36
|
-
getEntitySchemas.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
if (!(!getEntitySchemas || !getEntitySchemas.length)) {
|
|
40
|
+
_context.next = 8;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
return _context.abrupt("return");
|
|
44
|
+
case 8:
|
|
45
|
+
// no items so don't add section
|
|
46
|
+
menuItems = {};
|
|
47
|
+
sectionMenuItems = {
|
|
48
|
+
settings: {}
|
|
49
|
+
};
|
|
50
|
+
getEntitySchemas.forEach(function (_ref3) {
|
|
51
|
+
var id = _ref3.id,
|
|
52
|
+
displayName = _ref3.displayName,
|
|
53
|
+
displayProperties = _ref3.displayProperties;
|
|
54
|
+
if (!displayProperties) return null;
|
|
55
|
+
var _displayProperties$ad = displayProperties.adminMenu,
|
|
56
|
+
_displayProperties$ad2 = _displayProperties$ad === void 0 ? {} : _displayProperties$ad,
|
|
57
|
+
_displayProperties$ad3 = _displayProperties$ad2.sectionKey,
|
|
58
|
+
sectionKey = _displayProperties$ad3 === void 0 ? 'settings' : _displayProperties$ad3;
|
|
59
|
+
var sectionItems = sectionMenuItems[sectionKey] || {};
|
|
60
|
+
sectionItems[id] = {
|
|
61
|
+
label: displayName,
|
|
41
62
|
uri: "/data-listing/".concat(id)
|
|
42
|
-
}
|
|
63
|
+
};
|
|
64
|
+
sectionMenuItems[sectionKey] = sectionItems;
|
|
43
65
|
});
|
|
44
|
-
|
|
66
|
+
menuConfig = {
|
|
67
|
+
main: {
|
|
68
|
+
items: {
|
|
69
|
+
settings: {
|
|
70
|
+
items: menuItems
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
Object.entries(sectionMenuItems).forEach(function (_ref4) {
|
|
76
|
+
var _ref5 = (0, _slicedToArray2["default"])(_ref4, 2),
|
|
77
|
+
sectionKey = _ref5[0],
|
|
78
|
+
sectionItems = _ref5[1];
|
|
79
|
+
var sectionConfig = menuConfig.main.items[sectionKey] || {};
|
|
80
|
+
sectionConfig.items = sectionItems;
|
|
81
|
+
menuConfig.main.items[sectionKey] = sectionConfig;
|
|
82
|
+
});
|
|
83
|
+
getEntitySchemas.forEach(function (_ref6) {
|
|
84
|
+
var id = _ref6.id,
|
|
85
|
+
displayName = _ref6.displayName;
|
|
86
|
+
menuItems[id] = {
|
|
87
|
+
label: displayName,
|
|
88
|
+
uri: "/data-listing/".concat(id)
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
addConfig(menuConfig);
|
|
92
|
+
case 15:
|
|
45
93
|
case "end":
|
|
46
94
|
return _context.stop();
|
|
47
95
|
}
|
|
48
96
|
}, _callee);
|
|
49
97
|
}));
|
|
50
98
|
return function (_x) {
|
|
51
|
-
return
|
|
99
|
+
return _ref2.apply(this, arguments);
|
|
52
100
|
};
|
|
53
101
|
}();
|
|
54
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-content-menu-items.js","names":["_adminUiUtils","require","_require","MENU_PERMISSIONS","getAddContentMenuItems","app","
|
|
1
|
+
{"version":3,"file":"add-content-menu-items.js","names":["_adminUiUtils","require","_require","MENU_PERMISSIONS","getAddContentMenuItems","app","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","_ref","addConfig","client","_yield$client$query","getEntitySchemas","menuItems","sectionMenuItems","menuConfig","wrap","_callee$","_context","prev","next","getClient","query","getQuery","variables","canDoActions","sent","data","length","abrupt","settings","forEach","_ref3","id","displayName","displayProperties","_displayProperties$ad","adminMenu","_displayProperties$ad2","_displayProperties$ad3","sectionKey","sectionItems","label","uri","concat","main","items","Object","entries","_ref4","_ref5","_slicedToArray2","sectionConfig","_ref6","stop","_x","apply","arguments","_default","exports"],"sources":["../../src/utils/add-content-menu-items.js"],"sourcesContent":["import { getQuery } from '@blaze-cms/admin-ui-utils';\n\nconst { MENU_PERMISSIONS } = require('../constants');\n\nfunction getAddContentMenuItems(app) {\n return async ({ addConfig }) => {\n const client = app.getClient();\n const {\n data: { getEntitySchemas }\n } = await client.query({\n query: getQuery('GET_USER_EDITABLE_ENTITIES'),\n variables: {\n // only return entities that the current user can do the following actions on\n canDoActions: MENU_PERMISSIONS\n }\n });\n\n if (!getEntitySchemas || !getEntitySchemas.length) return; // no items so don't add section\n\n const menuItems = {};\n const sectionMenuItems = { settings: {} };\n\n getEntitySchemas.forEach(({ id, displayName, displayProperties }) => {\n if (!displayProperties) return null;\n\n const { adminMenu: { sectionKey = 'settings' } = {} } = displayProperties;\n const sectionItems = sectionMenuItems[sectionKey] || {};\n sectionItems[id] = {\n label: displayName,\n uri: `/data-listing/${id}`\n };\n sectionMenuItems[sectionKey] = sectionItems;\n });\n\n const menuConfig = {\n main: {\n items: {\n settings: {\n items: menuItems\n }\n }\n }\n };\n\n Object.entries(sectionMenuItems).forEach(([sectionKey, sectionItems]) => {\n const sectionConfig = menuConfig.main.items[sectionKey] || {};\n sectionConfig.items = sectionItems;\n menuConfig.main.items[sectionKey] = sectionConfig;\n });\n\n getEntitySchemas.forEach(({ id, displayName }) => {\n menuItems[id] = {\n label: displayName,\n uri: `/data-listing/${id}`\n };\n });\n\n addConfig(menuConfig);\n };\n}\n\nexport default getAddContentMenuItems;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAA6BD,OAAO,CAAC,cAAc,CAAC;EAA5CE,gBAAgB,GAAAD,QAAA,CAAhBC,gBAAgB;AAExB,SAASC,sBAAsBA,CAACC,GAAG,EAAE;EACnC;IAAA,IAAAC,KAAA,OAAAC,kBAAA,2BAAAC,YAAA,YAAAC,IAAA,CAAO,SAAAC,QAAAC,IAAA;MAAA,IAAAC,SAAA,EAAAC,MAAA,EAAAC,mBAAA,EAAAC,gBAAA,EAAAC,SAAA,EAAAC,gBAAA,EAAAC,UAAA;MAAA,OAAAV,YAAA,YAAAW,IAAA,UAAAC,SAAAC,QAAA;QAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;UAAA;YAASX,SAAS,GAAAD,IAAA,CAATC,SAAS;YACjBC,MAAM,GAAGR,GAAG,CAACmB,SAAS,CAAC,CAAC;YAAAH,QAAA,CAAAE,IAAA;YAAA,OAGpBV,MAAM,CAACY,KAAK,CAAC;cACrBA,KAAK,EAAE,I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LhB,QAAQ,EAAE;oBACRgB,KAAK,EAAEjC;kBACT;gBACF;cACF;YACF,CAAC;YAEDkC,MAAM,CAACC,OAAO,CAAClC,gBAAgB,CAAC,CAACiB,OAAO,CAAC,UAAAkB,KAAA,EAAgC;cAAA,IAAAC,KAAA,OAAAC,eAAA,aAAAF,KAAA;gBAA9BT,UAAU,GAAAU,KAAA;gBAAET,YAAY,GAAAS,KAAA;cACjE,IAAME,aAAa,GAAGrC,UAAU,CAAC8B,IAAI,CAACC,KAAK,CAACN,UAAU,CAAC,IAAI,CAAC,CAAC;cAC7DY,aAAa,CAACN,KAAK,GAAGL,YAAY;cAClC1B,UAAU,CAAC8B,IAAI,CAACC,KAAK,CAACN,UAAU,CAAC,GAAGY,aAAa;YACnD,CAAC,CAAC;YAEFxC,gBAAgB,CAACmB,OAAO,CAAC,UAAAsB,KAAA,EAAyB;cAAA,IAAtBpB,EAAE,GAAAoB,KAAA,CAAFpB,EAAE;gBAAEC,WAAW,GAAAmB,KAAA,CAAXnB,WAAW;cACzCrB,SAAS,CAACoB,EAAE,CAAC,GAAG;gBACdS,KAAK,EAAER,WAAW;gBAClBS,GAAG,mBAAAC,MAAA,CAAmBX,EAAE;cAC1B,CAAC;YACH,CAAC,CAAC;YAEFxB,SAAS,CAACM,UAAU,CAAC;UAAC;UAAA;YAAA,OAAAG,QAAA,CAAAoC,IAAA;QAAA;MAAA,GAAA/C,OAAA;IAAA,CACvB;IAAA,iBAAAgD,EAAA;MAAA,OAAApD,KAAA,CAAAqD,KAAA,OAAAC,SAAA;IAAA;EAAA;AACH;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEc1D,sBAAsB"}
|
|
@@ -6,15 +6,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
|
-
require("core-js/modules/es.array.join.js");
|
|
10
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
+
require("core-js/modules/es.array.join.js");
|
|
11
11
|
var _client = require("@apollo/client");
|
|
12
12
|
var _coreErrors = require("@blaze-cms/core-errors");
|
|
13
|
+
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
13
14
|
var _templateObject;
|
|
14
|
-
function
|
|
15
|
+
var buildAdminSearchQuery = function buildAdminSearchQuery(entitySchema) {
|
|
16
|
+
var _ref = entitySchema || {},
|
|
17
|
+
_ref$listingPropertie = _ref.listingProperties,
|
|
18
|
+
listingProperties = _ref$listingPropertie === void 0 ? [] : _ref$listingPropertie;
|
|
19
|
+
var parsedProperties = "id, ".concat(listingProperties.join(' ') || 'id name');
|
|
20
|
+
return (0, _adminUiUtils.getDynamicQuery)('ADMIN_SEARCH')([entitySchema], parsedProperties, true);
|
|
21
|
+
};
|
|
22
|
+
function buildListingQuery(entitySchema, isSearchQuery) {
|
|
15
23
|
if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {
|
|
16
24
|
throw new _coreErrors.BlazeError('Listing query requires getAll action and listingProperties from entity schema');
|
|
17
25
|
}
|
|
26
|
+
if (isSearchQuery) return buildAdminSearchQuery(entitySchema);
|
|
18
27
|
var sortType = entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);
|
|
19
28
|
return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n query ", "($where: JSON, $limit: Int, $offset:Int, $sort: [", "SortItem]) {\n listingData: ", "(where: $where, limit: $limit, offset:$offset, sort:$sort){\n id,\n ", "\n }\n }\n "])), entitySchema.actions.getAll, sortType, entitySchema.actions.getAll, entitySchema.listingProperties.join(',\n'));
|
|
20
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-listing-query.js","names":["_client","require","_coreErrors","_templateObject","
|
|
1
|
+
{"version":3,"file":"build-listing-query.js","names":["_client","require","_coreErrors","_adminUiUtils","_templateObject","buildAdminSearchQuery","entitySchema","_ref","_ref$listingPropertie","listingProperties","parsedProperties","concat","join","getDynamicQuery","buildListingQuery","isSearchQuery","actions","getAll","BlazeError","sortType","toUpperCase","substr","gql","_taggedTemplateLiteral2","_default","exports"],"sources":["../../src/utils/build-listing-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport { getDynamicQuery } from '@blaze-cms/admin-ui-utils';\n\nconst buildAdminSearchQuery = entitySchema => {\n const { listingProperties = [] } = entitySchema || {};\n const parsedProperties = `id, ${listingProperties.join(' ') || 'id name'}`;\n\n return getDynamicQuery('ADMIN_SEARCH')([entitySchema], parsedProperties, true);\n};\n\nfunction buildListingQuery(entitySchema, isSearchQuery) {\n if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {\n throw new BlazeError(\n 'Listing query requires getAll action and listingProperties from entity schema'\n );\n }\n\n if (isSearchQuery) return buildAdminSearchQuery(entitySchema);\n\n const sortType =\n entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);\n\n return gql`\n query ${\n entitySchema.actions.getAll\n }($where: JSON, $limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {\n listingData: ${\n entitySchema.actions.getAll\n }(where: $where, limit: $limit, offset:$offset, sort:$sort){\n id,\n ${entitySchema.listingProperties.join(',\\n')}\n }\n }\n `;\n}\n\nexport default buildListingQuery;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAA4D,IAAAG,eAAA;AAE5D,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAGC,YAAY,EAAI;EAC5C,IAAAC,IAAA,GAAmCD,YAAY,IAAI,CAAC,CAAC;IAAAE,qBAAA,GAAAD,IAAA,CAA7CE,iBAAiB;IAAjBA,iBAAiB,GAAAD,qBAAA,cAAG,EAAE,GAAAA,qBAAA;EAC9B,IAAME,gBAAgB,UAAAC,MAAA,CAAUF,iBAAiB,CAACG,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,CAAE;EAE1E,OAAO,IAAAC,6BAAe,EAAC,cAAc,CAAC,CAAC,CAACP,YAAY,CAAC,EAAEI,gBAAgB,EAAE,IAAI,CAAC;AAChF,CAAC;AAED,SAASI,iBAAiBA,CAACR,YAAY,EAAES,aAAa,EAAE;EACtD,IAAI,CAACT,YAAY,CAACU,OAAO,IAAI,CAACV,YAAY,CAACU,OAAO,CAACC,MAAM,IAAI,CAACX,YAAY,CAACG,iBAAiB,EAAE;IAC5F,MAAM,IAAIS,sBAAU,CAClB,+EACF,CAAC;EACH;EAEA,IAAIH,aAAa,EAAE,OAAOV,qBAAqB,CAACC,YAAY,CAAC;EAE7D,IAAMa,QAAQ,GACZb,YAAY,CAACU,OAAO,CAACC,MAAM,CAAC,CAAC,CAAC,CAACG,WAAW,CAAC,CAAC,GAAGd,YAAY,CAACU,OAAO,CAACC,MAAM,CAACI,MAAM,CAAC,CAAC,CAAC;EAEtF,WAAOC,WAAG,EAAAlB,eAAA,KAAAA,eAAA,OAAAmB,uBAAA,yOAENjB,YAAY,CAACU,OAAO,CAACC,MAAM,EACuBE,QAAQ,EAExDb,YAAY,CAACU,OAAO,CAACC,MAAM,EAGzBX,YAAY,CAACG,iBAAiB,CAACG,IAAI,CAAC,KAAK,CAAC;AAIpD;AAAC,IAAAY,QAAA,GAAAC,OAAA,cAEcX,iBAAiB"}
|
|
@@ -5,11 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.getDefaultQueryParams = void 0;
|
|
8
|
-
var getDefaultQueryParams = exports.getDefaultQueryParams = function getDefaultQueryParams(
|
|
9
|
-
var schema = _ref.schema;
|
|
8
|
+
var getDefaultQueryParams = exports.getDefaultQueryParams = function getDefaultQueryParams(schema) {
|
|
10
9
|
var updated = schema.properties && schema.properties.updated;
|
|
11
|
-
var
|
|
12
|
-
where =
|
|
10
|
+
var _ref = schema.displayProperties || {},
|
|
11
|
+
where = _ref.adminDefaultListingFilter;
|
|
13
12
|
return {
|
|
14
13
|
where: where,
|
|
15
14
|
limit: 40,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","exports","
|
|
1
|
+
{"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","exports","schema","updated","properties","_ref","displayProperties","where","adminDefaultListingFilter","limit","offset","sort","property","direction"],"sources":["../../src/utils/get-default-query-params.js"],"sourcesContent":["const getDefaultQueryParams = schema => {\n const updated = schema.properties && schema.properties.updated;\n const { adminDefaultListingFilter: where } = schema.displayProperties || {};\n\n return {\n where,\n limit: 40,\n offset: 0,\n sort: updated\n ? [\n {\n property: 'updated',\n direction: 'desc'\n }\n ]\n : []\n };\n};\n\nexport { getDefaultQueryParams };\n"],"mappings":";;;;;;;AAAA,IAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,SAAxBA,qBAAqBA,CAAGE,MAAM,EAAI;EACtC,IAAMC,OAAO,GAAGD,MAAM,CAACE,UAAU,IAAIF,MAAM,CAACE,UAAU,CAACD,OAAO;EAC9D,IAAAE,IAAA,GAA6CH,MAAM,CAACI,iBAAiB,IAAI,CAAC,CAAC;IAAxCC,KAAK,GAAAF,IAAA,CAAhCG,yBAAyB;EAEjC,OAAO;IACLD,KAAK,EAALA,KAAK;IACLE,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAER,OAAO,GACT,CACE;MACES,QAAQ,EAAE,SAAS;MACnBC,SAAS,EAAE;IACb,CAAC,CACF,GACD;EACN,CAAC;AACH,CAAC"}
|
|
@@ -5,22 +5,13 @@ import { getQuery } from '@blaze-cms/admin-ui-utils';
|
|
|
5
5
|
import ListingTable from '../ListingTable/ListingTable';
|
|
6
6
|
import { withContext } from '../../utils/hoc/withContext';
|
|
7
7
|
const EntityDataListing = ({
|
|
8
|
-
match
|
|
9
|
-
menuItems
|
|
8
|
+
match
|
|
10
9
|
}) => {
|
|
11
10
|
const {
|
|
12
11
|
params: {
|
|
13
12
|
entityIdentifier: identifier
|
|
14
13
|
}
|
|
15
14
|
} = match;
|
|
16
|
-
const [[selectedMenuItem]] = menuItems.map(([_, {
|
|
17
|
-
items
|
|
18
|
-
}]) => {
|
|
19
|
-
const item = items.filter(({
|
|
20
|
-
uri
|
|
21
|
-
}) => uri.endsWith(`/${identifier}`));
|
|
22
|
-
return item.length ? item : null;
|
|
23
|
-
}).filter(Boolean);
|
|
24
15
|
const {
|
|
25
16
|
data: {
|
|
26
17
|
getEntitySchemas = []
|
|
@@ -32,13 +23,11 @@ const EntityDataListing = ({
|
|
|
32
23
|
});
|
|
33
24
|
if (!getEntitySchemas.length) return '';
|
|
34
25
|
return /*#__PURE__*/React.createElement(ListingTable, {
|
|
35
|
-
entitySchema: getEntitySchemas[0]
|
|
36
|
-
selectedMenuItem: selectedMenuItem
|
|
26
|
+
entitySchema: getEntitySchemas[0]
|
|
37
27
|
});
|
|
38
28
|
};
|
|
39
29
|
EntityDataListing.propTypes = {
|
|
40
|
-
match: PropTypes.object.isRequired
|
|
41
|
-
menuItems: PropTypes.array.isRequired
|
|
30
|
+
match: PropTypes.object.isRequired
|
|
42
31
|
};
|
|
43
32
|
export default withContext(EntityDataListing);
|
|
44
33
|
//# sourceMappingURL=EntityDataListing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityDataListing.js","names":["useQuery","React","PropTypes","getQuery","ListingTable","withContext","EntityDataListing","match","
|
|
1
|
+
{"version":3,"file":"EntityDataListing.js","names":["useQuery","React","PropTypes","getQuery","ListingTable","withContext","EntityDataListing","match","params","entityIdentifier","identifier","data","getEntitySchemas","variables","length","createElement","entitySchema","propTypes","object","isRequired"],"sources":["../../../src/components/EntityDataListing/EntityDataListing.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\n\nimport ListingTable from '../ListingTable/ListingTable';\nimport { withContext } from '../../utils/hoc/withContext';\n\nconst EntityDataListing = ({ match }) => {\n const {\n params: { entityIdentifier: identifier }\n } = match;\n\n const { data: { getEntitySchemas = [] } = {} } = useQuery(getQuery('GET_ENTITY_SCHEMA'), {\n variables: { identifier }\n });\n\n if (!getEntitySchemas.length) return '';\n\n return <ListingTable entitySchema={getEntitySchemas[0]} />;\n};\n\nEntityDataListing.propTypes = {\n match: PropTypes.object.isRequired\n};\n\nexport default withContext(EntityDataListing);\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,QAAQ,2BAA2B;AAEpD,OAAOC,YAAY,MAAM,8BAA8B;AACvD,SAASC,WAAW,QAAQ,6BAA6B;AAEzD,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC;AAAM,CAAC,KAAK;EACvC,MAAM;IACJC,MAAM,EAAE;MAAEC,gBAAgB,EAAEC;IAAW;EACzC,CAAC,GAAGH,KAAK;EAET,MAAM;IAAEI,IAAI,EAAE;MAAEC,gBAAgB,GAAG;IAAG,CAAC,GAAG,CAAC;EAAE,CAAC,GAAGZ,QAAQ,CAACG,QAAQ,CAAC,mBAAmB,CAAC,EAAE;IACvFU,SAAS,EAAE;MAAEH;IAAW;EAC1B,CAAC,CAAC;EAEF,IAAI,CAACE,gBAAgB,CAACE,MAAM,EAAE,OAAO,EAAE;EAEvC,oBAAOb,KAAA,CAAAc,aAAA,CAACX,YAAY;IAACY,YAAY,EAAEJ,gBAAgB,CAAC,CAAC;EAAE,CAAE,CAAC;AAC5D,CAAC;AAEDN,iBAAiB,CAACW,SAAS,GAAG;EAC5BV,KAAK,EAAEL,SAAS,CAACgB,MAAM,CAACC;AAC1B,CAAC;AAED,eAAed,WAAW,CAACC,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|