@blaze-cms/plugin-data-ui 0.146.0-node18.1 → 0.146.0-rc-eagle.0
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.
- package/CHANGELOG.md +30 -16
- package/README.md +57 -0
- package/lib/components/EntityDataListing/EntityDataListing.js +21 -19
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityDataListing/index.js +2 -3
- package/lib/components/EntityDataListing/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +18 -20
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/Entity.js +289 -452
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +62 -66
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +34 -50
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +20 -26
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +20 -18
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +34 -32
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +104 -150
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +24 -24
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -56
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +29 -45
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/index.js +7 -8
- package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +36 -57
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +47 -66
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/index.js +2 -3
- package/lib/components/EntityManager/Entity/index.js.map +1 -1
- package/lib/components/EntityManager/EntityManager.js +91 -166
- package/lib/components/EntityManager/EntityManager.js.map +1 -1
- package/lib/components/EntityManager/index.js +2 -3
- package/lib/components/EntityManager/index.js.map +1 -1
- package/lib/components/EntityManager/utils/RecordEditContext/index.js +3 -4
- package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
- package/lib/components/EntityManager/utils/data-mappers.js +34 -46
- package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib/components/EntityManager/utils/entity.js +35 -73
- package/lib/components/EntityManager/utils/entity.js.map +1 -1
- package/lib/components/EntityManager/utils/entityAvailableActions.js +51 -110
- package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib/components/EntityManager/utils/is-form-empty.js +6 -10
- package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
- package/lib/components/EntityManager/utils/query.js +17 -10
- package/lib/components/EntityManager/utils/query.js.map +1 -1
- package/lib/components/InfoBoxes/InfoBoxTooltip.js +43 -0
- package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -0
- package/lib/components/InfoBoxes/InfoBoxes.js +19 -20
- package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js +26 -38
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +21 -17
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useData.js +33 -30
- package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useInfoBox.js +10 -10
- package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/index.js +2 -3
- package/lib/components/InfoBoxes/index.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBox.js +28 -32
- package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +11 -12
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +12 -12
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
- package/lib/components/ListingTable/ListingTable.js +163 -303
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +61 -40
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/index.js +2 -3
- package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js +215 -0
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -0
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js +48 -0
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -0
- package/lib/components/ListingTable/SearchFilter/helpers.js +105 -0
- package/lib/components/ListingTable/SearchFilter/helpers.js.map +1 -0
- package/lib/components/ListingTable/SearchFilter/querys.js +13 -0
- package/lib/components/ListingTable/SearchFilter/querys.js.map +1 -0
- package/lib/components/ListingTable/TableActions/TableActions.js +27 -31
- package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
- package/lib/components/ListingTable/TableActions/index.js +2 -3
- package/lib/components/ListingTable/TableActions/index.js.map +1 -1
- package/lib/components/ListingTable/index.js +2 -3
- package/lib/components/ListingTable/index.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +104 -120
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +66 -84
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/components/Tabs/index.js +26 -42
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/hooks/useCallbackDebounce.js +5 -9
- package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
- package/lib/constants.js +31 -29
- package/lib/constants.js.map +1 -1
- package/lib/icons/ContentIcon.js +17 -20
- package/lib/icons/ContentIcon.js.map +1 -1
- package/lib/icons/SettingsIcon.js +12 -15
- package/lib/icons/SettingsIcon.js.map +1 -1
- package/lib/icons/TaxonomyIcon.js +15 -18
- package/lib/icons/TaxonomyIcon.js.map +1 -1
- package/lib/icons/UsersIcon.js +11 -14
- package/lib/icons/UsersIcon.js.map +1 -1
- package/lib/icons/index.js +8 -9
- package/lib/icons/index.js.map +1 -1
- package/lib/index.js +81 -121
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +67 -93
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-create-entity-mutation.js +12 -9
- package/lib/utils/build-create-entity-mutation.js.map +1 -1
- package/lib/utils/build-delete-entity-mutation.js +11 -8
- package/lib/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib/utils/build-listing-query.js +20 -17
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/build-update-data-query.js +15 -9
- package/lib/utils/build-update-data-query.js.map +1 -1
- package/lib/utils/build-update-publish-unpublish-mutation.js +15 -8
- package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib/utils/get-default-query-params.js +7 -6
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib/utils/hoc/withContext.js +4 -6
- package/lib/utils/hoc/withContext.js.map +1 -1
- package/lib/utils/hooks/useToggle.js +4 -12
- package/lib/utils/hooks/useToggle.js.map +1 -1
- package/lib/utils/index.js +2 -3
- package/lib/utils/index.js.map +1 -1
- package/package.json +16 -16
- package/src/components/EntityManager/Entity/Entity.js +34 -39
- package/src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +8 -1
- package/src/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +2 -0
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +51 -17
- package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +5 -3
- package/src/components/EntityManager/utils/entity.js +13 -2
- package/src/components/InfoBoxes/InfoBoxTooltip.js +32 -0
- package/src/components/InfoBoxes/helpers/build-dynamic-query.js +2 -0
- package/src/components/InfoBoxes/presentational/InfoBox.js +4 -2
- package/src/components/ListingTable/ListingTable.js +13 -18
- package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +43 -25
- package/src/components/ListingTable/SearchFilter/SearchContainer.js +228 -0
- package/src/components/ListingTable/SearchFilter/SearchFilter.js +38 -0
- package/src/components/ListingTable/SearchFilter/helpers.js +99 -0
- package/src/components/ListingTable/SearchFilter/querys.js +9 -0
- package/src/components/ListingTable/mappers/populate-rows.js +3 -0
- package/src/components/ListingTable/service/index.js +2 -2
- package/src/components/Tabs/index.js +17 -21
- package/src/constants.js +9 -1
- package/src/index.js +9 -7
- package/src/utils/build-listing-query.js +4 -4
- package/src/utils/hoc/withContext.js +5 -4
- package/lib-es/components/EntityDataListing/EntityDataListing.js +0 -33
- package/lib-es/components/EntityDataListing/EntityDataListing.js.map +0 -1
- package/lib-es/components/EntityDataListing/index.js +0 -3
- package/lib-es/components/EntityDataListing/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +0 -30
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js +0 -3
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/Entity.js +0 -460
- package/lib-es/components/EntityManager/Entity/Entity.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js +0 -103
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +0 -42
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +0 -3
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/index.js +0 -3
- package/lib-es/components/EntityManager/Entity/EntityHeader/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +0 -30
- package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +0 -27
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +0 -49
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +0 -117
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +0 -30
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js +0 -5
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js +0 -46
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js +0 -32
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js +0 -5
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/index.js +0 -12
- package/lib-es/components/EntityManager/Entity/actions-handlers/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js +0 -5
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js +0 -39
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js +0 -5
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js +0 -53
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/index.js +0 -3
- package/lib-es/components/EntityManager/Entity/index.js.map +0 -1
- package/lib-es/components/EntityManager/EntityManager.js +0 -133
- package/lib-es/components/EntityManager/EntityManager.js.map +0 -1
- package/lib-es/components/EntityManager/index.js +0 -3
- package/lib-es/components/EntityManager/index.js.map +0 -1
- package/lib-es/components/EntityManager/utils/RecordEditContext/index.js +0 -6
- package/lib-es/components/EntityManager/utils/RecordEditContext/index.js.map +0 -1
- package/lib-es/components/EntityManager/utils/data-mappers.js +0 -55
- package/lib-es/components/EntityManager/utils/data-mappers.js.map +0 -1
- package/lib-es/components/EntityManager/utils/entity.js +0 -66
- package/lib-es/components/EntityManager/utils/entity.js.map +0 -1
- package/lib-es/components/EntityManager/utils/entityAvailableActions.js +0 -56
- package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +0 -1
- package/lib-es/components/EntityManager/utils/is-form-empty.js +0 -9
- package/lib-es/components/EntityManager/utils/is-form-empty.js.map +0 -1
- package/lib-es/components/EntityManager/utils/query.js +0 -23
- package/lib-es/components/EntityManager/utils/query.js.map +0 -1
- package/lib-es/components/InfoBoxes/InfoBoxes.js +0 -28
- package/lib-es/components/InfoBoxes/InfoBoxes.js.map +0 -1
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js +0 -38
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +0 -1
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +0 -26
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +0 -1
- package/lib-es/components/InfoBoxes/hooks/useData.js +0 -39
- package/lib-es/components/InfoBoxes/hooks/useData.js.map +0 -1
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js +0 -17
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +0 -1
- package/lib-es/components/InfoBoxes/index.js +0 -3
- package/lib-es/components/InfoBoxes/index.js.map +0 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js +0 -37
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +0 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js +0 -12
- package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +0 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js +0 -30
- package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js.map +0 -1
- package/lib-es/components/ListingTable/ListingTable.js +0 -207
- package/lib-es/components/ListingTable/ListingTable.js.map +0 -1
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +0 -54
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +0 -1
- package/lib-es/components/ListingTable/ListingTableContent/index.js +0 -3
- package/lib-es/components/ListingTable/ListingTableContent/index.js.map +0 -1
- package/lib-es/components/ListingTable/TableActions/TableActions.js +0 -34
- package/lib-es/components/ListingTable/TableActions/TableActions.js.map +0 -1
- package/lib-es/components/ListingTable/TableActions/index.js +0 -3
- package/lib-es/components/ListingTable/TableActions/index.js.map +0 -1
- package/lib-es/components/ListingTable/index.js +0 -3
- package/lib-es/components/ListingTable/index.js.map +0 -1
- package/lib-es/components/ListingTable/mappers/populate-rows.js +0 -137
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +0 -1
- package/lib-es/components/ListingTable/service/index.js +0 -86
- package/lib-es/components/ListingTable/service/index.js.map +0 -1
- package/lib-es/components/Tabs/index.js +0 -39
- package/lib-es/components/Tabs/index.js.map +0 -1
- package/lib-es/components/hooks/useCallbackDebounce.js +0 -12
- package/lib-es/components/hooks/useCallbackDebounce.js.map +0 -1
- package/lib-es/constants.js +0 -39
- package/lib-es/constants.js.map +0 -1
- package/lib-es/icons/ContentIcon.js +0 -80
- package/lib-es/icons/ContentIcon.js.map +0 -1
- package/lib-es/icons/SettingsIcon.js +0 -36
- package/lib-es/icons/SettingsIcon.js.map +0 -1
- package/lib-es/icons/TaxonomyIcon.js +0 -60
- package/lib-es/icons/TaxonomyIcon.js.map +0 -1
- package/lib-es/icons/UsersIcon.js +0 -33
- package/lib-es/icons/UsersIcon.js.map +0 -1
- package/lib-es/icons/index.js +0 -6
- package/lib-es/icons/index.js.map +0 -1
- package/lib-es/index.js +0 -84
- package/lib-es/index.js.map +0 -1
- package/lib-es/utils/add-content-menu-items.js +0 -72
- package/lib-es/utils/add-content-menu-items.js.map +0 -1
- package/lib-es/utils/build-create-entity-mutation.js +0 -21
- package/lib-es/utils/build-create-entity-mutation.js.map +0 -1
- package/lib-es/utils/build-delete-entity-mutation.js +0 -18
- package/lib-es/utils/build-delete-entity-mutation.js.map +0 -1
- package/lib-es/utils/build-listing-query.js +0 -28
- package/lib-es/utils/build-listing-query.js.map +0 -1
- package/lib-es/utils/build-update-data-query.js +0 -24
- package/lib-es/utils/build-update-data-query.js.map +0 -1
- package/lib-es/utils/build-update-publish-unpublish-mutation.js +0 -22
- package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +0 -1
- package/lib-es/utils/get-default-query-params.js +0 -17
- package/lib-es/utils/get-default-query-params.js.map +0 -1
- package/lib-es/utils/hoc/withContext.js +0 -8
- package/lib-es/utils/hoc/withContext.js.map +0 -1
- package/lib-es/utils/hooks/useToggle.js +0 -8
- package/lib-es/utils/hooks/useToggle.js.map +0 -1
- package/lib-es/utils/index.js +0 -3
- package/lib-es/utils/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EntityDataListing.js","names":["useQuery","React","PropTypes","getQuery","ListingTable","withContext","EntityDataListing","match","params","entityIdentifier","identifier","data","getEntitySchemas","variables","length","createElement","entitySchema","propTypes","object","isRequired"],"sources":["../../../src/components/EntityDataListing/EntityDataListing.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\n\nimport ListingTable from '../ListingTable/ListingTable';\nimport { withContext } from '../../utils/hoc/withContext';\n\nconst EntityDataListing = ({ match }) => {\n const {\n params: { entityIdentifier: identifier }\n } = match;\n\n const { data: { getEntitySchemas = [] } = {} } = useQuery(getQuery('GET_ENTITY_SCHEMA'), {\n variables: { identifier }\n });\n\n if (!getEntitySchemas.length) return '';\n\n return <ListingTable entitySchema={getEntitySchemas[0]} />;\n};\n\nEntityDataListing.propTypes = {\n match: PropTypes.object.isRequired\n};\n\nexport default withContext(EntityDataListing);\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,QAAQ,2BAA2B;AAEpD,OAAOC,YAAY,MAAM,8BAA8B;AACvD,SAASC,WAAW,QAAQ,6BAA6B;AAEzD,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC;AAAM,CAAC,KAAK;EACvC,MAAM;IACJC,MAAM,EAAE;MAAEC,gBAAgB,EAAEC;IAAW;EACzC,CAAC,GAAGH,KAAK;EAET,MAAM;IAAEI,IAAI,EAAE;MAAEC,gBAAgB,GAAG;IAAG,CAAC,GAAG,CAAC;EAAE,CAAC,GAAGZ,QAAQ,CAACG,QAAQ,CAAC,mBAAmB,CAAC,EAAE;IACvFU,SAAS,EAAE;MAAEH;IAAW;EAC1B,CAAC,CAAC;EAEF,IAAI,CAACE,gBAAgB,CAACE,MAAM,EAAE,OAAO,EAAE;EAEvC,oBAAOb,KAAA,CAAAc,aAAA,CAACX,YAAY;IAACY,YAAY,EAAEJ,gBAAgB,CAAC,CAAC;EAAE,CAAE,CAAC;AAC5D,CAAC;AAEDN,iBAAiB,CAACW,SAAS,GAAG;EAC5BV,KAAK,EAAEL,SAAS,CAACgB,MAAM,CAACC;AAC1B,CAAC;AAED,eAAed,WAAW,CAACC,iBAAiB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["EntityDataListing"],"sources":["../../../src/components/EntityDataListing/index.js"],"sourcesContent":["import EntityDataListing from './EntityDataListing';\n\nexport default EntityDataListing;\n"],"mappings":"AAAA,OAAOA,iBAAiB,MAAM,qBAAqB;AAEnD,eAAeA,iBAAiB","ignoreList":[]}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Link } from 'react-router-dom';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
const EntityNavLinks = ({
|
|
4
|
-
schema
|
|
5
|
-
}) => {
|
|
6
|
-
if (!schema) return null;
|
|
7
|
-
const {
|
|
8
|
-
displayProperties: {
|
|
9
|
-
adminSectionNavigation
|
|
10
|
-
}
|
|
11
|
-
} = schema;
|
|
12
|
-
if (!adminSectionNavigation) return null;
|
|
13
|
-
const links = Object.entries(adminSectionNavigation).map(([k, v]) => {
|
|
14
|
-
const {
|
|
15
|
-
label,
|
|
16
|
-
uri
|
|
17
|
-
} = v;
|
|
18
|
-
const Wrapper = uri.startsWith('#') ? 'a' : Link;
|
|
19
|
-
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
20
|
-
className: "entity-section-link",
|
|
21
|
-
href: uri,
|
|
22
|
-
to: uri
|
|
23
|
-
}, label);
|
|
24
|
-
});
|
|
25
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
-
className: "entity-section-links"
|
|
27
|
-
}, links);
|
|
28
|
-
};
|
|
29
|
-
export default EntityNavLinks;
|
|
30
|
-
//# sourceMappingURL=EntityNavLinks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EntityNavLinks.js","names":["Link","React","EntityNavLinks","schema","displayProperties","adminSectionNavigation","links","Object","entries","map","k","v","label","uri","Wrapper","startsWith","createElement","className","href","to"],"sources":["../../../../../src/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js"],"sourcesContent":["import { Link } from 'react-router-dom';\nimport React from 'react';\n\nconst EntityNavLinks = ({ schema }) => {\n if (!schema) return null;\n\n const {\n displayProperties: { adminSectionNavigation }\n } = schema;\n\n if (!adminSectionNavigation) return null;\n\n const links = Object.entries(adminSectionNavigation).map(([k, v]) => {\n const { label, uri } = v;\n const Wrapper = uri.startsWith('#') ? 'a' : Link;\n\n return (\n <Wrapper className=\"entity-section-link\" href={uri} to={uri}>\n {label}\n </Wrapper>\n );\n });\n\n return <div className=\"entity-section-links\">{links}</div>;\n};\n\nexport default EntityNavLinks;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,kBAAkB;AACvC,OAAOC,KAAK,MAAM,OAAO;AAEzB,MAAMC,cAAc,GAAGA,CAAC;EAAEC;AAAO,CAAC,KAAK;EACrC,IAAI,CAACA,MAAM,EAAE,OAAO,IAAI;EAExB,MAAM;IACJC,iBAAiB,EAAE;MAAEC;IAAuB;EAC9C,CAAC,GAAGF,MAAM;EAEV,IAAI,CAACE,sBAAsB,EAAE,OAAO,IAAI;EAExC,MAAMC,KAAK,GAAGC,MAAM,CAACC,OAAO,CAACH,sBAAsB,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,KAAK;IACnE,MAAM;MAAEC,KAAK;MAAEC;IAAI,CAAC,GAAGF,CAAC;IACxB,MAAMG,OAAO,GAAGD,GAAG,CAACE,UAAU,CAAC,GAAG,CAAC,GAAG,GAAG,GAAGf,IAAI;IAEhD,oBACEC,KAAA,CAAAe,aAAA,CAACF,OAAO;MAACG,SAAS,EAAC,qBAAqB;MAACC,IAAI,EAAEL,GAAI;MAACM,EAAE,EAAEN;IAAI,GACzDD,KACM,CAAC;EAEd,CAAC,CAAC;EAEF,oBAAOX,KAAA,CAAAe,aAAA;IAAKC,SAAS,EAAC;EAAsB,GAAEX,KAAW,CAAC;AAC5D,CAAC;AAED,eAAeJ,cAAc","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["EntityNavLinks"],"sources":["../../../../../src/components/EntityManager/Entity/EntitiyNavLinks/index.js"],"sourcesContent":["import EntityNavLinks from './EntityNavLinks';\n\nexport default EntityNavLinks;\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAE7C,eAAeA,cAAc","ignoreList":[]}
|
|
@@ -1,460 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
const _excluded = ["isValid", "fields", "isNewValueSet", "valuesChecked", "currentField", "value"];
|
|
4
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
/* eslint-disable no-undef */
|
|
7
|
-
import React, { useEffect, useState, useRef } from 'react';
|
|
8
|
-
import { withRouter, Prompt } from 'react-router-dom';
|
|
9
|
-
import { useApolloClient } from '@apollo/client';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
import { RenderHook } from '@blaze-cms/plugin-render-hooks-ui';
|
|
12
|
-
import { getQuery, GET_CURRENT_TAB_ID } from '@blaze-cms/admin-ui-utils';
|
|
13
|
-
import { FormBuilder, parseFormValues } from '@blaze-cms/react-form-builder';
|
|
14
|
-
import { DeleteAction, CopyDataFromAction } from '@blaze-cms/admin';
|
|
15
|
-
import { useToasts } from '@blaze-react/toaster';
|
|
16
|
-
import cloneDeep from 'lodash.clonedeep';
|
|
17
|
-
import { getPageName } from '../utils/data-mappers';
|
|
18
|
-
import isFormEmpty from '../utils/is-form-empty';
|
|
19
|
-
import availableActions from './actions-handlers';
|
|
20
|
-
import SideBarRelations from './SideBarRelations';
|
|
21
|
-
import Tabs from '../../Tabs';
|
|
22
|
-
import useCallbackDebounce from '../../hooks/useCallbackDebounce';
|
|
23
|
-
import { ENTITY_PUBLISHED, TEXT_CONTENT_TYPE, LEAVE_PAGE_MESSAGE, PREVIEW_INTERFACE, PAGE_BUILDER_FIELD_ID, PAGE_BUILDER_TEMPLATE_FIELD_ID, ERROR, SAVE_BUTTON_TEXTS, UNPUBLISHED_WARNING } from '../../../constants';
|
|
24
|
-
import EntityHeader from './EntityHeader';
|
|
25
|
-
import { validateSideBarRelations, canViewPage, onViewUrlClick, getUpdatedFormValues, checkFulfilConditions } from '../utils/entity';
|
|
26
|
-
import useToggle from '../../../utils/hooks/useToggle';
|
|
27
|
-
import InfoBoxes from '../../InfoBoxes/InfoBoxes';
|
|
28
|
-
import { RecordEditContextProvider } from '../utils/RecordEditContext';
|
|
29
|
-
const Entity = ({
|
|
30
|
-
formData,
|
|
31
|
-
entity,
|
|
32
|
-
schema,
|
|
33
|
-
previousQuery,
|
|
34
|
-
action,
|
|
35
|
-
history,
|
|
36
|
-
updateFormData,
|
|
37
|
-
onViewUrl,
|
|
38
|
-
refetchRecord
|
|
39
|
-
}) => {
|
|
40
|
-
var _schema$interfaces, _schema$interfaces2, _formData$values;
|
|
41
|
-
const client = useApolloClient();
|
|
42
|
-
const [, setCurrentTabId] = useState(null);
|
|
43
|
-
const [formValues, setFormValues] = useState(null);
|
|
44
|
-
const [entitySchema, setEntitySchema] = useState(null);
|
|
45
|
-
const [entityData, setEntityData] = useState(null);
|
|
46
|
-
const [entityIdentifier, setEntityIdentifier] = useState(null);
|
|
47
|
-
const [pageTitle, setPageTitle] = useState('');
|
|
48
|
-
const [isSaveButtonAvailable, setIsSaveButtonAvailable] = useState(false);
|
|
49
|
-
const [entityIsPublished, setEntityIsPublish] = useState(formData && formData.values && formData.values.status);
|
|
50
|
-
const [isEnablePublishButton, setEnablePublishButton] = useState(false);
|
|
51
|
-
const [isEnablePreviewButton, setEnablePreviewButton] = useState(false);
|
|
52
|
-
const [modalStatus, setModalStatus] = useToggle(false);
|
|
53
|
-
const [copyModalStatus, setCopyModalStatus] = useToggle(false);
|
|
54
|
-
const [pageBuilderTemplateStatus, setPageBuilderTemplateStatus] = useState(true);
|
|
55
|
-
const [shouldCopyData, setShouldCopyData] = useState(false);
|
|
56
|
-
const [isFormValid, setIsFormValid] = useState(false);
|
|
57
|
-
const [formDataFromCopy, setFormDataFromCopy] = useState(null);
|
|
58
|
-
const [newUpdatedDate, setNewUpdatedDate] = useState(null);
|
|
59
|
-
const [saveButtonText, setSaveButtonText] = useState(SAVE_BUTTON_TEXTS.save);
|
|
60
|
-
const [externalUpdateTime, setExternalUpdateTime] = useState(null);
|
|
61
|
-
const isCreatePage = history.location.pathname.includes('create');
|
|
62
|
-
const [isNewEntity, setIsNewEntity] = useState(isCreatePage);
|
|
63
|
-
const shouldUpdateState = !entityIdentifier || checkFulfilConditions(entity, schema, previousQuery, !entityData) || entityData && entityData.id !== entity.id;
|
|
64
|
-
const clonedFormData = cloneDeep(formData);
|
|
65
|
-
const {
|
|
66
|
-
addToast
|
|
67
|
-
} = useToasts();
|
|
68
|
-
|
|
69
|
-
// Here's how we'll keep track of our component's mounted state
|
|
70
|
-
const componentIsMounted = useRef(true);
|
|
71
|
-
const {
|
|
72
|
-
displayProperties: {
|
|
73
|
-
saveOnChange = false
|
|
74
|
-
}
|
|
75
|
-
} = schema;
|
|
76
|
-
useCallbackDebounce(() => {
|
|
77
|
-
isSaveButtonAvailable && onSubmit();
|
|
78
|
-
}, 500, [isSaveButtonAvailable], !saveOnChange);
|
|
79
|
-
useEffect(() => () => {
|
|
80
|
-
componentIsMounted.current = false;
|
|
81
|
-
}, []); // Using an empty dependency array ensures this only runs on unmount
|
|
82
|
-
|
|
83
|
-
useEffect(() => {
|
|
84
|
-
if (shouldUpdateState) {
|
|
85
|
-
setSaveButtonText(SAVE_BUTTON_TEXTS.save);
|
|
86
|
-
setEntityData(entity);
|
|
87
|
-
setPageTitle(getPageName(schema.displayProperties, entity));
|
|
88
|
-
setEntityIsPublish(entity.status);
|
|
89
|
-
setEntitySchema(schema);
|
|
90
|
-
setEnablePublishButton(schema.actions.publish);
|
|
91
|
-
setEntityIdentifier(schema.identifier);
|
|
92
|
-
setEnablePreviewButton(!!schema.interfaces.includes(PREVIEW_INTERFACE));
|
|
93
|
-
}
|
|
94
|
-
if (formData && pageBuilderTemplateStatus) {
|
|
95
|
-
const isPageBuilderTemplateSet = !!formData.values.pageBuilderTemplateId;
|
|
96
|
-
client.writeQuery({
|
|
97
|
-
query: getQuery('GET_PB_TEMPLATE_STATUS'),
|
|
98
|
-
data: {
|
|
99
|
-
pageBuilderTemplateSet: isPageBuilderTemplateSet,
|
|
100
|
-
pageBuilderTemplateId: formData.values.pageBuilderTemplateId || ''
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
if (schema) {
|
|
105
|
-
client.writeQuery({
|
|
106
|
-
query: getQuery('GET_CURRENT_ENTITY'),
|
|
107
|
-
data: {
|
|
108
|
-
currentEntity: schema.id
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}, [client, entity, entityData, formData, formValues, pageBuilderTemplateStatus, previousQuery, schema, shouldUpdateState]);
|
|
113
|
-
const getFullUrl = async () => {
|
|
114
|
-
const query = getQuery('GET_ENTITY_URL');
|
|
115
|
-
const {
|
|
116
|
-
data: {
|
|
117
|
-
getEntityUrl = ''
|
|
118
|
-
} = {}
|
|
119
|
-
} = await client.query({
|
|
120
|
-
query,
|
|
121
|
-
variables: {
|
|
122
|
-
itemId: entity.id,
|
|
123
|
-
itemEntity: schema.id,
|
|
124
|
-
fullUrl: true
|
|
125
|
-
},
|
|
126
|
-
fetchPolicy: 'network-only'
|
|
127
|
-
});
|
|
128
|
-
return getEntityUrl;
|
|
129
|
-
};
|
|
130
|
-
const getFormValues = values => {
|
|
131
|
-
if (componentIsMounted.current) {
|
|
132
|
-
setFormValues(values);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
const onChangeSideBarRelations = ({
|
|
136
|
-
id,
|
|
137
|
-
value
|
|
138
|
-
}, requiredChildField) => {
|
|
139
|
-
const updatedFormValues = getUpdatedFormValues({
|
|
140
|
-
id,
|
|
141
|
-
value,
|
|
142
|
-
requiredChildField,
|
|
143
|
-
formValues
|
|
144
|
-
});
|
|
145
|
-
const shouldActiveSaveButton = validateSideBarRelations(updatedFormValues, requiredChildField);
|
|
146
|
-
if (isFormValid && shouldActiveSaveButton && componentIsMounted.current) {
|
|
147
|
-
setIsSaveButtonAvailable(true);
|
|
148
|
-
setSaveButtonText(SAVE_BUTTON_TEXTS.save);
|
|
149
|
-
} else if (componentIsMounted.current) {
|
|
150
|
-
setIsSaveButtonAvailable(false);
|
|
151
|
-
}
|
|
152
|
-
if (componentIsMounted.current) {
|
|
153
|
-
setFormValues(updatedFormValues);
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
const onChangeFormValues = async _ref => {
|
|
157
|
-
let {
|
|
158
|
-
isValid,
|
|
159
|
-
fields,
|
|
160
|
-
isNewValueSet,
|
|
161
|
-
valuesChecked,
|
|
162
|
-
currentField,
|
|
163
|
-
value: fieldValue
|
|
164
|
-
} = _ref,
|
|
165
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
166
|
-
let updatedFormValues = valuesChecked ? valuesChecked.slice() : [];
|
|
167
|
-
if (currentField === PAGE_BUILDER_TEMPLATE_FIELD_ID) {
|
|
168
|
-
const pageBuilderTemplateId = fieldValue;
|
|
169
|
-
client.writeQuery({
|
|
170
|
-
query: getQuery('GET_PB_TEMPLATE_STATUS'),
|
|
171
|
-
data: {
|
|
172
|
-
pageBuilderTemplateSet: !!pageBuilderTemplateId,
|
|
173
|
-
pageBuilderTemplateId
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
if (componentIsMounted.current) {
|
|
177
|
-
setPageBuilderTemplateStatus(false);
|
|
178
|
-
}
|
|
179
|
-
const pageBuilder = updatedFormValues.filter(formValue => formValue.id === PAGE_BUILDER_FIELD_ID);
|
|
180
|
-
if (pageBuilderTemplateId) {
|
|
181
|
-
const {
|
|
182
|
-
data = {}
|
|
183
|
-
} = await client.query({
|
|
184
|
-
query: getQuery('MERGE_PB_TEMPLATE_CHANGES'),
|
|
185
|
-
variables: {
|
|
186
|
-
parent: {
|
|
187
|
-
pageBuilder: pageBuilder[0].value,
|
|
188
|
-
pageBuilderTemplateId
|
|
189
|
-
},
|
|
190
|
-
entityIdentifier
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
if (data && data.mergePageBuilderTemplateChanges) {
|
|
194
|
-
updatedFormValues = updatedFormValues.map(updatedFormValue => {
|
|
195
|
-
if (updatedFormValue.id === PAGE_BUILDER_FIELD_ID) {
|
|
196
|
-
return _objectSpread(_objectSpread({}, updatedFormValue), {}, {
|
|
197
|
-
value: data.mergePageBuilderTemplateChanges
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
return updatedFormValue;
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
const itemsToAdd = [];
|
|
206
|
-
if (formValues && formValues.length > updatedFormValues.length) {
|
|
207
|
-
[...updatedFormValues, ...formValues].forEach(item => {
|
|
208
|
-
const index = updatedFormValues.findIndex(value => value.id === item.id);
|
|
209
|
-
if (index === -1) {
|
|
210
|
-
itemsToAdd.push(item);
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
const [updatedEntity = null] = fields.filter(({
|
|
215
|
-
id
|
|
216
|
-
}) => id === 'name');
|
|
217
|
-
updatedEntity && setPageTitle(updatedEntity.value);
|
|
218
|
-
const isValidAndNewValueSet = isValid && isNewValueSet;
|
|
219
|
-
const isNotValidOrNotNewValueSet = !isValid || !isNewValueSet;
|
|
220
|
-
if (componentIsMounted.current) {
|
|
221
|
-
setIsFormValid(isValid);
|
|
222
|
-
}
|
|
223
|
-
if (isValidAndNewValueSet && componentIsMounted.current) {
|
|
224
|
-
setIsSaveButtonAvailable(true);
|
|
225
|
-
setSaveButtonText(SAVE_BUTTON_TEXTS.save);
|
|
226
|
-
}
|
|
227
|
-
if (isNotValidOrNotNewValueSet && componentIsMounted.current) {
|
|
228
|
-
setIsSaveButtonAvailable(false);
|
|
229
|
-
}
|
|
230
|
-
if (componentIsMounted.current) {
|
|
231
|
-
setFormValues([...updatedFormValues, ...itemsToAdd]);
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
const onSubmit = event => {
|
|
235
|
-
event && event.preventDefault();
|
|
236
|
-
if (!isSaveButtonAvailable) return null;
|
|
237
|
-
const parsedFormValues = parseFormValues(formValues);
|
|
238
|
-
const updatedFormValues = newUpdatedDate ? _objectSpread(_objectSpread({}, formData.values), {}, {
|
|
239
|
-
update: newUpdatedDate
|
|
240
|
-
}) : _objectSpread({}, formData.values);
|
|
241
|
-
const handleUpdateFormData = () => updateFormData({
|
|
242
|
-
values: _objectSpread(_objectSpread({}, updatedFormValues), parsedFormValues)
|
|
243
|
-
}, true);
|
|
244
|
-
const submitParams = {
|
|
245
|
-
update: {
|
|
246
|
-
entitySchema,
|
|
247
|
-
entityData,
|
|
248
|
-
parsedFormValues,
|
|
249
|
-
client,
|
|
250
|
-
setIsSaveButtonAvailable,
|
|
251
|
-
setNewUpdatedDate,
|
|
252
|
-
newUpdatedDate,
|
|
253
|
-
previousQuery,
|
|
254
|
-
setSaveButtonText,
|
|
255
|
-
handleUpdateFormData
|
|
256
|
-
},
|
|
257
|
-
create: {
|
|
258
|
-
entitySchema,
|
|
259
|
-
parsedFormValues,
|
|
260
|
-
client,
|
|
261
|
-
setEntityData,
|
|
262
|
-
setIsSaveButtonAvailable,
|
|
263
|
-
history,
|
|
264
|
-
setIsNewEntity,
|
|
265
|
-
setSaveButtonText,
|
|
266
|
-
handleUpdateFormData
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
const currentAction = submitParams[action];
|
|
270
|
-
return availableActions[action].submit(currentAction, addToast);
|
|
271
|
-
};
|
|
272
|
-
const onDelete = async () => {
|
|
273
|
-
const {
|
|
274
|
-
values: {
|
|
275
|
-
id
|
|
276
|
-
}
|
|
277
|
-
} = formData;
|
|
278
|
-
if (componentIsMounted.current) {
|
|
279
|
-
setIsSaveButtonAvailable(false);
|
|
280
|
-
}
|
|
281
|
-
await availableActions.delete.submit({
|
|
282
|
-
entitySchema,
|
|
283
|
-
client,
|
|
284
|
-
parsedFormValues: {
|
|
285
|
-
id
|
|
286
|
-
}
|
|
287
|
-
}, addToast);
|
|
288
|
-
history.push(`/data-listing/${entitySchema.id}`);
|
|
289
|
-
};
|
|
290
|
-
const onCopy = () => {
|
|
291
|
-
if (formDataFromCopy && componentIsMounted.current) {
|
|
292
|
-
updateFormData(formDataFromCopy);
|
|
293
|
-
setShouldCopyData(true);
|
|
294
|
-
setIsSaveButtonAvailable(true);
|
|
295
|
-
setSaveButtonText(SAVE_BUTTON_TEXTS.save);
|
|
296
|
-
if (formDataFromCopy.values.name) {
|
|
297
|
-
setPageTitle(formDataFromCopy.values.name);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
const updateCopyData = () => {
|
|
302
|
-
setCopyModalStatus(!copyModalStatus);
|
|
303
|
-
setShouldCopyData(false);
|
|
304
|
-
};
|
|
305
|
-
const handleCopyDataFromClose = () => {
|
|
306
|
-
setCopyModalStatus(false);
|
|
307
|
-
setFormDataFromCopy(null);
|
|
308
|
-
};
|
|
309
|
-
const getFormData = formDataValues => {
|
|
310
|
-
const formDataUpdated = {
|
|
311
|
-
values: _objectSpread({}, formDataValues)
|
|
312
|
-
};
|
|
313
|
-
setFormDataFromCopy(formDataUpdated);
|
|
314
|
-
};
|
|
315
|
-
const handlePublishAndUnpublish = async ({
|
|
316
|
-
target: {
|
|
317
|
-
textContent
|
|
318
|
-
}
|
|
319
|
-
}) => {
|
|
320
|
-
const isPublishButton = textContent === TEXT_CONTENT_TYPE;
|
|
321
|
-
const isPublished = entityIsPublished === ENTITY_PUBLISHED;
|
|
322
|
-
const isUnpublish = checkFulfilConditions(!isPublishButton, !isPublished);
|
|
323
|
-
if (isUnpublish) {
|
|
324
|
-
return addToast(UNPUBLISHED_WARNING, {
|
|
325
|
-
appearance: 'warning',
|
|
326
|
-
autoDismiss: true
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
if (checkFulfilConditions(isPublishButton, isSaveButtonAvailable)) {
|
|
330
|
-
const savedPageMessage = await onSubmit();
|
|
331
|
-
if (savedPageMessage === ERROR) {
|
|
332
|
-
return addToast(`Content not published`, {
|
|
333
|
-
appearance: ERROR,
|
|
334
|
-
autoDismiss: true
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
return availableActions.shared.triggerPublish({
|
|
339
|
-
entityData,
|
|
340
|
-
client,
|
|
341
|
-
setEntityIsPublish,
|
|
342
|
-
entitySchema,
|
|
343
|
-
textContent,
|
|
344
|
-
refetchRecord
|
|
345
|
-
}, addToast);
|
|
346
|
-
};
|
|
347
|
-
const showModal = checkFulfilConditions(formData, modalStatus);
|
|
348
|
-
const onViewUrlHandler = canViewPage(formData, entity, schema, entityIsPublished) ? () => onViewUrlClick(getFullUrl) : onViewUrl;
|
|
349
|
-
const pageName = formData && formData.values && formData.values.name;
|
|
350
|
-
const hasNewFormValues = checkFulfilConditions(isNewEntity, !isFormEmpty(formValues));
|
|
351
|
-
const hasToDisplayPrompt = isSaveButtonAvailable || hasNewFormValues;
|
|
352
|
-
const showSideBarRelations = checkFulfilConditions(schema, formData);
|
|
353
|
-
const showPageBuilderTabs = (schema === null || schema === void 0 ? void 0 : (_schema$interfaces = schema.interfaces) === null || _schema$interfaces === void 0 ? void 0 : _schema$interfaces.includes('page-builder/page-builder-template')) || (schema === null || schema === void 0 ? void 0 : (_schema$interfaces2 = schema.interfaces) === null || _schema$interfaces2 === void 0 ? void 0 : _schema$interfaces2.includes('page-builder/page-builder'));
|
|
354
|
-
return /*#__PURE__*/React.createElement(RecordEditContextProvider, {
|
|
355
|
-
value: {
|
|
356
|
-
externalUpdateTime,
|
|
357
|
-
updated: formData === null || formData === void 0 ? void 0 : (_formData$values = formData.values) === null || _formData$values === void 0 ? void 0 : _formData$values.updated
|
|
358
|
-
}
|
|
359
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
360
|
-
className: "page"
|
|
361
|
-
}, /*#__PURE__*/React.createElement(EntityHeader, {
|
|
362
|
-
entityData: entityData,
|
|
363
|
-
entityIdentifier: entityIdentifier,
|
|
364
|
-
pageTitle: pageTitle,
|
|
365
|
-
pageName: pageName,
|
|
366
|
-
onSubmit: onSubmit,
|
|
367
|
-
handlePublishAndUnpublish: handlePublishAndUnpublish,
|
|
368
|
-
isSaveButtonAvailable: isSaveButtonAvailable,
|
|
369
|
-
isEnablePublishButton: isEnablePublishButton,
|
|
370
|
-
isEnablePreviewButton: isEnablePreviewButton,
|
|
371
|
-
toggleCopyModal: setCopyModalStatus,
|
|
372
|
-
toggleModal: setModalStatus,
|
|
373
|
-
formData: formData,
|
|
374
|
-
onViewUrl: onViewUrlHandler,
|
|
375
|
-
saveButtonText: saveButtonText,
|
|
376
|
-
saveOnChange: saveOnChange,
|
|
377
|
-
entitySchema: entitySchema
|
|
378
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
379
|
-
className: "page-wrapper__content"
|
|
380
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
381
|
-
className: "tabs-wrapper tabs-wrapper__tab"
|
|
382
|
-
}, /*#__PURE__*/React.createElement(Prompt, {
|
|
383
|
-
when: hasToDisplayPrompt,
|
|
384
|
-
message: LEAVE_PAGE_MESSAGE
|
|
385
|
-
}), showModal && /*#__PURE__*/React.createElement(DeleteAction, {
|
|
386
|
-
onClose: setModalStatus,
|
|
387
|
-
deleteAction: onDelete,
|
|
388
|
-
itemName: formData.values.name
|
|
389
|
-
}), copyModalStatus && /*#__PURE__*/React.createElement(CopyDataFromAction, {
|
|
390
|
-
onClose: handleCopyDataFromClose,
|
|
391
|
-
copyAction: onCopy,
|
|
392
|
-
getFormData: getFormData
|
|
393
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
394
|
-
className: "page__content--fixed"
|
|
395
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
396
|
-
className: "page__content"
|
|
397
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
398
|
-
className: "content"
|
|
399
|
-
}, /*#__PURE__*/React.createElement(RenderHook, {
|
|
400
|
-
hookKey: `entity:${action}:main:top`,
|
|
401
|
-
entity: entity,
|
|
402
|
-
schema: schema
|
|
403
|
-
}), /*#__PURE__*/React.createElement(InfoBoxes, {
|
|
404
|
-
id: entity.id,
|
|
405
|
-
schema: schema
|
|
406
|
-
}), /*#__PURE__*/React.createElement(Tabs, {
|
|
407
|
-
enabled: showPageBuilderTabs,
|
|
408
|
-
onTabChange: tabId => {
|
|
409
|
-
client.writeQuery({
|
|
410
|
-
query: GET_CURRENT_TAB_ID,
|
|
411
|
-
data: {
|
|
412
|
-
currentTabId: tabId
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
setCurrentTabId(tabId);
|
|
416
|
-
}
|
|
417
|
-
}, /*#__PURE__*/React.createElement(FormBuilder, {
|
|
418
|
-
getIsFormValid: setIsFormValid,
|
|
419
|
-
getFormValues: getFormValues,
|
|
420
|
-
schema: schema,
|
|
421
|
-
data: clonedFormData,
|
|
422
|
-
onChange: onChangeFormValues,
|
|
423
|
-
shouldCopyData: shouldCopyData,
|
|
424
|
-
updateCopyData: updateCopyData,
|
|
425
|
-
formValues: formValues,
|
|
426
|
-
isNewEntity: isNewEntity,
|
|
427
|
-
onExternalUpdate: setExternalUpdateTime
|
|
428
|
-
})), /*#__PURE__*/React.createElement(RenderHook, {
|
|
429
|
-
hookKey: `entity:${action}:main:bottom`,
|
|
430
|
-
entity: entity,
|
|
431
|
-
schema: schema
|
|
432
|
-
}))))), /*#__PURE__*/React.createElement("div", {
|
|
433
|
-
className: "column column--one-third page-sidebar page-sidebar--relations"
|
|
434
|
-
}, showSideBarRelations && /*#__PURE__*/React.createElement(SideBarRelations, {
|
|
435
|
-
entity: entity,
|
|
436
|
-
formData: formData.values,
|
|
437
|
-
schema: schema,
|
|
438
|
-
onChange: onChangeSideBarRelations
|
|
439
|
-
})))));
|
|
440
|
-
};
|
|
441
|
-
Entity.propTypes = {
|
|
442
|
-
entity: PropTypes.object,
|
|
443
|
-
schema: PropTypes.object,
|
|
444
|
-
previousQuery: PropTypes.object,
|
|
445
|
-
action: PropTypes.string.isRequired,
|
|
446
|
-
history: PropTypes.object.isRequired,
|
|
447
|
-
formData: PropTypes.object,
|
|
448
|
-
updateFormData: PropTypes.func.isRequired,
|
|
449
|
-
onViewUrl: PropTypes.func,
|
|
450
|
-
refetchRecord: PropTypes.func.isRequired
|
|
451
|
-
};
|
|
452
|
-
Entity.defaultProps = {
|
|
453
|
-
previousQuery: null,
|
|
454
|
-
schema: null,
|
|
455
|
-
entity: null,
|
|
456
|
-
formData: null,
|
|
457
|
-
onViewUrl: null
|
|
458
|
-
};
|
|
459
|
-
export default withRouter(Entity);
|
|
460
|
-
//# sourceMappingURL=Entity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Entity.js","names":["React","useEffect","useState","useRef","withRouter","Prompt","useApolloClient","PropTypes","RenderHook","getQuery","GET_CURRENT_TAB_ID","FormBuilder","parseFormValues","DeleteAction","CopyDataFromAction","useToasts","cloneDeep","getPageName","isFormEmpty","availableActions","SideBarRelations","Tabs","useCallbackDebounce","ENTITY_PUBLISHED","TEXT_CONTENT_TYPE","LEAVE_PAGE_MESSAGE","PREVIEW_INTERFACE","PAGE_BUILDER_FIELD_ID","PAGE_BUILDER_TEMPLATE_FIELD_ID","ERROR","SAVE_BUTTON_TEXTS","UNPUBLISHED_WARNING","EntityHeader","validateSideBarRelations","canViewPage","onViewUrlClick","getUpdatedFormValues","checkFulfilConditions","useToggle","InfoBoxes","RecordEditContextProvider","Entity","formData","entity","schema","previousQuery","action","history","updateFormData","onViewUrl","refetchRecord","_schema$interfaces","_schema$interfaces2","_formData$values","client","setCurrentTabId","formValues","setFormValues","entitySchema","setEntitySchema","entityData","setEntityData","entityIdentifier","setEntityIdentifier","pageTitle","setPageTitle","isSaveButtonAvailable","setIsSaveButtonAvailable","entityIsPublished","setEntityIsPublish","values","status","isEnablePublishButton","setEnablePublishButton","isEnablePreviewButton","setEnablePreviewButton","modalStatus","setModalStatus","copyModalStatus","setCopyModalStatus","pageBuilderTemplateStatus","setPageBuilderTemplateStatus","shouldCopyData","setShouldCopyData","isFormValid","setIsFormValid","formDataFromCopy","setFormDataFromCopy","newUpdatedDate","setNewUpdatedDate","saveButtonText","setSaveButtonText","save","externalUpdateTime","setExternalUpdateTime","isCreatePage","location","pathname","includes","isNewEntity","setIsNewEntity","shouldUpdateState","id","clonedFormData","addToast","componentIsMounted","displayProperties","saveOnChange","onSubmit","current","actions","publish","identifier","interfaces","isPageBuilderTemplateSet","pageBuilderTemplateId","writeQuery","query","data","pageBuilderTemplateSet","currentEntity","getFullUrl","getEntityUrl","variables","itemId","itemEntity","fullUrl","fetchPolicy","getFormValues","onChangeSideBarRelations","value","requiredChildField","updatedFormValues","shouldActiveSaveButton","onChangeFormValues","_ref","isValid","fields","isNewValueSet","valuesChecked","currentField","fieldValue","otherProps","_objectWithoutProperties","_excluded","slice","pageBuilder","filter","formValue","parent","mergePageBuilderTemplateChanges","map","updatedFormValue","_objectSpread","itemsToAdd","length","forEach","item","index","findIndex","push","updatedEntity","isValidAndNewValueSet","isNotValidOrNotNewValueSet","event","preventDefault","parsedFormValues","update","handleUpdateFormData","submitParams","create","currentAction","submit","onDelete","delete","onCopy","name","updateCopyData","handleCopyDataFromClose","getFormData","formDataValues","formDataUpdated","handlePublishAndUnpublish","target","textContent","isPublishButton","isPublished","isUnpublish","appearance","autoDismiss","savedPageMessage","shared","triggerPublish","showModal","onViewUrlHandler","pageName","hasNewFormValues","hasToDisplayPrompt","showSideBarRelations","showPageBuilderTabs","createElement","updated","className","toggleCopyModal","toggleModal","when","message","onClose","deleteAction","itemName","copyAction","hookKey","enabled","onTabChange","tabId","currentTabId","getIsFormValid","onChange","onExternalUpdate","propTypes","object","string","isRequired","func","defaultProps"],"sources":["../../../../src/components/EntityManager/Entity/Entity.js"],"sourcesContent":["/* eslint-disable no-undef */\nimport React, { useEffect, useState, useRef } from 'react';\nimport { withRouter, Prompt } from 'react-router-dom';\nimport { useApolloClient } from '@apollo/client';\nimport PropTypes from 'prop-types';\nimport { RenderHook } from '@blaze-cms/plugin-render-hooks-ui';\nimport { getQuery, GET_CURRENT_TAB_ID } from '@blaze-cms/admin-ui-utils';\nimport { FormBuilder, parseFormValues } from '@blaze-cms/react-form-builder';\nimport { DeleteAction, CopyDataFromAction } from '@blaze-cms/admin';\nimport { useToasts } from '@blaze-react/toaster';\nimport cloneDeep from 'lodash.clonedeep';\nimport { getPageName } from '../utils/data-mappers';\nimport isFormEmpty from '../utils/is-form-empty';\nimport availableActions from './actions-handlers';\nimport SideBarRelations from './SideBarRelations';\nimport Tabs from '../../Tabs';\nimport useCallbackDebounce from '../../hooks/useCallbackDebounce';\n\nimport {\n ENTITY_PUBLISHED,\n TEXT_CONTENT_TYPE,\n LEAVE_PAGE_MESSAGE,\n PREVIEW_INTERFACE,\n PAGE_BUILDER_FIELD_ID,\n PAGE_BUILDER_TEMPLATE_FIELD_ID,\n ERROR,\n SAVE_BUTTON_TEXTS,\n UNPUBLISHED_WARNING\n} from '../../../constants';\nimport EntityHeader from './EntityHeader';\n\nimport {\n validateSideBarRelations,\n canViewPage,\n onViewUrlClick,\n getUpdatedFormValues,\n checkFulfilConditions\n} from '../utils/entity';\nimport useToggle from '../../../utils/hooks/useToggle';\nimport InfoBoxes from '../../InfoBoxes/InfoBoxes';\nimport { RecordEditContextProvider } from '../utils/RecordEditContext';\n\nconst Entity = ({\n formData,\n entity,\n schema,\n previousQuery,\n action,\n history,\n updateFormData,\n onViewUrl,\n refetchRecord\n}) => {\n const client = useApolloClient();\n const [, setCurrentTabId] = useState(null);\n const [formValues, setFormValues] = useState(null);\n const [entitySchema, setEntitySchema] = useState(null);\n const [entityData, setEntityData] = useState(null);\n const [entityIdentifier, setEntityIdentifier] = useState(null);\n const [pageTitle, setPageTitle] = useState('');\n const [isSaveButtonAvailable, setIsSaveButtonAvailable] = useState(false);\n const [entityIsPublished, setEntityIsPublish] = useState(\n formData && formData.values && formData.values.status\n );\n const [isEnablePublishButton, setEnablePublishButton] = useState(false);\n const [isEnablePreviewButton, setEnablePreviewButton] = useState(false);\n const [modalStatus, setModalStatus] = useToggle(false);\n const [copyModalStatus, setCopyModalStatus] = useToggle(false);\n const [pageBuilderTemplateStatus, setPageBuilderTemplateStatus] = useState(true);\n const [shouldCopyData, setShouldCopyData] = useState(false);\n const [isFormValid, setIsFormValid] = useState(false);\n const [formDataFromCopy, setFormDataFromCopy] = useState(null);\n const [newUpdatedDate, setNewUpdatedDate] = useState(null);\n const [saveButtonText, setSaveButtonText] = useState(SAVE_BUTTON_TEXTS.save);\n const [externalUpdateTime, setExternalUpdateTime] = useState(null);\n\n const isCreatePage = history.location.pathname.includes('create');\n const [isNewEntity, setIsNewEntity] = useState(isCreatePage);\n\n const shouldUpdateState =\n !entityIdentifier ||\n checkFulfilConditions(entity, schema, previousQuery, !entityData) ||\n (entityData && entityData.id !== entity.id);\n const clonedFormData = cloneDeep(formData);\n const { addToast } = useToasts();\n\n // Here's how we'll keep track of our component's mounted state\n const componentIsMounted = useRef(true);\n\n const {\n displayProperties: { saveOnChange = false }\n } = schema;\n\n useCallbackDebounce(\n () => {\n isSaveButtonAvailable && onSubmit();\n },\n 500,\n [isSaveButtonAvailable],\n !saveOnChange\n );\n\n useEffect(\n () => () => {\n componentIsMounted.current = false;\n },\n []\n ); // Using an empty dependency array ensures this only runs on unmount\n\n useEffect(() => {\n if (shouldUpdateState) {\n setSaveButtonText(SAVE_BUTTON_TEXTS.save);\n setEntityData(entity);\n setPageTitle(getPageName(schema.displayProperties, entity));\n setEntityIsPublish(entity.status);\n setEntitySchema(schema);\n setEnablePublishButton(schema.actions.publish);\n setEntityIdentifier(schema.identifier);\n setEnablePreviewButton(!!schema.interfaces.includes(PREVIEW_INTERFACE));\n }\n\n if (formData && pageBuilderTemplateStatus) {\n const isPageBuilderTemplateSet = !!formData.values.pageBuilderTemplateId;\n client.writeQuery({\n query: getQuery('GET_PB_TEMPLATE_STATUS'),\n data: {\n pageBuilderTemplateSet: isPageBuilderTemplateSet,\n pageBuilderTemplateId: formData.values.pageBuilderTemplateId || ''\n }\n });\n }\n if (schema) {\n client.writeQuery({\n query: getQuery('GET_CURRENT_ENTITY'),\n data: {\n currentEntity: schema.id\n }\n });\n }\n }, [\n client,\n entity,\n entityData,\n formData,\n formValues,\n pageBuilderTemplateStatus,\n previousQuery,\n schema,\n shouldUpdateState\n ]);\n\n const getFullUrl = async () => {\n const query = getQuery('GET_ENTITY_URL');\n const { data: { getEntityUrl = '' } = {} } = await client.query({\n query,\n variables: { itemId: entity.id, itemEntity: schema.id, fullUrl: true },\n fetchPolicy: 'network-only'\n });\n return getEntityUrl;\n };\n\n const getFormValues = values => {\n if (componentIsMounted.current) {\n setFormValues(values);\n }\n };\n\n const onChangeSideBarRelations = ({ id, value }, requiredChildField) => {\n const updatedFormValues = getUpdatedFormValues({ id, value, requiredChildField, formValues });\n\n const shouldActiveSaveButton = validateSideBarRelations(updatedFormValues, requiredChildField);\n\n if (isFormValid && shouldActiveSaveButton && componentIsMounted.current) {\n setIsSaveButtonAvailable(true);\n setSaveButtonText(SAVE_BUTTON_TEXTS.save);\n } else if (componentIsMounted.current) {\n setIsSaveButtonAvailable(false);\n }\n\n if (componentIsMounted.current) {\n setFormValues(updatedFormValues);\n }\n };\n\n const onChangeFormValues = async ({\n isValid,\n fields,\n isNewValueSet,\n valuesChecked,\n currentField,\n value: fieldValue,\n ...otherProps\n }) => {\n let updatedFormValues = valuesChecked ? valuesChecked.slice() : [];\n if (currentField === PAGE_BUILDER_TEMPLATE_FIELD_ID) {\n const pageBuilderTemplateId = fieldValue;\n client.writeQuery({\n query: getQuery('GET_PB_TEMPLATE_STATUS'),\n data: {\n pageBuilderTemplateSet: !!pageBuilderTemplateId,\n pageBuilderTemplateId\n }\n });\n\n if (componentIsMounted.current) {\n setPageBuilderTemplateStatus(false);\n }\n\n const pageBuilder = updatedFormValues.filter(\n formValue => formValue.id === PAGE_BUILDER_FIELD_ID\n );\n\n if (pageBuilderTemplateId) {\n const { data = {} } = await client.query({\n query: getQuery('MERGE_PB_TEMPLATE_CHANGES'),\n variables: {\n parent: {\n pageBuilder: pageBuilder[0].value,\n pageBuilderTemplateId\n },\n entityIdentifier\n }\n });\n\n if (data && data.mergePageBuilderTemplateChanges) {\n updatedFormValues = updatedFormValues.map(updatedFormValue => {\n if (updatedFormValue.id === PAGE_BUILDER_FIELD_ID) {\n return {\n ...updatedFormValue,\n value: data.mergePageBuilderTemplateChanges\n };\n }\n return updatedFormValue;\n });\n }\n }\n }\n const itemsToAdd = [];\n if (formValues && formValues.length > updatedFormValues.length) {\n [...updatedFormValues, ...formValues].forEach(item => {\n const index = updatedFormValues.findIndex(value => value.id === item.id);\n if (index === -1) {\n itemsToAdd.push(item);\n }\n });\n }\n\n const [updatedEntity = null] = fields.filter(({ id }) => id === 'name');\n updatedEntity && setPageTitle(updatedEntity.value);\n\n const isValidAndNewValueSet = isValid && isNewValueSet;\n const isNotValidOrNotNewValueSet = !isValid || !isNewValueSet;\n if (componentIsMounted.current) {\n setIsFormValid(isValid);\n }\n\n if (isValidAndNewValueSet && componentIsMounted.current) {\n setIsSaveButtonAvailable(true);\n setSaveButtonText(SAVE_BUTTON_TEXTS.save);\n }\n\n if (isNotValidOrNotNewValueSet && componentIsMounted.current) {\n setIsSaveButtonAvailable(false);\n }\n\n if (componentIsMounted.current) {\n setFormValues([...updatedFormValues, ...itemsToAdd]);\n }\n };\n\n const onSubmit = event => {\n event && event.preventDefault();\n\n if (!isSaveButtonAvailable) return null;\n const parsedFormValues = parseFormValues(formValues);\n\n const updatedFormValues = newUpdatedDate\n ? { ...formData.values, update: newUpdatedDate }\n : { ...formData.values };\n\n const handleUpdateFormData = () =>\n updateFormData(\n {\n values: { ...updatedFormValues, ...parsedFormValues }\n },\n true\n );\n\n const submitParams = {\n update: {\n entitySchema,\n entityData,\n parsedFormValues,\n client,\n setIsSaveButtonAvailable,\n setNewUpdatedDate,\n newUpdatedDate,\n previousQuery,\n setSaveButtonText,\n handleUpdateFormData\n },\n create: {\n entitySchema,\n parsedFormValues,\n client,\n setEntityData,\n setIsSaveButtonAvailable,\n history,\n setIsNewEntity,\n setSaveButtonText,\n handleUpdateFormData\n }\n };\n\n const currentAction = submitParams[action];\n return availableActions[action].submit(currentAction, addToast);\n };\n\n const onDelete = async () => {\n const {\n values: { id }\n } = formData;\n\n if (componentIsMounted.current) {\n setIsSaveButtonAvailable(false);\n }\n\n await availableActions.delete.submit(\n {\n entitySchema,\n client,\n parsedFormValues: { id }\n },\n addToast\n );\n\n history.push(`/data-listing/${entitySchema.id}`);\n };\n\n const onCopy = () => {\n if (formDataFromCopy && componentIsMounted.current) {\n updateFormData(formDataFromCopy);\n setShouldCopyData(true);\n setIsSaveButtonAvailable(true);\n setSaveButtonText(SAVE_BUTTON_TEXTS.save);\n if (formDataFromCopy.values.name) {\n setPageTitle(formDataFromCopy.values.name);\n }\n }\n };\n\n const updateCopyData = () => {\n setCopyModalStatus(!copyModalStatus);\n setShouldCopyData(false);\n };\n\n const handleCopyDataFromClose = () => {\n setCopyModalStatus(false);\n setFormDataFromCopy(null);\n };\n\n const getFormData = formDataValues => {\n const formDataUpdated = {\n values: { ...formDataValues }\n };\n setFormDataFromCopy(formDataUpdated);\n };\n\n const handlePublishAndUnpublish = async ({ target: { textContent } }) => {\n const isPublishButton = textContent === TEXT_CONTENT_TYPE;\n const isPublished = entityIsPublished === ENTITY_PUBLISHED;\n\n const isUnpublish = checkFulfilConditions(!isPublishButton, !isPublished);\n\n if (isUnpublish) {\n return addToast(UNPUBLISHED_WARNING, {\n appearance: 'warning',\n autoDismiss: true\n });\n }\n\n if (checkFulfilConditions(isPublishButton, isSaveButtonAvailable)) {\n const savedPageMessage = await onSubmit();\n\n if (savedPageMessage === ERROR) {\n return addToast(`Content not published`, {\n appearance: ERROR,\n autoDismiss: true\n });\n }\n }\n\n return availableActions.shared.triggerPublish(\n {\n entityData,\n client,\n setEntityIsPublish,\n entitySchema,\n textContent,\n refetchRecord\n },\n addToast\n );\n };\n\n const showModal = checkFulfilConditions(formData, modalStatus);\n\n const onViewUrlHandler = canViewPage(formData, entity, schema, entityIsPublished)\n ? () => onViewUrlClick(getFullUrl)\n : onViewUrl;\n\n const pageName = formData && formData.values && formData.values.name;\n\n const hasNewFormValues = checkFulfilConditions(isNewEntity, !isFormEmpty(formValues));\n const hasToDisplayPrompt = isSaveButtonAvailable || hasNewFormValues;\n\n const showSideBarRelations = checkFulfilConditions(schema, formData);\n const showPageBuilderTabs =\n schema?.interfaces?.includes('page-builder/page-builder-template') ||\n schema?.interfaces?.includes('page-builder/page-builder');\n\n return (\n <RecordEditContextProvider value={{ externalUpdateTime, updated: formData?.values?.updated }}>\n <div className=\"page\">\n <EntityHeader\n entityData={entityData}\n entityIdentifier={entityIdentifier}\n pageTitle={pageTitle}\n pageName={pageName}\n onSubmit={onSubmit}\n handlePublishAndUnpublish={handlePublishAndUnpublish}\n isSaveButtonAvailable={isSaveButtonAvailable}\n isEnablePublishButton={isEnablePublishButton}\n isEnablePreviewButton={isEnablePreviewButton}\n toggleCopyModal={setCopyModalStatus}\n toggleModal={setModalStatus}\n formData={formData}\n onViewUrl={onViewUrlHandler}\n saveButtonText={saveButtonText}\n saveOnChange={saveOnChange}\n entitySchema={entitySchema}\n />\n <div className=\"page-wrapper__content\">\n <div className=\"tabs-wrapper tabs-wrapper__tab\">\n <Prompt when={hasToDisplayPrompt} message={LEAVE_PAGE_MESSAGE} />\n {showModal && (\n <DeleteAction\n onClose={setModalStatus}\n deleteAction={onDelete}\n itemName={formData.values.name}\n />\n )}\n {copyModalStatus && (\n <CopyDataFromAction\n onClose={handleCopyDataFromClose}\n copyAction={onCopy}\n getFormData={getFormData}\n />\n )}\n\n <div className=\"page__content--fixed\">\n <div className=\"page__content\">\n <div className=\"content\">\n <RenderHook\n hookKey={`entity:${action}:main:top`}\n entity={entity}\n schema={schema}\n />\n <InfoBoxes id={entity.id} schema={schema} />\n <Tabs\n enabled={showPageBuilderTabs}\n onTabChange={tabId => {\n client.writeQuery({\n query: GET_CURRENT_TAB_ID,\n data: { currentTabId: tabId }\n });\n setCurrentTabId(tabId);\n }}>\n <FormBuilder\n getIsFormValid={setIsFormValid}\n getFormValues={getFormValues}\n schema={schema}\n data={clonedFormData}\n onChange={onChangeFormValues}\n shouldCopyData={shouldCopyData}\n updateCopyData={updateCopyData}\n formValues={formValues}\n isNewEntity={isNewEntity}\n onExternalUpdate={setExternalUpdateTime}\n />\n </Tabs>\n <RenderHook\n hookKey={`entity:${action}:main:bottom`}\n entity={entity}\n schema={schema}\n />\n </div>\n </div>\n </div>\n </div>\n\n <div className=\"column column--one-third page-sidebar page-sidebar--relations\">\n {showSideBarRelations && (\n <SideBarRelations\n entity={entity}\n formData={formData.values}\n schema={schema}\n onChange={onChangeSideBarRelations}\n />\n )}\n </div>\n </div>\n </div>\n </RecordEditContextProvider>\n );\n};\n\nEntity.propTypes = {\n entity: PropTypes.object,\n schema: PropTypes.object,\n previousQuery: PropTypes.object,\n action: PropTypes.string.isRequired,\n history: PropTypes.object.isRequired,\n formData: PropTypes.object,\n updateFormData: PropTypes.func.isRequired,\n onViewUrl: PropTypes.func,\n refetchRecord: PropTypes.func.isRequired\n};\n\nEntity.defaultProps = {\n previousQuery: null,\n schema: null,\n entity: null,\n formData: null,\n onViewUrl: null\n};\n\nexport default withRouter(Entity);\n"],"mappings":";;;;;AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,OAAO;AAC1D,SAASC,UAAU,EAAEC,MAAM,QAAQ,kBAAkB;AACrD,SAASC,eAAe,QAAQ,gBAAgB;AAChD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,UAAU,QAAQ,mCAAmC;AAC9D,SAASC,QAAQ,EAAEC,kBAAkB,QAAQ,2BAA2B;AACxE,SAASC,WAAW,EAAEC,eAAe,QAAQ,+BAA+B;AAC5E,SAASC,YAAY,EAAEC,kBAAkB,QAAQ,kBAAkB;AACnE,SAASC,SAAS,QAAQ,sBAAsB;AAChD,OAAOC,SAAS,MAAM,kBAAkB;AACxC,SAASC,WAAW,QAAQ,uBAAuB;AACnD,OAAOC,WAAW,MAAM,wBAAwB;AAChD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,YAAY;AAC7B,OAAOC,mBAAmB,MAAM,iCAAiC;AAEjE,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,EAClBC,iBAAiB,EACjBC,qBAAqB,EACrBC,8BAA8B,EAC9BC,KAAK,EACLC,iBAAiB,EACjBC,mBAAmB,QACd,oBAAoB;AAC3B,OAAOC,YAAY,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