@blaze-cms/plugin-data-ui 0.125.0-admin-updates.1 → 0.125.0-alpha.13

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 (172) hide show
  1. package/CHANGELOG.md +25 -8
  2. package/lib/components/EntityDataListing/EntityDataListing.js +17 -40
  3. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  4. package/lib/components/EntityDataListing/index.js +0 -4
  5. package/lib/components/EntityDataListing/index.js.map +1 -1
  6. package/lib/components/EntityManager/Entity/Entity.js +85 -226
  7. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  8. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +13 -28
  9. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  10. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +5 -26
  11. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  12. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +0 -4
  13. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  14. package/lib/components/EntityManager/Entity/EntityHeader/index.js +0 -4
  15. package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  16. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +18 -68
  17. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  18. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +0 -3
  19. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  20. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +0 -16
  21. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  22. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +0 -11
  23. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  24. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +0 -3
  25. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  26. package/lib/components/EntityManager/Entity/actions-handlers/index.js +0 -7
  27. package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  28. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +0 -3
  29. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  30. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +0 -18
  31. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  32. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +0 -3
  33. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  34. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +0 -25
  35. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  36. package/lib/components/EntityManager/Entity/index.js +0 -4
  37. package/lib/components/EntityManager/Entity/index.js.map +1 -1
  38. package/lib/components/EntityManager/EntityManager.js +24 -83
  39. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  40. package/lib/components/EntityManager/index.js +0 -4
  41. package/lib/components/EntityManager/index.js.map +1 -1
  42. package/lib/components/EntityManager/utils/data-mappers.js +5 -38
  43. package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
  44. package/lib/components/EntityManager/utils/entity.js +3 -38
  45. package/lib/components/EntityManager/utils/entity.js.map +1 -1
  46. package/lib/components/EntityManager/utils/entityAvailableActions.js +17 -42
  47. package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  48. package/lib/components/EntityManager/utils/is-form-empty.js +0 -7
  49. package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
  50. package/lib/components/EntityManager/utils/query.js +2 -11
  51. package/lib/components/EntityManager/utils/query.js.map +1 -1
  52. package/lib/components/ListingTable/ListingTable.js +31 -116
  53. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  54. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +9 -22
  55. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  56. package/lib/components/ListingTable/ListingTableContent/index.js +0 -4
  57. package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
  58. package/lib/components/ListingTable/TableActions/TableActions.js +2 -11
  59. package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
  60. package/lib/components/ListingTable/TableActions/index.js +0 -4
  61. package/lib/components/ListingTable/TableActions/index.js.map +1 -1
  62. package/lib/components/ListingTable/index.js +0 -4
  63. package/lib/components/ListingTable/index.js.map +1 -1
  64. package/lib/components/ListingTable/mappers/populate-rows.js +13 -49
  65. package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
  66. package/lib/components/ListingTable/service/index.js +0 -11
  67. package/lib/components/ListingTable/service/index.js.map +1 -1
  68. package/lib/components/Tabs/index.js +5 -16
  69. package/lib/components/Tabs/index.js.map +1 -1
  70. package/lib/constants.js +0 -1
  71. package/lib/constants.js.map +1 -1
  72. package/lib/index.js +0 -29
  73. package/lib/index.js.map +1 -1
  74. package/lib/utils/add-content-menu-items.js +2 -17
  75. package/lib/utils/add-content-menu-items.js.map +1 -1
  76. package/lib/utils/build-create-entity-mutation.js +0 -12
  77. package/lib/utils/build-create-entity-mutation.js.map +1 -1
  78. package/lib/utils/build-delete-entity-mutation.js +0 -10
  79. package/lib/utils/build-delete-entity-mutation.js.map +1 -1
  80. package/lib/utils/build-listing-query.js +0 -10
  81. package/lib/utils/build-listing-query.js.map +1 -1
  82. package/lib/utils/build-update-data-query.js +0 -12
  83. package/lib/utils/build-update-data-query.js.map +1 -1
  84. package/lib/utils/build-update-publish-unpublish-mutation.js +0 -9
  85. package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  86. package/lib/utils/get-default-query-params.js +0 -3
  87. package/lib/utils/get-default-query-params.js.map +1 -1
  88. package/lib/utils/hoc/withContext.js +0 -7
  89. package/lib/utils/hoc/withContext.js.map +1 -1
  90. package/lib/utils/hooks/useToggle.js +3 -10
  91. package/lib/utils/hooks/useToggle.js.map +1 -1
  92. package/lib/utils/index.js +0 -3
  93. package/lib/utils/index.js.map +1 -1
  94. package/lib-es/components/EntityDataListing/EntityDataListing.js +0 -2
  95. package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
  96. package/lib-es/components/EntityDataListing/index.js.map +1 -1
  97. package/lib-es/components/EntityManager/Entity/Entity.js +28 -77
  98. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  99. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js +0 -2
  100. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  101. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +2 -5
  102. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  103. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  104. package/lib-es/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  105. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +7 -16
  106. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  107. package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  108. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js +0 -3
  109. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  110. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js +0 -3
  111. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  112. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  113. package/lib-es/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  114. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  115. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js +0 -5
  116. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  117. package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  118. package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js +0 -6
  119. package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  120. package/lib-es/components/EntityManager/Entity/index.js.map +1 -1
  121. package/lib-es/components/EntityManager/EntityManager.js +2 -14
  122. package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
  123. package/lib-es/components/EntityManager/index.js.map +1 -1
  124. package/lib-es/components/EntityManager/utils/data-mappers.js +0 -11
  125. package/lib-es/components/EntityManager/utils/data-mappers.js.map +1 -1
  126. package/lib-es/components/EntityManager/utils/entity.js +0 -13
  127. package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
  128. package/lib-es/components/EntityManager/utils/entityAvailableActions.js +0 -2
  129. package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  130. package/lib-es/components/EntityManager/utils/is-form-empty.js +0 -2
  131. package/lib-es/components/EntityManager/utils/is-form-empty.js.map +1 -1
  132. package/lib-es/components/EntityManager/utils/query.js +2 -4
  133. package/lib-es/components/EntityManager/utils/query.js.map +1 -1
  134. package/lib-es/components/ListingTable/ListingTable.js +0 -17
  135. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  136. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +0 -2
  137. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  138. package/lib-es/components/ListingTable/ListingTableContent/index.js.map +1 -1
  139. package/lib-es/components/ListingTable/TableActions/TableActions.js +0 -2
  140. package/lib-es/components/ListingTable/TableActions/TableActions.js.map +1 -1
  141. package/lib-es/components/ListingTable/TableActions/index.js.map +1 -1
  142. package/lib-es/components/ListingTable/index.js.map +1 -1
  143. package/lib-es/components/ListingTable/mappers/populate-rows.js +0 -13
  144. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
  145. package/lib-es/components/ListingTable/service/index.js +0 -2
  146. package/lib-es/components/ListingTable/service/index.js.map +1 -1
  147. package/lib-es/components/Tabs/index.js +0 -2
  148. package/lib-es/components/Tabs/index.js.map +1 -1
  149. package/lib-es/constants.js.map +1 -1
  150. package/lib-es/index.js +2 -6
  151. package/lib-es/index.js.map +1 -1
  152. package/lib-es/utils/add-content-menu-items.js +0 -3
  153. package/lib-es/utils/add-content-menu-items.js.map +1 -1
  154. package/lib-es/utils/build-create-entity-mutation.js +0 -3
  155. package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
  156. package/lib-es/utils/build-delete-entity-mutation.js +0 -3
  157. package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
  158. package/lib-es/utils/build-listing-query.js +0 -3
  159. package/lib-es/utils/build-listing-query.js.map +1 -1
  160. package/lib-es/utils/build-update-data-query.js +0 -3
  161. package/lib-es/utils/build-update-data-query.js.map +1 -1
  162. package/lib-es/utils/build-update-publish-unpublish-mutation.js +0 -3
  163. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  164. package/lib-es/utils/get-default-query-params.js +0 -1
  165. package/lib-es/utils/get-default-query-params.js.map +1 -1
  166. package/lib-es/utils/hoc/withContext.js.map +1 -1
  167. package/lib-es/utils/hooks/useToggle.js +0 -2
  168. package/lib-es/utils/hooks/useToggle.js.map +1 -1
  169. package/lib-es/utils/index.js.map +1 -1
  170. package/package.json +6 -6
  171. package/src/components/EntityManager/Entity/Entity.js +60 -64
  172. package/src/components/EntityManager/Entity/SideBarRelations/index.js +9 -23
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","Tab","TabItem","useReadFromCache","GET_CURRENT_TAB_ID","TabsContextProvider","PAGE_BUILDER_TAB","PAGE_BUILDER_TAB_INDEX","EDITOR_VIEW_TAB","EDITOR_VIEW_TAB_INDEX","Tabs","children","onTabChange","enabled","currentTabId","query","propTypes","oneOfType","object","arrayOf","isRequired","func","bool"],"sources":["../../../src/components/Tabs/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Tab, TabItem } from '@blaze-react/tab';\nimport {\n useReadFromCache,\n GET_CURRENT_TAB_ID,\n TabsContextProvider\n} from '@blaze-cms/admin-ui-utils';\nimport {\n PAGE_BUILDER_TAB,\n PAGE_BUILDER_TAB_INDEX,\n EDITOR_VIEW_TAB,\n EDITOR_VIEW_TAB_INDEX\n} from '../../constants';\n\nconst Tabs = ({ children, onTabChange, enabled }) => {\n const { currentTabId } = useReadFromCache({ query: GET_CURRENT_TAB_ID }) || EDITOR_VIEW_TAB_INDEX;\n\n return enabled ? (\n <>\n <TabsContextProvider value={{ currentTabId }}>\n <Tab selected={currentTabId}>\n <TabItem title={EDITOR_VIEW_TAB} action={() => onTabChange(EDITOR_VIEW_TAB_INDEX)}>\n {children}\n </TabItem>\n <TabItem title={PAGE_BUILDER_TAB} action={() => onTabChange(PAGE_BUILDER_TAB_INDEX)}>\n {children}\n </TabItem>\n </Tab>\n </TabsContextProvider>\n </>\n ) : (\n <>{children}</>\n );\n};\n\nTabs.propTypes = {\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.arrayOf(PropTypes.object)]).isRequired,\n onTabChange: PropTypes.func.isRequired,\n enabled: PropTypes.bool.isRequired\n};\n\nexport default Tabs;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,GAAT,EAAcC,OAAd,QAA6B,kBAA7B;AACA,SACEC,gBADF,EAEEC,kBAFF,EAGEC,mBAHF,QAIO,2BAJP;AAKA,SACEC,gBADF,EAEEC,sBAFF,EAGEC,eAHF,EAIEC,qBAJF,QAKO,iBALP;;AAOA,MAAMC,IAAI,GAAG,CAAC;EAAEC,QAAF;EAAYC,WAAZ;EAAyBC;AAAzB,CAAD,KAAwC;EACnD,MAAM;IAAEC;EAAF,IAAmBX,gBAAgB,CAAC;IAAEY,KAAK,EAAEX;EAAT,CAAD,CAAhB,IAAmDK,qBAA5E;EAEA,OAAOI,OAAO,gBACZ,uDACE,oBAAC,mBAAD;IAAqB,KAAK,EAAE;MAAEC;IAAF;EAA5B,gBACE,oBAAC,GAAD;IAAK,QAAQ,EAAEA;EAAf,gBACE,oBAAC,OAAD;IAAS,KAAK,EAAEN,eAAhB;IAAiC,MAAM,EAAE,MAAMI,WAAW,CAACH,qBAAD;EAA1D,GACGE,QADH,CADF,eAIE,oBAAC,OAAD;IAAS,KAAK,EAAEL,gBAAhB;IAAkC,MAAM,EAAE,MAAMM,WAAW,CAACL,sBAAD;EAA3D,GACGI,QADH,CAJF,CADF,CADF,CADY,gBAcZ,0CAAGA,QAAH,CAdF;AAgBD,CAnBD;;AAqBAD,IAAI,CAACM,SAAL,GAAiB;EACfL,QAAQ,EAAEX,SAAS,CAACiB,SAAV,CAAoB,CAACjB,SAAS,CAACkB,MAAX,EAAmBlB,SAAS,CAACmB,OAAV,CAAkBnB,SAAS,CAACkB,MAA5B,CAAnB,CAApB,EAA6EE,UADxE;EAEfR,WAAW,EAAEZ,SAAS,CAACqB,IAAV,CAAeD,UAFb;EAGfP,OAAO,EAAEb,SAAS,CAACsB,IAAV,CAAeF;AAHT,CAAjB;AAMA,eAAeV,IAAf"}
1
+ {"version":3,"file":"index.js","names":["React","PropTypes","Tab","TabItem","useReadFromCache","GET_CURRENT_TAB_ID","TabsContextProvider","PAGE_BUILDER_TAB","PAGE_BUILDER_TAB_INDEX","EDITOR_VIEW_TAB","EDITOR_VIEW_TAB_INDEX","Tabs","children","onTabChange","enabled","currentTabId","query","propTypes","oneOfType","object","arrayOf","isRequired","func","bool"],"sources":["../../../src/components/Tabs/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Tab, TabItem } from '@blaze-react/tab';\nimport {\n useReadFromCache,\n GET_CURRENT_TAB_ID,\n TabsContextProvider\n} from '@blaze-cms/admin-ui-utils';\nimport {\n PAGE_BUILDER_TAB,\n PAGE_BUILDER_TAB_INDEX,\n EDITOR_VIEW_TAB,\n EDITOR_VIEW_TAB_INDEX\n} from '../../constants';\n\nconst Tabs = ({ children, onTabChange, enabled }) => {\n const { currentTabId } = useReadFromCache({ query: GET_CURRENT_TAB_ID }) || EDITOR_VIEW_TAB_INDEX;\n\n return enabled ? (\n <>\n <TabsContextProvider value={{ currentTabId }}>\n <Tab selected={currentTabId}>\n <TabItem title={EDITOR_VIEW_TAB} action={() => onTabChange(EDITOR_VIEW_TAB_INDEX)}>\n {children}\n </TabItem>\n <TabItem title={PAGE_BUILDER_TAB} action={() => onTabChange(PAGE_BUILDER_TAB_INDEX)}>\n {children}\n </TabItem>\n </Tab>\n </TabsContextProvider>\n </>\n ) : (\n <>{children}</>\n );\n};\n\nTabs.propTypes = {\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.arrayOf(PropTypes.object)]).isRequired,\n onTabChange: PropTypes.func.isRequired,\n enabled: PropTypes.bool.isRequired\n};\n\nexport default Tabs;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,GAAG,EAAEC,OAAO,QAAQ,kBAAkB;AAC/C,SACEC,gBAAgB,EAChBC,kBAAkB,EAClBC,mBAAmB,QACd,2BAA2B;AAClC,SACEC,gBAAgB,EAChBC,sBAAsB,EACtBC,eAAe,EACfC,qBAAqB,QAChB,iBAAiB;AAExB,MAAMC,IAAI,GAAG,CAAC;EAAEC,QAAQ;EAAEC,WAAW;EAAEC;AAAQ,CAAC,KAAK;EACnD,MAAM;IAAEC;EAAa,CAAC,GAAGX,gBAAgB,CAAC;IAAEY,KAAK,EAAEX;EAAmB,CAAC,CAAC,IAAIK,qBAAqB;EAEjG,OAAOI,OAAO,gBACZ,uDACE,oBAAC,mBAAmB;IAAC,KAAK,EAAE;MAAEC;IAAa;EAAE,gBAC3C,oBAAC,GAAG;IAAC,QAAQ,EAAEA;EAAa,gBAC1B,oBAAC,OAAO;IAAC,KAAK,EAAEN,eAAgB;IAAC,MAAM,EAAE,MAAMI,WAAW,CAACH,qBAAqB;EAAE,GAC/EE,QAAQ,CACD,eACV,oBAAC,OAAO;IAAC,KAAK,EAAEL,gBAAiB;IAAC,MAAM,EAAE,MAAMM,WAAW,CAACL,sBAAsB;EAAE,GACjFI,QAAQ,CACD,CACN,CACc,CACrB,gBAEH,0CAAGA,QAAQ,CACZ;AACH,CAAC;AAEDD,IAAI,CAACM,SAAS,GAAG;EACfL,QAAQ,EAAEX,SAAS,CAACiB,SAAS,CAAC,CAACjB,SAAS,CAACkB,MAAM,EAAElB,SAAS,CAACmB,OAAO,CAACnB,SAAS,CAACkB,MAAM,CAAC,CAAC,CAAC,CAACE,UAAU;EACjGR,WAAW,EAAEZ,SAAS,CAACqB,IAAI,CAACD,UAAU;EACtCP,OAAO,EAAEb,SAAS,CAACsB,IAAI,CAACF;AAC1B,CAAC;AAED,eAAeV,IAAI"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["PLUGIN_NAME","DATA_LISTING_PREFIX","PAGE_BUILDER","TEXT_CONTENT_TYPE","ENTITY_PUBLISHED","SELECT_DEFAULT_VALUE","LEAVE_PAGE_MESSAGE","KEY_TO_CHECK","MENU_PERMISSIONS","PREVIEW_INTERFACE","PAGE_BUILDER_FIELD_ID","PAGE_BUILDER_TEMPLATE_FIELD_ID","ERROR","SUCCESS","PUBLISHED","UNPUBLISHED","SAVE_BUTTON_TEXTS","save","saved","saving","ACTIONS","UNPUBLISHED_WARNING","SAVE_BEFORE_PUBLISH_MESSAGE","PAGE_BUILDER_TAB","PAGE_BUILDER_TAB_INDEX","EDITOR_VIEW_TAB","EDITOR_VIEW_TAB_INDEX"],"sources":["../src/constants.js"],"sourcesContent":["const PLUGIN_NAME = 'data-ui';\nconst DATA_LISTING_PREFIX = '/data-listing';\nconst PAGE_BUILDER = 'pageBuilder';\nconst TEXT_CONTENT_TYPE = 'Publish';\nconst ENTITY_PUBLISHED = 'published';\nconst SELECT_DEFAULT_VALUE = 'Please Choose...';\nconst LEAVE_PAGE_MESSAGE = 'You are going to leave without saving. Are you sure you want to leave?';\nconst KEY_TO_CHECK = 'values.slug';\nconst MENU_PERMISSIONS = ['update:any', 'update:own', 'create:any', 'create:own'];\nconst PREVIEW_INTERFACE = 'preview/can-preview';\nconst PAGE_BUILDER_FIELD_ID = 'pageBuilder';\nconst PAGE_BUILDER_TEMPLATE_FIELD_ID = 'pageBuilderTemplateId';\nconst ERROR = 'error';\nconst SUCCESS = 'success';\nconst PUBLISHED = 'published';\nconst UNPUBLISHED = 'unpublished';\nconst SAVE_BUTTON_TEXTS = { save: 'save', saved: 'saved', saving: 'saving' };\nconst ACTIONS = 'actions';\nconst UNPUBLISHED_WARNING = 'Page already unpublished';\nconst SAVE_BEFORE_PUBLISH_MESSAGE =\n 'You have to click save to create the record before you can publish';\n\nconst PAGE_BUILDER_TAB = 'Page builder';\nconst PAGE_BUILDER_TAB_INDEX = 1;\nconst EDITOR_VIEW_TAB = 'Editor view';\nconst EDITOR_VIEW_TAB_INDEX = 0;\n\nexport {\n DATA_LISTING_PREFIX,\n ENTITY_PUBLISHED,\n KEY_TO_CHECK,\n LEAVE_PAGE_MESSAGE,\n MENU_PERMISSIONS,\n PAGE_BUILDER,\n PLUGIN_NAME,\n PREVIEW_INTERFACE,\n SELECT_DEFAULT_VALUE,\n TEXT_CONTENT_TYPE,\n PAGE_BUILDER_FIELD_ID,\n PAGE_BUILDER_TEMPLATE_FIELD_ID,\n ERROR,\n SUCCESS,\n PUBLISHED,\n UNPUBLISHED,\n SAVE_BUTTON_TEXTS,\n ACTIONS,\n PAGE_BUILDER_TAB_INDEX,\n EDITOR_VIEW_TAB_INDEX,\n EDITOR_VIEW_TAB,\n PAGE_BUILDER_TAB,\n UNPUBLISHED_WARNING,\n SAVE_BEFORE_PUBLISH_MESSAGE\n};\n"],"mappings":"AAAA,MAAMA,WAAW,GAAG,SAApB;AACA,MAAMC,mBAAmB,GAAG,eAA5B;AACA,MAAMC,YAAY,GAAG,aAArB;AACA,MAAMC,iBAAiB,GAAG,SAA1B;AACA,MAAMC,gBAAgB,GAAG,WAAzB;AACA,MAAMC,oBAAoB,GAAG,kBAA7B;AACA,MAAMC,kBAAkB,GAAG,wEAA3B;AACA,MAAMC,YAAY,GAAG,aAArB;AACA,MAAMC,gBAAgB,GAAG,CAAC,YAAD,EAAe,YAAf,EAA6B,YAA7B,EAA2C,YAA3C,CAAzB;AACA,MAAMC,iBAAiB,GAAG,qBAA1B;AACA,MAAMC,qBAAqB,GAAG,aAA9B;AACA,MAAMC,8BAA8B,GAAG,uBAAvC;AACA,MAAMC,KAAK,GAAG,OAAd;AACA,MAAMC,OAAO,GAAG,SAAhB;AACA,MAAMC,SAAS,GAAG,WAAlB;AACA,MAAMC,WAAW,GAAG,aAApB;AACA,MAAMC,iBAAiB,GAAG;EAAEC,IAAI,EAAE,MAAR;EAAgBC,KAAK,EAAE,OAAvB;EAAgCC,MAAM,EAAE;AAAxC,CAA1B;AACA,MAAMC,OAAO,GAAG,SAAhB;AACA,MAAMC,mBAAmB,GAAG,0BAA5B;AACA,MAAMC,2BAA2B,GAC/B,oEADF;AAGA,MAAMC,gBAAgB,GAAG,cAAzB;AACA,MAAMC,sBAAsB,GAAG,CAA/B;AACA,MAAMC,eAAe,GAAG,aAAxB;AACA,MAAMC,qBAAqB,GAAG,CAA9B;AAEA,SACEzB,mBADF,EAEEG,gBAFF,EAGEG,YAHF,EAIED,kBAJF,EAKEE,gBALF,EAMEN,YANF,EAOEF,WAPF,EAQES,iBARF,EASEJ,oBATF,EAUEF,iBAVF,EAWEO,qBAXF,EAYEC,8BAZF,EAaEC,KAbF,EAcEC,OAdF,EAeEC,SAfF,EAgBEC,WAhBF,EAiBEC,iBAjBF,EAkBEI,OAlBF,EAmBEI,sBAnBF,EAoBEE,qBApBF,EAqBED,eArBF,EAsBEF,gBAtBF,EAuBEF,mBAvBF,EAwBEC,2BAxBF"}
1
+ {"version":3,"file":"constants.js","names":["PLUGIN_NAME","DATA_LISTING_PREFIX","PAGE_BUILDER","TEXT_CONTENT_TYPE","ENTITY_PUBLISHED","SELECT_DEFAULT_VALUE","LEAVE_PAGE_MESSAGE","KEY_TO_CHECK","MENU_PERMISSIONS","PREVIEW_INTERFACE","PAGE_BUILDER_FIELD_ID","PAGE_BUILDER_TEMPLATE_FIELD_ID","ERROR","SUCCESS","PUBLISHED","UNPUBLISHED","SAVE_BUTTON_TEXTS","save","saved","saving","ACTIONS","UNPUBLISHED_WARNING","SAVE_BEFORE_PUBLISH_MESSAGE","PAGE_BUILDER_TAB","PAGE_BUILDER_TAB_INDEX","EDITOR_VIEW_TAB","EDITOR_VIEW_TAB_INDEX"],"sources":["../src/constants.js"],"sourcesContent":["const PLUGIN_NAME = 'data-ui';\nconst DATA_LISTING_PREFIX = '/data-listing';\nconst PAGE_BUILDER = 'pageBuilder';\nconst TEXT_CONTENT_TYPE = 'Publish';\nconst ENTITY_PUBLISHED = 'published';\nconst SELECT_DEFAULT_VALUE = 'Please Choose...';\nconst LEAVE_PAGE_MESSAGE = 'You are going to leave without saving. Are you sure you want to leave?';\nconst KEY_TO_CHECK = 'values.slug';\nconst MENU_PERMISSIONS = ['update:any', 'update:own', 'create:any', 'create:own'];\nconst PREVIEW_INTERFACE = 'preview/can-preview';\nconst PAGE_BUILDER_FIELD_ID = 'pageBuilder';\nconst PAGE_BUILDER_TEMPLATE_FIELD_ID = 'pageBuilderTemplateId';\nconst ERROR = 'error';\nconst SUCCESS = 'success';\nconst PUBLISHED = 'published';\nconst UNPUBLISHED = 'unpublished';\nconst SAVE_BUTTON_TEXTS = { save: 'save', saved: 'saved', saving: 'saving' };\nconst ACTIONS = 'actions';\nconst UNPUBLISHED_WARNING = 'Page already unpublished';\nconst SAVE_BEFORE_PUBLISH_MESSAGE =\n 'You have to click save to create the record before you can publish';\n\nconst PAGE_BUILDER_TAB = 'Page builder';\nconst PAGE_BUILDER_TAB_INDEX = 1;\nconst EDITOR_VIEW_TAB = 'Editor view';\nconst EDITOR_VIEW_TAB_INDEX = 0;\n\nexport {\n DATA_LISTING_PREFIX,\n ENTITY_PUBLISHED,\n KEY_TO_CHECK,\n LEAVE_PAGE_MESSAGE,\n MENU_PERMISSIONS,\n PAGE_BUILDER,\n PLUGIN_NAME,\n PREVIEW_INTERFACE,\n SELECT_DEFAULT_VALUE,\n TEXT_CONTENT_TYPE,\n PAGE_BUILDER_FIELD_ID,\n PAGE_BUILDER_TEMPLATE_FIELD_ID,\n ERROR,\n SUCCESS,\n PUBLISHED,\n UNPUBLISHED,\n SAVE_BUTTON_TEXTS,\n ACTIONS,\n PAGE_BUILDER_TAB_INDEX,\n EDITOR_VIEW_TAB_INDEX,\n EDITOR_VIEW_TAB,\n PAGE_BUILDER_TAB,\n UNPUBLISHED_WARNING,\n SAVE_BEFORE_PUBLISH_MESSAGE\n};\n"],"mappings":"AAAA,MAAMA,WAAW,GAAG,SAAS;AAC7B,MAAMC,mBAAmB,GAAG,eAAe;AAC3C,MAAMC,YAAY,GAAG,aAAa;AAClC,MAAMC,iBAAiB,GAAG,SAAS;AACnC,MAAMC,gBAAgB,GAAG,WAAW;AACpC,MAAMC,oBAAoB,GAAG,kBAAkB;AAC/C,MAAMC,kBAAkB,GAAG,wEAAwE;AACnG,MAAMC,YAAY,GAAG,aAAa;AAClC,MAAMC,gBAAgB,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC;AACjF,MAAMC,iBAAiB,GAAG,qBAAqB;AAC/C,MAAMC,qBAAqB,GAAG,aAAa;AAC3C,MAAMC,8BAA8B,GAAG,uBAAuB;AAC9D,MAAMC,KAAK,GAAG,OAAO;AACrB,MAAMC,OAAO,GAAG,SAAS;AACzB,MAAMC,SAAS,GAAG,WAAW;AAC7B,MAAMC,WAAW,GAAG,aAAa;AACjC,MAAMC,iBAAiB,GAAG;EAAEC,IAAI,EAAE,MAAM;EAAEC,KAAK,EAAE,OAAO;EAAEC,MAAM,EAAE;AAAS,CAAC;AAC5E,MAAMC,OAAO,GAAG,SAAS;AACzB,MAAMC,mBAAmB,GAAG,0BAA0B;AACtD,MAAMC,2BAA2B,GAC/B,oEAAoE;AAEtE,MAAMC,gBAAgB,GAAG,cAAc;AACvC,MAAMC,sBAAsB,GAAG,CAAC;AAChC,MAAMC,eAAe,GAAG,aAAa;AACrC,MAAMC,qBAAqB,GAAG,CAAC;AAE/B,SACEzB,mBAAmB,EACnBG,gBAAgB,EAChBG,YAAY,EACZD,kBAAkB,EAClBE,gBAAgB,EAChBN,YAAY,EACZF,WAAW,EACXS,iBAAiB,EACjBJ,oBAAoB,EACpBF,iBAAiB,EACjBO,qBAAqB,EACrBC,8BAA8B,EAC9BC,KAAK,EACLC,OAAO,EACPC,SAAS,EACTC,WAAW,EACXC,iBAAiB,EACjBI,OAAO,EACPI,sBAAsB,EACtBE,qBAAqB,EACrBD,eAAe,EACfF,gBAAgB,EAChBF,mBAAmB,EACnBC,2BAA2B"}
package/lib-es/index.js CHANGED
@@ -3,12 +3,8 @@ import React from 'react';
3
3
  import pkg from '../package.json';
4
4
  import { DATA_LISTING_PREFIX, PLUGIN_NAME } from './constants';
5
5
  import getAddContentMenuItems from './utils/add-content-menu-items';
6
- const EntityDataListing = React.lazy(() => import(
7
- /* webpackChunkName: 'EntityDataListing' */
8
- './components/EntityDataListing'));
9
- const EntityManager = React.lazy(() => import(
10
- /* webpackChunkName: 'EntityManager' */
11
- './components/EntityManager'));
6
+ const EntityDataListing = React.lazy(() => import( /* webpackChunkName: 'EntityDataListing' */'./components/EntityDataListing'));
7
+ const EntityManager = React.lazy(() => import( /* webpackChunkName: 'EntityManager' */'./components/EntityManager'));
12
8
  export default async function load(app) {
13
9
  // To load different plugin information into menu
14
10
  const sectionKey = 'content';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["getFormBuilderLookup","formFieldTypes","React","pkg","DATA_LISTING_PREFIX","PLUGIN_NAME","getAddContentMenuItems","EntityDataListing","lazy","EntityManager","load","app","sectionKey","events","once","addSection","header","order","addFieldType","Object","keys","forEach","type","component","emitAsync","entityDataListingRoute","path","key","exact","editEntityRoute","addEntityRoute","addRoute","name","version","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import { getFormBuilderLookup, formFieldTypes } from '@blaze-cms/react-form-builder';\nimport React from 'react';\nimport pkg from '../package.json';\nimport { DATA_LISTING_PREFIX, PLUGIN_NAME } from './constants';\nimport getAddContentMenuItems from './utils/add-content-menu-items';\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 // To load different plugin information into menu\n const sectionKey = 'content';\n\n app.events.once('load:menu-section', addSection => {\n addSection(sectionKey, { header: 'content', order: 100 });\n });\n\n app.events.once('load:menu-items', getAddContentMenuItems(app, sectionKey));\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 const entityDataListingRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier`,\n key: 'entityDataListing',\n component: EntityDataListing,\n exact: true\n };\n\n const editEntityRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action/:id`,\n key: 'editEntity',\n component: EntityManager,\n exact: true\n };\n\n const addEntityRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action`,\n key: 'createEntity',\n component: EntityManager,\n exact: true\n };\n\n app.addRoute(entityDataListingRoute);\n app.addRoute(editEntityRoute);\n app.addRoute(addEntityRoute);\n\n return {\n name: PLUGIN_NAME,\n version: pkg.version\n };\n}\n\nload.pluginName = PLUGIN_NAME;\n"],"mappings":"AAAA,SAASA,oBAAT,EAA+BC,cAA/B,QAAqD,+BAArD;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,GAAP,MAAgB,iBAAhB;AACA,SAASC,mBAAT,EAA8BC,WAA9B,QAAiD,aAAjD;AACA,OAAOC,sBAAP,MAAmC,gCAAnC;AAEA,MAAMC,iBAAiB,GAAGL,KAAK,CAACM,IAAN,CAAW,MACnC;AAAO;AAA4C,gCAAnD,CADwB,CAA1B;AAGA,MAAMC,aAAa,GAAGP,KAAK,CAACM,IAAN,CAAW,MAC/B;AAAO;AAAwC,4BAA/C,CADoB,CAAtB;AAIA,eAAe,eAAeE,IAAf,CAAoBC,GAApB,EAAyB;EACtC;EACA,MAAMC,UAAU,GAAG,SAAnB;EAEAD,GAAG,CAACE,MAAJ,CAAWC,IAAX,CAAgB,mBAAhB,EAAqCC,UAAU,IAAI;IACjDA,UAAU,CAACH,UAAD,EAAa;MAAEI,MAAM,EAAE,SAAV;MAAqBC,KAAK,EAAE;IAA5B,CAAb,CAAV;EACD,CAFD;EAIAN,GAAG,CAACE,MAAJ,CAAWC,IAAX,CAAgB,iBAAhB,EAAmCR,sBAAsB,CAACK,GAAD,EAAMC,UAAN,CAAzD;EAEAD,GAAG,CAACE,MAAJ,CAAWC,IAAX,CAAgB,wBAAhB,EAA0CI,YAAY,IAAI;IACxDC,MAAM,CAACC,IAAP,CAAYnB,cAAZ,EAA4BoB,OAA5B,CAAoCC,IAAI,IAAI;MAC1CJ,YAAY,CAAC;QAAEI,IAAF;QAAQC,SAAS,EAAEtB,cAAc,CAACqB,IAAD;MAAjC,CAAD,CAAZ;IACD,CAFD;EAGD,CAJD;EAMAX,GAAG,CAACE,MAAJ,CAAWC,IAAX,CAAgB,4BAAhB,EAA8C,YAAY;IACxD,MAAMH,GAAG,CAACE,MAAJ,CAAWW,SAAX,CAAqB,wBAArB,EAA+CxB,oBAAoB,CAACkB,YAApE,CAAN;EACD,CAFD;EAIA,MAAMO,sBAAsB,GAAG;IAC7BC,IAAI,EAAG,GAAEtB,mBAAoB,oBADA;IAE7BuB,GAAG,EAAE,mBAFwB;IAG7BJ,SAAS,EAAEhB,iBAHkB;IAI7BqB,KAAK,EAAE;EAJsB,CAA/B;EAOA,MAAMC,eAAe,GAAG;IACtBH,IAAI,EAAG,GAAEtB,mBAAoB,gCADP;IAEtBuB,GAAG,EAAE,YAFiB;IAGtBJ,SAAS,EAAEd,aAHW;IAItBmB,KAAK,EAAE;EAJe,CAAxB;EAOA,MAAME,cAAc,GAAG;IACrBJ,IAAI,EAAG,GAAEtB,mBAAoB,4BADR;IAErBuB,GAAG,EAAE,cAFgB;IAGrBJ,SAAS,EAAEd,aAHU;IAIrBmB,KAAK,EAAE;EAJc,CAAvB;EAOAjB,GAAG,CAACoB,QAAJ,CAAaN,sBAAb;EACAd,GAAG,CAACoB,QAAJ,CAAaF,eAAb;EACAlB,GAAG,CAACoB,QAAJ,CAAaD,cAAb;EAEA,OAAO;IACLE,IAAI,EAAE3B,WADD;IAEL4B,OAAO,EAAE9B,GAAG,CAAC8B;EAFR,CAAP;AAID;AAEDvB,IAAI,CAACwB,UAAL,GAAkB7B,WAAlB"}
1
+ {"version":3,"file":"index.js","names":["getFormBuilderLookup","formFieldTypes","React","pkg","DATA_LISTING_PREFIX","PLUGIN_NAME","getAddContentMenuItems","EntityDataListing","lazy","EntityManager","load","app","sectionKey","events","once","addSection","header","order","addFieldType","Object","keys","forEach","type","component","emitAsync","entityDataListingRoute","path","key","exact","editEntityRoute","addEntityRoute","addRoute","name","version","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import { getFormBuilderLookup, formFieldTypes } from '@blaze-cms/react-form-builder';\nimport React from 'react';\nimport pkg from '../package.json';\nimport { DATA_LISTING_PREFIX, PLUGIN_NAME } from './constants';\nimport getAddContentMenuItems from './utils/add-content-menu-items';\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 // To load different plugin information into menu\n const sectionKey = 'content';\n\n app.events.once('load:menu-section', addSection => {\n addSection(sectionKey, { header: 'content', order: 100 });\n });\n\n app.events.once('load:menu-items', getAddContentMenuItems(app, sectionKey));\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 const entityDataListingRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier`,\n key: 'entityDataListing',\n component: EntityDataListing,\n exact: true\n };\n\n const editEntityRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action/:id`,\n key: 'editEntity',\n component: EntityManager,\n exact: true\n };\n\n const addEntityRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action`,\n key: 'createEntity',\n component: EntityManager,\n exact: true\n };\n\n app.addRoute(entityDataListingRoute);\n app.addRoute(editEntityRoute);\n app.addRoute(addEntityRoute);\n\n return {\n name: PLUGIN_NAME,\n version: pkg.version\n };\n}\n\nload.pluginName = PLUGIN_NAME;\n"],"mappings":"AAAA,SAASA,oBAAoB,EAAEC,cAAc,QAAQ,+BAA+B;AACpF,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,GAAG,MAAM,iBAAiB;AACjC,SAASC,mBAAmB,EAAEC,WAAW,QAAQ,aAAa;AAC9D,OAAOC,sBAAsB,MAAM,gCAAgC;AAEnE,MAAMC,iBAAiB,GAAGL,KAAK,CAACM,IAAI,CAAC,MACnC,MAAM,EAAC,2CAA4C,gCAAgC,CAAC,CACrF;AACD,MAAMC,aAAa,GAAGP,KAAK,CAACM,IAAI,CAAC,MAC/B,MAAM,EAAC,uCAAwC,4BAA4B,CAAC,CAC7E;AAED,eAAe,eAAeE,IAAI,CAACC,GAAG,EAAE;EACtC;EACA,MAAMC,UAAU,GAAG,SAAS;EAE5BD,GAAG,CAACE,MAAM,CAACC,IAAI,CAAC,mBAAmB,EAAEC,UAAU,IAAI;IACjDA,UAAU,CAACH,UAAU,EAAE;MAAEI,MAAM,EAAE,SAAS;MAAEC,KAAK,EAAE;IAAI,CAAC,CAAC;EAC3D,CAAC,CAAC;EAEFN,GAAG,CAACE,MAAM,CAACC,IAAI,CAAC,iBAAiB,EAAER,sBAAsB,CAACK,GAAG,EAAEC,UAAU,CAAC,CAAC;EAE3ED,GAAG,CAACE,MAAM,CAACC,IAAI,CAAC,wBAAwB,EAAEI,YAAY,IAAI;IACxDC,MAAM,CAACC,IAAI,CAACnB,cAAc,CAAC,CAACoB,OAAO,CAACC,IAAI,IAAI;MAC1CJ,YAAY,CAAC;QAAEI,IAAI;QAAEC,SAAS,EAAEtB,cAAc,CAACqB,IAAI;MAAE,CAAC,CAAC;IACzD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFX,GAAG,CAACE,MAAM,CAACC,IAAI,CAAC,4BAA4B,EAAE,YAAY;IACxD,MAAMH,GAAG,CAACE,MAAM,CAACW,SAAS,CAAC,wBAAwB,EAAExB,oBAAoB,CAACkB,YAAY,CAAC;EACzF,CAAC,CAAC;EAEF,MAAMO,sBAAsB,GAAG;IAC7BC,IAAI,EAAG,GAAEtB,mBAAoB,oBAAmB;IAChDuB,GAAG,EAAE,mBAAmB;IACxBJ,SAAS,EAAEhB,iBAAiB;IAC5BqB,KAAK,EAAE;EACT,CAAC;EAED,MAAMC,eAAe,GAAG;IACtBH,IAAI,EAAG,GAAEtB,mBAAoB,gCAA+B;IAC5DuB,GAAG,EAAE,YAAY;IACjBJ,SAAS,EAAEd,aAAa;IACxBmB,KAAK,EAAE;EACT,CAAC;EAED,MAAME,cAAc,GAAG;IACrBJ,IAAI,EAAG,GAAEtB,mBAAoB,4BAA2B;IACxDuB,GAAG,EAAE,cAAc;IACnBJ,SAAS,EAAEd,aAAa;IACxBmB,KAAK,EAAE;EACT,CAAC;EAEDjB,GAAG,CAACoB,QAAQ,CAACN,sBAAsB,CAAC;EACpCd,GAAG,CAACoB,QAAQ,CAACF,eAAe,CAAC;EAC7BlB,GAAG,CAACoB,QAAQ,CAACD,cAAc,CAAC;EAE5B,OAAO;IACLE,IAAI,EAAE3B,WAAW;IACjB4B,OAAO,EAAE9B,GAAG,CAAC8B;EACf,CAAC;AACH;AAEAvB,IAAI,CAACwB,UAAU,GAAG7B,WAAW"}
@@ -1,9 +1,7 @@
1
1
  import { getQuery } from '@blaze-cms/admin-ui-utils';
2
-
3
2
  const {
4
3
  MENU_PERMISSIONS
5
4
  } = require('../constants');
6
-
7
5
  function getAddContentMenuItems(app, sectionKey) {
8
6
  return async addItem => {
9
7
  const client = app.getClient();
@@ -29,6 +27,5 @@ function getAddContentMenuItems(app, sectionKey) {
29
27
  });
30
28
  };
31
29
  }
