@blaze-cms/plugin-data-ui 0.146.0-translations.8 → 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 (205) hide show
  1. package/lib/components/EntityDataListing/EntityDataListing.js +21 -19
  2. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  3. package/lib/components/EntityDataListing/index.js +2 -3
  4. package/lib/components/EntityDataListing/index.js.map +1 -1
  5. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +18 -19
  6. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
  7. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +2 -3
  8. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
  9. package/lib/components/EntityManager/Entity/Entity.js +286 -458
  10. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  11. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +62 -66
  12. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  13. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +32 -56
  14. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  15. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +2 -3
  16. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  17. package/lib/components/EntityManager/Entity/EntityHeader/index.js +2 -3
  18. package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  19. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +20 -26
  20. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
  21. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +20 -17
  22. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  23. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +34 -32
  24. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  25. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +95 -158
  26. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  27. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +23 -30
  28. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  29. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +2 -3
  30. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  31. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -56
  32. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  33. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +29 -45
  34. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  35. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +2 -3
  36. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  37. package/lib/components/EntityManager/Entity/actions-handlers/index.js +7 -8
  38. package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  39. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +2 -3
  40. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  41. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +36 -57
  42. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  43. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +2 -3
  44. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  45. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +47 -66
  46. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  47. package/lib/components/EntityManager/Entity/index.js +2 -3
  48. package/lib/components/EntityManager/Entity/index.js.map +1 -1
  49. package/lib/components/EntityManager/EntityManager.js +91 -166
  50. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  51. package/lib/components/EntityManager/index.js +2 -3
  52. package/lib/components/EntityManager/index.js.map +1 -1
  53. package/lib/components/EntityManager/utils/RecordEditContext/index.js +3 -4
  54. package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
  55. package/lib/components/EntityManager/utils/data-mappers.js +34 -46
  56. package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
  57. package/lib/components/EntityManager/utils/entity.js +35 -80
  58. package/lib/components/EntityManager/utils/entity.js.map +1 -1
  59. package/lib/components/EntityManager/utils/entityAvailableActions.js +51 -110
  60. package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  61. package/lib/components/EntityManager/utils/is-form-empty.js +6 -10
  62. package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
  63. package/lib/components/EntityManager/utils/query.js +17 -10
  64. package/lib/components/EntityManager/utils/query.js.map +1 -1
  65. package/lib/components/InfoBoxes/InfoBoxTooltip.js +19 -16
  66. package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
  67. package/lib/components/InfoBoxes/InfoBoxes.js +19 -19
  68. package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
  69. package/lib/components/InfoBoxes/container/InfoBoxContainer.js +26 -38
  70. package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  71. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +21 -16
  72. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  73. package/lib/components/InfoBoxes/hooks/useData.js +33 -30
  74. package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
  75. package/lib/components/InfoBoxes/hooks/useInfoBox.js +10 -10
  76. package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
  77. package/lib/components/InfoBoxes/index.js +2 -3
  78. package/lib/components/InfoBoxes/index.js.map +1 -1
  79. package/lib/components/InfoBoxes/presentational/InfoBox.js +27 -34
  80. package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  81. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +11 -12
  82. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  83. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +12 -12
  84. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
  85. package/lib/components/ListingTable/ListingTable.js +155 -296
  86. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  87. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +53 -58
  88. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  89. package/lib/components/ListingTable/ListingTableContent/index.js +2 -3
  90. package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
  91. package/lib/components/ListingTable/SearchFilter/SearchContainer.js +159 -257
  92. package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
  93. package/lib/components/ListingTable/SearchFilter/SearchFilter.js +25 -36
  94. package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -1
  95. package/lib/components/ListingTable/SearchFilter/helpers.js +46 -68
  96. package/lib/components/ListingTable/SearchFilter/helpers.js.map +1 -1
  97. package/lib/components/ListingTable/SearchFilter/querys.js +5 -5
  98. package/lib/components/ListingTable/SearchFilter/querys.js.map +1 -1
  99. package/lib/components/ListingTable/TableActions/TableActions.js +27 -31
  100. package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
  101. package/lib/components/ListingTable/TableActions/index.js +2 -3
  102. package/lib/components/ListingTable/TableActions/index.js.map +1 -1
  103. package/lib/components/ListingTable/index.js +2 -3
  104. package/lib/components/ListingTable/index.js.map +1 -1
  105. package/lib/components/ListingTable/mappers/populate-rows.js +103 -122
  106. package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
  107. package/lib/components/ListingTable/service/index.js +66 -83
  108. package/lib/components/ListingTable/service/index.js.map +1 -1
  109. package/lib/components/Tabs/index.js +26 -42
  110. package/lib/components/Tabs/index.js.map +1 -1
  111. package/lib/components/hooks/useCallbackDebounce.js +5 -9
  112. package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
  113. package/lib/constants.js +30 -31
  114. package/lib/constants.js.map +1 -1
  115. package/lib/icons/ContentIcon.js +17 -20
  116. package/lib/icons/ContentIcon.js.map +1 -1
  117. package/lib/icons/SettingsIcon.js +12 -15
  118. package/lib/icons/SettingsIcon.js.map +1 -1
  119. package/lib/icons/TaxonomyIcon.js +15 -18
  120. package/lib/icons/TaxonomyIcon.js.map +1 -1
  121. package/lib/icons/UsersIcon.js +11 -14
  122. package/lib/icons/UsersIcon.js.map +1 -1
  123. package/lib/icons/index.js +8 -9
  124. package/lib/icons/index.js.map +1 -1
  125. package/lib/index.js +81 -121
  126. package/lib/index.js.map +1 -1
  127. package/lib/utils/add-content-menu-items.js +67 -93
  128. package/lib/utils/add-content-menu-items.js.map +1 -1
  129. package/lib/utils/build-create-entity-mutation.js +12 -9
  130. package/lib/utils/build-create-entity-mutation.js.map +1 -1
  131. package/lib/utils/build-delete-entity-mutation.js +11 -8
  132. package/lib/utils/build-delete-entity-mutation.js.map +1 -1
  133. package/lib/utils/build-listing-query.js +17 -14
  134. package/lib/utils/build-listing-query.js.map +1 -1
  135. package/lib/utils/build-update-data-query.js +15 -9
  136. package/lib/utils/build-update-data-query.js.map +1 -1
  137. package/lib/utils/build-update-publish-unpublish-mutation.js +15 -8
  138. package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  139. package/lib/utils/get-default-query-params.js +7 -6
  140. package/lib/utils/get-default-query-params.js.map +1 -1
  141. package/lib/utils/hoc/withContext.js +4 -6
  142. package/lib/utils/hoc/withContext.js.map +1 -1
  143. package/lib/utils/hooks/useToggle.js +4 -12
  144. package/lib/utils/hooks/useToggle.js.map +1 -1
  145. package/lib/utils/index.js +2 -3
  146. package/lib/utils/index.js.map +1 -1
  147. package/lib-es/components/EntityManager/Entity/Entity.js +15 -26
  148. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  149. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  150. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  151. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  152. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  153. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +6 -3
  154. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  155. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  156. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  157. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  158. package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
  159. package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
  160. package/lib-es/components/EntityManager/utils/query.js.map +1 -1
  161. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
  162. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  163. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  164. package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
  165. package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  166. package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  167. package/lib-es/components/ListingTable/ListingTable.js +2 -2
  168. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  169. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +20 -17
  170. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  171. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
  172. package/lib-es/components/ListingTable/SearchFilter/helpers.js.map +1 -1
  173. package/lib-es/components/ListingTable/SearchFilter/querys.js.map +1 -1
  174. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
  175. package/lib-es/components/ListingTable/service/index.js.map +1 -1
  176. package/lib-es/components/Tabs/index.js +6 -7
  177. package/lib-es/components/Tabs/index.js.map +1 -1
  178. package/lib-es/index.js +11 -3
  179. package/lib-es/index.js.map +1 -1
  180. package/lib-es/utils/add-content-menu-items.js.map +1 -1
  181. package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
  182. package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
  183. package/lib-es/utils/build-listing-query.js.map +1 -1
  184. package/lib-es/utils/build-update-data-query.js.map +1 -1
  185. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  186. package/lib-es/utils/hoc/withContext.js +1 -1
  187. package/lib-es/utils/hoc/withContext.js.map +1 -1
  188. package/package.json +27 -22
  189. package/src/components/EntityManager/Entity/Entity.js +63 -81
  190. package/src/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
  191. package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +9 -7
  192. package/src/components/EntityManager/Entity/SideBarRelations/index.js +64 -59
  193. package/src/components/EntityManager/EntityManager.js +52 -45
  194. package/src/components/InfoBoxes/container/InfoBoxContainer.js +3 -6
  195. package/src/components/InfoBoxes/hooks/useData.js +6 -1
  196. package/src/components/ListingTable/ListingTable.js +13 -21
  197. package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +38 -44
  198. package/src/components/ListingTable/SearchFilter/SearchContainer.js +105 -120
  199. package/src/components/ListingTable/service/index.js +2 -3
  200. package/src/components/Tabs/index.js +17 -21
  201. package/src/index.js +9 -7
  202. package/src/utils/hoc/withContext.js +5 -4
  203. package/CHANGELOG.md +0 -1947
  204. package/babel.config.js +0 -3
  205. package/jest.config.js +0 -5
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_v","_client","_adminUiUtils","_reactFormBuilder","_classnames","_versioningUi","_constants","_CustomSidebarInfoContainer","_EntitiyNavLinks","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","SideBarRelations","_ref","schema","onChange","formData","entity","isOpen","onToggle","RelationComponent","formFieldTypes","relation","formattedStatus","formattedUpdated","formattedCreated","formattedPublished","updatedBy","status","client","useApolloClient","_useState","useState","_useState2","_slicedToArray2","relationsComponents","setRelationsComponents","useEffect","_asyncToGenerator2","_regenerator","mark","_callee3","fetchRelationSchema","allRelationComponents","wrap","_callee3$","_context3","prev","next","_ref4","_callee","_ref3","entityIdentifier","_yield$client$query","_yield$client$query$d","relationSchema","_callee$","_context","abrupt","query","getQuery","variables","identifier","sent","data","getEntitySchemas","stop","_x","apply","arguments","Promise","all","relations","filter","_ref5","showInForm","foreignKey","properties","map","_ref6","_callee2","_callee2$","_context2","t0","uuidv1","t1","t2","id","staticData","_x2","itemId","itemEntity","interfaces","statusClassName","classnames","PUBLISHED","UNPUBLISHED","createElement","className","onClick","role","displayProperties","disableDefaultAdminInfo","Fragment","name","VersionsList","_ref7","entitySchema","key","onSelect","propTypes","PropTypes","object","isRequired","func","bool","defaultProps","_default","exports"],"sources":["../../../../../src/components/EntityManager/Entity/SideBarRelations/index.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport uuidv1 from 'uuid/v1';\nimport { useApolloClient } from '@apollo/client';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\nimport { formFieldTypes } from '@blaze-cms/react-form-builder';\nimport classnames from 'classnames';\nimport { VersionsList } from '@blaze-cms/versioning-ui';\nimport { PUBLISHED, UNPUBLISHED } from '../../../../constants';\nimport CustomSidebarInfoContainer from './container/CustomSidebarInfoContainer';\nimport EntityNavLinks from '../EntitiyNavLinks';\n\nconst SideBarRelations = ({ schema, onChange, formData, entity, isOpen, onToggle }) => {\n const { relation: RelationComponent } = formFieldTypes;\n const {\n formattedStatus,\n formattedUpdated,\n formattedCreated,\n formattedPublished,\n updatedBy,\n status\n } = formData;\n const client = useApolloClient();\n\n const [relationsComponents, setRelationsComponents] = useState(null);\n\n useEffect(\n () => {\n (async () => {\n const fetchRelationSchema = async ({ entityIdentifier }) => {\n if (!entityIdentifier) return null;\n\n const {\n data: {\n getEntitySchemas: [relationSchema]\n }\n } = await client.query({\n query: getQuery('GET_ENTITY_SCHEMA'),\n variables: { identifier: entityIdentifier }\n });\n return relationSchema;\n };\n\n if (!relationsComponents && schema) {\n const allRelationComponents = await Promise.all(\n schema.relations\n .filter(({ showInForm, foreignKey }) => showInForm && schema.properties[foreignKey])\n .map(async relation => ({\n id: uuidv1(),\n staticData: relation,\n schema: await fetchRelationSchema(relation)\n }))\n );\n\n setRelationsComponents(allRelationComponents);\n }\n })();\n },\n [client, relationsComponents, schema, schema.relations]\n );\n const { id: itemId } = entity;\n const { identifier: itemEntity, interfaces } = schema;\n\n const statusClassName = classnames('sidebar__status__badge', {\n 'sidebar__status__badge--published': status === PUBLISHED,\n 'sidebar__status__badge--unpublished': status === UNPUBLISHED\n });\n\n return (\n <div\n className={classnames('sidebar', { 'sidebar--collapsed': !isOpen })}\n data-testid=\"sideBarRelations-main-div\">\n <div\n className=\"sidebar__toggle-button\"\n onClick={onToggle}\n role=\"button\"\n aria-label={isOpen ? 'Collapse sidebar' : 'Expand sidebar'}>\n <i className=\"material-icons\">{isOpen ? 'keyboard_arrow_right' : 'keyboard_arrow_left'}</i>\n </div>\n <div className=\"sidebar__content\">\n <div className=\"sidebar__status\">\n {formattedCreated && (\n <div className=\"sidebar__top\">\n <div className=\"sidebar__status__wrapper\">\n <b>Status</b>\n <span className={statusClassName}>{formattedStatus}</span>\n </div>\n {formattedStatus === PUBLISHED && (\n <p>\n {formattedStatus} on: <span> {formattedPublished}</span>\n </p>\n )}\n </div>\n )}\n {!schema.displayProperties.disableDefaultAdminInfo &&\n formattedCreated && (\n <>\n <>\n <p>\n Created: <span>{formattedCreated}</span>\n </p>\n <p>\n Updated: <span>{formattedUpdated}</span>\n </p>\n {updatedBy && (\n <p>\n Updated by: <span>{updatedBy.name}</span>\n </p>\n )}\n </>\n </>\n )}\n\n <CustomSidebarInfoContainer\n id={itemId}\n schema={schema}\n displayProperties={schema.displayProperties}\n />\n </div>\n\n <VersionsList itemEntity={itemEntity} itemId={itemId} interfaces={interfaces} />\n <EntityNavLinks schema={schema} />\n\n {relationsComponents &&\n relationsComponents.map(({ id, staticData, schema: entitySchema }) => (\n <RelationComponent\n formData={formData}\n schema={entitySchema}\n key={id}\n staticData={staticData}\n onSelect={onChange}\n />\n ))}\n </div>\n </div>\n );\n};\n\nSideBarRelations.propTypes = {\n schema: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n formData: PropTypes.object.isRequired,\n entity: PropTypes.object,\n isOpen: PropTypes.bool,\n onToggle: PropTypes.func\n};\nSideBarRelations.defaultProps = {\n entity: {},\n isOpen: true,\n onToggle: () => {}\n};\n\nexport default SideBarRelations;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,EAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,aAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,2BAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,gBAAA,GAAAT,sB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MAAM,CAACC,UAAU;EACnClG,QAAQ,EAAEgG,qBAAS,CAACG,IAAI,CAACD,UAAU;EACnCjG,QAAQ,EAAE+F,qBAAS,CAACC,MAAM,CAACC,UAAU;EACrChG,MAAM,EAAE8F,qBAAS,CAACC,MAAM;EACxB9F,MAAM,EAAE6F,qBAAS,CAACI,IAAI;EACtBhG,QAAQ,EAAE4F,qBAAS,CAACG;AACtB,CAAC;AACDtG,gBAAgB,CAACwG,YAAY,GAAG;EAC9BnG,MAAM,EAAE,CAAC,CAAC;EACVC,MAAM,EAAE,IAAI;EACZC,QAAQ,EAAE,SAAAA,SAAA,EAAM,CAAC;AACnB,CAAC;AAAC,IAAAkG,QAAA,GAAAC,OAAA,cAEa1G,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_v","_accordion","_client","_adminUiUtils","_reactFormBuilder","_classnames","_versioningUi","_constants","_CustomSidebarInfoContainer","_EntitiyNavLinks","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SideBarRelations","schema","onChange","formData","entity","isOpen","onToggle","relation","RelationComponent","formFieldTypes","formattedStatus","formattedUpdated","formattedCreated","formattedPublished","updatedBy","status","client","useApolloClient","relationsComponents","setRelationsComponents","useState","useEffect","fetchRelationSchema","entityIdentifier","data","getEntitySchemas","relationSchema","query","getQuery","variables","identifier","allRelationComponents","Promise","all","relations","filter","showInForm","foreignKey","properties","map","id","uuidv1","staticData","itemId","itemEntity","interfaces","statusClassName","classnames","PUBLISHED","UNPUBLISHED","createElement","className","onClick","role","displayProperties","disableDefaultAdminInfo","Fragment","name","VersionsList","Header","Content","ContentDetails","entitySchema","key","onSelect","propTypes","PropTypes","object","isRequired","func","bool","defaultProps","_default","exports"],"sources":["../../../../../src/components/EntityManager/Entity/SideBarRelations/index.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport uuidv1 from 'uuid/v1';\nimport Accordion from '@blaze-react/accordion';\nimport { useApolloClient } from '@apollo/client';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\nimport { formFieldTypes } from '@blaze-cms/react-form-builder';\nimport classnames from 'classnames';\nimport { VersionsList } from '@blaze-cms/versioning-ui';\nimport { PUBLISHED, UNPUBLISHED } from '../../../../constants';\nimport CustomSidebarInfoContainer from './container/CustomSidebarInfoContainer';\nimport EntityNavLinks from '../EntitiyNavLinks';\n\nconst SideBarRelations = ({ schema, onChange, formData, entity, isOpen, onToggle }) => {\n const { relation: RelationComponent } = formFieldTypes;\n const {\n formattedStatus,\n formattedUpdated,\n formattedCreated,\n formattedPublished,\n updatedBy,\n status\n } = formData;\n const client = useApolloClient();\n\n const [relationsComponents, setRelationsComponents] = useState(null);\n\n useEffect(() => {\n (async () => {\n const fetchRelationSchema = async ({ entityIdentifier }) => {\n if (!entityIdentifier) return null;\n\n const {\n data: {\n getEntitySchemas: [relationSchema]\n }\n } = await client.query({\n query: getQuery('GET_ENTITY_SCHEMA'),\n variables: { identifier: entityIdentifier }\n });\n return relationSchema;\n };\n\n if (!relationsComponents && schema) {\n const allRelationComponents = await Promise.all(\n schema.relations\n .filter(({ showInForm, foreignKey }) => showInForm && schema.properties[foreignKey])\n .map(async relation => ({\n id: uuidv1(),\n staticData: relation,\n schema: await fetchRelationSchema(relation)\n }))\n );\n\n setRelationsComponents(allRelationComponents);\n }\n })();\n }, [client, relationsComponents, schema, schema.relations]);\n const { id: itemId } = entity;\n const { identifier: itemEntity, interfaces } = schema;\n\n const statusClassName = classnames('sidebar__status__badge', {\n 'sidebar__status__badge--published': status === PUBLISHED,\n 'sidebar__status__badge--unpublished': status === UNPUBLISHED\n });\n\n return (\n <div\n className={classnames('sidebar', { 'sidebar--collapsed': !isOpen })}\n data-testid=\"sideBarRelations-main-div\">\n <div\n className=\"sidebar__toggle-button\"\n onClick={onToggle}\n role=\"button\"\n aria-label={isOpen ? 'Collapse sidebar' : 'Expand sidebar'}>\n <i className=\"material-icons\">{isOpen ? 'keyboard_arrow_right' : 'keyboard_arrow_left'}</i>\n </div>\n <div className=\"sidebar__content\">\n <div className=\"sidebar__status\">\n {formattedCreated && (\n <div className=\"sidebar__top\">\n <div className=\"sidebar__status__wrapper\">\n <b>Status</b>\n <span className={statusClassName}>{formattedStatus}</span>\n </div>\n {formattedStatus === PUBLISHED && (\n <p>\n {formattedStatus} on: <span> {formattedPublished}</span>\n </p>\n )}\n </div>\n )}\n {!schema.displayProperties.disableDefaultAdminInfo && formattedCreated && (\n <>\n <p>\n Created: <span>{formattedCreated}</span>\n </p>\n <p>\n Updated: <span>{formattedUpdated}</span>\n </p>\n {updatedBy && (\n <p>\n Updated by: <span>{updatedBy.name}</span>\n </p>\n )}\n </>\n )}\n\n <CustomSidebarInfoContainer\n id={itemId}\n schema={schema}\n displayProperties={schema.displayProperties}\n />\n </div>\n\n <VersionsList itemEntity={itemEntity} itemId={itemId} interfaces={interfaces} />\n <EntityNavLinks schema={schema} />\n\n {relationsComponents && (\n <Accordion isOpen>\n <Accordion.Header>\n <b>Classification</b>\n </Accordion.Header>\n <Accordion.Content>\n <Accordion.ContentDetails>\n {relationsComponents.map(({ id, staticData, schema: entitySchema }) => (\n <RelationComponent\n formData={formData}\n schema={entitySchema}\n key={id}\n staticData={staticData}\n onSelect={onChange}\n />\n ))}\n </Accordion.ContentDetails>\n </Accordion.Content>\n </Accordion>\n )}\n </div>\n </div>\n );\n};\n\nSideBarRelations.propTypes = {\n schema: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n formData: PropTypes.object.isRequired,\n entity: PropTypes.object,\n isOpen: PropTypes.bool,\n onToggle: PropTypes.func\n};\nSideBarRelations.defaultProps = {\n entity: {},\n isOpen: true,\n onToggle: () => {}\n};\n\nexport default SideBarRelations;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA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U;EACnClE,QAAQ,EAAEgE,kBAAS,CAACG,IAAI,CAACD,UAAU;EACnCjE,QAAQ,EAAE+D,kBAAS,CAACC,MAAM,CAACC,UAAU;EACrChE,MAAM,EAAE8D,kBAAS,CAACC,MAAM;EACxB9D,MAAM,EAAE6D,kBAAS,CAACI,IAAI;EACtBhE,QAAQ,EAAE4D,kBAAS,CAACG;AACtB,CAAC;AACDrE,gBAAgB,CAACuE,YAAY,GAAG;EAC9BnE,MAAM,EAAE,CAAC,CAAC;EACVC,MAAM,EAAE,IAAI;EACZC,QAAQ,EAAEA,CAAA,KAAM,CAAC;AACnB,CAAC;AAAC,IAAAkE,QAAA,GAAAC,OAAA,CAAAlF,OAAA,GAEaS,gBAAgB","ignoreList":[]}
@@ -1,50 +1,43 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports["default"] = void 0;
9
- require("core-js/modules/es.array.concat.js");
10
- require("core-js/modules/es.array.filter.js");
11
- require("core-js/modules/es.array.map.js");
12
- require("core-js/modules/es.object.to-string.js");
13
- require("core-js/modules/es.object.values.js");
7
+ exports.default = void 0;
14
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
9
  var _react = _interopRequireDefault(require("react"));
16
10
  var _InfoBoxValue = _interopRequireDefault(require("../../../../InfoBoxes/presentational/InfoBoxValue"));
17
11
  var _InfoBoxLabel = _interopRequireDefault(require("../../../../InfoBoxes/presentational/InfoBoxLabel"));
18
12
  var _InfoBoxTooltip = _interopRequireDefault(require("../../../../InfoBoxes/InfoBoxTooltip"));
19
- var CustomSidebarInfo = function CustomSidebarInfo(_ref) {
20
- var items = _ref.items,
21
- customSidebarInfoKey = _ref.customSidebarInfoKey;
13
+ const CustomSidebarInfo = ({
14
+ items,
15
+ customSidebarInfoKey
16
+ }) => {
22
17
  if (!items) return null;
23
- var customSidebarInfoItems = items.map(function (item) {
24
- return Object.values(item).map(function (info) {
25
- if (!info.label || !info.value) return null;
26
- return /*#__PURE__*/_react["default"].createElement("p", {
27
- key: "".concat(customSidebarInfoKey, "-").concat(info.label.toLowerCase())
28
- }, /*#__PURE__*/_react["default"].createElement(_InfoBoxLabel["default"], {
29
- item: info
30
- }), /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement(_InfoBoxValue["default"], {
31
- item: info
32
- }), /*#__PURE__*/_react["default"].createElement(_InfoBoxTooltip["default"], {
33
- info: info,
34
- position: "left"
35
- })));
36
- }).filter(Boolean);
37
- });
38
- return /*#__PURE__*/_react["default"].createElement("div", {
18
+ const customSidebarInfoItems = items.map(item => Object.values(item).map(info => {
19
+ if (!info.label || !info.value) return null;
20
+ return /*#__PURE__*/_react.default.createElement("p", {
21
+ key: `${customSidebarInfoKey}-${info.label.toLowerCase()}`
22
+ }, /*#__PURE__*/_react.default.createElement(_InfoBoxLabel.default, {
23
+ item: info
24
+ }), /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_InfoBoxValue.default, {
25
+ item: info
26
+ }), /*#__PURE__*/_react.default.createElement(_InfoBoxTooltip.default, {
27
+ info: info,
28
+ position: "left"
29
+ })));
30
+ }).filter(Boolean));
31
+ return /*#__PURE__*/_react.default.createElement("div", {
39
32
  className: "custom-sidebar-info",
40
33
  key: customSidebarInfoKey
41
- }, /*#__PURE__*/_react["default"].createElement("div", {
34
+ }, /*#__PURE__*/_react.default.createElement("div", {
42
35
  className: "custom-sidebar-info--container"
43
36
  }, customSidebarInfoItems));
44
37
  };
45
38
  CustomSidebarInfo.propTypes = {
46
- customSidebarInfoKey: _propTypes["default"].string.isRequired,
47
- items: _propTypes["default"].array.isRequired
39
+ customSidebarInfoKey: _propTypes.default.string.isRequired,
40
+ items: _propTypes.default.array.isRequired
48
41
  };
49
- var _default = exports["default"] = CustomSidebarInfo;
42
+ var _default = exports.default = CustomSidebarInfo;
50
43
  //# sourceMappingURL=CustomSidebarInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomSidebarInfo.js","names":["_propTypes","_interopRequireDefault","require","_react","_InfoBoxValue","_InfoBoxLabel","_InfoBoxTooltip","CustomSidebarInfo","_ref","items","customSidebarInfoKey","customSidebarInfoItems","map","item","Object","values","info","label","value","createElement","key","concat","toLowerCase","position","filter","Boolean","className","propTypes","PropTypes","string","isRequired","array","_default","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport InfoBoxValue from '../../../../InfoBoxes/presentational/InfoBoxValue';\nimport InfoBoxLabel from '../../../../InfoBoxes/presentational/InfoBoxLabel';\nimport InfoBoxTooltip from '../../../../InfoBoxes/InfoBoxTooltip';\n\nconst CustomSidebarInfo = ({ items, customSidebarInfoKey }) => {\n if (!items) return null;\n\n const customSidebarInfoItems = items.map(item =>\n Object.values(item)\n .map(info => {\n if (!info.label || !info.value) return null;\n\n return (\n <p key={`${customSidebarInfoKey}-${info.label.toLowerCase()}`}>\n <InfoBoxLabel item={info} />\n <span>\n <InfoBoxValue item={info} />\n <InfoBoxTooltip info={info} position=\"left\" />\n </span>\n </p>\n );\n })\n .filter(Boolean)\n );\n\n return (\n <div className=\"custom-sidebar-info\" key={customSidebarInfoKey}>\n <div className=\"custom-sidebar-info--container\">{customSidebarInfoItems}</div>\n </div>\n );\n};\n\nCustomSidebarInfo.propTypes = {\n customSidebarInfoKey: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired\n};\n\nexport default CustomSidebarInfo;\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,aAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,aAAA,GAAAJ,sBAAA,CAAA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,SAAS,GAAG;EAC5BjB,oBAAoB,EAAEkB,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjDrB,KAAK,EAAEmB,qBAAS,CAACG,KAAK,CAACD;AACzB,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,cAEa1B,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"CustomSidebarInfo.js","names":["_propTypes","_interopRequireDefault","require","_react","_InfoBoxValue","_InfoBoxLabel","_InfoBoxTooltip","CustomSidebarInfo","items","customSidebarInfoKey","customSidebarInfoItems","map","item","Object","values","info","label","value","default","createElement","key","toLowerCase","position","filter","Boolean","className","propTypes","PropTypes","string","isRequired","array","_default","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport InfoBoxValue from '../../../../InfoBoxes/presentational/InfoBoxValue';\nimport InfoBoxLabel from '../../../../InfoBoxes/presentational/InfoBoxLabel';\nimport InfoBoxTooltip from '../../../../InfoBoxes/InfoBoxTooltip';\n\nconst CustomSidebarInfo = ({ items, customSidebarInfoKey }) => {\n if (!items) return null;\n\n const customSidebarInfoItems = items.map(item =>\n Object.values(item)\n .map(info => {\n if (!info.label || !info.value) return null;\n\n return (\n <p key={`${customSidebarInfoKey}-${info.label.toLowerCase()}`}>\n <InfoBoxLabel item={info} />\n <span>\n <InfoBoxValue item={info} />\n <InfoBoxTooltip info={info} position=\"left\" />\n </span>\n </p>\n );\n })\n .filter(Boolean)\n );\n\n return (\n <div className=\"custom-sidebar-info\" key={customSidebarInfoKey}>\n <div className=\"custom-sidebar-info--container\">{customSidebarInfoItems}</div>\n </div>\n );\n};\n\nCustomSidebarInfo.propTypes = {\n customSidebarInfoKey: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired\n};\n\nexport default CustomSidebarInfo;\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,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AAKM,SAAS,EAAC;EAAgC,GAAEf,sBAA4B,CAC1E,CAAC;AAEV,CAAC;AAEDH,iBAAiB,CAACmB,SAAS,GAAG;EAC5BjB,oBAAoB,EAAEkB,kBAAS,CAACC,MAAM,CAACC,UAAU;EACjDrB,KAAK,EAAEmB,kBAAS,CAACG,KAAK,CAACD;AACzB,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAd,OAAA,GAEaX,iBAAiB","ignoreList":[]}
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
- exports["default"] = void 0;
6
+ exports.default = void 0;
8
7
  var _submit = require("./submit");
9
- var _default = exports["default"] = {
8
+ var _default = exports.default = {
10
9
  submit: _submit.submit
11
10
  };
12
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_submit","require","_default","exports","submit"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/create/index.js"],"sourcesContent":["import { submit } from './submit';\n\nexport default {\n submit\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAkC,IAAAC,QAAA,GAAAC,OAAA,cAEnB;EACbC,MAAM,EAANA;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_submit","require","_default","exports","default","submit"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/create/index.js"],"sourcesContent":["import { submit } from './submit';\n\nexport default {\n submit\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAkC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEnB;EACbC,MAAM,EAANA;AACF,CAAC","ignoreList":[]}
@@ -1,67 +1,53 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.submit = void 0;
9
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
- require("core-js/modules/es.array.concat.js");
11
- require("core-js/modules/es.regexp.exec.js");
12
- require("core-js/modules/es.string.replace.js");
13
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
14
8
  var _buildCreateEntityMutation = _interopRequireDefault(require("../../../../../utils/build-create-entity-mutation"));
15
9
  var _constants = require("../../../../../constants");
16
- var submit = exports.submit = /*#__PURE__*/function () {
17
- var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref, addToast) {
18
- var entitySchema, parsedFormValues, client, setEntityData, setIsSaveButtonAvailable, setSaveButtonText, history, setIsNewEntity, mutation, _yield$client$mutate, createdEntityResult, updatePathname;
19
- return _regenerator["default"].wrap(function _callee$(_context) {
20
- while (1) switch (_context.prev = _context.next) {
21
- case 0:
22
- entitySchema = _ref.entitySchema, parsedFormValues = _ref.parsedFormValues, client = _ref.client, setEntityData = _ref.setEntityData, setIsSaveButtonAvailable = _ref.setIsSaveButtonAvailable, setSaveButtonText = _ref.setSaveButtonText, history = _ref.history, setIsNewEntity = _ref.setIsNewEntity;
23
- mutation = (0, _buildCreateEntityMutation["default"])(entitySchema);
24
- _context.prev = 2;
25
- setIsSaveButtonAvailable(false);
26
- setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saving);
27
- _context.next = 7;
28
- return client.mutate({
29
- mutation: mutation,
30
- variables: {
31
- input: parsedFormValues
32
- }
33
- });
34
- case 7:
35
- _yield$client$mutate = _context.sent;
36
- createdEntityResult = _yield$client$mutate.data.createdEntity;
37
- setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saved);
38
- setEntityData(createdEntityResult.result);
39
- setIsNewEntity(false);
40
- updatePathname = history.location.pathname.replace('create', 'update');
41
- history.push("".concat(updatePathname, "/").concat(createdEntityResult.result.id));
42
- addToast("Created", {
43
- appearance: 'success',
44
- autoDismiss: true
45
- });
46
- _context.next = 22;
47
- break;
48
- case 17:
49
- _context.prev = 17;
50
- _context.t0 = _context["catch"](2);
51
- setIsSaveButtonAvailable(true);
52
- setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.save);
53
- addToast(_context.t0.message, {
54
- appearance: 'error',
55
- autoDismiss: true
56
- });
57
- case 22:
58
- case "end":
59
- return _context.stop();
10
+ const submit = async ({
11
+ entitySchema,
12
+ parsedFormValues,
13
+ client,
14
+ setEntityData,
15
+ setIsSaveButtonAvailable,
16
+ setSaveButtonText,
17
+ history,
18
+ setIsNewEntity
19
+ }, addToast) => {
20
+ const mutation = (0, _buildCreateEntityMutation.default)(entitySchema);
21
+ try {
22
+ setIsSaveButtonAvailable(false);
23
+ setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saving);
24
+ const {
25
+ data: {
26
+ createdEntity: createdEntityResult
60
27
  }
61
- }, _callee, null, [[2, 17]]);
62
- }));
63
- return function submit(_x, _x2) {
64
- return _ref2.apply(this, arguments);
65
- };
66
- }();
28
+ } = await client.mutate({
29
+ mutation,
30
+ variables: {
31
+ input: parsedFormValues
32
+ }
33
+ });
34
+ setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saved);
35
+ setEntityData(createdEntityResult.result);
36
+ setIsNewEntity(false);
37
+ const updatePathname = history.location.pathname.replace('create', 'update');
38
+ history.push(`${updatePathname}/${createdEntityResult.result.id}`);
39
+ addToast(`Created`, {
40
+ appearance: 'success',
41
+ autoDismiss: true
42
+ });
43
+ } catch (error) {
44
+ setIsSaveButtonAvailable(true);
45
+ setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.save);
46
+ addToast(error.message, {
47
+ appearance: 'error',
48
+ autoDismiss: true
49
+ });
50
+ }
51
+ };
52
+ exports.submit = submit;
67
53
  //# sourceMappingURL=submit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"submit.js","names":["_buildCreateEntityMutation","_interopRequireDefault","require","_constants","submit","exports","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","_ref","addToast","entitySchema","parsedFormValues","client","setEntityData","setIsSaveButtonAvailable","setSaveButtonText","history","setIsNewEntity","mutation","_yield$client$mutate","createdEntityResult","updatePathname","wrap","_callee$","_context","prev","next","buildCreateEntityMutation","SAVE_BUTTON_TEXTS","saving","mutate","variables","input","sent","data","createdEntity","saved","result","location","pathname","replace","push","concat","id","appearance","autoDismiss","t0","save","message","stop","_x","_x2","apply","arguments"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/create/submit.js"],"sourcesContent":["import buildCreateEntityMutation from '../../../../../utils/build-create-entity-mutation';\nimport { SAVE_BUTTON_TEXTS } from '../../../../../constants';\n\nconst submit = async (\n {\n entitySchema,\n parsedFormValues,\n client,\n setEntityData,\n setIsSaveButtonAvailable,\n setSaveButtonText,\n history,\n setIsNewEntity\n },\n addToast\n) => {\n const mutation = buildCreateEntityMutation(entitySchema);\n\n try {\n setIsSaveButtonAvailable(false);\n setSaveButtonText(SAVE_BUTTON_TEXTS.saving);\n const {\n data: { createdEntity: createdEntityResult }\n } = await client.mutate({\n mutation,\n variables: { input: parsedFormValues }\n });\n\n setSaveButtonText(SAVE_BUTTON_TEXTS.saved);\n setEntityData(createdEntityResult.result);\n setIsNewEntity(false);\n\n const updatePathname = history.location.pathname.replace('create', 'update');\n history.push(`${updatePathname}/${createdEntityResult.result.id}`);\n addToast(`Created`, {\n appearance: 'success',\n autoDismiss: true\n });\n } catch (error) {\n setIsSaveButtonAvailable(true);\n setSaveButtonText(SAVE_BUTTON_TEXTS.save);\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n }\n};\n\nexport { submit };\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,0BAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAME,MAAM,GAAAC,OAAA,CAAAD,MAAA;EAAA,IAAAE,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B,MAAM,CAAC;UACzCpB,cAAc,CAAC,KAAK,CAAC;UAEfI,cAAc,GAAGL,OAAO,CAACsB,QAAQ,CAACC,QAAQ,CAACC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC;UAC5ExB,OAAO,CAACyB,IAAI,IAAAC,MAAA,CAAIrB,cAAc,OAAAqB,MAAA,CAAItB,mBAAmB,CAACiB,MAAM,CAACM,EAAE,CAAE,CAAC;UAClElC,QAAQ,YAAY;YAClBmC,UAAU,EAAE,SAAS;YACrBC,WAAW,EAAE;UACf,CAAC,CAAC;UAACrB,QAAA,CAAAE,IAAA;UAAA;QAAA;UAAAF,QAAA,CAAAC,IAAA;UAAAD,QAAA,CAAAsB,EAAA,GAAAtB,QAAA;UAEHV,wBAAwB,CAAC,IAAI,CAAC;UAC9BC,iBAAiB,CAACa,4BAAiB,CAACmB,IAAI,CAAC;UACzCtC,QAAQ,CAACe,QAAA,CAAAsB,EAAA,CAAME,OAAO,EAAE;YACtBJ,UAAU,EAAE,OAAO;YACnBC,WAAW,EAAE;UACf,CAAC,CAAC;QAAC;QAAA;UAAA,OAAArB,QAAA,CAAAyB,IAAA;MAAA;IAAA,GAAA1C,OAAA;EAAA,CAEN;EAAA,gBA3CKN,MAAMA,CAAAiD,EAAA,EAAAC,GAAA;IAAA,OAAAhD,KAAA,CAAAiD,KAAA,OAAAC,SAAA;EAAA;AAAA,GA2CX","ignoreList":[]}
