@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.
Files changed (211) hide show
  1. package/lib/components/EntityDataListing/EntityDataListing.js +21 -19
  2. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  3. package/lib/components/EntityDataListing/index.js +2 -3
  4. package/lib/components/EntityDataListing/index.js.map +1 -1
  5. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +18 -19
  6. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
  7. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +2 -3
  8. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
  9. package/lib/components/EntityManager/Entity/Entity.js +284 -457
  10. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  11. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +62 -66
  12. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  13. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +32 -56
  14. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  15. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +2 -3
  16. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  17. package/lib/components/EntityManager/Entity/EntityHeader/index.js +2 -3
  18. package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  19. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +20 -26
  20. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
  21. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +20 -17
  22. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  23. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +34 -32
  24. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  25. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +95 -158
  26. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  27. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +23 -30
  28. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  29. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +2 -3
  30. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  31. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -56
  32. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  33. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +29 -45
  34. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  35. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +2 -3
  36. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  37. package/lib/components/EntityManager/Entity/actions-handlers/index.js +7 -8
  38. package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  39. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +2 -3
  40. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  41. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +36 -57
  42. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  43. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +2 -3
  44. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  45. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +47 -66
  46. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  47. package/lib/components/EntityManager/Entity/index.js +2 -3
  48. package/lib/components/EntityManager/Entity/index.js.map +1 -1
  49. package/lib/components/EntityManager/EntityManager.js +91 -166
  50. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  51. package/lib/components/EntityManager/index.js +2 -3
  52. package/lib/components/EntityManager/index.js.map +1 -1
  53. package/lib/components/EntityManager/utils/RecordEditContext/index.js +3 -4
  54. package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
  55. package/lib/components/EntityManager/utils/data-mappers.js +34 -46
  56. package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
  57. package/lib/components/EntityManager/utils/entity.js +35 -80
  58. package/lib/components/EntityManager/utils/entity.js.map +1 -1
  59. package/lib/components/EntityManager/utils/entityAvailableActions.js +51 -110
  60. package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  61. package/lib/components/EntityManager/utils/is-form-empty.js +6 -10
  62. package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
  63. package/lib/components/EntityManager/utils/query.js +17 -10
  64. package/lib/components/EntityManager/utils/query.js.map +1 -1
  65. package/lib/components/InfoBoxes/InfoBoxTooltip.js +19 -16
  66. package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
  67. package/lib/components/InfoBoxes/InfoBoxes.js +19 -19
  68. package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
  69. package/lib/components/InfoBoxes/container/InfoBoxContainer.js +26 -38
  70. package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  71. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +21 -16
  72. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  73. package/lib/components/InfoBoxes/hooks/useData.js +33 -30
  74. package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
  75. package/lib/components/InfoBoxes/hooks/useInfoBox.js +10 -10
  76. package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
  77. package/lib/components/InfoBoxes/index.js +2 -3
  78. package/lib/components/InfoBoxes/index.js.map +1 -1
  79. package/lib/components/InfoBoxes/presentational/InfoBox.js +27 -34
  80. package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  81. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +11 -12
  82. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  83. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +12 -12
  84. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
  85. package/lib/components/ListingTable/ListingTable.js +155 -296
  86. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  87. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +53 -58
  88. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  89. package/lib/components/ListingTable/ListingTableContent/index.js +2 -3
  90. package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
  91. package/lib/components/ListingTable/SearchFilter/SearchContainer.js +436 -262
  92. package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
  93. package/lib/components/ListingTable/SearchFilter/SearchFilter.js +30 -37
  94. package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -1
  95. package/lib/components/ListingTable/SearchFilter/helpers.js +82 -71
  96. package/lib/components/ListingTable/SearchFilter/helpers.js.map +1 -1
  97. package/lib/components/ListingTable/SearchFilter/querys.js +5 -5
  98. package/lib/components/ListingTable/SearchFilter/querys.js.map +1 -1
  99. package/lib/components/ListingTable/TableActions/TableActions.js +27 -31
  100. package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
  101. package/lib/components/ListingTable/TableActions/index.js +2 -3
  102. package/lib/components/ListingTable/TableActions/index.js.map +1 -1
  103. package/lib/components/ListingTable/index.js +2 -3
  104. package/lib/components/ListingTable/index.js.map +1 -1
  105. package/lib/components/ListingTable/mappers/populate-rows.js +103 -122
  106. package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
  107. package/lib/components/ListingTable/service/index.js +66 -83
  108. package/lib/components/ListingTable/service/index.js.map +1 -1
  109. package/lib/components/Tabs/index.js +26 -42
  110. package/lib/components/Tabs/index.js.map +1 -1
  111. package/lib/components/hooks/useCallbackDebounce.js +5 -9
  112. package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
  113. package/lib/constants.js +30 -31
  114. package/lib/constants.js.map +1 -1
  115. package/lib/icons/ContentIcon.js +17 -20
  116. package/lib/icons/ContentIcon.js.map +1 -1
  117. package/lib/icons/SettingsIcon.js +12 -15
  118. package/lib/icons/SettingsIcon.js.map +1 -1
  119. package/lib/icons/TaxonomyIcon.js +15 -18
  120. package/lib/icons/TaxonomyIcon.js.map +1 -1
  121. package/lib/icons/UsersIcon.js +11 -14
  122. package/lib/icons/UsersIcon.js.map +1 -1
  123. package/lib/icons/index.js +8 -9
  124. package/lib/icons/index.js.map +1 -1
  125. package/lib/index.js +88 -121
  126. package/lib/index.js.map +1 -1
  127. package/lib/utils/add-content-menu-items.js +67 -93
  128. package/lib/utils/add-content-menu-items.js.map +1 -1
  129. package/lib/utils/build-create-entity-mutation.js +12 -9
  130. package/lib/utils/build-create-entity-mutation.js.map +1 -1
  131. package/lib/utils/build-delete-entity-mutation.js +11 -8
  132. package/lib/utils/build-delete-entity-mutation.js.map +1 -1
  133. package/lib/utils/build-listing-query.js +17 -14
  134. package/lib/utils/build-listing-query.js.map +1 -1
  135. package/lib/utils/build-update-data-query.js +15 -9
  136. package/lib/utils/build-update-data-query.js.map +1 -1
  137. package/lib/utils/build-update-publish-unpublish-mutation.js +15 -8
  138. package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  139. package/lib/utils/get-default-query-params.js +7 -6
  140. package/lib/utils/get-default-query-params.js.map +1 -1
  141. package/lib/utils/hoc/withContext.js +4 -6
  142. package/lib/utils/hoc/withContext.js.map +1 -1
  143. package/lib/utils/hooks/useToggle.js +4 -12
  144. package/lib/utils/hooks/useToggle.js.map +1 -1
  145. package/lib/utils/index.js +2 -3
  146. package/lib/utils/index.js.map +1 -1
  147. package/lib-es/components/EntityManager/Entity/Entity.js +8 -20
  148. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  149. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  150. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  151. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  152. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  153. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +6 -3
  154. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  155. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  156. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  157. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  158. package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
  159. package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
  160. package/lib-es/components/EntityManager/utils/query.js.map +1 -1
  161. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
  162. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  163. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  164. package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
  165. package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  166. package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  167. package/lib-es/components/ListingTable/ListingTable.js +2 -2
  168. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  169. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +20 -17
  170. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  171. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js +323 -51
  172. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
  173. package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js +7 -3
  174. package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -1
  175. package/lib-es/components/ListingTable/SearchFilter/helpers.js +39 -8
  176. package/lib-es/components/ListingTable/SearchFilter/helpers.js.map +1 -1
  177. package/lib-es/components/ListingTable/SearchFilter/querys.js.map +1 -1
  178. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
  179. package/lib-es/components/ListingTable/service/index.js.map +1 -1
  180. package/lib-es/components/Tabs/index.js +6 -7
  181. package/lib-es/components/Tabs/index.js.map +1 -1
  182. package/lib-es/index.js +12 -3
  183. package/lib-es/index.js.map +1 -1
  184. package/lib-es/utils/add-content-menu-items.js.map +1 -1
  185. package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
  186. package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
  187. package/lib-es/utils/build-listing-query.js.map +1 -1
  188. package/lib-es/utils/build-update-data-query.js.map +1 -1
  189. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  190. package/lib-es/utils/hoc/withContext.js +1 -1
  191. package/lib-es/utils/hoc/withContext.js.map +1 -1
  192. package/package.json +27 -22
  193. package/src/components/EntityManager/Entity/Entity.js +59 -77
  194. package/src/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
  195. package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +9 -7
  196. package/src/components/EntityManager/Entity/SideBarRelations/index.js +64 -59
  197. package/src/components/EntityManager/EntityManager.js +52 -45
  198. package/src/components/InfoBoxes/container/InfoBoxContainer.js +3 -6
  199. package/src/components/InfoBoxes/hooks/useData.js +6 -1
  200. package/src/components/ListingTable/ListingTable.js +13 -21
  201. package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +38 -44
  202. package/src/components/ListingTable/SearchFilter/SearchContainer.js +411 -134
  203. package/src/components/ListingTable/SearchFilter/SearchFilter.js +5 -2
  204. package/src/components/ListingTable/SearchFilter/helpers.js +56 -8
  205. package/src/components/ListingTable/service/index.js +2 -3
  206. package/src/components/Tabs/index.js +17 -21
  207. package/src/index.js +11 -7
  208. package/src/utils/hoc/withContext.js +5 -4
  209. package/CHANGELOG.md +0 -1947
  210. package/babel.config.js +0 -3
  211. package/jest.config.js +0 -5
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_reactFormBuilder","require","_react","_interopRequireDefault","_package","_constants","_addContentMenuItems","_icons","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","_typeof2","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","EntityDataListing","React","lazy","Promise","resolve","then","EntityManager","load","_x","_load","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee2","app","entityDataListingRoute","editEntityRoute","addEntityRoute","wrap","_callee2$","_context2","prev","next","events","once","getAddContentMenuItems","addFieldType","keys","formFieldTypes","forEach","type","component","_callee","_callee$","_context","emitAsync","getFormBuilderLookup","stop","_ref2","addConfig","main","items","content","label","loadOpen","icon","ContentIcon","order","taxonomy","TaxonomyIcon","user","UserIcon","settings","SettingsIcon","path","concat","DATA_LISTING_PREFIX","key","exact","addRoute","abrupt","name","PLUGIN_NAME","version","pkg","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import { getFormBuilderLookup, formFieldTypes } from '@blaze-cms/react-form-builder';\nimport React from 'react';\nimport pkg from '../package.json';\nimport { DATA_LISTING_PREFIX, PLUGIN_NAME } from './constants';\nimport getAddContentMenuItems from './utils/add-content-menu-items';\nimport { UserIcon, TaxonomyIcon, ContentIcon, SettingsIcon } from './icons';\n\nconst EntityDataListing = React.lazy(() =>\n import(/* webpackChunkName: 'EntityDataListing' */ './components/EntityDataListing')\n);\nconst EntityManager = React.lazy(() =>\n import(/* webpackChunkName: 'EntityManager' */ './components/EntityManager')\n);\n\nexport default async function load(app) {\n app.events.once('admin:menu:config:load', getAddContentMenuItems(app));\n\n app.events.once('load:custom:field:type', addFieldType => {\n Object.keys(formFieldTypes).forEach(type => {\n addFieldType({ type, component: formFieldTypes[type] });\n });\n });\n\n app.events.once('plugin:data-ui:load:loaded', async () => {\n await app.events.emitAsync('load:custom:field:type', getFormBuilderLookup.addFieldType);\n });\n\n app.events.once('admin:menu:config:load', ({ addConfig }) => {\n addConfig({\n main: {\n items: {\n content: {\n label: 'content',\n loadOpen: true,\n items: {},\n icon: ContentIcon,\n order: 10\n },\n taxonomy: {\n label: 'Taxonomy',\n items: {},\n icon: TaxonomyIcon,\n order: 40\n },\n user: {\n label: 'User',\n items: {},\n icon: UserIcon,\n order: 90\n },\n settings: {\n label: 'Settings',\n items: {},\n icon: SettingsIcon,\n order: 100\n }\n }\n }\n });\n });\n\n const entityDataListingRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier`,\n key: 'entityDataListing',\n component: EntityDataListing,\n exact: true\n };\n\n const editEntityRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action/:id`,\n key: 'editEntity',\n component: EntityManager,\n exact: true\n };\n\n const addEntityRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action`,\n key: 'createEntity',\n component: EntityManager,\n exact: true\n };\n\n app.addRoute(entityDataListingRoute);\n app.addRoute(editEntityRoute);\n app.addRoute(addEntityRoute);\n\n return {\n name: PLUGIN_NAME,\n version: pkg.version\n };\n}\n\nload.pluginName = PLUGIN_NAME;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAH,sBAAA,C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GAAG;YACtBsC,IAAI,KAAAC,MAAA,CAAKC,8BAAmB,mCAAgC;YAC5DC,GAAG,EAAE,YAAY;YACjB1B,SAAS,EAAE3B,aAAa;YACxBsD,KAAK,EAAE;UACT,CAAC;UAEKzC,cAAc,GAAG;YACrBqC,IAAI,KAAAC,MAAA,CAAKC,8BAAmB,+BAA4B;YACxDC,GAAG,EAAE,cAAc;YACnB1B,SAAS,EAAE3B,aAAa;YACxBsD,KAAK,EAAE;UACT,CAAC;UAED5C,GAAG,CAAC6C,QAAQ,CAAC5C,sBAAsB,CAAC;UACpCD,GAAG,CAAC6C,QAAQ,CAAC3C,eAAe,CAAC;UAC7BF,GAAG,CAAC6C,QAAQ,CAAC1C,cAAc,CAAC;UAAC,OAAAG,SAAA,CAAAwC,MAAA,WAEtB;YACLC,IAAI,EAAEC,sBAAW;YACjBC,OAAO,EAAEC,mBAAG,CAACD;UACf,CAAC;QAAA;QAAA;UAAA,OAAA3C,SAAA,CAAAiB,IAAA;MAAA;IAAA,GAAAxB,QAAA;EAAA,CACF;EAAA,OAAAN,KAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAEDJ,IAAI,CAAC4D,UAAU,GAAGH,sBAAW","ignoreList":[]}
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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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["default"] = void 0;
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
- var _require = require('../constants'),
18
- MENU_PERMISSIONS = _require.MENU_PERMISSIONS;
8
+ const {
9
+ MENU_PERMISSIONS
10
+ } = require('../constants');
19
11
  function getAddContentMenuItems(app) {
20
- return /*#__PURE__*/function () {
21
- var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
22
- var addConfig, client, _yield$client$query, getEntitySchemas, menuItems, sectionMenuItems, menuConfig;
23
- return _regenerator["default"].wrap(function _callee$(_context) {
24
- while (1) switch (_context.prev = _context.next) {
25
- case 0:
26
- addConfig = _ref.addConfig;
27
- client = app.getClient();
28
- _context.next = 4;
29
- return client.query({
30
- query: (0, _adminUiUtils.getQuery)('GET_USER_EDITABLE_ENTITIES'),
31
- variables: {
32
- // only return entities that the current user can do the following actions on
33
- canDoActions: MENU_PERMISSIONS
34
- }
35
- });
36
- case 4:
37
- _yield$client$query = _context.sent;
38
- getEntitySchemas = _yield$client$query.data.getEntitySchemas;
39
- if (!(!getEntitySchemas || !getEntitySchemas.length)) {
40
- _context.next = 8;
41
- break;
42
- }
43
- return _context.abrupt("return");
44
- case 8:
45
- // no items so don't add section
46
- menuItems = {};
47
- sectionMenuItems = {
48
- settings: {}
49
- };
50
- getEntitySchemas.forEach(function (_ref3) {
51
- var id = _ref3.id,
52
- displayName = _ref3.displayName,
53
- displayProperties = _ref3.displayProperties;
54
- if (!displayProperties) return null;
55
- var _displayProperties$ad = displayProperties.adminMenu,
56
- _displayProperties$ad2 = _displayProperties$ad === void 0 ? {} : _displayProperties$ad,
57
- _displayProperties$ad3 = _displayProperties$ad2.sectionKey,
58
- sectionKey = _displayProperties$ad3 === void 0 ? 'settings' : _displayProperties$ad3;
59
- var sectionItems = sectionMenuItems[sectionKey] || {};
60
- sectionItems[id] = {
61
- label: displayName,
62
- uri: "/data-listing/".concat(id)
63
- };
64
- sectionMenuItems[sectionKey] = sectionItems;
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
- }, _callee);
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["default"] = getAddContentMenuItems;
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","_require","MENU_PERMISSIONS","getAddContentMenuItems","app","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","_ref","addConfig","client","_yield$client$query","getEntitySchemas","menuItems","sectionMenuItems","menuConfig","wrap","_callee$","_context","prev","next","getClient","query","getQuery","variables","canDoActions","sent","data","length","abrupt","settings","forEach","_ref3","id","displayName","displayProperties","_displayProperties$ad","adminMenu","_displayProperties$ad2","_displayProperties$ad3","sectionKey","sectionItems","label","uri","concat","main","items","Object","entries","_ref4","_ref5","_slicedToArray2","sectionConfig","_ref6","stop","_x","apply","arguments","_default","exports"],"sources":["../../src/utils/add-content-menu-items.js"],"sourcesContent":["import { getQuery } from '@blaze-cms/admin-ui-utils';\n\nconst { MENU_PERMISSIONS } = require('../constants');\n\nfunction getAddContentMenuItems(app) {\n return async ({ addConfig }) => {\n const client = app.getClient();\n const {\n data: { getEntitySchemas }\n } = await client.query({\n query: getQuery('GET_USER_EDITABLE_ENTITIES'),\n variables: {\n // only return entities that the current user can do the following actions on\n canDoActions: MENU_PERMISSIONS\n }\n });\n\n if (!getEntitySchemas || !getEntitySchemas.length) return; // no items so don't add section\n\n const menuItems = {};\n const sectionMenuItems = { settings: {} };\n\n getEntitySchemas.forEach(({ id, displayName, displayProperties }) => {\n if (!displayProperties) return null;\n\n const { adminMenu: { sectionKey = 'settings' } = {} } = displayProperties;\n const sectionItems = sectionMenuItems[sectionKey] || {};\n sectionItems[id] = {\n label: displayName,\n uri: `/data-listing/${id}`\n };\n sectionMenuItems[sectionKey] = sectionItems;\n });\n\n const menuConfig = {\n main: {\n items: {\n settings: {\n items: menuItems\n }\n }\n }\n };\n\n Object.entries(sectionMenuItems).forEach(([sectionKey, sectionItems]) => {\n const sectionConfig = menuConfig.main.items[sectionKey] || {};\n sectionConfig.items = sectionItems;\n menuConfig.main.items[sectionKey] = sectionConfig;\n });\n\n getEntitySchemas.forEach(({ id, displayName }) => {\n menuItems[id] = {\n label: displayName,\n uri: `/data-listing/${id}`\n };\n });\n\n addConfig(menuConfig);\n };\n}\n\nexport default getAddContentMenuItems;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAA6BD,OAAO,CAAC,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SAAS,CAACoB,EAAE,CAAC,GAAG;gBACdS,KAAK,EAAER,WAAW;gBAClBS,GAAG,mBAAAC,MAAA,CAAmBX,EAAE;cAC1B,CAAC;YACH,CAAC,CAAC;YAEFxB,SAAS,CAACM,UAAU,CAAC;UAAC;UAAA;YAAA,OAAAG,QAAA,CAAAoC,IAAA;QAAA;MAAA,GAAA/C,OAAA;IAAA,CACvB;IAAA,iBAAAgD,EAAA;MAAA,OAAApD,KAAA,CAAAqD,KAAA,OAAAC,SAAA;IAAA;EAAA;AACH;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEc1D,sBAAsB","ignoreList":[]}
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["default"] = void 0;
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
- var actionInput = (0, _lodash["default"])("".concat(entitySchema.actions.create, "Input"));
21
- var dataProperties = (0, _adminUiUtils.getDataProperties)(entitySchema);
22
- return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["mutation createEntity($input: ", ") {\n createdEntity: ", "(input: $input){\n result {\n id,\n ", "\n }\n }\n }"])), actionInput, entitySchema.actions.create, dataProperties.join(',\n'));
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["default"] = buildCreateEntityMutation;
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","_templateObject","buildCreateEntityMutation","entitySchema","actions","create","properties","BlazeError","actionInput","upperfirst","concat","dataProperties","getDataProperties","gql","_taggedTemplateLiteral2","join","_default","exports"],"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;AAA8D,IAAAK,eAAA;AAE9D,SAASC,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,IAAMC,WAAW,GAAG,IAAAC,kBAAU,KAAAC,MAAA,CAAIP,YAAY,CAACC,OAAO,CAACC,MAAM,UAAO,CAAC;EACrE,IAAMM,cAAc,GAAG,IAAAC,+BAAiB,EAACT,YAAY,CAAC;EAEtD,WAAOU,WAAG,EAAAZ,eAAA,KAAAA,eAAA,OAAAa,uBAAA,0KAAkCN,WAAW,EACpCL,YAAY,CAACC,OAAO,CAACC,MAAM,EAGpCM,cAAc,CAACI,IAAI,CAAC,KAAK,CAAC;AAItC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEcf,yBAAyB","ignoreList":[]}
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["default"] = void 0;
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["delete"]) {
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
- var actionInput = (0, _lodash["default"])("".concat(entitySchema.actions["delete"], "Input"));
19
- return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n mutation deleteEntity($input: ", ") {\n deleteEntity: ", "(input: $input){\n result\n }\n }\n "])), actionInput, entitySchema.actions["delete"]);
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["default"] = buildDeleteEntity;
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","_templateObject","buildDeleteEntity","entitySchema","actions","BlazeError","actionInput","upperfirst","concat","gql","_taggedTemplateLiteral2","_default","exports"],"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;AAA2C,IAAAI,eAAA;AAE3C,SAASC,iBAAiBA,CAACC,YAAY,EAAE;EACvC,IAAI,CAACA,YAAY,IAAI,CAACA,YAAY,CAACC,OAAO,IAAI,CAACD,YAAY,CAACC,OAAO,UAAO,EAAE;IAC1E,MAAM,IAAIC,sBAAU,CAAC,wDAAwD,CAAC;EAChF;EAEA,IAAMC,WAAW,GAAG,IAAAC,kBAAU,KAAAC,MAAA,CAAIL,YAAY,CAACC,OAAO,UAAO,UAAO,CAAC;EAErE,WAAOK,WAAG,EAAAR,eAAA,KAAAA,eAAA,OAAAS,uBAAA,qIACuBJ,WAAW,EAC1BH,YAAY,CAACC,OAAO,UAAO;AAK/C;AAAC,IAAAO,QAAA,GAAAC,OAAA,cAEcV,iBAAiB","ignoreList":[]}
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["default"] = void 0;
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
- var _templateObject;
15
- var buildAdminSearchQuery = function buildAdminSearchQuery(entitySchema, index) {
16
- var _ref = entitySchema || {},
17
- _ref$listingPropertie = _ref.listingProperties,
18
- listingProperties = _ref$listingPropertie === void 0 ? [] : _ref$listingPropertie;
19
- var parsedProperties = "id, ".concat(listingProperties.join(' ') || 'id name');
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
- var sortType = entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);
28
- return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n query ", "($where: JSON, $limit: Int, $offset:Int, $sort: [", "SortItem]) {\n listingData: ", "(where: $where, limit: $limit, offset:$offset, sort:$sort){\n id,\n ", "\n }\n totalRecords: ", "(where: $where)\n }\n "])), entitySchema.actions.getAll, sortType, entitySchema.actions.getAll, entitySchema.listingProperties.join(',\n'), entitySchema.actions.countAll);
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["default"] = buildListingQuery;
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","_templateObject","buildAdminSearchQuery","entitySchema","index","_ref","_ref$listingPropertie","listingProperties","parsedProperties","concat","join","getDynamicQuery","buildListingQuery","isSearchQuery","actions","getAll","BlazeError","sortType","toUpperCase","substr","gql","_taggedTemplateLiteral2","countAll","_default","exports"],"sources":["../../src/utils/build-listing-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport { getDynamicQuery } from '@blaze-cms/admin-ui-utils';\n\nconst buildAdminSearchQuery = (entitySchema, 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;AAA4D,IAAAG,eAAA;AAE5D,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,YAAY,EAAEC,KAAK,EAAK;EACrD,IAAAC,IAAA,GAAmCF,YAAY,IAAI,CAAC,CAAC;IAAAG,qBAAA,GAAAD,IAAA,CAA7CE,iBAAiB;IAAjBA,iBAAiB,GAAAD,qBAAA,cAAG,EAAE,GAAAA,qBAAA;EAC9B,IAAME,gBAAgB,UAAAC,MAAA,CAAUF,iBAAiB,CAACG,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,CAAE;EAE1E,OAAO,IAAAC,6BAAe,EAAC,cAAc,CAAC,CAAC,CAACR,YAAY,CAAC,EAAEK,gBAAgB,EAAE,IAAI,EAAEJ,KAAK,CAAC;AACvF,CAAC;AAED,SAASQ,iBAAiBA,CAACT,YAAY,EAAEC,KAAK,EAAES,aAAa,EAAE;EAC7D,IAAI,CAACV,YAAY,CAACW,OAAO,IAAI,CAACX,YAAY,CAACW,OAAO,CAACC,MAAM,IAAI,CAACZ,YAAY,CAACI,iBAAiB,EAAE;IAC5F,MAAM,IAAIS,sBAAU,CAClB,+EACF,CAAC;EACH;EAEA,IAAIH,aAAa,EAAE,OAAOX,qBAAqB,CAACC,YAAY,EAAEC,KAAK,CAAC;EAEpE,IAAMa,QAAQ,GACZd,YAAY,CAACW,OAAO,CAACC,MAAM,CAAC,CAAC,CAAC,CAACG,WAAW,CAAC,CAAC,GAAGf,YAAY,CAACW,OAAO,CAACC,MAAM,CAACI,MAAM,CAAC,CAAC,CAAC;EAEtF,WAAOC,WAAG,EAAAnB,eAAA,KAAAA,eAAA,OAAAoB,uBAAA,kRAENlB,YAAY,CAACW,OAAO,CAACC,MAAM,EACuBE,QAAQ,EAExDd,YAAY,CAACW,OAAO,CAACC,MAAM,EAGzBZ,YAAY,CAACI,iBAAiB,CAACG,IAAI,CAAC,KAAK,CAAC,EAE9BP,YAAY,CAACW,OAAO,CAACQ,QAAQ;AAGnD;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEcZ,iBAAiB","ignoreList":[]}
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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G;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["default"] = void 0;
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
- var actionInput = (0, _lodash["default"])("".concat(entitySchema.actions.update, "Input"));
21
- var dataProperties = (0, _adminUiUtils.getDataProperties)(entitySchema);
22
- return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n mutation updateEntity($input: ", ") {\n updateEntity: ", "(input: $input){\n result {\n id,\n ", ",\n updated\n }\n }\n }\n "])), actionInput, entitySchema.actions.update, dataProperties.join(',\n'));
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["default"] = buildUpdateDataQuery;
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","_templateObject","buildUpdateDataQuery","entitySchema","actions","update","properties","BlazeError","actionInput","upperfirst","concat","dataProperties","getDataProperties","gql","_taggedTemplateLiteral2","join","_default","exports"],"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;AAA8D,IAAAK,eAAA;AAE9D,SAASC,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,IAAMC,WAAW,GAAG,IAAAC,kBAAU,KAAAC,MAAA,CAAIP,YAAY,CAACC,OAAO,CAACC,MAAM,UAAO,CAAC;EACrE,IAAMM,cAAc,GAAG,IAAAC,+BAAiB,EAACT,YAAY,CAAC;EAEtD,WAAOU,WAAG,EAAAZ,eAAA,KAAAA,eAAA,OAAAa,uBAAA,qMACuBN,WAAW,EAC1BL,YAAY,CAACC,OAAO,CAACC,MAAM,EAGnCM,cAAc,CAACI,IAAI,CAAC,KAAK,CAAC;AAMtC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEcf,oBAAoB","ignoreList":[]}
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["default"] = void 0;
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
- var withClient = "".concat(cache ? '@client' : '');
18
- return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n mutation {\n response: ", " ", "(input: {\n id: \"", "\"\n }){\n result {\n id,\n status\n }\n }\n }\n "])), entitySchema.actions[action], withClient, id);
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["default"] = buildUpdatePublishUnpublishMutation;
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","_templateObject","buildUpdatePublishUnpublishMutation","entitySchema","id","action","cache","actions","publish","BlazeError","withClient","concat","gql","_taggedTemplateLiteral2","_default","exports"],"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;AAAoD,IAAAE,eAAA;AAEpD,SAASC,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,IAAMC,UAAU,MAAAC,MAAA,CAAML,KAAK,GAAG,SAAS,GAAG,EAAE,CAAE;EAE9C,WAAOM,WAAG,EAAAX,eAAA,KAAAA,eAAA,OAAAY,uBAAA,4LAEMV,YAAY,CAACI,OAAO,CAACF,MAAM,CAAC,EAAIK,UAAU,EAC7CN,EAAE;AASjB;AAAC,IAAAU,QAAA,GAAAC,OAAA,cAEcb,mCAAmC","ignoreList":[]}
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
- var getDefaultQueryParams = exports.getDefaultQueryParams = function getDefaultQueryParams(schema) {
9
- var updated = schema.properties && schema.properties.updated;
10
- var _ref = schema.displayProperties || {},
11
- where = _ref.adminDefaultListingFilter;
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: 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","exports","schema","updated","properties","_ref","displayProperties","where","adminDefaultListingFilter","limit","offset","sort","property","direction"],"sources":["../../src/utils/get-default-query-params.js"],"sourcesContent":["const getDefaultQueryParams = schema => {\n const updated = schema.properties && schema.properties.updated;\n const { adminDefaultListingFilter: where } = schema.displayProperties || {};\n\n return {\n where,\n limit: 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,IAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,SAAxBA,qBAAqBA,CAAGE,MAAM,EAAI;EACtC,IAAMC,OAAO,GAAGD,MAAM,CAACE,UAAU,IAAIF,MAAM,CAACE,UAAU,CAACD,OAAO;EAC9D,IAAAE,IAAA,GAA6CH,MAAM,CAACI,iBAAiB,IAAI,CAAC,CAAC;IAAxCC,KAAK,GAAAF,IAAA,CAAhCG,yBAAyB;EAEjC,OAAO;IACLD,KAAK,EAALA,KAAK;IACLE,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAER,OAAO,GACT,CACE;MACES,QAAQ,EAAE,SAAS;MACnBC,SAAS,EAAE;IACb,CAAC,CACF,GACD;EACN,CAAC;AACH,CAAC","ignoreList":[]}
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
- var withContext = exports.withContext = function withContext(Component) {
13
- return function (props) {
14
- var contexts = (0, _adminUiUtils.useMainContext)(_adminUiUtils.MainContext);
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","exports","Component","props","contexts","useMainContext","MainContext","createElement","_extends2"],"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 => 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,IAAME,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,SAAdA,WAAWA,CAAGE,SAAS;EAAA,OAAI,UAAAC,KAAK,EAAI;IAC/C,IAAMC,QAAQ,GAAG,IAAAC,4BAAc,EAACC,yBAAW,CAAC;IAC5C,oBAAOV,MAAA,YAAAW,aAAA,CAACL,SAAS,MAAAM,SAAA,iBAAKL,KAAK,EAAMC,QAAQ,CAAG,CAAC;EAC/C,CAAC;AAAA","ignoreList":[]}
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":[]}