@blaze-cms/plugin-data-ui 0.146.0-node18-core-styles-tooltips.19 → 0.146.0-node18-tooltips.13
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 +21 -90
- package/README.md +21 -0
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +4 -2
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib/components/EntityManager/utils/entity.js +3 -2
- package/lib/components/EntityManager/utils/entity.js.map +1 -1
- package/lib/constants.js +2 -1
- package/lib/constants.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +3 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib-es/components/EntityManager/utils/entity.js +3 -2
- package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
- package/lib-es/constants.js +2 -1
- package/lib-es/constants.js.map +1 -1
- package/package.json +10 -10
- package/src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +5 -1
- package/src/components/EntityManager/utils/entity.js +10 -2
- package/src/constants.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,58 +3,18 @@
|
|
|
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
|
-
# [0.146.0-node18-
|
|
6
|
+
# [0.146.0-node18-tooltips.13](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.12...v0.146.0-node18-tooltips.13) (2025-10-02)
|
|
7
7
|
|
|
8
|
-
**Note:** Version bump only for package @blaze-cms/plugin-data-ui
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# [0.146.0-node18-core-styles-tooltips.18](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.17...v0.146.0-node18-core-styles-tooltips.18) (2025-09-29)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @blaze-cms/plugin-data-ui
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# [0.146.0-node18-core-styles-tooltips.16](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.15...v0.146.0-node18-core-styles-tooltips.16) (2025-09-24)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
### Bug Fixes
|
|
26
|
-
|
|
27
|
-
* 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))
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
# [0.146.0-node18-core-styles-tooltips.15](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.14...v0.146.0-node18-core-styles-tooltips.15) (2025-09-23)
|
|
34
8
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# [0.146.0-node18-core-styles-tooltips.13](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.12...v0.146.0-node18-core-styles-tooltips.13) (2025-09-15)
|
|
42
|
-
|
|
43
|
-
**Note:** Version bump only for package @blaze-cms/plugin-data-ui
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
# [0.146.0-node18-core-styles-tooltips.12](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.11...v0.146.0-node18-core-styles-tooltips.12) (2025-08-27)
|
|
9
|
+
### Features
|
|
50
10
|
|
|
51
|
-
|
|
11
|
+
* 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))
|
|
52
12
|
|
|
53
13
|
|
|
54
14
|
|
|
55
15
|
|
|
56
16
|
|
|
57
|
-
# [0.146.0-node18-
|
|
17
|
+
# [0.146.0-node18-tooltips.11](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.10...v0.146.0-node18-tooltips.11) (2025-10-01)
|
|
58
18
|
|
|
59
19
|
**Note:** Version bump only for package @blaze-cms/plugin-data-ui
|
|
60
20
|
|
|
@@ -62,7 +22,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
62
22
|
|
|
63
23
|
|
|
64
24
|
|
|
65
|
-
# [0.146.0-node18-
|
|
25
|
+
# [0.146.0-node18-tooltips.8](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.7...v0.146.0-node18-tooltips.8) (2025-09-24)
|
|
66
26
|
|
|
67
27
|
**Note:** Version bump only for package @blaze-cms/plugin-data-ui
|
|
68
28
|
|
|
@@ -70,65 +30,26 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
70
30
|
|
|
71
31
|
|
|
72
32
|
|
|
73
|
-
# [0.146.0-node18-
|
|
33
|
+
# [0.146.0-node18-tooltips.6](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.5...v0.146.0-node18-tooltips.6) (2025-09-24)
|
|
74
34
|
|
|
75
35
|
|
|
76
36
|
### Bug Fixes
|
|
77
37
|
|
|
78
|
-
*
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
# [0.146.0-node18-core-styles-tooltips.6](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.5...v0.146.0-node18-core-styles-tooltips.6) (2025-07-22)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
### Bug Fixes
|
|
88
|
-
|
|
89
|
-
* show pagebuilder tabs when no components added ([#4844](https://github.com/thebyte9/blaze/issues/4844)) ([2cbb24d](https://github.com/thebyte9/blaze/commit/2cbb24df95b38d4c8f4575814daadebd74ba04d4))
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
# [0.146.0-node18-core-styles-tooltips.5](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.4...v0.146.0-node18-core-styles-tooltips.5) (2025-07-18)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
### Bug Fixes
|
|
99
|
-
|
|
100
|
-
* revert save text change ([#4833](https://github.com/thebyte9/blaze/issues/4833)) ([2cfc73b](https://github.com/thebyte9/blaze/commit/2cfc73bfc06dac1dc682f696ca30f932ac79e42b))
|
|
101
|
-
* table list cell style updates ([#4841](https://github.com/thebyte9/blaze/issues/4841)) ([e4fd643](https://github.com/thebyte9/blaze/commit/e4fd643300e710d2209763795280f5df84563806))
|
|
102
|
-
* use direct state value for toggling sidebar ([091a021](https://github.com/thebyte9/blaze/commit/091a0210bb312e06505d86582ee014a512317da0))
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
### Features
|
|
106
|
-
|
|
107
|
-
* make right sidebar collapsible ([cd45684](https://github.com/thebyte9/blaze/commit/cd456849648a6fe674b4de7e5f994146d76066c9))
|
|
108
|
-
* 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))
|
|
109
|
-
|
|
110
|
-
|
|
38
|
+
* 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))
|
|
111
39
|
|
|
112
40
|
|
|
113
41
|
|
|
114
|
-
# [0.146.0-node18-core-styles-tooltips.4](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.3...v0.146.0-node18-core-styles-tooltips.4) (2025-07-10)
|
|
115
42
|
|
|
116
43
|
|
|
117
|
-
|
|
44
|
+
# [0.146.0-node18-tooltips.4](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.3...v0.146.0-node18-tooltips.4) (2025-09-22)
|
|
118
45
|
|
|
119
|
-
|
|
120
|
-
* get index from source data ([64425ec](https://github.com/thebyte9/blaze/commit/64425ec1b9e69385b45659f4b941631ae4c8b871))
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
### Features
|
|
124
|
-
|
|
125
|
-
* add admin listing filters based on schema settings ([#4797](https://github.com/thebyte9/blaze/issues/4797)) ([84b3109](https://github.com/thebyte9/blaze/commit/84b310900222a60050e3cf32928ab62a12a99b8d))
|
|
46
|
+
**Note:** Version bump only for package @blaze-cms/plugin-data-ui
|
|
126
47
|
|
|
127
48
|
|
|
128
49
|
|
|
129
50
|
|
|
130
51
|
|
|
131
|
-
# [0.146.0-node18-
|
|
52
|
+
# [0.146.0-node18-tooltips.2](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.1...v0.146.0-node18-tooltips.2) (2025-09-17)
|
|
132
53
|
|
|
133
54
|
**Note:** Version bump only for package @blaze-cms/plugin-data-ui
|
|
134
55
|
|
|
@@ -136,14 +57,17 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
136
57
|
|
|
137
58
|
|
|
138
59
|
|
|
139
|
-
# [0.146.0-node18-
|
|
60
|
+
# [0.146.0-node18-tooltips.0](https://github.com/thebyte9/blaze/compare/v0.145.0...v0.146.0-node18-tooltips.0) (2025-09-09)
|
|
140
61
|
|
|
141
62
|
|
|
142
63
|
### Bug Fixes
|
|
143
64
|
|
|
144
65
|
* add hasUnsavedChanges state to track actual user edits ([b2e507a](https://github.com/thebyte9/blaze/commit/b2e507a756d90990da603230b589defa8b7e12f4))
|
|
145
66
|
* add necessary state for pop up ([fd37f1d](https://github.com/thebyte9/blaze/commit/fd37f1d45e27bae8ea4ab93ae1f52c3628be7d77))
|
|
67
|
+
* admin listing search filter fixes ([#4827](https://github.com/thebyte9/blaze/issues/4827)) ([8f72d2c](https://github.com/thebyte9/blaze/commit/8f72d2c4e9bb1fa585e20dc899fae6120a3d644e))
|
|
68
|
+
* correct tooltip position ([#4853](https://github.com/thebyte9/blaze/issues/4853)) ([f55356e](https://github.com/thebyte9/blaze/commit/f55356ed8900ba48e7320206ffa16ea57ca3cb2b))
|
|
146
69
|
* fixed breaking tests, updated next to 14 ([fecb0e1](https://github.com/thebyte9/blaze/commit/fecb0e1d822bd69ebbaa084072a219f0fddd23f1))
|
|
70
|
+
* get index from source data ([64425ec](https://github.com/thebyte9/blaze/commit/64425ec1b9e69385b45659f4b941631ae4c8b871))
|
|
147
71
|
* group data table row fields correctly ([#4465](https://github.com/thebyte9/blaze/issues/4465)) ([a07a06f](https://github.com/thebyte9/blaze/commit/a07a06f4db5d0f1980afad70d28352641effea1e))
|
|
148
72
|
* handle missing record error ([#4454](https://github.com/thebyte9/blaze/issues/4454)) ([f2ecf41](https://github.com/thebyte9/blaze/commit/f2ecf41962fd78b5808e6d7cd3714620697c4aaa))
|
|
149
73
|
* linting fixed automatically ([73135b9](https://github.com/thebyte9/blaze/commit/73135b9b8b0d5407e2e1dfba42ab2381f290607f))
|
|
@@ -151,19 +75,26 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
151
75
|
* move tabs from entity to page builder ([#4601](https://github.com/thebyte9/blaze/issues/4601)) ([944fe19](https://github.com/thebyte9/blaze/commit/944fe19ce0a09d2f36604fcced44f0054dd5e8e5))
|
|
152
76
|
* remove unused code ([95c24df](https://github.com/thebyte9/blaze/commit/95c24dfd3bb9068a5be69b40be1f3e93007ed850))
|
|
153
77
|
* render page from the ur on initial load ([#4463](https://github.com/thebyte9/blaze/issues/4463)) ([8de5fbe](https://github.com/thebyte9/blaze/commit/8de5fbe969e9c2954f6484e044fdfec49d7050ae))
|
|
78
|
+
* revert save text change ([#4833](https://github.com/thebyte9/blaze/issues/4833)) ([2cfc73b](https://github.com/thebyte9/blaze/commit/2cfc73bfc06dac1dc682f696ca30f932ac79e42b))
|
|
79
|
+
* show pagebuilder tabs when no components added ([#4844](https://github.com/thebyte9/blaze/issues/4844)) ([2cbb24d](https://github.com/thebyte9/blaze/commit/2cbb24df95b38d4c8f4575814daadebd74ba04d4))
|
|
80
|
+
* table list cell style updates ([#4841](https://github.com/thebyte9/blaze/issues/4841)) ([e4fd643](https://github.com/thebyte9/blaze/commit/e4fd643300e710d2209763795280f5df84563806))
|
|
154
81
|
* udpated yarn lock ([0cd4fa4](https://github.com/thebyte9/blaze/commit/0cd4fa4a185fca4b80b57e472badb771dd649ec2))
|
|
155
82
|
* updated toaster version ([39f3dbd](https://github.com/thebyte9/blaze/commit/39f3dbd15833d45dd0d407b401eb825553135e01))
|
|
156
83
|
* updated with dev ([90f545f](https://github.com/thebyte9/blaze/commit/90f545f1beabb35e26ba6fb2b45a7a0dfd072927))
|
|
157
84
|
* updated with dev ([729bb6e](https://github.com/thebyte9/blaze/commit/729bb6ee7e87946081d51564a4ab45538f7be1e7))
|
|
158
85
|
* updated with latest ([21cde6f](https://github.com/thebyte9/blaze/commit/21cde6f157c9279ed1eccb326870547821bc3dde))
|
|
86
|
+
* use direct state value for toggling sidebar ([091a021](https://github.com/thebyte9/blaze/commit/091a0210bb312e06505d86582ee014a512317da0))
|
|
159
87
|
* use isCreatePage to control navigation prompt display ([b56e0c7](https://github.com/thebyte9/blaze/commit/b56e0c7560308874554e3029a68878d1c2e8d948))
|
|
160
88
|
|
|
161
89
|
|
|
162
90
|
### Features
|
|
163
91
|
|
|
92
|
+
* add admin listing filters based on schema settings ([#4797](https://github.com/thebyte9/blaze/issues/4797)) ([84b3109](https://github.com/thebyte9/blaze/commit/84b310900222a60050e3cf32928ab62a12a99b8d))
|
|
164
93
|
* 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))
|
|
165
94
|
* allow custom components in table columns ([#4482](https://github.com/thebyte9/blaze/issues/4482)) ([87098c9](https://github.com/thebyte9/blaze/commit/87098c93d9fd85adc2a2aa19f2e9a3db4402ae41))
|
|
95
|
+
* make right sidebar collapsible ([cd45684](https://github.com/thebyte9/blaze/commit/cd456849648a6fe674b4de7e5f994146d76066c9))
|
|
166
96
|
* open frontend debug toolbar with a url param ([#4771](https://github.com/thebyte9/blaze/issues/4771)) ([37b8ea5](https://github.com/thebyte9/blaze/commit/37b8ea59a5ed4be0912465717adeb079fd6b3a89))
|
|
97
|
+
* 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))
|
|
167
98
|
* update info box properties to support tooltips ([#4701](https://github.com/thebyte9/blaze/issues/4701)) ([08ed041](https://github.com/thebyte9/blaze/commit/08ed041c9432f02e82e4846974cda65ae6c15a26))
|
|
168
99
|
* updated react to 18 ([9335f84](https://github.com/thebyte9/blaze/commit/9335f8432b376494501abb9c3deef1ddaa9b35a8))
|
|
169
100
|
|
package/README.md
CHANGED
|
@@ -129,3 +129,24 @@ import coreAdminPlugin from '@blaze-cms/plugin-admin-core-ui';
|
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
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
|
+
```
|
package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js
CHANGED
|
@@ -17,6 +17,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
17
17
|
var _button = _interopRequireDefault(require("@blaze-react/button"));
|
|
18
18
|
var _client = require("@apollo/client");
|
|
19
19
|
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
20
|
+
var _constants = require("../../../../../constants");
|
|
20
21
|
var HeaderPreviewButton = function HeaderPreviewButton(_ref) {
|
|
21
22
|
var itemId = _ref.itemId,
|
|
22
23
|
itemEntity = _ref.itemEntity;
|
|
@@ -26,7 +27,7 @@ var HeaderPreviewButton = function HeaderPreviewButton(_ref) {
|
|
|
26
27
|
if (process.env.BLAZE_DISABLE_PREVIEW) return null;
|
|
27
28
|
var onViewPreview = /*#__PURE__*/function () {
|
|
28
29
|
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
29
|
-
var _yield$createPreviewT, _yield$createPreviewT2, _yield$createPreviewT3, url, delimiter;
|
|
30
|
+
var _yield$createPreviewT, _yield$createPreviewT2, _yield$createPreviewT3, url, delimiter, debugParam;
|
|
30
31
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
31
32
|
while (1) switch (_context.prev = _context.next) {
|
|
32
33
|
case 0:
|
|
@@ -45,7 +46,8 @@ var HeaderPreviewButton = function HeaderPreviewButton(_ref) {
|
|
|
45
46
|
url = _yield$createPreviewT3.createPreviewToken.result.url;
|
|
46
47
|
if (url) {
|
|
47
48
|
delimiter = url.includes('?') ? '&' : '?';
|
|
48
|
-
|
|
49
|
+
debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM ? '' : "".concat(delimiter).concat(_constants.DEBUG_PARAM);
|
|
50
|
+
window.open("".concat(url).concat(debugParam), '_blank');
|
|
49
51
|
}
|
|
50
52
|
// eslint-disable-next-line no-empty
|
|
51
53
|
_context.next = 12;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderPreviewButton.js","names":["_react","_interopRequireDefault","require","_propTypes","_button","_client","_adminUiUtils","HeaderPreviewButton","_ref","itemId","itemEntity","_useMutation","useMutation","getMutation","_useMutation2","_slicedToArray2","createPreviewToken","process","env","BLAZE_DISABLE_PREVIEW","onViewPreview","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","_yield$createPreviewT","_yield$createPreviewT2","_yield$createPreviewT3","url","delimiter","wrap","_callee$","_context","prev","next","variables","sent","data","result","includes","
|
|
1
|
+
{"version":3,"file":"HeaderPreviewButton.js","names":["_react","_interopRequireDefault","require","_propTypes","_button","_client","_adminUiUtils","_constants","HeaderPreviewButton","_ref","itemId","itemEntity","_useMutation","useMutation","getMutation","_useMutation2","_slicedToArray2","createPreviewToken","process","env","BLAZE_DISABLE_PREVIEW","onViewPreview","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","_yield$createPreviewT","_yield$createPreviewT2","_yield$createPreviewT3","url","delimiter","debugParam","wrap","_callee$","_context","prev","next","variables","sent","data","result","includes","BLAZE_DISABLE_URL_DEBUG_PARAM","concat","DEBUG_PARAM","window","open","t0","stop","apply","arguments","createElement","className","onClick","propTypes","PropTypes","string","isRequired","_default","exports"],"sources":["../../../../../../src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '@blaze-react/button';\nimport { useMutation } from '@apollo/client';\nimport { getMutation } from '@blaze-cms/admin-ui-utils';\nimport { DEBUG_PARAM } from '../../../../../constants';\n\nconst HeaderPreviewButton = ({ itemId, itemEntity }) => {\n const [createPreviewToken] = useMutation(getMutation('PREVIEW_TOKEN_MUTATION'));\n if (process.env.BLAZE_DISABLE_PREVIEW) return null;\n\n const onViewPreview = async () => {\n try {\n const {\n data: {\n createPreviewToken: {\n result: { url }\n }\n } = {}\n } = await createPreviewToken({\n variables: {\n itemId,\n itemEntity\n }\n });\n\n if (url) {\n const delimiter = url.includes('?') ? '&' : '?';\n const debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM\n ? ''\n : `${delimiter}${DEBUG_PARAM}`;\n window.open(`${url}${debugParam}`, '_blank');\n }\n // eslint-disable-next-line no-empty\n } catch (err) {}\n };\n\n return (\n <Button className=\"more-menu__link\" onClick={onViewPreview}>\n Preview\n </Button>\n );\n};\n\nHeaderPreviewButton.propTypes = {\n itemId: PropTypes.string.isRequired,\n itemEntity: PropTypes.string.isRequired\n};\n\nexport default HeaderPreviewButton;\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAEA,IAAMM,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAAC,IAAA,EAA+B;EAAA,IAAzBC,MAAM,GAAAD,IAAA,CAANC,MAAM;IAAEC,UAAU,GAAAF,IAAA,CAAVE,UAAU;EAC/C,IAAAC,YAAA,GAA6B,IAAAC,mBAAW,EAAC,IAAAC,yBAAW,EAAC,wBAAwB,CAAC,CAAC;IAAAC,aAAA,OAAAC,eAAA,aAAAJ,YAAA;IAAxEK,kBAAkB,GAAAF,aAAA;EACzB,IAAIG,OAAO,C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IAAA;QAAA;MAAA,GAAAvB,OAAA;IAAA,CAEH;IAAA,gBAxBKL,aAAaA,CAAA;MAAA,OAAAC,KAAA,CAAA4B,KAAA,OAAAC,SAAA;IAAA;EAAA,GAwBlB;EAED,oBACEnD,MAAA,YAAAoD,aAAA,CAAChD,OAAA,WAAM;IAACiD,SAAS,EAAC,iBAAiB;IAACC,OAAO,EAAEjC;EAAc,GAAC,SAEpD,CAAC;AAEb,CAAC;AAEDb,mBAAmB,CAAC+C,SAAS,GAAG;EAC9B7C,MAAM,EAAE8C,qBAAS,CAACC,MAAM,CAACC,UAAU;EACnC/C,UAAU,EAAE6C,qBAAS,CAACC,MAAM,CAACC;AAC/B,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEapD,mBAAmB","ignoreList":[]}
|
|
@@ -55,7 +55,7 @@ function onViewUrlClick(_x) {
|
|
|
55
55
|
}
|
|
56
56
|
function _onViewUrlClick() {
|
|
57
57
|
_onViewUrlClick = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(getFullUrl) {
|
|
58
|
-
var fullUrl, delimiter;
|
|
58
|
+
var fullUrl, delimiter, debugParam;
|
|
59
59
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
60
60
|
while (1) switch (_context.prev = _context.next) {
|
|
61
61
|
case 0:
|
|
@@ -65,7 +65,8 @@ function _onViewUrlClick() {
|
|
|
65
65
|
fullUrl = _context.sent;
|
|
66
66
|
if (fullUrl) {
|
|
67
67
|
delimiter = fullUrl.includes('?') ? '&' : '?';
|
|
68
|
-
|
|
68
|
+
debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM ? '' : "".concat(delimiter).concat(_constants.DEBUG_PARAM);
|
|
69
|
+
window.open("".concat(fullUrl).concat(debugParam), '_blank');
|
|
69
70
|
}
|
|
70
71
|
case 4:
|
|
71
72
|
case "end":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","names":["_lodash","_interopRequireDefault","require","_constants","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","canViewPage","formData","entity","schema","entityIsPublished","has","KEY_TO_CHECK","id","ENTITY_PUBLISHED","validateSideBarRelations","updatedFormValues","requiredChildField","parentEntityField","find","_ref","parentIdField","_ref2","parentEntityFieldHasValue","value","SELECT_DEFAULT_VALUE","parentIdFieldHasValue","onViewUrlClick","_x","_onViewUrlClick","_asyncToGenerator2","_regenerator","mark","_callee","getFullUrl","fullUrl","delimiter","wrap","_callee$","_context","prev","next","sent","includes","
|
|
1
|
+
{"version":3,"file":"entity.js","names":["_lodash","_interopRequireDefault","require","_constants","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","canViewPage","formData","entity","schema","entityIsPublished","has","KEY_TO_CHECK","id","ENTITY_PUBLISHED","validateSideBarRelations","updatedFormValues","requiredChildField","parentEntityField","find","_ref","parentIdField","_ref2","parentEntityFieldHasValue","value","SELECT_DEFAULT_VALUE","parentIdFieldHasValue","onViewUrlClick","_x","_onViewUrlClick","_asyncToGenerator2","_regenerator","mark","_callee","getFullUrl","fullUrl","delimiter","debugParam","wrap","_callee$","_context","prev","next","sent","includes","process","env","BLAZE_DISABLE_URL_DEBUG_PARAM","concat","DEBUG_PARAM","window","open","stop","getUpdatedFormValues","_ref3","formValues","slice","fieldIndex","findIndex","_ref4","_id","requiredChildFieldIndex","_ref5","checkFulfilConditions","_len","args","Array","_key","every","param"],"sources":["../../../../src/components/EntityManager/utils/entity.js"],"sourcesContent":["import has from 'lodash.has';\nimport {\n DEBUG_PARAM,\n ENTITY_PUBLISHED,\n KEY_TO_CHECK,\n SELECT_DEFAULT_VALUE\n} from '../../../constants';\n\nfunction canViewPage(formData, entity, schema, entityIsPublished) {\n return (\n has(formData, KEY_TO_CHECK) &&\n entity &&\n entity.id &&\n schema &&\n schema.id &&\n entityIsPublished === ENTITY_PUBLISHED\n );\n}\n\nfunction validateSideBarRelations(updatedFormValues, requiredChildField) {\n if (!requiredChildField) return true;\n const parentEntityField = updatedFormValues.find(({ id }) => id === 'parentEntity');\n const parentIdField = updatedFormValues.find(({ id }) => id === 'parentId');\n\n const parentEntityFieldHasValue =\n parentEntityField &&\n parentEntityField.value &&\n parentEntityField.value !== SELECT_DEFAULT_VALUE;\n const parentIdFieldHasValue = parentIdField && parentIdField.value;\n\n return !!(!parentEntityFieldHasValue || (parentEntityFieldHasValue && parentIdFieldHasValue));\n}\n\nasync function onViewUrlClick(getFullUrl) {\n const fullUrl = await getFullUrl();\n if (fullUrl) {\n const delimiter = fullUrl.includes('?') ? '&' : '?';\n const debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM\n ? ''\n : `${delimiter}${DEBUG_PARAM}`;\n window.open(`${fullUrl}${debugParam}`, '_blank');\n }\n}\n\nfunction getUpdatedFormValues({ id, value, requiredChildField, formValues }) {\n const updatedFormValues = formValues ? formValues.slice() : [];\n const fieldIndex = updatedFormValues.findIndex(({ id: _id }) => _id === id);\n\n if (fieldIndex > -1) {\n updatedFormValues[fieldIndex] = { ...updatedFormValues[fieldIndex], value };\n } else {\n updatedFormValues.push({ id, value });\n }\n\n if (requiredChildField && requiredChildField.id) {\n const requiredChildFieldIndex = updatedFormValues.findIndex(\n ({ id: _id }) => _id === requiredChildField.id\n );\n if (requiredChildFieldIndex > -1) {\n updatedFormValues[requiredChildFieldIndex] = {\n ...updatedFormValues[requiredChildFieldIndex],\n value: requiredChildField.value\n };\n } else {\n updatedFormValues.push({\n id: requiredChildField.id,\n value: requiredChildField.value\n });\n }\n }\n\n return updatedFormValues;\n}\n\nfunction checkFulfilConditions(...args) {\n return args.every(param => param);\n}\n\nexport {\n canViewPage,\n validateSideBarRelations,\n onViewUr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MAAM;IACLR,iBAAiB,CAACpB,IAAI,CAAC;MAAEiB,EAAE,EAAFA,EAAE;MAAEW,KAAK,EAALA;IAAM,CAAC,CAAC;EACvC;EAEA,IAAIP,kBAAkB,IAAIA,kBAAkB,CAACJ,EAAE,EAAE;IAC/C,IAAMgD,uBAAuB,GAAG7C,iBAAiB,CAAC0C,SAAS,CACzD,UAAAI,KAAA;MAAA,IAAOF,GAAG,GAAAE,KAAA,CAAPjD,EAAE;MAAA,OAAY+C,GAAG,KAAK3C,kBAAkB,CAACJ,EAAE;IAAA,CAChD,CAAC;IACD,IAAIgD,uBAAuB,GAAG,CAAC,CAAC,EAAE;MAChC7C,iBAAiB,CAAC6C,uBAAuB,CAAC,GAAA/D,aAAA,CAAAA,aAAA,KACrCkB,iBAAiB,CAAC6C,uBAAuB,CAAC;QAC7CrC,KAAK,EAAEP,kBAAkB,CAACO;MAAK,EAChC;IACH,CAAC,MAAM;MACLR,iBAAiB,CAACpB,IAAI,CAAC;QACrBiB,EAAE,EAAEI,kBAAkB,CAACJ,EAAE;QACzBW,KAAK,EAAEP,kBAAkB,CAACO;MAC5B,CAAC,CAAC;IACJ;EACF;EAEA,OAAOR,iBAAiB;AAC1B;AAEA,SAAS+C,qBAAqBA,CAAA,EAAU;EAAA,SAAAC,IAAA,GAAAjE,SAAA,CAAAC,MAAA,EAANiE,IAAI,OAAAC,KAAA,CAAAF,IAAA,GAAAG,IAAA,MAAAA,IAAA,GAAAH,IAAA,EAAAG,IAAA;IAAJF,IAAI,CAAAE,IAAA,IAAApE,SAAA,CAAAoE,IAAA;EAAA;EACpC,OAAOF,IAAI,CAACG,KAAK,CAAC,UAAAC,KAAK;IAAA,OAAIA,KAAK;EAAA,EAAC;AACnC","ignoreList":[]}
|
package/lib/constants.js
CHANGED
|
@@ -4,7 +4,7 @@ require("core-js/modules/es.object.define-property.js");
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.UNPUBLISHED_WARNING = exports.UNPUBLISHED = exports.TEXT_CONTENT_TYPE = exports.SUCCESS = exports.SELECT_DEFAULT_VALUE = exports.SAVE_BUTTON_TEXTS = exports.SAVE_BEFORE_PUBLISH_MESSAGE = exports.PUBLISHED = exports.PREVIEW_INTERFACE = exports.PLUGIN_NAME = exports.PAGE_NOT_FOUND = exports.PAGE_BUILDER_TEMPLATE_FIELD_ID = exports.PAGE_BUILDER_TAB_INDEX = exports.PAGE_BUILDER_TAB = exports.PAGE_BUILDER_FIELD_ID = exports.PAGE_BUILDER = exports.MENU_PERMISSIONS = exports.LEAVE_PAGE_MESSAGE = exports.KEY_TO_CHECK = exports.ICON_SIZE = exports.ICON_COLOR = exports.ERROR = exports.ENTITY_PUBLISHED = exports.ENTER_KEY = exports.EDITOR_VIEW_TAB_INDEX = exports.EDITOR_VIEW_TAB = exports.DEFAULT_FILTER_OPTION_LABEL = exports.DATA_LISTING_PREFIX = exports.ACTIONS = void 0;
|
|
7
|
+
exports.UNPUBLISHED_WARNING = exports.UNPUBLISHED = exports.TEXT_CONTENT_TYPE = exports.SUCCESS = exports.SELECT_DEFAULT_VALUE = exports.SAVE_BUTTON_TEXTS = exports.SAVE_BEFORE_PUBLISH_MESSAGE = exports.PUBLISHED = exports.PREVIEW_INTERFACE = exports.PLUGIN_NAME = exports.PAGE_NOT_FOUND = exports.PAGE_BUILDER_TEMPLATE_FIELD_ID = exports.PAGE_BUILDER_TAB_INDEX = exports.PAGE_BUILDER_TAB = exports.PAGE_BUILDER_FIELD_ID = exports.PAGE_BUILDER = exports.MENU_PERMISSIONS = exports.LEAVE_PAGE_MESSAGE = exports.KEY_TO_CHECK = exports.ICON_SIZE = exports.ICON_COLOR = exports.ERROR = exports.ENTITY_PUBLISHED = exports.ENTER_KEY = exports.EDITOR_VIEW_TAB_INDEX = exports.EDITOR_VIEW_TAB = exports.DEFAULT_FILTER_OPTION_LABEL = exports.DEBUG_PARAM = exports.DATA_LISTING_PREFIX = exports.ACTIONS = void 0;
|
|
8
8
|
var PLUGIN_NAME = exports.PLUGIN_NAME = 'data-ui';
|
|
9
9
|
var DATA_LISTING_PREFIX = exports.DATA_LISTING_PREFIX = '/data-listing';
|
|
10
10
|
var PAGE_BUILDER = exports.PAGE_BUILDER = 'pageBuilder';
|
|
@@ -44,4 +44,5 @@ var ICON_COLOR = exports.ICON_COLOR = {
|
|
|
44
44
|
FILL: '#63779C'
|
|
45
45
|
};
|
|
46
46
|
var DEFAULT_FILTER_OPTION_LABEL = exports.DEFAULT_FILTER_OPTION_LABEL = 'Any';
|
|
47
|
+
var DEBUG_PARAM = exports.DEBUG_PARAM = 'blaze_debug=1';
|
|
47
48
|
//# sourceMappingURL=constants.js.map
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["PLUGIN_NAME","exports","DATA_LISTING_PREFIX","PAGE_BUILDER","TEXT_CONTENT_TYPE","ENTITY_PUBLISHED","SELECT_DEFAULT_VALUE","LEAVE_PAGE_MESSAGE","KEY_TO_CHECK","MENU_PERMISSIONS","PREVIEW_INTERFACE","PAGE_BUILDER_FIELD_ID","PAGE_BUILDER_TEMPLATE_FIELD_ID","ERROR","SUCCESS","PUBLISHED","UNPUBLISHED","SAVE_BUTTON_TEXTS","save","saved","saving","ACTIONS","UNPUBLISHED_WARNING","PAGE_NOT_FOUND","SAVE_BEFORE_PUBLISH_MESSAGE","PAGE_BUILDER_TAB","PAGE_BUILDER_TAB_INDEX","EDITOR_VIEW_TAB","EDITOR_VIEW_TAB_INDEX","ENTER_KEY","ICON_SIZE","WIDTH","HEIGHT","ICON_COLOR","STROKE","FILL","DEFAULT_FILTER_OPTION_LABEL"],"sources":["../src/constants.js"],"sourcesContent":["const PLUGIN_NAME = 'data-ui';\nconst DATA_LISTING_PREFIX = '/data-listing';\nconst PAGE_BUILDER = 'pageBuilder';\nconst TEXT_CONTENT_TYPE = 'Publish';\nconst ENTITY_PUBLISHED = 'published';\nconst SELECT_DEFAULT_VALUE = 'Please Choose...';\nconst LEAVE_PAGE_MESSAGE = 'You are going to leave without saving. Are you sure you want to leave?';\nconst KEY_TO_CHECK = 'values.slug';\nconst MENU_PERMISSIONS = ['update:any', 'update:own', 'create:any', 'create:own'];\nconst PREVIEW_INTERFACE = 'preview/can-preview';\nconst PAGE_BUILDER_FIELD_ID = 'pageBuilder';\nconst PAGE_BUILDER_TEMPLATE_FIELD_ID = 'pageBuilderTemplateId';\nconst ERROR = 'error';\nconst SUCCESS = 'success';\nconst PUBLISHED = 'published';\nconst UNPUBLISHED = 'unpublished';\nconst SAVE_BUTTON_TEXTS = { save: 'save', saved: 'saved', saving: 'saving' };\nconst ACTIONS = 'actions';\nconst UNPUBLISHED_WARNING = 'Page already unpublished';\nconst PAGE_NOT_FOUND = 'Page not found';\nconst SAVE_BEFORE_PUBLISH_MESSAGE =\n 'You have to click save to create the record before you can publish';\n\nconst PAGE_BUILDER_TAB = 'Page builder';\nconst PAGE_BUILDER_TAB_INDEX = 1;\nconst EDITOR_VIEW_TAB = 'Editor view';\nconst EDITOR_VIEW_TAB_INDEX = 0;\n\nconst ENTER_KEY = 'Enter';\n\nconst ICON_SIZE = {\n WIDTH: '25px',\n HEIGHT: '25px'\n};\n\nconst ICON_COLOR = {\n STROKE: '#63779C',\n FILL: '#63779C'\n};\n\nconst DEFAULT_FILTER_OPTION_LABEL = 'Any';\n\nexport {\n DATA_LISTING_PREFIX,\n ENTITY_PUBLISHED,\n KEY_TO_CHECK,\n LEAVE_PAGE_MESSAGE,\n MENU_PERMISSIONS,\n PAGE_BUILDER,\n PLUGIN_NAME,\n PREVIEW_INTERFACE,\n SELECT_DEFAULT_VALUE,\n TEXT_CONTENT_TYPE,\n PAGE_BUILDER_FIELD_ID,\n PAGE_BUILDER_TEMPLATE_FIELD_ID,\n ERROR,\n SUCCESS,\n PUBLISHED,\n UNPUBLISHED,\n SAVE_BUTTON_TEXTS,\n ACTIONS,\n PAGE_BUILDER_TA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TERFACE","PAGE_BUILDER_FIELD_ID","PAGE_BUILDER_TEMPLATE_FIELD_ID","ERROR","SUCCESS","PUBLISHED","UNPUBLISHED","SAVE_BUTTON_TEXTS","save","saved","saving","ACTIONS","UNPUBLISHED_WARNING","PAGE_NOT_FOUND","SAVE_BEFORE_PUBLISH_MESSAGE","PAGE_BUILDER_TAB","PAGE_BUILDER_TAB_INDEX","EDITOR_VIEW_TAB","EDITOR_VIEW_TAB_INDEX","ENTER_KEY","ICON_SIZE","WIDTH","HEIGHT","ICON_COLOR","STROKE","FILL","DEFAULT_FILTER_OPTION_LABEL","DEBUG_PARAM"],"sources":["../src/constants.js"],"sourcesContent":["const PLUGIN_NAME = 'data-ui';\nconst DATA_LISTING_PREFIX = '/data-listing';\nconst PAGE_BUILDER = 'pageBuilder';\nconst TEXT_CONTENT_TYPE = 'Publish';\nconst ENTITY_PUBLISHED = 'published';\nconst SELECT_DEFAULT_VALUE = 'Please Choose...';\nconst LEAVE_PAGE_MESSAGE = 'You are going to leave without saving. Are you sure you want to leave?';\nconst KEY_TO_CHECK = 'values.slug';\nconst MENU_PERMISSIONS = ['update:any', 'update:own', 'create:any', 'create:own'];\nconst PREVIEW_INTERFACE = 'preview/can-preview';\nconst PAGE_BUILDER_FIELD_ID = 'pageBuilder';\nconst PAGE_BUILDER_TEMPLATE_FIELD_ID = 'pageBuilderTemplateId';\nconst ERROR = 'error';\nconst SUCCESS = 'success';\nconst PUBLISHED = 'published';\nconst UNPUBLISHED = 'unpublished';\nconst SAVE_BUTTON_TEXTS = { save: 'save', saved: 'saved', saving: 'saving' };\nconst ACTIONS = 'actions';\nconst UNPUBLISHED_WARNING = 'Page already unpublished';\nconst PAGE_NOT_FOUND = 'Page not found';\nconst SAVE_BEFORE_PUBLISH_MESSAGE =\n 'You have to click save to create the record before you can publish';\n\nconst PAGE_BUILDER_TAB = 'Page builder';\nconst PAGE_BUILDER_TAB_INDEX = 1;\nconst EDITOR_VIEW_TAB = 'Editor view';\nconst EDITOR_VIEW_TAB_INDEX = 0;\n\nconst ENTER_KEY = 'Enter';\n\nconst ICON_SIZE = {\n WIDTH: '25px',\n HEIGHT: '25px'\n};\n\nconst ICON_COLOR = {\n STROKE: '#63779C',\n FILL: '#63779C'\n};\n\nconst DEFAULT_FILTER_OPTION_LABEL = 'Any';\nconst DEBUG_PARAM = 'blaze_debug=1';\n\nexport {\n DATA_LISTING_PREFIX,\n DEBUG_PARAM,\n ENTITY_PUBLISHED,\n KEY_TO_CHECK,\n LEAVE_PAGE_MESSAGE,\n MENU_PERMISSIONS,\n PAGE_BUILDER,\n PLUGIN_NAME,\n PREVIEW_INTERFACE,\n SELECT_DEFAULT_VALUE,\n TEXT_CONTENT_TYPE,\n PAGE_BUILDER_FIELD_ID,\n PAGE_BUILDER_TEMPLATE_FIELD_ID,\n ERROR,\n SUCCESS,\n PUBLISHED,\n UNPUBLISHED,\n SAVE_BUTTON_TEXTS,\n ACTIONS,\n PAGE_BUILDER_TAB_INDEX,\n EDITOR_VIEW_TAB_INDEX,\n EDITOR_VIEW_TAB,\n PAGE_BUILDER_TAB,\n UNPUBLISHED_WARNING,\n SAVE_BEFORE_PUBLISH_MESSAGE,\n ICON_SIZE,\n ICON_COLOR,\n PAGE_NOT_FOUND,\n ENTER_KEY,\n DEFAULT_FILTER_OPTION_LABEL\n};\n"],"mappings":";;;;;;;AAAA,IAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,SAAS;AAC7B,IAAME,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAG,eAAe;AAC3C,IAAMC,YAAY,GAAAF,OAAA,CAAAE,YAAA,GAAG,aAAa;AAClC,IAAMC,iBAAiB,GAAAH,OAAA,CAAAG,iBAAA,GAAG,SAAS;AACnC,IAAMC,gBAAgB,GAAAJ,OAAA,CAAAI,gBAAA,GAAG,WAAW;AACpC,IAAMC,oBAAoB,GAAAL,OAAA,CAAAK,oBAAA,GAAG,kBAAkB;AAC/C,IAAMC,kBAAkB,GAAA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AqB,GAAA3B,OAAA,CAAA2B,qBAAA,GAAG,CAAC;AAE/B,IAAMC,SAAS,GAAA5B,OAAA,CAAA4B,SAAA,GAAG,OAAO;AAEzB,IAAMC,SAAS,GAAA7B,OAAA,CAAA6B,SAAA,GAAG;EAChBC,KAAK,EAAE,MAAM;EACbC,MAAM,EAAE;AACV,CAAC;AAED,IAAMC,UAAU,GAAAhC,OAAA,CAAAgC,UAAA,GAAG;EACjBC,MAAM,EAAE,SAAS;EACjBC,IAAI,EAAE;AACR,CAAC;AAED,IAAMC,2BAA2B,GAAAnC,OAAA,CAAAmC,2BAAA,GAAG,KAAK;AACzC,IAAMC,WAAW,GAAApC,OAAA,CAAAoC,WAAA,GAAG,eAAe","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import Button from '@blaze-react/button';
|
|
4
4
|
import { useMutation } from '@apollo/client';
|
|
5
5
|
import { getMutation } from '@blaze-cms/admin-ui-utils';
|
|
6
|
+
import { DEBUG_PARAM } from '../../../../../constants';
|
|
6
7
|
const HeaderPreviewButton = ({
|
|
7
8
|
itemId,
|
|
8
9
|
itemEntity
|
|
@@ -27,7 +28,8 @@ const HeaderPreviewButton = ({
|
|
|
27
28
|
});
|
|
28
29
|
if (url) {
|
|
29
30
|
const delimiter = url.includes('?') ? '&' : '?';
|
|
30
|
-
|
|
31
|
+
const debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM ? '' : `${delimiter}${DEBUG_PARAM}`;
|
|
32
|
+
window.open(`${url}${debugParam}`, '_blank');
|
|
31
33
|
}
|
|
32
34
|
// eslint-disable-next-line no-empty
|
|
33
35
|
} catch (err) {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderPreviewButton.js","names":["React","PropTypes","Button","useMutation","getMutation","HeaderPreviewButton","itemId","itemEntity","createPreviewToken","process","env","BLAZE_DISABLE_PREVIEW","onViewPreview","data","result","url","variables","delimiter","includes","window","open","err","createElement","className","onClick","propTypes","string","isRequired"],"sources":["../../../../../../src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '@blaze-react/button';\nimport { useMutation } from '@apollo/client';\nimport { getMutation } from '@blaze-cms/admin-ui-utils';\n\nconst HeaderPreviewButton = ({ itemId, itemEntity }) => {\n const [createPreviewToken] = useMutation(getMutation('PREVIEW_TOKEN_MUTATION'));\n if (process.env.BLAZE_DISABLE_PREVIEW) return null;\n\n const onViewPreview = async () => {\n try {\n const {\n data: {\n createPreviewToken: {\n result: { url }\n }\n } = {}\n } = await createPreviewToken({\n variables: {\n itemId,\n itemEntity\n }\n });\n\n if (url) {\n const delimiter = url.includes('?') ? '&' : '?';\n window.open(`${url}${
|
|
1
|
+
{"version":3,"file":"HeaderPreviewButton.js","names":["React","PropTypes","Button","useMutation","getMutation","DEBUG_PARAM","HeaderPreviewButton","itemId","itemEntity","createPreviewToken","process","env","BLAZE_DISABLE_PREVIEW","onViewPreview","data","result","url","variables","delimiter","includes","debugParam","BLAZE_DISABLE_URL_DEBUG_PARAM","window","open","err","createElement","className","onClick","propTypes","string","isRequired"],"sources":["../../../../../../src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '@blaze-react/button';\nimport { useMutation } from '@apollo/client';\nimport { getMutation } from '@blaze-cms/admin-ui-utils';\nimport { DEBUG_PARAM } from '../../../../../constants';\n\nconst HeaderPreviewButton = ({ itemId, itemEntity }) => {\n const [createPreviewToken] = useMutation(getMutation('PREVIEW_TOKEN_MUTATION'));\n if (process.env.BLAZE_DISABLE_PREVIEW) return null;\n\n const onViewPreview = async () => {\n try {\n const {\n data: {\n createPreviewToken: {\n result: { url }\n }\n } = {}\n } = await createPreviewToken({\n variables: {\n itemId,\n itemEntity\n }\n });\n\n if (url) {\n const delimiter = url.includes('?') ? '&' : '?';\n const debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM\n ? ''\n : `${delimiter}${DEBUG_PARAM}`;\n window.open(`${url}${debugParam}`, '_blank');\n }\n // eslint-disable-next-line no-empty\n } catch (err) {}\n };\n\n return (\n <Button className=\"more-menu__link\" onClick={onViewPreview}>\n Preview\n </Button>\n );\n};\n\nHeaderPreviewButton.propTypes = {\n itemId: PropTypes.string.isRequired,\n itemEntity: PropTypes.string.isRequired\n};\n\nexport default HeaderPreviewButton;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,MAAM,MAAM,qBAAqB;AACxC,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SAASC,WAAW,QAAQ,0BAA0B;AAEtD,MAAMC,mBAAmB,GAAGA,CAAC;EAAEC,MAAM;EAAEC;AAAW,CAAC,KAAK;EACtD,MAAM,CAACC,kBAAkB,CAAC,GAAGN,WAAW,CAACC,WAAW,CAAC,wBAAwB,CAAC,CAAC;EAC/E,IAAIM,OAAO,CAACC,GAAG,CAACC,qBAAqB,EAAE,OAAO,IAAI;EAElD,MAAMC,aAAa,GAAG,MAAAA,CAAA,KAAY;IAChC,IAAI;MACF,MAAM;QACJC,IAAI,EAAE;UACJL,kBAAkB,EAAE;YAClBM,MAAM,EAAE;cAAEC;YAAI;UAChB;QACF,CAAC,GAAG,CAAC;MACP,CAAC,GAAG,MAAMP,kBAAkB,CAAC;QAC3BQ,SAAS,EAAE;UACTV,MAAM;UACNC;QACF;MACF,CAAC,CAAC;MAEF,IAAIQ,GAAG,EAAE;QACP,MAAME,SAAS,GAAGF,GAAG,CAACG,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG;QAC/C,MAAMC,UAAU,GAAGV,OAAO,CAACC,GAAG,CAACU,6BAA6B,GACxD,EAAE,GACF,GAAGH,SAAS,GAAGb,WAAW,EAAE;QAChCiB,MAAM,CAACC,IAAI,CAAC,GAAGP,GAAG,GAAGI,UAAU,EAAE,EAAE,QAAQ,CAAC;MAC9C;MACA;IACF,CAAC,CAAC,OAAOI,GAAG,EAAE,CAAC;EACjB,CAAC;EAED,oBACExB,KAAA,CAAAyB,aAAA,CAACvB,MAAM;IAACwB,SAAS,EAAC,iBAAiB;IAACC,OAAO,EAAEd;EAAc,GAAC,SAEpD,CAAC;AAEb,CAAC;AAEDP,mBAAmB,CAACsB,SAAS,GAAG;EAC9BrB,MAAM,EAAEN,SAAS,CAAC4B,MAAM,CAACC,UAAU;EACnCtB,UAAU,EAAEP,SAAS,CAAC4B,MAAM,CAACC;AAC/B,CAAC;AAED,eAAexB,mBAAmB","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
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; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import has from 'lodash.has';
|
|
5
|
-
import { ENTITY_PUBLISHED, KEY_TO_CHECK, SELECT_DEFAULT_VALUE } from '../../../constants';
|
|
5
|
+
import { DEBUG_PARAM, ENTITY_PUBLISHED, KEY_TO_CHECK, SELECT_DEFAULT_VALUE } from '../../../constants';
|
|
6
6
|
function canViewPage(formData, entity, schema, entityIsPublished) {
|
|
7
7
|
return has(formData, KEY_TO_CHECK) && entity && entity.id && schema && schema.id && entityIsPublished === ENTITY_PUBLISHED;
|
|
8
8
|
}
|
|
@@ -22,7 +22,8 @@ async function onViewUrlClick(getFullUrl) {
|
|
|
22
22
|
const fullUrl = await getFullUrl();
|
|
23
23
|
if (fullUrl) {
|
|
24
24
|
const delimiter = fullUrl.includes('?') ? '&' : '?';
|
|
25
|
-
|
|
25
|
+
const debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM ? '' : `${delimiter}${DEBUG_PARAM}`;
|
|
26
|
+
window.open(`${fullUrl}${debugParam}`, '_blank');
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
function getUpdatedFormValues({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","names":["has","ENTITY_PUBLISHED","KEY_TO_CHECK","SELECT_DEFAULT_VALUE","canViewPage","formData","entity","schema","entityIsPublished","id","validateSideBarRelations","updatedFormValues","requiredChildField","parentEntityField","find","parentIdField","parentEntityFieldHasValue","value","parentIdFieldHasValue","onViewUrlClick","getFullUrl","fullUrl","delimiter","includes","window","open","getUpdatedFormValues","formValues","slice","fieldIndex","findIndex","_id","_objectSpread","push","requiredChildFieldIndex","checkFulfilConditions","args","every","param"],"sources":["../../../../src/components/EntityManager/utils/entity.js"],"sourcesContent":["import has from 'lodash.has';\nimport {
|
|
1
|
+
{"version":3,"file":"entity.js","names":["has","DEBUG_PARAM","ENTITY_PUBLISHED","KEY_TO_CHECK","SELECT_DEFAULT_VALUE","canViewPage","formData","entity","schema","entityIsPublished","id","validateSideBarRelations","updatedFormValues","requiredChildField","parentEntityField","find","parentIdField","parentEntityFieldHasValue","value","parentIdFieldHasValue","onViewUrlClick","getFullUrl","fullUrl","delimiter","includes","debugParam","process","env","BLAZE_DISABLE_URL_DEBUG_PARAM","window","open","getUpdatedFormValues","formValues","slice","fieldIndex","findIndex","_id","_objectSpread","push","requiredChildFieldIndex","checkFulfilConditions","args","every","param"],"sources":["../../../../src/components/EntityManager/utils/entity.js"],"sourcesContent":["import has from 'lodash.has';\nimport {\n DEBUG_PARAM,\n ENTITY_PUBLISHED,\n KEY_TO_CHECK,\n SELECT_DEFAULT_VALUE\n} from '../../../constants';\n\nfunction canViewPage(formData, entity, schema, entityIsPublished) {\n return (\n has(formData, KEY_TO_CHECK) &&\n entity &&\n entity.id &&\n schema &&\n schema.id &&\n entityIsPublished === ENTITY_PUBLISHED\n );\n}\n\nfunction validateSideBarRelations(updatedFormValues, requiredChildField) {\n if (!requiredChildField) return true;\n const parentEntityField = updatedFormValues.find(({ id }) => id === 'parentEntity');\n const parentIdField = updatedFormValues.find(({ id }) => id === 'parentId');\n\n const parentEntityFieldHasValue =\n parentEntityField &&\n parentEntityField.value &&\n parentEntityField.value !== SELECT_DEFAULT_VALUE;\n const parentIdFieldHasValue = parentIdField && parentIdField.value;\n\n return !!(!parentEntityFieldHasValue || (parentEntityFieldHasValue && parentIdFieldHasValue));\n}\n\nasync function onViewUrlClick(getFullUrl) {\n const fullUrl = await getFullUrl();\n if (fullUrl) {\n const delimiter = fullUrl.includes('?') ? '&' : '?';\n const debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM\n ? ''\n : `${delimiter}${DEBUG_PARAM}`;\n window.open(`${fullUrl}${debugParam}`, '_blank');\n }\n}\n\nfunction getUpdatedFormValues({ id, value, requiredChildField, formValues }) {\n const updatedFormValues = formValues ? formValues.slice() : [];\n const fieldIndex = updatedFormValues.findIndex(({ id: _id }) => _id === id);\n\n if (fieldIndex > -1) {\n updatedFormValues[fieldIndex] = { ...updatedFormValues[fieldIndex], value };\n } else {\n updatedFormValues.push({ id, value });\n }\n\n if (requiredChildField && requiredChildField.id) {\n const requiredChildFieldIndex = updatedFormValues.findIndex(\n ({ id: _id }) => _id === requiredChildField.id\n );\n if (requiredChildFieldIndex > -1) {\n updatedFormValues[requiredChildFieldIndex] = {\n ...updatedFormValues[requiredChildFieldIndex],\n value: requiredChildField.value\n };\n } else {\n updatedFormValues.push({\n id: requiredChildField.id,\n value: requiredChildField.value\n });\n }\n }\n\n return updatedFormValues;\n}\n\nfunction checkFulfilConditions(...args) {\n return args.every(param => param);\n}\n\nexport {\n canViewPage,\n validateSideBarRelations,\n onViewUrlClick,\n getUpdatedFormValues,\n checkFulfilConditions\n};\n"],"mappings":";;;AAAA,OAAOA,GAAG,MAAM,YAAY;AAC5B,SACEC,WAAW,EACXC,gBAAgB,EAChBC,YAAY,EACZC,oBAAoB,QACf,oBAAoB;AAE3B,SAASC,WAAWA,CAACC,QAAQ,EAAEC,MAAM,EAAEC,MAAM,EAAEC,iBAAiB,EAAE;EAChE,OACET,GAAG,CAACM,QAAQ,EAAEH,YAAY,CAAC,IAC3BI,MAAM,IACNA,MAAM,CAACG,EAAE,IACTF,MAAM,IACNA,MAAM,CAACE,EAAE,IACTD,iBAAiB,KAAKP,gBAAgB;AAE1C;AAEA,SAASS,wBAAwBA,CAACC,iBAAiB,EAAEC,kBAAkB,EAAE;EACvE,IAAI,CAACA,kBAAkB,EAAE,OAAO,IAAI;EACpC,MAAMC,iBAAiB,GAAGF,iBAAiB,CAACG,IAAI,CAAC,CAAC;IAAEL;EAAG,CAAC,KAAKA,EAAE,KAAK,cAAc,CAAC;EACnF,MAAMM,aAAa,GAAGJ,iBAAiB,CAACG,IAAI,CAAC,CAAC;IAAEL;EAAG,CAAC,KAAKA,EAAE,KAAK,UAAU,CAAC;EAE3E,MAAMO,yBAAyB,GAC7BH,iBAAiB,IACjBA,iBAAiB,CAACI,KAAK,IACvBJ,iBAAiB,CAACI,KAAK,KAAKd,oBAAoB;EAClD,MAAMe,qBAAqB,GAAGH,aAAa,IAAIA,aAAa,CAACE,KAAK;EAElE,OAAO,CAAC,EAAE,CAACD,yBAAyB,IAAKA,yBAAyB,IAAIE,qBAAsB,CAAC;AAC/F;AAEA,eAAeC,cAAcA,CAACC,UAAU,EAAE;EACxC,MAAMC,OAAO,GAAG,MAAMD,UAAU,CAAC,CAAC;EAClC,IAAIC,O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uB,CAAC;QAC7CrB,KAAK,EAAEL,kBAAkB,CAACK;MAAK,EAChC;IACH,CAAC,MAAM;MACLN,iBAAiB,CAAC0B,IAAI,CAAC;QACrB5B,EAAE,EAAEG,kBAAkB,CAACH,EAAE;QACzBQ,KAAK,EAAEL,kBAAkB,CAACK;MAC5B,CAAC,CAAC;IACJ;EACF;EAEA,OAAON,iBAAiB;AAC1B;AAEA,SAAS4B,qBAAqBA,CAAC,GAAGC,IAAI,EAAE;EACtC,OAAOA,IAAI,CAACC,KAAK,CAACC,KAAK,IAAIA,KAAK,CAAC;AACnC;AAEA,SACEtC,WAAW,EACXM,wBAAwB,EACxBS,cAAc,EACdW,oBAAoB,EACpBS,qBAAqB","ignoreList":[]}
|
package/lib-es/constants.js
CHANGED
|
@@ -37,5 +37,6 @@ const ICON_COLOR = {
|
|
|
37
37
|
FILL: '#63779C'
|
|
38
38
|
};
|
|
39
39
|
const DEFAULT_FILTER_OPTION_LABEL = 'Any';
|
|
40
|
-
|
|
40
|
+
const DEBUG_PARAM = 'blaze_debug=1';
|
|
41
|
+
export { DATA_LISTING_PREFIX, DEBUG_PARAM, ENTITY_PUBLISHED, KEY_TO_CHECK, LEAVE_PAGE_MESSAGE, MENU_PERMISSIONS, PAGE_BUILDER, PLUGIN_NAME, PREVIEW_INTERFACE, SELECT_DEFAULT_VALUE, TEXT_CONTENT_TYPE, PAGE_BUILDER_FIELD_ID, PAGE_BUILDER_TEMPLATE_FIELD_ID, ERROR, SUCCESS, PUBLISHED, UNPUBLISHED, SAVE_BUTTON_TEXTS, ACTIONS, PAGE_BUILDER_TAB_INDEX, EDITOR_VIEW_TAB_INDEX, EDITOR_VIEW_TAB, PAGE_BUILDER_TAB, UNPUBLISHED_WARNING, SAVE_BEFORE_PUBLISH_MESSAGE, ICON_SIZE, ICON_COLOR, PAGE_NOT_FOUND, ENTER_KEY, DEFAULT_FILTER_OPTION_LABEL };
|
|
41
42
|
//# sourceMappingURL=constants.js.map
|
package/lib-es/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["PLUGIN_NAME","DATA_LISTING_PREFIX","PAGE_BUILDER","TEXT_CONTENT_TYPE","ENTITY_PUBLISHED","SELECT_DEFAULT_VALUE","LEAVE_PAGE_MESSAGE","KEY_TO_CHECK","MENU_PERMISSIONS","PREVIEW_INTERFACE","PAGE_BUILDER_FIELD_ID","PAGE_BUILDER_TEMPLATE_FIELD_ID","ERROR","SUCCESS","PUBLISHED","UNPUBLISHED","SAVE_BUTTON_TEXTS","save","saved","saving","ACTIONS","UNPUBLISHED_WARNING","PAGE_NOT_FOUND","SAVE_BEFORE_PUBLISH_MESSAGE","PAGE_BUILDER_TAB","PAGE_BUILDER_TAB_INDEX","EDITOR_VIEW_TAB","EDITOR_VIEW_TAB_INDEX","ENTER_KEY","ICON_SIZE","WIDTH","HEIGHT","ICON_COLOR","STROKE","FILL","DEFAULT_FILTER_OPTION_LABEL"],"sources":["../src/constants.js"],"sourcesContent":["const PLUGIN_NAME = 'data-ui';\nconst DATA_LISTING_PREFIX = '/data-listing';\nconst PAGE_BUILDER = 'pageBuilder';\nconst TEXT_CONTENT_TYPE = 'Publish';\nconst ENTITY_PUBLISHED = 'published';\nconst SELECT_DEFAULT_VALUE = 'Please Choose...';\nconst LEAVE_PAGE_MESSAGE = 'You are going to leave without saving. Are you sure you want to leave?';\nconst KEY_TO_CHECK = 'values.slug';\nconst MENU_PERMISSIONS = ['update:any', 'update:own', 'create:any', 'create:own'];\nconst PREVIEW_INTERFACE = 'preview/can-preview';\nconst PAGE_BUILDER_FIELD_ID = 'pageBuilder';\nconst PAGE_BUILDER_TEMPLATE_FIELD_ID = 'pageBuilderTemplateId';\nconst ERROR = 'error';\nconst SUCCESS = 'success';\nconst PUBLISHED = 'published';\nconst UNPUBLISHED = 'unpublished';\nconst SAVE_BUTTON_TEXTS = { save: 'save', saved: 'saved', saving: 'saving' };\nconst ACTIONS = 'actions';\nconst UNPUBLISHED_WARNING = 'Page already unpublished';\nconst PAGE_NOT_FOUND = 'Page not found';\nconst SAVE_BEFORE_PUBLISH_MESSAGE =\n 'You have to click save to create the record before you can publish';\n\nconst PAGE_BUILDER_TAB = 'Page builder';\nconst PAGE_BUILDER_TAB_INDEX = 1;\nconst EDITOR_VIEW_TAB = 'Editor view';\nconst EDITOR_VIEW_TAB_INDEX = 0;\n\nconst ENTER_KEY = 'Enter';\n\nconst ICON_SIZE = {\n WIDTH: '25px',\n HEIGHT: '25px'\n};\n\nconst ICON_COLOR = {\n STROKE: '#63779C',\n FILL: '#63779C'\n};\n\nconst DEFAULT_FILTER_OPTION_LABEL = 'Any';\n\nexport {\n DATA_LISTING_PREFIX,\n ENTITY_PUBLISHED,\n KEY_TO_CHECK,\n LEAVE_PAGE_MESSAGE,\n MENU_PERMISSIONS,\n PAGE_BUILDER,\n PLUGIN_NAME,\n PREVIEW_INTERFACE,\n SELECT_DEFAULT_VALUE,\n TEXT_CONTENT_TYPE,\n PAGE_BUILDER_FIELD_ID,\n PAGE_BUILDER_TEMPLATE_FIELD_ID,\n ERROR,\n SUCCESS,\n PUBLISHED,\n UNPUBLISHED,\n SAVE_BUTTON_TEXTS,\n ACTIONS,\n PAGE_BUILDER_TAB_INDEX,\n EDITOR_VIEW_TAB_INDEX,\n EDITOR_VIEW_TAB,\n PAGE_BUILDER_TAB,\n UNPUBLISHED_WARNING,\n SAVE_BEFORE_PUBLISH_MESSAGE,\n ICON_SIZE,\n ICON_COLOR,\n PAGE_NOT_FOUND,\n ENTER_KEY,\n DEFAULT_FILTER_OPTION_LABEL\n};\n"],"mappings":"AAAA,MAAMA,WAAW,GAAG,SAAS;AAC7B,MAAMC,mBAAmB,GAAG,eAAe;AAC3C,MAAMC,YAAY,GAAG,aAAa;AAClC,MAAMC,iBAAiB,GAAG,SAAS;AACnC,MAAMC,gBAAgB,GAAG,WAAW;AACpC,MAAMC,oBAAoB,GAAG,kBAAkB;AAC/C,MAAMC,kBAAkB,GAAG,wEAAwE;AACnG,MAAMC,YAAY,GAAG,aAAa;AAClC,MAAMC,gBAAgB,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC;AACjF,MAAMC,iBAAiB,GAAG,qBAAqB;AAC/C,MAAMC,qBAAqB,GAAG,aAAa;AAC3C,MAAMC,8BAA8B,GAAG,uBAAuB;AAC9D,MAAMC,KAAK,GAAG,OAAO;AACrB,MAAMC,OAAO,GAAG,SAAS;AACzB,MAAMC,SAAS,GAAG,WAAW;AAC7B,MAAMC,WAAW,GAAG,aAAa;AACjC,MAAMC,iBAAiB,GAAG;EAAEC,IAAI,EAAE,MAAM;EAAEC,KAAK,EAAE,OAAO;EAAEC,MAAM,EAAE;AAAS,CAAC;AAC5E,MAAMC,OAAO,GAAG,SAAS;AACzB,MAAMC,mBAAmB,GAAG,0BAA0B;AACtD,MAAMC,cAAc,GAAG,gBAAgB;AACvC,MAAMC,2BAA2B,GAC/B,oEAAoE;AAEtE,MAAMC,gBAAgB,GAAG,cAAc;AACvC,MAAMC,sBAAsB,GAAG,CAAC;AAChC,MAAMC,eAAe,GAAG,aAAa;AACrC,MAAMC,qBAAqB,GAAG,CAAC;AAE/B,MAAMC,SAAS,GAAG,OAAO;AAEzB,MAAMC,SAAS,GAAG;EAChBC,KAAK,EAAE,MAAM;EACbC,MAAM,EAAE;AACV,CAAC;AAED,MAAMC,UAAU,GAAG;EACjBC,MAAM,EAAE,SAAS;EACjBC,IAAI,EAAE;AACR,CAAC;AAED,MAAMC,2BAA2B,GAAG,KAAK;
|
|
1
|
+
{"version":3,"file":"constants.js","names":["PLUGIN_NAME","DATA_LISTING_PREFIX","PAGE_BUILDER","TEXT_CONTENT_TYPE","ENTITY_PUBLISHED","SELECT_DEFAULT_VALUE","LEAVE_PAGE_MESSAGE","KEY_TO_CHECK","MENU_PERMISSIONS","PREVIEW_INTERFACE","PAGE_BUILDER_FIELD_ID","PAGE_BUILDER_TEMPLATE_FIELD_ID","ERROR","SUCCESS","PUBLISHED","UNPUBLISHED","SAVE_BUTTON_TEXTS","save","saved","saving","ACTIONS","UNPUBLISHED_WARNING","PAGE_NOT_FOUND","SAVE_BEFORE_PUBLISH_MESSAGE","PAGE_BUILDER_TAB","PAGE_BUILDER_TAB_INDEX","EDITOR_VIEW_TAB","EDITOR_VIEW_TAB_INDEX","ENTER_KEY","ICON_SIZE","WIDTH","HEIGHT","ICON_COLOR","STROKE","FILL","DEFAULT_FILTER_OPTION_LABEL","DEBUG_PARAM"],"sources":["../src/constants.js"],"sourcesContent":["const PLUGIN_NAME = 'data-ui';\nconst DATA_LISTING_PREFIX = '/data-listing';\nconst PAGE_BUILDER = 'pageBuilder';\nconst TEXT_CONTENT_TYPE = 'Publish';\nconst ENTITY_PUBLISHED = 'published';\nconst SELECT_DEFAULT_VALUE = 'Please Choose...';\nconst LEAVE_PAGE_MESSAGE = 'You are going to leave without saving. Are you sure you want to leave?';\nconst KEY_TO_CHECK = 'values.slug';\nconst MENU_PERMISSIONS = ['update:any', 'update:own', 'create:any', 'create:own'];\nconst PREVIEW_INTERFACE = 'preview/can-preview';\nconst PAGE_BUILDER_FIELD_ID = 'pageBuilder';\nconst PAGE_BUILDER_TEMPLATE_FIELD_ID = 'pageBuilderTemplateId';\nconst ERROR = 'error';\nconst SUCCESS = 'success';\nconst PUBLISHED = 'published';\nconst UNPUBLISHED = 'unpublished';\nconst SAVE_BUTTON_TEXTS = { save: 'save', saved: 'saved', saving: 'saving' };\nconst ACTIONS = 'actions';\nconst UNPUBLISHED_WARNING = 'Page already unpublished';\nconst PAGE_NOT_FOUND = 'Page not found';\nconst SAVE_BEFORE_PUBLISH_MESSAGE =\n 'You have to click save to create the record before you can publish';\n\nconst PAGE_BUILDER_TAB = 'Page builder';\nconst PAGE_BUILDER_TAB_INDEX = 1;\nconst EDITOR_VIEW_TAB = 'Editor view';\nconst EDITOR_VIEW_TAB_INDEX = 0;\n\nconst ENTER_KEY = 'Enter';\n\nconst ICON_SIZE = {\n WIDTH: '25px',\n HEIGHT: '25px'\n};\n\nconst ICON_COLOR = {\n STROKE: '#63779C',\n FILL: '#63779C'\n};\n\nconst DEFAULT_FILTER_OPTION_LABEL = 'Any';\nconst DEBUG_PARAM = 'blaze_debug=1';\n\nexport {\n DATA_LISTING_PREFIX,\n DEBUG_PARAM,\n ENTITY_PUBLISHED,\n KEY_TO_CHECK,\n LEAVE_PAGE_MESSAGE,\n MENU_PERMISSIONS,\n PAGE_BUILDER,\n PLUGIN_NAME,\n PREVIEW_INTERFACE,\n SELECT_DEFAULT_VALUE,\n TEXT_CONTENT_TYPE,\n PAGE_BUILDER_FIELD_ID,\n PAGE_BUILDER_TEMPLATE_FIELD_ID,\n ERROR,\n SUCCESS,\n PUBLISHED,\n UNPUBLISHED,\n SAVE_BUTTON_TEXTS,\n ACTIONS,\n PAGE_BUILDER_TAB_INDEX,\n EDITOR_VIEW_TAB_INDEX,\n EDITOR_VIEW_TAB,\n PAGE_BUILDER_TAB,\n UNPUBLISHED_WARNING,\n SAVE_BEFORE_PUBLISH_MESSAGE,\n ICON_SIZE,\n ICON_COLOR,\n PAGE_NOT_FOUND,\n ENTER_KEY,\n DEFAULT_FILTER_OPTION_LABEL\n};\n"],"mappings":"AAAA,MAAMA,WAAW,GAAG,SAAS;AAC7B,MAAMC,mBAAmB,GAAG,eAAe;AAC3C,MAAMC,YAAY,GAAG,aAAa;AAClC,MAAMC,iBAAiB,GAAG,SAAS;AACnC,MAAMC,gBAAgB,GAAG,WAAW;AACpC,MAAMC,oBAAoB,GAAG,kBAAkB;AAC/C,MAAMC,kBAAkB,GAAG,wEAAwE;AACnG,MAAMC,YAAY,GAAG,aAAa;AAClC,MAAMC,gBAAgB,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC;AACjF,MAAMC,iBAAiB,GAAG,qBAAqB;AAC/C,MAAMC,qBAAqB,GAAG,aAAa;AAC3C,MAAMC,8BAA8B,GAAG,uBAAuB;AAC9D,MAAMC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@@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/plugin-data-ui",
|
|
3
|
-
"version": "0.146.0-node18-
|
|
3
|
+
"version": "0.146.0-node18-tooltips.13",
|
|
4
4
|
"description": "Blaze plugin data ui",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/admin-ui-utils": "0.146.0-node18-
|
|
31
|
-
"@blaze-cms/core-errors": "0.146.0-node18-
|
|
32
|
-
"@blaze-cms/plugin-render-hooks-ui": "0.146.0-node18-
|
|
33
|
-
"@blaze-cms/react-form-builder": "0.146.0-node18-
|
|
34
|
-
"@blaze-cms/react-page-builder": "0.146.0-node18-
|
|
35
|
-
"@blaze-cms/setup-ui": "0.146.0-node18-
|
|
36
|
-
"@blaze-cms/versioning-ui": "0.146.0-node18-
|
|
30
|
+
"@blaze-cms/admin-ui-utils": "0.146.0-node18-tooltips.4",
|
|
31
|
+
"@blaze-cms/core-errors": "0.146.0-node18-tooltips.0",
|
|
32
|
+
"@blaze-cms/plugin-render-hooks-ui": "0.146.0-node18-tooltips.0",
|
|
33
|
+
"@blaze-cms/react-form-builder": "0.146.0-node18-tooltips.11",
|
|
34
|
+
"@blaze-cms/react-page-builder": "0.146.0-node18-tooltips.13",
|
|
35
|
+
"@blaze-cms/setup-ui": "0.146.0-node18-tooltips.0",
|
|
36
|
+
"@blaze-cms/versioning-ui": "0.146.0-node18-tooltips.0",
|
|
37
37
|
"@blaze-react/button": "0.8.0-alpha.82",
|
|
38
38
|
"@blaze-react/more": "0.5.19",
|
|
39
39
|
"@blaze-react/multiselect": "0.8.0-alpha.103",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"uuid": "^3.3.3"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@blaze-cms/core-ui": "0.146.0-node18-
|
|
60
|
+
"@blaze-cms/core-ui": "0.146.0-node18-tooltips.11"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@apollo/client": "3.x",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"lib/*",
|
|
70
70
|
"lib-es/*"
|
|
71
71
|
],
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "7d2c08948085cc3324be4f931b738947d8093d66"
|
|
73
73
|
}
|
package/src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js
CHANGED
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import Button from '@blaze-react/button';
|
|
4
4
|
import { useMutation } from '@apollo/client';
|
|
5
5
|
import { getMutation } from '@blaze-cms/admin-ui-utils';
|
|
6
|
+
import { DEBUG_PARAM } from '../../../../../constants';
|
|
6
7
|
|
|
7
8
|
const HeaderPreviewButton = ({ itemId, itemEntity }) => {
|
|
8
9
|
const [createPreviewToken] = useMutation(getMutation('PREVIEW_TOKEN_MUTATION'));
|
|
@@ -25,7 +26,10 @@ const HeaderPreviewButton = ({ itemId, itemEntity }) => {
|
|
|
25
26
|
|
|
26
27
|
if (url) {
|
|
27
28
|
const delimiter = url.includes('?') ? '&' : '?';
|
|
28
|
-
|
|
29
|
+
const debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM
|
|
30
|
+
? ''
|
|
31
|
+
: `${delimiter}${DEBUG_PARAM}`;
|
|
32
|
+
window.open(`${url}${debugParam}`, '_blank');
|
|
29
33
|
}
|
|
30
34
|
// eslint-disable-next-line no-empty
|
|
31
35
|
} catch (err) {}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import has from 'lodash.has';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
DEBUG_PARAM,
|
|
4
|
+
ENTITY_PUBLISHED,
|
|
5
|
+
KEY_TO_CHECK,
|
|
6
|
+
SELECT_DEFAULT_VALUE
|
|
7
|
+
} from '../../../constants';
|
|
3
8
|
|
|
4
9
|
function canViewPage(formData, entity, schema, entityIsPublished) {
|
|
5
10
|
return (
|
|
@@ -30,7 +35,10 @@ async function onViewUrlClick(getFullUrl) {
|
|
|
30
35
|
const fullUrl = await getFullUrl();
|
|
31
36
|
if (fullUrl) {
|
|
32
37
|
const delimiter = fullUrl.includes('?') ? '&' : '?';
|
|
33
|
-
|
|
38
|
+
const debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM
|
|
39
|
+
? ''
|
|
40
|
+
: `${delimiter}${DEBUG_PARAM}`;
|
|
41
|
+
window.open(`${fullUrl}${debugParam}`, '_blank');
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
44
|
|
package/src/constants.js
CHANGED