1
+ {"version":3,"file":"submit.js","names":["_buildCreateEntityMutation","_interopRequireDefault","require","_constants","submit","entitySchema","parsedFormValues","client","setEntityData","setIsSaveButtonAvailable","setSaveButtonText","history","setIsNewEntity","addToast","mutation","buildCreateEntityMutation","SAVE_BUTTON_TEXTS","saving","data","createdEntity","createdEntityResult","mutate","variables","input","saved","result","updatePathname","location","pathname","replace","push","id","appearance","autoDismiss","error","save","message","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/create/submit.js"],"sourcesContent":["import buildCreateEntityMutation from '../../../../../utils/build-create-entity-mutation';\nimport { SAVE_BUTTON_TEXTS } from '../../../../../constants';\n\nconst submit = async (\n {\n entitySchema,\n parsedFormValues,\n client,\n setEntityData,\n setIsSaveButtonAvailable,\n setSaveButtonText,\n history,\n setIsNewEntity\n },\n addToast\n) => {\n const mutation = buildCreateEntityMutation(entitySchema);\n\n try {\n setIsSaveButtonAvailable(false);\n setSaveButtonText(SAVE_BUTTON_TEXTS.saving);\n const {\n data: { createdEntity: createdEntityResult }\n } = await client.mutate({\n mutation,\n variables: { input: parsedFormValues }\n });\n\n setSaveButtonText(SAVE_BUTTON_TEXTS.saved);\n setEntityData(createdEntityResult.result);\n setIsNewEntity(false);\n\n const updatePathname = history.location.pathname.replace('create', 'update');\n history.push(`${updatePathname}/${createdEntityResult.result.id}`);\n addToast(`Created`, {\n appearance: 'success',\n autoDismiss: true\n });\n } catch (error) {\n setIsSaveButtonAvailable(true);\n setSaveButtonText(SAVE_BUTTON_TEXTS.save);\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n }\n};\n\nexport { submit };\n"],"mappings":";;;;;;;AAAA,IAAAA,0BAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,MAAME,MAAM,GAAG,MAAAA,CACb;EACEC,YAAY;EACZC,gBAAgB;EAChBC,MAAM;EACNC,aAAa;EACbC,wBAAwB;EACxBC,iBAAiB;EACjBC,OAAO;EACPC;AACF,CAAC,EACDC,QAAQ,KACL;EACH,MAAMC,QAAQ,GAAG,IAAAC,kCAAyB,EAACV,YAAY,CAAC;EAExD,IAAI;IACFI,wBAAwB,CAAC,KAAK,CAAC;IAC/BC,iBAAiB,CAACM,4BAAiB,CAACC,MAAM,CAAC;IAC3C,MAAM;MACJC,IAAI,EAAE;QAAEC,aAAa,EAAEC;MAAoB;IAC7C,CAAC,GAAG,MAAMb,MAAM,CAACc,MAAM,CAAC;MACtBP,QAAQ;MACRQ,SAAS,EAAE;QAAEC,KAAK,EAAEjB;MAAiB;IACvC,CAAC,CAAC;IAEFI,iBAAiB,CAACM,4BAAiB,CAACQ,KAAK,CAAC;IAC1ChB,aAAa,CAACY,mBAAmB,CAACK,MAAM,CAAC;IACzCb,cAAc,CAAC,KAAK,CAAC;IAErB,MAAMc,cAAc,GAAGf,OAAO,CAACgB,QAAQ,CAACC,QAAQ,CAACC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5ElB,OAAO,CAACmB,IAAI,CAAC,GAAGJ,cAAc,IAAIN,mBAAmB,CAACK,MAAM,CAACM,EAAE,EAAE,CAAC;IAClElB,QAAQ,CAAC,SAAS,EAAE;MAClBmB,UAAU,EAAE,SAAS;MACrBC,WAAW,EAAE;IACf,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdzB,wBAAwB,CAAC,IAAI,CAAC;IAC9BC,iBAAiB,CAACM,4BAAiB,CAACmB,IAAI,CAAC;IACzCtB,QAAQ,CAACqB,KAAK,CAACE,OAAO,EAAE;MACtBJ,UAAU,EAAE,OAAO;MACnBC,WAAW,EAAE;IACf,CAAC,CAAC;EACJ;AACF,CAAC;AAACI,OAAA,CAAAjC,MAAA,GAAAA,MAAA","ignoreList":[]}
@@ -1,55 +1,39 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.submit = void 0;
9
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
8
  var _buildDeleteEntityMutation = _interopRequireDefault(require("../../../../../utils/build-delete-entity-mutation"));