32
-
33
30
  export default getAddContentMenuItems;
34
31
  //# sourceMappingURL=add-content-menu-items.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-content-menu-items.js","names":["getQuery","MENU_PERMISSIONS","require","getAddContentMenuItems","app","sectionKey","addItem","client","getClient","data","getEntitySchemas","query","variables","canDoActions","forEach","id","displayName","name","uri"],"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, sectionKey) {\n return async addItem => {\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 getEntitySchemas.forEach(({ id, displayName }) => {\n addItem({ name: displayName, uri: `/data-listing/${id}` }, sectionKey);\n });\n };\n}\n\nexport default getAddContentMenuItems;\n"],"mappings":"AAAA,SAASA,QAAT,QAAyB,2BAAzB;;AAEA,MAAM;EAAEC;AAAF,IAAuBC,OAAO,CAAC,cAAD,CAApC;;AAEA,SAASC,sBAAT,CAAgCC,GAAhC,EAAqCC,UAArC,EAAiD;EAC/C,OAAO,MAAMC,OAAN,IAAiB;IACtB,MAAMC,MAAM,GAAGH,GAAG,CAACI,SAAJ,EAAf;IACA,MAAM;MACJC,IAAI,EAAE;QAAEC;MAAF;IADF,IAEF,MAAMH,MAAM,CAACI,KAAP,CAAa;MACrBA,KAAK,EAAEX,QAAQ,CAAC,4BAAD,CADM;MAErBY,SAAS,EAAE;QACT;QACAC,YAAY,EAAEZ;MAFL;IAFU,CAAb,CAFV;IASAS,gBAAgB,CAACI,OAAjB,CAAyB,CAAC;MAAEC,EAAF;MAAMC;IAAN,CAAD,KAAyB;MAChDV,OAAO,CAAC;QAAEW,IAAI,EAAED,WAAR;QAAqBE,GAAG,EAAG,iBAAgBH,EAAG;MAA9C,CAAD,EAAoDV,UAApD,CAAP;IACD,CAFD;EAGD,CAdD;AAeD;;AAED,eAAeF,sBAAf"}
