@blaze-cms/plugin-data-ui 0.139.0-alpha.3 → 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 +56 -0
- package/README.md +42 -0
- package/lib/components/EntityDataListing/EntityDataListing.js +4 -26
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityDataListing/index.js +1 -2
- package/lib/components/EntityDataListing/index.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 +19 -7
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +1 -2
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +1 -2
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/index.js +1 -2
- package/lib/components/EntityManager/Entity/EntityHeader/index.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 +15 -6
- 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/EntityManager/Entity/actions-handlers/create/index.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/index.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +1 -2
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/index.js +1 -2
- package/lib/components/EntityManager/Entity/index.js.map +1 -1
- package/lib/components/EntityManager/EntityManager.js +3 -4
- package/lib/components/EntityManager/EntityManager.js.map +1 -1
- package/lib/components/EntityManager/index.js +1 -2
- package/lib/components/EntityManager/index.js.map +1 -1
- package/lib/components/EntityManager/utils/data-mappers.js +4 -8
- package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib/components/EntityManager/utils/entityAvailableActions.js +1 -2
- package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib/components/EntityManager/utils/is-form-empty.js +1 -2
- package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
- package/lib/components/EntityManager/utils/query.js +1 -2
- package/lib/components/EntityManager/utils/query.js.map +1 -1
- 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 +127 -84
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +9 -22
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/index.js +1 -2
- package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
- package/lib/components/ListingTable/TableActions/TableActions.js +1 -2
- package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
- package/lib/components/ListingTable/TableActions/index.js +1 -2
- package/lib/components/ListingTable/TableActions/index.js.map +1 -1
- package/lib/components/ListingTable/index.js +1 -2
- package/lib/components/ListingTable/index.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +92 -29
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +74 -13
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/components/Tabs/index.js +3 -4
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/constants.js +33 -49
- 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 +40 -13
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +62 -15
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-create-entity-mutation.js +1 -2
- package/lib/utils/build-create-entity-mutation.js.map +1 -1
- package/lib/utils/build-delete-entity-mutation.js +1 -2
- package/lib/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib/utils/build-listing-query.js +12 -4
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/build-update-data-query.js +1 -2
- package/lib/utils/build-update-data-query.js.map +1 -1
- package/lib/utils/build-update-publish-unpublish-mutation.js +1 -2
- package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib/utils/get-default-query-params.js +3 -5
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib/utils/hoc/withContext.js +1 -2
- package/lib/utils/hoc/withContext.js.map +1 -1
- package/lib/utils/hooks/useToggle.js +1 -2
- package/lib/utils/hooks/useToggle.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 -51
- 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 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsIcon.js","names":["React","ICON_SIZE","ICON_COLOR","SettingsIcon","width","WIDTH","height","HEIGHT","stroke","STROKE","createElement","viewBox","version","xmlns","xmlnsXlink","id","strokeWidth","fill","fillRule","strokeLinecap","strokeLinejoin","transform","d"],"sources":["../../src/icons/SettingsIcon.js"],"sourcesContent":["import React from 'react';\nimport { ICON_SIZE, ICON_COLOR } from '../constants';\n\nfunction SettingsIcon({\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>setting</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 <path\n d=\"M8.13888889,1.46333333 C8.61222222,-0.487777777 11.3877778,-0.487777777 11.8611111,1.46333333 C12.0051589,2.05784356 12.4244819,2.54780471 12.9896128,2.78193979 C13.5547438,3.01607487 14.1977123,2.96622362 14.72,2.64777778 C16.4344444,1.60333333 18.3977778,3.56555556 17.3533333,5.28111111 C17.0353472,5.803171 16.9856162,6.44564563 17.2194755,7.0104213 C17.4533348,7.57519696 17.9426987,7.99444609 18.5366667,8.13888889 C20.4877778,8.61222222 20.4877778,11.3877778 18.5366667,11.8611111 C17.9421564,12.0051589 17.4521953,12.4244819 17.2180602,12.9896128 C16.9839251,13.5547438 17.0337764,14.1977123 17.3522222,14.72 C18.3966667,16.4344444 16.4344444,18.3977778 14.7188889,17.3533333 C14.196829,17.0353472 13.5543544,16.9856162 12.9895787,17.2194755 C12.424803,17.4533348 12.0055539,17.9426987 11.8611111,18.5366667 C11.3877778,20.4877778 8.61222222,20.4877778 8.13888889,18.5366667 C7.99484107,17.9421564 7.57551807,17.4521953 7.01038716,17.2180602 C6.44525624,16.9839251 5.80228769,17.0337764 5.28,17.3522222 C3.56555556,18.3966667 1.60222222,16.4344444 2.64666667,14.7188889 C2.96465281,14.196829 3.01438377,13.5543544 2.78052448,12.9895787 C2.5466652,12.424803 2.05730134,12.0055539 1.46333333,11.8611111 C-0.487777777,11.3877778 -0.487777777,8.61222222 1.46333333,8.13888889 C2.05784356,7.99484107 2.54780471,7.57551807 2.78193979,7.01038716 C3.01607487,6.44525624 2.96622362,5.80228769 2.64777778,5.28 C1.60333333,3.56555556 3.56555556,1.60222222 5.28111111,2.64666667 C6.38777778,3.32222222 7.83222222,2.72444444 8.13888889,1.46333333 Z\"\n id=\"Path\"\n />\n <path\n d=\"M13.6666666,10.3333333 C13.6666666,12.1742825 12.1742825,13.6666666 10.3333333,13.6666666 C8.49238416,13.6666666 7,12.1742825 7,10.3333333 C7,8.49238416 8.49238416,7 10.3333333,7 C12.1742825,7 13.6666666,8.49238416 13.6666666,10.3333333 L13.6666666,10.3333333 Z\"\n id=\"Path\"\n />\n </g>\n </g>\n </svg>\n );\n}\n\nexport default SettingsIcon;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AAEpD,SAASC,YAAYA,CAAC;EACpBC,KAAK,GAAGH,SAAS,CAACI,KAAK;EACvBC,MAAM,GAAGL,SAAS,CAACM,MAAM;EACzBC,MAAM,GAAGN,UAAU,CAACO;AACtB,CAAC,EAAE;EACD,oBACET,KAAA,CAAAU,aAAA;IACEN,KAAK,EAAEA,KAAM;IACbE,MAAM,EAAEA,MAAO;IACfK,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC,KAAK;IACbC,KAAK,EAAC,4BAA4B;IAClCC,UAAU,EAAC;EAA8B,gBACzCd,KAAA,CAAAU,aAAA,gBAAO,SAAc,CAAC,eACtBV,KAAA,CAAAU,aAAA;IACEK,EAAE,EAAC,QAAQ;IACXP,MAAM,EAAC,MAAM;IACbQ,WAAW,EAAE,CAAE;IACfC,IAAI,EAAC,MAAM;IACXC,QAAQ,EAAC,SAAS;IAClBC,aAAa,EAAC,OAAO;IACrBC,cAAc,EAAC;EAAO,gBACtBpB,KAAA,CAAAU,aAAA;IAAGK,EAAE,EAAC,OAAO;IAACM,SAAS,EAAC,iBAAiB;IAACb,MAAM,EAAEA;EAAO,gBACvDR,KAAA,CAAAU,aAAA;IACEY,CAAC,EAAC,ygDAAygD;IAC3gDP,EAAE,EAAC;EAAM,CACV,CAAC,eACFf,KAAA,CAAAU,aAAA;IACEY,CAAC,EAAC,uQAAuQ;IACzQP,EAAE,EAAC;EAAM,CACV,CACA,CACF,CACA,CAAC;AAEV;AAEA,eAAeZ,YAAY"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ICON_SIZE, ICON_COLOR } from '../constants';
|
|
3
|
+
function TaxonomyIcon({
|
|
4
|
+
width = ICON_SIZE.WIDTH,
|
|
5
|
+
height = ICON_SIZE.HEIGHT,
|
|
6
|
+
stroke = ICON_COLOR.STROKE
|
|
7
|
+
}) {
|
|
8
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
9
|
+
width: width,
|
|
10
|
+
height: height,
|
|
11
|
+
viewBox: "0 0 22 22",
|
|
12
|
+
version: "1.1",
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
15
|
+
}, /*#__PURE__*/React.createElement("title", null, "taxonomy"), /*#__PURE__*/React.createElement("g", {
|
|
16
|
+
id: "Page-1",
|
|
17
|
+
stroke: "none",
|
|
18
|
+
strokeWidth: "1",
|
|
19
|
+
fill: "none",
|
|
20
|
+
fillRule: "evenodd",
|
|
21
|
+
strokeLinecap: "round",
|
|
22
|
+
strokeLinejoin: "round"
|
|
23
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
24
|
+
id: "Group",
|
|
25
|
+
transform: "translate(1, 1)",
|
|
26
|
+
stroke: stroke
|
|
27
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
28
|
+
id: "Rectangle",
|
|
29
|
+
x: "0",
|
|
30
|
+
y: "13.2173913",
|
|
31
|
+
width: "6.78260868",
|
|
32
|
+
height: "6.60869564",
|
|
33
|
+
rx: "1.5"
|
|
34
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
35
|
+
id: "Rectangle",
|
|
36
|
+
x: "13.2173913",
|
|
37
|
+
y: "13.2173913",
|
|
38
|
+
width: "6.78260868",
|
|
39
|
+
height: "6.60869564",
|
|
40
|
+
rx: "1.5"
|
|
41
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
42
|
+
id: "Rectangle",
|
|
43
|
+
x: "6.60869564",
|
|
44
|
+
y: "0",
|
|
45
|
+
width: "6.78260868",
|
|
46
|
+
height: "6.60869564",
|
|
47
|
+
rx: "1.5"
|
|
48
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
49
|
+
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",
|
|
50
|
+
id: "Path"
|
|
51
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
52
|
+
x1: "9.91304346",
|
|
53
|
+
y1: "6.60869564",
|
|
54
|
+
x2: "9.91304346",
|
|
55
|
+
y2: "9.91304346",
|
|
56
|
+
id: "Path"
|
|
57
|
+
}))));
|
|
58
|
+
}
|
|
59
|
+
export default TaxonomyIcon;
|
|
60
|
+
//# sourceMappingURL=TaxonomyIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaxonomyIcon.js","names":["React","ICON_SIZE","ICON_COLOR","TaxonomyIcon","width","WIDTH","height","HEIGHT","stroke","STROKE","createElement","viewBox","version","xmlns","xmlnsXlink","id","strokeWidth","fill","fillRule","strokeLinecap","strokeLinejoin","transform","x","y","rx","d","x1","y1","x2","y2"],"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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AAEpD,SAASC,YAAYA,CAAC;EACpBC,KAAK,GAAGH,SAAS,CAACI,KAAK;EACvBC,MAAM,GAAGL,SAAS,CAACM,MAAM;EACzBC,MAAM,GAAGN,UAAU,CAACO;AACtB,CAAC,EAAE;EACD,oBACET,KAAA,CAAAU,aAAA;IACEN,KAAK,EAAEA,KAAM;IACbE,MAAM,EAAEA,MAAO;IACfK,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC,KAAK;IACbC,KAAK,EAAC,4BAA4B;IAClCC,UAAU,EAAC;EAA8B,gBACzCd,KAAA,CAAAU,aAAA,gBAAO,UAAe,CAAC,eACvBV,KAAA,CAAAU,aAAA;IACEK,EAAE,EAAC,QAAQ;IACXP,MAAM,EAAC,MAAM;IACbQ,WAAW,EAAC,GAAG;IACfC,IAAI,EAAC,MAAM;IACXC,QAAQ,EAAC,SAAS;IAClBC,aAAa,EAAC,OAAO;IACrBC,cAAc,EAAC;EAAO,gBACtBpB,KAAA,CAAAU,aAAA;IAAGK,EAAE,EAAC,OAAO;IAACM,SAAS,EAAC,iBAAiB;IAACb,MAAM,EAAEA;EAAO,gBACvDR,KAAA,CAAAU,aAAA;IACEK,EAAE,EAAC,WAAW;IACdO,CAAC,EAAC,GAAG;IACLC,CAAC,EAAC,YAAY;IACdnB,KAAK,EAAC,YAAY;IAClBE,MAAM,EAAC,YAAY;IACnBkB,EAAE,EAAC;EAAK,CACT,CAAC,eACFxB,KAAA,CAAAU,aAAA;IACEK,EAAE,EAAC,WAAW;IACdO,CAAC,EAAC,YAAY;IACdC,CAAC,EAAC,YAAY;IACdnB,KAAK,EAAC,YAAY;IAClBE,MAAM,EAAC,YAAY;IACnBkB,EAAE,EAAC;EAAK,CACT,CAAC,eACFxB,KAAA,CAAAU,aAAA;IACEK,EAAE,EAAC,WAAW;IACdO,CAAC,EAAC,YAAY;IACdC,CAAC,EAAC,GAAG;IACLnB,KAAK,EAAC,YAAY;IAClBE,MAAM,EAAC,YAAY;IACnBkB,EAAE,EAAC;EAAK,CACT,CAAC,eACFxB,KAAA,CAAAU,aAAA;IACEe,CAAC,EAAC,gOAAgO;IAClOV,EAAE,EAAC;EAAM,CACV,CAAC,eACFf,KAAA,CAAAU,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;AAEA,eAAeZ,YAAY"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ICON_SIZE, ICON_COLOR } from '../constants';
|
|
3
|
+
function UserIcon({
|
|
4
|
+
width = ICON_SIZE.WIDTH,
|
|
5
|
+
height = ICON_SIZE.HEIGHT,
|
|
6
|
+
stroke = ICON_COLOR.STROKE
|
|
7
|
+
}) {
|
|
8
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
9
|
+
width: width,
|
|
10
|
+
height: height,
|
|
11
|
+
viewBox: "0 0 22 22",
|
|
12
|
+
version: "1.1",
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
15
|
+
}, /*#__PURE__*/React.createElement("title", null, "user"), /*#__PURE__*/React.createElement("g", {
|
|
16
|
+
id: "Page-1",
|
|
17
|
+
stroke: "none",
|
|
18
|
+
strokeWidth: 1,
|
|
19
|
+
fill: "none",
|
|
20
|
+
fillRule: "evenodd",
|
|
21
|
+
strokeLinecap: "round",
|
|
22
|
+
strokeLinejoin: "round"
|
|
23
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
24
|
+
id: "Group",
|
|
25
|
+
transform: "translate(1, 0.76)",
|
|
26
|
+
stroke: stroke
|
|
27
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
28
|
+
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",
|
|
29
|
+
id: "Shape"
|
|
30
|
+
}))));
|
|
31
|
+
}
|
|
32
|
+
export default UserIcon;
|
|
33
|
+
//# sourceMappingURL=UsersIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UsersIcon.js","names":["React","ICON_SIZE","ICON_COLOR","UserIcon","width","WIDTH","height","HEIGHT","stroke","STROKE","createElement","viewBox","version","xmlns","xmlnsXlink","id","strokeWidth","fill","fillRule","strokeLinecap","strokeLinejoin","transform","d"],"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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AAEpD,SAASC,QAAQA,CAAC;EAChBC,KAAK,GAAGH,SAAS,CAACI,KAAK;EACvBC,MAAM,GAAGL,SAAS,CAACM,MAAM;EACzBC,MAAM,GAAGN,UAAU,CAACO;AACtB,CAAC,EAAE;EACD,oBACET,KAAA,CAAAU,aAAA;IACEN,KAAK,EAAEA,KAAM;IACbE,MAAM,EAAEA,MAAO;IACfK,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC,KAAK;IACbC,KAAK,EAAC,4BAA4B;IAClCC,UAAU,EAAC;EAA8B,gBACzCd,KAAA,CAAAU,aAAA,gBAAO,MAAW,CAAC,eACnBV,KAAA,CAAAU,aAAA;IACEK,EAAE,EAAC,QAAQ;IACXP,MAAM,EAAC,MAAM;IACbQ,WAAW,EAAE,CAAE;IACfC,IAAI,EAAC,MAAM;IACXC,QAAQ,EAAC,SAAS;IAClBC,aAAa,EAAC,OAAO;IACrBC,cAAc,EAAC;EAAO,gBACtBpB,KAAA,CAAAU,aAAA;IAAGK,EAAE,EAAC,OAAO;IAACM,SAAS,EAAC,oBAAoB;IAACb,MAAM,EAAEA;EAAO,gBAC1DR,KAAA,CAAAU,aAAA;IACEY,CAAC,EAAC,kqBAAkqB;IACpqBP,EAAE,EAAC;EAAO,CACX,CACA,CACF,CACA,CAAC;AAEV;AAEA,eAAeZ,QAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["UserIcon","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,OAAOA,QAAQ,MAAM,aAAa;AAClC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,SAASH,QAAQ,EAAEC,YAAY,EAAEC,WAAW,EAAEC,YAAY"}
|
package/lib-es/index.js
CHANGED
|
@@ -3,18 +3,11 @@ import React from 'react';
|
|
|
3
3
|
import pkg from '../package.json';
|
|
4
4
|
import { DATA_LISTING_PREFIX, PLUGIN_NAME } from './constants';
|
|
5
5
|
import getAddContentMenuItems from './utils/add-content-menu-items';
|
|
6
|
+
import { UserIcon, TaxonomyIcon, ContentIcon, SettingsIcon } from './icons';
|
|
6
7
|
const EntityDataListing = React.lazy(() => import( /* webpackChunkName: 'EntityDataListing' */'./components/EntityDataListing'));
|
|
7
8
|
const EntityManager = React.lazy(() => import( /* webpackChunkName: 'EntityManager' */'./components/EntityManager'));
|
|
8
9
|
export default async function load(app) {
|
|
9
|
-
|
|
10
|
-
const sectionKey = 'content';
|
|
11
|
-
app.events.once('load:menu-section', addSection => {
|
|
12
|
-
addSection(sectionKey, {
|
|
13
|
-
header: 'content',
|
|
14
|
-
order: 100
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
app.events.once('load:menu-items', getAddContentMenuItems(app, sectionKey));
|
|
10
|
+
app.events.once('admin:menu:config:load', getAddContentMenuItems(app));
|
|
18
11
|
app.events.once('load:custom:field:type', addFieldType => {
|
|
19
12
|
Object.keys(formFieldTypes).forEach(type => {
|
|
20
13
|
addFieldType({
|
|
@@ -26,6 +19,41 @@ export default async function load(app) {
|
|
|
26
19
|
app.events.once('plugin:data-ui:load:loaded', async () => {
|
|
27
20
|
await app.events.emitAsync('load:custom:field:type', getFormBuilderLookup.addFieldType);
|
|
28
21
|
});
|
|
22
|
+
app.events.once('admin:menu:config:load', ({
|
|
23
|
+
addConfig
|
|
24
|
+
}) => {
|
|
25
|
+
addConfig({
|
|
26
|
+
main: {
|
|
27
|
+
items: {
|
|
28
|
+
content: {
|
|
29
|
+
label: 'content',
|
|
30
|
+
loadOpen: true,
|
|
31
|
+
items: {},
|
|
32
|
+
icon: ContentIcon,
|
|
33
|
+
order: 10
|
|
34
|
+
},
|
|
35
|
+
taxonomy: {
|
|
36
|
+
label: 'Taxonomy',
|
|
37
|
+
items: {},
|
|
38
|
+
icon: TaxonomyIcon,
|
|
39
|
+
order: 40
|
|
40
|
+
},
|
|
41
|
+
user: {
|
|
42
|
+
label: 'User',
|
|
43
|
+
items: {},
|
|
44
|
+
icon: UserIcon,
|
|
45
|
+
order: 90
|
|
46
|
+
},
|
|
47
|
+
settings: {
|
|
48
|
+
label: 'Settings',
|
|
49
|
+
items: {},
|
|
50
|
+
icon: SettingsIcon,
|
|
51
|
+
order: 100
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
29
57
|
const entityDataListingRoute = {
|
|
30
58
|
path: `${DATA_LISTING_PREFIX}/:entityIdentifier`,
|
|
31
59
|
key: 'entityDataListing',
|
package/lib-es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getFormBuilderLookup","formFieldTypes","React","pkg","DATA_LISTING_PREFIX","PLUGIN_NAME","getAddContentMenuItems","
|
|
1
|
+
{"version":3,"file":"index.js","names":["getFormBuilderLookup","formFieldTypes","React","pkg","DATA_LISTING_PREFIX","PLUGIN_NAME","getAddContentMenuItems","UserIcon","TaxonomyIcon","ContentIcon","SettingsIcon","EntityDataListing","lazy","EntityManager","load","app","events","once","addFieldType","Object","keys","forEach","type","component","emitAsync","addConfig","main","items","content","label","loadOpen","icon","order","taxonomy","user","settings","entityDataListingRoute","path","key","exact","editEntityRoute","addEntityRoute","addRoute","name","version","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import { getFormBuilderLookup, formFieldTypes } from '@blaze-cms/react-form-builder';\nimport React from 'react';\nimport pkg from '../package.json';\nimport { DATA_LISTING_PREFIX, PLUGIN_NAME } from './constants';\nimport getAddContentMenuItems from './utils/add-content-menu-items';\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":"AAAA,SAASA,oBAAoB,EAAEC,cAAc,QAAQ,+BAA+B;AACpF,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,GAAG,MAAM,iBAAiB;AACjC,SAASC,mBAAmB,EAAEC,WAAW,QAAQ,aAAa;AAC9D,OAAOC,sBAAsB,MAAM,gCAAgC;AACnE,SAASC,QAAQ,EAAEC,YAAY,EAAEC,WAAW,EAAEC,YAAY,QAAQ,SAAS;AAE3E,MAAMC,iBAAiB,GAAGT,KAAK,CAACU,IAAI,CAAC,MACnC,MAAM,EAAC,2CAA4C,gCAAgC,CACrF,CAAC;AACD,MAAMC,aAAa,GAAGX,KAAK,CAACU,IAAI,CAAC,MAC/B,MAAM,EAAC,uCAAwC,4BAA4B,CAC7E,CAAC;AAED,eAAe,eAAeE,IAAIA,CAACC,GAAG,EAAE;EACtCA,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,wBAAwB,EAAEX,sBAAsB,CAACS,GAAG,CAAC,CAAC;EAEtEA,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,wBAAwB,EAAEC,YAAY,IAAI;IACxDC,MAAM,CAACC,IAAI,CAACnB,cAAc,CAAC,CAACoB,OAAO,CAACC,IAAI,IAAI;MAC1CJ,YAAY,CAAC;QAAEI,IAAI;QAAEC,SAAS,EAAEtB,cAAc,CAACqB,IAAI;MAAE,CAAC,CAAC;IACzD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFP,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,4BAA4B,EAAE,YAAY;IACxD,MAAMF,GAAG,CAACC,MAAM,CAACQ,SAAS,CAAC,wBAAwB,EAAExB,oBAAoB,CAACkB,YAAY,CAAC;EACzF,CAAC,CAAC;EAEFH,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAAEQ;EAAU,CAAC,KAAK;IAC3DA,SAAS,CAAC;MACRC,IAAI,EAAE;QACJC,KAAK,EAAE;UACLC,OAAO,EAAE;YACPC,KAAK,EAAE,SAAS;YAChBC,QAAQ,EAAE,IAAI;YACdH,KAAK,EAAE,CAAC,CAAC;YACTI,IAAI,EAAEtB,WAAW;YACjBuB,KAAK,EAAE;UACT,CAAC;UACDC,QAAQ,EAAE;YACRJ,KAAK,EAAE,UAAU;YACjBF,KAAK,EAAE,CAAC,CAAC;YACTI,IAAI,EAAEvB,YAAY;YAClBwB,KAAK,EAAE;UACT,CAAC;UACDE,IAAI,EAAE;YACJL,KAAK,EAAE,MAAM;YACbF,KAAK,EAAE,CAAC,CAAC;YACTI,IAAI,EAAExB,QAAQ;YACdyB,KAAK,EAAE;UACT,CAAC;UACDG,QAAQ,EAAE;YACRN,KAAK,EAAE,UAAU;YACjBF,KAAK,EAAE,CAAC,CAAC;YACTI,IAAI,EAAErB,YAAY;YAClBsB,KAAK,EAAE;UACT;QACF;MACF;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,MAAMI,sBAAsB,GAAG;IAC7BC,IAAI,EAAG,GAAEjC,mBAAoB,oBAAmB;IAChDkC,GAAG,EAAE,mBAAmB;IACxBf,SAAS,EAAEZ,iBAAiB;IAC5B4B,KAAK,EAAE;EACT,CAAC;EAED,MAAMC,eAAe,GAAG;IACtBH,IAAI,EAAG,GAAEjC,mBAAoB,gCAA+B;IAC5DkC,GAAG,EAAE,YAAY;IACjBf,SAAS,EAAEV,aAAa;IACxB0B,KAAK,EAAE;EACT,CAAC;EAED,MAAME,cAAc,GAAG;IACrBJ,IAAI,EAAG,GAAEjC,mBAAoB,4BAA2B;IACxDkC,GAAG,EAAE,cAAc;IACnBf,SAAS,EAAEV,aAAa;IACxB0B,KAAK,EAAE;EACT,CAAC;EAEDxB,GAAG,CAAC2B,QAAQ,CAACN,sBAAsB,CAAC;EACpCrB,GAAG,CAAC2B,QAAQ,CAACF,eAAe,CAAC;EAC7BzB,GAAG,CAAC2B,QAAQ,CAACD,cAAc,CAAC;EAE5B,OAAO;IACLE,IAAI,EAAEtC,WAAW;IACjBuC,OAAO,EAAEzC,GAAG,CAACyC;EACf,CAAC;AACH;AAEA9B,IAAI,CAAC+B,UAAU,GAAGxC,WAAW"}
|
|
@@ -2,8 +2,10 @@ import { getQuery } from '@blaze-cms/admin-ui-utils';
|
|
|
2
2
|
const {
|
|
3
3
|
MENU_PERMISSIONS
|
|
4
4
|
} = require('../constants');
|
|
5
|
-
function getAddContentMenuItems(app
|
|
6
|
-
return async
|
|
5
|
+
function getAddContentMenuItems(app) {
|
|
6
|
+
return async ({
|
|
7
|
+
addConfig
|
|
8
|
+
}) => {
|
|
7
9
|
const client = app.getClient();
|
|
8
10
|
const {
|
|
9
11
|
data: {
|
|
@@ -16,15 +18,54 @@ function getAddContentMenuItems(app, sectionKey) {
|
|
|
16
18
|
canDoActions: MENU_PERMISSIONS
|
|
17
19
|
}
|
|
18
20
|
});
|
|
21
|
+
if (!getEntitySchemas || !getEntitySchemas.length) return; // no items so don't add section
|
|
22
|
+
|
|
23
|
+
const menuItems = {};
|
|
24
|
+
const sectionMenuItems = {
|
|
25
|
+
settings: {}
|
|
26
|
+
};
|
|
27
|
+
getEntitySchemas.forEach(({
|
|
28
|
+
id,
|
|
29
|
+
displayName,
|
|
30
|
+
displayProperties
|
|
31
|
+
}) => {
|
|
32
|
+
if (!displayProperties) return null;
|
|
33
|
+
const {
|
|
34
|
+
adminMenu: {
|
|
35
|
+
sectionKey = 'settings'
|
|
36
|
+
} = {}
|
|
37
|
+
} = displayProperties;
|
|
38
|
+
const sectionItems = sectionMenuItems[sectionKey] || {};
|
|
39
|
+
sectionItems[id] = {
|
|
40
|
+
label: displayName,
|
|
41
|
+
uri: `/data-listing/${id}`
|
|
42
|
+
};
|
|
43
|
+
sectionMenuItems[sectionKey] = sectionItems;
|
|
44
|
+
});
|
|
45
|
+
const menuConfig = {
|
|
46
|
+
main: {
|
|
47
|
+
items: {
|
|
48
|
+
settings: {
|
|
49
|
+
items: menuItems
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
Object.entries(sectionMenuItems).forEach(([sectionKey, sectionItems]) => {
|
|
55
|
+
const sectionConfig = menuConfig.main.items[sectionKey] || {};
|
|
56
|
+
sectionConfig.items = sectionItems;
|
|
57
|
+
menuConfig.main.items[sectionKey] = sectionConfig;
|
|
58
|
+
});
|
|
19
59
|
getEntitySchemas.forEach(({
|
|
20
60
|
id,
|
|
21
61
|
displayName
|
|
22
62
|
}) => {
|
|
23
|
-
|
|
24
|
-
|
|
63
|
+
menuItems[id] = {
|
|
64
|
+
label: displayName,
|
|
25
65
|
uri: `/data-listing/${id}`
|
|
26
|
-
}
|
|
66
|
+
};
|
|
27
67
|
});
|
|
68
|
+
addConfig(menuConfig);
|
|
28
69
|
};
|
|
29
70
|
}
|
|
30
71
|
export default getAddContentMenuItems;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-content-menu-items.js","names":["getQuery","MENU_PERMISSIONS","require","getAddContentMenuItems","app","
|
|
1
|
+
{"version":3,"file":"add-content-menu-items.js","names":["getQuery","MENU_PERMISSIONS","require","getAddContentMenuItems","app","addConfig","client","getClient","data","getEntitySchemas","query","variables","canDoActions","length","menuItems","sectionMenuItems","settings","forEach","id","displayName","displayProperties","adminMenu","sectionKey","sectionItems","label","uri","menuConfig","main","items","Object","entries","sectionConfig"],"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,SAASA,QAAQ,QAAQ,2BAA2B;AAEpD,MAAM;EAAEC;AAAiB,CAAC,GAAGC,OAAO,CAAC,cAAc,CAAC;AAEpD,SAASC,sBAAsBA,CAACC,GAAG,EAAE;EACnC,OAAO,OAAO;IAAEC;EAAU,CAAC,KAAK;IAC9B,MAAMC,MAAM,GAAGF,GAAG,CAACG,SAAS,CAAC,CAAC;IAC9B,MAAM;MACJC,IAAI,EAAE;QAAEC;MAAiB;IAC3B,CAAC,GAAG,MAAMH,MAAM,CAACI,KAAK,CAAC;MACrBA,KAAK,EAAEV,QAAQ,CAAC,4BAA4B,CAAC;MAC7CW,SAAS,EAAE;QACT;QACAC,YAAY,EAAEX;MAChB;IACF,CAAC,CAAC;IAEF,IAAI,CAACQ,gBAAgB,IAAI,CAACA,gBAAgB,CAACI,MAAM,EAAE,OAAO,CAAC;;IAE3D,MAAMC,SAAS,GAAG,CAAC,CAAC;IACpB,MAAMC,gBAAgB,GAAG;MAAEC,QAAQ,EAAE,CAAC;IAAE,CAAC;IAEzCP,gBAAgB,CAACQ,OAAO,CAAC,CAAC;MAAEC,EAAE;MAAEC,WAAW;MAAEC;IAAkB,CAAC,KAAK;MACnE,IAAI,CAACA,iBAAiB,EAAE,OAAO,IAAI;MAEnC,MAAM;QAAEC,SAAS,EAAE;UAAEC,UAAU,GAAG;QAAW,CAAC,GAAG,CAAC;MAAE,CAAC,GAAGF,iBAAiB;MACzE,MAAMG,YAAY,GAAGR,gBAAgB,CAACO,UAAU,CAAC,IAAI,CAAC,CAAC;MACvDC,YAAY,CAACL,EAAE,CAAC,GAAG;QACjBM,KAAK,EAAEL,WAAW;QAClBM,GAAG,EAAG,iBAAgBP,EAAG;MAC3B,CAAC;MACDH,gBAAgB,CAACO,UAAU,CAAC,GAAGC,YAAY;IAC7C,CAAC,CAAC;IAEF,MAAMG,UAAU,GAAG;MACjBC,IAAI,EAAE;QACJC,KAAK,EAAE;UACLZ,QAAQ,EAAE;YACRY,KAAK,EAAEd;UACT;QACF;MACF;IACF,CAAC;IAEDe,MAAM,CAACC,OAAO,CAACf,gBAAgB,CAAC,CAACE,OAAO,CAAC,CAAC,CAACK,UAAU,EAAEC,YAAY,CAAC,KAAK;MACvE,MAAMQ,aAAa,GAAGL,UAAU,CAACC,IAAI,CAACC,KAAK,CAACN,UAAU,CAAC,IAAI,CAAC,CAAC;MAC7DS,aAAa,CAACH,KAAK,GAAGL,YAAY;MAClCG,UAAU,CAACC,IAAI,CAACC,KAAK,CAACN,UAAU,CAAC,GAAGS,aAAa;IACnD,CAAC,CAAC;IAEFtB,gBAAgB,CAACQ,OAAO,CAAC,CAAC;MAAEC,EAAE;MAAEC;IAAY,CAAC,KAAK;MAChDL,SAAS,CAACI,EAAE,CAAC,GAAG;QACdM,KAAK,EAAEL,WAAW;QAClBM,GAAG,EAAG,iBAAgBP,EAAG;MAC3B,CAAC;IACH,CAAC,CAAC;IAEFb,SAAS,CAACqB,UAAU,CAAC;EACvB,CAAC;AACH;AAEA,eAAevB,sBAAsB"}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { gql } from '@apollo/client';
|
|
2
2
|
import { BlazeError } from '@blaze-cms/core-errors';
|
|
3
|
-
|
|
3
|
+
import { getDynamicQuery } from '@blaze-cms/admin-ui-utils';
|
|
4
|
+
const buildAdminSearchQuery = entitySchema => {
|
|
5
|
+
const {
|
|
6
|
+
listingProperties = []
|
|
7
|
+
} = entitySchema || {};
|
|
8
|
+
const parsedProperties = `id, ${listingProperties.join(' ') || 'id name'}`;
|
|
9
|
+
return getDynamicQuery('ADMIN_SEARCH')([entitySchema], parsedProperties, true);
|
|
10
|
+
};
|
|
11
|
+
function buildListingQuery(entitySchema, isSearchQuery) {
|
|
4
12
|
if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {
|
|
5
13
|
throw new BlazeError('Listing query requires getAll action and listingProperties from entity schema');
|
|
6
14
|
}
|
|
15
|
+
if (isSearchQuery) return buildAdminSearchQuery(entitySchema);
|
|
7
16
|
const sortType = entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);
|
|
8
17
|
return gql`
|
|
9
18
|
query ${entitySchema.actions.getAll}($where: JSON, $limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-listing-query.js","names":["gql","BlazeError","
|
|
1
|
+
{"version":3,"file":"build-listing-query.js","names":["gql","BlazeError","getDynamicQuery","buildAdminSearchQuery","entitySchema","listingProperties","parsedProperties","join","buildListingQuery","isSearchQuery","actions","getAll","sortType","toUpperCase","substr"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,eAAe,QAAQ,2BAA2B;AAE3D,MAAMC,qBAAqB,GAAGC,YAAY,IAAI;EAC5C,MAAM;IAAEC,iBAAiB,GAAG;EAAG,CAAC,GAAGD,YAAY,IAAI,CAAC,CAAC;EACrD,MAAME,gBAAgB,GAAI,OAAMD,iBAAiB,CAACE,IAAI,CAAC,GAAG,CAAC,IAAI,SAAU,EAAC;EAE1E,OAAOL,eAAe,CAAC,cAAc,CAAC,CAAC,CAACE,YAAY,CAAC,EAAEE,gBAAgB,EAAE,IAAI,CAAC;AAChF,CAAC;AAED,SAASE,iBAAiBA,CAACJ,YAAY,EAAEK,aAAa,EAAE;EACtD,IAAI,CAACL,YAAY,CAACM,OAAO,IAAI,CAACN,YAAY,CAACM,OAAO,CAACC,MAAM,IAAI,CAACP,YAAY,CAACC,iBAAiB,EAAE;IAC5F,MAAM,IAAIJ,UAAU,CAClB,+EACF,CAAC;EACH;EAEA,IAAIQ,aAAa,EAAE,OAAON,qBAAqB,CAACC,YAAY,CAAC;EAE7D,MAAMQ,QAAQ,GACZR,YAAY,CAACM,OAAO,CAACC,MAAM,CAAC,CAAC,CAAC,CAACE,WAAW,CAAC,CAAC,GAAGT,YAAY,CAACM,OAAO,CAACC,MAAM,CAACG,MAAM,CAAC,CAAC,CAAC;EAEtF,OAAOd,GAAI;AACb,YACMI,YAAY,CAACM,OAAO,CAACC,MACtB,oDAAmDC,QAAS;AACjE,qBACQR,YAAY,CAACM,OAAO,CAACC,MACtB;AACP;AACA,UAAUP,YAAY,CAACC,iBAAiB,CAACE,IAAI,CAAC,KAAK,CAAE;AACrD;AACA;AACA,GAAG;AACH;AAEA,eAAeC,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","schema","updated","properties","adminDefaultListingFilter","where","displayProperties","limit","offset","sort","property","direction"],"sources":["../../src/utils/get-default-query-params.js"],"sourcesContent":["const getDefaultQueryParams =
|
|
1
|
+
{"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","schema","updated","properties","adminDefaultListingFilter","where","displayProperties","limit","offset","sort","property","direction"],"sources":["../../src/utils/get-default-query-params.js"],"sourcesContent":["const getDefaultQueryParams = schema => {\n const updated = schema.properties && schema.properties.updated;\n const { adminDefaultListingFilter: where } = schema.displayProperties || {};\n\n return {\n where,\n limit: 40,\n offset: 0,\n sort: updated\n ? [\n {\n property: 'updated',\n direction: 'desc'\n }\n ]\n : []\n };\n};\n\nexport { getDefaultQueryParams };\n"],"mappings":"AAAA,MAAMA,qBAAqB,GAAGC,MAAM,IAAI;EACtC,MAAMC,OAAO,GAAGD,MAAM,CAACE,UAAU,IAAIF,MAAM,CAACE,UAAU,CAACD,OAAO;EAC9D,MAAM;IAAEE,yBAAyB,EAAEC;EAAM,CAAC,GAAGJ,MAAM,CAACK,iBAAiB,IAAI,CAAC,CAAC;EAE3E,OAAO;IACLD,KAAK;IACLE,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAEP,OAAO,GACT,CACE;MACEQ,QAAQ,EAAE,SAAS;MACnBC,SAAS,EAAE;IACb,CAAC,CACF,GACD;EACN,CAAC;AACH,CAAC;AAED,SAASX,qBAAqB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/plugin-data-ui",
|
|
3
|
-
"version": "0.139.0-alpha.
|
|
3
|
+
"version": "0.139.0-alpha.6",
|
|
4
4
|
"description": "Blaze plugin data ui",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -27,10 +27,11 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/admin-ui-utils": "
|
|
30
|
+
"@blaze-cms/admin-ui-utils": "0.139.0-alpha.6",
|
|
31
31
|
"@blaze-cms/core-errors": "^0.131.0",
|
|
32
|
-
"@blaze-cms/
|
|
33
|
-
"@blaze-cms/react-
|
|
32
|
+
"@blaze-cms/plugin-render-hooks-ui": "0.139.0-alpha.6",
|
|
33
|
+
"@blaze-cms/react-form-builder": "0.139.0-alpha.6",
|
|
34
|
+
"@blaze-cms/react-page-builder": "0.139.0-alpha.6",
|
|
34
35
|
"@blaze-cms/setup-ui": "^0.131.0",
|
|
35
36
|
"@blaze-cms/versioning-ui": "^0.136.0",
|
|
36
37
|
"@blaze-react/button": "0.5.19",
|
|
@@ -65,5 +66,5 @@
|
|
|
65
66
|
"lib/*",
|
|
66
67
|
"lib-es/*"
|
|
67
68
|
],
|
|
68
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "cadf0cce4d05d747f493e4eafe479fd082169a01"
|
|
69
70
|
}
|
|
@@ -6,31 +6,22 @@ import { getQuery } from '@blaze-cms/admin-ui-utils';
|
|
|
6
6
|
import ListingTable from '../ListingTable/ListingTable';
|
|
7
7
|
import { withContext } from '../../utils/hoc/withContext';
|
|
8
8
|
|
|
9
|
-
const EntityDataListing = ({ match
|
|
9
|
+
const EntityDataListing = ({ match }) => {
|
|
10
10
|
const {
|
|
11
11
|
params: { entityIdentifier: identifier }
|
|
12
12
|
} = match;
|
|
13
13
|
|
|
14
|
-
const [[selectedMenuItem]] = menuItems
|
|
15
|
-
.map(([_, { items }]) => {
|
|
16
|
-
const item = items.filter(({ uri }) => uri.endsWith(`/${identifier}`));
|
|
17
|
-
|
|
18
|
-
return item.length ? item : null;
|
|
19
|
-
})
|
|
20
|
-
.filter(Boolean);
|
|
21
|
-
|
|
22
14
|
const { data: { getEntitySchemas = [] } = {} } = useQuery(getQuery('GET_ENTITY_SCHEMA'), {
|
|
23
15
|
variables: { identifier }
|
|
24
16
|
});
|
|
25
17
|
|
|
26
18
|
if (!getEntitySchemas.length) return '';
|
|
27
19
|
|
|
28
|
-
return <ListingTable entitySchema={getEntitySchemas[0]}
|
|
20
|
+
return <ListingTable entitySchema={getEntitySchemas[0]} />;
|
|
29
21
|
};
|
|
30
22
|
|
|
31
23
|
EntityDataListing.propTypes = {
|
|
32
|
-
match: PropTypes.object.isRequired
|
|
33
|
-
menuItems: PropTypes.array.isRequired
|
|
24
|
+
match: PropTypes.object.isRequired
|
|
34
25
|
};
|
|
35
26
|
|
|
36
27
|
export default withContext(EntityDataListing);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Link } from 'react-router-dom';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
const EntityNavLinks = ({ schema }) => {
|
|
5
|
+
if (!schema) return null;
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
displayProperties: { adminSectionNavigation }
|
|
9
|
+
} = schema;
|
|
10
|
+
|
|
11
|
+
if (!adminSectionNavigation) return null;
|
|
12
|
+
|
|
13
|
+
const links = Object.entries(adminSectionNavigation).map(([k, v]) => {
|
|
14
|
+
const { label, uri } = v;
|
|
15
|
+
const Wrapper = uri.startsWith('#') ? 'a' : Link;
|
|
16
|
+
return (
|
|
17
|
+
<Wrapper className="entity-section-link" href={uri} to={uri}>
|
|
18
|
+
{label}
|
|
19
|
+
</Wrapper>
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return <div className="entity-section-links">{links}</div>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default EntityNavLinks;
|
|
@@ -3,6 +3,7 @@ import React, { useEffect, useState, useRef } from 'react';
|
|
|
3
3
|
import { withRouter, Prompt } from 'react-router-dom';
|
|
4
4
|
import { useApolloClient } from '@apollo/client';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import { RenderHook } from '@blaze-cms/plugin-render-hooks-ui';
|
|
6
7
|
import { getQuery, GET_CURRENT_TAB_ID } from '@blaze-cms/admin-ui-utils';
|
|
7
8
|
import { FormBuilder, parseFormValues } from '@blaze-cms/react-form-builder';
|
|
8
9
|
import { DeleteAction, CopyDataFromAction } from '@blaze-cms/admin';
|
|
@@ -34,6 +35,7 @@ import {
|
|
|
34
35
|
checkFulfilConditions
|
|
35
36
|
} from '../utils/entity';
|
|
36
37
|
import useToggle from '../../../utils/hooks/useToggle';
|
|
38
|
+
import InfoBoxes from '../../InfoBoxes/InfoBoxes';
|
|
37
39
|
|
|
38
40
|
const Entity = ({
|
|
39
41
|
formData,
|
|
@@ -440,6 +442,8 @@ const Entity = ({
|
|
|
440
442
|
<div className="page__content--fixed">
|
|
441
443
|
<div className="page__content">
|
|
442
444
|
<div className="content">
|
|
445
|
+
<RenderHook hookKey={`entity:${action}:main:top`} entity={entity} schema={schema} />
|
|
446
|
+
<InfoBoxes id={entity.id} schema={schema} />
|
|
443
447
|
<Tabs
|
|
444
448
|
enabled={showPageBuilderTabs}
|
|
445
449
|
onTabChange={tabId => {
|
|
@@ -461,12 +465,17 @@ const Entity = ({
|
|
|
461
465
|
isNewEntity={isNewEntity}
|
|
462
466
|
/>
|
|
463
467
|
</Tabs>
|
|
468
|
+
<RenderHook
|
|
469
|
+
hookKey={`entity:${action}:main:bottom`}
|
|
470
|
+
entity={entity}
|
|
471
|
+
schema={schema}
|
|
472
|
+
/>
|
|
464
473
|
</div>
|
|
465
474
|
</div>
|
|
466
475
|
</div>
|
|
467
476
|
</div>
|
|
468
477
|
|
|
469
|
-
<div className="column column--one-third page-sidebar">
|
|
478
|
+
<div className="column column--one-third page-sidebar page-sidebar--relations">
|
|
470
479
|
{showSideBarRelations && (
|
|
471
480
|
<SideBarRelations
|
|
472
481
|
entity={entity}
|
package/src/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import useCustomSidebarData from '../hooks/useCustomSidebarData';
|
|
4
|
+
import CustomSidebarInfo from '../presentational/CustomSidebarInfo';
|
|
5
|
+
|
|
6
|
+
const CustomSibebarInfoContainer = ({ id, schema, displayProperties }) => {
|
|
7
|
+
const { data } = useCustomSidebarData({ id, schema, displayProperties });
|
|
8
|
+
|
|
9
|
+
if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;
|
|
10
|
+
|
|
11
|
+
const items = Object.values(data).flatMap(item => Object.values(item));
|
|
12
|
+
|
|
13
|
+
return <CustomSidebarInfo items={items} customSidebarInfoKey={displayProperties.key} />;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default CustomSibebarInfoContainer;
|
|
17
|
+
|
|
18
|
+
CustomSibebarInfoContainer.propTypes = {
|
|
19
|
+
id: PropTypes.string.isRequired,
|
|
20
|
+
displayProperties: PropTypes.object.isRequired,
|
|
21
|
+
schema: PropTypes.object.isRequired
|
|
22
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { BlazeError } from '@blaze-cms/core-errors';
|
|
3
|
+
|
|
4
|
+
export default function buildDynamicQuery({ id, schema, displayProperties }) {
|
|
5
|
+
if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
|
|
6
|
+
throw new BlazeError(
|
|
7
|
+
'DataEntity query requires get action, properties and fields from entity schema'
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (
|
|
12
|
+
displayProperties.adminMainInfoProperty &&
|
|
13
|
+
Array.isArray(displayProperties.adminMainInfoProperty)
|
|
14
|
+
) {
|
|
15
|
+
const fields = displayProperties.adminMainInfoProperty.map(
|
|
16
|
+
infoProperty =>
|
|
17
|
+
`${infoProperty} {
|
|
18
|
+
label
|
|
19
|
+
value
|
|
20
|
+
}`
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
return gql`query getInfoBoxData($id: String!){
|
|
24
|
+
${schema.actions.get}( id: $id ) {
|
|
25
|
+
id
|
|
26
|
+
${fields.map(field => field)}
|
|
27
|
+
__typename
|
|
28
|
+
}
|
|
29
|
+
}`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import ProptTypes from 'prop-types';
|
|
2
|
+
import { useQuery, gql } from '@apollo/client';
|
|
3
|
+
import buildDynamicQuery from '../helpers/build-dynamic-query';
|
|
4
|
+
|
|
5
|
+
const useCustomSidebarData = ({ id, schema, displayProperties }) => {
|
|
6
|
+
const query = buildDynamicQuery({ id, schema, displayProperties });
|
|
7
|
+
|
|
8
|
+
const customSidebarInfoQuery =
|
|
9
|
+
query ||
|
|
10
|
+
gql`
|
|
11
|
+
query {
|
|
12
|
+
__typename
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
const { data = {}, loading, error } = useQuery(customSidebarInfoQuery, {
|
|
17
|
+
variables: { id },
|
|
18
|
+
skip: !query
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return { data: data.__typename !== 'Query' ? data : null, loading, error };
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default useCustomSidebarData;
|
|
25
|
+
|
|
26
|
+
useCustomSidebarData.propTypes = {
|
|
27
|
+
displayProperties: ProptTypes.object.isRequired
|
|
28
|
+
};
|