@blaze-cms/plugin-data-ui 0.125.0-f-admin-updates.0 → 0.125.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 +69 -6
- package/README.md +33 -1
- package/lib/components/EntityDataListing/EntityDataListing.js +17 -40
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityDataListing/index.js +0 -4
- package/lib/components/EntityDataListing/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/Entity.js +85 -226
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +13 -28
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +5 -26
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +0 -4
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/index.js +0 -4
- package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +18 -68
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +0 -3
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +0 -16
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +0 -11
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +0 -3
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/index.js +0 -7
- package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +0 -3
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +0 -18
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +0 -3
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +0 -25
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/index.js +0 -4
- package/lib/components/EntityManager/Entity/index.js.map +1 -1
- package/lib/components/EntityManager/EntityManager.js +24 -83
- package/lib/components/EntityManager/EntityManager.js.map +1 -1
- package/lib/components/EntityManager/index.js +0 -4
- package/lib/components/EntityManager/index.js.map +1 -1
- package/lib/components/EntityManager/utils/data-mappers.js +11 -42
- package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib/components/EntityManager/utils/entity.js +3 -38
- package/lib/components/EntityManager/utils/entity.js.map +1 -1
- package/lib/components/EntityManager/utils/entityAvailableActions.js +17 -42
- package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib/components/EntityManager/utils/is-form-empty.js +0 -7
- package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
- package/lib/components/EntityManager/utils/query.js +2 -11
- package/lib/components/EntityManager/utils/query.js.map +1 -1
- package/lib/components/ListingTable/ListingTable.js +31 -116
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +9 -22
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/index.js +0 -4
- package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
- package/lib/components/ListingTable/TableActions/TableActions.js +2 -11
- package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
- package/lib/components/ListingTable/TableActions/index.js +0 -4
- package/lib/components/ListingTable/TableActions/index.js.map +1 -1
- package/lib/components/ListingTable/index.js +0 -4
- package/lib/components/ListingTable/index.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +13 -49
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +0 -11
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/components/Tabs/index.js +5 -16
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/constants.js +0 -1
- package/lib/constants.js.map +1 -1
- package/lib/index.js +2 -31
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +2 -17
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-create-entity-mutation.js +0 -12
- package/lib/utils/build-create-entity-mutation.js.map +1 -1
- package/lib/utils/build-delete-entity-mutation.js +0 -10
- package/lib/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib/utils/build-listing-query.js +1 -11
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/build-update-data-query.js +0 -12
- package/lib/utils/build-update-data-query.js.map +1 -1
- package/lib/utils/build-update-publish-unpublish-mutation.js +0 -9
- package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib/utils/get-default-query-params.js +3 -3
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib/utils/hoc/withContext.js +0 -7
- package/lib/utils/hoc/withContext.js.map +1 -1
- package/lib/utils/hooks/useToggle.js +3 -10
- package/lib/utils/hooks/useToggle.js.map +1 -1
- package/lib/utils/index.js +0 -3
- package/lib/utils/index.js.map +1 -1
- package/lib-es/components/EntityDataListing/EntityDataListing.js +0 -2
- package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib-es/components/EntityDataListing/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/Entity.js +28 -77
- package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js +0 -2
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +2 -5
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +7 -16
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js +0 -3
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js +0 -3
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js +0 -5
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js +0 -6
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/index.js.map +1 -1
- package/lib-es/components/EntityManager/EntityManager.js +2 -14
- package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
- package/lib-es/components/EntityManager/index.js.map +1 -1
- package/lib-es/components/EntityManager/utils/data-mappers.js +2 -13
- package/lib-es/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib-es/components/EntityManager/utils/entity.js +0 -13
- package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
- package/lib-es/components/EntityManager/utils/entityAvailableActions.js +0 -2
- package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib-es/components/EntityManager/utils/is-form-empty.js +0 -2
- package/lib-es/components/EntityManager/utils/is-form-empty.js.map +1 -1
- package/lib-es/components/EntityManager/utils/query.js +2 -4
- package/lib-es/components/EntityManager/utils/query.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTable.js +0 -17
- package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +0 -2
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTableContent/index.js.map +1 -1
- package/lib-es/components/ListingTable/TableActions/TableActions.js +0 -2
- package/lib-es/components/ListingTable/TableActions/TableActions.js.map +1 -1
- package/lib-es/components/ListingTable/TableActions/index.js.map +1 -1
- package/lib-es/components/ListingTable/index.js.map +1 -1
- package/lib-es/components/ListingTable/mappers/populate-rows.js +0 -13
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib-es/components/ListingTable/service/index.js +0 -2
- package/lib-es/components/ListingTable/service/index.js.map +1 -1
- package/lib-es/components/Tabs/index.js +0 -2
- package/lib-es/components/Tabs/index.js.map +1 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/index.js +2 -6
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/add-content-menu-items.js +0 -3
- package/lib-es/utils/add-content-menu-items.js.map +1 -1
- package/lib-es/utils/build-create-entity-mutation.js +0 -3
- package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
- package/lib-es/utils/build-delete-entity-mutation.js +0 -3
- package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib-es/utils/build-listing-query.js +2 -5
- package/lib-es/utils/build-listing-query.js.map +1 -1
- package/lib-es/utils/build-update-data-query.js +0 -3
- package/lib-es/utils/build-update-data-query.js.map +1 -1
- package/lib-es/utils/build-update-publish-unpublish-mutation.js +0 -3
- package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib-es/utils/get-default-query-params.js +4 -1
- package/lib-es/utils/get-default-query-params.js.map +1 -1
- package/lib-es/utils/hoc/withContext.js.map +1 -1
- package/lib-es/utils/hooks/useToggle.js +0 -2
- package/lib-es/utils/hooks/useToggle.js.map +1 -1
- package/lib-es/utils/index.js.map +1 -1
- package/package.json +7 -7
- package/src/components/EntityManager/Entity/Entity.js +60 -64
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +9 -23
- package/src/components/EntityManager/utils/data-mappers.js +2 -2
- package/src/utils/build-listing-query.js +6 -2
- package/src/utils/get-default-query-params.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,19 +3,82 @@
|
|
|
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.125.0
|
|
6
|
+
# [0.125.0](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.18...v0.125.0) (2022-11-30)
|
|
7
7
|
|
|
8
|
+
**Note:** Version bump only for package @blaze-cms/plugin-data-ui
|
|
8
9
|
|
|
9
|
-
### Bug Fixes
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.125.0-alpha.18](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.17...v0.125.0-alpha.18) (2022-11-28)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* add admin listing filter to allow filtering in admin listings ([ac862bf](https://github.com/thebyte9/blaze/commit/ac862bf64dc021b2618aa648545b873b7db2638e))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [0.125.0-alpha.15](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.14...v0.125.0-alpha.15) (2022-11-16)
|
|
13
26
|
|
|
14
27
|
|
|
15
28
|
### Features
|
|
16
29
|
|
|
17
|
-
*
|
|
18
|
-
|
|
30
|
+
* GroupContent components ([#3678](https://github.com/thebyte9/blaze/issues/3678)) ([b6f5c7e](https://github.com/thebyte9/blaze/commit/b6f5c7e6e5a03f2322f3d3c1568c9d42b33ede45))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# [0.125.0-alpha.14](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.13...v0.125.0-alpha.14) (2022-10-25)
|
|
37
|
+
|
|
38
|
+
**Note:** Version bump only for package @blaze-cms/plugin-data-ui
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# [0.125.0-alpha.13](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.12...v0.125.0-alpha.13) (2022-10-24)
|
|
45
|
+
|
|
46
|
+
**Note:** Version bump only for package @blaze-cms/plugin-data-ui
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
# [0.125.0-alpha.7](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.6...v0.125.0-alpha.7) (2022-10-07)
|
|
53
|
+
|
|
54
|
+
**Note:** Version bump only for package @blaze-cms/plugin-data-ui
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# [0.125.0-alpha.3](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.2...v0.125.0-alpha.3) (2022-09-27)
|
|
61
|
+
|
|
62
|
+
**Note:** Version bump only for package @blaze-cms/plugin-data-ui
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# [0.125.0-alpha.1](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.0...v0.125.0-alpha.1) (2022-09-15)
|
|
69
|
+
|
|
70
|
+
**Note:** Version bump only for package @blaze-cms/plugin-data-ui
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
## [0.124.2-alpha.0](https://github.com/thebyte9/blaze/compare/v0.124.1...v0.124.2-alpha.0) (2022-09-06)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### Bug Fixes
|
|
80
|
+
|
|
81
|
+
* copy data from functionality ([#3567](https://github.com/thebyte9/blaze/issues/3567)) ([e3e1faf](https://github.com/thebyte9/blaze/commit/e3e1faf758661ac9e1555f1b3963f472c93edd36))
|
|
19
82
|
|
|
20
83
|
|
|
21
84
|
|
package/README.md
CHANGED
|
@@ -5,4 +5,36 @@ Base files for a plugin
|
|
|
5
5
|
### Events emitted
|
|
6
6
|
| key | Description | Argument |
|
|
7
7
|
| ---------------------- | ------------------------------------------------- | ---------------------------------------------- |
|
|
8
|
-
| load:custom:field:type | Add to the form builder lookup a new custom field | {type: 'text': component: unmountendComponent} |
|
|
8
|
+
| load:custom:field:type | Add to the form builder lookup a new custom field | {type: 'text': component: unmountendComponent} |
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## displayProperties
|
|
13
|
+
|
|
14
|
+
The `displayProperties` property can be set on entity schema in the api to provide extra information for how to format the way an entity is display. For example the following could be set on an entity
|
|
15
|
+
```json
|
|
16
|
+
"displayProperties": {
|
|
17
|
+
"adminHeader": [
|
|
18
|
+
"firstname",
|
|
19
|
+
"lastname"
|
|
20
|
+
],
|
|
21
|
+
"adminLabel": {
|
|
22
|
+
"main": [
|
|
23
|
+
"firstname",
|
|
24
|
+
"lastname"
|
|
25
|
+
],
|
|
26
|
+
"sub": [
|
|
27
|
+
"group.name"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"adminDefaultListingFilter": {
|
|
31
|
+
"firstname": {
|
|
32
|
+
"_exists": false
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- adminDefaultListingFilter: this is a where query that will be passed to the api to filter records from the admin listing
|
|
39
|
+
- adminLabel: properties to build label when record is showing search listings
|
|
40
|
+
- adminHeader: properties to build admin header
|
|
@@ -1,83 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = void 0;
|
|
11
|
-
|
|
12
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
-
|
|
14
10
|
require("core-js/modules/es.regexp.exec.js");
|
|
15
|
-
|
|
16
11
|
require("core-js/modules/es.string.match.js");
|
|
17
|
-
|
|
18
12
|
require("core-js/modules/es.array.filter.js");
|
|
19
|
-
|
|
20
13
|
require("core-js/modules/es.object.to-string.js");
|
|
21
|
-
|
|
22
14
|
require("core-js/modules/es.array.map.js");
|
|
23
|
-
|
|
24
15
|
require("core-js/modules/es.string.ends-with.js");
|
|
25
|
-
|
|
26
16
|
var _client = require("@apollo/client");
|
|
27
|
-
|
|
28
17
|
var _react = _interopRequireDefault(require("react"));
|
|
29
|
-
|
|
30
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
31
|
-
|
|
32
19
|
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
33
|
-
|
|
34
20
|
var _ListingTable = _interopRequireDefault(require("../ListingTable/ListingTable"));
|
|
35
|
-
|
|
36
21
|
var _withContext = require("../../utils/hoc/withContext");
|
|
37
|
-
|
|
38
22
|
var EntityDataListing = function EntityDataListing(_ref) {
|
|
39
23
|
var match = _ref.match,
|
|
40
|
-
|
|
24
|
+
menuItems = _ref.menuItems;
|
|
41
25
|
var identifier = match.params.entityIdentifier;
|
|
42
|
-
|
|
43
26
|
var _menuItems$map$filter = menuItems.map(function (_ref2) {
|
|
44
|
-
|
|
27
|
+
var _ref3 = (0, _slicedToArray2["default"])(_ref2, 2),
|
|
45
28
|
_ = _ref3[0],
|
|
46
29
|
items = _ref3[1].items;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
selectedMenuItem = _menuItems$map$filter3[0];
|
|
57
|
-
|
|
30
|
+
var item = items.filter(function (_ref4) {
|
|
31
|
+
var uri = _ref4.uri;
|
|
32
|
+
return uri.endsWith("/".concat(identifier));
|
|
33
|
+
});
|
|
34
|
+
return item.length ? item : null;
|
|
35
|
+
}).filter(Boolean),
|
|
36
|
+
_menuItems$map$filter2 = (0, _slicedToArray2["default"])(_menuItems$map$filter, 1),
|
|
37
|
+
_menuItems$map$filter3 = (0, _slicedToArray2["default"])(_menuItems$map$filter2[0], 1),
|
|
38
|
+
selectedMenuItem = _menuItems$map$filter3[0];
|
|
58
39
|
var _useQuery = (0, _client.useQuery)((0, _adminUiUtils.getQuery)('GET_ENTITY_SCHEMA'), {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
40
|
+
variables: {
|
|
41
|
+
identifier: identifier
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
_useQuery$data = _useQuery.data;
|
|
65
45
|
_useQuery$data = _useQuery$data === void 0 ? {} : _useQuery$data;
|
|
66
46
|
var _useQuery$data$getEnt = _useQuery$data.getEntitySchemas,
|
|
67
|
-
|
|
47
|
+
getEntitySchemas = _useQuery$data$getEnt === void 0 ? [] : _useQuery$data$getEnt;
|
|
68
48
|
if (!getEntitySchemas.length) return '';
|
|
69
49
|
return /*#__PURE__*/_react["default"].createElement(_ListingTable["default"], {
|
|
70
50
|
entitySchema: getEntitySchemas[0],
|
|
71
51
|
selectedMenuItem: selectedMenuItem
|
|
72
52
|
});
|
|
73
53
|
};
|
|
74
|
-
|
|
75
54
|
EntityDataListing.propTypes = {
|
|
76
55
|
match: _propTypes["default"].object.isRequired,
|
|
77
56
|
menuItems: _propTypes["default"].array.isRequired
|
|
78
57
|
};
|
|
79
|
-
|
|
80
58
|
var _default = (0, _withContext.withContext)(EntityDataListing);
|
|
81
|
-
|
|
82
59
|
exports["default"] = _default;
|
|
83
60
|
//# sourceMappingURL=EntityDataListing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityDataListing.js","names":["EntityDataListing","match","menuItems","identifier","params","entityIdentifier","map","_","items","item","filter","uri","endsWith","length","Boolean","selectedMenuItem","useQuery","getQuery","variables","data","getEntitySchemas","propTypes","PropTypes","object","isRequired","array","withContext"],"sources":["../../../src/components/EntityDataListing/EntityDataListing.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\n\nimport ListingTable from '../ListingTable/ListingTable';\nimport { withContext } from '../../utils/hoc/withContext';\n\nconst EntityDataListing = ({ match, menuItems }) => {\n const {\n params: { entityIdentifier: identifier }\n } = match;\n\n const [[selectedMenuItem]] = menuItems\n .map(([_, { items }]) => {\n const item = items.filter(({ uri }) => uri.endsWith(`/${identifier}`));\n\n return item.length ? item : null;\n })\n .filter(Boolean);\n\n const { data: { getEntitySchemas = [] } = {} } = useQuery(getQuery('GET_ENTITY_SCHEMA'), {\n variables: { identifier }\n });\n\n if (!getEntitySchemas.length) return '';\n\n return <ListingTable entitySchema={getEntitySchemas[0]} selectedMenuItem={selectedMenuItem} />;\n};\n\nEntityDataListing.propTypes = {\n match: PropTypes.object.isRequired,\n menuItems: PropTypes.array.isRequired\n};\n\nexport default withContext(EntityDataListing);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EntityDataListing.js","names":["EntityDataListing","match","menuItems","identifier","params","entityIdentifier","map","_","items","item","filter","uri","endsWith","length","Boolean","selectedMenuItem","useQuery","getQuery","variables","data","getEntitySchemas","propTypes","PropTypes","object","isRequired","array","withContext"],"sources":["../../../src/components/EntityDataListing/EntityDataListing.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\n\nimport ListingTable from '../ListingTable/ListingTable';\nimport { withContext } from '../../utils/hoc/withContext';\n\nconst EntityDataListing = ({ match, menuItems }) => {\n const {\n params: { entityIdentifier: identifier }\n } = match;\n\n const [[selectedMenuItem]] = menuItems\n .map(([_, { items }]) => {\n const item = items.filter(({ uri }) => uri.endsWith(`/${identifier}`));\n\n return item.length ? item : null;\n })\n .filter(Boolean);\n\n const { data: { getEntitySchemas = [] } = {} } = useQuery(getQuery('GET_ENTITY_SCHEMA'), {\n variables: { identifier }\n });\n\n if (!getEntitySchemas.length) return '';\n\n return <ListingTable entitySchema={getEntitySchemas[0]} selectedMenuItem={selectedMenuItem} />;\n};\n\nEntityDataListing.propTypes = {\n match: PropTypes.object.isRequired,\n menuItems: PropTypes.array.isRequired\n};\n\nexport default withContext(EntityDataListing);\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiB,OAA6B;EAAA,IAAvBC,KAAK,QAALA,KAAK;IAAEC,SAAS,QAATA,SAAS;EAC3C,IAC8BC,UAAU,GACpCF,KAAK,CADPG,MAAM,CAAIC,gBAAgB;EAG5B,4BAA6BH,SAAS,CACnCI,GAAG,CAAC,iBAAoB;MAAA;QAAlBC,CAAC;QAAIC,KAAK,YAALA,KAAK;MACf,IAAMC,IAAI,GAAGD,KAAK,CAACE,MAAM,CAAC;QAAA,IAAGC,GAAG,SAAHA,GAAG;QAAA,OAAOA,GAAG,CAACC,QAAQ,YAAKT,UAAU,EAAG;MAAA,EAAC;MAEtE,OAAOM,IAAI,CAACI,MAAM,GAAGJ,IAAI,GAAG,IAAI;IAClC,CAAC,CAAC,CACDC,MAAM,CAACI,OAAO,CAAC;IAAA;IAAA;IANVC,gBAAgB;EAQxB,gBAAiD,IAAAC,gBAAQ,EAAC,IAAAC,sBAAQ,EAAC,mBAAmB,CAAC,EAAE;MACvFC,SAAS,EAAE;QAAEf,UAAU,EAAVA;MAAW;IAC1B,CAAC,CAAC;IAAA,2BAFMgB,IAAI;EAAZ,6CAA0C,CAAC,CAAC;EAA5C,2CAAgBC,gBAAgB;IAAhBA,gBAAgB,sCAAG,EAAE;EAIrC,IAAI,CAACA,gBAAgB,CAACP,MAAM,EAAE,OAAO,EAAE;EAEvC,oBAAO,gCAAC,wBAAY;IAAC,YAAY,EAAEO,gBAAgB,CAAC,CAAC,CAAE;IAAC,gBAAgB,EAAEL;EAAiB,EAAG;AAChG,CAAC;AAEDf,iBAAiB,CAACqB,SAAS,GAAG;EAC5BpB,KAAK,EAAEqB,qBAAS,CAACC,MAAM,CAACC,UAAU;EAClCtB,SAAS,EAAEoB,qBAAS,CAACG,KAAK,CAACD;AAC7B,CAAC;AAAC,eAEa,IAAAE,wBAAW,EAAC1B,iBAAiB,CAAC;AAAA"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = void 0;
|
|
11
|
-
|
|
12
9
|
var _EntityDataListing = _interopRequireDefault(require("./EntityDataListing"));
|
|
13
|
-
|
|
14
10
|
var _default = _EntityDataListing["default"];
|
|
15
11
|
exports["default"] = _default;
|
|
16
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["EntityDataListing"],"sources":["../../../src/components/EntityDataListing/index.js"],"sourcesContent":["import EntityDataListing from './EntityDataListing';\n\nexport default EntityDataListing;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["EntityDataListing"],"sources":["../../../src/components/EntityDataListing/index.js"],"sourcesContent":["import EntityDataListing from './EntityDataListing';\n\nexport default EntityDataListing;\n"],"mappings":";;;;;;;;AAAA;AAAoD,eAErCA,6BAAiB;AAAA"}
|