1
+ {"version":3,"file":"add-content-menu-items.js","names":["getQuery","MENU_PERMISSIONS","require","getAddContentMenuItems","app","sectionKey","addItem","client","getClient","data","getEntitySchemas","query","variables","canDoActions","forEach","id","displayName","name","uri"],"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, sectionKey) {\n return async addItem => {\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 getEntitySchemas.forEach(({ id, displayName }) => {\n addItem({ name: displayName, uri: `/data-listing/${id}` }, sectionKey);\n });\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,sBAAsB,CAACC,GAAG,EAAEC,UAAU,EAAE;EAC/C,OAAO,MAAMC,OAAO,IAAI;IACtB,MAAMC,MAAM,GAAGH,GAAG,CAACI,SAAS,EAAE;IAC9B,MAAM;MACJC,IAAI,EAAE;QAAEC;MAAiB;IAC3B,CAAC,GAAG,MAAMH,MAAM,CAACI,KAAK,CAAC;MACrBA,KAAK,EAAEX,QAAQ,CAAC,4BAA4B,CAAC;MAC7CY,SAAS,EAAE;QACT;QACAC,YAAY,EAAEZ;MAChB;IACF,CAAC,CAAC;IACFS,gBAAgB,CAACI,OAAO,CAAC,CAAC;MAAEC,EAAE;MAAEC;IAAY,CAAC,KAAK;MAChDV,OAAO,CAAC;QAAEW,IAAI,EAAED,WAAW;QAAEE,GAAG,EAAG,iBAAgBH,EAAG;MAAE,CAAC,EAAEV,UAAU,CAAC;IACxE,CAAC,CAAC;EACJ,CAAC;AACH;AAEA,eAAeF,sBAAsB"}
@@ -2,12 +2,10 @@ import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
3
  import upperfirst from 'lodash.upperfirst';
