@blaze-cms/plugin-data-ui 0.146.0-translations.6 → 0.147.0-rc-eagle.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 -19
- 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 -17
- 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 -19
- 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 -16
- 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 -83
- 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/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib-es/components/EntityDataListing/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/Entity.js +21 -28
- package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +6 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +2 -0
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +26 -7
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +8 -2
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/index.js.map +1 -1
- package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
- package/lib-es/components/EntityManager/index.js.map +1 -1
- package/lib-es/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
- package/lib-es/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib-es/components/EntityManager/utils/entity.js +6 -2
- package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
- package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib-es/components/EntityManager/utils/is-form-empty.js.map +1 -1
- package/lib-es/components/EntityManager/utils/query.js.map +1 -1
- package/lib-es/components/InfoBoxes/InfoBoxTooltip.js +36 -0
- package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +1 -0
- package/lib-es/components/InfoBoxes/InfoBoxes.js.map +1 -1
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +2 -0
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
- package/lib-es/components/InfoBoxes/index.js.map +1 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js +4 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTable.js +12 -11
- package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +34 -16
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTableContent/index.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js +207 -0
- package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -0
- package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js +40 -0
- package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -0
- package/lib-es/components/ListingTable/SearchFilter/helpers.js +96 -0
- package/lib-es/components/ListingTable/SearchFilter/helpers.js.map +1 -0
- package/lib-es/components/ListingTable/SearchFilter/querys.js +8 -0
- package/lib-es/components/ListingTable/SearchFilter/querys.js.map +1 -0
- package/lib-es/components/ListingTable/TableActions/TableActions.js.map +1 -1
- package/lib-es/components/ListingTable/TableActions/index.js.map +1 -1
- package/lib-es/components/ListingTable/index.js.map +1 -1
- package/lib-es/components/ListingTable/mappers/populate-rows.js +3 -0
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib-es/components/ListingTable/service/index.js +3 -2
- package/lib-es/components/ListingTable/service/index.js.map +1 -1
- package/lib-es/components/Tabs/index.js +6 -7
- package/lib-es/components/Tabs/index.js.map +1 -1
- package/lib-es/components/hooks/useCallbackDebounce.js.map +1 -1
- package/lib-es/constants.js +4 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/icons/ContentIcon.js.map +1 -1
- package/lib-es/icons/SettingsIcon.js.map +1 -1
- package/lib-es/icons/TaxonomyIcon.js.map +1 -1
- package/lib-es/icons/UsersIcon.js.map +1 -1
- package/lib-es/icons/index.js.map +1 -1
- package/lib-es/index.js +11 -3
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/add-content-menu-items.js.map +1 -1
- package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
- package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib-es/utils/build-listing-query.js +4 -4
- package/lib-es/utils/build-listing-query.js.map +1 -1
- package/lib-es/utils/build-update-data-query.js.map +1 -1
- package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib-es/utils/get-default-query-params.js.map +1 -1
- package/lib-es/utils/hoc/withContext.js +1 -1
- package/lib-es/utils/hoc/withContext.js.map +1 -1
- package/lib-es/utils/hooks/useToggle.js.map +1 -1
- package/lib-es/utils/index.js.map +1 -1
- package/package.json +28 -22
- package/src/components/EntityManager/Entity/Entity.js +72 -80
- package/src/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
- 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/hooks/useCustomSidebarData.js +9 -7
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +82 -59
- package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +5 -3
- package/src/components/EntityManager/EntityManager.js +52 -45
- package/src/components/EntityManager/utils/entity.js +13 -2
- package/src/components/InfoBoxes/InfoBoxTooltip.js +32 -0
- package/src/components/InfoBoxes/container/InfoBoxContainer.js +3 -6
- package/src/components/InfoBoxes/helpers/build-dynamic-query.js +2 -0
- package/src/components/InfoBoxes/hooks/useData.js +6 -1
- package/src/components/InfoBoxes/presentational/InfoBox.js +4 -2
- package/src/components/ListingTable/ListingTable.js +23 -31
- package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +43 -27
- 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 +3 -4
- 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/CHANGELOG.md +0 -1939
- package/babel.config.js +0 -3
- package/jest.config.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_v","_client","_adminUiUtils","_reactFormBuilder","_classnames","_versioningUi","_constants","_CustomSidebarInfoContainer","_EntitiyNavLinks","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","SideBarRelations","_ref","schema","onChange","formData","entity","RelationComponent","formFieldTypes","relation","formattedStatus","formattedUpdated","formattedCreated","formattedPublished","status","client","useApolloClient","_useState","useState","_useState2","_slicedToArray2","relationsComponents","setRelationsComponents","useEffect","_asyncToGenerator2","_regenerator","mark","_callee3","fetchRelationSchema","allRelationComponents","wrap","_callee3$","_context3","prev","next","_ref4","_callee","_ref3","entityIdentifier","_yield$client$query","_yield$client$query$d","relationSchema","_callee$","_context","abrupt","query","getQuery","variables","identifier","sent","data","getEntitySchemas","stop","_x","apply","arguments","Promise","all","relations","filter","_ref5","showInForm","foreignKey","properties","map","_ref6","_callee2","_callee2$","_context2","t0","uuidv1","t1","t2","id","staticData","_x2","itemId","itemEntity","interfaces","statusClassName","classnames","PUBLISHED","UNPUBLISHED","createElement","className","displayProperties","disableDefaultAdminInfo","Fragment","VersionsList","_ref7","entitySchema","key","onSelect","propTypes","PropTypes","object","isRequired","func","defaultProps","_default","exports"],"sources":["../../../../../src/components/EntityManager/Entity/SideBarRelations/index.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport uuidv1 from 'uuid/v1';\nimport { useApolloClient } from '@apollo/client';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\nimport { formFieldTypes } from '@blaze-cms/react-form-builder';\nimport classnames from 'classnames';\nimport { VersionsList } from '@blaze-cms/versioning-ui';\nimport { PUBLISHED, UNPUBLISHED } from '../../../../constants';\nimport CustomSidebarInfoContainer from './container/CustomSidebarInfoContainer';\nimport EntityNavLinks from '../EntitiyNavLinks';\n\nconst SideBarRelations = ({ schema, onChange, formData, entity }) => {\n const { relation: RelationComponent } = formFieldTypes;\n const {\n formattedStatus,\n formattedUpdated,\n formattedCreated,\n formattedPublished,\n status\n } = formData;\n const client = useApolloClient();\n\n const [relationsComponents, setRelationsComponents] = useState(null);\n\n useEffect(\n () => {\n (async () => {\n const fetchRelationSchema = async ({ entityIdentifier }) => {\n if (!entityIdentifier) return null;\n\n const {\n data: {\n getEntitySchemas: [relationSchema]\n }\n } = await client.query({\n query: getQuery('GET_ENTITY_SCHEMA'),\n variables: { identifier: entityIdentifier }\n });\n return relationSchema;\n };\n\n if (!relationsComponents && schema) {\n const allRelationComponents = await Promise.all(\n schema.relations\n .filter(({ showInForm, foreignKey }) => showInForm && schema.properties[foreignKey])\n .map(async relation => ({\n id: uuidv1(),\n staticData: relation,\n schema: await fetchRelationSchema(relation)\n }))\n );\n\n setRelationsComponents(allRelationComponents);\n }\n })();\n },\n [client, relationsComponents, schema, schema.relations]\n );\n const { id: itemId } = entity;\n const { identifier: itemEntity, interfaces } = schema;\n\n const statusClassName = classnames('sidebar__status__badge', {\n 'sidebar__status__badge--published': status === PUBLISHED,\n 'sidebar__status__badge--unpublished': status === UNPUBLISHED\n });\n\n return (\n <div 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 &&\n formattedCreated && (\n <>\n <>\n <p>\n Created: <span>{formattedCreated}</span>\n </p>\n <p>\n Updated: <span>{formattedUpdated}</span>\n </p>\n </>\n </>\n )}\n\n <CustomSidebarInfoContainer\n id={itemId}\n schema={schema}\n displayProperties={schema.displayProperties}\n />\n </div>\n\n <VersionsList itemEntity={itemEntity} itemId={itemId} interfaces={interfaces} />\n <EntityNavLinks schema={schema} />\n\n {relationsComponents &&\n 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":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,EAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,aAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,2BAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,gBAAA,GAAAT,sBAAA,CAAAF,OAAA;AAAgD,SAAAY,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAd,wBAAAc,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAA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ACpB,CAAC;EAAA,CACH,CACA,CACF,CAAC;AAEV,CAAC;AAEDH,gBAAgB,CAAC4F,SAAS,GAAG;EAC3B1F,MAAM,EAAE2F,qBAAS,CAACC,MAAM,CAACC,UAAU;EACnC5F,QAAQ,EAAE0F,qBAAS,CAACG,IAAI,CAACD,UAAU;EACnC3F,QAAQ,EAAEyF,qBAAS,CAACC,MAAM,CAACC,UAAU;EACrC1F,MAAM,EAAEwF,qBAAS,CAACC;AACpB,CAAC;AAED9F,gBAAgB,CAACiG,YAAY,GAAG;EAC9B5F,MAAM,EAAE,CAAC;AACX,CAAC;AAAC,IAAA6F,QAAA,GAAAC,OAAA,cAEanG,gBAAgB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_v","_accordion","_client","_adminUiUtils","_reactFormBuilder","_classnames","_versioningUi","_constants","_CustomSidebarInfoContainer","_EntitiyNavLinks","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SideBarRelations","schema","onChange","formData","entity","isOpen","onToggle","relation","RelationComponent","formFieldTypes","formattedStatus","formattedUpdated","formattedCreated","formattedPublished","updatedBy","status","client","useApolloClient","relationsComponents","setRelationsComponents","useState","useEffect","fetchRelationSchema","entityIdentifier","data","getEntitySchemas","relationSchema","query","getQuery","variables","identifier","allRelationComponents","Promise","all","relations","filter","showInForm","foreignKey","properties","map","id","uuidv1","staticData","itemId","itemEntity","interfaces","statusClassName","classnames","PUBLISHED","UNPUBLISHED","createElement","className","onClick","role","displayProperties","disableDefaultAdminInfo","Fragment","name","VersionsList","Header","Content","ContentDetails","entitySchema","key","onSelect","propTypes","PropTypes","object","isRequired","func","bool","defaultProps","_default","exports"],"sources":["../../../../../src/components/EntityManager/Entity/SideBarRelations/index.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport uuidv1 from 'uuid/v1';\nimport Accordion from '@blaze-react/accordion';\nimport { useApolloClient } from '@apollo/client';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\nimport { formFieldTypes } from '@blaze-cms/react-form-builder';\nimport classnames from 'classnames';\nimport { VersionsList } from '@blaze-cms/versioning-ui';\nimport { PUBLISHED, UNPUBLISHED } from '../../../../constants';\nimport CustomSidebarInfoContainer from './container/CustomSidebarInfoContainer';\nimport EntityNavLinks from '../EntitiyNavLinks';\n\nconst SideBarRelations = ({ schema, onChange, formData, entity, isOpen, onToggle }) => {\n const { relation: RelationComponent } = formFieldTypes;\n const {\n formattedStatus,\n formattedUpdated,\n formattedCreated,\n formattedPublished,\n updatedBy,\n status\n } = formData;\n const client = useApolloClient();\n\n const [relationsComponents, setRelationsComponents] = useState(null);\n\n useEffect(() => {\n (async () => {\n const fetchRelationSchema = async ({ entityIdentifier }) => {\n if (!entityIdentifier) return null;\n\n const {\n data: {\n getEntitySchemas: [relationSchema]\n }\n } = await client.query({\n query: getQuery('GET_ENTITY_SCHEMA'),\n variables: { identifier: entityIdentifier }\n });\n return relationSchema;\n };\n\n if (!relationsComponents && schema) {\n const allRelationComponents = await Promise.all(\n schema.relations\n .filter(({ showInForm, foreignKey }) => showInForm && schema.properties[foreignKey])\n .map(async relation => ({\n id: uuidv1(),\n staticData: relation,\n schema: await fetchRelationSchema(relation)\n }))\n );\n\n setRelationsComponents(allRelationComponents);\n }\n })();\n }, [client, relationsComponents, schema, schema.relations]);\n const { id: itemId } = entity;\n const { identifier: itemEntity, interfaces } = schema;\n\n const statusClassName = classnames('sidebar__status__badge', {\n 'sidebar__status__badge--published': status === PUBLISHED,\n 'sidebar__status__badge--unpublished': status === UNPUBLISHED\n });\n\n return (\n <div\n className={classnames('sidebar', { 'sidebar--collapsed': !isOpen })}\n data-testid=\"sideBarRelations-main-div\">\n <div\n className=\"sidebar__toggle-button\"\n onClick={onToggle}\n role=\"button\"\n aria-label={isOpen ? 'Collapse sidebar' : 'Expand sidebar'}>\n <i className=\"material-icons\">{isOpen ? 'keyboard_arrow_right' : 'keyboard_arrow_left'}</i>\n </div>\n <div className=\"sidebar__content\">\n <div className=\"sidebar__status\">\n {formattedCreated && (\n <div className=\"sidebar__top\">\n <div className=\"sidebar__status__wrapper\">\n <b>Status</b>\n <span className={statusClassName}>{formattedStatus}</span>\n </div>\n {formattedStatus === PUBLISHED && (\n <p>\n {formattedStatus} on: <span> {formattedPublished}</span>\n </p>\n )}\n </div>\n )}\n {!schema.displayProperties.disableDefaultAdminInfo && formattedCreated && (\n <>\n <p>\n Created: <span>{formattedCreated}</span>\n </p>\n <p>\n Updated: <span>{formattedUpdated}</span>\n </p>\n {updatedBy && (\n <p>\n Updated by: <span>{updatedBy.name}</span>\n </p>\n )}\n </>\n )}\n\n <CustomSidebarInfoContainer\n id={itemId}\n schema={schema}\n displayProperties={schema.displayProperties}\n />\n </div>\n\n <VersionsList itemEntity={itemEntity} itemId={itemId} interfaces={interfaces} />\n <EntityNavLinks schema={schema} />\n\n {relationsComponents && (\n <Accordion isOpen>\n <Accordion.Header>\n <b>Classification</b>\n </Accordion.Header>\n <Accordion.Content>\n <Accordion.ContentDetails>\n {relationsComponents.map(({ id, staticData, schema: entitySchema }) => (\n <RelationComponent\n formData={formData}\n schema={entitySchema}\n key={id}\n staticData={staticData}\n onSelect={onChange}\n />\n ))}\n </Accordion.ContentDetails>\n </Accordion.Content>\n </Accordion>\n )}\n </div>\n </div>\n );\n};\n\nSideBarRelations.propTypes = {\n schema: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n formData: PropTypes.object.isRequired,\n entity: PropTypes.object,\n isOpen: PropTypes.bool,\n onToggle: PropTypes.func\n};\nSideBarRelations.defaultProps = {\n entity: {},\n isOpen: true,\n onToggle: () => {}\n};\n\nexport default SideBarRelations;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG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AAI,CAACD,UAAU;EACnCjE,QAAQ,EAAE+D,kBAAS,CAACC,MAAM,CAACC,UAAU;EACrChE,MAAM,EAAE8D,kBAAS,CAACC,MAAM;EACxB9D,MAAM,EAAE6D,kBAAS,CAACI,IAAI;EACtBhE,QAAQ,EAAE4D,kBAAS,CAACG;AACtB,CAAC;AACDrE,gBAAgB,CAACuE,YAAY,GAAG;EAC9BnE,MAAM,EAAE,CAAC,CAAC;EACVC,MAAM,EAAE,IAAI;EACZC,QAAQ,EAAEA,CAAA,KAAM,CAAC;AACnB,CAAC;AAAC,IAAAkE,QAAA,GAAAC,OAAA,CAAAlF,OAAA,GAEaS,gBAAgB","ignoreList":[]}
|
package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
9
|
-
require("core-js/modules/es.array.map.js");
|
|
10
|
-
require("core-js/modules/es.array.filter.js");
|
|
11
|
-
require("core-js/modules/es.object.to-string.js");
|
|
12
|
-
require("core-js/modules/es.object.values.js");
|
|
7
|
+
exports.default = void 0;
|
|
13
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
9
|
var _react = _interopRequireDefault(require("react"));
|
|
15
10
|
var _InfoBoxValue = _interopRequireDefault(require("../../../../InfoBoxes/presentational/InfoBoxValue"));
|
|
16
11
|
var _InfoBoxLabel = _interopRequireDefault(require("../../../../InfoBoxes/presentational/InfoBoxLabel"));
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
var _InfoBoxTooltip = _interopRequireDefault(require("../../../../InfoBoxes/InfoBoxTooltip"));
|
|
13
|
+
const CustomSidebarInfo = ({
|
|
14
|
+
items,
|
|
15
|
+
customSidebarInfoKey
|
|
16
|
+
}) => {
|
|
20
17
|
if (!items) return null;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}).
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
const customSidebarInfoItems = items.map(item => Object.values(item).map(info => {
|
|
19
|
+
if (!info.label || !info.value) return null;
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement("p", {
|
|
21
|
+
key: `${customSidebarInfoKey}-${info.label.toLowerCase()}`
|
|
22
|
+
}, /*#__PURE__*/_react.default.createElement(_InfoBoxLabel.default, {
|
|
23
|
+
item: info
|
|
24
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_InfoBoxValue.default, {
|
|
25
|
+
item: info
|
|
26
|
+
}), /*#__PURE__*/_react.default.createElement(_InfoBoxTooltip.default, {
|
|
27
|
+
info: info,
|
|
28
|
+
position: "left"
|
|
29
|
+
})));
|
|
30
|
+
}).filter(Boolean));
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
32
32
|
className: "custom-sidebar-info",
|
|
33
33
|
key: customSidebarInfoKey
|
|
34
|
-
}, /*#__PURE__*/_react
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
35
35
|
className: "custom-sidebar-info--container"
|
|
36
36
|
}, customSidebarInfoItems));
|
|
37
37
|
};
|
|
38
|
-
var _default = exports["default"] = CustomSidebarInfo;
|
|
39
38
|
CustomSidebarInfo.propTypes = {
|
|
40
|
-
customSidebarInfoKey: _propTypes
|
|
41
|
-
items: _propTypes
|
|
39
|
+
customSidebarInfoKey: _propTypes.default.string.isRequired,
|
|
40
|
+
items: _propTypes.default.array.isRequired
|
|
42
41
|
};
|
|
42
|
+
var _default = exports.default = CustomSidebarInfo;
|
|
43
43
|
//# sourceMappingURL=CustomSidebarInfo.js.map
|
package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomSidebarInfo.js","names":["_propTypes","_interopRequireDefault","require","_react","_InfoBoxValue","_InfoBoxLabel","
|
|
1
|
+
{"version":3,"file":"CustomSidebarInfo.js","names":["_propTypes","_interopRequireDefault","require","_react","_InfoBoxValue","_InfoBoxLabel","_InfoBoxTooltip","CustomSidebarInfo","items","customSidebarInfoKey","customSidebarInfoItems","map","item","Object","values","info","label","value","default","createElement","key","toLowerCase","position","filter","Boolean","className","propTypes","PropTypes","string","isRequired","array","_default","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport InfoBoxValue from '../../../../InfoBoxes/presentational/InfoBoxValue';\nimport InfoBoxLabel from '../../../../InfoBoxes/presentational/InfoBoxLabel';\nimport InfoBoxTooltip from '../../../../InfoBoxes/InfoBoxTooltip';\n\nconst CustomSidebarInfo = ({ items, customSidebarInfoKey }) => {\n if (!items) return null;\n\n const customSidebarInfoItems = items.map(item =>\n Object.values(item)\n .map(info => {\n if (!info.label || !info.value) return null;\n\n return (\n <p key={`${customSidebarInfoKey}-${info.label.toLowerCase()}`}>\n <InfoBoxLabel item={info} />\n <span>\n <InfoBoxValue item={info} />\n <InfoBoxTooltip info={info} position=\"left\" />\n </span>\n </p>\n );\n })\n .filter(Boolean)\n );\n\n return (\n <div className=\"custom-sidebar-info\" key={customSidebarInfoKey}>\n <div className=\"custom-sidebar-info--container\">{customSidebarInfoItems}</div>\n </div>\n );\n};\n\nCustomSidebarInfo.propTypes = {\n customSidebarInfoKey: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired\n};\n\nexport default CustomSidebarInfo;\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,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aAAA;IAAKM,SAAS,EAAC;EAAgC,GAAEf,sBAA4B,CAC1E,CAAC;AAEV,CAAC;AAEDH,iBAAiB,CAACmB,SAAS,GAAG;EAC5BjB,oBAAoB,EAAEkB,kBAAS,CAACC,MAAM,CAACC,UAAU;EACjDrB,KAAK,EAAEmB,kBAAS,CAACG,KAAK,CAACD;AACzB,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAd,OAAA,GAEaX,iBAAiB","ignoreList":[]}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
8
7
|
var _submit = require("./submit");
|
|
9
|
-
var _default = exports
|
|
8
|
+
var _default = exports.default = {
|
|
10
9
|
submit: _submit.submit
|
|
11
10
|
};
|
|
12
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_submit","require","_default","exports","submit"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/create/index.js"],"sourcesContent":["import { submit } from './submit';\n\nexport default {\n submit\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_submit","require","_default","exports","default","submit"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/create/index.js"],"sourcesContent":["import { submit } from './submit';\n\nexport default {\n submit\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAkC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEnB;EACbC,MAAM,EAANA;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,67 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.submit = void 0;
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
11
|
-
require("core-js/modules/es.string.replace.js");
|
|
12
|
-
require("core-js/modules/es.array.concat.js");
|
|
13
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
8
|
var _buildCreateEntityMutation = _interopRequireDefault(require("../../../../../utils/build-create-entity-mutation"));
|
|
15
9
|
var _constants = require("../../../../../constants");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
34
|
-
case 7:
|
|
35
|
-
_yield$client$mutate = _context.sent;
|
|
36
|
-
createdEntityResult = _yield$client$mutate.data.createdEntity;
|
|
37
|
-
setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saved);
|
|
38
|
-
setEntityData(createdEntityResult.result);
|
|
39
|
-
setIsNewEntity(false);
|
|
40
|
-
updatePathname = history.location.pathname.replace('create', 'update');
|
|
41
|
-
history.push("".concat(updatePathname, "/").concat(createdEntityResult.result.id));
|
|
42
|
-
addToast("Created", {
|
|
43
|
-
appearance: 'success',
|
|
44
|
-
autoDismiss: true
|
|
45
|
-
});
|
|
46
|
-
_context.next = 22;
|
|
47
|
-
break;
|
|
48
|
-
case 17:
|
|
49
|
-
_context.prev = 17;
|
|
50
|
-
_context.t0 = _context["catch"](2);
|
|
51
|
-
setIsSaveButtonAvailable(true);
|
|
52
|
-
setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.save);
|
|
53
|
-
addToast(_context.t0.message, {
|
|
54
|
-
appearance: 'error',
|
|
55
|
-
autoDismiss: true
|
|
56
|
-
});
|
|
57
|
-
case 22:
|
|
58
|
-
case "end":
|
|
59
|
-
return _context.stop();
|
|
10
|
+
const submit = async ({
|
|
11
|
+
entitySchema,
|
|
12
|
+
parsedFormValues,
|
|
13
|
+
client,
|
|
14
|
+
setEntityData,
|
|
15
|
+
setIsSaveButtonAvailable,
|
|
16
|
+
setSaveButtonText,
|
|
17
|
+
history,
|
|
18
|
+
setIsNewEntity
|
|
19
|
+
}, addToast) => {
|
|
20
|
+
const mutation = (0, _buildCreateEntityMutation.default)(entitySchema);
|
|
21
|
+
try {
|
|
22
|
+
setIsSaveButtonAvailable(false);
|
|
23
|
+
setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saving);
|
|
24
|
+
const {
|
|
25
|
+
data: {
|
|
26
|
+
createdEntity: createdEntityResult
|
|
60
27
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
28
|
+
} = await client.mutate({
|
|
29
|
+
mutation,
|
|
30
|
+
variables: {
|
|
31
|
+
input: parsedFormValues
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.saved);
|
|
35
|
+
setEntityData(createdEntityResult.result);
|
|
36
|
+
setIsNewEntity(false);
|
|
37
|
+
const updatePathname = history.location.pathname.replace('create', 'update');
|
|
38
|
+
history.push(`${updatePathname}/${createdEntityResult.result.id}`);
|
|
39
|
+
addToast(`Created`, {
|
|
40
|
+
appearance: 'success',
|
|
41
|
+
autoDismiss: true
|
|
42
|
+
});
|
|
43
|
+
} catch (error) {
|
|
44
|
+
setIsSaveButtonAvailable(true);
|
|
45
|
+
setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.save);
|
|
46
|
+
addToast(error.message, {
|
|
47
|
+
appearance: 'error',
|
|
48
|
+
autoDismiss: true
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
exports.submit = submit;
|
|
67
53
|
//# sourceMappingURL=submit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit.js","names":["_buildCreateEntityMutation","_interopRequireDefault","require","_constants","submit","
|
|
1
|
+
{"version":3,"file":"submit.js","names":["_buildCreateEntityMutation","_interopRequireDefault","require","_constants","submit","entitySchema","parsedFormValues","client","setEntityData","setIsSaveButtonAvailable","setSaveButtonText","history","setIsNewEntity","addToast","mutation","buildCreateEntityMutation","SAVE_BUTTON_TEXTS","saving","data","createdEntity","createdEntityResult","mutate","variables","input","saved","result","updatePathname","location","pathname","replace","push","id","appearance","autoDismiss","error","save","message","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/create/submit.js"],"sourcesContent":["import buildCreateEntityMutation from '../../../../../utils/build-create-entity-mutation';\nimport { SAVE_BUTTON_TEXTS } from '../../../../../constants';\n\nconst submit = async (\n {\n entitySchema,\n parsedFormValues,\n client,\n setEntityData,\n setIsSaveButtonAvailable,\n setSaveButtonText,\n history,\n setIsNewEntity\n },\n addToast\n) => {\n const mutation = buildCreateEntityMutation(entitySchema);\n\n try {\n setIsSaveButtonAvailable(false);\n setSaveButtonText(SAVE_BUTTON_TEXTS.saving);\n const {\n data: { createdEntity: createdEntityResult }\n } = await client.mutate({\n mutation,\n variables: { input: parsedFormValues }\n });\n\n setSaveButtonText(SAVE_BUTTON_TEXTS.saved);\n setEntityData(createdEntityResult.result);\n setIsNewEntity(false);\n\n const updatePathname = history.location.pathname.replace('create', 'update');\n history.push(`${updatePathname}/${createdEntityResult.result.id}`);\n addToast(`Created`, {\n appearance: 'success',\n autoDismiss: true\n });\n } catch (error) {\n setIsSaveButtonAvailable(true);\n setSaveButtonText(SAVE_BUTTON_TEXTS.save);\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n }\n};\n\nexport { submit };\n"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BC,WAAW,EAAE;IACf,CAAC,CAAC;EACJ;AACF,CAAC;AAACI,OAAA,CAAAjC,MAAA,GAAAA,MAAA","ignoreList":[]}
|
|
@@ -1,55 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.submit = void 0;
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
8
|
var _buildDeleteEntityMutation = _interopRequireDefault(require("../../../../../utils/build-delete-entity-mutation"));
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
case 6:
|
|
32
|
-
addToast('Deleted', {
|
|
33
|
-
appearance: 'success',
|
|
34
|
-
autoDismiss: true
|
|
35
|
-
});
|
|
36
|
-
_context.next = 12;
|
|
37
|
-
break;
|
|
38
|
-
case 9:
|
|
39
|
-
_context.prev = 9;
|
|
40
|
-
_context.t0 = _context["catch"](3);
|
|
41
|
-
addToast(_context.t0.message, {
|
|
42
|
-
appearance: 'error',
|
|
43
|
-
autoDismiss: true
|
|
44
|
-
});
|
|
45
|
-
case 12:
|
|
46
|
-
case "end":
|
|
47
|
-
return _context.stop();
|
|
9
|
+
const submit = async ({
|
|
10
|
+
entitySchema,
|
|
11
|
+
parsedFormValues,
|
|
12
|
+
client
|
|
13
|
+
}, addToast) => {
|
|
14
|
+
const mutation = (0, _buildDeleteEntityMutation.default)(entitySchema);
|
|
15
|
+
const {
|
|
16
|
+
id
|
|
17
|
+
} = parsedFormValues;
|
|
18
|
+
try {
|
|
19
|
+
await client.mutate({
|
|
20
|
+
mutation,
|
|
21
|
+
variables: {
|
|
22
|
+
input: {
|
|
23
|
+
id
|
|
24
|
+
}
|
|
48
25
|
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}()
|
|
26
|
+
});
|
|
27
|
+
addToast('Deleted', {
|
|
28
|
+
appearance: 'success',
|
|
29
|
+
autoDismiss: true
|
|
30
|
+
});
|
|
31
|
+
} catch (error) {
|
|
32
|
+
addToast(error.message, {
|
|
33
|
+
appearance: 'error',
|
|
34
|
+
autoDismiss: true
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.submit = submit;
|
|
55
39
|
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","names":["_buildDeleteEntityMutation","_interopRequireDefault","require","submit","
|
|
1
|
+
{"version":3,"file":"delete.js","names":["_buildDeleteEntityMutation","_interopRequireDefault","require","submit","entitySchema","parsedFormValues","client","addToast","mutation","buildDeleteEntityMutation","id","mutate","variables","input","appearance","autoDismiss","error","message","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/delete/delete.js"],"sourcesContent":["import buildDeleteEntityMutation from '../../../../../utils/build-delete-entity-mutation';\n\nconst submit = async ({ entitySchema, parsedFormValues, client }, addToast) => {\n const mutation = buildDeleteEntityMutation(entitySchema);\n const { id } = parsedFormValues;\n\n try {\n await client.mutate({\n mutation,\n variables: { input: { id } }\n });\n addToast('Deleted', {\n appearance: 'success',\n autoDismiss: true\n });\n } catch (error) {\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n }\n};\n\nexport { submit };\n"],"mappings":";;;;;;;AAAA,IAAAA,0BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,MAAMC,MAAM,GAAG,MAAAA,CAAO;EAAEC,YAAY;EAAEC,gBAAgB;EAAEC;AAAO,CAAC,EAAEC,QAAQ,KAAK;EAC7E,MAAMC,QAAQ,GAAG,IAAAC,kCAAyB,EAACL,YAAY,CAAC;EACxD,MAAM;IAAEM;EAAG,CAAC,GAAGL,gBAAgB;EAE/B,IAAI;IACF,MAAMC,MAAM,CAACK,MAAM,CAAC;MAClBH,QAAQ;MACRI,SAAS,EAAE;QAAEC,KAAK,EAAE;UAAEH;QAAG;MAAE;IAC7B,CAAC,CAAC;IACFH,QAAQ,CAAC,SAAS,EAAE;MAClBO,UAAU,EAAE,SAAS;MACrBC,WAAW,EAAE;IACf,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdT,QAAQ,CAACS,KAAK,CAACC,OAAO,EAAE;MACtBH,UAAU,EAAE,OAAO;MACnBC,WAAW,EAAE;IACf,CAAC,CAAC;EACJ;AACF,CAAC;AAACG,OAAA,CAAAf,MAAA,GAAAA,MAAA","ignoreList":[]}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
8
7
|
var _delete = require("./delete");
|
|
9
|
-
var _default = exports
|
|
8
|
+
var _default = exports.default = {
|
|
10
9
|
submit: _delete.submit
|
|
11
10
|
};
|
|
12
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_delete","require","_default","exports","submit"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/delete/index.js"],"sourcesContent":["import { submit } from './delete';\n\nexport default { submit };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_delete","require","_default","exports","default","submit"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/delete/index.js"],"sourcesContent":["import { submit } from './delete';\n\nexport default { submit };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAkC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEnB;EAAEC,MAAM,EAANA;AAAO,CAAC","ignoreList":[]}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
7
|
+
exports.default = void 0;
|
|
9
8
|
var _create = _interopRequireDefault(require("./create"));
|
|
10
9
|
var _update = _interopRequireDefault(require("./update"));
|
|
11
10
|
var _shared = _interopRequireDefault(require("./shared"));
|
|
12
11
|
var _delete = _interopRequireDefault(require("./delete"));
|
|
13
|
-
|
|
14
|
-
create: _create
|
|
15
|
-
update: _update
|
|
16
|
-
shared: _shared
|
|
17
|
-
|
|
12
|
+
const availableActions = {
|
|
13
|
+
create: _create.default,
|
|
14
|
+
update: _update.default,
|
|
15
|
+
shared: _shared.default,
|
|
16
|
+
delete: _delete.default
|
|
18
17
|
};
|
|
19
|
-
var _default = exports
|
|
18
|
+
var _default = exports.default = availableActions;
|
|
20
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_create","_interopRequireDefault","require","_update","_shared","_delete","availableActions","create","createActions","update","updateActions","shared","sharedActions","deleteActions","_default","exports"],"sources":["../../../../../src/components/EntityManager/Entity/actions-handlers/index.js"],"sourcesContent":["import createActions from './create';\nimport updateActions from './update';\nimport sharedActions from './shared';\nimport deleteActions from './delete';\n\nconst availableActions = {\n create: createActions,\n update: updateActions,\n shared: sharedActions,\n delete: deleteActions\n};\n\nexport default availableActions;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_create","_interopRequireDefault","require","_update","_shared","_delete","availableActions","create","createActions","update","updateActions","shared","sharedActions","delete","deleteActions","_default","exports","default"],"sources":["../../../../../src/components/EntityManager/Entity/actions-handlers/index.js"],"sourcesContent":["import createActions from './create';\nimport updateActions from './update';\nimport sharedActions from './shared';\nimport deleteActions from './delete';\n\nconst availableActions = {\n create: createActions,\n update: updateActions,\n shared: sharedActions,\n delete: deleteActions\n};\n\nexport default availableActions;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,MAAMI,gBAAgB,GAAG;EACvBC,MAAM,EAAEC,eAAa;EACrBC,MAAM,EAAEC,eAAa;EACrBC,MAAM,EAAEC,eAAa;EACrBC,MAAM,EAAEC;AACV,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaX,gBAAgB","ignoreList":[]}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
8
7
|
var _publish = require("./publish");
|
|
9
|
-
var _default = exports
|
|
8
|
+
var _default = exports.default = {
|
|
10
9
|
triggerPublish: _publish.triggerPublish
|
|
11
10
|
};
|
|
12
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_publish","require","_default","exports","triggerPublish"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/shared/index.js"],"sourcesContent":["import { triggerPublish } from './publish';\n\nexport default { triggerPublish };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_publish","require","_default","exports","default","triggerPublish"],"sources":["../../../../../../src/components/EntityManager/Entity/actions-handlers/shared/index.js"],"sourcesContent":["import { triggerPublish } from './publish';\n\nexport default { triggerPublish };\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAA2C,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE5B;EAAEC,cAAc,EAAdA;AAAe,CAAC","ignoreList":[]}
|
|
@@ -1,66 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.triggerPublish = void 0;
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
-
require("core-js/modules/es.object.keys.js");
|
|
11
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
7
|
var _utils = require("../../../../../utils");
|
|
13
8
|
var _constants = require("../../../../../constants");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
appearance: 'error',
|
|
51
|
-
autoDismiss: true
|
|
52
|
-
});
|
|
53
|
-
case 16:
|
|
54
|
-
setEntityIsPublish(entityIsPublishedSwitch);
|
|
55
|
-
refetchRecord(true);
|
|
56
|
-
case 18:
|
|
57
|
-
case "end":
|
|
58
|
-
return _context.stop();
|
|
59
|
-
}
|
|
60
|
-
}, _callee, null, [[7, 13]]);
|
|
61
|
-
}));
|
|
62
|
-
return function triggerPublish(_x, _x2) {
|
|
63
|
-
return _ref2.apply(this, arguments);
|
|
64
|
-
};
|
|
65
|
-
}();
|
|
9
|
+
const triggerPublish = async ({
|
|
10
|
+
entityData,
|
|
11
|
+
client,
|
|
12
|
+
setEntityIsPublish,
|
|
13
|
+
entitySchema,
|
|
14
|
+
textContent = '',
|
|
15
|
+
refetchRecord
|
|
16
|
+
}, addToast) => {
|
|
17
|
+
if (!Object.keys(entityData).length) {
|
|
18
|
+
addToast(_constants.SAVE_BEFORE_PUBLISH_MESSAGE, {
|
|
19
|
+
appearance: 'info',
|
|
20
|
+
autoDismiss: true
|
|
21
|
+
});
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const actionType = textContent.toLowerCase();
|
|
25
|
+
const entityIsPublishedSwitch = `${actionType}ed`;
|
|
26
|
+
const mutation = (0, _utils.buildUpdatePublishUnpublishMutation)(entitySchema, entityData.id, actionType);
|
|
27
|
+
try {
|
|
28
|
+
await client.mutate({
|
|
29
|
+
mutation
|
|
30
|
+
});
|
|
31
|
+
addToast(`${textContent}ed`, {
|
|
32
|
+
appearance: 'success',
|
|
33
|
+
autoDismiss: true
|
|
34
|
+
});
|
|
35
|
+
} catch (error) {
|
|
36
|
+
addToast(error.message, {
|
|
37
|
+
appearance: 'error',
|
|
38
|
+
autoDismiss: true
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
setEntityIsPublish(entityIsPublishedSwitch);
|
|
42
|
+
refetchRecord(true);
|
|
43
|
+
};
|
|
44
|
+
exports.triggerPublish = triggerPublish;
|
|
66
45
|
//# sourceMappingURL=publish.js.map
|