@blaze-cms/admin 0.125.1 → 0.125.2
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 +8 -0
- package/lib/components/CardPrompt/CardPrompt.js +1 -7
- package/lib/components/CardPrompt/CardPrompt.js.map +1 -1
- package/lib/components/CardPrompt/index.js +0 -4
- package/lib/components/CardPrompt/index.js.map +1 -1
- package/lib/components/CopyDataFromAction/CopyDataFromAction.js +23 -87
- package/lib/components/CopyDataFromAction/CopyDataFromAction.js.map +1 -1
- package/lib/components/CopyDataFromAction/helpers.js +0 -9
- package/lib/components/CopyDataFromAction/helpers.js.map +1 -1
- package/lib/components/CopyDataFromAction/index.js +0 -4
- package/lib/components/CopyDataFromAction/index.js.map +1 -1
- package/lib/components/DeleteAction/DeleteAction.js +2 -9
- package/lib/components/DeleteAction/DeleteAction.js.map +1 -1
- package/lib/components/DeleteAction/index.js +0 -4
- package/lib/components/DeleteAction/index.js.map +1 -1
- package/lib/components/LeaveAction/LeaveAction.js +0 -12
- package/lib/components/LeaveAction/LeaveAction.js.map +1 -1
- package/lib/components/LeaveAction/index.js +0 -4
- package/lib/components/LeaveAction/index.js.map +1 -1
- package/lib/components/MetaTitle/MetaTitle.js +2 -15
- package/lib/components/MetaTitle/MetaTitle.js.map +1 -1
- package/lib/components/MetaTitle/index.js +0 -4
- package/lib/components/MetaTitle/index.js.map +1 -1
- package/lib/components/PageHeader/PageHeader.js +4 -14
- package/lib/components/PageHeader/PageHeader.js.map +1 -1
- package/lib/components/PageHeader/index.js +0 -4
- package/lib/components/PageHeader/index.js.map +1 -1
- package/lib/components/RevertToTemplate/RevertToTemplate.js +2 -9
- package/lib/components/RevertToTemplate/RevertToTemplate.js.map +1 -1
- package/lib/components/RevertToTemplate/index.js +0 -4
- package/lib/components/RevertToTemplate/index.js.map +1 -1
- package/lib/index.js +0 -10
- package/lib/index.js.map +1 -1
- package/lib/utils/build-interface.js +3 -23
- package/lib/utils/build-interface.js.map +1 -1
- package/lib/utils/get-blaze-admin.js +1 -10
- package/lib/utils/get-blaze-admin.js.map +1 -1
- package/lib-es/components/CardPrompt/CardPrompt.js +0 -2
- 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 +5 -20
- package/lib-es/components/CopyDataFromAction/CopyDataFromAction.js.map +1 -1
- package/lib-es/components/CopyDataFromAction/helpers.js +0 -3
- 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 +0 -2
- 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 +0 -5
- 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 +0 -2
- 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 +0 -4
- 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 +0 -2
- 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 +0 -2
- package/lib-es/utils/get-blaze-admin.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.2](https://github.com/thebyte9/blaze/compare/v0.125.1...v0.125.2) (2022-12-12)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @blaze-cms/admin
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.125.1](https://github.com/thebyte9/blaze/compare/v0.125.0...v0.125.1) (2022-12-09)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @blaze-cms/admin
|
|
@@ -1,21 +1,16 @@
|
|
|
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 _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
11
|
var CardPrompt = function CardPrompt(_ref) {
|
|
17
12
|
var onClose = _ref.onClose,
|
|
18
|
-
|
|
13
|
+
children = _ref.children;
|
|
19
14
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
20
15
|
className: "card card--prompt",
|
|
21
16
|
"data-testid": "card-prompt"
|
|
@@ -38,7 +33,6 @@ var CardPrompt = function CardPrompt(_ref) {
|
|
|
38
33
|
className: "card__title"
|
|
39
34
|
}, "Nothing to see here!"), /*#__PURE__*/_react["default"].createElement("p", null, "How about adding some content now?"), children));
|
|
40
35
|
};
|
|
41
|
-
|
|
42
36
|
CardPrompt.displayName = 'CardPrompt';
|
|
43
37
|
CardPrompt.propTypes = {
|
|
44
38
|
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,UAAU;EAAA,IAAMC,OAAO,QAAPA,OAAO;IAAEC,QAAQ,QAARA,QAAQ;EAAA,oBACrC;IAAK,SAAS,EAAC,mBAAmB;IAAC,eAAY;EAAa,gBAC1D;IAAK,SAAS,EAAC;EAAa,gBAC1B;IAAQ,IAAI,EAAC,QAAQ;IAAC,SAAS,EAAC,gCAAgC;IAAC,OAAO,EAAED;EAAQ,gBAChF;IAAG,SAAS,EAAC;EAAgB,WAAU,CAChC,CACL,eACN;IAAK,SAAS,EAAC;EAAmB,gBAChC;IAAK,GAAG,EAAC,uDAAuD;IAAC,GAAG,EAAC;EAAQ,EAAG,CAC5E,eACN;IAAK,SAAS,EAAC;EAAqC,gBAClD;IAAI,SAAS,EAAC;EAAa,0BAA0B,eACrD,gFAAyC,EACxCC,QAAQ,CACL,CACF;AAAA,CACP;AAEDF,UAAU,CAACG,WAAW,GAAG,YAAY;AAErCH,UAAU,CAACI,SAAS,GAAG;EACrBH,OAAO,EAAEI,qBAAS,CAACC,IAAI,CAACC,UAAU;EAClCL,QAAQ,EAAEG,qBAAS,CAACG,SAAS,CAAC,CAACH,qBAAS,CAACI,KAAK,EAAEJ,qBAAS,CAACK,MAAM,EAAEL,qBAAS,CAACM,MAAM,CAAC;AACrF,CAAC;AAEDX,UAAU,CAACY,YAAY,GAAG;EACxBV,QAAQ,EAAE;AACZ,CAAC;AAAC,eAEaF,UAAU;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 _CardPrompt = _interopRequireDefault(require("./CardPrompt"));
|
|
13
|
-
|
|
14
10
|
var _default = _CardPrompt["default"];
|
|
15
11
|
exports["default"] = _default;
|
|
16
12
|
//# 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;AAAsC,eAEvBA,sBAAU;AAAA"}
|
|
@@ -1,114 +1,70 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.symbol.js");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.array.filter.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
8
|
-
|
|
9
6
|
require("core-js/modules/es.array.for-each.js");
|
|
10
|
-
|
|
11
7
|
require("core-js/modules/web.dom-collections.for-each.js");
|
|
12
|
-
|
|
13
8
|
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
14
|
-
|
|
15
9
|
require("core-js/modules/es.object.define-properties.js");
|
|
16
|
-
|
|
17
10
|
require("core-js/modules/es.object.define-property.js");
|
|
18
|
-
|
|
19
11
|
require("core-js/modules/es.array.iterator.js");
|
|
20
|
-
|
|
21
12
|
require("core-js/modules/es.string.iterator.js");
|
|
22
|
-
|
|
23
13
|
require("core-js/modules/es.weak-map.js");
|
|
24
|
-
|
|
25
14
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
26
|
-
|
|
27
15
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
28
|
-
|
|
29
16
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
30
|
-
|
|
31
17
|
Object.defineProperty(exports, "__esModule", {
|
|
32
18
|
value: true
|
|
33
19
|
});
|
|
34
20
|
exports["default"] = void 0;
|
|
35
|
-
|
|
36
21
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
37
|
-
|
|
38
22
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
39
|
-
|
|
40
23
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
41
|
-
|
|
42
24
|
require("core-js/modules/es.object.keys.js");
|
|
43
|
-
|
|
44
25
|
require("core-js/modules/es.array.map.js");
|
|
45
|
-
|
|
46
26
|
require("core-js/modules/es.function.name.js");
|
|
47
|
-
|
|
48
27
|
require("core-js/modules/es.array.find.js");
|
|
49
|
-
|
|
50
28
|
require("core-js/modules/es.object.to-string.js");
|
|
51
|
-
|
|
52
29
|
require("core-js/modules/es.array.join.js");
|
|
53
|
-
|
|
54
30
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
55
|
-
|
|
56
31
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
57
|
-
|
|
58
32
|
var _react = _interopRequireWildcard(require("react"));
|
|
59
|
-
|
|
60
33
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
61
|
-
|
|
62
34
|
var _alert = _interopRequireDefault(require("@blaze-react/alert"));
|
|
63
|
-
|
|
64
35
|
var _modal = _interopRequireDefault(require("@blaze-react/modal"));
|
|
65
|
-
|
|
66
36
|
var _client = require("@apollo/client");
|
|
67
|
-
|
|
68
37
|
var _reactFormBuilder = require("@blaze-cms/react-form-builder");
|
|
69
|
-
|
|
70
38
|
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
71
|
-
|
|
72
39
|
var _helpers = require("./helpers");
|
|
73
|
-
|
|
74
40
|
var _excluded = ["id", "displayName", "actions"];
|
|
75
|
-
|
|
76
41
|
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
|
-
|
|
78
42
|
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
|
-
|
|
80
43
|
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
|
-
|
|
82
44
|
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
|
-
|
|
84
45
|
var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
85
46
|
var onClose = _ref.onClose,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
47
|
+
copyAction = _ref.copyAction,
|
|
48
|
+
getFormData = _ref.getFormData;
|
|
89
49
|
var _useState = (0, _react.useState)([]),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
50
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
51
|
+
entityRecordsOptions = _useState2[0],
|
|
52
|
+
setEntityRecordsOptions = _useState2[1];
|
|
94
53
|
var _useState3 = (0, _react.useState)(),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
54
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
55
|
+
actionName = _useState4[0],
|
|
56
|
+
setActionName = _useState4[1];
|
|
99
57
|
var _useState5 = (0, _react.useState)(),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
58
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
59
|
+
selectedEntity = _useState6[0],
|
|
60
|
+
setSelectedEntity = _useState6[1];
|
|
104
61
|
var _useState7 = (0, _react.useState)(true),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
62
|
+
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
63
|
+
autocompleteDisabledStatus = _useState8[0],
|
|
64
|
+
setAutocompleteDisabledStatus = _useState8[1];
|
|
109
65
|
var client = (0, _client.useApolloClient)();
|
|
110
66
|
var Select = _reactFormBuilder.formFieldTypes.select,
|
|
111
|
-
|
|
67
|
+
Autocomplete = _reactFormBuilder.formFieldTypes.autocomplete;
|
|
112
68
|
var entitiesAction = [];
|
|
113
69
|
var entityProperties = {};
|
|
114
70
|
var modalActions = [{
|
|
@@ -121,11 +77,9 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
121
77
|
modifiers: [],
|
|
122
78
|
'data-testid': 'copyDataFromAction-copy-button'
|
|
123
79
|
}];
|
|
124
|
-
|
|
125
80
|
var fetchEntityRecords = /*#__PURE__*/function () {
|
|
126
81
|
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(action) {
|
|
127
82
|
var _yield$client$query, _yield$client$query$d, data, entityRecords;
|
|
128
|
-
|
|
129
83
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
130
84
|
while (1) {
|
|
131
85
|
switch (_context.prev = _context.next) {
|
|
@@ -134,16 +88,14 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
134
88
|
return client.query({
|
|
135
89
|
query: (0, _helpers.getAction)(action)
|
|
136
90
|
});
|
|
137
|
-
|
|
138
91
|
case 2:
|
|
139
92
|
_yield$client$query = _context.sent;
|
|
140
93
|
_yield$client$query$d = _yield$client$query.data;
|
|
141
94
|
data = _yield$client$query$d === void 0 ? {} : _yield$client$query$d;
|
|
142
|
-
|
|
143
95
|
if (Object.keys(data).length) {
|
|
144
96
|
entityRecords = data[action].map(function (_ref3) {
|
|
145
97
|
var id = _ref3.id,
|
|
146
|
-
|
|
98
|
+
name = _ref3.name;
|
|
147
99
|
return {
|
|
148
100
|
id: id,
|
|
149
101
|
name: name
|
|
@@ -151,7 +103,6 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
151
103
|
});
|
|
152
104
|
setEntityRecordsOptions(entityRecords);
|
|
153
105
|
}
|
|
154
|
-
|
|
155
106
|
case 6:
|
|
156
107
|
case "end":
|
|
157
108
|
return _context.stop();
|
|
@@ -159,20 +110,16 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
159
110
|
}
|
|
160
111
|
}, _callee);
|
|
161
112
|
}));
|
|
162
|
-
|
|
163
113
|
return function fetchEntityRecords(_x) {
|
|
164
114
|
return _ref2.apply(this, arguments);
|
|
165
115
|
};
|
|
166
116
|
}();
|
|
167
|
-
|
|
168
117
|
var onEntityChange = function onEntityChange(_ref4) {
|
|
169
118
|
var value = _ref4.value;
|
|
170
|
-
|
|
171
119
|
var _entitiesAction$find = entitiesAction.find(function (entity) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
120
|
+
return entity.id === value;
|
|
121
|
+
}),
|
|
122
|
+
action = _entitiesAction$find.action;
|
|
176
123
|
if (action) {
|
|
177
124
|
setActionName(action);
|
|
178
125
|
setSelectedEntity(value);
|
|
@@ -180,11 +127,9 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
180
127
|
setAutocompleteDisabledStatus(false);
|
|
181
128
|
}
|
|
182
129
|
};
|
|
183
|
-
|
|
184
130
|
var onEntityRecordChange = /*#__PURE__*/function () {
|
|
185
131
|
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(event) {
|
|
186
132
|
var fields, _yield$client$query2, _yield$client$query2$, data;
|
|
187
|
-
|
|
188
133
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
189
134
|
while (1) {
|
|
190
135
|
switch (_context2.prev = _context2.next) {
|
|
@@ -194,16 +139,13 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
194
139
|
return client.query({
|
|
195
140
|
query: (0, _helpers.getAction)(actionName, event.id, fields)
|
|
196
141
|
});
|
|
197
|
-
|
|
198
142
|
case 3:
|
|
199
143
|
_yield$client$query2 = _context2.sent;
|
|
200
144
|
_yield$client$query2$ = _yield$client$query2.data;
|
|
201
145
|
data = _yield$client$query2$ === void 0 ? {} : _yield$client$query2$;
|
|
202
|
-
|
|
203
146
|
if (Object.keys(data).length) {
|
|
204
147
|
getFormData(data[actionName][0]);
|
|
205
148
|
}
|
|
206
|
-
|
|
207
149
|
case 7:
|
|
208
150
|
case "end":
|
|
209
151
|
return _context2.stop();
|
|
@@ -211,24 +153,20 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
211
153
|
}
|
|
212
154
|
}, _callee2);
|
|
213
155
|
}));
|
|
214
|
-
|
|
215
156
|
return function onEntityRecordChange(_x2) {
|
|
216
157
|
return _ref5.apply(this, arguments);
|
|
217
158
|
};
|
|
218
159
|
}();
|
|
219
|
-
|
|
220
160
|
var _useQuery = (0, _client.useQuery)((0, _adminUiUtils.getQuery)('GET_USER_EDITABLE_ENTITIES')),
|
|
221
|
-
|
|
222
|
-
|
|
161
|
+
_useQuery$data = _useQuery.data;
|
|
223
162
|
_useQuery$data = _useQuery$data === void 0 ? {} : _useQuery$data;
|
|
224
163
|
var getEntitySchemas = _useQuery$data.getEntitySchemas;
|
|
225
|
-
|
|
226
164
|
if (getEntitySchemas) {
|
|
227
165
|
var entities = getEntitySchemas.map(function (_ref6) {
|
|
228
166
|
var id = _ref6.id,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
167
|
+
displayName = _ref6.displayName,
|
|
168
|
+
actions = _ref6.actions,
|
|
169
|
+
otherSchemaProps = (0, _objectWithoutProperties2["default"])(_ref6, _excluded);
|
|
232
170
|
entitiesAction.push({
|
|
233
171
|
id: id,
|
|
234
172
|
action: actions.getAll
|
|
@@ -267,10 +205,8 @@ var CopyDataFromAction = function CopyDataFromAction(_ref) {
|
|
|
267
205
|
}
|
|
268
206
|
}));
|
|
269
207
|
}
|
|
270
|
-
|
|
271
208
|
return null;
|
|
272
209
|
};
|
|
273
|
-
|
|
274
210
|
CopyDataFromAction.propTypes = {
|
|
275
211
|
onClose: _propTypes["default"].func.isRequired,
|
|
276
212
|
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;AAAsC;AAAA;AAAA;AAAA;AAAA;AAEtC,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkB,OAA6C;EAAA,IAAvCC,OAAO,QAAPA,OAAO;IAAEC,UAAU,QAAVA,UAAU;IAAEC,WAAW,QAAXA,WAAW;EAC5D,gBAAwD,IAAAC,eAAQ,EAAC,EAAE,CAAC;IAAA;IAA7DC,oBAAoB;IAAEC,uBAAuB;EACpD,iBAAoC,IAAAF,eAAQ,GAAE;IAAA;IAAvCG,UAAU;IAAEC,aAAa;EAChC,iBAA4C,IAAAJ,eAAQ,GAAE;IAAA;IAA/CK,cAAc;IAAEC,iBAAiB;EACxC,iBAAoE,IAAAN,eAAQ,EAAC,IAAI,CAAC;IAAA;IAA3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3D,WAAW,EAAEyD,qBAAS,CAACC,IAAI,CAACC;AAC9B,CAAC;AAAC,eAEa9D,kBAAkB;AAAA"}
|
|
@@ -1,31 +1,22 @@
|
|
|
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.getAction = void 0;
|
|
11
|
-
|
|
12
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
10
|
require("core-js/modules/es.array.concat.js");
|
|
15
|
-
|
|
16
11
|
var _client = require("@apollo/client");
|
|
17
|
-
|
|
18
12
|
var _templateObject;
|
|
19
|
-
|
|
20
13
|
var generateQuery = function generateQuery(action, id, fragment) {
|
|
21
14
|
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 ");
|
|
22
15
|
};
|
|
23
|
-
|
|
24
16
|
var getAction = function getAction(action, id) {
|
|
25
17
|
var fields = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
26
18
|
var query = id ? generateQuery(action, id, fields) : generateQuery(action);
|
|
27
19
|
return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n "])), query);
|
|
28
20
|
};
|
|
29
|
-
|
|
30
21
|
exports.getAction = getAction;
|
|
31
22
|
//# 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;AAAqC;AAErC,IAAMA,aAAa,GAAG,SAAhBA,aAAa,CAAIC,MAAM,EAAEC,EAAE,EAAEC,QAAQ;EAAA,OACzCD,EAAE,+CAGID,MAAM,4BAAiBC,EAAE,2CAEvBC,QAAQ,sEAKRF,MAAM,+DAKX;AAAA;AAEL,IAAMG,SAAS,GAAG,SAAZA,SAAS,CAAIH,MAAM,EAAEC,EAAE,EAAkB;EAAA,IAAhBG,MAAM,uEAAG,EAAE;EACxC,IAAMC,KAAK,GAAGJ,EAAE,GAAGF,aAAa,CAACC,MAAM,EAAEC,EAAE,EAAEG,MAAM,CAAC,GAAGL,aAAa,CAACC,MAAM,CAAC;EAC5E,WAAOM,WAAG,sGACND,KAAK;AAEX,CAAC;AAAC"}
|
|
@@ -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 _CopyDataFromAction = _interopRequireDefault(require("./CopyDataFromAction"));
|
|
13
|
-
|
|
14
10
|
var _default = _CopyDataFromAction["default"];
|
|
15
11
|
exports["default"] = _default;
|
|
16
12
|
//# 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;AAAsD,eAEvCA,8BAAkB;AAAA"}
|
|
@@ -1,24 +1,18 @@
|
|
|
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 _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
11
|
var _modal = _interopRequireDefault(require("@blaze-react/modal"));
|
|
17
|
-
|
|
18
12
|
var DeleteAction = function DeleteAction(_ref) {
|
|
19
13
|
var onClose = _ref.onClose,
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
deleteAction = _ref.deleteAction,
|
|
15
|
+
itemName = _ref.itemName;
|
|
22
16
|
var alertActions = [{
|
|
23
17
|
callback: function callback(event) {
|
|
24
18
|
event.stopPropagation();
|
|
@@ -33,7 +27,6 @@ var DeleteAction = function DeleteAction(_ref) {
|
|
|
33
27
|
isAlert: true
|
|
34
28
|
}, /*#__PURE__*/_react["default"].createElement("p", null, "You are about to delete: ", /*#__PURE__*/_react["default"].createElement("strong", null, itemName)));
|
|
35
29
|
};
|
|
36
|
-
|
|
37
30
|
DeleteAction.propTypes = {
|
|
38
31
|
onClose: _propTypes["default"].func.isRequired,
|
|
39
32
|
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,YAAY,OAA4C;EAAA,IAAtCC,OAAO,QAAPA,OAAO;IAAEC,YAAY,QAAZA,YAAY;IAAEC,QAAQ,QAARA,QAAQ;EACrD,IAAMC,YAAY,GAAG,CACnB;IACEC,QAAQ,EAAE,kBAAAC,KAAK,EAAI;MACjBA,KAAK,CAACC,eAAe,EAAE;MACvBL,YAAY,EAAE;IAChB,CAAC;IACDM,SAAS,EAAE,CAAC,OAAO,CAAC;IACpBC,UAAU,EAAE;EACd,CAAC,CACF;EAED,oBACE,gCAAC,iBAAK;IAAC,OAAO,EAAEL,YAAa;IAAC,OAAO,EAAEH,OAAQ;IAAC,OAAO;EAAA,gBACrD,qFAC2B,gDAASE,QAAQ,CAAU,CAClD,CACE;AAEZ,CAAC;AAEDH,YAAY,CAACU,SAAS,GAAG;EACvBT,OAAO,EAAEU,qBAAS,CAACC,IAAI,CAACC,UAAU;EAClCX,YAAY,EAAES,qBAAS,CAACC,IAAI,CAACC,UAAU;EACvCV,QAAQ,EAAEQ,qBAAS,CAACG;AACtB,CAAC;AAEDd,YAAY,CAACe,YAAY,GAAG;EAC1BZ,QAAQ,EAAE;AACZ,CAAC;AAAC,eAEaH,YAAY;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 _DeleteAction = _interopRequireDefault(require("./DeleteAction"));
|
|
13
|
-
|
|
14
10
|
var _default = _DeleteAction["default"];
|
|
15
11
|
exports["default"] = _default;
|
|
16
12
|
//# 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;AAA0C,eAE3BA,wBAAY;AAAA"}
|
|
@@ -1,36 +1,26 @@
|
|
|
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 _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
10
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
15
|
-
|
|
16
11
|
var _modal = _interopRequireDefault(require("@blaze-react/modal"));
|
|
17
|
-
|
|
18
12
|
var LeaveAction = function LeaveAction(message, callback) {
|
|
19
13
|
var container = document.getElementById('leave-container');
|
|
20
|
-
|
|
21
14
|
if (!container) {
|
|
22
15
|
container = document.createElement('div');
|
|
23
16
|
container.setAttribute('confirmation-modal', '');
|
|
24
17
|
container.id = 'leave-container';
|
|
25
18
|
document.body.appendChild(container);
|
|
26
19
|
}
|
|
27
|
-
|
|
28
20
|
var closeModal = function closeModal(callbackState) {
|
|
29
21
|
_reactDom["default"].unmountComponentAtNode(container);
|
|
30
|
-
|
|
31
22
|
callback(callbackState);
|
|
32
23
|
};
|
|
33
|
-
|
|
34
24
|
var alertActions = [{
|
|
35
25
|
callback: function callback(event) {
|
|
36
26
|
event.stopPropagation();
|
|
@@ -39,7 +29,6 @@ var LeaveAction = function LeaveAction(message, callback) {
|
|
|
39
29
|
modifiers: ['small'],
|
|
40
30
|
textButton: 'Leave'
|
|
41
31
|
}];
|
|
42
|
-
|
|
43
32
|
_reactDom["default"].render( /*#__PURE__*/_react["default"].createElement(_modal["default"], {
|
|
44
33
|
actions: alertActions,
|
|
45
34
|
onClose: function onClose() {
|
|
@@ -48,7 +37,6 @@ var LeaveAction = function LeaveAction(message, callback) {
|
|
|
48
37
|
isAlert: true
|
|
49
38
|
}, /*#__PURE__*/_react["default"].createElement("p", null, message)), container);
|
|
50
39
|
};
|
|
51
|
-
|
|
52
40
|
var _default = LeaveAction;
|
|
53
41
|
exports["default"] = _default;
|
|
54
42
|
//# sourceMappingURL=LeaveAction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeaveAction.js","names":["LeaveAction","message","callback","container","document","getElementById","createElement","setAttribute","id","body","appendChild","closeModal","callbackState","ReactDOM","unmountComponentAtNode","alertActions","event","stopPropagation","modifiers","textButton","render"],"sources":["../../../src/components/LeaveAction/LeaveAction.js"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport Modal from '@blaze-react/modal';\n\nconst LeaveAction = (message, callback) => {\n let container = document.getElementById('leave-container');\n if (!container) {\n container = document.createElement('div');\n container.setAttribute('confirmation-modal', '');\n container.id = 'leave-container';\n document.body.appendChild(container);\n }\n\n const closeModal = callbackState => {\n ReactDOM.unmountComponentAtNode(container);\n callback(callbackState);\n };\n\n const alertActions = [\n {\n callback: event => {\n event.stopPropagation();\n closeModal(true);\n },\n modifiers: ['small'],\n textButton: 'Leave'\n }\n ];\n\n ReactDOM.render(\n <Modal actions={alertActions} onClose={() => closeModal(false)} isAlert>\n <p>{message}</p>\n </Modal>,\n container\n );\n};\n\nexport default LeaveAction;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"LeaveAction.js","names":["LeaveAction","message","callback","container","document","getElementById","createElement","setAttribute","id","body","appendChild","closeModal","callbackState","ReactDOM","unmountComponentAtNode","alertActions","event","stopPropagation","modifiers","textButton","render"],"sources":["../../../src/components/LeaveAction/LeaveAction.js"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport Modal from '@blaze-react/modal';\n\nconst LeaveAction = (message, callback) => {\n let container = document.getElementById('leave-container');\n if (!container) {\n container = document.createElement('div');\n container.setAttribute('confirmation-modal', '');\n container.id = 'leave-container';\n document.body.appendChild(container);\n }\n\n const closeModal = callbackState => {\n ReactDOM.unmountComponentAtNode(container);\n callback(callbackState);\n };\n\n const alertActions = [\n {\n callback: event => {\n event.stopPropagation();\n closeModal(true);\n },\n modifiers: ['small'],\n textButton: 'Leave'\n }\n ];\n\n ReactDOM.render(\n <Modal actions={alertActions} onClose={() => closeModal(false)} isAlert>\n <p>{message}</p>\n </Modal>,\n container\n );\n};\n\nexport default LeaveAction;\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AAEA,IAAMA,WAAW,GAAG,SAAdA,WAAW,CAAIC,OAAO,EAAEC,QAAQ,EAAK;EACzC,IAAIC,SAAS,GAAGC,QAAQ,CAACC,cAAc,CAAC,iBAAiB,CAAC;EAC1D,IAAI,CAACF,SAAS,EAAE;IACdA,SAAS,GAAGC,QAAQ,CAACE,aAAa,CAAC,KAAK,CAAC;IACzCH,SAAS,CAACI,YAAY,CAAC,oBAAoB,EAAE,EAAE,CAAC;IAChDJ,SAAS,CAACK,EAAE,GAAG,iBAAiB;IAChCJ,QAAQ,CAACK,IAAI,CAACC,WAAW,CAACP,SAAS,CAAC;EACtC;EAEA,IAAMQ,UAAU,GAAG,SAAbA,UAAU,CAAGC,aAAa,EAAI;IAClCC,oBAAQ,CAACC,sBAAsB,CAACX,SAAS,CAAC;IAC1CD,QAAQ,CAACU,aAAa,CAAC;EACzB,CAAC;EAED,IAAMG,YAAY,GAAG,CACnB;IACEb,QAAQ,EAAE,kBAAAc,KAAK,EAAI;MACjBA,KAAK,CAACC,eAAe,EAAE;MACvBN,UAAU,CAAC,IAAI,CAAC;IAClB,CAAC;IACDO,SAAS,EAAE,CAAC,OAAO,CAAC;IACpBC,UAAU,EAAE;EACd,CAAC,CACF;EAEDN,oBAAQ,CAACO,MAAM,eACb,gCAAC,iBAAK;IAAC,OAAO,EAAEL,YAAa;IAAC,OAAO,EAAE;MAAA,OAAMJ,UAAU,CAAC,KAAK,CAAC;IAAA,CAAC;IAAC,OAAO;EAAA,gBACrE,2CAAIV,OAAO,CAAK,CACV,EACRE,SAAS,CACV;AACH,CAAC;AAAC,eAEaH,WAAW;AAAA"}
|