4
4
  import { getDataProperties } from '@blaze-cms/admin-ui-utils';
5
-
6
5
  function buildCreateEntityMutation(entitySchema) {
7
6
  if (!entitySchema || !entitySchema.actions || !entitySchema.actions.create || !entitySchema.properties) {
8
7
  throw new BlazeError('Create entity query requires create action and properties from entity schema');
9
8
  }
10
-
11
9
  const actionInput = upperfirst(`${entitySchema.actions.create}Input`);
12
10
  const dataProperties = getDataProperties(entitySchema);
13
11
  return gql`mutation createEntity($input: ${actionInput}) {
@@ -19,6 +17,5 @@ function buildCreateEntityMutation(entitySchema) {
19
17
  }
20
18
  }`;
21
19
  }
22
-
23
20
  export default buildCreateEntityMutation;
24
21
  //# sourceMappingURL=build-create-entity-mutation.js.map
@@ -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,GAAT,QAAoB,gBAApB;AACA,SAASC,UAAT,QAA2B,wBAA3B;AACA,OAAOC,UAAP,MAAuB,mBAAvB;AACA,SAASC,iBAAT,QAAkC,2BAAlC;;AAEA,SAASC,yBAAT,CAAmCC,YAAnC,EAAiD;EAC/C,IACE,CAACA,YAAD,IACA,CAACA,YAAY,CAACC,OADd,IAEA,CAACD,YAAY,CAACC,OAAb,CAAqBC,MAFtB,IAGA,CAACF,YAAY,CAACG,UAJhB,EAKE;IACA,MAAM,IAAIP,UAAJ,CACJ,8EADI,CAAN;EAGD;;EAED,MAAMQ,WAAW,GAAGP,UAAU,CAAE,GAAEG,YAAY,CAACC,OAAb,CAAqBC,MAAO,OAAhC,CAA9B;EACA,MAAMG,cAAc,GAAGP,iBAAiB,CAACE,YAAD,CAAxC;EAEA,OAAOL,GAAI,kCAAiCS,WAAY;AAC1D,qBAAqBJ,YAAY,CAACC,OAAb,CAAqBC,MAAO;AACjD;AACA;AACA,YAAYG,cAAc,CAACC,IAAf,CAAoB,KAApB,CAA2B;AACvC;AACA;AACA,IAPE;AAQD;;AAED,eAAeP,yBAAf"}
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,yBAAyB,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,8EAA8E,CAC/E;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,12 +1,10 @@
1
1
  import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
