@blaze-cms/plugin-data-ui 0.146.0-translations.6 → 0.147.0-rc-eagle.2

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 (273) hide show
  1. package/README.md +57 -0
  2. package/lib/components/EntityDataListing/EntityDataListing.js +21 -19
  3. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  4. package/lib/components/EntityDataListing/index.js +2 -3
  5. package/lib/components/EntityDataListing/index.js.map +1 -1
  6. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +18 -19
  7. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
  8. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +2 -3
  9. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
  10. package/lib/components/EntityManager/Entity/Entity.js +289 -452
  11. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  12. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +62 -66
  13. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  14. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +34 -50
  15. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  16. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +2 -3
  17. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  18. package/lib/components/EntityManager/Entity/EntityHeader/index.js +2 -3
  19. package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  20. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +20 -26
  21. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
  22. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +20 -17
  23. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  24. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +34 -32
  25. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  26. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +104 -150
  27. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  28. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +24 -24
  29. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  30. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +2 -3
  31. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  32. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -56
  33. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  34. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +29 -45
  35. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  36. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +2 -3
  37. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  38. package/lib/components/EntityManager/Entity/actions-handlers/index.js +7 -8
  39. package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  40. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +2 -3
  41. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  42. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +36 -57
  43. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  44. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +2 -3
  45. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  46. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +47 -66
  47. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  48. package/lib/components/EntityManager/Entity/index.js +2 -3
  49. package/lib/components/EntityManager/Entity/index.js.map +1 -1
  50. package/lib/components/EntityManager/EntityManager.js +91 -166
  51. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  52. package/lib/components/EntityManager/index.js +2 -3
  53. package/lib/components/EntityManager/index.js.map +1 -1
  54. package/lib/components/EntityManager/utils/RecordEditContext/index.js +3 -4
  55. package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
  56. package/lib/components/EntityManager/utils/data-mappers.js +34 -46
  57. package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
  58. package/lib/components/EntityManager/utils/entity.js +35 -73
  59. package/lib/components/EntityManager/utils/entity.js.map +1 -1
  60. package/lib/components/EntityManager/utils/entityAvailableActions.js +51 -110
  61. package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  62. package/lib/components/EntityManager/utils/is-form-empty.js +6 -10
  63. package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
  64. package/lib/components/EntityManager/utils/query.js +17 -10
  65. package/lib/components/EntityManager/utils/query.js.map +1 -1
  66. package/lib/components/InfoBoxes/InfoBoxTooltip.js +43 -0
  67. package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -0
  68. package/lib/components/InfoBoxes/InfoBoxes.js +19 -19
  69. package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
  70. package/lib/components/InfoBoxes/container/InfoBoxContainer.js +26 -38
  71. package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  72. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +21 -16
  73. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  74. package/lib/components/InfoBoxes/hooks/useData.js +33 -30
  75. package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
  76. package/lib/components/InfoBoxes/hooks/useInfoBox.js +10 -10
  77. package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
  78. package/lib/components/InfoBoxes/index.js +2 -3
  79. package/lib/components/InfoBoxes/index.js.map +1 -1
  80. package/lib/components/InfoBoxes/presentational/InfoBox.js +28 -32
  81. package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  82. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +11 -12
  83. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  84. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +12 -12
  85. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
  86. package/lib/components/ListingTable/ListingTable.js +163 -303
  87. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  88. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +61 -40
  89. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  90. package/lib/components/ListingTable/ListingTableContent/index.js +2 -3
  91. package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
  92. package/lib/components/ListingTable/SearchFilter/SearchContainer.js +215 -0
  93. package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -0
  94. package/lib/components/ListingTable/SearchFilter/SearchFilter.js +48 -0
  95. package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -0
  96. package/lib/components/ListingTable/SearchFilter/helpers.js +105 -0
  97. package/lib/components/ListingTable/SearchFilter/helpers.js.map +1 -0
  98. package/lib/components/ListingTable/SearchFilter/querys.js +13 -0
  99. package/lib/components/ListingTable/SearchFilter/querys.js.map +1 -0
  100. package/lib/components/ListingTable/TableActions/TableActions.js +27 -31
  101. package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
  102. package/lib/components/ListingTable/TableActions/index.js +2 -3
  103. package/lib/components/ListingTable/TableActions/index.js.map +1 -1
  104. package/lib/components/ListingTable/index.js +2 -3
  105. package/lib/components/ListingTable/index.js.map +1 -1
  106. package/lib/components/ListingTable/mappers/populate-rows.js +104 -120
  107. package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
  108. package/lib/components/ListingTable/service/index.js +66 -83
  109. package/lib/components/ListingTable/service/index.js.map +1 -1
  110. package/lib/components/Tabs/index.js +26 -42
  111. package/lib/components/Tabs/index.js.map +1 -1
  112. package/lib/components/hooks/useCallbackDebounce.js +5 -9
  113. package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
  114. package/lib/constants.js +31 -29
  115. package/lib/constants.js.map +1 -1
  116. package/lib/icons/ContentIcon.js +17 -20
  117. package/lib/icons/ContentIcon.js.map +1 -1
  118. package/lib/icons/SettingsIcon.js +12 -15
  119. package/lib/icons/SettingsIcon.js.map +1 -1
  120. package/lib/icons/TaxonomyIcon.js +15 -18
  121. package/lib/icons/TaxonomyIcon.js.map +1 -1
  122. package/lib/icons/UsersIcon.js +11 -14
  123. package/lib/icons/UsersIcon.js.map +1 -1
  124. package/lib/icons/index.js +8 -9
  125. package/lib/icons/index.js.map +1 -1
  126. package/lib/index.js +81 -121
  127. package/lib/index.js.map +1 -1
  128. package/lib/utils/add-content-menu-items.js +67 -93
  129. package/lib/utils/add-content-menu-items.js.map +1 -1
  130. package/lib/utils/build-create-entity-mutation.js +12 -9
  131. package/lib/utils/build-create-entity-mutation.js.map +1 -1
  132. package/lib/utils/build-delete-entity-mutation.js +11 -8
  133. package/lib/utils/build-delete-entity-mutation.js.map +1 -1
  134. package/lib/utils/build-listing-query.js +20 -17
  135. package/lib/utils/build-listing-query.js.map +1 -1
  136. package/lib/utils/build-update-data-query.js +15 -9
  137. package/lib/utils/build-update-data-query.js.map +1 -1
  138. package/lib/utils/build-update-publish-unpublish-mutation.js +15 -8
  139. package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  140. package/lib/utils/get-default-query-params.js +7 -6
  141. package/lib/utils/get-default-query-params.js.map +1 -1
  142. package/lib/utils/hoc/withContext.js +4 -6
  143. package/lib/utils/hoc/withContext.js.map +1 -1
  144. package/lib/utils/hooks/useToggle.js +4 -12
  145. package/lib/utils/hooks/useToggle.js.map +1 -1
  146. package/lib/utils/index.js +2 -3
  147. package/lib/utils/index.js.map +1 -1
  148. package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
  149. package/lib-es/components/EntityDataListing/index.js.map +1 -1
  150. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
  151. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
  152. package/lib-es/components/EntityManager/Entity/Entity.js +21 -28
  153. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  154. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  155. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +6 -1
  156. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  157. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  158. package/lib-es/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  159. package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
  160. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +2 -0
  161. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  162. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  163. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +26 -7
  164. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  165. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +8 -2
  166. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  167. package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  168. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  169. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  170. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  171. package/lib-es/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  172. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  173. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  174. package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  175. package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  176. package/lib-es/components/EntityManager/Entity/index.js.map +1 -1
  177. package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
  178. package/lib-es/components/EntityManager/index.js.map +1 -1
  179. package/lib-es/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
  180. package/lib-es/components/EntityManager/utils/data-mappers.js.map +1 -1
  181. package/lib-es/components/EntityManager/utils/entity.js +6 -2
  182. package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
  183. package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  184. package/lib-es/components/EntityManager/utils/is-form-empty.js.map +1 -1
  185. package/lib-es/components/EntityManager/utils/query.js.map +1 -1
  186. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js +36 -0
  187. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +1 -0
  188. package/lib-es/components/InfoBoxes/InfoBoxes.js.map +1 -1
  189. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  190. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +2 -0
  191. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  192. package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
  193. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
  194. package/lib-es/components/InfoBoxes/index.js.map +1 -1
  195. package/lib-es/components/InfoBoxes/presentational/InfoBox.js +4 -1
  196. package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  197. package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  198. package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
  199. package/lib-es/components/ListingTable/ListingTable.js +12 -11
  200. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  201. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +34 -16
  202. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  203. package/lib-es/components/ListingTable/ListingTableContent/index.js.map +1 -1
  204. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js +207 -0
  205. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -0
  206. package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js +40 -0
  207. package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -0
  208. package/lib-es/components/ListingTable/SearchFilter/helpers.js +96 -0
  209. package/lib-es/components/ListingTable/SearchFilter/helpers.js.map +1 -0
  210. package/lib-es/components/ListingTable/SearchFilter/querys.js +8 -0
  211. package/lib-es/components/ListingTable/SearchFilter/querys.js.map +1 -0
  212. package/lib-es/components/ListingTable/TableActions/TableActions.js.map +1 -1
  213. package/lib-es/components/ListingTable/TableActions/index.js.map +1 -1
  214. package/lib-es/components/ListingTable/index.js.map +1 -1
  215. package/lib-es/components/ListingTable/mappers/populate-rows.js +3 -0
  216. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
  217. package/lib-es/components/ListingTable/service/index.js +3 -2
  218. package/lib-es/components/ListingTable/service/index.js.map +1 -1
  219. package/lib-es/components/Tabs/index.js +6 -7
  220. package/lib-es/components/Tabs/index.js.map +1 -1
  221. package/lib-es/components/hooks/useCallbackDebounce.js.map +1 -1
  222. package/lib-es/constants.js +4 -1
  223. package/lib-es/constants.js.map +1 -1
  224. package/lib-es/icons/ContentIcon.js.map +1 -1
  225. package/lib-es/icons/SettingsIcon.js.map +1 -1
  226. package/lib-es/icons/TaxonomyIcon.js.map +1 -1
  227. package/lib-es/icons/UsersIcon.js.map +1 -1
  228. package/lib-es/icons/index.js.map +1 -1
  229. package/lib-es/index.js +11 -3
  230. package/lib-es/index.js.map +1 -1
  231. package/lib-es/utils/add-content-menu-items.js.map +1 -1
  232. package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
  233. package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
  234. package/lib-es/utils/build-listing-query.js +4 -4
  235. package/lib-es/utils/build-listing-query.js.map +1 -1
  236. package/lib-es/utils/build-update-data-query.js.map +1 -1
  237. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  238. package/lib-es/utils/get-default-query-params.js.map +1 -1
  239. package/lib-es/utils/hoc/withContext.js +1 -1
  240. package/lib-es/utils/hoc/withContext.js.map +1 -1
  241. package/lib-es/utils/hooks/useToggle.js.map +1 -1
  242. package/lib-es/utils/index.js.map +1 -1
  243. package/package.json +28 -22
  244. package/src/components/EntityManager/Entity/Entity.js +72 -80
  245. package/src/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
  246. package/src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +8 -1
  247. package/src/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +2 -0
  248. package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +9 -7
  249. package/src/components/EntityManager/Entity/SideBarRelations/index.js +82 -59
  250. package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +5 -3
  251. package/src/components/EntityManager/EntityManager.js +52 -45
  252. package/src/components/EntityManager/utils/entity.js +13 -2
  253. package/src/components/InfoBoxes/InfoBoxTooltip.js +32 -0
  254. package/src/components/InfoBoxes/container/InfoBoxContainer.js +3 -6
  255. package/src/components/InfoBoxes/helpers/build-dynamic-query.js +2 -0
  256. package/src/components/InfoBoxes/hooks/useData.js +6 -1
  257. package/src/components/InfoBoxes/presentational/InfoBox.js +4 -2
  258. package/src/components/ListingTable/ListingTable.js +23 -31
  259. package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +43 -27
  260. package/src/components/ListingTable/SearchFilter/SearchContainer.js +228 -0
  261. package/src/components/ListingTable/SearchFilter/SearchFilter.js +38 -0
  262. package/src/components/ListingTable/SearchFilter/helpers.js +99 -0
  263. package/src/components/ListingTable/SearchFilter/querys.js +9 -0
  264. package/src/components/ListingTable/mappers/populate-rows.js +3 -0
  265. package/src/components/ListingTable/service/index.js +3 -4
  266. package/src/components/Tabs/index.js +17 -21
  267. package/src/constants.js +9 -1
  268. package/src/index.js +9 -7
  269. package/src/utils/build-listing-query.js +4 -4
  270. package/src/utils/hoc/withContext.js +5 -4
  271. package/CHANGELOG.md +0 -1939
  272. package/babel.config.js +0 -3
  273. package/jest.config.js +0 -5
