versacall-core-library-react 2.0.65 → 2.0.67
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/dist/components/CoreAlert/CoreAlert.js +43 -107
- package/dist/components/CoreAlert/index.js +2 -4
- package/dist/components/CoreAppBar/CoreAppBar.js +275 -418
- package/dist/components/CoreAppBar/CoreAppBarDrawer.js +88 -171
- package/dist/components/CoreAppBar/index.js +2 -4
- package/dist/components/CoreAppSelector/AppLink.js +36 -60
- package/dist/components/CoreAppSelector/CoreAppSelector.js +109 -200
- package/dist/components/CoreAppSelector/index.js +2 -4
- package/dist/components/CoreDialogueToolBar/CoreDialogueToolBar.js +43 -69
- package/dist/components/CoreDialogueToolBar/index.js +2 -4
- package/dist/components/CoreDrawer/CoreDrawer.js +168 -286
- package/dist/components/CoreDrawer/index.js +2 -4
- package/dist/components/CoreDropDownTextfield/CoreDropDownTextfield.js +57 -121
- package/dist/components/CoreDropDownTextfield/index.js +2 -4
- package/dist/components/CoreElapsedTime/CoreElapsedTime.js +38 -97
- package/dist/components/CoreElapsedTime/index.js +2 -4
- package/dist/components/CoreFrame/CoreFrame.js +17 -28
- package/dist/components/CoreFrame/index.js +2 -4
- package/dist/components/CoreImportDialog/CoreImportDialog.js +87 -189
- package/dist/components/CoreImportDialog/index.js +2 -4
- package/dist/components/CoreImportResultsDialog/CoreImportResultsDialog.js +19 -45
- package/dist/components/CoreImportResultsDialog/index.js +2 -4
- package/dist/components/CoreImporting/CoreImporting.js +23 -39
- package/dist/components/CoreImporting/index.js +2 -4
- package/dist/components/CorePlugin/CorePlugin.js +83 -160
- package/dist/components/CorePlugin/OldCorePlugin.js +73 -149
- package/dist/components/CorePlugin/index.js +2 -4
- package/dist/components/CoreSaveChangesDialog/CoreSaveChangesDialog.js +10 -32
- package/dist/components/CoreSaveChangesDialog/index.js +2 -4
- package/dist/components/CoreShiftTagFilter/CoreShiftTagFilter.js +288 -408
- package/dist/components/CoreShiftTagFilter/OldCoreShiftTagFilter.js +161 -257
- package/dist/components/CoreShiftTagFilter/index.js +2 -4
- package/dist/components/CoreSideBar/CoreSideBar.js +578 -737
- package/dist/components/CoreSideBar/CoreSideBarDrawer.js +122 -212
- package/dist/components/CoreSideBar/index.js +2 -4
- package/dist/components/CoreSnackBar/CoreSnackBar.js +76 -143
- package/dist/components/CoreSnackBar/index.js +2 -4
- package/dist/components/CoreTable/CoreTable.js +219 -337
- package/dist/components/CoreTable/CoreTableChips.js +11 -19
- package/dist/components/CoreTable/CoreTableHead.js +125 -205
- package/dist/components/CoreTable/CoreTableToolbar.js +34 -56
- package/dist/components/CoreTable/index.js +2 -4
- package/dist/components/CoreTagFilter/CoreTagFilter.js +212 -319
- package/dist/components/CoreTagFilter/OldCoreTagFilter.js +270 -402
- package/dist/components/CoreTagFilter/OldTagChip.js +10 -20
- package/dist/components/CoreTagFilter/OldTagFilterSelector.js +77 -148
- package/dist/components/CoreTagFilter/OldTagOption.js +21 -47
- package/dist/components/CoreTagFilter/TagFilterBuilder.js +114 -274
- package/dist/components/CoreTagFilter/index.js +2 -4
- package/dist/components/CoreTextField/CoreTextField.js +69 -132
- package/dist/components/CoreTextField/index.js +2 -4
- package/dist/components/CoreTheme/CoreTheme.js +13 -27
- package/dist/components/CoreTheme/index.js +2 -4
- package/dist/components/CoreTile/CoreTile.js +21 -34
- package/dist/components/CoreTile/CoreTileToolbar.js +21 -36
- package/dist/components/CoreTile/index.js +2 -4
- package/dist/components/CoreTimerInput/CoreTimerInput.js +36 -60
- package/dist/components/CoreTimerInput/CoreTimerInputOld.js +29 -47
- package/dist/components/CoreTimerInput/index.js +2 -4
- package/dist/components/CoreToolbar/CoreToolbar.js +65 -95
- package/dist/components/CoreToolbar/index.js +2 -4
- package/dist/components/CoreTracker/CoreTracker.js +32 -91
- package/dist/components/CoreTracker/index.js +2 -4
- package/dist/components/CoreTranslate/CoreTranslate.js +17 -48
- package/dist/components/CoreTranslate/index.js +2 -4
- package/dist/components/CoreTranslateWrapper/CoreTranslateWrapper.js +7 -15
- package/dist/components/CoreTranslateWrapper/index.js +2 -4
- package/dist/components/CoreWidget/CoreWidget.js +81 -149
- package/dist/components/CoreWidget/index.js +2 -4
- package/dist/components/CoreWrapper/CoreWrapper.js +8 -16
- package/dist/components/CoreWrapper/index.js +2 -4
- package/dist/components/index.js +29 -58
- package/dist/constants/index.js +3 -6
- package/dist/constants/testOrganization.js +2 -3
- package/dist/constants/testToken.js +2 -3
- package/dist/context/Authentication/AuthenticationContext.js +3 -8
- package/dist/context/Authentication/AuthenticationProvider.js +156 -257
- package/dist/context/Authentication/index.js +4 -8
- package/dist/context/Authentication/withAuthentication.js +5 -14
- package/dist/context/Channels/ChannelsConsumer.js +14 -70
- package/dist/context/Channels/ChannelsContext.js +3 -8
- package/dist/context/Channels/ChannelsProvider.js +132 -278
- package/dist/context/Channels/DataChannel.js +39 -103
- package/dist/context/Channels/EntityChannel.js +40 -104
- package/dist/context/Channels/EveryoneChannel.js +32 -92
- package/dist/context/Channels/OrganizationChannel.js +40 -104
- package/dist/context/Channels/UserChannel.js +37 -99
- package/dist/context/Channels/index.js +10 -20
- package/dist/context/Channels/withChannels.js +5 -14
- package/dist/context/Core/CoreContext.js +3 -8
- package/dist/context/Core/CoreProvider.js +68 -132
- package/dist/context/Core/index.js +4 -8
- package/dist/context/Core/withCore.js +5 -14
- package/dist/context/Organization/OrganizationContext.js +3 -8
- package/dist/context/Organization/OrganizationProvider.js +48 -120
- package/dist/context/Organization/index.js +4 -8
- package/dist/context/Organization/withOrganization.js +5 -14
- package/dist/context/Plugin/PluginContext.js +3 -8
- package/dist/context/Plugin/PluginProvider.js +55 -112
- package/dist/context/Plugin/index.js +4 -8
- package/dist/context/Plugin/withPlugin.js +5 -14
- package/dist/context/index.js +5 -15
- package/dist/css/index.js +3 -6
- package/dist/functions/TagEvaluator.js +107 -156
- package/dist/functions/compareObjects.js +0 -7
- package/dist/functions/formatElapsedTime.js +5 -6
- package/dist/functions/formatNameFileSafe.js +3 -4
- package/dist/functions/getIconUrl.js +0 -3
- package/dist/functions/getParameterByName.js +9 -12
- package/dist/functions/getProperty.js +4 -8
- package/dist/functions/getUrl.js +0 -3
- package/dist/functions/index.js +9 -18
- package/dist/icons/CopyIcon.js +11 -22
- package/dist/icons/DeleteIcon.js +11 -22
- package/dist/icons/DuplicateIcon.js +11 -22
- package/dist/icons/EditIcon.js +11 -22
- package/dist/icons/FabAddIcon.js +19 -35
- package/dist/icons/PasteIcon.js +11 -22
- package/dist/icons/index.js +7 -14
- package/dist/index.js +6 -18
- package/package.json +89 -79
|
@@ -1,89 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
9
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
15
|
-
|
|
16
10
|
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
|
17
|
-
|
|
18
11
|
var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
|
|
19
|
-
|
|
20
12
|
var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));
|
|
21
|
-
|
|
22
13
|
var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));
|
|
23
|
-
|
|
24
14
|
var _FormControlLabel = _interopRequireDefault(require("@material-ui/core/FormControlLabel"));
|
|
25
|
-
|
|
26
15
|
var _Radio = _interopRequireDefault(require("@material-ui/core/Radio"));
|
|
27
|
-
|
|
28
16
|
var _RadioGroup = _interopRequireDefault(require("@material-ui/core/RadioGroup"));
|
|
29
|
-
|
|
30
17
|
var _Slide = _interopRequireDefault(require("@material-ui/core/Slide"));
|
|
31
|
-
|
|
32
18
|
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
33
|
-
|
|
34
19
|
var _ChangeHistory = _interopRequireDefault(require("@material-ui/icons/ChangeHistory"));
|
|
35
|
-
|
|
36
20
|
var _ArrowUpward = _interopRequireDefault(require("@material-ui/icons/ArrowUpward"));
|
|
37
|
-
|
|
38
21
|
var _ArrowDownward = _interopRequireDefault(require("@material-ui/icons/ArrowDownward"));
|
|
39
|
-
|
|
40
22
|
var _styles = require("@material-ui/core/styles");
|
|
41
|
-
|
|
42
23
|
var _reactIntl = require("react-intl");
|
|
43
|
-
|
|
44
24
|
var _CoreTable = _interopRequireDefault(require("../CoreTable"));
|
|
45
|
-
|
|
46
25
|
var _css = require("../../css");
|
|
47
|
-
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
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) { _defineProperty(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; }
|
|
57
|
-
|
|
58
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
59
|
-
|
|
60
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
61
|
-
|
|
62
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
63
|
-
|
|
64
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
65
|
-
|
|
66
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
67
|
-
|
|
68
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
69
|
-
|
|
70
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
71
|
-
|
|
72
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
73
|
-
|
|
74
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
75
|
-
|
|
26
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
28
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
|
+
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; }
|
|
30
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
32
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
33
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
34
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } // import DialogContentText from '@material-ui/core/DialogContentText';
|
|
76
35
|
function Transition(props) {
|
|
77
36
|
return /*#__PURE__*/_react.default.createElement(_Slide.default, _extends({
|
|
78
37
|
direction: "up"
|
|
79
38
|
}, props));
|
|
80
39
|
}
|
|
81
|
-
|
|
82
40
|
function buildActionMap(items) {
|
|
83
|
-
|
|
84
|
-
items.forEach(
|
|
85
|
-
|
|
86
|
-
|
|
41
|
+
const actionMap = new Map();
|
|
42
|
+
items.forEach(item => {
|
|
43
|
+
let action = 'ignore';
|
|
87
44
|
if (item.existing) {
|
|
88
45
|
if (item.existing.version && item.import.version) {
|
|
89
46
|
if (item.import.version > item.existing.version) {
|
|
@@ -93,43 +50,37 @@ function buildActionMap(items) {
|
|
|
93
50
|
} else {
|
|
94
51
|
action = 'add';
|
|
95
52
|
}
|
|
96
|
-
|
|
97
53
|
actionMap.set(item.id, action);
|
|
98
|
-
});
|
|
99
|
-
|
|
54
|
+
});
|
|
55
|
+
// console.log('actionMap.size', actionMap.size);
|
|
100
56
|
return actionMap;
|
|
101
57
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
|
|
58
|
+
const styles = () => ({
|
|
59
|
+
scrollViewer: {
|
|
60
|
+
maxHeight: 'calc(100vh - 100px)'
|
|
61
|
+
}
|
|
62
|
+
});
|
|
111
63
|
function CoreImportDialog(props) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
var handleRadioChange = function handleRadioChange(e) {
|
|
64
|
+
const {
|
|
65
|
+
classes,
|
|
66
|
+
intl,
|
|
67
|
+
items,
|
|
68
|
+
nameProperty
|
|
69
|
+
} = props;
|
|
70
|
+
// https://medium.com/swlh/using-es6-map-with-react-state-hooks-800b91eedd5f
|
|
71
|
+
const [actionMap, setActionMap] = (0, _react.useState)(buildActionMap(items));
|
|
72
|
+
const handleRadioChange = e => {
|
|
123
73
|
// console.log(`name: ${e.target.name}, value: ${e.target.value}`);
|
|
124
74
|
// const newActionMap = { ...actionMap };
|
|
125
75
|
// newActionMap.set(e.target.name, e.target.value);
|
|
126
76
|
// setActionMap(newActionMap);
|
|
127
77
|
setActionMap(new Map(actionMap.set(e.target.name, e.target.value)));
|
|
128
78
|
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
79
|
+
const customCellName = _ref => {
|
|
80
|
+
let {
|
|
81
|
+
row
|
|
82
|
+
} = _ref;
|
|
83
|
+
const nameChange = row.existing && row.existing[nameProperty] !== row.import[nameProperty];
|
|
133
84
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
134
85
|
style: {
|
|
135
86
|
display: 'flex',
|
|
@@ -144,6 +95,7 @@ function CoreImportDialog(props) {
|
|
|
144
95
|
color: "error"
|
|
145
96
|
})));
|
|
146
97
|
};
|
|
98
|
+
|
|
147
99
|
/* const customCellVersionChange = ({ row }) => {
|
|
148
100
|
if (row.import.version) {
|
|
149
101
|
if (row.existing && row.existing.version) {
|
|
@@ -177,19 +129,17 @@ function CoreImportDialog(props) {
|
|
|
177
129
|
return 'N/A';
|
|
178
130
|
}; */
|
|
179
131
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
132
|
+
const customCellDifferent = _ref2 => {
|
|
133
|
+
let {
|
|
134
|
+
row
|
|
135
|
+
} = _ref2;
|
|
184
136
|
if (row.existing) {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
137
|
+
let newerVersion = false;
|
|
138
|
+
let olderVersion = false;
|
|
188
139
|
if (row.existing.version && row.import.version) {
|
|
189
140
|
newerVersion = row.import.version > row.existing.version;
|
|
190
141
|
olderVersion = row.existing.version > row.import.version;
|
|
191
142
|
}
|
|
192
|
-
|
|
193
143
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
194
144
|
style: {
|
|
195
145
|
display: 'flex',
|
|
@@ -213,18 +163,17 @@ function CoreImportDialog(props) {
|
|
|
213
163
|
color: "error"
|
|
214
164
|
})));
|
|
215
165
|
}
|
|
216
|
-
|
|
217
166
|
return /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
218
167
|
title: "v".concat(row.import.version)
|
|
219
168
|
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, {
|
|
220
169
|
id: "__new"
|
|
221
170
|
}));
|
|
222
171
|
};
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
172
|
+
const customCellAction = _ref3 => {
|
|
173
|
+
let {
|
|
174
|
+
row
|
|
175
|
+
} = _ref3;
|
|
176
|
+
const action = actionMap && actionMap.has(row.id) ? actionMap.get(row.id) : 'ignore';
|
|
228
177
|
if (row.existing) {
|
|
229
178
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
230
179
|
style: {
|
|
@@ -258,7 +207,6 @@ function CoreImportDialog(props) {
|
|
|
258
207
|
})
|
|
259
208
|
})));
|
|
260
209
|
}
|
|
261
|
-
|
|
262
210
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
263
211
|
style: {
|
|
264
212
|
whiteSpace: 'nowrap'
|
|
@@ -285,120 +233,76 @@ function CoreImportDialog(props) {
|
|
|
285
233
|
})
|
|
286
234
|
})));
|
|
287
235
|
};
|
|
288
|
-
|
|
289
|
-
var handleSubmit = function handleSubmit() {
|
|
236
|
+
const handleSubmit = () => {
|
|
290
237
|
// const methodName = 'handleSubmit';
|
|
291
|
-
|
|
292
|
-
|
|
238
|
+
const addList = [];
|
|
239
|
+
const updateList = [];
|
|
293
240
|
/* eslint-disable-next-line no-restricted-syntax */
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
switch (value) {
|
|
311
|
-
case 'add':
|
|
312
|
-
addList.push(importObject.import);
|
|
313
|
-
break;
|
|
314
|
-
|
|
315
|
-
case 'update':
|
|
316
|
-
updateList.push(importObject.import);
|
|
317
|
-
break;
|
|
318
|
-
|
|
319
|
-
case 'duplicate':
|
|
320
|
-
{
|
|
321
|
-
var clonedObject = _objectSpread({}, importObject.import);
|
|
322
|
-
|
|
323
|
-
delete clonedObject.id;
|
|
324
|
-
addList.push(clonedObject);
|
|
325
|
-
break;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
default:
|
|
241
|
+
for (const [key, value] of actionMap) {
|
|
242
|
+
if (value !== 'ignore') {
|
|
243
|
+
const importObject = items.find(x => x.id === key);
|
|
244
|
+
if (importObject) {
|
|
245
|
+
switch (value) {
|
|
246
|
+
case 'add':
|
|
247
|
+
addList.push(importObject.import);
|
|
248
|
+
break;
|
|
249
|
+
case 'update':
|
|
250
|
+
updateList.push(importObject.import);
|
|
251
|
+
break;
|
|
252
|
+
case 'duplicate':
|
|
253
|
+
{
|
|
254
|
+
const clonedObject = _objectSpread({}, importObject.import);
|
|
255
|
+
delete clonedObject.id;
|
|
256
|
+
addList.push(clonedObject);
|
|
329
257
|
break;
|
|
330
|
-
|
|
331
|
-
|
|
258
|
+
}
|
|
259
|
+
default:
|
|
260
|
+
break;
|
|
332
261
|
}
|
|
262
|
+
} else {
|
|
263
|
+
// NOTE: This is an issue, can't find what was referenced, shouldn't happen
|
|
333
264
|
}
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
337
|
-
_loop();
|
|
338
265
|
}
|
|
339
|
-
} catch (err) {
|
|
340
|
-
_iterator.e(err);
|
|
341
|
-
} finally {
|
|
342
|
-
_iterator.f();
|
|
343
266
|
}
|
|
344
|
-
|
|
345
267
|
props.onImport(addList, updateList);
|
|
346
268
|
};
|
|
347
|
-
|
|
348
|
-
|
|
269
|
+
const columns = [
|
|
270
|
+
// { id: 'id', label: 'Id' },
|
|
349
271
|
{
|
|
350
272
|
id: 'name',
|
|
351
273
|
label: intl.formatMessage({
|
|
352
274
|
id: '__name'
|
|
353
275
|
}),
|
|
354
|
-
customCell:
|
|
355
|
-
return customCellName(cc);
|
|
356
|
-
}
|
|
276
|
+
customCell: cc => customCellName(cc)
|
|
357
277
|
}, {
|
|
358
278
|
id: 'different',
|
|
359
279
|
label: intl.formatMessage({
|
|
360
280
|
id: '__different'
|
|
361
281
|
}),
|
|
362
|
-
customCell:
|
|
363
|
-
return customCellDifferent(cc);
|
|
364
|
-
}
|
|
282
|
+
customCell: cc => customCellDifferent(cc)
|
|
365
283
|
}, {
|
|
366
284
|
id: 'actions',
|
|
367
285
|
style: {
|
|
368
286
|
textAlign: 'right'
|
|
369
287
|
},
|
|
370
|
-
customCell:
|
|
371
|
-
return customCellAction(cc);
|
|
372
|
-
}
|
|
288
|
+
customCell: cc => customCellAction(cc)
|
|
373
289
|
}];
|
|
290
|
+
|
|
374
291
|
/* {items.map(item => (
|
|
375
292
|
<DialogContentText key={item.id}>
|
|
376
293
|
{`${item.importName} (v${item.existingVersion} to v${item.importVersion})`}
|
|
377
294
|
</DialogContentText>
|
|
378
295
|
))} */
|
|
379
296
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
297
|
+
let importCount = 0;
|
|
298
|
+
const iterator1 = actionMap.values();
|
|
299
|
+
// NOTE: Not sure how to do this more efficiently...
|
|
383
300
|
/* eslint-disable-next-line no-restricted-syntax */
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
try {
|
|
389
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
390
|
-
var value = _step2.value;
|
|
391
|
-
|
|
392
|
-
if (value !== 'ignore') {
|
|
393
|
-
importCount++;
|
|
394
|
-
}
|
|
301
|
+
for (const value of iterator1) {
|
|
302
|
+
if (value !== 'ignore') {
|
|
303
|
+
importCount++;
|
|
395
304
|
}
|
|
396
|
-
} catch (err) {
|
|
397
|
-
_iterator2.e(err);
|
|
398
|
-
} finally {
|
|
399
|
-
_iterator2.f();
|
|
400
305
|
}
|
|
401
|
-
|
|
402
306
|
return /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
403
307
|
open: true,
|
|
404
308
|
TransitionComponent: Transition,
|
|
@@ -418,9 +322,7 @@ function CoreImportDialog(props) {
|
|
|
418
322
|
})), /*#__PURE__*/_react.default.createElement(_DialogActions.default, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
419
323
|
color: "primary",
|
|
420
324
|
disabled: importCount === 0,
|
|
421
|
-
onClick:
|
|
422
|
-
return handleSubmit();
|
|
423
|
-
}
|
|
325
|
+
onClick: () => handleSubmit()
|
|
424
326
|
}, "".concat(intl.formatMessage({
|
|
425
327
|
id: '__import'
|
|
426
328
|
}), " (").concat(importCount, ")")), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
@@ -430,24 +332,20 @@ function CoreImportDialog(props) {
|
|
|
430
332
|
id: "__cancel"
|
|
431
333
|
}))));
|
|
432
334
|
}
|
|
433
|
-
|
|
434
335
|
CoreImportDialog.propTypes = {
|
|
435
336
|
classes: _propTypes.default.shape().isRequired,
|
|
436
337
|
intl: _propTypes.default.shape().isRequired,
|
|
437
338
|
items: _propTypes.default.arrayOf(_propTypes.default.shape),
|
|
438
339
|
onClose: _propTypes.default.func.isRequired,
|
|
439
340
|
onImport: _propTypes.default.func.isRequired,
|
|
440
|
-
nameProperty: _propTypes.default.string
|
|
341
|
+
nameProperty: _propTypes.default.string
|
|
342
|
+
// showDifferent: PropTypes.bool,
|
|
441
343
|
// showVersionChange: PropTypes.bool,
|
|
442
|
-
|
|
443
344
|
};
|
|
444
345
|
CoreImportDialog.defaultProps = {
|
|
445
346
|
items: [],
|
|
446
|
-
nameProperty: 'name'
|
|
347
|
+
nameProperty: 'name'
|
|
348
|
+
// showDifferent: true,
|
|
447
349
|
// showVersionChange: true,
|
|
448
|
-
|
|
449
350
|
};
|
|
450
|
-
|
|
451
|
-
var _default = (0, _reactIntl.injectIntl)((0, _styles.withStyles)(styles)(CoreImportDialog));
|
|
452
|
-
|
|
453
|
-
exports.default = _default;
|
|
351
|
+
var _default = exports.default = (0, _reactIntl.injectIntl)((0, _styles.withStyles)(styles)(CoreImportDialog));
|
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _CoreImportDialog.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
var _CoreImportDialog = _interopRequireDefault(require("./CoreImportDialog"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -4,68 +4,49 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
13
|
-
|
|
14
10
|
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
|
15
|
-
|
|
16
11
|
var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
|
|
17
|
-
|
|
18
12
|
var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));
|
|
19
|
-
|
|
20
13
|
var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));
|
|
21
|
-
|
|
22
14
|
var _Slide = _interopRequireDefault(require("@material-ui/core/Slide"));
|
|
23
|
-
|
|
24
15
|
var _styles = require("@material-ui/core/styles");
|
|
25
|
-
|
|
26
16
|
var _reactIntl = require("react-intl");
|
|
27
|
-
|
|
28
17
|
var _CoreTable = _interopRequireDefault(require("../CoreTable"));
|
|
29
|
-
|
|
30
18
|
var _css = require("../../css");
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
35
|
-
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } // import DialogContentText from '@material-ui/core/DialogContentText';
|
|
36
21
|
function Transition(props) {
|
|
37
22
|
return /*#__PURE__*/_react.default.createElement(_Slide.default, _extends({
|
|
38
23
|
direction: "up"
|
|
39
24
|
}, props));
|
|
40
25
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
|
|
26
|
+
const styles = () => ({
|
|
27
|
+
scrollViewer: {
|
|
28
|
+
maxHeight: 'calc(100vh - 100px)'
|
|
29
|
+
}
|
|
30
|
+
});
|
|
50
31
|
function CoreImportResultsDialog(props) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
32
|
+
const {
|
|
33
|
+
classes,
|
|
34
|
+
intl,
|
|
35
|
+
results
|
|
36
|
+
} = props;
|
|
37
|
+
const customCellStatus = _ref => {
|
|
38
|
+
let {
|
|
39
|
+
row
|
|
40
|
+
} = _ref;
|
|
58
41
|
switch (row.statusCode) {
|
|
59
42
|
case 'added':
|
|
60
43
|
return /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, {
|
|
61
44
|
id: "__added"
|
|
62
45
|
});
|
|
63
|
-
|
|
64
46
|
case 'updated':
|
|
65
47
|
return /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, {
|
|
66
48
|
id: "__updated"
|
|
67
49
|
});
|
|
68
|
-
|
|
69
50
|
default:
|
|
70
51
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
71
52
|
style: {
|
|
@@ -74,8 +55,7 @@ function CoreImportResultsDialog(props) {
|
|
|
74
55
|
}, row.statusCode);
|
|
75
56
|
}
|
|
76
57
|
};
|
|
77
|
-
|
|
78
|
-
var columns = [{
|
|
58
|
+
const columns = [{
|
|
79
59
|
id: 'id',
|
|
80
60
|
label: 'Id'
|
|
81
61
|
}, {
|
|
@@ -88,9 +68,7 @@ function CoreImportResultsDialog(props) {
|
|
|
88
68
|
label: intl.formatMessage({
|
|
89
69
|
id: '__status'
|
|
90
70
|
}),
|
|
91
|
-
customCell:
|
|
92
|
-
return customCellStatus(cc);
|
|
93
|
-
}
|
|
71
|
+
customCell: cc => customCellStatus(cc)
|
|
94
72
|
}];
|
|
95
73
|
return /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
96
74
|
open: true,
|
|
@@ -113,7 +91,6 @@ function CoreImportResultsDialog(props) {
|
|
|
113
91
|
id: "__close"
|
|
114
92
|
}))));
|
|
115
93
|
}
|
|
116
|
-
|
|
117
94
|
CoreImportResultsDialog.propTypes = {
|
|
118
95
|
classes: _propTypes.default.shape().isRequired,
|
|
119
96
|
intl: _propTypes.default.shape().isRequired,
|
|
@@ -123,7 +100,4 @@ CoreImportResultsDialog.propTypes = {
|
|
|
123
100
|
CoreImportResultsDialog.defaultProps = {
|
|
124
101
|
results: []
|
|
125
102
|
};
|
|
126
|
-
|
|
127
|
-
var _default = (0, _reactIntl.injectIntl)((0, _styles.withStyles)(styles)(CoreImportResultsDialog));
|
|
128
|
-
|
|
129
|
-
exports.default = _default;
|
|
103
|
+
var _default = exports.default = (0, _reactIntl.injectIntl)((0, _styles.withStyles)(styles)(CoreImportResultsDialog));
|
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _CoreImportResultsDialog.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
var _CoreImportResultsDialog = _interopRequireDefault(require("./CoreImportResultsDialog"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|