3
  import upperfirst from 'lodash.upperfirst';
4
-
5
4
  function buildDeleteEntity(entitySchema) {
6
5
  if (!entitySchema || !entitySchema.actions || !entitySchema.actions.delete) {
7
6
  throw new BlazeError('Delete query requires delete action from entity schema');
8
7
  }
9
-
10
8
  const actionInput = upperfirst(`${entitySchema.actions.delete}Input`);
11
9
  return gql`
12
10
  mutation deleteEntity($input: ${actionInput}) {
@@ -16,6 +14,5 @@ function buildDeleteEntity(entitySchema) {
16
14
  }
17
15
  `;
18
16
  }
19
-
20
17
  export default buildDeleteEntity;
21
18
  //# sourceMappingURL=build-delete-entity-mutation.js.map
@@ -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,GAAT,QAAoB,gBAApB;AACA,SAASC,UAAT,QAA2B,wBAA3B;AACA,OAAOC,UAAP,MAAuB,mBAAvB;;AAEA,SAASC,iBAAT,CAA2BC,YAA3B,EAAyC;EACvC,IAAI,CAACA,YAAD,IAAiB,CAACA,YAAY,CAACC,OAA/B,IAA0C,CAACD,YAAY,CAACC,OAAb,CAAqBC,MAApE,EAA4E;IAC1E,MAAM,IAAIL,UAAJ,CAAe,wDAAf,CAAN;EACD;;EAED,MAAMM,WAAW,GAAGL,UAAU,CAAE,GAAEE,YAAY,CAACC,OAAb,CAAqBC,MAAO,OAAhC,CAA9B;EAEA,OAAON,GAAI;AACb,mCAAmCO,WAAY;AAC/C,oBAAoBH,YAAY,CAACC,OAAb,CAAqBC,MAAO;AAChD;AACA;AACA;AACA,GANE;AAOD;;AAED,eAAeH,iBAAf"}
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,iBAAiB,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,11 +1,9 @@
1
1
  import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
