@blaze-cms/plugin-data-ui 0.146.0-node18-core-styles.3 → 0.146.0-node18-core-styles-tooltips.1

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 (155) hide show
  1. package/CHANGELOG.md +13 -23
  2. package/lib/components/EntityManager/Entity/Entity.js +54 -70
  3. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  4. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +8 -2
  5. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  6. package/lib/components/EntityManager/utils/entity.js +8 -2
  7. package/lib/components/EntityManager/utils/entity.js.map +1 -1
  8. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +18 -15
  9. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  10. package/lib/components/Tabs/index.js +3 -2
  11. package/lib/components/Tabs/index.js.map +1 -1
  12. package/package.json +12 -12
  13. package/src/components/EntityManager/Entity/Entity.js +15 -30
  14. package/src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +4 -1
  15. package/src/components/EntityManager/utils/entity.js +4 -1
  16. package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +23 -24
  17. package/src/components/Tabs/index.js +15 -15
  18. package/lib-es/components/EntityDataListing/EntityDataListing.js +0 -33
  19. package/lib-es/components/EntityDataListing/EntityDataListing.js.map +0 -1
  20. package/lib-es/components/EntityDataListing/index.js +0 -3
  21. package/lib-es/components/EntityDataListing/index.js.map +0 -1
  22. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +0 -30
  23. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +0 -1
  24. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js +0 -3
  25. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +0 -1
  26. package/lib-es/components/EntityManager/Entity/Entity.js +0 -461
  27. package/lib-es/components/EntityManager/Entity/Entity.js.map +0 -1
  28. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js +0 -103
  29. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +0 -1
  30. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +0 -42
  31. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +0 -1
  32. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +0 -3
  33. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +0 -1
  34. package/lib-es/components/EntityManager/Entity/EntityHeader/index.js +0 -3
  35. package/lib-es/components/EntityManager/Entity/EntityHeader/index.js.map +0 -1
  36. package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +0 -30
  37. package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +0 -1
  38. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +0 -29
  39. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +0 -1
  40. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +0 -49
  41. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +0 -1
  42. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +0 -117
  43. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +0 -1
  44. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +0 -36
  45. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +0 -1
  46. package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js +0 -5
  47. package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js.map +0 -1
  48. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js +0 -46
  49. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +0 -1
  50. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js +0 -32
  51. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +0 -1
  52. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js +0 -5
  53. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js.map +0 -1
  54. package/lib-es/components/EntityManager/Entity/actions-handlers/index.js +0 -12
  55. package/lib-es/components/EntityManager/Entity/actions-handlers/index.js.map +0 -1
  56. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js +0 -5
  57. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js.map +0 -1
  58. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js +0 -39
  59. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +0 -1
  60. package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js +0 -5
  61. package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js.map +0 -1
  62. package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js +0 -53
  63. package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +0 -1
  64. package/lib-es/components/EntityManager/Entity/index.js +0 -3
  65. package/lib-es/components/EntityManager/Entity/index.js.map +0 -1
  66. package/lib-es/components/EntityManager/EntityManager.js +0 -133
  67. package/lib-es/components/EntityManager/EntityManager.js.map +0 -1
  68. package/lib-es/components/EntityManager/index.js +0 -3
  69. package/lib-es/components/EntityManager/index.js.map +0 -1
  70. package/lib-es/components/EntityManager/utils/RecordEditContext/index.js +0 -6
  71. package/lib-es/components/EntityManager/utils/RecordEditContext/index.js.map +0 -1
  72. package/lib-es/components/EntityManager/utils/data-mappers.js +0 -55
  73. package/lib-es/components/EntityManager/utils/data-mappers.js.map +0 -1
  74. package/lib-es/components/EntityManager/utils/entity.js +0 -66
  75. package/lib-es/components/EntityManager/utils/entity.js.map +0 -1
  76. package/lib-es/components/EntityManager/utils/entityAvailableActions.js +0 -56
  77. package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +0 -1
  78. package/lib-es/components/EntityManager/utils/is-form-empty.js +0 -9
  79. package/lib-es/components/EntityManager/utils/is-form-empty.js.map +0 -1
  80. package/lib-es/components/EntityManager/utils/query.js +0 -23
  81. package/lib-es/components/EntityManager/utils/query.js.map +0 -1
  82. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js +0 -36
  83. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +0 -1
  84. package/lib-es/components/InfoBoxes/InfoBoxes.js +0 -28
  85. package/lib-es/components/InfoBoxes/InfoBoxes.js.map +0 -1
  86. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js +0 -38
  87. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +0 -1
  88. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +0 -28
  89. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +0 -1
  90. package/lib-es/components/InfoBoxes/hooks/useData.js +0 -39
  91. package/lib-es/components/InfoBoxes/hooks/useData.js.map +0 -1
  92. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js +0 -17
  93. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +0 -1
  94. package/lib-es/components/InfoBoxes/index.js +0 -3
  95. package/lib-es/components/InfoBoxes/index.js.map +0 -1
  96. package/lib-es/components/InfoBoxes/presentational/InfoBox.js +0 -40
  97. package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +0 -1
  98. package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js +0 -12
  99. package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +0 -1
  100. package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js +0 -30
  101. package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js.map +0 -1
  102. package/lib-es/components/ListingTable/ListingTable.js +0 -207
  103. package/lib-es/components/ListingTable/ListingTable.js.map +0 -1
  104. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +0 -54
  105. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +0 -1
  106. package/lib-es/components/ListingTable/ListingTableContent/index.js +0 -3
  107. package/lib-es/components/ListingTable/ListingTableContent/index.js.map +0 -1
  108. package/lib-es/components/ListingTable/TableActions/TableActions.js +0 -34
  109. package/lib-es/components/ListingTable/TableActions/TableActions.js.map +0 -1
  110. package/lib-es/components/ListingTable/TableActions/index.js +0 -3
  111. package/lib-es/components/ListingTable/TableActions/index.js.map +0 -1
  112. package/lib-es/components/ListingTable/index.js +0 -3
  113. package/lib-es/components/ListingTable/index.js.map +0 -1
  114. package/lib-es/components/ListingTable/mappers/populate-rows.js +0 -140
  115. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +0 -1
  116. package/lib-es/components/ListingTable/service/index.js +0 -86
  117. package/lib-es/components/ListingTable/service/index.js.map +0 -1
  118. package/lib-es/components/Tabs/index.js +0 -39
  119. package/lib-es/components/Tabs/index.js.map +0 -1
  120. package/lib-es/components/hooks/useCallbackDebounce.js +0 -12
  121. package/lib-es/components/hooks/useCallbackDebounce.js.map +0 -1
  122. package/lib-es/constants.js +0 -39
  123. package/lib-es/constants.js.map +0 -1
  124. package/lib-es/icons/ContentIcon.js +0 -80
  125. package/lib-es/icons/ContentIcon.js.map +0 -1
  126. package/lib-es/icons/SettingsIcon.js +0 -36
  127. package/lib-es/icons/SettingsIcon.js.map +0 -1
  128. package/lib-es/icons/TaxonomyIcon.js +0 -60
  129. package/lib-es/icons/TaxonomyIcon.js.map +0 -1
  130. package/lib-es/icons/UsersIcon.js +0 -33
  131. package/lib-es/icons/UsersIcon.js.map +0 -1
  132. package/lib-es/icons/index.js +0 -6
  133. package/lib-es/icons/index.js.map +0 -1
  134. package/lib-es/index.js +0 -84
  135. package/lib-es/index.js.map +0 -1
  136. package/lib-es/utils/add-content-menu-items.js +0 -72
  137. package/lib-es/utils/add-content-menu-items.js.map +0 -1
  138. package/lib-es/utils/build-create-entity-mutation.js +0 -21
  139. package/lib-es/utils/build-create-entity-mutation.js.map +0 -1
  140. package/lib-es/utils/build-delete-entity-mutation.js +0 -18
  141. package/lib-es/utils/build-delete-entity-mutation.js.map +0 -1
  142. package/lib-es/utils/build-listing-query.js +0 -28
  143. package/lib-es/utils/build-listing-query.js.map +0 -1
  144. package/lib-es/utils/build-update-data-query.js +0 -24
  145. package/lib-es/utils/build-update-data-query.js.map +0 -1
  146. package/lib-es/utils/build-update-publish-unpublish-mutation.js +0 -22
  147. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +0 -1
  148. package/lib-es/utils/get-default-query-params.js +0 -17
  149. package/lib-es/utils/get-default-query-params.js.map +0 -1
  150. package/lib-es/utils/hoc/withContext.js +0 -8
  151. package/lib-es/utils/hoc/withContext.js.map +0 -1
  152. package/lib-es/utils/hooks/useToggle.js +0 -8
  153. package/lib-es/utils/hooks/useToggle.js.map +0 -1
  154. package/lib-es/utils/index.js +0 -3
  155. package/lib-es/utils/index.js.map +0 -1
