@blaze-cms/plugin-data-ui 0.146.0-translations.8 → 0.147.0-rc-eagle.4
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/lib/components/EntityDataListing/EntityDataListing.js +21 -19
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityDataListing/index.js +2 -3
- package/lib/components/EntityDataListing/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +18 -19
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/Entity.js +284 -457
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +62 -66
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +32 -56
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +20 -26
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +20 -17
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +34 -32
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +95 -158
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +23 -30
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -56
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +29 -45
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/index.js +7 -8
- package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +36 -57
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +47 -66
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/index.js +2 -3
- package/lib/components/EntityManager/Entity/index.js.map +1 -1
- package/lib/components/EntityManager/EntityManager.js +91 -166
- package/lib/components/EntityManager/EntityManager.js.map +1 -1
- package/lib/components/EntityManager/index.js +2 -3
- package/lib/components/EntityManager/index.js.map +1 -1
- package/lib/components/EntityManager/utils/RecordEditContext/index.js +3 -4
- package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
- package/lib/components/EntityManager/utils/data-mappers.js +34 -46
- package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib/components/EntityManager/utils/entity.js +35 -80
- package/lib/components/EntityManager/utils/entity.js.map +1 -1
- package/lib/components/EntityManager/utils/entityAvailableActions.js +51 -110
- package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib/components/EntityManager/utils/is-form-empty.js +6 -10
- package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
- package/lib/components/EntityManager/utils/query.js +17 -10
- package/lib/components/EntityManager/utils/query.js.map +1 -1
- package/lib/components/InfoBoxes/InfoBoxTooltip.js +19 -16
- package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
- package/lib/components/InfoBoxes/InfoBoxes.js +19 -19
- package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js +26 -38
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +21 -16
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useData.js +33 -30
- package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useInfoBox.js +10 -10
- package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/index.js +2 -3
- package/lib/components/InfoBoxes/index.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBox.js +27 -34
- package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +11 -12
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +12 -12
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
- package/lib/components/ListingTable/ListingTable.js +155 -296
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +53 -58
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/index.js +2 -3
- package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js +436 -262
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js +30 -37
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/helpers.js +82 -71
- package/lib/components/ListingTable/SearchFilter/helpers.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/querys.js +5 -5
- package/lib/components/ListingTable/SearchFilter/querys.js.map +1 -1
- package/lib/components/ListingTable/TableActions/TableActions.js +27 -31
- package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
- package/lib/components/ListingTable/TableActions/index.js +2 -3
- package/lib/components/ListingTable/TableActions/index.js.map +1 -1
- package/lib/components/ListingTable/index.js +2 -3
- package/lib/components/ListingTable/index.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +103 -122
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +66 -83
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/components/Tabs/index.js +26 -42
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/hooks/useCallbackDebounce.js +5 -9
- package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
- package/lib/constants.js +30 -31
- package/lib/constants.js.map +1 -1
- package/lib/icons/ContentIcon.js +17 -20
- package/lib/icons/ContentIcon.js.map +1 -1
- package/lib/icons/SettingsIcon.js +12 -15
- package/lib/icons/SettingsIcon.js.map +1 -1
- package/lib/icons/TaxonomyIcon.js +15 -18
- package/lib/icons/TaxonomyIcon.js.map +1 -1
- package/lib/icons/UsersIcon.js +11 -14
- package/lib/icons/UsersIcon.js.map +1 -1
- package/lib/icons/index.js +8 -9
- package/lib/icons/index.js.map +1 -1
- package/lib/index.js +88 -121
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +67 -93
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-create-entity-mutation.js +12 -9
- package/lib/utils/build-create-entity-mutation.js.map +1 -1
- package/lib/utils/build-delete-entity-mutation.js +11 -8
- package/lib/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib/utils/build-listing-query.js +17 -14
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/build-update-data-query.js +15 -9
- package/lib/utils/build-update-data-query.js.map +1 -1
- package/lib/utils/build-update-publish-unpublish-mutation.js +15 -8
- package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib/utils/get-default-query-params.js +7 -6
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib/utils/hoc/withContext.js +4 -6
- package/lib/utils/hoc/withContext.js.map +1 -1
- package/lib/utils/hooks/useToggle.js +4 -12
- package/lib/utils/hooks/useToggle.js.map +1 -1
- package/lib/utils/index.js +2 -3
- package/lib/utils/index.js.map +1 -1
- package/lib-es/components/EntityManager/Entity/Entity.js +8 -20
- 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.map +1 -1
- 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 +6 -3
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- 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.map +1 -1
- package/lib-es/components/EntityManager/utils/query.js.map +1 -1
- package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -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 +2 -2
- package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +20 -17
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js +323 -51
- package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js +7 -3
- package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/helpers.js +39 -8
- package/lib-es/components/ListingTable/SearchFilter/helpers.js.map +1 -1
- package/lib-es/components/ListingTable/SearchFilter/querys.js.map +1 -1
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib-es/components/ListingTable/service/index.js.map +1 -1
- package/lib-es/components/Tabs/index.js +6 -7
- package/lib-es/components/Tabs/index.js.map +1 -1
- package/lib-es/index.js +12 -3
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/add-content-menu-items.js.map +1 -1
- package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
- package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib-es/utils/build-listing-query.js.map +1 -1
- package/lib-es/utils/build-update-data-query.js.map +1 -1
- package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib-es/utils/hoc/withContext.js +1 -1
- package/lib-es/utils/hoc/withContext.js.map +1 -1
- package/package.json +27 -22
- package/src/components/EntityManager/Entity/Entity.js +59 -77
- package/src/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
- package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +9 -7
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +64 -59
- package/src/components/EntityManager/EntityManager.js +52 -45
- package/src/components/InfoBoxes/container/InfoBoxContainer.js +3 -6
- package/src/components/InfoBoxes/hooks/useData.js +6 -1
- package/src/components/ListingTable/ListingTable.js +13 -21
- package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +38 -44
- package/src/components/ListingTable/SearchFilter/SearchContainer.js +411 -134
- package/src/components/ListingTable/SearchFilter/SearchFilter.js +5 -2
- package/src/components/ListingTable/SearchFilter/helpers.js +56 -8
- package/src/components/ListingTable/service/index.js +2 -3
- package/src/components/Tabs/index.js +17 -21
- package/src/index.js +11 -7
- package/src/utils/hoc/withContext.js +5 -4
- package/CHANGELOG.md +0 -1947
- package/babel.config.js +0 -3
- package/jest.config.js +0 -5
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.RecordEditContextProvider = exports.RecordEditContextConsumer = exports.RecordEditContext = void 0;
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const RecordEditContext = exports.RecordEditContext = /*#__PURE__*/_react.default.createContext();
|
|
10
|
+
const RecordEditContextProvider = exports.RecordEditContextProvider = RecordEditContext.Provider;
|
|
11
|
+
const RecordEditContextConsumer = exports.RecordEditContextConsumer = RecordEditContext.Consumer;
|
|
13
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","RecordEditContext","exports","React","createContext","RecordEditContextProvider","Provider","RecordEditContextConsumer","Consumer"],"sources":["../../../../../src/components/EntityManager/utils/RecordEditContext/index.js"],"sourcesContent":["import React from 'react';\n\nconst RecordEditContext = React.createContext();\nconst RecordEditContextProvider = RecordEditContext.Provider;\nconst RecordEditContextConsumer = RecordEditContext.Consumer;\n\nexport { RecordEditContext, RecordEditContextProvider, RecordEditContextConsumer };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","RecordEditContext","exports","React","createContext","RecordEditContextProvider","Provider","RecordEditContextConsumer","Consumer"],"sources":["../../../../../src/components/EntityManager/utils/RecordEditContext/index.js"],"sourcesContent":["import React from 'react';\n\nconst RecordEditContext = React.createContext();\nconst RecordEditContextProvider = RecordEditContext.Provider;\nconst RecordEditContextConsumer = RecordEditContext.Consumer;\n\nexport { RecordEditContext, RecordEditContextProvider, RecordEditContextConsumer };\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,gBAAGE,cAAK,CAACC,aAAa,CAAC,CAAC;AAC/C,MAAMC,yBAAyB,GAAAH,OAAA,CAAAG,yBAAA,GAAGJ,iBAAiB,CAACK,QAAQ;AAC5D,MAAMC,yBAAyB,GAAAL,OAAA,CAAAK,yBAAA,GAAGN,iBAAiB,CAACO,QAAQ","ignoreList":[]}
|
|
@@ -1,60 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.js");
|
|
4
|
-
require("core-js/modules/es.object.define-properties.js");
|
|
5
|
-
require("core-js/modules/es.object.define-property.js");
|
|
6
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
7
|
-
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
8
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
9
4
|
Object.defineProperty(exports, "__esModule", {
|
|
10
5
|
value: true
|
|
11
6
|
});
|
|
12
7
|
exports.updateListItems = exports.getPageName = exports.deleteFromListItems = exports.createNewListItem = void 0;
|
|
13
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
-
require("core-js/modules/es.array.concat.js");
|
|
16
|
-
require("core-js/modules/es.array.filter.js");
|
|
17
|
-
require("core-js/modules/es.array.for-each.js");
|
|
18
|
-
require("core-js/modules/es.array.join.js");
|
|
19
|
-
require("core-js/modules/es.array.map.js");
|
|
20
|
-
require("core-js/modules/es.array.reduce.js");
|
|
21
|
-
require("core-js/modules/es.function.name.js");
|
|
22
|
-
require("core-js/modules/es.object.keys.js");
|
|
23
|
-
require("core-js/modules/es.object.to-string.js");
|
|
24
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
25
9
|
var _coreErrors = require("@blaze-cms/core-errors");
|
|
26
10
|
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; }
|
|
27
|
-
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
|
|
28
|
-
|
|
29
|
-
var displayProperties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
30
|
-
var entity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
11
|
+
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; }
|
|
12
|
+
const getPageName = (displayProperties = {}, entity = {}) => {
|
|
31
13
|
if (!displayProperties || !displayProperties.adminHeader) {
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
const {
|
|
15
|
+
name,
|
|
16
|
+
id: fieldId
|
|
17
|
+
} = entity;
|
|
34
18
|
return name || fieldId || '';
|
|
35
19
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
20
|
+
const {
|
|
21
|
+
adminHeader
|
|
22
|
+
} = displayProperties;
|
|
23
|
+
return adminHeader.reduce((acc, headerProperty) => {
|
|
24
|
+
const item = entity[headerProperty];
|
|
39
25
|
if (item) acc.push(item);
|
|
40
26
|
return acc;
|
|
41
27
|
}, []).join(' ');
|
|
42
28
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
29
|
+
exports.getPageName = getPageName;
|
|
30
|
+
const createNewListItem = ({
|
|
31
|
+
listingData,
|
|
32
|
+
result
|
|
33
|
+
}) => [...listingData, result];
|
|
34
|
+
exports.createNewListItem = createNewListItem;
|
|
35
|
+
const updateListItems = ({
|
|
36
|
+
listingData,
|
|
37
|
+
result,
|
|
38
|
+
id
|
|
39
|
+
} = {}) => {
|
|
53
40
|
if (!listingData || !result || !id) throw new _coreErrors.BlazeError('Expected object with: listingData, result, id');
|
|
54
|
-
return listingData.map(
|
|
55
|
-
|
|
41
|
+
return listingData.map(item => {
|
|
42
|
+
const mapperResult = _objectSpread({}, item);
|
|
56
43
|
if (item.id === id) {
|
|
57
|
-
Object.keys(item).forEach(
|
|
44
|
+
Object.keys(item).forEach(key => {
|
|
58
45
|
if (result[key] && key !== 'id') {
|
|
59
46
|
mapperResult[key] = result[key];
|
|
60
47
|
}
|
|
@@ -64,14 +51,15 @@ var updateListItems = exports.updateListItems = function updateListItems() {
|
|
|
64
51
|
return mapperResult;
|
|
65
52
|
});
|
|
66
53
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
54
|
+
exports.updateListItems = updateListItems;
|
|
55
|
+
const deleteFromListItems = ({
|
|
56
|
+
listingData,
|
|
57
|
+
id
|
|
58
|
+
} = {}) => {
|
|
71
59
|
if (!listingData || !id) throw new _coreErrors.BlazeError('Expected object with: listingData, id');
|
|
72
|
-
return listingData.filter(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
});
|
|
60
|
+
return listingData.filter(({
|
|
61
|
+
id: itemId
|
|
62
|
+
}) => itemId !== id);
|
|
76
63
|
};
|
|
64
|
+
exports.deleteFromListItems = deleteFromListItems;
|
|
77
65
|
//# sourceMappingURL=data-mappers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-mappers.js","names":["_coreErrors","require","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","getPageName","
|
|
1
|
+
{"version":3,"file":"data-mappers.js","names":["_coreErrors","require","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","getPageName","displayProperties","entity","adminHeader","name","id","fieldId","reduce","acc","headerProperty","item","join","exports","createNewListItem","listingData","result","updateListItems","BlazeError","map","mapperResult","key","deleteFromListItems","itemId"],"sources":["../../../../src/components/EntityManager/utils/data-mappers.js"],"sourcesContent":["import { BlazeError } from '@blaze-cms/core-errors';\n\nconst getPageName = (displayProperties = {}, entity = {}) => {\n if (!displayProperties || !displayProperties.adminHeader) {\n const { name, id: fieldId } = entity;\n return name || fieldId || '';\n }\n\n const { adminHeader } = displayProperties;\n return adminHeader\n .reduce((acc, headerProperty) => {\n const item = entity[headerProperty];\n if (item) acc.push(item);\n return acc;\n }, [])\n .join(' ');\n};\n\nconst createNewListItem = ({ listingData, result }) => [...listingData, result];\n\nconst updateListItems = ({ listingData, result, id } = {}) => {\n if (!listingData || !result || !id)\n throw new BlazeError('Expected object with: listingData, result, id');\n return listingData.map(item => {\n const mapperResult = { ...item };\n if (item.id === id) {\n Object.keys(item).forEach(key => {\n if (result[key] && key !== 'id') {\n mapperResult[key] = result[key];\n }\n });\n return mapperResult;\n }\n return mapperResult;\n });\n};\n\nconst deleteFromListItems = ({ listingData, id } = {}) => {\n if (!listingData || !id) throw new BlazeError('Expected object with: listingData, id');\n return listingData.filter(({ id: itemId }) => itemId !== id);\n};\n\nexport { getPageName, createNewListItem, updateListItems, deleteFromListItems };\n"],"mappings":";;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAoD,SAAAC,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC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IY,sBAAU,CAAC,uCAAuC,CAAC;EACtF,OAAOH,WAAW,CAAC5B,MAAM,CAAC,CAAC;IAAEmB,EAAE,EAAEiB;EAAO,CAAC,KAAKA,MAAM,KAAKjB,EAAE,CAAC;AAC9D,CAAC;AAACO,OAAA,CAAAS,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.js");
|
|
4
|
-
require("core-js/modules/es.array.filter.js");
|
|
5
|
-
require("core-js/modules/es.array.for-each.js");
|
|
6
|
-
require("core-js/modules/es.object.define-properties.js");
|
|
7
|
-
require("core-js/modules/es.object.define-property.js");
|
|
8
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
9
|
-
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
10
|
-
require("core-js/modules/es.object.keys.js");
|
|
11
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
12
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
13
4
|
Object.defineProperty(exports, "__esModule", {
|
|
14
5
|
value: true
|
|
@@ -18,89 +9,58 @@ exports.checkFulfilConditions = checkFulfilConditions;
|
|
|
18
9
|
exports.getUpdatedFormValues = getUpdatedFormValues;
|
|
19
10
|
exports.onViewUrlClick = onViewUrlClick;
|
|
20
11
|
exports.validateSideBarRelations = validateSideBarRelations;
|
|
21
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
22
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
24
|
-
require("core-js/modules/es.array.concat.js");
|
|
25
|
-
require("core-js/modules/es.array.every.js");
|
|
26
|
-
require("core-js/modules/es.array.find.js");
|
|
27
|
-
require("core-js/modules/es.array.find-index.js");
|
|
28
|
-
require("core-js/modules/es.array.includes.js");
|
|
29
|
-
require("core-js/modules/es.array.slice.js");
|
|
30
|
-
require("core-js/modules/es.object.to-string.js");
|
|
31
|
-
require("core-js/modules/es.string.includes.js");
|
|
32
13
|
var _lodash = _interopRequireDefault(require("lodash.has"));
|
|
33
14
|
var _constants = require("../../../constants");
|
|
34
15
|
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; }
|
|
35
|
-
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
|
|
16
|
+
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; }
|
|
36
17
|
function canViewPage(formData, entity, schema, entityIsPublished) {
|
|
37
|
-
return (0, _lodash
|
|
18
|
+
return (0, _lodash.default)(formData, _constants.KEY_TO_CHECK) && entity && entity.id && schema && schema.id && entityIsPublished === _constants.ENTITY_PUBLISHED;
|
|
38
19
|
}
|
|
39
20
|
function validateSideBarRelations(updatedFormValues, requiredChildField) {
|
|
40
21
|
if (!requiredChildField) return true;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var parentEntityFieldHasValue = parentEntityField && parentEntityField.value && parentEntityField.value !== _constants.SELECT_DEFAULT_VALUE;
|
|
50
|
-
var parentIdFieldHasValue = parentIdField && parentIdField.value;
|
|
22
|
+
const parentEntityField = updatedFormValues.find(({
|
|
23
|
+
id
|
|
24
|
+
}) => id === 'parentEntity');
|
|
25
|
+
const parentIdField = updatedFormValues.find(({
|
|
26
|
+
id
|
|
27
|
+
}) => id === 'parentId');
|
|
28
|
+
const parentEntityFieldHasValue = parentEntityField && parentEntityField.value && parentEntityField.value !== _constants.SELECT_DEFAULT_VALUE;
|
|
29
|
+
const parentIdFieldHasValue = parentIdField && parentIdField.value;
|
|
51
30
|
return !!(!parentEntityFieldHasValue || parentEntityFieldHasValue && parentIdFieldHasValue);
|
|
52
31
|
}
|
|
53
|
-
function onViewUrlClick(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
while (1) switch (_context.prev = _context.next) {
|
|
61
|
-
case 0:
|
|
62
|
-
_context.next = 2;
|
|
63
|
-
return getFullUrl();
|
|
64
|
-
case 2:
|
|
65
|
-
fullUrl = _context.sent;
|
|
66
|
-
if (fullUrl) {
|
|
67
|
-
delimiter = fullUrl.includes('?') ? '&' : '?';
|
|
68
|
-
debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM ? '' : "".concat(delimiter).concat(_constants.DEBUG_PARAM);
|
|
69
|
-
window.open("".concat(fullUrl).concat(debugParam), '_blank');
|
|
70
|
-
}
|
|
71
|
-
case 4:
|
|
72
|
-
case "end":
|
|
73
|
-
return _context.stop();
|
|
74
|
-
}
|
|
75
|
-
}, _callee);
|
|
76
|
-
}));
|
|
77
|
-
return _onViewUrlClick.apply(this, arguments);
|
|
32
|
+
async function onViewUrlClick(getFullUrl) {
|
|
33
|
+
const fullUrl = await getFullUrl();
|
|
34
|
+
if (fullUrl) {
|
|
35
|
+
const delimiter = fullUrl.includes('?') ? '&' : '?';
|
|
36
|
+
const debugParam = process.env.BLAZE_DISABLE_URL_DEBUG_PARAM ? '' : `${delimiter}${_constants.DEBUG_PARAM}`;
|
|
37
|
+
window.open(`${fullUrl}${debugParam}`, '_blank');
|
|
38
|
+
}
|
|
78
39
|
}
|
|
79
|
-
function getUpdatedFormValues(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
});
|
|
40
|
+
function getUpdatedFormValues({
|
|
41
|
+
id,
|
|
42
|
+
value,
|
|
43
|
+
requiredChildField,
|
|
44
|
+
formValues
|
|
45
|
+
}) {
|
|
46
|
+
const updatedFormValues = formValues ? formValues.slice() : [];
|
|
47
|
+
const fieldIndex = updatedFormValues.findIndex(({
|
|
48
|
+
id: _id
|
|
49
|
+
}) => _id === id);
|
|
89
50
|
if (fieldIndex > -1) {
|
|
90
51
|
updatedFormValues[fieldIndex] = _objectSpread(_objectSpread({}, updatedFormValues[fieldIndex]), {}, {
|
|
91
|
-
value
|
|
52
|
+
value
|
|
92
53
|
});
|
|
93
54
|
} else {
|
|
94
55
|
updatedFormValues.push({
|
|
95
|
-
id
|
|
96
|
-
value
|
|
56
|
+
id,
|
|
57
|
+
value
|
|
97
58
|
});
|
|
98
59
|
}
|
|
99
60
|
if (requiredChildField && requiredChildField.id) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
});
|
|
61
|
+
const requiredChildFieldIndex = updatedFormValues.findIndex(({
|
|
62
|
+
id: _id
|
|
63
|
+
}) => _id === requiredChildField.id);
|
|
104
64
|
if (requiredChildFieldIndex > -1) {
|
|
105
65
|
updatedFormValues[requiredChildFieldIndex] = _objectSpread(_objectSpread({}, updatedFormValues[requiredChildFieldIndex]), {}, {
|
|
106
66
|
value: requiredChildField.value
|
|
@@ -114,12 +74,7 @@ function getUpdatedFormValues(_ref3) {
|
|
|
114
74
|
}
|
|
115
75
|
return updatedFormValues;
|
|
116
76
|
}
|
|
117
|
-
function checkFulfilConditions() {
|
|
118
|
-
|
|
119
|
-
args[_key] = arguments[_key];
|
|
120
|
-
}
|
|
121
|
-
return args.every(function (param) {
|
|
122
|
-
return param;
|
|
123
|
-
});
|
|
77
|
+
function checkFulfilConditions(...args) {
|
|
78
|
+
return args.every(param => param);
|
|
124
79
|
}
|
|
125
80
|
//# sourceMappingURL=entity.js.map
|
|
@@ -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","
|
|
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","default","getOwnPropertyDescriptors","defineProperties","defineProperty","canViewPage","formData","entity","schema","entityIsPublished","has","KEY_TO_CHECK","id","ENTITY_PUBLISHED","validateSideBarRelations","updatedFormValues","requiredChildField","parentEntityField","find","parentIdField","parentEntityFieldHasValue","value","SELECT_DEFAULT_VALUE","parentIdFieldHasValue","onViewUrlClick","getFullUrl","fullUrl","delimiter","includes","debugParam","process","env","BLAZE_DISABLE_URL_DEBUG_PARAM","DEBUG_PARAM","window","open","getUpdatedFormValues","formValues","slice","fieldIndex","findIndex","_id","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":";;;;;;;;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|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
|
+
exports.default = void 0;
|
|
12
7
|
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
13
8
|
var _coreErrors = require("@blaze-cms/core-errors");
|
|
14
|
-
|
|
15
|
-
create:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
_args = arguments;
|
|
25
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
26
|
-
while (1) switch (_context.prev = _context.next) {
|
|
27
|
-
case 0:
|
|
28
|
-
_ref = _args.length > 0 && _args[0] !== undefined ? _args[0] : {
|
|
29
|
-
client: null,
|
|
30
|
-
identifier: null
|
|
31
|
-
}, client = _ref.client, identifier = _ref.identifier;
|
|
32
|
-
if (!(!client && !identifier)) {
|
|
33
|
-
_context.next = 3;
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
throw new _coreErrors.BlazeError('Expected params client or identifier not found');
|
|
37
|
-
case 3:
|
|
38
|
-
query = (0, _adminUiUtils.getQuery)('GET_ENTITY_SCHEMA');
|
|
39
|
-
_context.next = 6;
|
|
40
|
-
return client.query({
|
|
41
|
-
query: query,
|
|
42
|
-
variables: {
|
|
43
|
-
identifier: identifier
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
case 6:
|
|
47
|
-
_yield$client$query = _context.sent;
|
|
48
|
-
_yield$client$query$d = (0, _slicedToArray2["default"])(_yield$client$query.data.getEntitySchemas, 1);
|
|
49
|
-
schema = _yield$client$query$d[0];
|
|
50
|
-
return _context.abrupt("return", [schema]);
|
|
51
|
-
case 10:
|
|
52
|
-
case "end":
|
|
53
|
-
return _context.stop();
|
|
54
|
-
}
|
|
55
|
-
}, _callee);
|
|
56
|
-
}));
|
|
57
|
-
function create() {
|
|
58
|
-
return _create.apply(this, arguments);
|
|
9
|
+
const entityAvailableActions = {
|
|
10
|
+
create: async ({
|
|
11
|
+
client,
|
|
12
|
+
identifier
|
|
13
|
+
} = {
|
|
14
|
+
client: null,
|
|
15
|
+
identifier: null
|
|
16
|
+
}) => {
|
|
17
|
+
if (!client && !identifier) {
|
|
18
|
+
throw new _coreErrors.BlazeError('Expected params client or identifier not found');
|
|
59
19
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
_context2.next = 3;
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
throw new _coreErrors.BlazeError('Expected params client, identifier or id not found');
|
|
88
|
-
case 3:
|
|
89
|
-
_context2.next = 5;
|
|
90
|
-
return entityAvailableActions.create({
|
|
91
|
-
client: client,
|
|
92
|
-
identifier: identifier
|
|
93
|
-
});
|
|
94
|
-
case 5:
|
|
95
|
-
_yield$entityAvailabl = _context2.sent;
|
|
96
|
-
_yield$entityAvailabl2 = (0, _slicedToArray2["default"])(_yield$entityAvailabl, 1);
|
|
97
|
-
schema = _yield$entityAvailabl2[0];
|
|
98
|
-
formDataQuery = (0, _adminUiUtils.getDynamicQuery)('DATA_QUERY')(schema, id);
|
|
99
|
-
_context2.next = 11;
|
|
100
|
-
return client.query({
|
|
101
|
-
query: formDataQuery,
|
|
102
|
-
fetchPolicy: 'network-only'
|
|
103
|
-
});
|
|
104
|
-
case 11:
|
|
105
|
-
_yield$client$query2 = _context2.sent;
|
|
106
|
-
entityData = _yield$client$query2.data.entityData;
|
|
107
|
-
return _context2.abrupt("return", [schema, entityData, formDataQuery]);
|
|
108
|
-
case 14:
|
|
109
|
-
case "end":
|
|
110
|
-
return _context2.stop();
|
|
111
|
-
}
|
|
112
|
-
}, _callee2);
|
|
113
|
-
}));
|
|
114
|
-
function update() {
|
|
115
|
-
return _update.apply(this, arguments);
|
|
20
|
+
const query = (0, _adminUiUtils.getQuery)('GET_ENTITY_SCHEMA');
|
|
21
|
+
const {
|
|
22
|
+
data: {
|
|
23
|
+
getEntitySchemas: [schema]
|
|
24
|
+
}
|
|
25
|
+
} = await client.query({
|
|
26
|
+
query,
|
|
27
|
+
variables: {
|
|
28
|
+
identifier
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return [schema];
|
|
32
|
+
},
|
|
33
|
+
update: async ({
|
|
34
|
+
client,
|
|
35
|
+
identifier,
|
|
36
|
+
id
|
|
37
|
+
} = {
|
|
38
|
+
client: null,
|
|
39
|
+
identifier: null,
|
|
40
|
+
id: null
|
|
41
|
+
}) => {
|
|
42
|
+
if (!client && !identifier && !id) {
|
|
43
|
+
throw new _coreErrors.BlazeError('Expected params client, identifier or id not found');
|
|
116
44
|
}
|
|
117
|
-
|
|
118
|
-
|
|
45
|
+
const [schema] = await entityAvailableActions.create({
|
|
46
|
+
client,
|
|
47
|
+
identifier
|
|
48
|
+
});
|
|
49
|
+
const formDataQuery = (0, _adminUiUtils.getDynamicQuery)('DATA_QUERY')(schema, id);
|
|
50
|
+
const {
|
|
51
|
+
data: {
|
|
52
|
+
entityData
|
|
53
|
+
}
|
|
54
|
+
} = await client.query({
|
|
55
|
+
query: formDataQuery,
|
|
56
|
+
fetchPolicy: 'network-only'
|
|
57
|
+
});
|
|
58
|
+
return [schema, entityData, formDataQuery];
|
|
59
|
+
}
|
|
119
60
|
};
|
|
120
|
-
var _default = exports
|
|
61
|
+
var _default = exports.default = entityAvailableActions;
|
|
121
62
|
//# sourceMappingURL=entityAvailableActions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityAvailableActions.js","names":["_adminUiUtils","require","_coreErrors","entityAvailableActions","create","
|
|
1
|
+
{"version":3,"file":"entityAvailableActions.js","names":["_adminUiUtils","require","_coreErrors","entityAvailableActions","create","client","identifier","BlazeError","query","getQuery","data","getEntitySchemas","schema","variables","update","id","formDataQuery","getDynamicQuery","entityData","fetchPolicy","_default","exports","default"],"sources":["../../../../src/components/EntityManager/utils/entityAvailableActions.js"],"sourcesContent":["import { getQuery, getDynamicQuery } from '@blaze-cms/admin-ui-utils';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nconst entityAvailableActions = {\n create: async ({ client, identifier } = { client: null, identifier: null }) => {\n if (!client && !identifier) {\n throw new BlazeError('Expected params client or identifier not found');\n }\n const query = getQuery('GET_ENTITY_SCHEMA');\n const {\n data: {\n getEntitySchemas: [schema]\n }\n } = await client.query({ query, variables: { identifier } });\n return [schema];\n },\n update: async ({ client, identifier, id } = { client: null, identifier: null, id: null }) => {\n if (!client && !identifier && !id) {\n throw new BlazeError('Expected params client, identifier or id not found');\n }\n const [schema] = await entityAvailableActions.create({ client, identifier });\n const formDataQuery = getDynamicQuery('DATA_QUERY')(schema, id);\n const {\n data: { entityData }\n } = await client.query({ query: formDataQuery, fetchPolicy: 'network-only' });\n return [schema, entityData, formDataQuery];\n }\n};\n\nexport default entityAvailableActions;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,MAAME,sBAAsB,GAAG;EAC7BC,MAAM,EAAE,MAAAA,CAAO;IAAEC,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AAA,CAAAC,OAAA,GAEanB,sBAAsB","ignoreList":[]}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
9
|
-
require("core-js/modules/es.array.some.js");
|
|
10
|
-
require("core-js/modules/es.object.to-string.js");
|
|
7
|
+
exports.default = void 0;
|
|
11
8
|
var _lodash = _interopRequireDefault(require("lodash.isempty"));
|
|
12
|
-
|
|
9
|
+
const isFormEmpty = formValues => {
|
|
13
10
|
if (!formValues) return false;
|
|
14
|
-
return !formValues.some(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
11
|
+
return !formValues.some(({
|
|
12
|
+
value
|
|
13
|
+
}) => typeof value === 'boolean' ? value : !(0, _lodash.default)(value));
|
|
18
14
|
};
|
|
19
|
-
var _default = exports
|
|
15
|
+
var _default = exports.default = isFormEmpty;
|
|
20
16
|
//# sourceMappingURL=is-form-empty.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-form-empty.js","names":["_lodash","_interopRequireDefault","require","isFormEmpty","formValues","some","
|
|
1
|
+
{"version":3,"file":"is-form-empty.js","names":["_lodash","_interopRequireDefault","require","isFormEmpty","formValues","some","value","isEmpty","_default","exports","default"],"sources":["../../../../src/components/EntityManager/utils/is-form-empty.js"],"sourcesContent":["import isEmpty from 'lodash.isempty';\n\nconst isFormEmpty = formValues => {\n if (!formValues) return false;\n return !formValues.some(({ value }) => (typeof value === 'boolean' ? value : !isEmpty(value)));\n};\n\nexport default isFormEmpty;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,MAAMC,WAAW,GAAGC,UAAU,IAAI;EAChC,IAAI,CAACA,UAAU,EAAE,OAAO,KAAK;EAC7B,OAAO,CAACA,UAAU,CAACC,IAAI,CAAC,CAAC;IAAEC;EAAM,CAAC,KAAM,OAAOA,KAAK,KAAK,SAAS,GAAGA,KAAK,GAAG,CAAC,IAAAC,eAAO,EAACD,KAAK,CAAE,CAAC;AAChG,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaP,WAAW","ignoreList":[]}
|