-
4
3
  function buildListingQuery(entitySchema) {
5
4
  if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {
6
5
  throw new BlazeError('Listing query requires getAll action and listingProperties from entity schema');
7
6
  }
8
-
9
7
  const sortType = entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);
10
8
  return gql`
11
9
  query ${entitySchema.actions.getAll}($limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {
@@ -16,6 +14,5 @@ function buildListingQuery(entitySchema) {
16
14
  }
17
15
  `;
18
16
  }
19
-
20
17
  export default buildListingQuery;
21
18
  //# sourceMappingURL=build-listing-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-listing-query.js","names":["gql","BlazeError","buildListingQuery","entitySchema","actions","getAll","listingProperties","sortType","toUpperCase","substr","join"],"sources":["../../src/utils/build-listing-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nfunction buildListingQuery(entitySchema) {\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 const sortType =\n entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);\n\n return gql`\n query ${entitySchema.actions.getAll}($limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {\n listingData: ${entitySchema.actions.getAll}(limit: $limit, offset:$offset, sort:$sort){\n id,\n ${entitySchema.listingProperties.join(',\\n')}\n }\n }\n `;\n}\n\nexport default buildListingQuery;\n"],"mappings":"AAAA,SAASA,GAAT,QAAoB,gBAApB;AACA,SAASC,UAAT,QAA2B,wBAA3B;;AAEA,SAASC,iBAAT,CAA2BC,YAA3B,EAAyC;EACvC,IAAI,CAACA,YAAY,CAACC,OAAd,IAAyB,CAACD,YAAY,CAACC,OAAb,CAAqBC,MAA/C,IAAyD,CAACF,YAAY,CAACG,iBAA3E,EAA8F;IAC5F,MAAM,IAAIL,UAAJ,CACJ,+EADI,CAAN;EAGD;;EAED,MAAMM,QAAQ,GACZJ,YAAY,CAACC,OAAb,CAAqBC,MAArB,CAA4B,CAA5B,EAA+BG,WAA/B,KAA+CL,YAAY,CAACC,OAAb,CAAqBC,MAArB,CAA4BI,MAA5B,CAAmC,CAAnC,CADjD;EAGA,OAAOT,GAAI;AACb,YAAYG,YAAY,CAACC,OAAb,CAAqBC,MAAO,sCAAqCE,QAAS;AACtF,qBAAqBJ,YAAY,CAACC,OAAb,CAAqBC,MAAO;AACjD;AACA,UAAUF,YAAY,CAACG,iBAAb,CAA+BI,IAA/B,CAAoC,KAApC,CAA2C;AACrD;AACA;AACA,GAPE;AAQD;;AAED,eAAeR,iBAAf"}