12
- var submit = exports.submit = /*#__PURE__*/function () {
13
- var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref, addToast) {
14
- var entitySchema, parsedFormValues, client, mutation, id;
15
- return _regenerator["default"].wrap(function _callee$(_context) {
16
- while (1) switch (_context.prev = _context.next) {
17
- case 0:
18
- entitySchema = _ref.entitySchema, parsedFormValues = _ref.parsedFormValues, client = _ref.client;
19
- mutation = (0, _buildDeleteEntityMutation["default"])(entitySchema);
20
- id = parsedFormValues.id;
21
- _context.prev = 3;
22
- _context.next = 6;
23
- return client.mutate({
24
- mutation: mutation,
25
- variables: {
26
- input: {
27
- id: id
28
- }
29
- }
30
- });
31
- case 6:
32
- addToast('Deleted', {
33
- appearance: 'success',
34
- autoDismiss: true
35
- });
36
- _context.next = 12;
37
- break;
38
- case 9:
39
- _context.prev = 9;
40
- _context.t0 = _context["catch"](3);
41
- addToast(_context.t0.message, {
42
- appearance: 'error',
43
- autoDismiss: true
44
- });
45
- case 12:
46
- case "end":
47
- return _context.stop();
9
+ const submit = async ({
10
+ entitySchema,
11
+ parsedFormValues,
12
+ client
13
+ }, addToast) => {
14
+ const mutation = (0, _buildDeleteEntityMutation.default)(entitySchema);
15
+ const {
16
+ id
17
+ } = parsedFormValues;
18
+ try {
19
+ await client.mutate({
20
+ mutation,
21
+ variables: {
22
+ input: {
23
+ id
24
+ }
48
25
  }
49
- }, _callee, null, [[3, 9]]);
50
- }));
51
- return function submit(_x, _x2) {
52
- return _ref2.apply(this, arguments);
53
- };
54
- }();
26
+ });
27
+ addToast('Deleted', {
28
+ appearance: 'success',
29
+ autoDismiss: true
30
+ });
31
+ } catch (error) {
32
+ addToast(error.message, {
33
+ appearance: 'error',
34
+ autoDismiss: true
35
+ });
36
+ }
37
+ };
38
+ exports.submit = submit;
55
39
  //# sourceMappingURL=delete.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"delete.js","names":["_buildDeleteEntityMutation","_interopRequireDefault","require","submit","exports","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","_ref","addToast","entitySchema","parsedFormValues","client","mutation","id","wrap","_callee$","_context","prev","next","buildDeleteEntityMutation","mutate","variables","input","appearance","autoDismiss","t0","message","stop","_x","_x2","apply","arguments"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/delete/delete.js"],"sourcesContent":["import buildDeleteEntityMutation from '../../../../../utils/build-delete-entity-mutation';\n\nconst submit = async ({ entitySchema, parsedFormValues, client }, addToast) => {\n const mutation = buildDeleteEntityMutation(entitySchema);\n const { id } = parsedFormValues;\n\n try {\n await client.mutate({\n mutation,\n variables: { input: { id } }\n });\n addToast('Deleted', {\n appearance: 'success',\n autoDismiss: true\n });\n } catch (error) {\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n }\n};\n\nexport { submit };\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,0BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAMC,MAAM,GAAAC,OAAA,CAAAD,MAAA;EAAA,IAAAE,KAAA,OAAAC,kBAAA,2BAAAC,YAAA,YAAAC,IAAA,CAAG,SAAAC,QAAAC,IAAA,EAAmDC,QAAQ;IAAA,IAAAC,YAAA,EAAAC,gBAAA,EAAAC,MAAA,EAAAC,QAAA,EAAAC,EAAA;IAAA,OAAAT,YAAA,YAAAU,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAAlDT,YAAY,GAAAF,IAAA,CAAZE,YAAY,EAAEC,gBAAgB,GAAAH,IAAA,CAAhBG,gBAAgB,EAAEC,MAAM,GAAAJ,IAAA,CAANI,MAAM;UACtDC,QAAQ,GAAG,IAAAO,qCAAyB,EAACV,YAAY,CAAC;UAChDI,EAAE,GAAKH,gBAAgB,CAAvBG,EAAE;UAAAG,QAAA,CAAAC,IAAA;UAAAD,QAAA,CAAAE,IAAA;UAAA,OAGFP,MAAM,CAACS,MAAM,CAAC;YAClBR,QAAQ,EAARA,QAAQ;YACRS,SAAS,EAAE;cAAEC,KAAK,EAAE;gBAAET,EAAE,EAAFA;cAAG;YAAE;UAC7B,CAAC,CAAC;QAAA;UACFL,QAAQ,CAAC,SAAS,EAAE;YAClBe,UAAU,EAAE,SAAS;YACrBC,WAAW,EAAE;UACf,CAAC,CAAC;UAACR,QAAA,CAAAE,IAAA;UAAA;QAAA;UAAAF,QAAA,CAAAC,IAAA;UAAAD,QAAA,CAAAS,EAAA,GAAAT,QAAA;UAEHR,QAAQ,CAACQ,QAAA,CAAAS,EAAA,CAAMC,OAAO,EAAE;YACtBH,UAAU,EAAE,OAAO;YACnBC,WAAW,EAAE;UACf,CAAC,CAAC;QAAC;QAAA;UAAA,OAAAR,QAAA,CAAAW,IAAA;MAAA;IAAA,GAAArB,OAAA;EAAA,CAEN;EAAA,gBAnBKN,MAAMA,CAAA4B,EAAA,EAAAC,GAAA;IAAA,OAAA3B,KAAA,CAAA4B,KAAA,OAAAC,SAAA;EAAA;AAAA,GAmBX","ignoreList":[]}