@@ -1,42 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import Button from '@blaze-react/button';
4
- import { useMutation } from '@apollo/client';
5
- import { getMutation } from '@blaze-cms/admin-ui-utils';
6
- const HeaderPreviewButton = ({
7
- itemId,
8
- itemEntity
9
- }) => {
10
- const [createPreviewToken] = useMutation(getMutation('PREVIEW_TOKEN_MUTATION'));
11
- if (process.env.BLAZE_DISABLE_PREVIEW) return null;
12
- const onViewPreview = async () => {
13
- try {
14
- const {
15
- data: {
16
- createPreviewToken: {
17
- result: {
18
- url
19
- }
20
- }
21
- } = {}
22
- } = await createPreviewToken({
23
- variables: {
24
- itemId,
25
- itemEntity
26
- }
27
- });
28
- if (url) window.open(url, '_blank');
29
- // eslint-disable-next-line no-empty
30
- } catch (err) {}
31
- };
32
- return /*#__PURE__*/React.createElement(Button, {
33
- className: "more-menu__link",
34
- onClick: onViewPreview
35
- }, "Preview");
36
- };
37
- HeaderPreviewButton.propTypes = {
38
- itemId: PropTypes.string.isRequired,
39
- itemEntity: PropTypes.string.isRequired
40
- };
41
- export default HeaderPreviewButton;
42
- //# sourceMappingURL=HeaderPreviewButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HeaderPreviewButton.js","names":["React","PropTypes","Button","useMutation","getMutation","HeaderPreviewButton","itemId","itemEntity","createPreviewToken","process","env","BLAZE_DISABLE_PREVIEW","onViewPreview","data","result","url","variables","window","open","err","createElement","className","onClick","propTypes","string","isRequired"],"sources":["../../../../../../src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '@blaze-react/button';\nimport { useMutation } from '@apollo/client';\nimport { getMutation } from '@blaze-cms/admin-ui-utils';\n\nconst HeaderPreviewButton = ({ itemId, itemEntity }) => {\n const [createPreviewToken] = useMutation(getMutation('PREVIEW_TOKEN_MUTATION'));\n if (process.env.BLAZE_DISABLE_PREVIEW) return null;\n\n const onViewPreview = async () => {\n try {\n const {\n data: {\n createPreviewToken: {\n result: { url }\n }\n } = {}\n } = await createPreviewToken({\n variables: {\n itemId,\n itemEntity\n }\n });\n\n if (url) window.open(url, '_blank');\n // eslint-disable-next-line no-empty\n } catch (err) {}\n };\n\n return (\n <Button className=\"more-menu__link\" onClick={onViewPreview}>\n Preview\n </Button>\n );\n};\n\nHeaderPreviewButton.propTypes = {\n itemId: PropTypes.string.isRequired,\n itemEntity: PropTypes.string.isRequired\n};\n\nexport default HeaderPreviewButton;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,MAAM,MAAM,qBAAqB;AACxC,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,WAAW,QAAQ,2BAA2B;AAEvD,MAAMC,mBAAmB,GAAGA,CAAC;EAAEC,MAAM;EAAEC;AAAW,CAAC,KAAK;EACtD,MAAM,CAACC,kBAAkB,CAAC,GAAGL,WAAW,CAACC,WAAW,CAAC,wBAAwB,CAAC,CAAC;EAC/E,IAAIK,OAAO,CAACC,GAAG,CAACC,qBAAqB,EAAE,OAAO,IAAI;EAElD,MAAMC,aAAa,GAAG,MAAAA,CAAA,KAAY;IAChC,IAAI;MACF,MAAM;QACJC,IAAI,EAAE;UACJL,kBAAkB,EAAE;YAClBM,MAAM,EAAE;cAAEC;YAAI;UAChB;QACF,CAAC,GAAG,CAAC;MACP,CAAC,GAAG,MAAMP,kBAAkB,CAAC;QAC3BQ,SAAS,EAAE;UACTV,MAAM;UACNC;QACF;MACF,CAAC,CAAC;MAEF,IAAIQ,GAAG,EAAEE,MAAM,CAACC,IAAI,CAACH,GAAG,EAAE,QAAQ,CAAC;MACnC;IACF,CAAC,CAAC,OAAOI,GAAG,EAAE,CAAC;EACjB,CAAC;EAED,oBACEnB,KAAA,CAAAoB,aAAA,CAAClB,MAAM;IAACmB,SAAS,EAAC,iBAAiB;IAACC,OAAO,EAAEV;EAAc,GAAC,SAEpD,CAAC;AAEb,CAAC;AAEDP,mBAAmB,CAACkB,SAAS,GAAG;EAC9BjB,MAAM,EAAEL,SAAS,CAACuB,MAAM,CAACC,UAAU;EACnClB,UAAU,EAAEN,SAAS,CAACuB,MAAM,CAACC;AAC/B,CAAC;AAED,eAAepB,mBAAmB","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import HeaderPreviewButton from './HeaderPreviewButton';
2
- export default HeaderPreviewButton;
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["HeaderPreviewButton"],"sources":["../../../../../../src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js"],"sourcesContent":["import HeaderPreviewButton from './HeaderPreviewButton';\n\nexport default HeaderPreviewButton;\n"],"mappings":"AAAA,OAAOA,mBAAmB,MAAM,uBAAuB;AAEvD,eAAeA,mBAAmB","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import EntityHeader from './EntityHeader';
2
- export default EntityHeader;
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["EntityHeader"],"sources":["../../../../../src/components/EntityManager/Entity/EntityHeader/index.js"],"sourcesContent":["import EntityHeader from './EntityHeader';\n\nexport default EntityHeader;\n"],"mappings":"AAAA,OAAOA,YAAY,MAAM,gBAAgB;AAEzC,eAAeA,YAAY","ignoreList":[]}
@@ -1,30 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import useCustomSidebarData from '../hooks/useCustomSidebarData';
4
- import CustomSidebarInfo from '../presentational/CustomSidebarInfo';
5
- const CustomSibebarInfoContainer = ({
6
- id,
7
- schema,
8
- displayProperties
9
- }) => {
10
- const {
11
- data
12
- } = useCustomSidebarData({
13
- id,
14
- schema,
15
- displayProperties
16
- });
17
- if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;
18
- const items = Object.values(data).flatMap(item => Object.values(item));
19
- return /*#__PURE__*/React.createElement(CustomSidebarInfo, {
20
- items: items,
21
- customSidebarInfoKey: displayProperties.key
22
- });
23
- };
24
- export default CustomSibebarInfoContainer;
25
- CustomSibebarInfoContainer.propTypes = {
26
- id: PropTypes.string.isRequired,
27
- displayProperties: PropTypes.object.isRequired,
28
- schema: PropTypes.object.isRequired
29
- };
30
- //# sourceMappingURL=CustomSidebarInfoContainer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CustomSidebarInfoContainer.js","names":["PropTypes","React","useCustomSidebarData","CustomSidebarInfo","CustomSibebarInfoContainer","id","schema","displayProperties","data","Object","keys","length","items","values","flatMap","item","createElement","customSidebarInfoKey","key","propTypes","string","isRequired","object"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport useCustomSidebarData from '../hooks/useCustomSidebarData';\nimport CustomSidebarInfo from '../presentational/CustomSidebarInfo';\n\nconst CustomSibebarInfoContainer = ({ id, schema, displayProperties }) => {\n const { data } = useCustomSidebarData({ id, schema, displayProperties });\n\n if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;\n\n const items = Object.values(data).flatMap(item => Object.values(item));\n\n return <CustomSidebarInfo items={items} customSidebarInfoKey={displayProperties.key} />;\n};\n\nexport default CustomSibebarInfoContainer;\n\nCustomSibebarInfoContainer.propTypes = {\n id: PropTypes.string.isRequired,\n displayProperties: PropTypes.object.isRequired,\n schema: PropTypes.object.isRequired\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,oBAAoB,MAAM,+BAA+B;AAChE,OAAOC,iBAAiB,MAAM,qCAAqC;AAEnE,MAAMC,0BAA0B,GAAGA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAkB,CAAC,KAAK;EACxE,MAAM;IAAEC;EAAK,CAAC,GAAGN,oBAAoB,CAAC;IAAEG,EAAE;IAAEC,MAAM;IAAEC;EAAkB,CAAC,CAAC;EAExE,IAAI,CAACC,IAAI,IAAI,CAACC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,CAACG,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAE9E,MAAMC,KAAK,GAAGH,MAAM,CAACI,MAAM,CAACL,IAAI,CAAC,CAACM,OAAO,CAACC,IAAI,IAAIN,MAAM,CAACI,MAAM,CAACE,IAAI,CAAC,CAAC;EAEtE,oBAAOd,KAAA,CAAAe,aAAA,CAACb,iBAAiB;IAACS,KAAK,EAAEA,KAAM;IAACK,oBAAoB,EAAEV,iBAAiB,CAACW;EAAI,CAAE,CAAC;AACzF,CAAC;AAED,eAAed,0BAA0B;AAEzCA,0BAA0B,CAACe,SAAS,GAAG;EACrCd,EAAE,EAAEL,SAAS,CAACoB,MAAM,CAACC,UAAU;EAC/Bd,iBAAiB,EAAEP,SAAS,CAACsB,MAAM,CAACD,UAAU;EAC9Cf,MAAM,EAAEN,SAAS,CAACsB,MAAM,CAACD;AAC3B,CAAC","ignoreList":[]}
@@ -1,29 +0,0 @@
1
- import { gql } from '@apollo/client';
2
- import { BlazeError } from '@blaze-cms/core-errors';
3
- export default function buildDynamicQuery({
4
- id,
5
- schema,
6
- displayProperties
7
- }) {
8
- if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
9
- throw new BlazeError('DataEntity query requires get action, properties and fields from entity schema');
10
- }
11
- if (displayProperties.adminMainInfoProperty && Array.isArray(displayProperties.adminMainInfoProperty)) {
12
- const fields = displayProperties.adminMainInfoProperty.map(infoProperty => `${infoProperty} {
13
- label
14
- value
15
- showLabel
16
- tooltipIcon
17
- tooltipContent
18
- }`);
19
- return gql`query getInfoBoxData($id: String!){
20
- ${schema.actions.get}( id: $id ) {
21
- id
22
- ${fields.map(field => field)}
23
- __typename
24
- }
25
- }`;
26
- }
27
- return null;
28
- }
29
- //# sourceMappingURL=build-dynamic-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-dynamic-query.js","names":["gql","BlazeError","buildDynamicQuery","id","schema","displayProperties","actions","get","properties","adminMainInfoProperty","Array","isArray","fields","map","infoProperty","field"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nexport default function buildDynamicQuery({ id, schema, displayProperties }) {\n if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {\n throw new BlazeError(\n 'DataEntity query requires get action, properties and fields from entity schema'\n );\n }\n\n if (\n displayProperties.adminMainInfoProperty &&\n Array.isArray(displayProperties.adminMainInfoProperty)\n ) {\n const fields = displayProperties.adminMainInfoProperty.map(\n infoProperty =>\n `${infoProperty} {\n label\n value\n showLabel\n tooltipIcon\n tooltipContent\n }`\n );\n\n return gql`query getInfoBoxData($id: String!){\n ${schema.actions.get}( id: $id ) {\n id\n ${fields.map(field => field)}\n __typename\n }\n }`;\n }\n\n return null;\n}\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,eAAe,SAASC,iBAAiBA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAkB,CAAC,EAAE;EAC3E,IAAI,CAACD,MAAM,IAAI,CAACA,MAAM,CAACE,OAAO,IAAI,CAACF,MAAM,CAACE,OAAO,CAACC,GAAG,IAAI,CAACH,MAAM,CAACI,UAAU,EAAE;IAC3E,MAAM,IAAIP,UAAU,CAClB,gFACF,CAAC;EACH;EAEA,IACEI,iBAAiB,CAACI,qBAAqB,IACvCC,KAAK,CAACC,OAAO,CAACN,iBAAiB,CAACI,qBAAqB,CAAC,EACtD;IACA,MAAMG,MAAM,GAAGP,iBAAiB,CAACI,qBAAqB,CAACI,GAAG,CACxDC,YAAY,IACV,GAAGA,YAAY;AACvB;AACA;AACA;AACA;AACA;AACA,QACI,CAAC;IAED,OAAOd,GAAG;AACd,QAAQI,MAAM,CAACE,OAAO,CAACC,GAAG;AAC1B;AACA,SAASK,MAAM,CAACC,GAAG,CAACE,KAAK,IAAIA,KAAK,CAAC;AACnC;AACA;AACA,MAAM;EACJ;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
@@ -1,49 +0,0 @@
1
- import { useContext, useEffect } from 'react';
2
- import ProptTypes from 'prop-types';
3
- import { useQuery, gql } from '@apollo/client';
4
- import buildDynamicQuery from '../../../../InfoBoxes/helpers/build-dynamic-query';
5
- import { RecordEditContext } from '../../../utils/RecordEditContext';
6
- const useCustomSidebarData = ({
7
- id,
8
- schema,
9
- displayProperties
10
- }) => {
11
- const {
12
- externalUpdateTime,
13
- updated
14
- } = useContext(RecordEditContext);
15
- const query = displayProperties.adminMainInfoProperty && Array.isArray(displayProperties.adminMainInfoProperty) ? buildDynamicQuery({
16
- id,
17
- schema,
18
- properties: displayProperties.adminMainInfoProperty
19
- }) : null;
20
- const customSidebarInfoQuery = query || gql`
21
- query {
22
- __typename
23
- }
24
- `;
25
- const {
26
- data = {},
27
- loading,
28
- error,
29
- refetch
30
- } = useQuery(customSidebarInfoQuery, {
31
- variables: {
32
- id
33
- },
34
- skip: !query
35
- });
36
- useEffect(() => {
37
- refetch();
38
- }, [externalUpdateTime, updated, refetch]);
39
- return {
40
- data: data.__typename !== 'Query' ? data : null,
41
- loading,
42
- error
43
- };
44
- };
45
- export default useCustomSidebarData;
46
- useCustomSidebarData.propTypes = {
47
- displayProperties: ProptTypes.object.isRequired
48
- };
49
- //# sourceMappingURL=useCustomSidebarData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCustomSidebarData.js","names":["useContext","useEffect","ProptTypes","useQuery","gql","buildDynamicQuery","RecordEditContext","useCustomSidebarData","id","schema","displayProperties","externalUpdateTime","updated","query","adminMainInfoProperty","Array","isArray","properties","customSidebarInfoQuery","data","loading","error","refetch","variables","skip","__typename","propTypes","object","isRequired"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js"],"sourcesContent":["import { useContext, useEffect } from 'react';\nimport ProptTypes from 'prop-types';\nimport { useQuery, gql } from '@apollo/client';\nimport buildDynamicQuery from '../../../../InfoBoxes/helpers/build-dynamic-query';\nimport { RecordEditContext } from '../../../utils/RecordEditContext';\n\nconst useCustomSidebarData = ({ id, schema, displayProperties }) => {\n const { externalUpdateTime, updated } = useContext(RecordEditContext);\n\n const query =\n displayProperties.adminMainInfoProperty &&\n Array.isArray(displayProperties.adminMainInfoProperty)\n ? buildDynamicQuery({ id, schema, properties: displayProperties.adminMainInfoProperty })\n : null;\n\n const customSidebarInfoQuery =\n query ||\n gql`\n query {\n __typename\n }\n `;\n\n const {\n data = {},\n loading,\n error,\n refetch\n } = useQuery(customSidebarInfoQuery, {\n variables: { id },\n skip: !query\n });\n\n useEffect(() => {\n refetch();\n }, [externalUpdateTime, updated, refetch]);\n\n return { data: data.__typename !== 'Query' ? data : null, loading, error };\n};\n\nexport default useCustomSidebarData;\n\nuseCustomSidebarData.propTypes = {\n displayProperties: ProptTypes.object.isRequired\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,SAAS,QAAQ,OAAO;AAC7C,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,QAAQ,EAAEC,GAAG,QAAQ,gBAAgB;AAC9C,OAAOC,iBAAiB,MAAM,mDAAmD;AACjF,SAASC,iBAAiB,QAAQ,kCAAkC;AAEpE,MAAMC,oBAAoB,GAAGA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAkB,CAAC,KAAK;EAClE,MAAM;IAAEC,kBAAkB;IAAEC;EAAQ,CAAC,GAAGZ,UAAU,CAACM,iBAAiB,CAAC;EAErE,MAAMO,KAAK,GACTH,iBAAiB,CAACI,qBAAqB,IACvCC,KAAK,CAACC,OAAO,CAACN,iBAAiB,CAACI,qBAAqB,CAAC,GAClDT,iBAAiB,CAAC;IAAEG,EAAE;IAAEC,MAAM;IAAEQ,UAAU,EAAEP,iBAAiB,CAACI;EAAsB,CAAC,CAAC,GACtF,IAAI;EAEV,MAAMI,sBAAsB,GAC1BL,KAAK,IACLT,GAAG;AACP;AACA;AACA;AACA,KAAK;EAEH,MAAM;IACJe,IAAI,GAAG,CAAC,CAAC;IACTC,OAAO;IACPC,KAAK;IACLC;EACF,CAAC,GAAGnB,QAAQ,CAACe,sBAAsB,EAAE;IACnCK,SAAS,EAAE;MAAEf;IAAG,CAAC;IACjBgB,IAAI,EAAE,CAACX;EACT,CAAC,CAAC;EAEFZ,SAAS,CAAC,MAAM;IACdqB,OAAO,CAAC,CAAC;EACX,CAAC,EAAE,CAACX,kBAAkB,EAAEC,OAAO,EAAEU,OAAO,CAAC,CAAC;EAE1C,OAAO;IAAEH,IAAI,EAAEA,IAAI,CAACM,UAAU,KAAK,OAAO,GAAGN,IAAI,GAAG,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC;AAC5E,CAAC;AAED,eAAed,oBAAoB;AAEnCA,oBAAoB,CAACmB,SAAS,GAAG;EAC/BhB,iBAAiB,EAAER,UAAU,CAACyB,MAAM,CAACC;AACvC,CAAC","ignoreList":[]}
@@ -1,117 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import PropTypes from 'prop-types';
3
- import uuidv1 from 'uuid/v1';
4
- import { useApolloClient } from '@apollo/client';
5
- import { getQuery } from '@blaze-cms/admin-ui-utils';
6
- import { formFieldTypes } from '@blaze-cms/react-form-builder';
7
- import classnames from 'classnames';
8
- import { VersionsList } from '@blaze-cms/versioning-ui';
9
- import { PUBLISHED, UNPUBLISHED } from '../../../../constants';
10
- import CustomSidebarInfoContainer from './container/CustomSidebarInfoContainer';
11
- import EntityNavLinks from '../EntitiyNavLinks';
12
- const SideBarRelations = ({
13
- schema,
14
- onChange,
15
- formData,
16
- entity
17
- }) => {
18
- const {
19
- relation: RelationComponent
20
- } = formFieldTypes;
21
- const {
22
- formattedStatus,
23
- formattedUpdated,
24
- formattedCreated,
25
- formattedPublished,
26
- status
27
- } = formData;
28
- const client = useApolloClient();
29
- const [relationsComponents, setRelationsComponents] = useState(null);
30
- useEffect(() => {
31
- (async () => {
32
- const fetchRelationSchema = async ({
33
- entityIdentifier
34
- }) => {
35
- if (!entityIdentifier) return null;
36
- const {
37
- data: {
38
- getEntitySchemas: [relationSchema]
39
- }
40
- } = await client.query({
41
- query: getQuery('GET_ENTITY_SCHEMA'),
42
- variables: {
43
- identifier: entityIdentifier
44
- }
45
- });
46
- return relationSchema;
47
- };
48
- if (!relationsComponents && schema) {
49
- const allRelationComponents = await Promise.all(schema.relations.filter(({
50
- showInForm,
51
- foreignKey
52
- }) => showInForm && schema.properties[foreignKey]).map(async relation => ({
53
- id: uuidv1(),
54
- staticData: relation,
55
- schema: await fetchRelationSchema(relation)
56
- })));
57
- setRelationsComponents(allRelationComponents);
58
- }
59
- })();
60
- }, [client, relationsComponents, schema, schema.relations]);
61
- const {
62
- id: itemId
63
- } = entity;
64
- const {
65
- identifier: itemEntity,
66
- interfaces
67
- } = schema;
68
- const statusClassName = classnames('sidebar__status__badge', {
69
- 'sidebar__status__badge--published': status === PUBLISHED,
70
- 'sidebar__status__badge--unpublished': status === UNPUBLISHED
71
- });
72
- return /*#__PURE__*/React.createElement("div", {
73
- className: "sidebar",
74
- "data-testid": "sideBarRelations-main-div"
75
- }, /*#__PURE__*/React.createElement("div", {
76
- className: "sidebar__content"
77
- }, /*#__PURE__*/React.createElement("div", {
78
- className: "sidebar__status"
79
- }, formattedCreated && /*#__PURE__*/React.createElement("div", {
80
- className: "sidebar__top"
81
- }, /*#__PURE__*/React.createElement("div", {
82
- className: "sidebar__status__wrapper"
83
- }, /*#__PURE__*/React.createElement("b", null, "Status"), /*#__PURE__*/React.createElement("span", {
84
- className: statusClassName
85
- }, formattedStatus)), formattedStatus === PUBLISHED && /*#__PURE__*/React.createElement("p", null, formattedStatus, " on: ", /*#__PURE__*/React.createElement("span", null, " ", formattedPublished))), !schema.displayProperties.disableDefaultAdminInfo && formattedCreated && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, "Created: ", /*#__PURE__*/React.createElement("span", null, formattedCreated)), /*#__PURE__*/React.createElement("p", null, "Updated: ", /*#__PURE__*/React.createElement("span", null, formattedUpdated))), /*#__PURE__*/React.createElement(CustomSidebarInfoContainer, {
86
- id: itemId,
87
- schema: schema,
88
- displayProperties: schema.displayProperties
89
- })), /*#__PURE__*/React.createElement(VersionsList, {
90
- itemEntity: itemEntity,
91
- itemId: itemId,
92
- interfaces: interfaces
93
- }), /*#__PURE__*/React.createElement(EntityNavLinks, {
94
- schema: schema
95
- }), relationsComponents && relationsComponents.map(({
96
- id,
97
- staticData,
98
- schema: entitySchema
99
- }) => /*#__PURE__*/React.createElement(RelationComponent, {
100
- formData: formData,
101
- schema: entitySchema,
102
- key: id,
103
- staticData: staticData,
104
- onSelect: onChange
105
- }))));
106
- };
107
- SideBarRelations.propTypes = {
108
- schema: PropTypes.object.isRequired,
109
- onChange: PropTypes.func.isRequired,
110
- formData: PropTypes.object.isRequired,
111
- entity: PropTypes.object
112
- };
113
- SideBarRelations.defaultProps = {
114
- entity: {}
115
- };
116
- export default SideBarRelations;
117
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["React","useState","useEffect","PropTypes","uuidv1","useApolloClient","getQuery","formFieldTypes","classnames","VersionsList","PUBLISHED","UNPUBLISHED","CustomSidebarInfoContainer","EntityNavLinks","SideBarRelations","schema","onChange","formData","entity","relation","RelationComponent","formattedStatus","formattedUpdated","formattedCreated","formattedPublished","status","client","relationsComponents","setRelationsComponents","fetchRelationSchema","entityIdentifier","data","getEntitySchemas","relationSchema","query","variables","identifier","allRelationComponents","Promise","all","relations","filter","showInForm","foreignKey","properties","map","id","staticData","itemId","itemEntity","interfaces","statusClassName","createElement","className","displayProperties","disableDefaultAdminInfo","Fragment","entitySchema","key","onSelect","propTypes","object","isRequired","func","defaultProps"],"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 }) => {\n const { relation: RelationComponent } = formFieldTypes;\n const { formattedStatus, formattedUpdated, formattedCreated, formattedPublished, 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 className=\"sidebar\" data-testid=\"sideBarRelations-main-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 </>\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};\n\nSideBarRelations.defaultProps = {\n entity: {}\n};\n\nexport default SideBarRelations;\n"],"mappings":"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","ignoreList":[]}
@@ -1,36 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import InfoBoxValue from '../../../../InfoBoxes/presentational/InfoBoxValue';
4
- import InfoBoxLabel from '../../../../InfoBoxes/presentational/InfoBoxLabel';
5
- import InfoBoxTooltip from '../../../../InfoBoxes/InfoBoxTooltip';
6
- const CustomSidebarInfo = ({
7
- items,
8
- customSidebarInfoKey
9
- }) => {
10
- if (!items) return null;
11
- const customSidebarInfoItems = items.map(item => Object.values(item).map(info => {
12
- if (!info.label || !info.value) return null;
13
- return /*#__PURE__*/React.createElement("p", {
14
- key: `${customSidebarInfoKey}-${info.label.toLowerCase()}`
15
- }, /*#__PURE__*/React.createElement(InfoBoxLabel, {
16
- item: info
17
- }), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InfoBoxValue, {
18
- item: info
19
- }), /*#__PURE__*/React.createElement(InfoBoxTooltip, {
20
- info: info,
21
- position: "left"
22
- })));
23
- }).filter(Boolean));
24
- return /*#__PURE__*/React.createElement("div", {
25
- className: "custom-sidebar-info",
26
- key: customSidebarInfoKey
27
- }, /*#__PURE__*/React.createElement("div", {
28
- className: "custom-sidebar-info--container"
29
- }, customSidebarInfoItems));
30
- };
31
- CustomSidebarInfo.propTypes = {
32
- customSidebarInfoKey: PropTypes.string.isRequired,
33
- items: PropTypes.array.isRequired
34
- };
35
- export default CustomSidebarInfo;
36
- //# sourceMappingURL=CustomSidebarInfo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CustomSidebarInfo.js","names":["PropTypes","React","InfoBoxValue","InfoBoxLabel","InfoBoxTooltip","CustomSidebarInfo","items","customSidebarInfoKey","customSidebarInfoItems","map","item","Object","values","info","label","value","createElement","key","toLowerCase","position","filter","Boolean","className","propTypes","string","isRequired","array"],"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,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,YAAY,MAAM,mDAAmD;AAC5E,OAAOC,YAAY,MAAM,mDAAmD;AAC5E,OAAOC,cAAc,MAAM,sCAAsC;AAEjE,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAqB,CAAC,KAAK;EAC7D,IAAI,CAACD,KAAK,EAAE,OAAO,IAAI;EAEvB,MAAME,sBAAsB,GAAGF,KAAK,CAACG,GAAG,CAACC,IAAI,IAC3CC,MAAM,CAACC,MAAM,CAACF,IAAI,CAAC,CAChBD,GAAG,CAACI,IAAI,IAAI;IACX,IAAI,CAACA,IAAI,CAACC,KAAK,IAAI,CAACD,IAAI,CAACE,KAAK,EAAE,OAAO,IAAI;IAE3C,oBACEd,KAAA,CAAAe,aAAA;MAAGC,GAAG,EAAE,GAAGV,oBAAoB,IAAIM,IAAI,CAACC,KAAK,CAACI,WAAW,CAAC,CAAC;IAAG,gBAC5DjB,KAAA,CAAAe,aAAA,CAACb,YAAY;MAACO,IAAI,EAAEG;IAAK,CAAE,CAAC,eAC5BZ,KAAA,CAAAe,aAAA,4BACEf,KAAA,CAAAe,aAAA,CAACd,YAAY;MAACQ,IAAI,EAAEG;IAAK,CAAE,CAAC,eAC5BZ,KAAA,CAAAe,aAAA,CAACZ,cAAc;MAACS,IAAI,EAAEA,IAAK;MAACM,QAAQ,EAAC;IAAM,CAAE,CACzC,CACL,CAAC;EAER,CAAC,CAAC,CACDC,MAAM,CAACC,OAAO,CACnB,CAAC;EAED,oBACEpB,KAAA,CAAAe,aAAA;IAAKM,SAAS,EAAC,qBAAqB;IAACL,GAAG,EAAEV;EAAqB,gBAC7DN,KAAA,CAAAe,aAAA;IAAKM,SAAS,EAAC;EAAgC,GAAEd,sBAA4B,CAC1E,CAAC;AAEV,CAAC;AAEDH,iBAAiB,CAACkB,SAAS,GAAG;EAC5BhB,oBAAoB,EAAEP,SAAS,CAACwB,MAAM,CAACC,UAAU;EACjDnB,KAAK,EAAEN,SAAS,CAAC0B,KAAK,CAACD;AACzB,CAAC;AAED,eAAepB,iBAAiB","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- import { submit } from './submit';
2
- export default {
3
- submit
4
- };
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["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,SAASA,MAAM,QAAQ,UAAU;AAEjC,eAAe;EACbA;AACF,CAAC","ignoreList":[]}
@@ -1,46 +0,0 @@
1
- import buildCreateEntityMutation from '../../../../../utils/build-create-entity-mutation';
2
- import { SAVE_BUTTON_TEXTS } from '../../../../../constants';
3
- const submit = async ({
4
- entitySchema,
5
- parsedFormValues,
6
- client,
7
- setEntityData,
8
- setIsSaveButtonAvailable,
9
- setSaveButtonText,
10
- history,
11
- setIsNewEntity
12
- }, addToast) => {
13
- const mutation = buildCreateEntityMutation(entitySchema);
14
- try {
15
- setIsSaveButtonAvailable(false);
16
- setSaveButtonText(SAVE_BUTTON_TEXTS.saving);
17
- const {
18
- data: {
19
- createdEntity: createdEntityResult
20
- }
21
- } = await client.mutate({
22
- mutation,
23
- variables: {
24
- input: parsedFormValues
25
- }
26
- });
27
- setSaveButtonText(SAVE_BUTTON_TEXTS.saved);
28
- setEntityData(createdEntityResult.result);
29
- setIsNewEntity(false);
30
- const updatePathname = history.location.pathname.replace('create', 'update');
31
- history.push(`${updatePathname}/${createdEntityResult.result.id}`);
32
- addToast(`Created`, {
33
- appearance: 'success',
34
- autoDismiss: true
35
- });
36
- } catch (error) {
37
- setIsSaveButtonAvailable(true);
38
- setSaveButtonText(SAVE_BUTTON_TEXTS.save);
39
- addToast(error.message, {
40
- appearance: 'error',
41
- autoDismiss: true
42
- });
43
- }
44
- };
45
- export { submit };
46
- //# sourceMappingURL=submit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"submit.js","names":["buildCreateEntityMutation","SAVE_BUTTON_TEXTS","submit","entitySchema","parsedFormValues","client","setEntityData","setIsSaveButtonAvailable","setSaveButtonText","history","setIsNewEntity","addToast","mutation","saving","data","createdEntity","createdEntityResult","mutate","variables","input","saved","result","updatePathname","location","pathname","replace","push","id","appearance","autoDismiss","error","save","message"],"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,OAAOA,yBAAyB,MAAM,mDAAmD;AACzF,SAASC,iBAAiB,QAAQ,0BAA0B;AAE5D,MAAMC,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,GAAGZ,yBAAyB,CAACG,YAAY,CAAC;EAExD,IAAI;IACFI,wBAAwB,CAAC,KAAK,CAAC;IAC/BC,iBAAiB,CAACP,iBAAiB,CAACY,MAAM,CAAC;IAC3C,MAAM;MACJC,IAAI,EAAE;QAAEC,aAAa,EAAEC;MAAoB;IAC7C,CAAC,GAAG,MAAMX,MAAM,CAACY,MAAM,CAAC;MACtBL,QAAQ;MACRM,SAAS,EAAE;QAAEC,KAAK,EAAEf;MAAiB;IACvC,CAAC,CAAC;IAEFI,iBAAiB,CAACP,iBAAiB,CAACmB,KAAK,CAAC;IAC1Cd,aAAa,CAACU,mBAAmB,CAACK,MAAM,CAAC;IACzCX,cAAc,CAAC,KAAK,CAAC;IAErB,MAAMY,cAAc,GAAGb,OAAO,CAACc,QAAQ,CAACC,QAAQ,CAACC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5EhB,OAAO,CAACiB,IAAI,CAAC,GAAGJ,cAAc,IAAIN,mBAAmB,CAACK,MAAM,CAACM,EAAE,EAAE,CAAC;IAClEhB,QAAQ,CAAC,SAAS,EAAE;MAClBiB,UAAU,EAAE,SAAS;MACrBC,WAAW,EAAE;IACf,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdvB,wBAAwB,CAAC,IAAI,CAAC;IAC9BC,iBAAiB,CAACP,iBAAiB,CAAC8B,IAAI,CAAC;IACzCpB,QAAQ,CAACmB,KAAK,CAACE,OAAO,EAAE;MACtBJ,UAAU,EAAE,OAAO;MACnBC,WAAW,EAAE;IACf,CAAC,CAAC;EACJ;AACF,CAAC;AAED,SAAS3B,MAAM","ignoreList":[]}
@@ -1,32 +0,0 @@
1
- import buildDeleteEntityMutation from '../../../../../utils/build-delete-entity-mutation';
2
- const submit = async ({
3
- entitySchema,
4
- parsedFormValues,
5
- client
6
- }, addToast) => {
7
- const mutation = buildDeleteEntityMutation(entitySchema);
8
- const {
9
- id
10
- } = parsedFormValues;
11
- try {
12
- await client.mutate({
13
- mutation,
14
- variables: {
15
- input: {
16
- id
17
- }
18
- }
19
- });
20
- addToast('Deleted', {
21
- appearance: 'success',
22
- autoDismiss: true
23
- });
24
- } catch (error) {
25
- addToast(error.message, {
26
- appearance: 'error',
27
- autoDismiss: true
28
- });
29
- }
30
- };
31
- export { submit };
32
- //# sourceMappingURL=delete.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete.js","names":["buildDeleteEntityMutation","submit","entitySchema","parsedFormValues","client","addToast","mutation","id","mutate","variables","input","appearance","autoDismiss","error","message"],"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,OAAOA,yBAAyB,MAAM,mDAAmD;AAEzF,MAAMC,MAAM,GAAG,MAAAA,CAAO;EAAEC,YAAY;EAAEC,gBAAgB;EAAEC;AAAO,CAAC,EAAEC,QAAQ,KAAK;EAC7E,MAAMC,QAAQ,GAAGN,yBAAyB,CAACE,YAAY,CAAC;EACxD,MAAM;IAAEK;EAAG,CAAC,GAAGJ,gBAAgB;EAE/B,IAAI;IACF,MAAMC,MAAM,CAACI,MAAM,CAAC;MAClBF,QAAQ;MACRG,SAAS,EAAE;QAAEC,KAAK,EAAE;UAAEH;QAAG;MAAE;IAC7B,CAAC,CAAC;IACFF,QAAQ,CAAC,SAAS,EAAE;MAClBM,UAAU,EAAE,SAAS;MACrBC,WAAW,EAAE;IACf,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdR,QAAQ,CAACQ,KAAK,CAACC,OAAO,EAAE;MACtBH,UAAU,EAAE,OAAO;MACnBC,WAAW,EAAE;IACf,CAAC,CAAC;EACJ;AACF,CAAC;AAED,SAASX,MAAM","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- import { submit } from './delete';
2
- export default {
3
- submit
4
- };
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["submit"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/delete/index.js"],"sourcesContent":["import { submit } from './delete';\n\nexport default { submit };\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,UAAU;AAEjC,eAAe;EAAEA;AAAO,CAAC","ignoreList":[]}
@@ -1,12 +0,0 @@
1
- import createActions from './create';
2
- import updateActions from './update';
3
- import sharedActions from './shared';
4
- import deleteActions from './delete';
5
- const availableActions = {
6
- create: createActions,
7
- update: updateActions,
8
- shared: sharedActions,
9
- delete: deleteActions
10
- };
11
- export default availableActions;
12
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["createActions","updateActions","sharedActions","deleteActions","availableActions","create","update","shared","delete"],"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,OAAOA,aAAa,MAAM,UAAU;AACpC,OAAOC,aAAa,MAAM,UAAU;AACpC,OAAOC,aAAa,MAAM,UAAU;AACpC,OAAOC,aAAa,MAAM,UAAU;AAEpC,MAAMC,gBAAgB,GAAG;EACvBC,MAAM,EAAEL,aAAa;EACrBM,MAAM,EAAEL,aAAa;EACrBM,MAAM,EAAEL,aAAa;EACrBM,MAAM,EAAEL;AACV,CAAC;AAED,eAAeC,gBAAgB","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- import { triggerPublish } from './publish';
2
- export default {
3
- triggerPublish
4
- };
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["triggerPublish"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/shared/index.js"],"sourcesContent":["import { triggerPublish } from './publish';\n\nexport default { triggerPublish };\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,WAAW;AAE1C,eAAe;EAAEA;AAAe,CAAC","ignoreList":[]}
@@ -1,39 +0,0 @@
1
- import { buildUpdatePublishUnpublishMutation } from '../../../../../utils';
2
- import { SAVE_BEFORE_PUBLISH_MESSAGE } from '../../../../../constants';
3
- const triggerPublish = async ({
4
- entityData,
5
- client,
6
- setEntityIsPublish,
7
- entitySchema,
8
- textContent = '',
9
- refetchRecord
10
- }, addToast) => {
11
- if (!Object.keys(entityData).length) {
12
- addToast(SAVE_BEFORE_PUBLISH_MESSAGE, {
13
- appearance: 'info',
14
- autoDismiss: true
15
- });
16
- return;
17
- }
18
- const actionType = textContent.toLowerCase();
19
- const entityIsPublishedSwitch = `${actionType}ed`;
20
- const mutation = buildUpdatePublishUnpublishMutation(entitySchema, entityData.id, actionType);
21
- try {
22
- await client.mutate({
23
- mutation
24
- });
25
- addToast(`${textContent}ed`, {
26
- appearance: 'success',
27
- autoDismiss: true
28
- });
29
- } catch (error) {
30
- addToast(error.message, {
31
- appearance: 'error',
32
- autoDismiss: true
33
- });
34
- }
35
- setEntityIsPublish(entityIsPublishedSwitch);
36
- refetchRecord(true);
37
- };
38
- export { triggerPublish };
39
- //# sourceMappingURL=publish.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publish.js","names":["buildUpdatePublishUnpublishMutation","SAVE_BEFORE_PUBLISH_MESSAGE","triggerPublish","entityData","client","setEntityIsPublish","entitySchema","textContent","refetchRecord","addToast","Object","keys","length","appearance","autoDismiss","actionType","toLowerCase","entityIsPublishedSwitch","mutation","id","mutate","error","message"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/shared/publish.js"],"sourcesContent":["import { buildUpdatePublishUnpublishMutation } from '../../../../../utils';\nimport { SAVE_BEFORE_PUBLISH_MESSAGE } from '../../../../../constants';\n\nconst triggerPublish = async (\n { entityData, client, setEntityIsPublish, entitySchema, textContent = '', refetchRecord },\n addToast\n) => {\n if (!Object.keys(entityData).length) {\n addToast(SAVE_BEFORE_PUBLISH_MESSAGE, {\n appearance: 'info',\n autoDismiss: true\n });\n return;\n }\n const actionType = textContent.toLowerCase();\n const entityIsPublishedSwitch = `${actionType}ed`;\n const mutation = buildUpdatePublishUnpublishMutation(entitySchema, entityData.id, actionType);\n\n try {\n await client.mutate({\n mutation\n });\n addToast(`${textContent}ed`, {\n appearance: 'success',\n autoDismiss: true\n });\n } catch (error) {\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n }\n\n setEntityIsPublish(entityIsPublishedSwitch);\n refetchRecord(true);\n};\n\nexport { triggerPublish };\n"],"mappings":"AAAA,SAASA,mCAAmC,QAAQ,sBAAsB;AAC1E,SAASC,2BAA2B,QAAQ,0BAA0B;AAEtE,MAAMC,cAAc,GAAG,MAAAA,CACrB;EAAEC,UAAU;EAAEC,MAAM;EAAEC,kBAAkB;EAAEC,YAAY;EAAEC,WAAW,GAAG,EAAE;EAAEC;AAAc,CAAC,EACzFC,QAAQ,KACL;EACH,IAAI,CAACC,MAAM,CAACC,IAAI,CAACR,UAAU,CAAC,CAACS,MAAM,EAAE;IACnCH,QAAQ,CAACR,2BAA2B,EAAE;MACpCY,UAAU,EAAE,MAAM;MAClBC,WAAW,EAAE;IACf,CAAC,CAAC;IACF;EACF;EACA,MAAMC,UAAU,GAAGR,WAAW,CAACS,WAAW,CAAC,CAAC;EAC5C,MAAMC,uBAAuB,GAAG,GAAGF,UAAU,IAAI;EACjD,MAAMG,QAAQ,GAAGlB,mCAAmC,CAACM,YAAY,EAAEH,UAAU,CAACgB,EAAE,EAAEJ,UAAU,CAAC;EAE7F,IAAI;IACF,MAAMX,MAAM,CAACgB,MAAM,CAAC;MAClBF;IACF,CAAC,CAAC;IACFT,QAAQ,CAAC,GAAGF,WAAW,IAAI,EAAE;MAC3BM,UAAU,EAAE,SAAS;MACrBC,WAAW,EAAE;IACf,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOO,KAAK,EAAE;IACdZ,QAAQ,CAACY,KAAK,CAACC,OAAO,EAAE;MACtBT,UAAU,EAAE,OAAO;MACnBC,WAAW,EAAE;IACf,CAAC,CAAC;EACJ;EAEAT,kBAAkB,CAACY,uBAAuB,CAAC;EAC3CT,aAAa,CAAC,IAAI,CAAC;AACrB,CAAC;AAED,SAASN,cAAc","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- import { submit } from './submit';
2
- export default {
3
- submit
4
- };
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["submit"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/update/index.js"],"sourcesContent":["import { submit } from './submit';\n\nexport default { submit };\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,UAAU;AAEjC,eAAe;EAAEA;AAAO,CAAC","ignoreList":[]}