@blaze-cms/plugin-data-ui 0.146.0-core-styles.62 → 0.146.0-core-styles.63
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 +16 -0
- package/lib/components/EntityManager/Entity/Entity.js +24 -24
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +10 -10
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +25 -24
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +12 -12
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +12 -12
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +15 -15
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +11 -11
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib/components/EntityManager/EntityManager.js +20 -20
- package/lib/components/EntityManager/EntityManager.js.map +1 -1
- package/lib/components/EntityManager/utils/entity.js +4 -4
- package/lib/components/EntityManager/utils/entity.js.map +1 -1
- package/lib/components/EntityManager/utils/entityAvailableActions.js +14 -14
- package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib/components/ListingTable/ListingTable.js +25 -25
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js +22 -22
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +6 -6
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +6 -6
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +2 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -1
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +6 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityHeader.js","names":["React","PageHeader","Button","More","PropTypes","HeaderPreviewButton","SAVE_BUTTON_TEXTS","EntityHeader","saveButtonText","entityData","entitySchema","entityIdentifier","pageTitle","onSubmit","handlePublishAndUnpublish","isSaveButtonAvailable","isEnablePublishButton","isEnablePreviewButton","toggleCopyModal","toggleModal","formData","pageName","onViewUrl","saveOnChange","SaveButtonModifiers","showPreviewButton","id","shouldDisableMoreMenu","saving","displayProperties","adminCrudActions","delete","deleteAction","active","showDeleteButton","Object","keys","values","length","createElement","title","Actions","onClick","modifiers","disabled","Avatar","isMoreMenu","className","Content","itemId","itemEntity","propTypes","object","string","isRequired","func","bool","oneOfType","defaultProps","displayName"],"sources":["../../../../../src/components/EntityManager/Entity/EntityHeader/EntityHeader.js"],"sourcesContent":["import React from 'react';\nimport { PageHeader } from '@blaze-cms/admin';\nimport Button from '@blaze-react/button';\nimport More from '@blaze-react/more';\nimport PropTypes from 'prop-types';\nimport HeaderPreviewButton from './HeaderPreviewButton';\nimport { SAVE_BUTTON_TEXTS } from '../../../../constants';\n\nconst EntityHeader = ({\n saveButtonText,\n entityData,\n entitySchema,\n entityIdentifier,\n pageTitle,\n onSubmit,\n handlePublishAndUnpublish,\n isSaveButtonAvailable,\n isEnablePublishButton,\n isEnablePreviewButton,\n toggleCopyModal,\n toggleModal,\n formData,\n pageName,\n onViewUrl,\n saveOnChange\n}) => {\n const SaveButtonModifiers = isSaveButtonAvailable ? ['small'] : ['small', 'disabled'];\n const showPreviewButton = isEnablePreviewButton && entityIdentifier && entityData.id;\n const shouldDisableMoreMenu = saveButtonText === SAVE_BUTTON_TEXTS.saving;\n\n const {\n displayProperties: { adminCrudActions: { delete: deleteAction = { active: true } } = {} } = {}\n } =\n entitySchema || {};\n\n const showDeleteButton =\n deleteAction.active && formData && Object.keys(formData.values).length !== 0;\n\n return (\n <PageHeader title={pageTitle} pageName={pageName} onViewUrl={onViewUrl}>\n <PageHeader.Actions>\n {!saveOnChange && (\n <Button onClick={onSubmit} modifiers={SaveButtonModifiers} data-testid=\"button-save\">\n {saveButtonText
|
|
1
|
+
{"version":3,"file":"EntityHeader.js","names":["React","PageHeader","Button","More","PropTypes","HeaderPreviewButton","SAVE_BUTTON_TEXTS","EntityHeader","saveButtonText","entityData","entitySchema","entityIdentifier","pageTitle","onSubmit","handlePublishAndUnpublish","isSaveButtonAvailable","isEnablePublishButton","isEnablePreviewButton","toggleCopyModal","toggleModal","formData","pageName","onViewUrl","saveOnChange","SaveButtonModifiers","showPreviewButton","id","shouldDisableMoreMenu","saving","displayProperties","adminCrudActions","delete","deleteAction","active","showDeleteButton","Object","keys","values","length","createElement","title","Actions","onClick","modifiers","disabled","Avatar","isMoreMenu","className","Content","itemId","itemEntity","propTypes","object","string","isRequired","func","bool","oneOfType","defaultProps","displayName"],"sources":["../../../../../src/components/EntityManager/Entity/EntityHeader/EntityHeader.js"],"sourcesContent":["import React from 'react';\nimport { PageHeader } from '@blaze-cms/admin';\nimport Button from '@blaze-react/button';\nimport More from '@blaze-react/more';\nimport PropTypes from 'prop-types';\nimport HeaderPreviewButton from './HeaderPreviewButton';\nimport { SAVE_BUTTON_TEXTS } from '../../../../constants';\n\nconst EntityHeader = ({\n saveButtonText,\n entityData,\n entitySchema,\n entityIdentifier,\n pageTitle,\n onSubmit,\n handlePublishAndUnpublish,\n isSaveButtonAvailable,\n isEnablePublishButton,\n isEnablePreviewButton,\n toggleCopyModal,\n toggleModal,\n formData,\n pageName,\n onViewUrl,\n saveOnChange\n}) => {\n const SaveButtonModifiers = isSaveButtonAvailable ? ['small'] : ['small', 'disabled'];\n const showPreviewButton = isEnablePreviewButton && entityIdentifier && entityData.id;\n const shouldDisableMoreMenu = saveButtonText === SAVE_BUTTON_TEXTS.saving;\n\n const {\n displayProperties: { adminCrudActions: { delete: deleteAction = { active: true } } = {} } = {}\n } =\n entitySchema || {};\n\n const showDeleteButton =\n deleteAction.active && formData && Object.keys(formData.values).length !== 0;\n\n return (\n <PageHeader title={pageTitle} pageName={pageName} onViewUrl={onViewUrl}>\n <PageHeader.Actions>\n {!saveOnChange && (\n <Button onClick={onSubmit} modifiers={SaveButtonModifiers} data-testid=\"button-save\">\n {saveButtonText}\n </Button>\n )}\n <More disabled={shouldDisableMoreMenu}>\n <More.Avatar data-testid={`entity-header-${pageName}`} isMoreMenu>\n <span className=\"material-icons\">more_vert</span>\n </More.Avatar>\n <More.Content isMoreMenu>\n {isEnablePublishButton && (\n <Button className=\"more-menu__link\" onClick={handlePublishAndUnpublish}>\n Publish\n </Button>\n )}\n {isEnablePublishButton && (\n <Button className=\"more-menu__link\" onClick={handlePublishAndUnpublish}>\n Unpublish\n </Button>\n )}\n {showPreviewButton && (\n <HeaderPreviewButton itemId={entityData.id} itemEntity={entityIdentifier} />\n )}\n <Button className=\"more-menu__link\" onClick={toggleCopyModal}>\n Copy data from\n </Button>\n {onViewUrl && (\n <Button className=\"more-menu__link\" onClick={onViewUrl}>\n View\n </Button>\n )}\n {showDeleteButton && (\n <Button className=\"more-menu__link\" onClick={toggleModal}>\n Delete\n </Button>\n )}\n </More.Content>\n </More>\n </PageHeader.Actions>\n </PageHeader>\n );\n};\n\nEntityHeader.propTypes = {\n entityData: PropTypes.object,\n entityIdentifier: PropTypes.string,\n entitySchema: PropTypes.object.isRequired,\n pageTitle: PropTypes.string.isRequired,\n pageName: PropTypes.string,\n onSubmit: PropTypes.func.isRequired,\n handlePublishAndUnpublish: PropTypes.func.isRequired,\n isSaveButtonAvailable: PropTypes.bool.isRequired,\n isEnablePublishButton: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).isRequired,\n isEnablePreviewButton: PropTypes.bool.isRequired,\n toggleCopyModal: PropTypes.func.isRequired,\n toggleModal: PropTypes.func.isRequired,\n formData: PropTypes.object,\n onViewUrl: PropTypes.func.isRequired,\n saveButtonText: PropTypes.string,\n saveOnChange: PropTypes.bool.isRequired\n};\n\nEntityHeader.defaultProps = {\n entityData: {},\n entityIdentifier: '',\n formData: null,\n pageName: '',\n saveButtonText: 'save'\n};\n\nEntityHeader.displayName = 'EntityHeader';\n\nexport default EntityHeader;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,qBAAqB;AACxC,OAAOC,IAAI,MAAM,mBAAmB;AACpC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,SAASC,iBAAiB,QAAQ,uBAAuB;AAEzD,MAAMC,YAAY,GAAGA,CAAC;EACpBC,cAAc;EACdC,UAAU;EACVC,YAAY;EACZC,gBAAgB;EAChBC,SAAS;EACTC,QAAQ;EACRC,yBAAyB;EACzBC,qBAAqB;EACrBC,qBAAqB;EACrBC,qBAAqB;EACrBC,eAAe;EACfC,WAAW;EACXC,QAAQ;EACRC,QAAQ;EACRC,SAAS;EACTC;AACF,CAAC,KAAK;EACJ,MAAMC,mBAAmB,GAAGT,qBAAqB,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC;EACrF,MAAMU,iB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ACrD,SAAS,CAACiD,MAAM,EAAEjD,SAAS,CAACoD,IAAI,CAAC,CAAC,CAACF,UAAU;EACzFrC,qBAAqB,EAAEb,SAAS,CAACoD,IAAI,CAACF,UAAU;EAChDpC,eAAe,EAAEd,SAAS,CAACmD,IAAI,CAACD,UAAU;EAC1CnC,WAAW,EAAEf,SAAS,CAACmD,IAAI,CAACD,UAAU;EACtClC,QAAQ,EAAEhB,SAAS,CAACgD,MAAM;EAC1B9B,SAAS,EAAElB,SAAS,CAACmD,IAAI,CAACD,UAAU;EACpC9C,cAAc,EAAEJ,SAAS,CAACiD,MAAM;EAChC9B,YAAY,EAAEnB,SAAS,CAACoD,IAAI,CAACF;AAC/B,CAAC;AAED/C,YAAY,CAACmD,YAAY,GAAG;EAC1BjD,UAAU,EAAE,CAAC,CAAC;EACdE,gBAAgB,EAAE,EAAE;EACpBS,QAAQ,EAAE,IAAI;EACdC,QAAQ,EAAE,EAAE;EACZb,cAAc,EAAE;AAClB,CAAC;AAEDD,YAAY,CAACoD,WAAW,GAAG,cAAc;AAEzC,eAAepD,YAAY","ignoreList":[]}
|
|
@@ -23,6 +23,7 @@ const SideBarRelations = ({
|
|
|
23
23
|
formattedUpdated,
|
|
24
24
|
formattedCreated,
|
|
25
25
|
formattedPublished,
|
|
26
|
+
updatedBy,
|
|
26
27
|
status
|
|
27
28
|
} = formData;
|
|
28
29
|
const client = useApolloClient();
|
|
@@ -82,7 +83,7 @@ const SideBarRelations = ({
|
|
|
82
83
|
className: "sidebar__status__wrapper"
|
|
83
84
|
}, /*#__PURE__*/React.createElement("b", null, "Status"), /*#__PURE__*/React.createElement("span", {
|
|
84
85
|
className: statusClassName
|
|
85
|
-
}, formattedStatus)), formattedStatus === PUBLISHED && /*#__PURE__*/React.createElement("p", null, formattedStatus, " on: ", /*#__PURE__*/React.createElement("span", null, " ", formattedPublished))), !schema.displayProperties.disableDefaultAdminInfo && formattedCreated && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, "Created: ", /*#__PURE__*/React.createElement("span", null, formattedCreated)), /*#__PURE__*/React.createElement("p", null, "Updated: ", /*#__PURE__*/React.createElement("span", null, formattedUpdated)))), /*#__PURE__*/React.createElement(CustomSidebarInfoContainer, {
|
|
86
|
+
}, formattedStatus)), formattedStatus === PUBLISHED && /*#__PURE__*/React.createElement("p", null, formattedStatus, " on: ", /*#__PURE__*/React.createElement("span", null, " ", formattedPublished))), !schema.displayProperties.disableDefaultAdminInfo && formattedCreated && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, "Created: ", /*#__PURE__*/React.createElement("span", null, formattedCreated)), /*#__PURE__*/React.createElement("p", null, "Updated: ", /*#__PURE__*/React.createElement("span", null, formattedUpdated)), updatedBy && /*#__PURE__*/React.createElement("p", null, "Updated by: ", /*#__PURE__*/React.createElement("span", null, updatedBy.name)))), /*#__PURE__*/React.createElement(CustomSidebarInfoContainer, {
|
|
86
87
|
id: itemId,
|
|
87
88
|
schema: schema,
|
|
88
89
|
displayProperties: schema.displayProperties
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useState","useEffect","PropTypes","uuidv1","useApolloClient","getQuery","formFieldTypes","classnames","VersionsList","PUBLISHED","UNPUBLISHED","CustomSidebarInfoContainer","EntityNavLinks","SideBarRelations","schema","onChange","formData","entity","relation","RelationComponent","formattedStatus","formattedUpdated","formattedCreated","formattedPublished","status","client","relationsComponents","setRelationsComponents","fetchRelationSchema","entityIdentifier","data","getEntitySchemas","relationSchema","query","variables","identifier","allRelationComponents","Promise","all","relations","filter","showInForm","foreignKey","properties","map","id","staticData","itemId","itemEntity","interfaces","statusClassName","createElement","className","displayProperties","disableDefaultAdminInfo","Fragment","entitySchema","key","onSelect","propTypes","object","isRequired","func","defaultProps"],"sources":["../../../../../src/components/EntityManager/Entity/SideBarRelations/index.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport uuidv1 from 'uuid/v1';\nimport { useApolloClient } from '@apollo/client';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\nimport { formFieldTypes } from '@blaze-cms/react-form-builder';\nimport classnames from 'classnames';\nimport { VersionsList } from '@blaze-cms/versioning-ui';\nimport { PUBLISHED, UNPUBLISHED } from '../../../../constants';\nimport CustomSidebarInfoContainer from './container/CustomSidebarInfoContainer';\nimport EntityNavLinks from '../EntitiyNavLinks';\n\nconst SideBarRelations = ({ schema, onChange, formData, entity }) => {\n const { relation: RelationComponent } = formFieldTypes;\n const {\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,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,MAAM,MAAM,SAAS;AAC5B,SAASC,eAAe,QAAQ,gBAAgB;AAChD,SAASC,QAAQ,QAAQ,2BAA2B;AACpD,SAASC,cAAc,QAAQ,+BAA+B;AAC9D,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,YAAY,QAAQ,0BAA0B;AACvD,SAASC,SAAS,EAAEC,WAAW,QAAQ,uBAAuB;AAC9D,OAAOC,0BAA0B,MAAM,wCAAwC;AAC/E,OAAOC,cAAc,MAAM,oBAAoB;AAE/C,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAK;EACnE,MAAM;IAAEC,QAAQ,EAAEC;EAAkB,CAAC,GAAGb,cAAc;EACtD,MAAM;IACJc,eAAe;IACfC,gBAAgB;IAChBC,gBAAgB;IAChBC,kBAAkB;IAClBC;EACF,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useState","useEffect","PropTypes","uuidv1","useApolloClient","getQuery","formFieldTypes","classnames","VersionsList","PUBLISHED","UNPUBLISHED","CustomSidebarInfoContainer","EntityNavLinks","SideBarRelations","schema","onChange","formData","entity","relation","RelationComponent","formattedStatus","formattedUpdated","formattedCreated","formattedPublished","updatedBy","status","client","relationsComponents","setRelationsComponents","fetchRelationSchema","entityIdentifier","data","getEntitySchemas","relationSchema","query","variables","identifier","allRelationComponents","Promise","all","relations","filter","showInForm","foreignKey","properties","map","id","staticData","itemId","itemEntity","interfaces","statusClassName","createElement","className","displayProperties","disableDefaultAdminInfo","Fragment","name","entitySchema","key","onSelect","propTypes","object","isRequired","func","defaultProps"],"sources":["../../../../../src/components/EntityManager/Entity/SideBarRelations/index.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport uuidv1 from 'uuid/v1';\nimport { useApolloClient } from '@apollo/client';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\nimport { formFieldTypes } from '@blaze-cms/react-form-builder';\nimport classnames from 'classnames';\nimport { VersionsList } from '@blaze-cms/versioning-ui';\nimport { PUBLISHED, UNPUBLISHED } from '../../../../constants';\nimport CustomSidebarInfoContainer from './container/CustomSidebarInfoContainer';\nimport EntityNavLinks from '../EntitiyNavLinks';\n\nconst SideBarRelations = ({ schema, onChange, formData, entity }) => {\n const { relation: RelationComponent } = formFieldTypes;\n const {\n formattedStatus,\n formattedUpdated,\n formattedCreated,\n formattedPublished,\n updatedBy,\n status\n } = formData;\n const client = useApolloClient();\n\n const [relationsComponents, setRelationsComponents] = useState(null);\n\n useEffect(\n () => {\n (async () => {\n const fetchRelationSchema = async ({ entityIdentifier }) => {\n if (!entityIdentifier) return null;\n\n const {\n data: {\n getEntitySchemas: [relationSchema]\n }\n } = await client.query({\n query: getQuery('GET_ENTITY_SCHEMA'),\n variables: { identifier: entityIdentifier }\n });\n return relationSchema;\n };\n\n if (!relationsComponents && schema) {\n const allRelationComponents = await Promise.all(\n schema.relations\n .filter(({ showInForm, foreignKey }) => showInForm && schema.properties[foreignKey])\n .map(async relation => ({\n id: uuidv1(),\n staticData: relation,\n schema: await fetchRelationSchema(relation)\n }))\n );\n\n setRelationsComponents(allRelationComponents);\n }\n })();\n },\n [client, relationsComponents, schema, schema.relations]\n );\n const { id: itemId } = entity;\n const { identifier: itemEntity, interfaces } = schema;\n\n const statusClassName = classnames('sidebar__status__badge', {\n 'sidebar__status__badge--published': status === PUBLISHED,\n 'sidebar__status__badge--unpublished': status === UNPUBLISHED\n });\n\n return (\n <div 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 {updatedBy && (\n <p>\n Updated by: <span>{updatedBy.name}</span>\n </p>\n )}\n </>\n </>\n )}\n\n <CustomSidebarInfoContainer\n id={itemId}\n schema={schema}\n displayProperties={schema.displayProperties}\n />\n </div>\n\n <VersionsList itemEntity={itemEntity} itemId={itemId} interfaces={interfaces} />\n <EntityNavLinks schema={schema} />\n\n {relationsComponents &&\n relationsComponents.map(({ id, staticData, schema: entitySchema }) => (\n <RelationComponent\n formData={formData}\n schema={entitySchema}\n key={id}\n staticData={staticData}\n onSelect={onChange}\n />\n ))}\n </div>\n </div>\n );\n};\n\nSideBarRelations.propTypes = {\n schema: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n formData: PropTypes.object.isRequired,\n entity: PropTypes.object\n};\n\nSideBarRelations.defaultProps = {\n entity: {}\n};\n\nexport default SideBarRelations;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,MAAM,MAAM,SAAS;AAC5B,SAASC,eAAe,QAAQ,gBAAgB;AAChD,SAASC,QAAQ,QAAQ,2BAA2B;AACpD,SAASC,cAAc,QAAQ,+BAA+B;AAC9D,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,YAAY,QAAQ,0BAA0B;AACvD,SAASC,SAAS,EAAEC,WAAW,QAAQ,uBAAuB;AAC9D,OAAOC,0BAA0B,MAAM,wCAAwC;AAC/E,OAAOC,cAAc,MAAM,oBAAoB;AAE/C,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAK;EACnE,MAAM;IAAEC,QAAQ,EAAEC;EAAkB,CAAC,GAAGb,cAAc;EACtD,MAAM;IACJc,eAAe;IACfC,gBAAgB;IAChBC,gBAAgB;IAChBC,kBAAkB;IAClBC,SAAS;IACTC;EACF,CAAC,GAAGT,QAAQ;EACZ,MAAMU,MAAM,GAAGtB,eAAe,CAAC,CAAC;EAEhC,MAAM,CAACuB,mBAAmB,EAAEC,sBAAsB,CAAC,GAAG5B,QAAQ,CAAC,IAAI,CAAC;EAEpEC,SAAS,CACP,MAAM;IACJ,CAAC,YAAY;MACX,MAAM4B,mBAAmB,GAAG,MAAAA,CAAO;QAAEC;MAAiB,CAAC,KAAK;QAC1D,IAAI,CAACA,gBAAgB,EAAE,OAAO,IAAI;QAElC,MAAM;UACJC,IAAI,EAA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;IAACD,MAAM,EAAEA,MAAO;IAACE,UAAU,EAAEA;EAAW,CAAE,CAAC,eAChFnD,KAAA,CAAAqD,aAAA,CAACxC,cAAc;IAACE,MAAM,EAAEA;EAAO,CAAE,CAAC,EAEjCa,mBAAmB,IAClBA,mBAAmB,CAACkB,GAAG,CAAC,CAAC;IAAEC,EAAE;IAAEC,UAAU;IAAEjC,MAAM,EAAE4C;EAAa,CAAC,kBAC/D3D,KAAA,CAAAqD,aAAA,CAACjC,iBAAiB;IAChBH,QAAQ,EAAEA,QAAS;IACnBF,MAAM,EAAE4C,YAAa;IACrBC,GAAG,EAAEb,EAAG;IACRC,UAAU,EAAEA,UAAW;IACvBa,QAAQ,EAAE7C;EAAS,CACpB,CACF,CACA,CACF,CAAC;AAEV,CAAC;AAEDF,gBAAgB,CAACgD,SAAS,GAAG;EAC3B/C,MAAM,EAAEZ,SAAS,CAAC4D,MAAM,CAACC,UAAU;EACnChD,QAAQ,EAAEb,SAAS,CAAC8D,IAAI,CAACD,UAAU;EACnC/C,QAAQ,EAAEd,SAAS,CAAC4D,MAAM,CAACC,UAAU;EACrC9C,MAAM,EAAEf,SAAS,CAAC4D;AACpB,CAAC;AAEDjD,gBAAgB,CAACoD,YAAY,GAAG;EAC9BhD,MAAM,EAAE,CAAC;AACX,CAAC;AAED,eAAeJ,gBAAgB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/plugin-data-ui",
|
|
3
|
-
"version": "0.146.0-core-styles.
|
|
3
|
+
"version": "0.146.0-core-styles.63",
|
|
4
4
|
"description": "Blaze plugin data ui",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/admin-ui-utils": "0.146.0-core-styles.
|
|
30
|
+
"@blaze-cms/admin-ui-utils": "0.146.0-core-styles.63",
|
|
31
31
|
"@blaze-cms/core-errors": "0.146.0-core-styles.52",
|
|
32
32
|
"@blaze-cms/plugin-render-hooks-ui": "0.145.1-core-styles.0",
|
|
33
|
-
"@blaze-cms/react-form-builder": "0.146.0-core-styles.
|
|
34
|
-
"@blaze-cms/react-page-builder": "0.146.0-core-styles.
|
|
33
|
+
"@blaze-cms/react-form-builder": "0.146.0-core-styles.63",
|
|
34
|
+
"@blaze-cms/react-page-builder": "0.146.0-core-styles.63",
|
|
35
35
|
"@blaze-cms/setup-ui": "0.145.1-core-styles.0",
|
|
36
36
|
"@blaze-cms/versioning-ui": "0.146.0-core-styles.3",
|
|
37
37
|
"@blaze-react/button": "0.8.0-alpha.82",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"lib/*",
|
|
69
69
|
"lib-es/*"
|
|
70
70
|
],
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "ced9156d14f886f57f602047bab502e1b8e19d0e"
|
|
72
72
|
}
|
|
@@ -41,7 +41,7 @@ const EntityHeader = ({
|
|
|
41
41
|
<PageHeader.Actions>
|
|
42
42
|
{!saveOnChange && (
|
|
43
43
|
<Button onClick={onSubmit} modifiers={SaveButtonModifiers} data-testid="button-save">
|
|
44
|
-
{saveButtonText
|
|
44
|
+
{saveButtonText}
|
|
45
45
|
</Button>
|
|
46
46
|
)}
|
|
47
47
|
<More disabled={shouldDisableMoreMenu}>
|
|
@@ -17,6 +17,7 @@ const SideBarRelations = ({ schema, onChange, formData, entity }) => {
|
|
|
17
17
|
formattedUpdated,
|
|
18
18
|
formattedCreated,
|
|
19
19
|
formattedPublished,
|
|
20
|
+
updatedBy,
|
|
20
21
|
status
|
|
21
22
|
} = formData;
|
|
22
23
|
const client = useApolloClient();
|
|
@@ -92,6 +93,11 @@ const SideBarRelations = ({ schema, onChange, formData, entity }) => {
|
|
|
92
93
|
<p>
|
|
93
94
|
Updated: <span>{formattedUpdated}</span>
|
|
94
95
|
</p>
|
|
96
|
+
{updatedBy && (
|
|
97
|
+
<p>
|
|
98
|
+
Updated by: <span>{updatedBy.name}</span>
|
|
99
|
+
</p>
|
|
100
|
+
)}
|
|
95
101
|
</>
|
|
96
102
|
</>
|
|
97
103
|
)}
|