1
+ {"version":3,"file":"delete.js","names":["_buildDeleteEntityMutation","_interopRequireDefault","require","submit","entitySchema","parsedFormValues","client","addToast","mutation","buildDeleteEntityMutation","id","mutate","variables","input","appearance","autoDismiss","error","message","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/delete/delete.js"],"sourcesContent":["import buildDeleteEntityMutation from '../../../../../utils/build-delete-entity-mutation';\n\nconst submit = async ({ entitySchema, parsedFormValues, client }, addToast) => {\n const mutation = buildDeleteEntityMutation(entitySchema);\n const { id } = parsedFormValues;\n\n try {\n await client.mutate({\n mutation,\n variables: { input: { id } }\n });\n addToast('Deleted', {\n appearance: 'success',\n autoDismiss: true\n });\n } catch (error) {\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n }\n};\n\nexport { submit };\n"],"mappings":";;;;;;;AAAA,IAAAA,0BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,MAAMC,MAAM,GAAG,MAAAA,CAAO;EAAEC,YAAY;EAAEC,gBAAgB;EAAEC;AAAO,CAAC,EAAEC,QAAQ,KAAK;EAC7E,MAAMC,QAAQ,GAAG,IAAAC,kCAAyB,EAACL,YAAY,CAAC;EACxD,MAAM;IAAEM;EAAG,CAAC,GAAGL,gBAAgB;EAE/B,IAAI;IACF,MAAMC,MAAM,CAACK,MAAM,CAAC;MAClBH,QAAQ;MACRI,SAAS,EAAE;QAAEC,KAAK,EAAE;UAAEH;QAAG;MAAE;IAC7B,CAAC,CAAC;IACFH,QAAQ,CAAC,SAAS,EAAE;MAClBO,UAAU,EAAE,SAAS;MACrBC,WAAW,EAAE;IACf,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdT,QAAQ,CAACS,KAAK,CAACC,OAAO,EAAE;MACtBH,UAAU,EAAE,OAAO;MACnBC,WAAW,EAAE;IACf,CAAC,CAAC;EACJ;AACF,CAAC;AAACG,OAAA,CAAAf,MAAA,GAAAA,MAAA","ignoreList":[]}
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
- exports["default"] = void 0;
6
+ exports.default = void 0;
8
7
  var _delete = require("./delete");
