@blaze-cms/plugin-data-ui 0.146.0-translations.8 → 0.147.0-rc-eagle.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/EntityDataListing/EntityDataListing.js +21 -19
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityDataListing/index.js +2 -3
- package/lib/components/EntityDataListing/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +18 -19
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/Entity.js +284 -457
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +62 -66
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +32 -56
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +20 -26
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +20 -17
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +34 -32
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +95 -158
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +23 -30
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -56
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +29 -45
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/index.js +7 -8
- package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +36 -57
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +47 -66
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/index.js +2 -3
- package/lib/components/EntityManager/Entity/index.js.map +1 -1
- package/lib/components/EntityManager/EntityManager.js +91 -166
- package/lib/components/EntityManager/EntityManager.js.map +1 -1
- package/lib/components/EntityManager/index.js +2 -3
- package/lib/components/EntityManager/index.js.map +1 -1
- package/lib/components/EntityManager/utils/RecordEditContext/index.js +3 -4
- package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
- package/lib/components/EntityManager/utils/data-mappers.js +34 -46
- package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib/components/EntityManager/utils/entity.js +35 -80
- package/lib/components/EntityManager/utils/entity.js.map +1 -1
- package/lib/components/EntityManager/utils/entityAvailableActions.js +51 -110
- package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib/components/EntityManager/utils/is-form-empty.js +6 -10
- package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
- package/lib/components/EntityManager/utils/query.js +17 -10
- package/lib/components/EntityManager/utils/query.js.map +1 -1
- package/lib/components/InfoBoxes/InfoBoxTooltip.js +19 -16
- package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
- package/lib/components/InfoBoxes/InfoBoxes.js +19 -19
- package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js +26 -38
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +21 -16
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useData.js +33 -30
- package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useInfoBox.js +10 -10
- package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/index.js +2 -3
- package/lib/components/InfoBoxes/index.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBox.js +27 -34
- package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +11 -12
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +12 -12
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
- package/lib/components/ListingTable/ListingTable.js +155 -296
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +53 -58
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/index.js +2 -3
- package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js +436 -262
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js +30 -37
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/helpers.js +82 -71
- package/lib/components/ListingTable/SearchFilter/helpers.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/querys.js +5 -5
- package/lib/components/ListingTable/SearchFilter/querys.js.map +1 -1
- package/lib/components/ListingTable/TableActions/TableActions.js +27 -31
- package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
- package/lib/components/ListingTable/TableActions/index.js +2 -3
- package/lib/components/ListingTable/TableActions/index.js.map +1 -1
- package/lib/components/ListingTable/index.js +2 -3
- package/lib/components/ListingTable/index.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +103 -122
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +66 -83
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/components/Tabs/index.js +26 -42
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/hooks/useCallbackDebounce.js +5 -9
- package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
- package/lib/constants.js +30 -31
- package/lib/constants.js.map +1 -1
- package/lib/icons/ContentIcon.js +17 -20
- package/lib/icons/ContentIcon.js.map +1 -1
- package/lib/icons/SettingsIcon.js +12 -15
- package/lib/icons/SettingsIcon.js.map +1 -1
- package/lib/icons/TaxonomyIcon.js +15 -18
- package/lib/icons/TaxonomyIcon.js.map +1 -1
- package/lib/icons/UsersIcon.js +11 -14
- package/lib/icons/UsersIcon.js.map +1 -1
- package/lib/icons/index.js +8 -9
- package/lib/icons/index.js.map +1 -1
- package/lib/index.js +88 -121
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +67 -93
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-create-entity-mutation.js +12 -9
- package/lib/utils/build-create-entity-mutation.js.map +1 -1
- package/lib/utils/build-delete-entity-mutation.js +11 -8
- package/lib/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib/utils/build-listing-query.js +17 -14
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/build-update-data-query.js +15 -9
- package/lib/utils/build-update-data-query.js.map +1 -1
- package/lib/utils/build-update-publish-unpublish-mutation.js +15 -8
- package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib/utils/get-default-query-params.js +7 -6
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib/utils/hoc/withContext.js +4 -6
- package/lib/utils/hoc/withContext.js.map +1 -1
- package/lib/utils/hooks/useToggle.js +4 -12
- package/lib/utils/hooks/useToggle.js.map +1 -1
- package/lib/utils/index.js +2 -3
- package/lib/utils/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/Entity.js +8 -20
- package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +6 -3
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
- package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
- package/lib-es/components/EntityManager/utils/query.js.map +1 -1
- package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTable.js +2 -2
- package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +20 -17
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js +323 -51
- package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js +7 -3
- package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/helpers.js +39 -8
- package/lib-es/components/ListingTable/SearchFilter/helpers.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/querys.js.map +1 -1
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib-es/components/ListingTable/service/index.js.map +1 -1
- package/lib-es/components/Tabs/index.js +6 -7
- package/lib-es/components/Tabs/index.js.map +1 -1
- package/lib-es/index.js +12 -3
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/add-content-menu-items.js.map +1 -1
- package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
- package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib-es/utils/build-listing-query.js.map +1 -1
- package/lib-es/utils/build-update-data-query.js.map +1 -1
- package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib-es/utils/hoc/withContext.js +1 -1
- package/lib-es/utils/hoc/withContext.js.map +1 -1
- package/package.json +27 -22
- package/src/components/EntityManager/Entity/Entity.js +59 -77
- package/src/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
- package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +9 -7
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +64 -59
- package/src/components/EntityManager/EntityManager.js +52 -45
- package/src/components/InfoBoxes/container/InfoBoxContainer.js +3 -6
- package/src/components/InfoBoxes/hooks/useData.js +6 -1
- package/src/components/ListingTable/ListingTable.js +13 -21
- package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +38 -44
- package/src/components/ListingTable/SearchFilter/SearchContainer.js +411 -134
- package/src/components/ListingTable/SearchFilter/SearchFilter.js +5 -2
- package/src/components/ListingTable/SearchFilter/helpers.js +56 -8
- package/src/components/ListingTable/service/index.js +2 -3
- package/src/components/Tabs/index.js +17 -21
- package/src/index.js +11 -7
- package/src/utils/hoc/withContext.js +5 -4
- package/CHANGELOG.md +0 -1947
- package/babel.config.js +0 -3
- package/jest.config.js +0 -5
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_reactFormBuilder","require","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_reactFormBuilder","require","_package","_interopRequireDefault","_constants","_addContentMenuItems","_icons","_EntityDataListing","_EntityManager","_SearchFilter","load","app","events","once","getAddContentMenuItems","addFieldType","Object","keys","formFieldTypes","forEach","type","component","emitAsync","getFormBuilderLookup","addConfig","main","items","content","label","loadOpen","icon","ContentIcon","order","taxonomy","TaxonomyIcon","user","UserIcon","settings","SettingsIcon","entityDataListingRoute","path","DATA_LISTING_PREFIX","key","EntityDataListing","exact","editEntityRoute","EntityManager","addEntityRoute","addRoute","name","PLUGIN_NAME","version","pkg","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import { getFormBuilderLookup, formFieldTypes } from '@blaze-cms/react-form-builder';\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';\nimport EntityDataListing from './components/EntityDataListing';\nimport EntityManager from './components/EntityManager';\n\n// todo: renable lazy loading after bundler optimisations, currently they are too slow in dev mode\n// const EntityDataListing = React.lazy(\n// () => import(/* webpackChunkName: 'EntityDataListing' */ './components/EntityDataListing')\n// );\n// const EntityManager = React.lazy(\n// () => import(/* webpackChunkName: 'EntityManager' */ './components/EntityManager')\n// );\n\nexport { default as SearchFilter } from './components/ListingTable/SearchFilter/SearchFilter';\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,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,cAAA,GAAAL,sBAAA,CAAAF,OAAA;AAUA,IAAAQ,aAAA,GAAAN,sBAAA,CAAAF,OAAA;AARA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIe,eAAeS,IAAIA,CAACC,GAAG,EAAE;EACtCA,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,wBAAwB,EAAE,IAAAC,4BAAsB,EAACH,GAAG,CAAC,CAAC;EAEtEA,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,wBAAwB,EAAEE,YAAY,IAAI;IACxDC,MAAM,CAACC,IAAI,CAACC,gCAAc,CAAC,CAACC,OAAO,CAACC,IAAI,IAAI;MAC1CL,YAAY,CAAC;QAAEK,IAAI;QAAEC,SAAS,EAAEH,gCAAc,CAACE,IAAI;MAAE,CAAC,CAAC;IACzD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFT,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,4BAA4B,EAAE,YAAY;IACxD,MAAMF,GAAG,CAACC,MAAM,CAACU,SAAS,CAAC,wBAAwB,EAAEC,sCAAoB,CAACR,YAAY,CAAC;EACzF,CAAC,CAAC;EAEFJ,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAAEW;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,EAAEC,kBAAW;YACjBC,KAAK,EAAE;UACT,CAAC;UACDC,QAAQ,EAAE;YACRL,KAAK,EAAE,UAAU;YACjBF,KAAK,EAAE,CAAC,CAAC;YACTI,IAAI,EAAEI,mBAAY;YAClBF,KAAK,EAAE;UACT,CAAC;UACDG,IAAI,EAAE;YACJP,KAAK,EAAE,MAAM;YACbF,KAAK,EAAE,CAAC,CAAC;YACTI,IAAI,EAAEM,eAAQ;YACdJ,KAAK,EAAE;UACT,CAAC;UACDK,QAAQ,EAAE;YACRT,KAAK,EAAE,UAAU;YACjBF,KAAK,EAAE,CAAC,CAAC;YACTI,IAAI,EAAEQ,mBAAY;YAClBN,KAAK,EAAE;UACT;QACF;MACF;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,MAAMO,sBAAsB,GAAG;IAC7BC,IAAI,EAAE,GAAGC,8BAAmB,oBAAoB;IAChDC,GAAG,EAAE,mBAAmB;IACxBrB,SAAS,EAAEsB,0BAAiB;IAC5BC,KAAK,EAAE;EACT,CAAC;EAED,MAAMC,eAAe,GAAG;IACtBL,IAAI,EAAE,GAAGC,8BAAmB,gCAAgC;IAC5DC,GAAG,EAAE,YAAY;IACjBrB,SAAS,EAAEyB,sBAAa;IACxBF,KAAK,EAAE;EACT,CAAC;EAED,MAAMG,cAAc,GAAG;IACrBP,IAAI,EAAE,GAAGC,8BAAmB,4BAA4B;IACxDC,GAAG,EAAE,cAAc;IACnBrB,SAAS,EAAEyB,sBAAa;IACxBF,KAAK,EAAE;EACT,CAAC;EAEDjC,GAAG,CAACqC,QAAQ,CAACT,sBAAsB,CAAC;EACpC5B,GAAG,CAACqC,QAAQ,CAACH,eAAe,CAAC;EAC7BlC,GAAG,CAACqC,QAAQ,CAACD,cAAc,CAAC;EAE5B,OAAO;IACLE,IAAI,EAAEC,sBAAW;IACjBC,OAAO,EAAEC,gBAAG,CAACD;EACf,CAAC;AACH;AAEAzC,IAAI,CAAC2C,UAAU,GAAGH,sBAAW","ignoreList":[]}
|
|
@@ -1,104 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
-
require("core-js/modules/es.array.for-each.js");
|
|
11
|
-
require("core-js/modules/es.object.entries.js");
|
|
12
|
-
require("core-js/modules/es.object.to-string.js");
|
|
13
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
|
+
exports.default = void 0;
|
|
16
7
|
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
17
|
-
|
|
18
|
-
MENU_PERMISSIONS
|
|
8
|
+
const {
|
|
9
|
+
MENU_PERMISSIONS
|
|
10
|
+
} = require('../constants');
|
|
19
11
|
function getAddContentMenuItems(app) {
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
});
|
|
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:
|
|
93
|
-
case "end":
|
|
94
|
-
return _context.stop();
|
|
12
|
+
return async ({
|
|
13
|
+
addConfig
|
|
14
|
+
}) => {
|
|
15
|
+
const client = app.getClient();
|
|
16
|
+
const {
|
|
17
|
+
data: {
|
|
18
|
+
getEntitySchemas
|
|
19
|
+
}
|
|
20
|
+
} = await client.query({
|
|
21
|
+
query: (0, _adminUiUtils.getQuery)('GET_USER_EDITABLE_ENTITIES'),
|
|
22
|
+
variables: {
|
|
23
|
+
// only return entities that the current user can do the following actions on
|
|
24
|
+
canDoActions: MENU_PERMISSIONS
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
if (!getEntitySchemas || !getEntitySchemas.length) return; // no items so don't add section
|
|
28
|
+
|
|
29
|
+
const menuItems = {};
|
|
30
|
+
const sectionMenuItems = {
|
|
31
|
+
settings: {}
|
|
32
|
+
};
|
|
33
|
+
getEntitySchemas.forEach(({
|
|
34
|
+
id,
|
|
35
|
+
displayName,
|
|
36
|
+
displayProperties
|
|
37
|
+
}) => {
|
|
38
|
+
if (!displayProperties) return null;
|
|
39
|
+
const {
|
|
40
|
+
adminMenu: {
|
|
41
|
+
sectionKey = 'settings'
|
|
42
|
+
} = {}
|
|
43
|
+
} = displayProperties;
|
|
44
|
+
const sectionItems = sectionMenuItems[sectionKey] || {};
|
|
45
|
+
sectionItems[id] = {
|
|
46
|
+
label: displayName,
|
|
47
|
+
uri: `/data-listing/${id}`
|
|
48
|
+
};
|
|
49
|
+
sectionMenuItems[sectionKey] = sectionItems;
|
|
50
|
+
});
|
|
51
|
+
const menuConfig = {
|
|
52
|
+
main: {
|
|
53
|
+
items: {
|
|
54
|
+
settings: {
|
|
55
|
+
items: menuItems
|
|
56
|
+
}
|
|
95
57
|
}
|
|
96
|
-
}
|
|
97
|
-
}));
|
|
98
|
-
return function (_x) {
|
|
99
|
-
return _ref2.apply(this, arguments);
|
|
58
|
+
}
|
|
100
59
|
};
|
|
101
|
-
|
|
60
|
+
Object.entries(sectionMenuItems).forEach(([sectionKey, sectionItems]) => {
|
|
61
|
+
const sectionConfig = menuConfig.main.items[sectionKey] || {};
|
|
62
|
+
sectionConfig.items = sectionItems;
|
|
63
|
+
menuConfig.main.items[sectionKey] = sectionConfig;
|
|
64
|
+
});
|
|
65
|
+
getEntitySchemas.forEach(({
|
|
66
|
+
id,
|
|
67
|
+
displayName
|
|
68
|
+
}) => {
|
|
69
|
+
menuItems[id] = {
|
|
70
|
+
label: displayName,
|
|
71
|
+
uri: `/data-listing/${id}`
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
addConfig(menuConfig);
|
|
75
|
+
};
|
|
102
76
|
}
|
|
103
|
-
var _default = exports
|
|
77
|
+
var _default = exports.default = getAddContentMenuItems;
|
|
104
78
|
//# sourceMappingURL=add-content-menu-items.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-content-menu-items.js","names":["_adminUiUtils","require","
|
|
1
|
+
{"version":3,"file":"add-content-menu-items.js","names":["_adminUiUtils","require","MENU_PERMISSIONS","getAddContentMenuItems","app","addConfig","client","getClient","data","getEntitySchemas","query","getQuery","variables","canDoActions","length","menuItems","sectionMenuItems","settings","forEach","id","displayName","displayProperties","adminMenu","sectionKey","sectionItems","label","uri","menuConfig","main","items","Object","entries","sectionConfig","_default","exports","default"],"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,MAAM;EAAEC;AAAiB,CAAC,GAAGD,OAAO,CAAC,cAAc,CAAC;AAEpD,SAASE,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,EAAE,IAAAC,sBAAQ,EAAC,4BAA4B,CAAC;MAC7CC,SAAS,EAAE;QACT;QACAC,YAAY,EAAEX;MAChB;IACF,CAAC,CAAC;IAEF,IAAI,CAACO,gBAAgB,IAAI,CAACA,gBAAgB,CAACK,MAAM,EAAE,OAAO,CAAC;;IAE3D,MAAMC,SAAS,GAAG,CAAC,CAAC;IACpB,MAAMC,gBAAgB,GAAG;MAAEC,QAAQ,EAAE,CAAC;IAAE,CAAC;IAEzCR,gBAAgB,CAACS,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,EAAE,iBAAiBP,EAAE;MAC1B,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;IAEFvB,gBAAgB,CAACS,OAAO,CAAC,CAAC;MAAEC,EAAE;MAAEC;IAAY,CAAC,KAAK;MAChDL,SAAS,CAACI,EAAE,CAAC,GAAG;QACdM,KAAK,EAAEL,WAAW;QAClBM,GAAG,EAAE,iBAAiBP,EAAE;MAC1B,CAAC;IACH,CAAC,CAAC;IAEFd,SAAS,CAACsB,UAAU,CAAC;EACvB,CAAC;AACH;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEchC,sBAAsB","ignoreList":[]}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
9
|
-
require("core-js/modules/es.array.join.js");
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
7
|
+
exports.default = void 0;
|
|
11
8
|
var _client = require("@apollo/client");
|
|
12
9
|
var _coreErrors = require("@blaze-cms/core-errors");
|
|
13
10
|
var _lodash = _interopRequireDefault(require("lodash.upperfirst"));
|
|
14
11
|
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
15
|
-
var _templateObject;
|
|
16
12
|
function buildCreateEntityMutation(entitySchema) {
|
|
17
13
|
if (!entitySchema || !entitySchema.actions || !entitySchema.actions.create || !entitySchema.properties) {
|
|
18
14
|
throw new _coreErrors.BlazeError('Create entity query requires create action and properties from entity schema');
|
|
19
15
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return (0, _client.gql)
|
|
16
|
+
const actionInput = (0, _lodash.default)(`${entitySchema.actions.create}Input`);
|
|
17
|
+
const dataProperties = (0, _adminUiUtils.getDataProperties)(entitySchema);
|
|
18
|
+
return (0, _client.gql)`mutation createEntity($input: ${actionInput}) {
|
|
19
|
+
createdEntity: ${entitySchema.actions.create}(input: $input){
|
|
20
|
+
result {
|
|
21
|
+
id,
|
|
22
|
+
${dataProperties.join(',\n')}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}`;
|
|
23
26
|
}
|
|
24
|
-
var _default = exports
|
|
27
|
+
var _default = exports.default = buildCreateEntityMutation;
|
|
25
28
|
//# sourceMappingURL=build-create-entity-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-create-entity-mutation.js","names":["_client","require","_coreErrors","_lodash","_interopRequireDefault","_adminUiUtils","
|
|
1
|
+
{"version":3,"file":"build-create-entity-mutation.js","names":["_client","require","_coreErrors","_lodash","_interopRequireDefault","_adminUiUtils","buildCreateEntityMutation","entitySchema","actions","create","properties","BlazeError","actionInput","upperfirst","dataProperties","getDataProperties","gql","join","_default","exports","default"],"sources":["../../src/utils/build-create-entity-mutation.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\nimport { getDataProperties } from '@blaze-cms/admin-ui-utils';\n\nfunction buildCreateEntityMutation(entitySchema) {\n if (\n !entitySchema ||\n !entitySchema.actions ||\n !entitySchema.actions.create ||\n !entitySchema.properties\n ) {\n throw new BlazeError(\n 'Create entity query requires create action and properties from entity schema'\n );\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.create}Input`);\n const dataProperties = getDataProperties(entitySchema);\n\n return gql`mutation createEntity($input: ${actionInput}) {\n createdEntity: ${entitySchema.actions.create}(input: $input){\n result {\n id,\n ${dataProperties.join(',\\n')}\n }\n }\n }`;\n}\n\nexport default buildCreateEntityMutation;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAEA,SAASK,yBAAyBA,CAACC,YAAY,EAAE;EAC/C,IACE,CAACA,YAAY,IACb,CAACA,YAAY,CAACC,OAAO,IACrB,CAACD,YAAY,CAACC,OAAO,CAACC,MAAM,IAC5B,CAACF,YAAY,CAACG,UAAU,EACxB;IACA,MAAM,IAAIC,sBAAU,CAClB,8EACF,CAAC;EACH;EAEA,MAAMC,WAAW,GAAG,IAAAC,eAAU,EAAC,GAAGN,YAAY,CAACC,OAAO,CAACC,MAAM,OAAO,CAAC;EACrE,MAAMK,cAAc,GAAG,IAAAC,+BAAiB,EAACR,YAAY,CAAC;EAEtD,OAAO,IAAAS,WAAG,mCAAkCJ,WAAW;AACzD,qBAAqBL,YAAY,CAACC,OAAO,CAACC,MAAM;AAChD;AACA;AACA,YAAYK,cAAc,CAACG,IAAI,CAAC,KAAK,CAAC;AACtC;AACA;AACA,IAAI;AACJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcd,yBAAyB","ignoreList":[]}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
7
|
+
exports.default = void 0;
|
|
10
8
|
var _client = require("@apollo/client");
|
|
11
9
|
var _coreErrors = require("@blaze-cms/core-errors");
|
|
12
10
|
var _lodash = _interopRequireDefault(require("lodash.upperfirst"));
|
|
13
|
-
var _templateObject;
|
|
14
11
|
function buildDeleteEntity(entitySchema) {
|
|
15
|
-
if (!entitySchema || !entitySchema.actions || !entitySchema.actions
|
|
12
|
+
if (!entitySchema || !entitySchema.actions || !entitySchema.actions.delete) {
|
|
16
13
|
throw new _coreErrors.BlazeError('Delete query requires delete action from entity schema');
|
|
17
14
|
}
|
|
18
|
-
|
|
19
|
-
return (0, _client.gql)
|
|
15
|
+
const actionInput = (0, _lodash.default)(`${entitySchema.actions.delete}Input`);
|
|
16
|
+
return (0, _client.gql)`
|
|
17
|
+
mutation deleteEntity($input: ${actionInput}) {
|
|
18
|
+
deleteEntity: ${entitySchema.actions.delete}(input: $input){
|
|
19
|
+
result
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
20
23
|
}
|
|
21
|
-
var _default = exports
|
|
24
|
+
var _default = exports.default = buildDeleteEntity;
|
|
22
25
|
//# sourceMappingURL=build-delete-entity-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-delete-entity-mutation.js","names":["_client","require","_coreErrors","_lodash","_interopRequireDefault","
|
|
1
|
+
{"version":3,"file":"build-delete-entity-mutation.js","names":["_client","require","_coreErrors","_lodash","_interopRequireDefault","buildDeleteEntity","entitySchema","actions","delete","BlazeError","actionInput","upperfirst","gql","_default","exports","default"],"sources":["../../src/utils/build-delete-entity-mutation.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\n\nfunction buildDeleteEntity(entitySchema) {\n if (!entitySchema || !entitySchema.actions || !entitySchema.actions.delete) {\n throw new BlazeError('Delete query requires delete action from entity schema');\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.delete}Input`);\n\n return gql`\n mutation deleteEntity($input: ${actionInput}) {\n deleteEntity: ${entitySchema.actions.delete}(input: $input){\n result\n }\n }\n `;\n}\n\nexport default buildDeleteEntity;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,SAASI,iBAAiBA,CAACC,YAAY,EAAE;EACvC,IAAI,CAACA,YAAY,IAAI,CAACA,YAAY,CAACC,OAAO,IAAI,CAACD,YAAY,CAACC,OAAO,CAACC,MAAM,EAAE;IAC1E,MAAM,IAAIC,sBAAU,CAAC,wDAAwD,CAAC;EAChF;EAEA,MAAMC,WAAW,GAAG,IAAAC,eAAU,EAAC,GAAGL,YAAY,CAACC,OAAO,CAACC,MAAM,OAAO,CAAC;EAErE,OAAO,IAAAI,WAAG;AACZ,mCAAmCF,WAAW;AAC9C,oBAAoBJ,YAAY,CAACC,OAAO,CAACC,MAAM;AAC/C;AACA;AACA;AACA,GAAG;AACH;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcV,iBAAiB","ignoreList":[]}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
-
require("core-js/modules/es.array.join.js");
|
|
6
|
+
exports.default = void 0;
|
|
11
7
|
var _client = require("@apollo/client");
|
|
12
8
|
var _coreErrors = require("@blaze-cms/core-errors");
|
|
13
9
|
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var parsedProperties = "id, ".concat(listingProperties.join(' ') || 'id name');
|
|
10
|
+
const buildAdminSearchQuery = (entitySchema, index) => {
|
|
11
|
+
const {
|
|
12
|
+
listingProperties = []
|
|
13
|
+
} = entitySchema || {};
|
|
14
|
+
const parsedProperties = `id, ${listingProperties.join(' ') || 'id name'}`;
|
|
20
15
|
return (0, _adminUiUtils.getDynamicQuery)('ADMIN_SEARCH')([entitySchema], parsedProperties, true, index);
|
|
21
16
|
};
|
|
22
17
|
function buildListingQuery(entitySchema, index, isSearchQuery) {
|
|
@@ -24,8 +19,16 @@ function buildListingQuery(entitySchema, index, isSearchQuery) {
|
|
|
24
19
|
throw new _coreErrors.BlazeError('Listing query requires getAll action and listingProperties from entity schema');
|
|
25
20
|
}
|
|
26
21
|
if (isSearchQuery) return buildAdminSearchQuery(entitySchema, index);
|
|
27
|
-
|
|
28
|
-
return (0, _client.gql)
|
|
22
|
+
const sortType = entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);
|
|
23
|
+
return (0, _client.gql)`
|
|
24
|
+
query ${entitySchema.actions.getAll}($where: JSON, $limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {
|
|
25
|
+
listingData: ${entitySchema.actions.getAll}(where: $where, limit: $limit, offset:$offset, sort:$sort){
|
|
26
|
+
id,
|
|
27
|
+
${entitySchema.listingProperties.join(',\n')}
|
|
28
|
+
}
|
|
29
|
+
totalRecords: ${entitySchema.actions.countAll}(where: $where)
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
29
32
|
}
|
|
30
|
-
var _default = exports
|
|
33
|
+
var _default = exports.default = buildListingQuery;
|
|
31
34
|
//# sourceMappingURL=build-listing-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-listing-query.js","names":["_client","require","_coreErrors","_adminUiUtils","
|
|
1
|
+
{"version":3,"file":"build-listing-query.js","names":["_client","require","_coreErrors","_adminUiUtils","buildAdminSearchQuery","entitySchema","index","listingProperties","parsedProperties","join","getDynamicQuery","buildListingQuery","isSearchQuery","actions","getAll","BlazeError","sortType","toUpperCase","substr","gql","countAll","_default","exports","default"],"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, index) => {\n const { listingProperties = [] } = entitySchema || {};\n const parsedProperties = `id, ${listingProperties.join(' ') || 'id name'}`;\n\n return getDynamicQuery('ADMIN_SEARCH')([entitySchema], parsedProperties, true, index);\n};\n\nfunction buildListingQuery(entitySchema, index, 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, index);\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 totalRecords: ${entitySchema.actions.countAll}(where: $where)\n }\n `;\n}\n\nexport default buildListingQuery;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA,MAAMG,qBAAqB,GAAGA,CAACC,YAAY,EAAEC,KAAK,KAAK;EACrD,MAAM;IAAEC,iBAAiB,GAAG;EAAG,CAAC,GAAGF,YAAY,IAAI,CAAC,CAAC;EACrD,MAAMG,gBAAgB,GAAG,OAAOD,iBAAiB,CAACE,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,EAAE;EAE1E,OAAO,IAAAC,6BAAe,EAAC,cAAc,CAAC,CAAC,CAACL,YAAY,CAAC,EAAEG,gBAAgB,EAAE,IAAI,EAAEF,KAAK,CAAC;AACvF,CAAC;AAED,SAASK,iBAAiBA,CAACN,YAAY,EAAEC,KAAK,EAAEM,aAAa,EAAE;EAC7D,IAAI,CAACP,YAAY,CAACQ,OAAO,IAAI,CAACR,YAAY,CAACQ,OAAO,CAACC,MAAM,IAAI,CAACT,YAAY,CAACE,iBAAiB,EAAE;IAC5F,MAAM,IAAIQ,sBAAU,CAClB,+EACF,CAAC;EACH;EAEA,IAAIH,aAAa,EAAE,OAAOR,qBAAqB,CAACC,YAAY,EAAEC,KAAK,CAAC;EAEpE,MAAMU,QAAQ,GACZX,YAAY,CAACQ,OAAO,CAACC,MAAM,CAAC,CAAC,CAAC,CAACG,WAAW,CAAC,CAAC,GAAGZ,YAAY,CAACQ,OAAO,CAACC,MAAM,CAACI,MAAM,CAAC,CAAC,CAAC;EAEtF,OAAO,IAAAC,WAAG;AACZ,YACMd,YAAY,CAACQ,OAAO,CAACC,MAAM,oDACuBE,QAAQ;AAChE,qBACQX,YAAY,CAACQ,OAAO,CAACC,MAAM;AACnC;AACA,UACUT,YAAY,CAACE,iBAAiB,CAACE,IAAI,CAAC,KAAK,CAAC;AACpD;AACA,sBAAsBJ,YAAY,CAACQ,OAAO,CAACO,QAAQ;AACnD;AACA,GAAG;AACH;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcZ,iBAAiB","ignoreList":[]}
|
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
9
|
-
require("core-js/modules/es.array.join.js");
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
7
|
+
exports.default = void 0;
|
|
11
8
|
var _client = require("@apollo/client");
|
|
12
9
|
var _coreErrors = require("@blaze-cms/core-errors");
|
|
13
10
|
var _lodash = _interopRequireDefault(require("lodash.upperfirst"));
|
|
14
11
|
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
15
|
-
var _templateObject;
|
|
16
12
|
function buildUpdateDataQuery(entitySchema) {
|
|
17
13
|
if (!entitySchema.actions || !entitySchema.actions.update || !entitySchema.properties) {
|
|
18
14
|
throw new _coreErrors.BlazeError('Update DataEntity query requires get action and properties from entity schema');
|
|
19
15
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return (0, _client.gql)
|
|
16
|
+
const actionInput = (0, _lodash.default)(`${entitySchema.actions.update}Input`);
|
|
17
|
+
const dataProperties = (0, _adminUiUtils.getDataProperties)(entitySchema);
|
|
18
|
+
return (0, _client.gql)`
|
|
19
|
+
mutation updateEntity($input: ${actionInput}) {
|
|
20
|
+
updateEntity: ${entitySchema.actions.update}(input: $input){
|
|
21
|
+
result {
|
|
22
|
+
id,
|
|
23
|
+
${dataProperties.join(',\n')},
|
|
24
|
+
updated
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
23
29
|
}
|
|
24
|
-
var _default = exports
|
|
30
|
+
var _default = exports.default = buildUpdateDataQuery;
|
|
25
31
|
//# sourceMappingURL=build-update-data-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-update-data-query.js","names":["_client","require","_coreErrors","_lodash","_interopRequireDefault","_adminUiUtils","
|
|
1
|
+
{"version":3,"file":"build-update-data-query.js","names":["_client","require","_coreErrors","_lodash","_interopRequireDefault","_adminUiUtils","buildUpdateDataQuery","entitySchema","actions","update","properties","BlazeError","actionInput","upperfirst","dataProperties","getDataProperties","gql","join","_default","exports","default"],"sources":["../../src/utils/build-update-data-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\nimport { getDataProperties } from '@blaze-cms/admin-ui-utils';\n\nfunction buildUpdateDataQuery(entitySchema) {\n if (!entitySchema.actions || !entitySchema.actions.update || !entitySchema.properties) {\n throw new BlazeError(\n 'Update DataEntity query requires get action and properties from entity schema'\n );\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.update}Input`);\n const dataProperties = getDataProperties(entitySchema);\n\n return gql`\n mutation updateEntity($input: ${actionInput}) {\n updateEntity: ${entitySchema.actions.update}(input: $input){\n result {\n id,\n ${dataProperties.join(',\\n')},\n updated\n }\n }\n }\n `;\n}\n\nexport default buildUpdateDataQuery;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAEA,SAASK,oBAAoBA,CAACC,YAAY,EAAE;EAC1C,IAAI,CAACA,YAAY,CAACC,OAAO,IAAI,CAACD,YAAY,CAACC,OAAO,CAACC,MAAM,IAAI,CAACF,YAAY,CAACG,UAAU,EAAE;IACrF,MAAM,IAAIC,sBAAU,CAClB,+EACF,CAAC;EACH;EAEA,MAAMC,WAAW,GAAG,IAAAC,eAAU,EAAC,GAAGN,YAAY,CAACC,OAAO,CAACC,MAAM,OAAO,CAAC;EACrE,MAAMK,cAAc,GAAG,IAAAC,+BAAiB,EAACR,YAAY,CAAC;EAEtD,OAAO,IAAAS,WAAG;AACZ,mCAAmCJ,WAAW;AAC9C,oBAAoBL,YAAY,CAACC,OAAO,CAACC,MAAM;AAC/C;AACA;AACA,YAAYK,cAAc,CAACG,IAAI,CAAC,KAAK,CAAC;AACtC;AACA;AACA;AACA;AACA,GAAG;AACH;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcd,oBAAoB","ignoreList":[]}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
6
|
+
exports.default = void 0;
|
|
10
7
|
var _client = require("@apollo/client");
|
|
11
8
|
var _coreErrors = require("@blaze-cms/core-errors");
|
|
12
|
-
var _templateObject;
|
|
13
9
|
function buildUpdatePublishUnpublishMutation(entitySchema, id, action, cache) {
|
|
14
10
|
if (!entitySchema || !entitySchema.actions || !entitySchema.actions.publish || !id || !action) {
|
|
15
11
|
throw new _coreErrors.BlazeError('Update DataEntity query requires publish action from entity schema and id');
|
|
16
12
|
}
|
|
17
|
-
|
|
18
|
-
return (0, _client.gql)
|
|
13
|
+
const withClient = `${cache ? '@client' : ''}`;
|
|
14
|
+
return (0, _client.gql)`
|
|
15
|
+
mutation {
|
|
16
|
+
response: ${entitySchema.actions[action]} ${withClient}(input: {
|
|
17
|
+
id: "${id}"
|
|
18
|
+
}){
|
|
19
|
+
result {
|
|
20
|
+
id,
|
|
21
|
+
status
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
19
26
|
}
|
|
20
|
-
var _default = exports
|
|
27
|
+
var _default = exports.default = buildUpdatePublishUnpublishMutation;
|
|
21
28
|
//# sourceMappingURL=build-update-publish-unpublish-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-update-publish-unpublish-mutation.js","names":["_client","require","_coreErrors","
|
|
1
|
+
{"version":3,"file":"build-update-publish-unpublish-mutation.js","names":["_client","require","_coreErrors","buildUpdatePublishUnpublishMutation","entitySchema","id","action","cache","actions","publish","BlazeError","withClient","gql","_default","exports","default"],"sources":["../../src/utils/build-update-publish-unpublish-mutation.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nfunction buildUpdatePublishUnpublishMutation(entitySchema, id, action, cache) {\n if (!entitySchema || !entitySchema.actions || !entitySchema.actions.publish || !id || !action) {\n throw new BlazeError(\n 'Update DataEntity query requires publish action from entity schema and id'\n );\n }\n\n const withClient = `${cache ? '@client' : ''}`;\n\n return gql`\n mutation {\n response: ${entitySchema.actions[action]} ${withClient}(input: {\n id: \"${id}\"\n }){\n result {\n id,\n status\n }\n }\n }\n `;\n}\n\nexport default buildUpdatePublishUnpublishMutation;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,SAASE,mCAAmCA,CAACC,YAAY,EAAEC,EAAE,EAAEC,MAAM,EAAEC,KAAK,EAAE;EAC5E,IAAI,CAACH,YAAY,IAAI,CAACA,YAAY,CAACI,OAAO,IAAI,CAACJ,YAAY,CAACI,OAAO,CAACC,OAAO,IAAI,CAACJ,EAAE,IAAI,CAACC,MAAM,EAAE;IAC7F,MAAM,IAAII,sBAAU,CAClB,2EACF,CAAC;EACH;EAEA,MAAMC,UAAU,GAAG,GAAGJ,KAAK,GAAG,SAAS,GAAG,EAAE,EAAE;EAE9C,OAAO,IAAAK,WAAG;AACZ;AACA,kBAAkBR,YAAY,CAACI,OAAO,CAACF,MAAM,CAAC,IAAIK,UAAU;AAC5D,eAAeN,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcZ,mCAAmC","ignoreList":[]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.getDefaultQueryParams = void 0;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
where
|
|
7
|
+
const getDefaultQueryParams = schema => {
|
|
8
|
+
const updated = schema.properties && schema.properties.updated;
|
|
9
|
+
const {
|
|
10
|
+
adminDefaultListingFilter: where
|
|
11
|
+
} = schema.displayProperties || {};
|
|
12
12
|
return {
|
|
13
|
-
where
|
|
13
|
+
where,
|
|
14
14
|
limit: 10,
|
|
15
15
|
offset: 0,
|
|
16
16
|
sort: updated ? [{
|
|
@@ -19,4 +19,5 @@ var getDefaultQueryParams = exports.getDefaultQueryParams = function getDefaultQ
|
|
|
19
19
|
}] : []
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
+
exports.getDefaultQueryParams = getDefaultQueryParams;
|
|
22
23
|
//# sourceMappingURL=get-default-query-params.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","
|
|
1
|
+
{"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","schema","updated","properties","adminDefaultListingFilter","where","displayProperties","limit","offset","sort","property","direction","exports"],"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: 10,\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;AAACC,OAAA,CAAAZ,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
@@ -9,10 +8,9 @@ exports.withContext = void 0;
|
|
|
9
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var _react = _interopRequireDefault(require("react"));
|
|
11
10
|
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({}, props, contexts));
|
|
16
|
-
};
|
|
11
|
+
const withContext = Component => function (props) {
|
|
12
|
+
const contexts = (0, _adminUiUtils.useMainContext)(_adminUiUtils.MainContext);
|
|
13
|
+
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, props, contexts));
|
|
17
14
|
};
|
|
15
|
+
exports.withContext = withContext;
|
|
18
16
|
//# sourceMappingURL=withContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withContext.js","names":["_react","_interopRequireDefault","require","_adminUiUtils","withContext","
|
|
1
|
+
{"version":3,"file":"withContext.js","names":["_react","_interopRequireDefault","require","_adminUiUtils","withContext","Component","props","contexts","useMainContext","MainContext","default","createElement","_extends2","exports"],"sources":["../../../src/utils/hoc/withContext.js"],"sourcesContent":["import React from 'react';\nimport { useMainContext, MainContext } from '@blaze-cms/admin-ui-utils';\n\nexport const withContext = Component =>\n function (props) {\n const contexts = useMainContext(MainContext);\n return <Component {...props} {...contexts} />;\n };\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEO,MAAME,WAAW,GAAGC,SAAS,IAClC,UAAUC,KAAK,EAAE;EACf,MAAMC,QAAQ,GAAG,IAAAC,4BAAc,EAACC,yBAAW,CAAC;EAC5C,oBAAOT,MAAA,CAAAU,OAAA,CAAAC,aAAA,CAACN,SAAS,MAAAO,SAAA,CAAAF,OAAA,MAAKJ,KAAK,EAAMC,QAAQ,CAAG,CAAC;AAC/C,CAAC;AAACM,OAAA,CAAAT,WAAA,GAAAA,WAAA","ignoreList":[]}
|