1
+ {"version":3,"file":"build-listing-query.js","names":["gql","BlazeError","buildListingQuery","entitySchema","actions","getAll","listingProperties","sortType","toUpperCase","substr","join"],"sources":["../../src/utils/build-listing-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nfunction buildListingQuery(entitySchema) {\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 const sortType =\n entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);\n\n return gql`\n query ${entitySchema.actions.getAll}($limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {\n listingData: ${entitySchema.actions.getAll}(limit: $limit, offset:$offset, sort:$sort){\n id,\n ${entitySchema.listingProperties.join(',\\n')}\n }\n }\n `;\n}\n\nexport default buildListingQuery;\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,iBAAiB,CAACC,YAAY,EAAE;EACvC,IAAI,CAACA,YAAY,CAACC,OAAO,IAAI,CAACD,YAAY,CAACC,OAAO,CAACC,MAAM,IAAI,CAACF,YAAY,CAACG,iBAAiB,EAAE;IAC5F,MAAM,IAAIL,UAAU,CAClB,+EAA+E,CAChF;EACH;EAEA,MAAMM,QAAQ,GACZJ,YAAY,CAACC,OAAO,CAACC,MAAM,CAAC,CAAC,CAAC,CAACG,WAAW,EAAE,GAAGL,YAAY,CAACC,OAAO,CAACC,MAAM,CAACI,MAAM,CAAC,CAAC,CAAC;EAEtF,OAAOT,GAAI;AACb,YAAYG,YAAY,CAACC,OAAO,CAACC,MAAO,sCAAqCE,QAAS;AACtF,qBAAqBJ,YAAY,CAACC,OAAO,CAACC,MAAO;AACjD;AACA,UAAUF,YAAY,CAACG,iBAAiB,CAACI,IAAI,CAAC,KAAK,CAAE;AACrD;AACA;AACA,GAAG;AACH;AAEA,eAAeR,iBAAiB"}
@@ -2,12 +2,10 @@ import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
3
  import upperfirst from 'lodash.upperfirst';
4
4
  import { getDataProperties } from '@blaze-cms/admin-ui-utils';
5
-
6
5
  function buildUpdateDataQuery(entitySchema) {
7
6
  if (!entitySchema.actions || !entitySchema.actions.update || !entitySchema.properties) {
8
7
  throw new BlazeError('Update DataEntity query requires get action and properties from entity schema');
9
8
  }
10
-
11
9
  const actionInput = upperfirst(`${entitySchema.actions.update}Input`);
12
10
  const dataProperties = getDataProperties(entitySchema);
13
11
  return gql`
@@ -22,6 +20,5 @@ function buildUpdateDataQuery(entitySchema) {
22
20
  }
23
21
  `;
24
22
  }
25
-
26
23
  export default buildUpdateDataQuery;
27
24
  //# sourceMappingURL=build-update-data-query.js.map
@@ -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,GAAT,QAAoB,gBAApB;AACA,SAASC,UAAT,QAA2B,wBAA3B;AACA,OAAOC,UAAP,MAAuB,mBAAvB;AACA,SAASC,iBAAT,QAAkC,2BAAlC;;AAEA,SAASC,oBAAT,CAA8BC,YAA9B,EAA4C;EAC1C,IAAI,CAACA,YAAY,CAACC,OAAd,IAAyB,CAACD,YAAY,CAACC,OAAb,CAAqBC,MAA/C,IAAyD,CAACF,YAAY,CAACG,UAA3E,EAAuF;IACrF,MAAM,IAAIP,UAAJ,CACJ,+EADI,CAAN;EAGD;;EAED,MAAMQ,WAAW,GAAGP,UAAU,CAAE,GAAEG,YAAY,CAACC,OAAb,CAAqBC,MAAO,OAAhC,CAA9B;EACA,MAAMG,cAAc,GAAGP,iBAAiB,CAACE,YAAD,CAAxC;EAEA,OAAOL,GAAI;AACb,mCAAmCS,WAAY;AAC/C,oBAAoBJ,YAAY,CAACC,OAAb,CAAqBC,MAAO;AAChD;AACA;AACA,YAAYG,cAAc,CAACC,IAAf,CAAoB,KAApB,CAA2B;AACvC;AACA;AACA;AACA;AACA,GAVE;AAWD;;AAED,eAAeP,oBAAf"}
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,oBAAoB,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,+EAA+E,CAChF;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,11 +1,9 @@
1
1
  import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
-
4
3
  function buildUpdatePublishUnpublishMutation(entitySchema, id, action, cache) {
5
4
  if (!entitySchema || !entitySchema.actions || !entitySchema.actions.publish || !id || !action) {
6
5
  throw new BlazeError('Update DataEntity query requires publish action from entity schema and id');
7
6
  }
8
-
9
7
  const withClient = `${cache ? '@client' : ''}`;
10
8
  return gql`
11
9
  mutation {
@@ -20,6 +18,5 @@ function buildUpdatePublishUnpublishMutation(entitySchema, id, action, cache) {
20
18
  }
21
19
  `;
22
20
  }
23
-
24
21
  export default buildUpdatePublishUnpublishMutation;
25
22
  //# sourceMappingURL=build-update-publish-unpublish-mutation.js.map
@@ -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,GAAT,QAAoB,gBAApB;AACA,SAASC,UAAT,QAA2B,wBAA3B;;AAEA,SAASC,mCAAT,CAA6CC,YAA7C,EAA2DC,EAA3D,EAA+DC,MAA/D,EAAuEC,KAAvE,EAA8E;EAC5E,IAAI,CAACH,YAAD,IAAiB,CAACA,YAAY,CAACI,OAA/B,IAA0C,CAACJ,YAAY,CAACI,OAAb,CAAqBC,OAAhE,IAA2E,CAACJ,EAA5E,IAAkF,CAACC,MAAvF,EAA+F;IAC7F,MAAM,IAAIJ,UAAJ,CACJ,2EADI,CAAN;EAGD;;EAED,MAAMQ,UAAU,GAAI,GAAEH,KAAK,GAAG,SAAH,GAAe,EAAG,EAA7C;EAEA,OAAON,GAAI;AACb;AACA,kBAAkBG,YAAY,CAACI,OAAb,CAAqBF,MAArB,CAA6B,IAAGI,UAAW;AAC7D,eAAeL,EAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAXE;AAYD;;AAED,eAAeF,mCAAf"}
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,mCAAmC,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,2EAA2E,CAC5E;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"}
@@ -11,6 +11,5 @@ const getDefaultQueryParams = ({
11
11
  }] : []
12
12
  };
13
13
  };
14
-
15
14
  export { getDefaultQueryParams };
16
15
  //# sourceMappingURL=get-default-query-params.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","schema","updated","properties","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\n return {\n limit: 40,\n offset: 0,\n sort: updated\n ? [\n {\n property: 'updated',\n direction: 'desc'\n }\n ]\n : []\n };\n};\n\nexport { getDefaultQueryParams };\n"],"mappings":"AAAA,MAAMA,qBAAqB,GAAG,CAAC;EAAEC;AAAF,CAAD,KAAgB;EAC5C,MAAMC,OAAO,GAAGD,MAAM,CAACE,UAAP,IAAqBF,MAAM,CAACE,UAAP,CAAkBD,OAAvD;EAEA,OAAO;IACLE,KAAK,EAAE,EADF;IAELC,MAAM,EAAE,CAFH;IAGLC,IAAI,EAAEJ,OAAO,GACT,CACE;MACEK,QAAQ,EAAE,SADZ;MAEEC,SAAS,EAAE;IAFb,CADF,CADS,GAOT;EAVC,CAAP;AAYD,CAfD;;AAiBA,SAASR,qBAAT"}
1
+ {"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","schema","updated","properties","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\n return {\n limit: 40,\n offset: 0,\n sort: updated\n ? [\n {\n property: 'updated',\n direction: 'desc'\n }\n ]\n : []\n };\n};\n\nexport { getDefaultQueryParams };\n"],"mappings":"AAAA,MAAMA,qBAAqB,GAAG,CAAC;EAAEC;AAAO,CAAC,KAAK;EAC5C,MAAMC,OAAO,GAAGD,MAAM,CAACE,UAAU,IAAIF,MAAM,CAACE,UAAU,CAACD,OAAO;EAE9D,OAAO;IACLE,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAEJ,OAAO,GACT,CACE;MACEK,QAAQ,EAAE,SAAS;MACnBC,SAAS,EAAE;IACb,CAAC,CACF,GACD;EACN,CAAC;AACH,CAAC;AAED,SAASR,qBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"withContext.js","names":["React","useMainContext","MainContext","withContext","Component","props","contexts"],"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,KAAP,MAAkB,OAAlB;AACA,SAASC,cAAT,EAAyBC,WAAzB,QAA4C,2BAA5C;AAEA,OAAO,MAAMC,WAAW,GAAGC,SAAS,IAAIC,KAAK,IAAI;EAC/C,MAAMC,QAAQ,GAAGL,cAAc,CAACC,WAAD,CAA/B;EACA,oBAAO,oBAAC,SAAD,eAAeG,KAAf,EAA0BC,QAA1B,EAAP;AACD,CAHM"}
1
+ {"version":3,"file":"withContext.js","names":["React","useMainContext","MainContext","withContext","Component","props","contexts"],"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,oBAAO,oBAAC,SAAS,eAAKG,KAAK,EAAMC,QAAQ,EAAI;AAC/C,CAAC"}
@@ -1,10 +1,8 @@
1
1
  import { useState, useCallback } from 'react';
2
-
3
2
  function useToggle(initialValue) {
4
3
  const [toggleValue, setToggleValue] = useState(initialValue);
5
4
  const toggler = useCallback(() => setToggleValue(!toggleValue), [toggleValue]);
6
5
  return [toggleValue, toggler];
7
6
  }
8
-
9
7
  export default useToggle;
10
8
  //# sourceMappingURL=useToggle.js.map
@@ -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,QAAT,EAAmBC,WAAnB,QAAsC,OAAtC;;AAEA,SAASC,SAAT,CAAmBC,YAAnB,EAAiC;EAC/B,MAAM,CAACC,WAAD,EAAcC,cAAd,IAAgCL,QAAQ,CAACG,YAAD,CAA9C;EACA,MAAMG,OAAO,GAAGL,WAAW,CAAC,MAAMI,cAAc,CAAC,CAACD,WAAF,CAArB,EAAqC,CAACA,WAAD,CAArC,CAA3B;EAEA,OAAO,CAACA,WAAD,EAAcE,OAAd,CAAP;AACD;;AAED,eAAeJ,SAAf"}
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,SAAS,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 +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,mCAAP,MAAgD,2CAAhD;AAEA,SAASA,mCAAT"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaze-cms/plugin-data-ui",
3
- "version": "0.125.0-admin-updates.1",
3
+ "version": "0.125.0-alpha.13",
4
4
  "description": "Blaze plugin data ui",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-es/index.js",