@@ -1 +1 @@
1
- {"version":3,"file":"add-content-menu-items.js","names":["getQuery","MENU_PERMISSIONS","require","getAddContentMenuItems","app","addConfig","client","getClient","data","getEntitySchemas","query","variables","canDoActions","length","menuItems","sectionMenuItems","settings","forEach","id","displayName","displayProperties","adminMenu","sectionKey","sectionItems","label","uri","menuConfig","main","items","Object","entries","sectionConfig"],"sources":["../../src/utils/add-content-menu-items.js"],"sourcesContent":["import { getQuery } from '@blaze-cms/admin-ui-utils';\n\nconst { MENU_PERMISSIONS } = require('../constants');\n\nfunction getAddContentMenuItems(app) {\n return async ({ addConfig }) => {\n const client = app.getClient();\n const {\n data: { getEntitySchemas }\n } = await client.query({\n query: getQuery('GET_USER_EDITABLE_ENTITIES'),\n variables: {\n // only return entities that the current user can do the following actions on\n canDoActions: MENU_PERMISSIONS\n }\n });\n\n if (!getEntitySchemas || !getEntitySchemas.length) return; // no items so don't add section\n\n const menuItems = {};\n const sectionMenuItems = { settings: {} };\n\n getEntitySchemas.forEach(({ id, displayName, displayProperties }) => {\n if (!displayProperties) return null;\n\n const { adminMenu: { sectionKey = 'settings' } = {} } = displayProperties;\n const sectionItems = sectionMenuItems[sectionKey] || {};\n sectionItems[id] = {\n label: displayName,\n uri: `/data-listing/${id}`\n };\n sectionMenuItems[sectionKey] = sectionItems;\n });\n\n const menuConfig = {\n main: {\n items: {\n settings: {\n items: menuItems\n }\n }\n }\n };\n\n Object.entries(sectionMenuItems).forEach(([sectionKey, sectionItems]) => {\n const sectionConfig = menuConfig.main.items[sectionKey] || {};\n sectionConfig.items = sectionItems;\n menuConfig.main.items[sectionKey] = sectionConfig;\n });\n\n getEntitySchemas.forEach(({ id, displayName }) => {\n menuItems[id] = {\n label: displayName,\n uri: `/data-listing/${id}`\n };\n });\n\n addConfig(menuConfig);\n };\n}\n\nexport default getAddContentMenuItems;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,2BAA2B;AAEpD,MAAM;EAAEC;AAAiB,CAAC,GAAGC,OAAO,CAAC,cAAc,CAAC;AAEpD,SAASC,sBAAsBA,CAACC,GAAG,EAAE;EACnC,OAAO,OAAO;IAAEC;EAAU,CAAC,KAAK;IAC9B,MAAMC,MAAM,GAAGF,GAAG,CAACG,SAAS,CAAC,CAAC;IAC9B,MAAM;MACJC,IAAI,EAAE;QAAEC;MAAiB;IAC3B,CAAC,GAAG,MAAMH,MAAM,CAACI,KAAK,CAAC;MACrBA,KAAK,EAAEV,QAAQ,CAAC,4BAA4B,CAAC;MAC7CW,SAAS,EAAE;QACT;QACAC,YAAY,EAAEX;MAChB;IACF,CAAC,CAAC;IAEF,IAAI,CAACQ,gBAAgB,IAAI,CAACA,gBAAgB,CAACI,MAAM,EAAE,OAAO,CAAC;;IAE3D,MAAMC,SAAS,GAAG,CAAC,CAAC;IACpB,MAAMC,gBAAgB,GAAG;MAAEC,QAAQ,EAAE,CAAC;IAAE,CAAC;IAEzCP,gBAAgB,CAACQ,OAAO,CAAC,CAAC;MAAEC,EAAE;MAAEC,WAAW;MAAEC;IAAkB,CAAC,KAAK;MACnE,IAAI,CAACA,iBAAiB,EAAE,OAAO,IAAI;MAEnC,MAAM;QAAEC,SAAS,EAAE;UAAEC,UAAU,GAAG;QAAW,CAAC,GAAG,CAAC;MAAE,CAAC,GAAGF,iBAAiB;MACzE,MAAMG,YAAY,GAAGR,gBAAgB,CAACO,UAAU,CAAC,IAAI,CAAC,CAAC;MACvDC,YAAY,CAACL,EAAE,CAAC,GAAG;QACjBM,KAAK,EAAEL,WAAW;QAClBM,GAAG,EAAG,iBAAgBP,EAAG;MAC3B,CAAC;MACDH,gBAAgB,CAACO,UAAU,CAAC,GAAGC,YAAY;IAC7C,CAAC,CAAC;IAEF,MAAMG,UAAU,GAAG;MACjBC,IAAI,EAAE;QACJC,KAAK,EAAE;UACLZ,QAAQ,EAAE;YACRY,KAAK,EAAEd;UACT;QACF;MACF;IACF,CAAC;IAEDe,MAAM,CAACC,OAAO,CAACf,gBAAgB,CAAC,CAACE,OAAO,CAAC,CAAC,CAACK,UAAU,EAAEC,YAAY,CAAC,KAAK;MACvE,MAAMQ,aAAa,GAAGL,UAAU,CAACC,IAAI,CAACC,KAAK,CAACN,UAAU,CAAC,IAAI,CAAC,CAAC;MAC7DS,aAAa,CAACH,KAAK,GAAGL,YAAY;MAClCG,UAAU,CAACC,IAAI,CAACC,KAAK,CAACN,UAAU,CAAC,GAAGS,aAAa;IACnD,CAAC,CAAC;IAEFtB,gBAAgB,CAACQ,OAAO,CAAC,CAAC;MAAEC,EAAE;MAAEC;IAAY,CAAC,KAAK;MAChDL,SAAS,CAACI,EAAE,CAAC,GAAG;QACdM,KAAK,EAAEL,WAAW;QAClBM,GAAG,EAAG,iBAAgBP,EAAG;MAC3B,CAAC;IACH,CAAC,CAAC;IAEFb,SAAS,CAACqB,UAAU,CAAC;EACvB,CAAC;AACH;AAEA,eAAevB,sBAAsB"}
1
+ {"version":3,"file":"add-content-menu-items.js","names":["getQuery","MENU_PERMISSIONS","require","getAddContentMenuItems","app","addConfig","client","getClient","data","getEntitySchemas","query","variables","canDoActions","length","menuItems","sectionMenuItems","settings","forEach","id","displayName","displayProperties","adminMenu","sectionKey","sectionItems","label","uri","menuConfig","main","items","Object","entries","sectionConfig"],"sources":["../../src/utils/add-content-menu-items.js"],"sourcesContent":["import { getQuery } from '@blaze-cms/admin-ui-utils';\n\nconst { MENU_PERMISSIONS } = require('../constants');\n\nfunction getAddContentMenuItems(app) {\n return async ({ addConfig }) => {\n const client = app.getClient();\n const {\n data: { getEntitySchemas }\n } = await client.query({\n query: getQuery('GET_USER_EDITABLE_ENTITIES'),\n variables: {\n // only return entities that the current user can do the following actions on\n canDoActions: MENU_PERMISSIONS\n }\n });\n\n if (!getEntitySchemas || !getEntitySchemas.length) return; // no items so don't add section\n\n const menuItems = {};\n const sectionMenuItems = { settings: {} };\n\n getEntitySchemas.forEach(({ id, displayName, displayProperties }) => {\n if (!displayProperties) return null;\n\n const { adminMenu: { sectionKey = 'settings' } = {} } = displayProperties;\n const sectionItems = sectionMenuItems[sectionKey] || {};\n sectionItems[id] = {\n label: displayName,\n uri: `/data-listing/${id}`\n };\n sectionMenuItems[sectionKey] = sectionItems;\n });\n\n const menuConfig = {\n main: {\n items: {\n settings: {\n items: menuItems\n }\n }\n }\n };\n\n Object.entries(sectionMenuItems).forEach(([sectionKey, sectionItems]) => {\n const sectionConfig = menuConfig.main.items[sectionKey] || {};\n sectionConfig.items = sectionItems;\n menuConfig.main.items[sectionKey] = sectionConfig;\n });\n\n getEntitySchemas.forEach(({ id, displayName }) => {\n menuItems[id] = {\n label: displayName,\n uri: `/data-listing/${id}`\n };\n });\n\n addConfig(menuConfig);\n };\n}\n\nexport default getAddContentMenuItems;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,2BAA2B;AAEpD,MAAM;EAAEC;AAAiB,CAAC,GAAGC,OAAO,CAAC,cAAc,CAAC;AAEpD,SAASC,sBAAsBA,CAACC,GAAG,EAAE;EACnC,OAAO,OAAO;IAAEC;EAAU,CAAC,KAAK;IAC9B,MAAMC,MAAM,GAAGF,GAAG,CAACG,SAAS,CAAC,CAAC;IAC9B,MAAM;MACJC,IAAI,EAAE;QAAEC;MAAiB;IAC3B,CAAC,GAAG,MAAMH,MAAM,CAACI,KAAK,CAAC;MACrBA,KAAK,EAAEV,QAAQ,CAAC,4BAA4B,CAAC;MAC7CW,SAAS,EAAE;QACT;QACAC,YAAY,EAAEX;MAChB;IACF,CAAC,CAAC;IAEF,IAAI,CAACQ,gBAAgB,IAAI,CAACA,gBAAgB,CAACI,MAAM,EAAE,OAAO,CAAC;;IAE3D,MAAMC,SAAS,GAAG,CAAC,CAAC;IACpB,MAAMC,gBAAgB,GAAG;MAAEC,QAAQ,EAAE,CAAC;IAAE,CAAC;IAEzCP,gBAAgB,CAACQ,OAAO,CAAC,CAAC;MAAEC,EAAE;MAAEC,WAAW;MAAEC;IAAkB,CAAC,KAAK;MACnE,IAAI,CAACA,iBAAiB,EAAE,OAAO,IAAI;MAEnC,MAAM;QAAEC,SAAS,EAAE;UAAEC,UAAU,GAAG;QAAW,CAAC,GAAG,CAAC;MAAE,CAAC,GAAGF,iBAAiB;MACzE,MAAMG,YAAY,GAAGR,gBAAgB,CAACO,UAAU,CAAC,IAAI,CAAC,CAAC;MACvDC,YAAY,CAACL,EAAE,CAAC,GAAG;QACjBM,KAAK,EAAEL,WAAW;QAClBM,GAAG,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;IAEFtB,gBAAgB,CAACQ,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;IAEFb,SAAS,CAACqB,UAAU,CAAC;EACvB,CAAC;AACH;AAEA,eAAevB,sBAAsB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"build-create-entity-mutation.js","names":["gql","BlazeError","upperfirst","getDataProperties","buildCreateEntityMutation","entitySchema","actions","create","properties","actionInput","dataProperties","join"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,UAAU,MAAM,mBAAmB;AAC1C,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,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,IAAIP,UAAU,CAClB,8EACF,CAAC;EACH;EAEA,MAAMQ,WAAW,GAAGP,UAAU,CAAE,GAAEG,YAAY,CAACC,OAAO,CAACC,MAAO,OAAM,CAAC;EACrE,MAAMG,cAAc,GAAGP,iBAAiB,CAACE,YAAY,CAAC;EAEtD,OAAOL,GAAI,kCAAiCS,WAAY;AAC1D,qBAAqBJ,YAAY,CAACC,OAAO,CAACC,MAAO;AACjD;AACA;AACA,YAAYG,cAAc,CAACC,IAAI,CAAC,KAAK,CAAE;AACvC;AACA;AACA,IAAI;AACJ;AAEA,eAAeP,yBAAyB"}
1
+ {"version":3,"file":"build-create-entity-mutation.js","names":["gql","BlazeError","upperfirst","getDataProperties","buildCreateEntityMutation","entitySchema","actions","create","properties","actionInput","dataProperties","join"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,UAAU,MAAM,mBAAmB;AAC1C,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,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,IAAIP,UAAU,CAClB,8EACF,CAAC;EACH;EAEA,MAAMQ,WAAW,GAAGP,UAAU,CAAC,GAAGG,YAAY,CAACC,OAAO,CAACC,MAAM,OAAO,CAAC;EACrE,MAAMG,cAAc,GAAGP,iBAAiB,CAACE,YAAY,CAAC;EAEtD,OAAOL,GAAG,kCAAkCS,WAAW;AACzD,qBAAqBJ,YAAY,CAACC,OAAO,CAACC,MAAM;AAChD;AACA;AACA,YAAYG,cAAc,CAACC,IAAI,CAAC,KAAK,CAAC;AACtC;AACA;AACA,IAAI;AACJ;AAEA,eAAeP,yBAAyB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"build-delete-entity-mutation.js","names":["gql","BlazeError","upperfirst","buildDeleteEntity","entitySchema","actions","delete","actionInput"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,UAAU,MAAM,mBAAmB;AAE1C,SAASC,iBAAiBA,CAACC,YAAY,EAAE;EACvC,IAAI,CAACA,YAAY,IAAI,CAACA,YAAY,CAACC,OAAO,IAAI,CAACD,YAAY,CAACC,OAAO,CAACC,MAAM,EAAE;IAC1E,MAAM,IAAIL,UAAU,CAAC,wDAAwD,CAAC;EAChF;EAEA,MAAMM,WAAW,GAAGL,UAAU,CAAE,GAAEE,YAAY,CAACC,OAAO,CAACC,MAAO,OAAM,CAAC;EAErE,OAAON,GAAI;AACb,mCAAmCO,WAAY;AAC/C,oBAAoBH,YAAY,CAACC,OAAO,CAACC,MAAO;AAChD;AACA;AACA;AACA,GAAG;AACH;AAEA,eAAeH,iBAAiB"}
1
+ {"version":3,"file":"build-delete-entity-mutation.js","names":["gql","BlazeError","upperfirst","buildDeleteEntity","entitySchema","actions","delete","actionInput"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,UAAU,MAAM,mBAAmB;AAE1C,SAASC,iBAAiBA,CAACC,YAAY,EAAE;EACvC,IAAI,CAACA,YAAY,IAAI,CAACA,YAAY,CAACC,OAAO,IAAI,CAACD,YAAY,CAACC,OAAO,CAACC,MAAM,EAAE;IAC1E,MAAM,IAAIL,UAAU,CAAC,wDAAwD,CAAC;EAChF;EAEA,MAAMM,WAAW,GAAGL,UAAU,CAAC,GAAGE,YAAY,CAACC,OAAO,CAACC,MAAM,OAAO,CAAC;EAErE,OAAON,GAAG;AACZ,mCAAmCO,WAAW;AAC9C,oBAAoBH,YAAY,CAACC,OAAO,CAACC,MAAM;AAC/C;AACA;AACA;AACA,GAAG;AACH;AAEA,eAAeH,iBAAiB","ignoreList":[]}
@@ -1,18 +1,18 @@
1
1
  import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
3
  import { getDynamicQuery } from '@blaze-cms/admin-ui-utils';
4
- const buildAdminSearchQuery = entitySchema => {
4
+ const buildAdminSearchQuery = (entitySchema, index) => {
5
5
  const {
6
6
  listingProperties = []
7
7
  } = entitySchema || {};
8
8
  const parsedProperties = `id, ${listingProperties.join(' ') || 'id name'}`;
9
- return getDynamicQuery('ADMIN_SEARCH')([entitySchema], parsedProperties, true);
9
+ return getDynamicQuery('ADMIN_SEARCH')([entitySchema], parsedProperties, true, index);
10
10
  };
11
- function buildListingQuery(entitySchema, isSearchQuery) {
11
+ function buildListingQuery(entitySchema, index, isSearchQuery) {
12
12
  if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {
13
13
  throw new BlazeError('Listing query requires getAll action and listingProperties from entity schema');
14
14
  }
15
- if (isSearchQuery) return buildAdminSearchQuery(entitySchema);
15
+ if (isSearchQuery) return buildAdminSearchQuery(entitySchema, index);
16
16
  const sortType = entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);
17
17
  return gql`
18
18
  query ${entitySchema.actions.getAll}($where: JSON, $limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {
@@ -1 +1 @@
1
- {"version":3,"file":"build-listing-query.js","names":["gql","BlazeError","getDynamicQuery","buildAdminSearchQuery","entitySchema","listingProperties","parsedProperties","join","buildListingQuery","isSearchQuery","actions","getAll","sortType","toUpperCase","substr","countAll"],"sources":["../../src/utils/build-listing-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport { getDynamicQuery } from '@blaze-cms/admin-ui-utils';\n\nconst buildAdminSearchQuery = entitySchema => {\n const { listingProperties = [] } = entitySchema || {};\n const parsedProperties = `id, ${listingProperties.join(' ') || 'id name'}`;\n\n return getDynamicQuery('ADMIN_SEARCH')([entitySchema], parsedProperties, true);\n};\n\nfunction buildListingQuery(entitySchema, isSearchQuery) {\n if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {\n throw new BlazeError(\n 'Listing query requires getAll action and listingProperties from entity schema'\n );\n }\n\n if (isSearchQuery) return buildAdminSearchQuery(entitySchema);\n\n const sortType =\n entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);\n\n return gql`\n query ${\n entitySchema.actions.getAll\n }($where: JSON, $limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {\n listingData: ${\n entitySchema.actions.getAll\n }(where: $where, limit: $limit, offset:$offset, sort:$sort){\n id,\n ${entitySchema.listingProperties.join(',\\n')}\n }\n totalRecords: ${entitySchema.actions.countAll}(where: $where)\n }\n `;\n}\n\nexport default buildListingQuery;\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,eAAe,QAAQ,2BAA2B;AAE3D,MAAMC,qBAAqB,GAAGC,YAAY,IAAI;EAC5C,MAAM;IAAEC,iBAAiB,GAAG;EAAG,CAAC,GAAGD,YAAY,IAAI,CAAC,CAAC;EACrD,MAAME,gBAAgB,GAAI,OAAMD,iBAAiB,CAACE,IAAI,CAAC,GAAG,CAAC,IAAI,SAAU,EAAC;EAE1E,OAAOL,eAAe,CAAC,cAAc,CAAC,CAAC,CAACE,YAAY,CAAC,EAAEE,gBAAgB,EAAE,IAAI,CAAC;AAChF,CAAC;AAED,SAASE,iBAAiBA,CAACJ,YAAY,EAAEK,aAAa,EAAE;EACtD,IAAI,CAACL,YAAY,CAACM,OAAO,IAAI,CAACN,YAAY,CAACM,OAAO,CAACC,MAAM,IAAI,CAACP,YAAY,CAACC,iBAAiB,EAAE;IAC5F,MAAM,IAAIJ,UAAU,CAClB,+EACF,CAAC;EACH;EAEA,IAAIQ,aAAa,EAAE,OAAON,qBAAqB,CAACC,YAAY,CAAC;EAE7D,MAAMQ,QAAQ,GACZR,YAAY,CAACM,OAAO,CAACC,MAAM,CAAC,CAAC,CAAC,CAACE,WAAW,CAAC,CAAC,GAAGT,YAAY,CAACM,OAAO,CAACC,MAAM,CAACG,MAAM,CAAC,CAAC,CAAC;EAEtF,OAAOd,GAAI;AACb,YACMI,YAAY,CAACM,OAAO,CAACC,MACtB,oDAAmDC,QAAS;AACjE,qBACQR,YAAY,CAACM,OAAO,CAACC,MACtB;AACP;AACA,UAAUP,YAAY,CAACC,iBAAiB,CAACE,IAAI,CAAC,KAAK,CAAE;AACrD;AACA,sBAAsBH,YAAY,CAACM,OAAO,CAACK,QAAS;AACpD;AACA,GAAG;AACH;AAEA,eAAeP,iBAAiB"}
1
+ {"version":3,"file":"build-listing-query.js","names":["gql","BlazeError","getDynamicQuery","buildAdminSearchQuery","entitySchema","index","listingProperties","parsedProperties","join","buildListingQuery","isSearchQuery","actions","getAll","sortType","toUpperCase","substr","countAll"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,eAAe,QAAQ,2BAA2B;AAE3D,MAAMC,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,OAAON,eAAe,CAAC,cAAc,CAAC,CAAC,CAACE,YAAY,CAAC,EAAEG,gBAAgB,EAAE,IAAI,EAAEF,KAAK,CAAC;AACvF,CAAC;AAED,SAASI,iBAAiBA,CAACL,YAAY,EAAEC,KAAK,EAAEK,aAAa,EAAE;EAC7D,IAAI,CAACN,YAAY,CAACO,OAAO,IAAI,CAACP,YAAY,CAACO,OAAO,CAACC,MAAM,IAAI,CAACR,YAAY,CAACE,iBAAiB,EAAE;IAC5F,MAAM,IAAIL,UAAU,CAClB,+EACF,CAAC;EACH;EAEA,IAAIS,aAAa,EAAE,OAAOP,qBAAqB,CAACC,YAAY,EAAEC,KAAK,CAAC;EAEpE,MAAMQ,QAAQ,GACZT,YAAY,CAACO,OAAO,CAACC,MAAM,CAAC,CAAC,CAAC,CAACE,WAAW,CAAC,CAAC,GAAGV,YAAY,CAACO,OAAO,CAACC,MAAM,CAACG,MAAM,CAAC,CAAC,CAAC;EAEtF,OAAOf,GAAG;AACZ,YACMI,YAAY,CAACO,OAAO,CAACC,MAAM,oDACuBC,QAAQ;AAChE,qBACQT,YAAY,CAACO,OAAO,CAACC,MAAM;AACnC;AACA,UACUR,YAAY,CAACE,iBAAiB,CAACE,IAAI,CAAC,KAAK,CAAC;AACpD;AACA,sBAAsBJ,YAAY,CAACO,OAAO,CAACK,QAAQ;AACnD;AACA,GAAG;AACH;AAEA,eAAeP,iBAAiB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"build-update-data-query.js","names":["gql","BlazeError","upperfirst","getDataProperties","buildUpdateDataQuery","entitySchema","actions","update","properties","actionInput","dataProperties","join"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,UAAU,MAAM,mBAAmB;AAC1C,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,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,IAAIP,UAAU,CAClB,+EACF,CAAC;EACH;EAEA,MAAMQ,WAAW,GAAGP,UAAU,CAAE,GAAEG,YAAY,CAACC,OAAO,CAACC,MAAO,OAAM,CAAC;EACrE,MAAMG,cAAc,GAAGP,iBAAiB,CAACE,YAAY,CAAC;EAEtD,OAAOL,GAAI;AACb,mCAAmCS,WAAY;AAC/C,oBAAoBJ,YAAY,CAACC,OAAO,CAACC,MAAO;AAChD;AACA;AACA,YAAYG,cAAc,CAACC,IAAI,CAAC,KAAK,CAAE;AACvC;AACA;AACA;AACA;AACA,GAAG;AACH;AAEA,eAAeP,oBAAoB"}
1
+ {"version":3,"file":"build-update-data-query.js","names":["gql","BlazeError","upperfirst","getDataProperties","buildUpdateDataQuery","entitySchema","actions","update","properties","actionInput","dataProperties","join"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,UAAU,MAAM,mBAAmB;AAC1C,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,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,IAAIP,UAAU,CAClB,+EACF,CAAC;EACH;EAEA,MAAMQ,WAAW,GAAGP,UAAU,CAAC,GAAGG,YAAY,CAACC,OAAO,CAACC,MAAM,OAAO,CAAC;EACrE,MAAMG,cAAc,GAAGP,iBAAiB,CAACE,YAAY,CAAC;EAEtD,OAAOL,GAAG;AACZ,mCAAmCS,WAAW;AAC9C,oBAAoBJ,YAAY,CAACC,OAAO,CAACC,MAAM;AAC/C;AACA;AACA,YAAYG,cAAc,CAACC,IAAI,CAAC,KAAK,CAAC;AACtC;AACA;AACA;AACA;AACA,GAAG;AACH;AAEA,eAAeP,oBAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"build-update-publish-unpublish-mutation.js","names":["gql","BlazeError","buildUpdatePublishUnpublishMutation","entitySchema","id","action","cache","actions","publish","withClient"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,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,IAAIJ,UAAU,CAClB,2EACF,CAAC;EACH;EAEA,MAAMQ,UAAU,GAAI,GAAEH,KAAK,GAAG,SAAS,GAAG,EAAG,EAAC;EAE9C,OAAON,GAAI;AACb;AACA,kBAAkBG,YAAY,CAACI,OAAO,CAACF,MAAM,CAAE,IAAGI,UAAW;AAC7D,eAAeL,EAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AAEA,eAAeF,mCAAmC"}
1
+ {"version":3,"file":"build-update-publish-unpublish-mutation.js","names":["gql","BlazeError","buildUpdatePublishUnpublishMutation","entitySchema","id","action","cache","actions","publish","withClient"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,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,IAAIJ,UAAU,CAClB,2EACF,CAAC;EACH;EAEA,MAAMQ,UAAU,GAAG,GAAGH,KAAK,GAAG,SAAS,GAAG,EAAE,EAAE;EAE9C,OAAON,GAAG;AACZ;AACA,kBAAkBG,YAAY,CAACI,OAAO,CAACF,MAAM,CAAC,IAAII,UAAU;AAC5D,eAAeL,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AAEA,eAAeF,mCAAmC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","schema","updated","properties","adminDefaultListingFilter","where","displayProperties","limit","offset","sort","property","direction"],"sources":["../../src/utils/get-default-query-params.js"],"sourcesContent":["const getDefaultQueryParams = 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;AAED,SAASX,qBAAqB"}
1
+ {"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","schema","updated","properties","adminDefaultListingFilter","where","displayProperties","limit","offset","sort","property","direction"],"sources":["../../src/utils/get-default-query-params.js"],"sourcesContent":["const getDefaultQueryParams = schema => {\n const updated = schema.properties && schema.properties.updated;\n const { adminDefaultListingFilter: where } = schema.displayProperties || {};\n\n return {\n where,\n limit: 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;AAED,SAASX,qBAAqB","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import { useMainContext, MainContext } from '@blaze-cms/admin-ui-utils';
4
- export const withContext = Component => props => {
4
+ export const withContext = Component => function (props) {
5
5
  const contexts = useMainContext(MainContext);
6
6
  return /*#__PURE__*/React.createElement(Component, _extends({}, props, contexts));
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"withContext.js","names":["React","useMainContext","MainContext","withContext","Component","props","contexts","createElement","_extends"],"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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,EAAEC,WAAW,QAAQ,2BAA2B;AAEvE,OAAO,MAAMC,WAAW,GAAGC,SAAS,IAAIC,KAAK,IAAI;EAC/C,MAAMC,QAAQ,GAAGL,cAAc,CAACC,WAAW,CAAC;EAC5C,oBAAOF,KAAA,CAAAO,aAAA,CAACH,SAAS,EAAAI,QAAA,KAAKH,KAAK,EAAMC,QAAQ,CAAG,CAAC;AAC/C,CAAC"}
1
+ {"version":3,"file":"withContext.js","names":["React","useMainContext","MainContext","withContext","Component","props","contexts","createElement","_extends"],"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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,EAAEC,WAAW,QAAQ,2BAA2B;AAEvE,OAAO,MAAMC,WAAW,GAAGC,SAAS,IAClC,UAAUC,KAAK,EAAE;EACf,MAAMC,QAAQ,GAAGL,cAAc,CAACC,WAAW,CAAC;EAC5C,oBAAOF,KAAA,CAAAO,aAAA,CAACH,SAAS,EAAAI,QAAA,KAAKH,KAAK,EAAMC,QAAQ,CAAG,CAAC;AAC/C,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useToggle.js","names":["useState","useCallback","useToggle","initialValue","toggleValue","setToggleValue","toggler"],"sources":["../../../src/utils/hooks/useToggle.js"],"sourcesContent":["import { useState, useCallback } from 'react';\n\nfunction useToggle(initialValue) {\n const [toggleValue, setToggleValue] = useState(initialValue);\n const toggler = useCallback(() => setToggleValue(!toggleValue), [toggleValue]);\n\n return [toggleValue, toggler];\n}\n\nexport default useToggle;\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,WAAW,QAAQ,OAAO;AAE7C,SAASC,SAASA,CAACC,YAAY,EAAE;EAC/B,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGL,QAAQ,CAACG,YAAY,CAAC;EAC5D,MAAMG,OAAO,GAAGL,WAAW,CAAC,MAAMI,cAAc,CAAC,CAACD,WAAW,CAAC,EAAE,CAACA,WAAW,CAAC,CAAC;EAE9E,OAAO,CAACA,WAAW,EAAEE,OAAO,CAAC;AAC/B;AAEA,eAAeJ,SAAS"}
1
+ {"version":3,"file":"useToggle.js","names":["useState","useCallback","useToggle","initialValue","toggleValue","setToggleValue","toggler"],"sources":["../../../src/utils/hooks/useToggle.js"],"sourcesContent":["import { useState, useCallback } from 'react';\n\nfunction useToggle(initialValue) {\n const [toggleValue, setToggleValue] = useState(initialValue);\n const toggler = useCallback(() => setToggleValue(!toggleValue), [toggleValue]);\n\n return [toggleValue, toggler];\n}\n\nexport default useToggle;\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,WAAW,QAAQ,OAAO;AAE7C,SAASC,SAASA,CAACC,YAAY,EAAE;EAC/B,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGL,QAAQ,CAACG,YAAY,CAAC;EAC5D,MAAMG,OAAO,GAAGL,WAAW,CAAC,MAAMI,cAAc,CAAC,CAACD,WAAW,CAAC,EAAE,CAACA,WAAW,CAAC,CAAC;EAE9E,OAAO,CAACA,WAAW,EAAEE,OAAO,CAAC;AAC/B;AAEA,eAAeJ,SAAS","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["buildUpdatePublishUnpublishMutation"],"sources":["../../src/utils/index.js"],"sourcesContent":["import buildUpdatePublishUnpublishMutation from './build-update-publish-unpublish-mutation';\n\nexport { buildUpdatePublishUnpublishMutation };\n"],"mappings":"AAAA,OAAOA,mCAAmC,MAAM,2CAA2C;AAE3F,SAASA,mCAAmC"}
1
+ {"version":3,"file":"index.js","names":["buildUpdatePublishUnpublishMutation"],"sources":["../../src/utils/index.js"],"sourcesContent":["import buildUpdatePublishUnpublishMutation from './build-update-publish-unpublish-mutation';\n\nexport { buildUpdatePublishUnpublishMutation };\n"],"mappings":"AAAA,OAAOA,mCAAmC,MAAM,2CAA2C;AAE3F,SAASA,mCAAmC","ignoreList":[]}
package/package.json CHANGED
@@ -1,24 +1,29 @@
1
1
  {
2
2
  "name": "@blaze-cms/plugin-data-ui",
3
- "version": "0.146.0-translations.6",
3
+ "version": "0.147.0-rc-eagle.2",
4
4
  "description": "Blaze plugin data ui",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-es/index.js",
7
- "sideEffects": false,
7
+ "files": [
8
+ "lib",
9
+ "lib-es",
10
+ "src"
11
+ ],
12
+ "source": "src/index.js",
8
13
  "directories": {
9
14
  "src": "src/"
10
15
  },
11
16
  "scripts": {
12
17
  "test": "jest",
13
- "lint": "yarn run lint:js",
18
+ "lint": "npm run lint:js",
14
19
  "lint:js": "eslint .",
15
20
  "clean": "rm -Rf ./lib/ && rm -Rf ./lib-es/",
16
21
  "build:cjs": "BABEL_ENV=cjs ../../node_modules/.bin/babel ./src --out-dir ./lib --source-maps --root-mode upward",
17
22
  "build:esm": "BABEL_ENV=esm ../../node_modules/.bin/babel ./src --out-dir ./lib-es --source-maps --root-mode upward",
18
- "build": "yarn run build:cjs && yarn run build:esm",
19
- "build:clean": "yarn run clean && yarn run build",
20
- "prepublishOnly": "yarn run build:clean",
21
- "postpublish": "yarn run clean"
23
+ "build": "npm run build:cjs && npm run build:esm",
24
+ "build:clean": "npm run clean && npm run build",
25
+ "prepublishOnly": "npm run build:clean",
26
+ "postpublish": "npm run clean"
22
27
  },
23
28
  "author": {
24
29
  "email": "hello@thebyte9.com",
@@ -27,27 +32,28 @@
27
32
  },
28
33
  "license": "GPL-3.0",
29
34
  "dependencies": {
30
- "@blaze-cms/admin-ui-utils": "0.146.0-translations.6",
31
- "@blaze-cms/core-errors": "0.146.0-translations.0",
32
- "@blaze-cms/plugin-render-hooks-ui": "^0.140.3",
33
- "@blaze-cms/react-form-builder": "0.146.0-translations.6",
34
- "@blaze-cms/react-page-builder": "0.146.0-translations.6",
35
- "@blaze-cms/setup-ui": "^0.140.3",
36
- "@blaze-cms/versioning-ui": "0.146.0-translations.0",
35
+ "@blaze-cms/admin-ui-utils": "0.147.0-rc-eagle.2",
36
+ "@blaze-cms/core-errors": "0.147.0-rc-eagle.2",
37
+ "@blaze-cms/plugin-render-hooks-ui": "0.147.0-rc-eagle.2",
38
+ "@blaze-cms/react-form-builder": "0.147.0-rc-eagle.2",
39
+ "@blaze-cms/react-page-builder": "0.147.0-rc-eagle.2",
40
+ "@blaze-cms/setup-ui": "0.147.0-rc-eagle.2",
41
+ "@blaze-cms/versioning-ui": "0.147.0-rc-eagle.2",
37
42
  "@blaze-react/button": "0.8.0-alpha.82",
38
43
  "@blaze-react/more": "0.5.19",
39
- "@blaze-react/multiselect": "0.8.0-alpha.78",
44
+ "@blaze-react/multiselect": "0.8.0-alpha.103",
40
45
  "@blaze-react/pagination": "0.8.0-alpha.76",
41
- "@blaze-react/select": "0.8.0-alpha.80",
46
+ "@blaze-react/select": "0.8.0-alpha.100",
47
+ "@blaze-react/tab": "^0.7.0",
42
48
  "@blaze-react/table": "0.8.0-alpha.74",
43
- "@blaze-react/toaster": "0.5.17",
49
+ "@blaze-react/toaster": "^0.7.0",
50
+ "@blaze-react/tooltip": "0.8.0-alpha.100",
44
51
  "@blaze-react/utils": "0.5.15",
45
- "core-js": "^3.2.1",
46
52
  "lodash.differencewith": "^4.5.0",
47
53
  "lodash.has": "^4.5.2",
48
54
  "lodash.isempty": "^4.4.0",
49
55
  "lodash.isequal": "^4.5.0",
50
- "lodash.omit": "^4.5.0",
56
+ "lodash.omit": "^4.18.0",
51
57
  "lodash.unionby": "^4.8.0",
52
58
  "lodash.upperfirst": "^4.3.1",
53
59
  "react-helmet": "^6.1.0",
@@ -55,17 +61,17 @@
55
61
  "uuid": "^3.3.3"
56
62
  },
57
63
  "devDependencies": {
58
- "@blaze-cms/core-ui": "0.146.0-translations.0"
64
+ "@blaze-cms/core-ui": "0.147.0-rc-eagle.2"
59
65
  },
60
66
  "peerDependencies": {
61
67
  "@apollo/client": "3.x",
62
68
  "prop-types": "^15.7.2",
63
- "react": "^17.0.2",
69
+ "react": ">= 18",
64
70
  "react-router-dom": "^5.0.1"
65
71
  },
66
72
  "eslintIgnore": [
67
73
  "lib/*",
68
74
  "lib-es/*"
69
75
  ],
70
- "gitHead": "3cfd3eef1049e8d197602cbcc4a4d6f94c8fa71b"
76
+ "gitHead": "156a1560d7bc2bbd57b5b51fdf11098349bb26f5"
71
77
  }
@@ -4,16 +4,14 @@ import { withRouter, Prompt } from 'react-router-dom';
4
4
  import { useApolloClient } from '@apollo/client';
5
5
  import PropTypes from 'prop-types';
6
6
  import { RenderHook } from '@blaze-cms/plugin-render-hooks-ui';
7
- import { getQuery, GET_CURRENT_TAB_ID } from '@blaze-cms/admin-ui-utils';
7
+ import { getQuery } from '@blaze-cms/admin-ui-utils';
8
8
  import { FormBuilder, parseFormValues } from '@blaze-cms/react-form-builder';
9
9
  import { DeleteAction, CopyDataFromAction } from '@blaze-cms/admin';
10
10
  import { useToasts } from '@blaze-react/toaster';
11
11
  import cloneDeep from 'lodash.clonedeep';
12
12
  import { getPageName } from '../utils/data-mappers';
13
- import isFormEmpty from '../utils/is-form-empty';
14
13
  import availableActions from './actions-handlers';
15
14
  import SideBarRelations from './SideBarRelations';
16
- import Tabs from '../../Tabs';
17
15
  import useCallbackDebounce from '../../hooks/useCallbackDebounce';
18
16
 
19
17
  import {
@@ -51,7 +49,6 @@ const Entity = ({
51
49
  onViewUrl,
52
50
  refetchRecord
53
51
  }) => {
54
- const [, setCurrentTabId] = useState(null);
55
52
  const [formValues, setFormValues] = useState(null);
56
53
  const [entitySchema, setEntitySchema] = useState(null);
57
54
  const [entityData, setEntityData] = useState(null);
@@ -72,6 +69,9 @@ const Entity = ({
72
69
  const [newUpdatedDate, setNewUpdatedDate] = useState(null);
73
70
  const [saveButtonText, setSaveButtonText] = useState(SAVE_BUTTON_TEXTS.save);
74
71
  const [externalUpdateTime, setExternalUpdateTime] = useState(null);
72
+ const [suppressPrompt, setSuppressPrompt] = useState(false);
73
+ const [isRightSidebarOpen, setIsRightSidebarOpen] = useState(true);
74
+ const handleToggleRightSidebar = () => setIsRightSidebarOpen(!isRightSidebarOpen);
75
75
 
76
76
  const isCreatePage = history.location.pathname.includes('create');
77
77
  const [isNewEntity, setIsNewEntity] = useState(isCreatePage);
@@ -107,50 +107,48 @@ const Entity = ({
107
107
  []
108
108
  ); // Using an empty dependency array ensures this only runs on unmount
109
109
 
110
- useEffect(
111
- () => {
112
- if (shouldUpdateState) {
113
- setSaveButtonText(SAVE_BUTTON_TEXTS.save);
114
- setEntityData(entity);
115
- setPageTitle(getPageName(schema.displayProperties, entity));
116
- setEntityIsPublish(entity.status);
117
- setEntitySchema(schema);
118
- setEnablePublishButton(schema.actions.publish);
119
- setEntityIdentifier(schema.identifier);
120
- setEnablePreviewButton(!!schema.interfaces.includes(PREVIEW_INTERFACE));
121
- }
110
+ useEffect(() => {
111
+ if (shouldUpdateState) {
112
+ setSaveButtonText(SAVE_BUTTON_TEXTS.save);
113
+ setEntityData(entity);
114
+ setPageTitle(getPageName(schema.displayProperties, entity));
115
+ setEntityIsPublish(entity.status);
116
+ setEntitySchema(schema);
117
+ setEnablePublishButton(schema.actions.publish);
118
+ setEntityIdentifier(schema.identifier);
119
+ setEnablePreviewButton(!!schema.interfaces.includes(PREVIEW_INTERFACE));
120
+ }
122
121
 
123
- if (formData && pageBuilderTemplateStatus) {
124
- const isPageBuilderTemplateSet = !!formData.values.pageBuilderTemplateId;
125
- client.writeQuery({
126
- query: getQuery('GET_PB_TEMPLATE_STATUS'),
127
- data: {
128
- pageBuilderTemplateSet: isPageBuilderTemplateSet,
129
- pageBuilderTemplateId: formData.values.pageBuilderTemplateId || ''
130
- }
131
- });
132
- }
133
- if (schema) {
134
- client.writeQuery({
135
- query: getQuery('GET_CURRENT_ENTITY'),
136
- data: {
137
- currentEntity: schema.id
138
- }
139
- });
140
- }
141
- },
142
- [
143
- client,
144
- entity,
145
- entityData,
146
- formData,
147
- formValues,
148
- pageBuilderTemplateStatus,
149
- previousQuery,
150
- schema,
151
- shouldUpdateState
152
- ]
153
- );
122
+ if (formData && pageBuilderTemplateStatus) {
123
+ const isPageBuilderTemplateSet = !!formData.values.pageBuilderTemplateId;
124
+ client.writeQuery({
125
+ query: getQuery('GET_PB_TEMPLATE_STATUS'),
126
+ data: {
127
+ pageBuilderTemplateSet: isPageBuilderTemplateSet,
128
+ pageBuilderTemplateId: formData.values.pageBuilderTemplateId || ''
129
+ }
130
+ });
131
+ }
132
+ if (schema) {
133
+ client.writeQuery({
134
+ query: getQuery('GET_CURRENT_ENTITY'),
135
+ data: {
136
+ currentEntity: schema.id,
137
+ currentItemId: entity ? entity.id : null
138
+ }
139
+ });
140
+ }
141
+ }, [
142
+ client,
143
+ entity,
144
+ entityData,
145
+ formData,
146
+ formValues,
147
+ pageBuilderTemplateStatus,
148
+ previousQuery,
149
+ schema,
150
+ shouldUpdateState
151
+ ]);
154
152
 
155
153
  const getFullUrl = async () => {
156
154
  const query = getQuery('GET_ENTITY_URL');
@@ -251,13 +249,12 @@ const Entity = ({
251
249
  const [updatedEntity = null] = fields.filter(({ id }) => id === 'name');
252
250
  updatedEntity && setPageTitle(updatedEntity.value);
253
251
 
254
- const isValidAndNewValueSet = isValid && isNewValueSet;
255
252
  const isNotValidOrNotNewValueSet = !isValid || !isNewValueSet;
256
253
  if (componentIsMounted.current) {
257
254
  setIsFormValid(isValid);
258
255
  }
259
256
 
260
- if (isValidAndNewValueSet && componentIsMounted.current) {
257
+ if (isValid && isNewValueSet && componentIsMounted.current) {
261
258
  setIsSaveButtonAvailable(true);
262
259
  setSaveButtonText(SAVE_BUTTON_TEXTS.save);
263
260
  }
@@ -273,10 +270,12 @@ const Entity = ({
273
270
 
274
271
  const onSubmit = event => {
275
272
  event && event.preventDefault();
276
-
277
273
  if (!isSaveButtonAvailable) return null;
278
- const parsedFormValues = parseFormValues(formValues);
279
274
 
275
+ if (isCreatePage) {
276
+ setSuppressPrompt(true);
277
+ }
278
+ const parsedFormValues = parseFormValues(formValues);
280
279
  const updatedFormValues = newUpdatedDate
281
280
  ? { ...formData.values, update: newUpdatedDate }
282
281
  : { ...formData.values };
@@ -414,13 +413,9 @@ const Entity = ({
414
413
 
415
414
  const pageName = formData && formData.values && formData.values.name;
416
415
 
417
- const hasNewFormValues = checkFulfilConditions(isNewEntity, !isFormEmpty(formValues));
418
- const hasToDisplayPrompt = isSaveButtonAvailable || hasNewFormValues;
416
+ const hasToDisplayPrompt = isSaveButtonAvailable && !suppressPrompt;
419
417
 
420
418
  const showSideBarRelations = checkFulfilConditions(schema, formData);
421
- const showPageBuilderTabs =
422
- schema?.interfaces?.includes('page-builder/page-builder-template') ||
423
- schema?.interfaces?.includes('page-builder/page-builder');
424
419
 
425
420
  return (
426
421
  <RecordEditContextProvider value={{ externalUpdateTime, updated: formData?.values?.updated }}>
@@ -461,7 +456,8 @@ const Entity = ({
461
456
  />
462
457
  )}
463
458
 
464
- <div className="page__content--fixed">
459
+ <div
460
+ className={`page__content${!isRightSidebarOpen ? ' right-sidebar-collapsed' : ''}`}>
465
461
  <div className="page__content">
466
462
  <div className="content">
467
463
  <RenderHook
@@ -470,28 +466,19 @@ const Entity = ({
470
466
  schema={schema}
471
467
  />
472
468
  <InfoBoxes id={entity.id} schema={schema} />
473
- <Tabs
474
- enabled={showPageBuilderTabs}
475
- onTabChange={tabId => {
476
- client.writeQuery({
477
- query: GET_CURRENT_TAB_ID,
478
- data: { currentTabId: tabId }
479
- });
480
- setCurrentTabId(tabId);
481
- }}>
482
- <FormBuilder
483
- getIsFormValid={setIsFormValid}
484
- getFormValues={getFormValues}
485
- schema={schema}
486
- data={clonedFormData}
487
- onChange={onChangeFormValues}
488
- shouldCopyData={shouldCopyData}
489
- updateCopyData={updateCopyData}
490
- formValues={formValues}
491
- isNewEntity={isNewEntity}
492
- onExternalUpdate={setExternalUpdateTime}
493
- />
494
- </Tabs>
469
+ <FormBuilder
470
+ getIsFormValid={setIsFormValid}
471
+ getFormValues={getFormValues}
472
+ schema={schema}
473
+ data={clonedFormData}
474
+ onChange={onChangeFormValues}
475
+ shouldCopyData={shouldCopyData}
476
+ updateCopyData={updateCopyData}
477
+ formValues={formValues}
478
+ isNewEntity={isNewEntity}
479
+ onExternalUpdate={setExternalUpdateTime}
480
+ mode={isNewEntity ? 'create' : 'update'}
481
+ />
495
482
  <RenderHook
496
483
  hookKey={`entity:${action}:main:bottom`}
497
484
  entity={entity}
@@ -502,13 +489,18 @@ const Entity = ({
502
489
  </div>
503
490
  </div>
504
491
 
505
- <div className="column column--one-third page-sidebar page-sidebar--relations">
492
+ <div
493
+ className={`column column--one-third page-sidebar page-sidebar--relations${
494
+ !isRightSidebarOpen ? ' sidebar--collapsed' : ''
495
+ }`}>
506
496
  {showSideBarRelations && (
507
497
  <SideBarRelations
508
498
  entity={entity}
509
499
  formData={formData.values}
510
500
  schema={schema}
511
501
  onChange={onChangeSideBarRelations}
502
+ isOpen={isRightSidebarOpen}
503
+ onToggle={handleToggleRightSidebar}
512
504
  />
513
505
  )}
514
506
  </div>
@@ -30,8 +30,7 @@ const EntityHeader = ({
30
30
 
31
31
  const {
32
32
  displayProperties: { adminCrudActions: { delete: deleteAction = { active: true } } = {} } = {}
33
- } =
34
- entitySchema || {};
33
+ } = entitySchema || {};
35
34
 
36
35
  const showDeleteButton =
37
36
  deleteAction.active && formData && Object.keys(formData.values).length !== 0;
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import Button from '@blaze-react/button';
4
4
  import { useMutation } from '@apollo/client';
5
5
  import { getMutation } from '@blaze-cms/admin-ui-utils';
6
+ import { DEBUG_PARAM } from '../../../../../constants';
6
7
 
7
8
  const HeaderPreviewButton = ({ itemId, itemEntity }) => {
8
9
  const [createPreviewToken] = useMutation(getMutation('PREVIEW_TOKEN_MUTATION'));
@@ -23,7 +24,13 @@ const HeaderPreviewButton = ({ itemId, itemEntity }) => {
23
24
  }
24
25
  });
25
26
 
26
- if (url) window.open(url, '_blank');
27
+ if (url) {
28
+ const delimiter = url.includes('?') ? '&' : '?';
29
+ const debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM
30
+ ? ''
31
+ : `${delimiter}${DEBUG_PARAM}`;
32
+ window.open(`${url}${debugParam}`, '_blank');
33
+ }
27
34
  // eslint-disable-next-line no-empty
28
35
  } catch (err) {}
29
36
  };
@@ -18,6 +18,8 @@ export default function buildDynamicQuery({ id, schema, displayProperties }) {
18
18
  label
19
19
  value
20
20
  showLabel
21
+ tooltipIcon
22
+ tooltipContent
21
23
  }`
22
24
  );
23
25
 
@@ -21,17 +21,19 @@ const useCustomSidebarData = ({ id, schema, displayProperties }) => {
21
21
  }
22
22
  `;
23
23
 
24
- const { data = {}, loading, error, refetch } = useQuery(customSidebarInfoQuery, {
24
+ const {
25
+ data = {},
26
+ loading,
27
+ error,
28
+ refetch
29
+ } = useQuery(customSidebarInfoQuery, {
25
30
  variables: { id },
26
31
  skip: !query
27
32
  });
28
33
 
29
- useEffect(
30
- () => {
31
- refetch();
32
- },
33
- [externalUpdateTime, updated, refetch]
34
- );
34
+ useEffect(() => {
35
+ refetch();
36
+ }, [externalUpdateTime, updated, refetch]);
35
37
 
36
38
  return { data: data.__typename !== 'Query' ? data : null, loading, error };
37
39
  };