9
- var _default = exports["default"] = {
8
+ var _default = exports.default = {
10
9
  submit: _delete.submit
11
10
  };
12
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_delete","require","_default","exports","submit"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/delete/index.js"],"sourcesContent":["import { submit } from './delete';\n\nexport default { submit };\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAkC,IAAAC,QAAA,GAAAC,OAAA,cAEnB;EAAEC,MAAM,EAANA;AAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_delete","require","_default","exports","default","submit"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/delete/index.js"],"sourcesContent":["import { submit } from './delete';\n\nexport default { submit };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAkC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEnB;EAAEC,MAAM,EAANA;AAAO,CAAC","ignoreList":[]}
@@ -1,20 +1,19 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports["default"] = void 0;
7
+ exports.default = void 0;
9
8
  var _create = _interopRequireDefault(require("./create"));
10
9
  var _update = _interopRequireDefault(require("./update"));
11
10
  var _shared = _interopRequireDefault(require("./shared"));
12
11
  var _delete = _interopRequireDefault(require("./delete"));
13
- var availableActions = {
14
- create: _create["default"],
15
- update: _update["default"],
16
- shared: _shared["default"],
17
- "delete": _delete["default"]
12
+ const availableActions = {
13
+ create: _create.default,
14
+ update: _update.default,
15
+ shared: _shared.default,
16
+ delete: _delete.default
18
17
  };
19
- var _default = exports["default"] = availableActions;
18
+ var _default = exports.default = availableActions;
20
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_create","_interopRequireDefault","require","_update","_shared","_delete","availableActions","create","createActions","update","updateActions","shared","sharedActions","deleteActions","_default","exports"],"sources":["../../../../../src/components/EntityManager/Entity/actions-handlers/index.js"],"sourcesContent":["import createActions from './create';\nimport updateActions from './update';\nimport sharedActions from './shared';\nimport deleteActions from './delete';\n\nconst availableActions = {\n create: createActions,\n update: updateActions,\n shared: sharedActions,\n delete: deleteActions\n};\n\nexport default availableActions;\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAMI,gBAAgB,GAAG;EACvBC,MAAM,EAAEC,kBAAa;EACrBC,MAAM,EAAEC,kBAAa;EACrBC,MAAM,EAAEC,kBAAa;EACrB,UAAQC;AACV,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEaT,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_create","_interopRequireDefault","require","_update","_shared","_delete","availableActions","create","createActions","update","updateActions","shared","sharedActions","delete","deleteActions","_default","exports","default"],"sources":["../../../../../src/components/EntityManager/Entity/actions-handlers/index.js"],"sourcesContent":["import createActions from './create';\nimport updateActions from './update';\nimport sharedActions from './shared';\nimport deleteActions from './delete';\n\nconst availableActions = {\n create: createActions,\n update: updateActions,\n shared: sharedActions,\n delete: deleteActions\n};\n\nexport default availableActions;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,MAAMI,gBAAgB,GAAG;EACvBC,MAAM,EAAEC,eAAa;EACrBC,MAAM,EAAEC,eAAa;EACrBC,MAAM,EAAEC,eAAa;EACrBC,MAAM,EAAEC;AACV,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaX,gBAAgB","ignoreList":[]}
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
- exports["default"] = void 0;
6
+ exports.default = void 0;
8
7
  var _publish = require("./publish");
9
- var _default = exports["default"] = {
8
+ var _default = exports.default = {
10
9
  triggerPublish: _publish.triggerPublish
11
10
  };
12
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_publish","require","_default","exports","triggerPublish"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/shared/index.js"],"sourcesContent":["import { triggerPublish } from './publish';\n\nexport default { triggerPublish };\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAA2C,IAAAC,QAAA,GAAAC,OAAA,cAE5B;EAAEC,cAAc,EAAdA;AAAe,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_publish","require","_default","exports","default","triggerPublish"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/shared/index.js"],"sourcesContent":["import { triggerPublish } from './publish';\n\nexport default { triggerPublish };\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAA2C,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE5B;EAAEC,cAAc,EAAdA;AAAe,CAAC","ignoreList":[]}
@@ -1,66 +1,45 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.triggerPublish = void 0;
9
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
- require("core-js/modules/es.object.keys.js");
11
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
7
  var _utils = require("../../../../../utils");
13
8
  var _constants = require("../../../../../constants");
14
- var triggerPublish = exports.triggerPublish = /*#__PURE__*/function () {
15
- var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref, addToast) {
16
- var entityData, client, setEntityIsPublish, entitySchema, _ref$textContent, textContent, refetchRecord, actionType, entityIsPublishedSwitch, mutation;
17
- return _regenerator["default"].wrap(function _callee$(_context) {
18
- while (1) switch (_context.prev = _context.next) {
19
- case 0:
20
- entityData = _ref.entityData, client = _ref.client, setEntityIsPublish = _ref.setEntityIsPublish, entitySchema = _ref.entitySchema, _ref$textContent = _ref.textContent, textContent = _ref$textContent === void 0 ? '' : _ref$textContent, refetchRecord = _ref.refetchRecord;
21
- if (Object.keys(entityData).length) {
22
- _context.next = 4;
23
- break;
24
- }
25
- addToast(_constants.SAVE_BEFORE_PUBLISH_MESSAGE, {
26
- appearance: 'info',
27
- autoDismiss: true
28
- });
29
- return _context.abrupt("return");
30
- case 4:
31
- actionType = textContent.toLowerCase();
32
- entityIsPublishedSwitch = "".concat(actionType, "ed");
33
- mutation = (0, _utils.buildUpdatePublishUnpublishMutation)(entitySchema, entityData.id, actionType);
34
- _context.prev = 7;
35
- _context.next = 10;
36
- return client.mutate({
37
- mutation: mutation
38
- });
39
- case 10:
40
- addToast("".concat(textContent, "ed"), {
41
- appearance: 'success',
42
- autoDismiss: true
43
- });
44
- _context.next = 16;
45
- break;
46
- case 13:
47
- _context.prev = 13;
48
- _context.t0 = _context["catch"](7);
49
- addToast(_context.t0.message, {
50
- appearance: 'error',
51
- autoDismiss: true
52
- });
53
- case 16:
54
- setEntityIsPublish(entityIsPublishedSwitch);
55
- refetchRecord(true);
56
- case 18:
57
- case "end":
58
- return _context.stop();
59
- }
60
- }, _callee, null, [[7, 13]]);
61
- }));
62
- return function triggerPublish(_x, _x2) {
63
- return _ref2.apply(this, arguments);
64
- };
65
- }();
9
+ const triggerPublish = async ({
10
+ entityData,
11
+ client,
12
+ setEntityIsPublish,
13
+ entitySchema,
14
+ textContent = '',
15
+ refetchRecord
16
+ }, addToast) => {
17
+ if (!Object.keys(entityData).length) {
18
+ addToast(_constants.SAVE_BEFORE_PUBLISH_MESSAGE, {
19
+ appearance: 'info',
20
+ autoDismiss: true
21
+ });
22
+ return;
23
+ }
24
+ const actionType = textContent.toLowerCase();
25
+ const entityIsPublishedSwitch = `${actionType}ed`;
26
+ const mutation = (0, _utils.buildUpdatePublishUnpublishMutation)(entitySchema, entityData.id, actionType);
27
+ try {
28
+ await client.mutate({
29
+ mutation
30
+ });
31
+ addToast(`${textContent}ed`, {
32
+ appearance: 'success',
33
+ autoDismiss: true
34
+ });
35
+ } catch (error) {
36
+ addToast(error.message, {
37
+ appearance: 'error',
38
+ autoDismiss: true
39
+ });
40
+ }
41
+ setEntityIsPublish(entityIsPublishedSwitch);
42
+ refetchRecord(true);
43
+ };
44
+ exports.triggerPublish = triggerPublish;
66
45
  //# sourceMappingURL=publish.js.map