@blaze-cms/plugin-data-ui 0.145.1-alpha.1 → 0.146.0-alpha-q1-2026.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 +36 -6
- package/README.md +57 -0
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +1 -0
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
- package/lib/components/EntityManager/Entity/Entity.js +78 -80
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +11 -3
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +2 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +27 -10
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +9 -2
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib/components/EntityManager/EntityManager.js +3 -3
- package/lib/components/EntityManager/EntityManager.js.map +1 -1
- package/lib/components/EntityManager/utils/entity.js +10 -3
- package/lib/components/EntityManager/utils/entity.js.map +1 -1
- package/lib/components/EntityManager/utils/entityAvailableActions.js +2 -2
- package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib/components/InfoBoxes/InfoBoxTooltip.js +40 -0
- package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -0
- package/lib/components/InfoBoxes/InfoBoxes.js +1 -0
- package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js +1 -1
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +2 -1
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBox.js +4 -1
- package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib/components/ListingTable/ListingTable.js +21 -19
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +45 -16
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js +313 -0
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -0
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js +59 -0
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -0
- package/lib/components/ListingTable/SearchFilter/helpers.js +128 -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.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +16 -4
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +5 -4
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/components/Tabs/index.js +4 -3
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/constants.js +4 -1
- package/lib/constants.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 +1 -1
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-listing-query.js +4 -4
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/Entity.js +19 -27
- 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/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 +21 -5
- 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/submit.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib-es/components/EntityManager/EntityManager.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/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/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/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/ListingTable/ListingTable.js +14 -12
- 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/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/mappers/populate-rows.js +16 -4
- 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 +3 -2
- package/lib-es/components/Tabs/index.js.map +1 -1
- package/lib-es/constants.js +4 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/index.js +2 -2
- 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/package.json +22 -20
- package/src/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +1 -0
- package/src/components/EntityManager/Entity/Entity.js +70 -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 +61 -49
- 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 +25 -32
- package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +46 -30
- package/src/components/ListingTable/SearchFilter/SearchContainer.js +243 -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 +33 -5
- package/src/components/ListingTable/service/index.js +3 -4
- package/src/components/Tabs/index.js +15 -15
- package/src/constants.js +9 -1
- package/src/index.js +4 -4
- package/src/utils/build-listing-query.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,24 +3,54 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# [0.146.0-alpha-q1-2026.0](https://github.com/thebyte9/blaze/compare/v0.145.0...v0.146.0-alpha-q1-2026.0) (2026-02-03)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
10
10
|
|
|
11
|
+
* add hasUnsavedChanges state to track actual user edits ([b2e507a](https://github.com/thebyte9/blaze/commit/b2e507a756d90990da603230b589defa8b7e12f4))
|
|
12
|
+
* add necessary state for pop up ([fd37f1d](https://github.com/thebyte9/blaze/commit/fd37f1d45e27bae8ea4ab93ae1f52c3628be7d77))
|
|
13
|
+
* admin listing search filter fixes ([#4827](https://github.com/thebyte9/blaze/issues/4827)) ([8f72d2c](https://github.com/thebyte9/blaze/commit/8f72d2c4e9bb1fa585e20dc899fae6120a3d644e))
|
|
14
|
+
* correct tooltip position ([#4853](https://github.com/thebyte9/blaze/issues/4853)) ([f55356e](https://github.com/thebyte9/blaze/commit/f55356ed8900ba48e7320206ffa16ea57ca3cb2b))
|
|
15
|
+
* fixed breaking tests, updated next to 14 ([fecb0e1](https://github.com/thebyte9/blaze/commit/fecb0e1d822bd69ebbaa084072a219f0fddd23f1))
|
|
16
|
+
* get index from source data ([64425ec](https://github.com/thebyte9/blaze/commit/64425ec1b9e69385b45659f4b941631ae4c8b871))
|
|
11
17
|
* group data table row fields correctly ([#4465](https://github.com/thebyte9/blaze/issues/4465)) ([a07a06f](https://github.com/thebyte9/blaze/commit/a07a06f4db5d0f1980afad70d28352641effea1e))
|
|
18
|
+
* handle missing record error ([#4454](https://github.com/thebyte9/blaze/issues/4454)) ([f2ecf41](https://github.com/thebyte9/blaze/commit/f2ecf41962fd78b5808e6d7cd3714620697c4aaa))
|
|
19
|
+
* linting fixed automatically ([73135b9](https://github.com/thebyte9/blaze/commit/73135b9b8b0d5407e2e1dfba42ab2381f290607f))
|
|
20
|
+
* more test fixes ([a2a2f7a](https://github.com/thebyte9/blaze/commit/a2a2f7a650bb2c995660ba8e88e2d8f1c54586d7))
|
|
21
|
+
* move tabs from entity to page builder ([#4601](https://github.com/thebyte9/blaze/issues/4601)) ([944fe19](https://github.com/thebyte9/blaze/commit/944fe19ce0a09d2f36604fcced44f0054dd5e8e5))
|
|
22
|
+
* remove unused code ([95c24df](https://github.com/thebyte9/blaze/commit/95c24dfd3bb9068a5be69b40be1f3e93007ed850))
|
|
12
23
|
* render page from the ur on initial load ([#4463](https://github.com/thebyte9/blaze/issues/4463)) ([8de5fbe](https://github.com/thebyte9/blaze/commit/8de5fbe969e9c2954f6484e044fdfec49d7050ae))
|
|
24
|
+
* revert save text change ([#4833](https://github.com/thebyte9/blaze/issues/4833)) ([2cfc73b](https://github.com/thebyte9/blaze/commit/2cfc73bfc06dac1dc682f696ca30f932ac79e42b))
|
|
25
|
+
* set missing ref on listing table to fix table header widths ([#4917](https://github.com/thebyte9/blaze/issues/4917)) ([d3d3cab](https://github.com/thebyte9/blaze/commit/d3d3cab771b8ab8c395fa071833b400e38b49f11))
|
|
26
|
+
* show pagebuilder tabs when no components added ([#4844](https://github.com/thebyte9/blaze/issues/4844)) ([2cbb24d](https://github.com/thebyte9/blaze/commit/2cbb24df95b38d4c8f4575814daadebd74ba04d4))
|
|
27
|
+
* table list cell style updates ([#4841](https://github.com/thebyte9/blaze/issues/4841)) ([e4fd643](https://github.com/thebyte9/blaze/commit/e4fd643300e710d2209763795280f5df84563806))
|
|
28
|
+
* udpated yarn lock ([0cd4fa4](https://github.com/thebyte9/blaze/commit/0cd4fa4a185fca4b80b57e472badb771dd649ec2))
|
|
29
|
+
* updated toaster version ([39f3dbd](https://github.com/thebyte9/blaze/commit/39f3dbd15833d45dd0d407b401eb825553135e01))
|
|
30
|
+
* updated with dev ([90f545f](https://github.com/thebyte9/blaze/commit/90f545f1beabb35e26ba6fb2b45a7a0dfd072927))
|
|
31
|
+
* updated with dev ([729bb6e](https://github.com/thebyte9/blaze/commit/729bb6ee7e87946081d51564a4ab45538f7be1e7))
|
|
32
|
+
* updated with latest ([21cde6f](https://github.com/thebyte9/blaze/commit/21cde6f157c9279ed1eccb326870547821bc3dde))
|
|
33
|
+
* use direct state value for toggling sidebar ([091a021](https://github.com/thebyte9/blaze/commit/091a0210bb312e06505d86582ee014a512317da0))
|
|
34
|
+
* use isCreatePage to control navigation prompt display ([b56e0c7](https://github.com/thebyte9/blaze/commit/b56e0c7560308874554e3029a68878d1c2e8d948))
|
|
13
35
|
|
|
14
36
|
|
|
37
|
+
### Features
|
|
15
38
|
|
|
39
|
+
* add admin listing filters based on schema settings ([#4797](https://github.com/thebyte9/blaze/issues/4797)) ([84b3109](https://github.com/thebyte9/blaze/commit/84b310900222a60050e3cf32928ab62a12a99b8d))
|
|
40
|
+
* add env var to disable automatically appending blaze_debug param to admin links ([#4937](https://github.com/thebyte9/blaze/issues/4937)) ([b545d72](https://github.com/thebyte9/blaze/commit/b545d72112e311db3f73388487de8a9f284de84e))
|
|
41
|
+
* add tooltip support to parent select in DynamicRelation component ([#4603](https://github.com/thebyte9/blaze/issues/4603)) ([7767b5d](https://github.com/thebyte9/blaze/commit/7767b5dd7641d4b0c2477cffe6c0be8f9e8aa9dd))
|
|
42
|
+
* allow custom components in table columns ([#4482](https://github.com/thebyte9/blaze/issues/4482)) ([87098c9](https://github.com/thebyte9/blaze/commit/87098c93d9fd85adc2a2aa19f2e9a3db4402ae41))
|
|
43
|
+
* get carousel images from record data ([#4341](https://github.com/thebyte9/blaze/issues/4341)) ([904e8a3](https://github.com/thebyte9/blaze/commit/904e8a319ab053ee470dbb4477c3865d3a5435df))
|
|
44
|
+
* make right sidebar collapsible ([cd45684](https://github.com/thebyte9/blaze/commit/cd456849648a6fe674b4de7e5f994146d76066c9))
|
|
45
|
+
* open frontend debug toolbar with a url param ([#4771](https://github.com/thebyte9/blaze/issues/4771)) ([37b8ea5](https://github.com/thebyte9/blaze/commit/37b8ea59a5ed4be0912465717adeb079fd6b3a89))
|
|
46
|
+
* query for getting the audit details in dynamic properties ([#3287](https://github.com/thebyte9/blaze/issues/3287)) ([39d889b](https://github.com/thebyte9/blaze/commit/39d889b18a6c6b8bc43ae1a5fddb4d19751cf159))
|
|
47
|
+
* update info box properties to support tooltips ([#4701](https://github.com/thebyte9/blaze/issues/4701)) ([08ed041](https://github.com/thebyte9/blaze/commit/08ed041c9432f02e82e4846974cda65ae6c15a26))
|
|
48
|
+
* updated react to 18 ([9335f84](https://github.com/thebyte9/blaze/commit/9335f8432b376494501abb9c3deef1ddaa9b35a8))
|
|
16
49
|
|
|
17
50
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
### Bug Fixes
|
|
51
|
+
### Reverts
|
|
22
52
|
|
|
23
|
-
*
|
|
53
|
+
* Revert "chore: updating versions" ([1bbc7c2](https://github.com/thebyte9/blaze/commit/1bbc7c25a20903b8d517e1276b113b68976307d2))
|
|
24
54
|
|
|
25
55
|
|
|
26
56
|
|
package/README.md
CHANGED
|
@@ -31,6 +31,12 @@ The `displayProperties` property can be set on entity schema in the api to provi
|
|
|
31
31
|
"firstname": {
|
|
32
32
|
"_exists": false
|
|
33
33
|
}
|
|
34
|
+
},
|
|
35
|
+
"adminListings": {
|
|
36
|
+
"dataSource": {
|
|
37
|
+
"source": "search",
|
|
38
|
+
"index": "admin"
|
|
39
|
+
}
|
|
34
40
|
}
|
|
35
41
|
}
|
|
36
42
|
```
|
|
@@ -40,7 +46,37 @@ The `displayProperties` property can be set on entity schema in the api to provi
|
|
|
40
46
|
- adminHeader: properties to build admin header
|
|
41
47
|
- adminMainInfoProperty: indicates a property that returns data to be displayed in the admin edit sidebar. Data is returned is formatted with the [data/info-properties](#Info properties) definition
|
|
42
48
|
- disableDefaultAdminInfo: boolean value that can be used to hide default sidebar values updated/created
|
|
49
|
+
- adminListings.dataSource:
|
|
50
|
+
-- adminListings.dataSource.source: indicates whether to get listing data from search queries instead of direct entity queries.
|
|
51
|
+
-- adminListings.dataSource.index: which index to search. This changes the query used e.g. searchAdmin
|
|
52
|
+
|
|
53
|
+
### Listing filters
|
|
54
|
+
You can add the following to an entity properties/dynamicProperties to have them generate filters that appear at the top of admin record listings.
|
|
55
|
+
```json
|
|
56
|
+
// this will be represented as a select
|
|
57
|
+
"relationKeyId": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"label": "Related records",
|
|
60
|
+
"searchable": true,
|
|
61
|
+
"showInForm": true,
|
|
62
|
+
"formFieldType": "relation",
|
|
63
|
+
"adminListingOptions": {
|
|
64
|
+
"filterType": "select"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
43
67
|
|
|
68
|
+
// will include this property in a keyword search
|
|
69
|
+
"name": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"label": "Name",
|
|
72
|
+
"searchable": true,
|
|
73
|
+
"adminListingOptions": {
|
|
74
|
+
"includeInKeywordSeach": true
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
- `filterType: "select"`: This will get relevant options and display them in a select. If the property is relation data the select will be populated with the `name` property from the related records
|
|
79
|
+
- `includeInKeywordSeach`: This property will be included in a keyword search
|
|
44
80
|
|
|
45
81
|
### Info properties
|
|
46
82
|
|
|
@@ -93,3 +129,24 @@ import coreAdminPlugin from '@blaze-cms/plugin-admin-core-ui';
|
|
|
93
129
|
}
|
|
94
130
|
});
|
|
95
131
|
```
|
|
132
|
+
|
|
133
|
+
## Environment Variables
|
|
134
|
+
|
|
135
|
+
The following environment variables can be used to configure the behavior of this plugin:
|
|
136
|
+
|
|
137
|
+
| Variable | Description | Default |
|
|
138
|
+
| ------------------------------- | -------------------------------------------------------------------------------- | ------- |
|
|
139
|
+
| `BLAZE_DISABLE_PREVIEW` | Disables the preview button functionality completely | `false` |
|
|
140
|
+
| `BLAZE_DISABLE_URL_DEBUG_PARAM` | Disables adding "blaze_debug=1" parameter to preview and view URLs | `false` |
|
|
141
|
+
|
|
142
|
+
### Usage
|
|
143
|
+
|
|
144
|
+
Set these variables in your environment to modify the plugin behavior:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Disable preview functionality
|
|
148
|
+
BLAZE_DISABLE_PREVIEW=true
|
|
149
|
+
|
|
150
|
+
# Disable debug parameter in URLs
|
|
151
|
+
BLAZE_DISABLE_URL_DEBUG_PARAM=true
|
|
152
|
+
```
|
|
@@ -9,6 +9,7 @@ exports["default"] = void 0;
|
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
require("core-js/modules/es.array.map.js");
|
|
11
11
|
require("core-js/modules/es.object.entries.js");
|
|
12
|
+
require("core-js/modules/es.object.to-string.js");
|
|
12
13
|
require("core-js/modules/es.string.starts-with.js");
|
|
13
14
|
var _reactRouterDom = require("react-router-dom");
|
|
14
15
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityNavLinks.js","names":["_reactRouterDom","require","_react","_interopRequireDefault","EntityNavLinks","_ref","schema","adminSectionNavigation","displayProperties","links","Object","entries","map","_ref2","_ref3","_slicedToArray2","k","v","label","uri","Wrapper","startsWith","Link","createElement","className","href","to","_default","exports"],"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 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":"
|
|
1
|
+
{"version":3,"file":"EntityNavLinks.js","names":["_reactRouterDom","require","_react","_interopRequireDefault","EntityNavLinks","_ref","schema","adminSectionNavigation","displayProperties","links","Object","entries","map","_ref2","_ref3","_slicedToArray2","k","v","label","uri","Wrapper","startsWith","Link","createElement","className","href","to","_default","exports"],"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,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAMG,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAAmB;EAAA,IAAbC,MAAM,GAAAD,IAAA,CAANC,MAAM;EAC9B,IAAI,CAACA,MAAM,EAAE,OAAO,IAAI;EAExB,IACuBC,sBAAsB,GACzCD,MAAM,CADRE,iBAAiB,CAAID,sBAAsB;EAG7C,IAAI,CAACA,sBAAsB,EAAE,OAAO,IAAI;EAExC,IAAME,KAAK,GAAGC,MAAM,CAACC,OAAO,CAACJ,sBAAsB,CAAC,CAACK,GAAG,CAAC,UAAAC,KAAA,EAAY;IAAA,IAAAC,KAAA,OAAAC,eAAA,aAAAF,KAAA;MAAVG,CAAC,GAAAF,KAAA;MAAEG,CAAC,GAAAH,KAAA;IAC7D,IAAQI,KAAK,GAAUD,CAAC,CAAhBC,KAAK;MAAEC,GAAG,GAAKF,CAAC,CAATE,GAAG;IAClB,IAAMC,OAAO,GAAGD,GAAG,CAACE,UAAU,CAAC,GAAG,CAAC,GAAG,GAAG,GAAGC,oBAAI;IAEhD,oBACEpB,MAAA,YAAAqB,aAAA,CAACH,OAAO;MAACI,SAAS,EAAC,qBAAqB;MAACC,IAAI,EAAEN,GAAI;MAACO,EAAE,EAAEP;IAAI,GACzDD,KACM,CAAC;EAEd,CAAC,CAAC;EAEF,oBAAOhB,MAAA,YAAAqB,aAAA;IAAKC,SAAS,EAAC;EAAsB,GAAEf,KAAW,CAAC;AAC5D,CAAC;AAAC,IAAAkB,QAAA,GAAAC,OAAA,cAEaxB,cAAc","ignoreList":[]}
|
|
@@ -44,10 +44,8 @@ var _admin = require("@blaze-cms/admin");
|
|
|
44
44
|
var _toaster = require("@blaze-react/toaster");
|
|
45
45
|
var _lodash = _interopRequireDefault(require("lodash.clonedeep"));
|
|
46
46
|
var _dataMappers = require("../utils/data-mappers");
|
|
47
|
-
var _isFormEmpty = _interopRequireDefault(require("../utils/is-form-empty"));
|
|
48
47
|
var _actionsHandlers = _interopRequireDefault(require("./actions-handlers"));
|
|
49
48
|
var _SideBarRelations = _interopRequireDefault(require("./SideBarRelations"));
|
|
50
|
-
var _Tabs = _interopRequireDefault(require("../../Tabs"));
|
|
51
49
|
var _useCallbackDebounce = _interopRequireDefault(require("../../hooks/useCallbackDebounce"));
|
|
52
50
|
var _constants = require("../../../constants");
|
|
53
51
|
var _EntityHeader = _interopRequireDefault(require("./EntityHeader"));
|
|
@@ -58,11 +56,11 @@ var _RecordEditContext = require("../utils/RecordEditContext");
|
|
|
58
56
|
var _excluded = ["isValid", "fields", "isNewValueSet", "valuesChecked", "currentField", "value"];
|
|
59
57
|
/* eslint-disable no-undef */
|
|
60
58
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
61
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
59
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
62
60
|
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; }
|
|
63
61
|
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) { (0, _defineProperty2["default"])(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; }
|
|
64
62
|
var Entity = function Entity(_ref) {
|
|
65
|
-
var
|
|
63
|
+
var _formData$values;
|
|
66
64
|
var formData = _ref.formData,
|
|
67
65
|
entity = _ref.entity,
|
|
68
66
|
schema = _ref.schema,
|
|
@@ -74,43 +72,40 @@ var Entity = function Entity(_ref) {
|
|
|
74
72
|
refetchRecord = _ref.refetchRecord;
|
|
75
73
|
var _useState = (0, _react.useState)(null),
|
|
76
74
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
77
|
-
|
|
75
|
+
formValues = _useState2[0],
|
|
76
|
+
setFormValues = _useState2[1];
|
|
78
77
|
var _useState3 = (0, _react.useState)(null),
|
|
79
78
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
entitySchema = _useState4[0],
|
|
80
|
+
setEntitySchema = _useState4[1];
|
|
82
81
|
var _useState5 = (0, _react.useState)(null),
|
|
83
82
|
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
entityData = _useState6[0],
|
|
84
|
+
setEntityData = _useState6[1];
|
|
86
85
|
var _useState7 = (0, _react.useState)(null),
|
|
87
86
|
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var _useState9 = (0, _react.useState)(
|
|
87
|
+
entityIdentifier = _useState8[0],
|
|
88
|
+
setEntityIdentifier = _useState8[1];
|
|
89
|
+
var _useState9 = (0, _react.useState)(''),
|
|
91
90
|
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
var _useState11 = (0, _react.useState)(
|
|
91
|
+
pageTitle = _useState10[0],
|
|
92
|
+
setPageTitle = _useState10[1];
|
|
93
|
+
var _useState11 = (0, _react.useState)(false),
|
|
95
94
|
_useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
var _useState13 = (0, _react.useState)(
|
|
95
|
+
isSaveButtonAvailable = _useState12[0],
|
|
96
|
+
setIsSaveButtonAvailable = _useState12[1];
|
|
97
|
+
var _useState13 = (0, _react.useState)(formData && formData.values && formData.values.status),
|
|
99
98
|
_useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
var _useState15 = (0, _react.useState)(
|
|
99
|
+
entityIsPublished = _useState14[0],
|
|
100
|
+
setEntityIsPublish = _useState14[1];
|
|
101
|
+
var _useState15 = (0, _react.useState)(false),
|
|
103
102
|
_useState16 = (0, _slicedToArray2["default"])(_useState15, 2),
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
isEnablePublishButton = _useState16[0],
|
|
104
|
+
setEnablePublishButton = _useState16[1];
|
|
106
105
|
var _useState17 = (0, _react.useState)(false),
|
|
107
106
|
_useState18 = (0, _slicedToArray2["default"])(_useState17, 2),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
var _useState19 = (0, _react.useState)(false),
|
|
111
|
-
_useState20 = (0, _slicedToArray2["default"])(_useState19, 2),
|
|
112
|
-
isEnablePreviewButton = _useState20[0],
|
|
113
|
-
setEnablePreviewButton = _useState20[1];
|
|
107
|
+
isEnablePreviewButton = _useState18[0],
|
|
108
|
+
setEnablePreviewButton = _useState18[1];
|
|
114
109
|
var _useToggle = (0, _useToggle5["default"])(false),
|
|
115
110
|
_useToggle2 = (0, _slicedToArray2["default"])(_useToggle, 2),
|
|
116
111
|
modalStatus = _useToggle2[0],
|
|
@@ -119,39 +114,50 @@ var Entity = function Entity(_ref) {
|
|
|
119
114
|
_useToggle4 = (0, _slicedToArray2["default"])(_useToggle3, 2),
|
|
120
115
|
copyModalStatus = _useToggle4[0],
|
|
121
116
|
setCopyModalStatus = _useToggle4[1];
|
|
122
|
-
var
|
|
117
|
+
var _useState19 = (0, _react.useState)(true),
|
|
118
|
+
_useState20 = (0, _slicedToArray2["default"])(_useState19, 2),
|
|
119
|
+
pageBuilderTemplateStatus = _useState20[0],
|
|
120
|
+
setPageBuilderTemplateStatus = _useState20[1];
|
|
121
|
+
var _useState21 = (0, _react.useState)(false),
|
|
123
122
|
_useState22 = (0, _slicedToArray2["default"])(_useState21, 2),
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
shouldCopyData = _useState22[0],
|
|
124
|
+
setShouldCopyData = _useState22[1];
|
|
126
125
|
var _useState23 = (0, _react.useState)(false),
|
|
127
126
|
_useState24 = (0, _slicedToArray2["default"])(_useState23, 2),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
var _useState25 = (0, _react.useState)(
|
|
127
|
+
isFormValid = _useState24[0],
|
|
128
|
+
setIsFormValid = _useState24[1];
|
|
129
|
+
var _useState25 = (0, _react.useState)(null),
|
|
131
130
|
_useState26 = (0, _slicedToArray2["default"])(_useState25, 2),
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
formDataFromCopy = _useState26[0],
|
|
132
|
+
setFormDataFromCopy = _useState26[1];
|
|
134
133
|
var _useState27 = (0, _react.useState)(null),
|
|
135
134
|
_useState28 = (0, _slicedToArray2["default"])(_useState27, 2),
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
var _useState29 = (0, _react.useState)(
|
|
135
|
+
newUpdatedDate = _useState28[0],
|
|
136
|
+
setNewUpdatedDate = _useState28[1];
|
|
137
|
+
var _useState29 = (0, _react.useState)(_constants.SAVE_BUTTON_TEXTS.save),
|
|
139
138
|
_useState30 = (0, _slicedToArray2["default"])(_useState29, 2),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
var _useState31 = (0, _react.useState)(
|
|
139
|
+
saveButtonText = _useState30[0],
|
|
140
|
+
setSaveButtonText = _useState30[1];
|
|
141
|
+
var _useState31 = (0, _react.useState)(null),
|
|
143
142
|
_useState32 = (0, _slicedToArray2["default"])(_useState31, 2),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
var _useState33 = (0, _react.useState)(
|
|
143
|
+
externalUpdateTime = _useState32[0],
|
|
144
|
+
setExternalUpdateTime = _useState32[1];
|
|
145
|
+
var _useState33 = (0, _react.useState)(false),
|
|
147
146
|
_useState34 = (0, _slicedToArray2["default"])(_useState33, 2),
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
var
|
|
151
|
-
var _useState35 = (0, _react.useState)(isCreatePage),
|
|
147
|
+
suppressPrompt = _useState34[0],
|
|
148
|
+
setSuppressPrompt = _useState34[1];
|
|
149
|
+
var _useState35 = (0, _react.useState)(true),
|
|
152
150
|
_useState36 = (0, _slicedToArray2["default"])(_useState35, 2),
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
isRightSidebarOpen = _useState36[0],
|
|
152
|
+
setIsRightSidebarOpen = _useState36[1];
|
|
153
|
+
var handleToggleRightSidebar = function handleToggleRightSidebar() {
|
|
154
|
+
return setIsRightSidebarOpen(!isRightSidebarOpen);
|
|
155
|
+
};
|
|
156
|
+
var isCreatePage = history.location.pathname.includes('create');
|
|
157
|
+
var _useState37 = (0, _react.useState)(isCreatePage),
|
|
158
|
+
_useState38 = (0, _slicedToArray2["default"])(_useState37, 2),
|
|
159
|
+
isNewEntity = _useState38[0],
|
|
160
|
+
setIsNewEntity = _useState38[1];
|
|
155
161
|
var client = (0, _client.useApolloClient)();
|
|
156
162
|
var shouldUpdateState = !entityIdentifier || (0, _entity.checkFulfilConditions)(entity, schema, previousQuery, !entityData) || entityData && entityData.id !== entity.id;
|
|
157
163
|
var clonedFormData = (0, _lodash["default"])(formData);
|
|
@@ -196,13 +202,14 @@ var Entity = function Entity(_ref) {
|
|
|
196
202
|
client.writeQuery({
|
|
197
203
|
query: (0, _adminUiUtils.getQuery)('GET_CURRENT_ENTITY'),
|
|
198
204
|
data: {
|
|
199
|
-
currentEntity: schema.id
|
|
205
|
+
currentEntity: schema.id,
|
|
206
|
+
currentItemId: entity ? entity.id : null
|
|
200
207
|
}
|
|
201
208
|
});
|
|
202
209
|
}
|
|
203
210
|
}, [client, entity, entityData, formData, formValues, pageBuilderTemplateStatus, previousQuery, schema, shouldUpdateState]);
|
|
204
211
|
var getFullUrl = /*#__PURE__*/function () {
|
|
205
|
-
var _ref2 = (0, _asyncToGenerator2["default"])(
|
|
212
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
206
213
|
var query, _yield$client$query, _yield$client$query$d, _yield$client$query$d2, _yield$client$query$d3, getEntityUrl;
|
|
207
214
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
208
215
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -261,8 +268,8 @@ var Entity = function Entity(_ref) {
|
|
|
261
268
|
}
|
|
262
269
|
};
|
|
263
270
|
var onChangeFormValues = /*#__PURE__*/function () {
|
|
264
|
-
var _ref5 = (0, _asyncToGenerator2["default"])(
|
|
265
|
-
var isValid, fields, isNewValueSet, valuesChecked, currentField, fieldValue, otherProps, updatedFormValues, pageBuilderTemplateId, pageBuilder, _yield$client$query2, _yield$client$query2$, data, itemsToAdd, _fields$filter, _fields$filter2, _fields$filter2$, updatedEntity,
|
|
271
|
+
var _ref5 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(_ref4) {
|
|
272
|
+
var isValid, fields, isNewValueSet, valuesChecked, currentField, fieldValue, otherProps, updatedFormValues, pageBuilderTemplateId, pageBuilder, _yield$client$query2, _yield$client$query2$, data, itemsToAdd, _fields$filter, _fields$filter2, _fields$filter2$, updatedEntity, isNotValidOrNotNewValueSet;
|
|
266
273
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
267
274
|
while (1) switch (_context2.prev = _context2.next) {
|
|
268
275
|
case 0:
|
|
@@ -332,12 +339,11 @@ var Entity = function Entity(_ref) {
|
|
|
332
339
|
return id === 'name';
|
|
333
340
|
}), _fields$filter2 = (0, _slicedToArray2["default"])(_fields$filter, 1), _fields$filter2$ = _fields$filter2[0], updatedEntity = _fields$filter2$ === void 0 ? null : _fields$filter2$;
|
|
334
341
|
updatedEntity && setPageTitle(updatedEntity.value);
|
|
335
|
-
isValidAndNewValueSet = isValid && isNewValueSet;
|
|
336
342
|
isNotValidOrNotNewValueSet = !isValid || !isNewValueSet;
|
|
337
343
|
if (componentIsMounted.current) {
|
|
338
344
|
setIsFormValid(isValid);
|
|
339
345
|
}
|
|
340
|
-
if (
|
|
346
|
+
if (isValid && isNewValueSet && componentIsMounted.current) {
|
|
341
347
|
setIsSaveButtonAvailable(true);
|
|
342
348
|
setSaveButtonText(_constants.SAVE_BUTTON_TEXTS.save);
|
|
343
349
|
}
|
|
@@ -347,7 +353,7 @@ var Entity = function Entity(_ref) {
|
|
|
347
353
|
if (componentIsMounted.current) {
|
|
348
354
|
setFormValues([].concat((0, _toConsumableArray2["default"])(updatedFormValues), itemsToAdd));
|
|
349
355
|
}
|
|
350
|
-
case
|
|
356
|
+
case 23:
|
|
351
357
|
case "end":
|
|
352
358
|
return _context2.stop();
|
|
353
359
|
}
|
|
@@ -360,6 +366,9 @@ var Entity = function Entity(_ref) {
|
|
|
360
366
|
var onSubmit = function onSubmit(event) {
|
|
361
367
|
event && event.preventDefault();
|
|
362
368
|
if (!isSaveButtonAvailable) return null;
|
|
369
|
+
if (isCreatePage) {
|
|
370
|
+
setSuppressPrompt(true);
|
|
371
|
+
}
|
|
363
372
|
var parsedFormValues = (0, _reactFormBuilder.parseFormValues)(formValues);
|
|
364
373
|
var updatedFormValues = newUpdatedDate ? _objectSpread(_objectSpread({}, formData.values), {}, {
|
|
365
374
|
update: newUpdatedDate
|
|
@@ -398,7 +407,7 @@ var Entity = function Entity(_ref) {
|
|
|
398
407
|
return _actionsHandlers["default"][action].submit(currentAction, addToast);
|
|
399
408
|
};
|
|
400
409
|
var onDelete = /*#__PURE__*/function () {
|
|
401
|
-
var _ref7 = (0, _asyncToGenerator2["default"])(
|
|
410
|
+
var _ref7 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
402
411
|
var id;
|
|
403
412
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
404
413
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -453,7 +462,7 @@ var Entity = function Entity(_ref) {
|
|
|
453
462
|
setFormDataFromCopy(formDataUpdated);
|
|
454
463
|
};
|
|
455
464
|
var handlePublishAndUnpublish = /*#__PURE__*/function () {
|
|
456
|
-
var _ref9 = (0, _asyncToGenerator2["default"])(
|
|
465
|
+
var _ref9 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(_ref8) {
|
|
457
466
|
var textContent, isPublishButton, isPublished, isUnpublish, savedPageMessage;
|
|
458
467
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
459
468
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -511,10 +520,8 @@ var Entity = function Entity(_ref) {
|
|
|
511
520
|
return (0, _entity.onViewUrlClick)(getFullUrl);
|
|
512
521
|
} : onViewUrl;
|
|
513
522
|
var pageName = formData && formData.values && formData.values.name;
|
|
514
|
-
var
|
|
515
|
-
var hasToDisplayPrompt = isSaveButtonAvailable || hasNewFormValues;
|
|
523
|
+
var hasToDisplayPrompt = isSaveButtonAvailable && !suppressPrompt;
|
|
516
524
|
var showSideBarRelations = (0, _entity.checkFulfilConditions)(schema, formData);
|
|
517
|
-
var 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'));
|
|
518
525
|
return /*#__PURE__*/_react["default"].createElement(_RecordEditContext.RecordEditContextProvider, {
|
|
519
526
|
value: {
|
|
520
527
|
externalUpdateTime: externalUpdateTime,
|
|
@@ -555,7 +562,7 @@ var Entity = function Entity(_ref) {
|
|
|
555
562
|
copyAction: onCopy,
|
|
556
563
|
getFormData: getFormData
|
|
557
564
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
558
|
-
className: "page__content
|
|
565
|
+
className: "page__content".concat(!isRightSidebarOpen ? ' right-sidebar-collapsed' : '')
|
|
559
566
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
560
567
|
className: "page__content"
|
|
561
568
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -567,18 +574,7 @@ var Entity = function Entity(_ref) {
|
|
|
567
574
|
}), /*#__PURE__*/_react["default"].createElement(_InfoBoxes["default"], {
|
|
568
575
|
id: entity.id,
|
|
569
576
|
schema: schema
|
|
570
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
|
571
|
-
enabled: showPageBuilderTabs,
|
|
572
|
-
onTabChange: function onTabChange(tabId) {
|
|
573
|
-
client.writeQuery({
|
|
574
|
-
query: _adminUiUtils.GET_CURRENT_TAB_ID,
|
|
575
|
-
data: {
|
|
576
|
-
currentTabId: tabId
|
|
577
|
-
}
|
|
578
|
-
});
|
|
579
|
-
setCurrentTabId(tabId);
|
|
580
|
-
}
|
|
581
|
-
}, /*#__PURE__*/_react["default"].createElement(_reactFormBuilder.FormBuilder, {
|
|
577
|
+
}), /*#__PURE__*/_react["default"].createElement(_reactFormBuilder.FormBuilder, {
|
|
582
578
|
getIsFormValid: setIsFormValid,
|
|
583
579
|
getFormValues: getFormValues,
|
|
584
580
|
schema: schema,
|
|
@@ -589,17 +585,19 @@ var Entity = function Entity(_ref) {
|
|
|
589
585
|
formValues: formValues,
|
|
590
586
|
isNewEntity: isNewEntity,
|
|
591
587
|
onExternalUpdate: setExternalUpdateTime
|
|
592
|
-
})
|
|
588
|
+
}), /*#__PURE__*/_react["default"].createElement(_pluginRenderHooksUi.RenderHook, {
|
|
593
589
|
hookKey: "entity:".concat(action, ":main:bottom"),
|
|
594
590
|
entity: entity,
|
|
595
591
|
schema: schema
|
|
596
592
|
}))))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
597
|
-
className: "column column--one-third page-sidebar page-sidebar--relations"
|
|
593
|
+
className: "column column--one-third page-sidebar page-sidebar--relations".concat(!isRightSidebarOpen ? ' sidebar--collapsed' : '')
|
|
598
594
|
}, showSideBarRelations && /*#__PURE__*/_react["default"].createElement(_SideBarRelations["default"], {
|
|
599
595
|
entity: entity,
|
|
600
596
|
formData: formData.values,
|
|
601
597
|
schema: schema,
|
|
602
|
-
onChange: onChangeSideBarRelations
|
|
598
|
+
onChange: onChangeSideBarRelations,
|
|
599
|
+
isOpen: isRightSidebarOpen,
|
|
600
|
+
onToggle: handleToggleRightSidebar
|
|
603
601
|
})))));
|
|
604
602
|
};
|
|
605
603
|
Entity.propTypes = {
|