@blaze-cms/admin 0.125.0-f-admin-updates.4 → 0.125.1
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 +61 -5
- package/lib/components/CardPrompt/CardPrompt.js +7 -1
- package/lib/components/CardPrompt/CardPrompt.js.map +1 -1
- package/lib/components/CardPrompt/index.js +4 -0
- package/lib/components/CardPrompt/index.js.map +1 -1
- package/lib/components/CopyDataFromAction/CopyDataFromAction.js +87 -23
- package/lib/components/CopyDataFromAction/CopyDataFromAction.js.map +1 -1
- package/lib/components/CopyDataFromAction/helpers.js +9 -0
- package/lib/components/CopyDataFromAction/helpers.js.map +1 -1
- package/lib/components/CopyDataFromAction/index.js +4 -0
- package/lib/components/CopyDataFromAction/index.js.map +1 -1
- package/lib/components/DeleteAction/DeleteAction.js +9 -2
- package/lib/components/DeleteAction/DeleteAction.js.map +1 -1
- package/lib/components/DeleteAction/index.js +4 -0
- package/lib/components/DeleteAction/index.js.map +1 -1
- package/lib/components/LeaveAction/LeaveAction.js +12 -0
- package/lib/components/LeaveAction/LeaveAction.js.map +1 -1
- package/lib/components/LeaveAction/index.js +4 -0
- package/lib/components/LeaveAction/index.js.map +1 -1
- package/lib/components/MetaTitle/MetaTitle.js +15 -2
- package/lib/components/MetaTitle/MetaTitle.js.map +1 -1
- package/lib/components/MetaTitle/index.js +4 -0
- package/lib/components/MetaTitle/index.js.map +1 -1
- package/lib/components/PageHeader/PageHeader.js +14 -4
- package/lib/components/PageHeader/PageHeader.js.map +1 -1
- package/lib/components/PageHeader/index.js +4 -0
- package/lib/components/PageHeader/index.js.map +1 -1
- package/lib/components/RevertToTemplate/RevertToTemplate.js +9 -2
- package/lib/components/RevertToTemplate/RevertToTemplate.js.map +1 -1
- package/lib/components/RevertToTemplate/index.js +4 -0
- package/lib/components/RevertToTemplate/index.js.map +1 -1
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -1
- package/lib/utils/build-interface.js +23 -3
- package/lib/utils/build-interface.js.map +1 -1
- package/lib/utils/get-blaze-admin.js +10 -1
- package/lib/utils/get-blaze-admin.js.map +1 -1
- package/lib-es/components/CardPrompt/CardPrompt.js +2 -0
- package/lib-es/components/CardPrompt/CardPrompt.js.map +1 -1
- package/lib-es/components/CardPrompt/index.js.map +1 -1
- package/lib-es/components/CopyDataFromAction/CopyDataFromAction.js +20 -5
- package/lib-es/components/CopyDataFromAction/CopyDataFromAction.js.map +1 -1
- package/lib-es/components/CopyDataFromAction/helpers.js +3 -0
- package/lib-es/components/CopyDataFromAction/helpers.js.map +1 -1
- package/lib-es/components/CopyDataFromAction/index.js.map +1 -1
- package/lib-es/components/DeleteAction/DeleteAction.js +2 -0
- package/lib-es/components/DeleteAction/DeleteAction.js.map +1 -1
- package/lib-es/components/DeleteAction/index.js.map +1 -1
- package/lib-es/components/LeaveAction/LeaveAction.js +5 -0
- package/lib-es/components/LeaveAction/LeaveAction.js.map +1 -1
- package/lib-es/components/LeaveAction/index.js.map +1 -1
- package/lib-es/components/MetaTitle/MetaTitle.js +2 -0
- package/lib-es/components/MetaTitle/MetaTitle.js.map +1 -1
- package/lib-es/components/MetaTitle/index.js.map +1 -1
- package/lib-es/components/PageHeader/PageHeader.js +4 -0
- package/lib-es/components/PageHeader/PageHeader.js.map +1 -1
- package/lib-es/components/PageHeader/index.js.map +1 -1
- package/lib-es/components/RevertToTemplate/RevertToTemplate.js +2 -0
- package/lib-es/components/RevertToTemplate/RevertToTemplate.js.map +1 -1
- package/lib-es/components/RevertToTemplate/index.js.map +1 -1
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/build-interface.js.map +1 -1
- package/lib-es/utils/get-blaze-admin.js +2 -0
- package/lib-es/utils/get-blaze-admin.js.map +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## [0.125.1](https://github.com/thebyte9/blaze/compare/v0.125.0...v0.125.1) (2022-12-09)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @blaze-cms/admin
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
# [0.125.0
|
|
14
|
+
# [0.125.0](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.18...v0.125.0) (2022-11-30)
|
|
15
15
|
|
|
16
16
|
**Note:** Version bump only for package @blaze-cms/admin
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
# [0.125.0-
|
|
22
|
+
# [0.125.0-alpha.18](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.17...v0.125.0-alpha.18) (2022-11-28)
|
|
23
23
|
|
|
24
24
|
**Note:** Version bump only for package @blaze-cms/admin
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
# [0.125.0-
|
|
30
|
+
# [0.125.0-alpha.15](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.14...v0.125.0-alpha.15) (2022-11-16)
|
|
31
31
|
|
|
32
32
|
**Note:** Version bump only for package @blaze-cms/admin
|
|
33
33
|
|
|
@@ -35,7 +35,63 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
# [0.125.0-
|
|
38
|
+
# [0.125.0-alpha.14](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.13...v0.125.0-alpha.14) (2022-10-25)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @blaze-cms/admin
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# [0.125.0-alpha.13](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.12...v0.125.0-alpha.13) (2022-10-24)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @blaze-cms/admin
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
# [0.125.0-alpha.12](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.11...v0.125.0-alpha.12) (2022-10-19)
|
|
55
|
+
|
|
56
|
+
**Note:** Version bump only for package @blaze-cms/admin
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# [0.125.0-alpha.11](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.10...v0.125.0-alpha.11) (2022-10-17)
|
|
63
|
+
|
|
64
|
+
**Note:** Version bump only for package @blaze-cms/admin
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
# [0.125.0-alpha.7](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.6...v0.125.0-alpha.7) (2022-10-07)
|
|
71
|
+
|
|
72
|
+
**Note:** Version bump only for package @blaze-cms/admin
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
# [0.125.0-alpha.3](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.2...v0.125.0-alpha.3) (2022-09-27)
|
|
79
|
+
|
|
80
|
+
**Note:** Version bump only for package @blaze-cms/admin
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# [0.125.0-alpha.1](https://github.com/thebyte9/blaze/compare/v0.125.0-alpha.0...v0.125.0-alpha.1) (2022-09-15)
|
|
87
|
+
|
|
88
|
+
**Note:** Version bump only for package @blaze-cms/admin
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## [0.124.2-alpha.0](https://github.com/thebyte9/blaze/compare/v0.124.1...v0.124.2-alpha.0) (2022-09-06)
|
|
39
95
|
|
|
40
96
|
**Note:** Version bump only for package @blaze-cms/admin
|
|
41
97
|
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
4
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports["default"] = void 0;
|
|
11
|
+
|
|
9
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
10
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
11
16
|
var CardPrompt = function CardPrompt(_ref) {
|
|
12
17
|
var onClose = _ref.onClose,
|
|
13
|
-
|
|
18
|
+
children = _ref.children;
|
|
14
19
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
15
20
|
className: "card card--prompt",
|
|
16
21
|
"data-testid": "card-prompt"
|
|
@@ -33,6 +38,7 @@ var CardPrompt = function CardPrompt(_ref) {
|
|
|
33
38
|
className: "card__title"
|
|
34
39
|
}, "Nothing to see here!"), /*#__PURE__*/_react["default"].createElement("p", null, "How about adding some content now?"), children));
|
|
35
40
|
};
|
|
41
|
+
|
|
36
42
|
CardPrompt.displayName = 'CardPrompt';
|
|
37
43
|
CardPrompt.propTypes = {
|
|
38
44
|
onClose: _propTypes["default"].func.isRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardPrompt.js","names":["CardPrompt","onClose","children","displayName","propTypes","PropTypes","func","isRequired","oneOfType","array","object","string","defaultProps"],"sources":["../../../src/components/CardPrompt/CardPrompt.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst CardPrompt = ({ onClose, children }) => (\n <div className=\"card card--prompt\" data-testid=\"card-prompt\">\n <div className=\"card__close\">\n <button type=\"button\" className=\"icon-button icon-button--close\" onClick={onClose}>\n <i className=\"material-icons\">close</i>\n </button>\n </div>\n <div className=\"card__image amber\">\n <img src=\"https://images.thisisblaze.com/empty-icon-140-140.png\" alt=\"prompt\" />\n </div>\n <div className=\"card__content card__content--prompt\">\n <h2 className=\"card__title\">Nothing to see here!</h2>\n <p>How about adding some content now?</p>\n {children}\n </div>\n </div>\n);\n\nCardPrompt.displayName = 'CardPrompt';\n\nCardPrompt.propTypes = {\n onClose: PropTypes.func.isRequired,\n children: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string])\n};\n\nCardPrompt.defaultProps = {\n children: ''\n};\n\nexport default CardPrompt;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CardPrompt.js","names":["CardPrompt","onClose","children","displayName","propTypes","PropTypes","func","isRequired","oneOfType","array","object","string","defaultProps"],"sources":["../../../src/components/CardPrompt/CardPrompt.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst CardPrompt = ({ onClose, children }) => (\n <div className=\"card card--prompt\" data-testid=\"card-prompt\">\n <div className=\"card__close\">\n <button type=\"button\" className=\"icon-button icon-button--close\" onClick={onClose}>\n <i className=\"material-icons\">close</i>\n </button>\n </div>\n <div className=\"card__image amber\">\n <img src=\"https://images.thisisblaze.com/empty-icon-140-140.png\" alt=\"prompt\" />\n </div>\n <div className=\"card__content card__content--prompt\">\n <h2 className=\"card__title\">Nothing to see here!</h2>\n <p>How about adding some content now?</p>\n {children}\n </div>\n </div>\n);\n\nCardPrompt.displayName = 'CardPrompt';\n\nCardPrompt.propTypes = {\n onClose: PropTypes.func.isRequired,\n children: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string])\n};\n\nCardPrompt.defaultProps = {\n children: ''\n};\n\nexport default CardPrompt;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa;EAAA,IAAGC,OAAH,QAAGA,OAAH;EAAA,IAAYC,QAAZ,QAAYA,QAAZ;EAAA,oBACjB;IAAK,SAAS,EAAC,mBAAf;IAAmC,eAAY;EAA/C,gBACE;IAAK,SAAS,EAAC;EAAf,gBACE;IAAQ,IAAI,EAAC,QAAb;IAAsB,SAAS,EAAC,gCAAhC;IAAiE,OAAO,EAAED;EAA1E,gBACE;IAAG,SAAS,EAAC;EAAb,WADF,CADF,CADF,eAME;IAAK,SAAS,EAAC;EAAf,gBACE;IAAK,GAAG,EAAC,uDAAT;IAAiE,GAAG,EAAC;EAArE,EADF,CANF,eASE;IAAK,SAAS,EAAC;EAAf,gBACE;IAAI,SAAS,EAAC;EAAd,0BADF,eAEE,gFAFF,EAGGC,QAHH,CATF,CADiB;AAAA,CAAnB;;AAkBAF,UAAU,CAACG,WAAX,GAAyB,YAAzB;AAEAH,UAAU,CAACI,SAAX,GAAuB;EACrBH,OAAO,EAAEI,qBAAA,CAAUC,IAAV,CAAeC,UADH;EAErBL,QAAQ,EAAEG,qBAAA,CAAUG,SAAV,CAAoB,CAACH,qBAAA,CAAUI,KAAX,EAAkBJ,qBAAA,CAAUK,MAA5B,EAAoCL,qBAAA,CAAUM,MAA9C,CAApB;AAFW,CAAvB;AAKAX,UAAU,CAACY,YAAX,GAA0B;EACxBV,QAAQ,EAAE;AADc,CAA1B;eAIeF,U"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
4
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports["default"] = void 0;
|
|
11
|
+
|
|
9
12
|
var _CardPrompt = _interopRequireDefault(require("./CardPrompt"));
|
|
13
|
+
|
|
10
14
|
var _default = _CardPrompt["default"];
|
|
11
15
|
exports["default"] = _default;
|
|
12
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CardPrompt"],"sources":["../../../src/components/CardPrompt/index.js"],"sourcesContent":["import CardPrompt from './CardPrompt';\n\nexport default CardPrompt;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["CardPrompt"],"sources":["../../../src/components/CardPrompt/index.js"],"sourcesContent":["import CardPrompt from './CardPrompt';\n\nexport default CardPrompt;\n"],"mappings":";;;;;;;;;;;AAAA;;eAEeA,sB"}
|
|
@@ -1,70 +1,114 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.symbol.js");
|
|
4
|
+
|
|
4
5
|
require("core-js/modules/es.array.filter.js");
|
|
6
|
+
|
|
5
7
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
8
|
+
|
|
6
9
|
require("core-js/modules/es.array.for-each.js");
|
|
10
|
+
|
|
7
11
|
require("core-js/modules/web.dom-collections.for-each.js");
|
|
12
|
+
|
|
8
13
|
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
14
|
+
|
|
9
15
|
require("core-js/modules/es.object.define-properties.js");
|
|
16
|
+
|
|
10
17
|
require("core-js/modules/es.object.define-property.js");
|
|
18
|
+
|
|
11
19
|
require("core-js/modules/es.array.iterator.js");
|
|
20
|
+
|
|
12
21
|
require("core-js/modules/es.string.iterator.js");
|
|
22
|
+
|
|
13
23
|
require("core-js/modules/es.weak-map.js");
|
|
24
|
+
|
|
14
25
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
26
|
+
|
|
15
27
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
28
|
+
|
|
16
29
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
30
|
+
|
|
17
31
|
Object.defineProperty(exports, "__esModule", {
|
|
18
32
|
value: true
|
|
19
33
|
});
|
|
20
34
|
exports["default"] = void 0;
|
|
35
|
+
|
|
21
36
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
37
|
+
|
|
22
38
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
39
|
+
|
|
23
40
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
41
|
+
|
|
24
42
|
require("core-js/modules/es.object.keys.js");
|
|
43
|
+
|
|
25
44
|
require("core-js/modules/es.array.map.js");
|
|
45
|
+
|
|
26
46
|
require("core-js/modules/es.function.name.js");
|
|
47
|
+
|
|
27
48
|
require("core-js/modules/es.array.find.js");
|
|
49
|
+
|
|
28
50
|
require("core-js/modules/es.object.to-string.js");
|
|
51
|
+
|
|
29
52
|
require("core-js/modules/es.array.join.js");
|
|
53
|
+
|
|
30
54
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
55
|
+
|
|
31
56
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
57
|
+
|
|
32
58
|
var _react = _interopRequireWildcard(require("react"));
|
|
59
|
+
|
|
33
60
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
61
|
+
|
|
34
62
|
var _alert = _interopRequireDefault(require("@blaze-react/alert"));
|
|
63
|
+
|
|
35
64
|
var _modal = _interopRequireDefault(require("@blaze-react/modal"));
|
|
65
|
+
|
|
36
66
|
var _client = require("@apollo/client");
|
|
67
|
+
|
|
37
68
|
var _reactFormBuilder = require("@blaze-cms/react-form-builder");
|
|
69
|
+
|
|
38
70
|
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
71
|
+
|
|
39
72
|
var _helpers = require("./helpers");
|
|
73
|
+
|
|
40
74
|
var _excluded = ["id", "displayName", "actions"];
|
|
75
|
+
|
|
41
76
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
77
|
+
|
|
42
78
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
79
|
+
|
|
43
80
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
81
|
+
|
|
44
82
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
83
|
+
|
|
45
84
|
var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
46
85
|
var onClose = _ref.onClose,
|
|
47
|
-
|
|
48
|
-
|
|
86
|
+
copyAction = _ref.copyAction,
|
|
87
|
+
getFormData = _ref.getFormData;
|
|
88
|
+
|
|
49
89
|
var _useState = (0, _react.useState)([]),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
90
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
91
|
+
entityRecordsOptions = _useState2[0],
|
|
92
|
+
setEntityRecordsOptions = _useState2[1];
|
|
93
|
+
|
|
53
94
|
var _useState3 = (0, _react.useState)(),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
95
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
96
|
+
actionName = _useState4[0],
|
|
97
|
+
setActionName = _useState4[1];
|
|
98
|
+
|
|
57
99
|
var _useState5 = (0, _react.useState)(),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
100
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
101
|
+
selectedEntity = _useState6[0],
|
|
102
|
+
setSelectedEntity = _useState6[1];
|
|
103
|
+
|
|
61
104
|
var _useState7 = (0, _react.useState)(true),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
105
|
+
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
106
|
+
autocompleteDisabledStatus = _useState8[0],
|
|
107
|
+
setAutocompleteDisabledStatus = _useState8[1];
|
|
108
|
+
|
|
65
109
|
var client = (0, _client.useApolloClient)();
|
|
66
110
|
var Select = _reactFormBuilder.formFieldTypes.select,
|
|
67
|
-
|
|
111
|
+
Autocomplete = _reactFormBuilder.formFieldTypes.autocomplete;
|
|
68
112
|
var entitiesAction = [];
|
|
69
113
|
var entityProperties = {};
|
|
70
114
|
var modalActions = [{
|
|
@@ -77,9 +121,11 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
77
121
|
modifiers: [],
|
|
78
122
|
'data-testid': 'copyDataFromAction-copy-button'
|
|
79
123
|
}];
|
|
124
|
+
|
|
80
125
|
var fetchEntityRecords = /*#__PURE__*/function () {
|
|
81
126
|
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(action) {
|
|
82
127
|
var _yield$client$query, _yield$client$query$d, data, entityRecords;
|
|
128
|
+
|
|
83
129
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
84
130
|
while (1) {
|
|
85
131
|
switch (_context.prev = _context.next) {
|
|
@@ -88,14 +134,16 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
88
134
|
return client.query({
|
|
89
135
|
query: (0, _helpers.getAction)(action)
|
|
90
136
|
});
|
|
137
|
+
|
|
91
138
|
case 2:
|
|
92
139
|
_yield$client$query = _context.sent;
|
|
93
140
|
_yield$client$query$d = _yield$client$query.data;
|
|
94
141
|
data = _yield$client$query$d === void 0 ? {} : _yield$client$query$d;
|
|
142
|
+
|
|
95
143
|
if (Object.keys(data).length) {
|
|
96
144
|
entityRecords = data[action].map(function (_ref3) {
|
|
97
145
|
var id = _ref3.id,
|
|
98
|
-
|
|
146
|
+
name = _ref3.name;
|
|
99
147
|
return {
|
|
100
148
|
id: id,
|
|
101
149
|
name: name
|
|
@@ -103,6 +151,7 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
103
151
|
});
|
|
104
152
|
setEntityRecordsOptions(entityRecords);
|
|
105
153
|
}
|
|
154
|
+
|
|
106
155
|
case 6:
|
|
107
156
|
case "end":
|
|
108
157
|
return _context.stop();
|
|
@@ -110,16 +159,20 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
110
159
|
}
|
|
111
160
|
}, _callee);
|
|
112
161
|
}));
|
|
162
|
+
|
|
113
163
|
return function fetchEntityRecords(_x) {
|
|
114
164
|
return _ref2.apply(this, arguments);
|
|
115
165
|
};
|
|
116
166
|
}();
|
|
167
|
+
|
|
117
168
|
var onEntityChange = function onEntityChange(_ref4) {
|
|
118
169
|
var value = _ref4.value;
|
|
170
|
+
|
|
119
171
|
var _entitiesAction$find = entitiesAction.find(function (entity) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
172
|
+
return entity.id === value;
|
|
173
|
+
}),
|
|
174
|
+
action = _entitiesAction$find.action;
|
|
175
|
+
|
|
123
176
|
if (action) {
|
|
124
177
|
setActionName(action);
|
|
125
178
|
setSelectedEntity(value);
|
|
@@ -127,9 +180,11 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
127
180
|
setAutocompleteDisabledStatus(false);
|
|
128
181
|
}
|
|
129
182
|
};
|
|
183
|
+
|
|
130
184
|
var onEntityRecordChange = /*#__PURE__*/function () {
|
|
131
185
|
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(event) {
|
|
132
186
|
var fields, _yield$client$query2, _yield$client$query2$, data;
|
|
187
|
+
|
|
133
188
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
134
189
|
while (1) {
|
|
135
190
|
switch (_context2.prev = _context2.next) {
|
|
@@ -139,13 +194,16 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
139
194
|
return client.query({
|
|
140
195
|
query: (0, _helpers.getAction)(actionName, event.id, fields)
|
|
141
196
|
});
|
|
197
|
+
|
|
142
198
|
case 3:
|
|
143
199
|
_yield$client$query2 = _context2.sent;
|
|
144
200
|
_yield$client$query2$ = _yield$client$query2.data;
|
|
145
201
|
data = _yield$client$query2$ === void 0 ? {} : _yield$client$query2$;
|
|
202
|
+
|
|
146
203
|
if (Object.keys(data).length) {
|
|
147
204
|
getFormData(data[actionName][0]);
|
|
148
205
|
}
|
|
206
|
+
|
|
149
207
|
case 7:
|
|
150
208
|
case "end":
|
|
151
209
|
return _context2.stop();
|
|
@@ -153,20 +211,24 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
153
211
|
}
|
|
154
212
|
}, _callee2);
|
|
155
213
|
}));
|
|
214
|
+
|
|
156
215
|
return function onEntityRecordChange(_x2) {
|
|
157
216
|
return _ref5.apply(this, arguments);
|
|
158
217
|
};
|
|
159
218
|
}();
|
|
219
|
+
|
|
160
220
|
var _useQuery = (0, _client.useQuery)((0, _adminUiUtils.getQuery)('GET_USER_EDITABLE_ENTITIES')),
|
|
161
|
-
|
|
221
|
+
_useQuery$data = _useQuery.data;
|
|
222
|
+
|
|
162
223
|
_useQuery$data = _useQuery$data === void 0 ? {} : _useQuery$data;
|
|
163
224
|
var getEntitySchemas = _useQuery$data.getEntitySchemas;
|
|
225
|
+
|
|
164
226
|
if (getEntitySchemas) {
|
|
165
227
|
var entities = getEntitySchemas.map(function (_ref6) {
|
|
166
228
|
var id = _ref6.id,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
229
|
+
displayName = _ref6.displayName,
|
|
230
|
+
actions = _ref6.actions,
|
|
231
|
+
otherSchemaProps = (0, _objectWithoutProperties2["default"])(_ref6, _excluded);
|
|
170
232
|
entitiesAction.push({
|
|
171
233
|
id: id,
|
|
172
234
|
action: actions.getAll
|
|
@@ -205,8 +267,10 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
205
267
|
}
|
|
206
268
|
}));
|
|
207
269
|
}
|
|
270
|
+
|
|
208
271
|
return null;
|
|
209
272
|
};
|
|
273
|
+
|
|
210
274
|
CopyDataFromAction.propTypes = {
|
|
211
275
|
onClose: _propTypes["default"].func.isRequired,
|
|
212
276
|
copyAction: _propTypes["default"].func.isRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyDataFromAction.js","names":["CopyDataFromAction","onClose","copyAction","getFormData","useState","entityRecordsOptions","setEntityRecordsOptions","actionName","setActionName","selectedEntity","setSelectedEntity","autocompleteDisabledStatus","setAutocompleteDisabledStatus","client","useApolloClient","Select","formFieldTypes","select","Autocomplete","autocomplete","entitiesAction","entityProperties","modalActions","textButton","callback","modifiers","fetchEntityRecords","action","query","getAction","data","Object","keys","length","entityRecords","map","id","name","onEntityChange","value","find","entity","onEntityRecordChange","event","fields","useQuery","getQuery","getEntitySchemas","entities","displayName","actions","otherSchemaProps","push","getAll","getDataProperties","join","keyValue","filterBy","uniqueId","propTypes","PropTypes","func","isRequired"],"sources":["../../../src/components/CopyDataFromAction/CopyDataFromAction.js"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport Alert from '@blaze-react/alert';\nimport Modal from '@blaze-react/modal';\nimport { useQuery, useApolloClient } from '@apollo/client';\nimport { formFieldTypes } from '@blaze-cms/react-form-builder';\nimport { getQuery, getDataProperties } from '@blaze-cms/admin-ui-utils';\nimport { getAction } from './helpers';\n\nconst CopyDataFromAction = ({ onClose, copyAction, getFormData }) => {\n const [entityRecordsOptions, setEntityRecordsOptions] = useState([]);\n const [actionName, setActionName] = useState();\n const [selectedEntity, setSelectedEntity] = useState();\n const [autocompleteDisabledStatus, setAutocompleteDisabledStatus] = useState(true);\n\n const client = useApolloClient();\n const { select: Select, autocomplete: Autocomplete } = formFieldTypes;\n const entitiesAction = [];\n let entityProperties = {};\n\n const modalActions = [\n {\n textButton: 'Cancel',\n callback: onClose,\n modifiers: ['cancel']\n },\n {\n textButton: 'Copy',\n callback: copyAction,\n modifiers: [],\n 'data-testid': 'copyDataFromAction-copy-button'\n }\n ];\n\n const fetchEntityRecords = async action => {\n const { data = {} } = await client.query({\n query: getAction(action)\n });\n\n if (Object.keys(data).length) {\n const entityRecords = data[action].map(({ id, name }) => ({ id, name }));\n setEntityRecordsOptions(entityRecords);\n }\n };\n\n const onEntityChange = ({ value }) => {\n const { action } = entitiesAction.find(entity => entity.id === value);\n if (action) {\n setActionName(action);\n setSelectedEntity(value);\n fetchEntityRecords(action);\n setAutocompleteDisabledStatus(false);\n }\n };\n\n const onEntityRecordChange = async event => {\n const fields = entityProperties[selectedEntity];\n const { data = {} } = await client.query({\n query: getAction(actionName, event.id, fields)\n });\n\n if (Object.keys(data).length) {\n getFormData(data[actionName][0]);\n }\n };\n const { data: { getEntitySchemas } = {} } = useQuery(getQuery('GET_USER_EDITABLE_ENTITIES'));\n\n if (getEntitySchemas) {\n const entities = getEntitySchemas.map(({ id, displayName, actions, ...otherSchemaProps }) => {\n entitiesAction.push({ id, action: actions.getAll });\n entityProperties = {\n [id]: getDataProperties(otherSchemaProps).join(', '),\n ...entityProperties\n };\n return [id, displayName];\n });\n\n return (\n <Modal title=\"Copy data from\" actions={modalActions} onClose={onClose}>\n <Alert type=\"info\">\n By performing this action it will copy and overwrite any unsaved data you have.\n </Alert>\n <Select\n data-testid=\"copyDataFromAction-select\"\n label=\"Entity\"\n value=\"\"\n id=\"entity\"\n onChange={onEntityChange}\n options={entities}\n />\n <Autocomplete\n inputProps={{ 'data-testid': 'copyDataFromAction-autocomplete' }}\n disabled={autocompleteDisabledStatus}\n data={{ data: entityRecordsOptions, keyValue: 'name', filterBy: ['name'] }}\n selected={onEntityRecordChange}\n utils={{ uniqueId: data => data.id }}\n />\n </Modal>\n );\n }\n\n return null;\n};\n\nCopyDataFromAction.propTypes = {\n onClose: PropTypes.func.isRequired,\n copyAction: PropTypes.func.isRequired,\n getFormData: PropTypes.func.isRequired\n};\n\nexport default CopyDataFromAction;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CopyDataFromAction.js","names":["CopyDataFromAction","onClose","copyAction","getFormData","useState","entityRecordsOptions","setEntityRecordsOptions","actionName","setActionName","selectedEntity","setSelectedEntity","autocompleteDisabledStatus","setAutocompleteDisabledStatus","client","useApolloClient","Select","formFieldTypes","select","Autocomplete","autocomplete","entitiesAction","entityProperties","modalActions","textButton","callback","modifiers","fetchEntityRecords","action","query","getAction","data","Object","keys","length","entityRecords","map","id","name","onEntityChange","value","find","entity","onEntityRecordChange","event","fields","useQuery","getQuery","getEntitySchemas","entities","displayName","actions","otherSchemaProps","push","getAll","getDataProperties","join","keyValue","filterBy","uniqueId","propTypes","PropTypes","func","isRequired"],"sources":["../../../src/components/CopyDataFromAction/CopyDataFromAction.js"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport Alert from '@blaze-react/alert';\nimport Modal from '@blaze-react/modal';\nimport { useQuery, useApolloClient } from '@apollo/client';\nimport { formFieldTypes } from '@blaze-cms/react-form-builder';\nimport { getQuery, getDataProperties } from '@blaze-cms/admin-ui-utils';\nimport { getAction } from './helpers';\n\nconst CopyDataFromAction = ({ onClose, copyAction, getFormData }) => {\n const [entityRecordsOptions, setEntityRecordsOptions] = useState([]);\n const [actionName, setActionName] = useState();\n const [selectedEntity, setSelectedEntity] = useState();\n const [autocompleteDisabledStatus, setAutocompleteDisabledStatus] = useState(true);\n\n const client = useApolloClient();\n const { select: Select, autocomplete: Autocomplete } = formFieldTypes;\n const entitiesAction = [];\n let entityProperties = {};\n\n const modalActions = [\n {\n textButton: 'Cancel',\n callback: onClose,\n modifiers: ['cancel']\n },\n {\n textButton: 'Copy',\n callback: copyAction,\n modifiers: [],\n 'data-testid': 'copyDataFromAction-copy-button'\n }\n ];\n\n const fetchEntityRecords = async action => {\n const { data = {} } = await client.query({\n query: getAction(action)\n });\n\n if (Object.keys(data).length) {\n const entityRecords = data[action].map(({ id, name }) => ({ id, name }));\n setEntityRecordsOptions(entityRecords);\n }\n };\n\n const onEntityChange = ({ value }) => {\n const { action } = entitiesAction.find(entity => entity.id === value);\n if (action) {\n setActionName(action);\n setSelectedEntity(value);\n fetchEntityRecords(action);\n setAutocompleteDisabledStatus(false);\n }\n };\n\n const onEntityRecordChange = async event => {\n const fields = entityProperties[selectedEntity];\n const { data = {} } = await client.query({\n query: getAction(actionName, event.id, fields)\n });\n\n if (Object.keys(data).length) {\n getFormData(data[actionName][0]);\n }\n };\n const { data: { getEntitySchemas } = {} } = useQuery(getQuery('GET_USER_EDITABLE_ENTITIES'));\n\n if (getEntitySchemas) {\n const entities = getEntitySchemas.map(({ id, displayName, actions, ...otherSchemaProps }) => {\n entitiesAction.push({ id, action: actions.getAll });\n entityProperties = {\n [id]: getDataProperties(otherSchemaProps).join(', '),\n ...entityProperties\n };\n return [id, displayName];\n });\n\n return (\n <Modal title=\"Copy data from\" actions={modalActions} onClose={onClose}>\n <Alert type=\"info\">\n By performing this action it will copy and overwrite any unsaved data you have.\n </Alert>\n <Select\n data-testid=\"copyDataFromAction-select\"\n label=\"Entity\"\n value=\"\"\n id=\"entity\"\n onChange={onEntityChange}\n options={entities}\n />\n <Autocomplete\n inputProps={{ 'data-testid': 'copyDataFromAction-autocomplete' }}\n disabled={autocompleteDisabledStatus}\n data={{ data: entityRecordsOptions, keyValue: 'name', filterBy: ['name'] }}\n selected={onEntityRecordChange}\n utils={{ uniqueId: data => data.id }}\n />\n </Modal>\n );\n }\n\n return null;\n};\n\nCopyDataFromAction.propTypes = {\n onClose: PropTypes.func.isRequired,\n copyAction: PropTypes.func.isRequired,\n getFormData: PropTypes.func.isRequired\n};\n\nexport default CopyDataFromAction;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAqB,OAA0C;EAAA,IAAvCC,OAAuC,QAAvCA,OAAuC;EAAA,IAA9BC,UAA8B,QAA9BA,UAA8B;EAAA,IAAlBC,WAAkB,QAAlBA,WAAkB;;EACnE,gBAAwD,IAAAC,eAAA,EAAS,EAAT,CAAxD;EAAA;EAAA,IAAOC,oBAAP;EAAA,IAA6BC,uBAA7B;;EACA,iBAAoC,IAAAF,eAAA,GAApC;EAAA;EAAA,IAAOG,UAAP;EAAA,IAAmBC,aAAnB;;EACA,iBAA4C,IAAAJ,eAAA,GAA5C;EAAA;EAAA,IAAOK,cAAP;EAAA,IAAuBC,iBAAvB;;EACA,iBAAoE,IAAAN,eAAA,EAAS,IAAT,CAApE;EAAA;EAAA,IAAOO,0BAAP;E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,CAAeC,UADK;EAE7B5D,UAAU,EAAE0D,qBAAA,CAAUC,IAAV,CAAeC,UAFE;EAG7B3D,WAAW,EAAEyD,qBAAA,CAAUC,IAAV,CAAeC;AAHC,CAA/B;eAMe9D,kB"}
|
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
4
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports.getAction = void 0;
|
|
11
|
+
|
|
9
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
+
|
|
10
14
|
require("core-js/modules/es.array.concat.js");
|
|
15
|
+
|
|
11
16
|
var _client = require("@apollo/client");
|
|
17
|
+
|
|
12
18
|
var _templateObject;
|
|
19
|
+
|
|
13
20
|
var generateQuery = function generateQuery(action, id, fragment) {
|
|
14
21
|
return id ? "\n query getEntityData{\n ".concat(action, "(where:{ id: \"").concat(id, "\" }){\n name\n ").concat(fragment, "\n }\n }\n ") : "query getEntityData{\n ".concat(action, "{\n id,\n name\n }\n }\n ");
|
|
15
22
|
};
|
|
23
|
+
|
|
16
24
|
var getAction = function getAction(action, id) {
|
|
17
25
|
var fields = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
18
26
|
var query = id ? generateQuery(action, id, fields) : generateQuery(action);
|
|
19
27
|
return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n "])), query);
|
|
20
28
|
};
|
|
29
|
+
|
|
21
30
|
exports.getAction = getAction;
|
|
22
31
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["generateQuery","action","id","fragment","getAction","fields","query","gql"],"sources":["../../../src/components/CopyDataFromAction/helpers.js"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst generateQuery = (action, id, fragment) =>\n id\n ? `\n query getEntityData{\n ${action}(where:{ id: \"${id}\" }){\n name\n ${fragment}\n }\n }\n `\n : `query getEntityData{\n ${action}{\n id,\n name\n }\n }\n `;\n\nconst getAction = (action, id, fields = '') => {\n const query = id ? generateQuery(action, id, fields) : generateQuery(action);\n return gql`\n ${query}\n `;\n};\n\nexport { getAction };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["generateQuery","action","id","fragment","getAction","fields","query","gql"],"sources":["../../../src/components/CopyDataFromAction/helpers.js"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst generateQuery = (action, id, fragment) =>\n id\n ? `\n query getEntityData{\n ${action}(where:{ id: \"${id}\" }){\n name\n ${fragment}\n }\n }\n `\n : `query getEntityData{\n ${action}{\n id,\n name\n }\n }\n `;\n\nconst getAction = (action, id, fields = '') => {\n const query = id ? generateQuery(action, id, fields) : generateQuery(action);\n return gql`\n ${query}\n `;\n};\n\nexport { getAction };\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,MAAD,EAASC,EAAT,EAAaC,QAAb;EAAA,OACpBD,EAAE,+CAGID,MAHJ,4BAG2BC,EAH3B,2CAKMC,QALN,sEAUMF,MAVN,+DADkB;AAAA,CAAtB;;AAkBA,IAAMG,SAAS,GAAG,SAAZA,SAAY,CAACH,MAAD,EAASC,EAAT,EAA6B;EAAA,IAAhBG,MAAgB,uEAAP,EAAO;EAC7C,IAAMC,KAAK,GAAGJ,EAAE,GAAGF,aAAa,CAACC,MAAD,EAASC,EAAT,EAAaG,MAAb,CAAhB,GAAuCL,aAAa,CAACC,MAAD,CAApE;EACA,WAAOM,WAAP,sGACID,KADJ;AAGD,CALD"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
4
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports["default"] = void 0;
|
|
11
|
+
|
|
9
12
|
var _CopyDataFromAction = _interopRequireDefault(require("./CopyDataFromAction"));
|
|
13
|
+
|
|
10
14
|
var _default = _CopyDataFromAction["default"];
|
|
11
15
|
exports["default"] = _default;
|
|
12
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CopyDataFromAction"],"sources":["../../../src/components/CopyDataFromAction/index.js"],"sourcesContent":["import CopyDataFromAction from './CopyDataFromAction';\n\nexport default CopyDataFromAction;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["CopyDataFromAction"],"sources":["../../../src/components/CopyDataFromAction/index.js"],"sourcesContent":["import CopyDataFromAction from './CopyDataFromAction';\n\nexport default CopyDataFromAction;\n"],"mappings":";;;;;;;;;;;AAAA;;eAEeA,8B"}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
4
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports["default"] = void 0;
|
|
11
|
+
|
|
9
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
10
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
11
16
|
var _modal = _interopRequireDefault(require("@blaze-react/modal"));
|
|
17
|
+
|
|
12
18
|
var DeleteAction = function DeleteAction(_ref) {
|
|
13
19
|
var onClose = _ref.onClose,
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
deleteAction = _ref.deleteAction,
|
|
21
|
+
itemName = _ref.itemName;
|
|
16
22
|
var alertActions = [{
|
|
17
23
|
callback: function callback(event) {
|
|
18
24
|
event.stopPropagation();
|
|
@@ -27,6 +33,7 @@ var DeleteAction = function DeleteAction(_ref) {
|
|
|
27
33
|
isAlert: true
|
|
28
34
|
}, /*#__PURE__*/_react["default"].createElement("p", null, "You are about to delete: ", /*#__PURE__*/_react["default"].createElement("strong", null, itemName)));
|
|
29
35
|
};
|
|
36
|
+
|
|
30
37
|
DeleteAction.propTypes = {
|
|
31
38
|
onClose: _propTypes["default"].func.isRequired,
|
|
32
39
|
deleteAction: _propTypes["default"].func.isRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteAction.js","names":["DeleteAction","onClose","deleteAction","itemName","alertActions","callback","event","stopPropagation","modifiers","textButton","propTypes","PropTypes","func","isRequired","string","defaultProps"],"sources":["../../../src/components/DeleteAction/DeleteAction.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Modal from '@blaze-react/modal';\n\nconst DeleteAction = ({ onClose, deleteAction, itemName }) => {\n const alertActions = [\n {\n callback: event => {\n event.stopPropagation();\n deleteAction();\n },\n modifiers: ['small'],\n textButton: 'Delete'\n }\n ];\n\n return (\n <Modal actions={alertActions} onClose={onClose} isAlert>\n <p>\n You are about to delete: <strong>{itemName}</strong>\n </p>\n </Modal>\n );\n};\n\nDeleteAction.propTypes = {\n onClose: PropTypes.func.isRequired,\n deleteAction: PropTypes.func.isRequired,\n itemName: PropTypes.string\n};\n\nDeleteAction.defaultProps = {\n itemName: ''\n};\n\nexport default DeleteAction;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeleteAction.js","names":["DeleteAction","onClose","deleteAction","itemName","alertActions","callback","event","stopPropagation","modifiers","textButton","propTypes","PropTypes","func","isRequired","string","defaultProps"],"sources":["../../../src/components/DeleteAction/DeleteAction.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Modal from '@blaze-react/modal';\n\nconst DeleteAction = ({ onClose, deleteAction, itemName }) => {\n const alertActions = [\n {\n callback: event => {\n event.stopPropagation();\n deleteAction();\n },\n modifiers: ['small'],\n textButton: 'Delete'\n }\n ];\n\n return (\n <Modal actions={alertActions} onClose={onClose} isAlert>\n <p>\n You are about to delete: <strong>{itemName}</strong>\n </p>\n </Modal>\n );\n};\n\nDeleteAction.propTypes = {\n onClose: PropTypes.func.isRequired,\n deleteAction: PropTypes.func.isRequired,\n itemName: PropTypes.string\n};\n\nDeleteAction.defaultProps = {\n itemName: ''\n};\n\nexport default DeleteAction;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,YAAY,GAAG,SAAfA,YAAe,OAAyC;EAAA,IAAtCC,OAAsC,QAAtCA,OAAsC;EAAA,IAA7BC,YAA6B,QAA7BA,YAA6B;EAAA,IAAfC,QAAe,QAAfA,QAAe;EAC5D,IAAMC,YAAY,GAAG,CACnB;IACEC,QAAQ,EAAE,kBAAAC,KAAK,EAAI;MACjBA,KAAK,CAACC,eAAN;MACAL,YAAY;IACb,CAJH;IAKEM,SAAS,EAAE,CAAC,OAAD,CALb;IAMEC,UAAU,EAAE;EANd,CADmB,CAArB;EAWA,oBACE,gCAAC,iBAAD;IAAO,OAAO,EAAEL,YAAhB;IAA8B,OAAO,EAAEH,OAAvC;IAAgD,OAAO;EAAvD,gBACE,qFAC2B,gDAASE,QAAT,CAD3B,CADF,CADF;AAOD,CAnBD;;AAqBAH,YAAY,CAACU,SAAb,GAAyB;EACvBT,OAAO,EAAEU,qBAAA,CAAUC,IAAV,CAAeC,UADD;EAEvBX,YAAY,EAAES,qBAAA,CAAUC,IAAV,CAAeC,UAFN;EAGvBV,QAAQ,EAAEQ,qBAAA,CAAUG;AAHG,CAAzB;AAMAd,YAAY,CAACe,YAAb,GAA4B;EAC1BZ,QAAQ,EAAE;AADgB,CAA5B;eAIeH,Y"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
4
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports["default"] = void 0;
|
|
11
|
+
|
|
9
12
|
var _DeleteAction = _interopRequireDefault(require("./DeleteAction"));
|
|
13
|
+
|
|
10
14
|
var _default = _DeleteAction["default"];
|
|
11
15
|
exports["default"] = _default;
|
|
12
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DeleteAction"],"sources":["../../../src/components/DeleteAction/index.js"],"sourcesContent":["import DeleteAction from './DeleteAction';\n\nexport default DeleteAction;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["DeleteAction"],"sources":["../../../src/components/DeleteAction/index.js"],"sourcesContent":["import DeleteAction from './DeleteAction';\n\nexport default DeleteAction;\n"],"mappings":";;;;;;;;;;;AAAA;;eAEeA,wB"}
|