@@ -27,12 +27,12 @@
27
27
  },
28
28
  "license": "GPL-3.0",
29
29
  "dependencies": {
30
- "@blaze-cms/admin-ui-utils": "0.125.0-admin-updates.0",
30
+ "@blaze-cms/admin-ui-utils": "^0.124.0",
31
31
  "@blaze-cms/core-errors": "^0.118.0",
32
- "@blaze-cms/react-form-builder": "^0.125.0-admin-updates.1",
33
- "@blaze-cms/react-page-builder": "^0.125.0-admin-updates.1",
32
+ "@blaze-cms/react-form-builder": "^0.124.0",
33
+ "@blaze-cms/react-page-builder": "0.125.0-alpha.13",
34
34
  "@blaze-cms/setup-ui": "^0.92.0",
35
- "@blaze-cms/versioning-ui": "0.125.0-admin-updates.0",
35
+ "@blaze-cms/versioning-ui": "^0.124.0",
36
36
  "@blaze-react/button": "0.5.19",
37
37
  "@blaze-react/more": "0.5.19",
38
38
  "@blaze-react/multiselect": "0.6.6",
@@ -65,5 +65,5 @@
65
65
  "lib/*",
66
66
  "lib-es/*"
67
67
  ],
68
- "gitHead": "18db5a6c5174241db2c760418930b7b73b9e82dd"
68
+ "gitHead": "29fe7795dcc4c4b334d987fe160e5763b881e974"
69
69
  }
@@ -402,73 +402,69 @@ const Entity = ({
402
402
  schema?.interfaces?.includes('page-builder/page-builder');
403
403
 
404
404
  return (
405
- <div className="page-wrapper">
406
- <EntityHeader
407
- entityData={entityData}
408
- entityIdentifier={entityIdentifier}
409
- pageTitle={pageTitle}
410
- pageName={pageName}
411
- onSubmit={onSubmit}
412
- handlePublishAndUnpublish={handlePublishAndUnpublish}
413
- isSaveButtonAvailable={isSaveButtonAvailable}
414
- isEnablePublishButton={isEnablePublishButton}
415
- isEnablePreviewButton={isEnablePreviewButton}
416
- toggleCopyModal={setCopyModalStatus}
417
- toggleModal={setModalStatus}
418
- formData={formData}
419
- onViewUrl={onViewUrlHandler}
420
- saveButtonText={saveButtonText}
421
- />
422
- <div className="page-wrapper__content">
423
- <div className="page page__tab">
424
- <Prompt when={hasToDisplayPrompt} message={LEAVE_PAGE_MESSAGE} />
425
- {showModal && (
426
- <DeleteAction
427
- onClose={setModalStatus}
428
- deleteAction={onDelete}
429
- itemName={formData.values.name}
430
- />
431
- )}
432
- {copyModalStatus && (
433
- <CopyDataFromAction
434
- onClose={handleCopyDataFromClose}
435
- copyAction={onCopy}
436
- getFormData={getFormData}
437
- />
438
- )}
439
-
440
- <div className="row row--display-row">
441
- <div className="column">
442
- <div className="page__content">
443
- <div className="content">
444
- <Tabs
445
- enabled={showPageBuilderTabs}
446
- onTabChange={tabId => {
447
- client.writeQuery({
448
- query: GET_CURRENT_TAB_ID,
449
- data: { currentTabId: tabId }
450
- });
451
- setCurrentTabId(tabId);
452
- }}>
453
- <FormBuilder
454
- getIsFormValid={setIsFormValid}
455
- getFormValues={getFormValues}
456
- schema={schema}
457
- data={clonedFormData}
458
- onChange={onChangeFormValues}
459
- shouldCopyData={shouldCopyData}
460
- updateCopyData={updateCopyData}
461
- formValues={formValues}
462
- isNewEntity={isNewEntity}
463
- />
464
- </Tabs>
465
- </div>
466
- </div>
405
+ <div className="page">
406
+ <Prompt when={hasToDisplayPrompt} message={LEAVE_PAGE_MESSAGE} />
407
+ {showModal && (
408
+ <DeleteAction
409
+ onClose={setModalStatus}
410
+ deleteAction={onDelete}
411
+ itemName={formData.values.name}
412
+ />
413
+ )}
414
+ {copyModalStatus && (
415
+ <CopyDataFromAction
416
+ onClose={handleCopyDataFromClose}
417
+ copyAction={onCopy}
418
+ getFormData={getFormData}
419
+ />
420
+ )}
421
+
422
+ <div className="row row--display-row">
423
+ <div className="column column--three-quarters">
424
+ <EntityHeader
425
+ entityData={entityData}
426
+ entityIdentifier={entityIdentifier}
427
+ pageTitle={pageTitle}
428
+ pageName={pageName}
429
+ onSubmit={onSubmit}
430
+ handlePublishAndUnpublish={handlePublishAndUnpublish}
431
+ isSaveButtonAvailable={isSaveButtonAvailable}
432
+ isEnablePublishButton={isEnablePublishButton}
433
+ isEnablePreviewButton={isEnablePreviewButton}
434
+ toggleCopyModal={setCopyModalStatus}
435
+ toggleModal={setModalStatus}
436
+ formData={formData}
437
+ onViewUrl={onViewUrlHandler}
438
+ saveButtonText={saveButtonText}
439
+ />
440
+
441
+ <div className="page__content">
442
+ <div className="content">
443
+ <Tabs
444
+ enabled={showPageBuilderTabs}
445
+ onTabChange={tabId => {
446
+ client.writeQuery({
447
+ query: GET_CURRENT_TAB_ID,
448
+ data: { currentTabId: tabId }
449
+ });
450
+ setCurrentTabId(tabId);
451
+ }}>
452
+ <FormBuilder
453
+ getIsFormValid={setIsFormValid}
454
+ getFormValues={getFormValues}
455
+ schema={schema}
456
+ data={clonedFormData}
457
+ onChange={onChangeFormValues}
458
+ shouldCopyData={shouldCopyData}
459
+ updateCopyData={updateCopyData}
460
+ formValues={formValues}
461
+ isNewEntity={isNewEntity}
462
+ />
463
+ </Tabs>
467
464
  </div>
468
465
  </div>
469
466
  </div>
470
-
471
- <div className="column column--one-third page-sidebar">
467
+ <div className="column column--one-third">
472
468
  {showSideBarRelations && (
473
469
  <SideBarRelations
474
470
  entity={entity}
@@ -4,21 +4,16 @@ import uuidv1 from 'uuid/v1';
4
4
  import { useApolloClient } from '@apollo/client';
5
5
  import { getQuery } from '@blaze-cms/admin-ui-utils';
6
6
  import { formFieldTypes } from '@blaze-cms/react-form-builder';
7
- import classnames from 'classnames';
7
+ import Badge from '@blaze-react/badge';
8
8
  import { VersionsList } from '@blaze-cms/versioning-ui';
9
- import { PUBLISHED, UNPUBLISHED } from '../../../../constants';
9
+ import { PUBLISHED } from '../../../../constants';
10
10
 
11
11
  const SideBarRelations = ({ schema, onChange, formData, entity }) => {
12
12
  const { relation: RelationComponent } = formFieldTypes;
13
- const {
14
- formattedStatus,
15
- formattedUpdated,
16
- formattedCreated,
17
- formattedPublished,
18
- status
19
- } = formData;
13
+ const { formattedStatus, formattedUpdated, formattedCreated, formattedPublished } = formData;
20
14
  const client = useApolloClient();
21
15
  const [relationsComponents, setRelationsComponents] = useState(null);
16
+
22
17
  useEffect(
23
18
  () => {
24
19
  (async () => {
@@ -56,26 +51,17 @@ const SideBarRelations = ({ schema, onChange, formData, entity }) => {
56
51
  const { id: itemId } = entity;
57
52
  const { identifier: itemEntity, interfaces } = schema;
58
53
 
59
- const statusClassName = classnames('sidebar__status__badge', {
60
- 'sidebar__status__badge--published': status === PUBLISHED,
61
- 'sidebar__status__badge--unpublished': status === UNPUBLISHED
62
- });
63
-
64
54
  return (
65
55
  <div className="sidebar" data-testid="sideBarRelations-main-div">
66
56
  <div className="sidebar__content">
67
57
  {formattedCreated && (
68
58
  <div className="sidebar__status">
69
- <div className="sidebar__status__wrapper">
70
- <b>Status</b>
71
- <span className={statusClassName}>{formattedStatus}</span>
72
- </div>
73
- {formattedStatus === PUBLISHED && (
74
- <p>
75
- {formattedStatus} on: <span> {formattedPublished}</span>
76
- </p>
59
+ {formattedStatus && (
60
+ <Badge type="status" modifiers={formattedStatus}>
61
+ {formattedStatus}
62
+ {formattedStatus === PUBLISHED && `: ${formattedPublished}`}
63
+ </Badge>
77
64
  )}
78
-
79
65
  <p>
80
66
  Created: <span>{formattedCreated}</span>
81
67
  </p>