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,70 +1,29 @@
|
|
|
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 _ListItemIcon = _interopRequireDefault(require("@material-ui/core/ListItemIcon"));
|
|
13
|
-
|
|
14
9
|
var _ListItemText = _interopRequireDefault(require("@material-ui/core/ListItemText"));
|
|
15
|
-
|
|
16
10
|
var _reactIntl = require("react-intl");
|
|
17
|
-
|
|
18
11
|
var _ExpandMore = _interopRequireDefault(require("@material-ui/icons/ExpandMore"));
|
|
19
|
-
|
|
20
12
|
var _ExpandLess = _interopRequireDefault(require("@material-ui/icons/ExpandLess"));
|
|
21
|
-
|
|
22
13
|
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
23
|
-
|
|
24
14
|
var _ListItem = _interopRequireDefault(require("@material-ui/core/ListItem"));
|
|
25
|
-
|
|
26
15
|
var _Collapse = _interopRequireDefault(require("@material-ui/core/Collapse"));
|
|
27
|
-
|
|
28
16
|
var _Drawer = _interopRequireDefault(require("@material-ui/core/Drawer"));
|
|
29
|
-
|
|
30
17
|
var _List = _interopRequireDefault(require("@material-ui/core/List"));
|
|
31
|
-
|
|
32
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
33
|
-
|
|
34
19
|
var _jsCookie = _interopRequireDefault(require("js-cookie"));
|
|
35
|
-
|
|
36
20
|
var _functions = require("../../functions");
|
|
37
|
-
|
|
38
21
|
var _context = require("../../context");
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
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; }
|
|
45
|
-
|
|
46
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
47
|
-
|
|
48
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
49
|
-
|
|
50
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
51
|
-
|
|
52
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
53
|
-
|
|
54
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
55
|
-
|
|
56
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
57
|
-
|
|
58
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
59
|
-
|
|
60
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
61
|
-
|
|
62
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
63
|
-
|
|
64
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
65
|
-
|
|
66
|
-
var collapseCookie = 'vt4000_collapse';
|
|
67
|
-
var style = {
|
|
22
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
|
+
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); }
|
|
24
|
+
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; }
|
|
25
|
+
const collapseCookie = 'vt4000_collapse';
|
|
26
|
+
const style = {
|
|
68
27
|
icon: {
|
|
69
28
|
margin: 5,
|
|
70
29
|
height: 32,
|
|
@@ -78,130 +37,91 @@ var style = {
|
|
|
78
37
|
paddingLeft: 42
|
|
79
38
|
}
|
|
80
39
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
function CoreAppBarDrawer() {
|
|
88
|
-
var _this;
|
|
89
|
-
|
|
90
|
-
_classCallCheck(this, CoreAppBarDrawer);
|
|
91
|
-
|
|
92
|
-
_this = _super.call(this);
|
|
93
|
-
|
|
94
|
-
var cookie = _jsCookie.default.getJSON(collapseCookie);
|
|
95
|
-
|
|
96
|
-
_this.state = {
|
|
40
|
+
class CoreAppBarDrawer extends _react.Component {
|
|
41
|
+
constructor() {
|
|
42
|
+
super();
|
|
43
|
+
const cookie = _jsCookie.default.getJSON(collapseCookie);
|
|
44
|
+
this.state = {
|
|
97
45
|
expanded: cookie !== undefined ? cookie : []
|
|
98
46
|
};
|
|
99
|
-
return _this;
|
|
100
47
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
179
|
-
src: _this3.props.core.formatUrl((0, _functions.getIconUrl)(subApp.definition.metadata)),
|
|
180
|
-
style: style.icon,
|
|
181
|
-
alt: "algImg"
|
|
182
|
-
})), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
183
|
-
inset: true,
|
|
184
|
-
primary: _this3.getTranslatedName(subApp.definition)
|
|
185
|
-
}))));
|
|
186
|
-
})) : /*#__PURE__*/_react.default.createElement("a", {
|
|
187
|
-
style: style.a,
|
|
188
|
-
href: core.formatUrl((0, _functions.getUrl)(app.definition.metadata))
|
|
189
|
-
}, /*#__PURE__*/_react.default.createElement(_ListItem.default, {
|
|
190
|
-
button: true
|
|
191
|
-
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
192
|
-
src: _this3.props.core.formatUrl((0, _functions.getIconUrl)(app.definition.metadata)),
|
|
193
|
-
style: style.icon,
|
|
194
|
-
alt: "algImg"
|
|
195
|
-
})), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
196
|
-
primary: _this3.getTranslatedName(app.definition)
|
|
197
|
-
}))));
|
|
198
|
-
})));
|
|
199
|
-
}
|
|
200
|
-
}]);
|
|
201
|
-
|
|
202
|
-
return CoreAppBarDrawer;
|
|
203
|
-
}(_react.Component);
|
|
204
|
-
|
|
48
|
+
getTranslatedName(app) {
|
|
49
|
+
const translation = app.translations.find(x => x.languageCode === this.props.intl.locale);
|
|
50
|
+
return translation !== undefined ? translation.name : app.name;
|
|
51
|
+
}
|
|
52
|
+
handleClick(componentID) {
|
|
53
|
+
this.setState(prevState => {
|
|
54
|
+
let expanded = prevState.expanded;
|
|
55
|
+
if (expanded.includes(componentID)) {
|
|
56
|
+
expanded = expanded.filter(psExpanded => psExpanded !== componentID);
|
|
57
|
+
} else {
|
|
58
|
+
expanded.push(componentID);
|
|
59
|
+
}
|
|
60
|
+
_jsCookie.default.set(collapseCookie, expanded);
|
|
61
|
+
return {
|
|
62
|
+
expanded: expanded
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
const {
|
|
68
|
+
open,
|
|
69
|
+
apps,
|
|
70
|
+
core
|
|
71
|
+
} = this.props;
|
|
72
|
+
const {
|
|
73
|
+
expanded
|
|
74
|
+
} = this.state;
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_Drawer.default, {
|
|
76
|
+
open: open,
|
|
77
|
+
onClose: () => this.props.onClose()
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_List.default, null, /*#__PURE__*/_react.default.createElement(_ListItem.default, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
79
|
+
variant: "h5"
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, {
|
|
81
|
+
id: "__applications"
|
|
82
|
+
}))), apps.map(app => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
83
|
+
key: app.definition.componentID
|
|
84
|
+
}, app.children.length > 0 ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_ListItem.default, {
|
|
85
|
+
onClick: () => this.handleClick(app.definition.componentID),
|
|
86
|
+
button: true
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
88
|
+
src: this.props.core.formatUrl((0, _functions.getIconUrl)(app.definition.metadata)),
|
|
89
|
+
style: style.icon,
|
|
90
|
+
alt: "algImg"
|
|
91
|
+
})), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
92
|
+
primary: this.getTranslatedName(app.definition)
|
|
93
|
+
}), expanded.includes(app.definition.componentID) ? /*#__PURE__*/_react.default.createElement(_ExpandLess.default, null) : /*#__PURE__*/_react.default.createElement(_ExpandMore.default, null)), app.children.map(subApp => /*#__PURE__*/_react.default.createElement(_Collapse.default, {
|
|
94
|
+
timeout: "auto",
|
|
95
|
+
key: subApp.definition.componentID,
|
|
96
|
+
in: expanded.includes(app.definition.componentID),
|
|
97
|
+
unmountOnExit: true
|
|
98
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
99
|
+
style: style.a,
|
|
100
|
+
href: core.formatUrl("".concat((0, _functions.getUrl)(app.definition.metadata), "#").concat((0, _functions.getUrl)(subApp.definition.metadata)))
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement(_ListItem.default, {
|
|
102
|
+
style: style.nested,
|
|
103
|
+
button: true
|
|
104
|
+
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
105
|
+
src: this.props.core.formatUrl((0, _functions.getIconUrl)(subApp.definition.metadata)),
|
|
106
|
+
style: style.icon,
|
|
107
|
+
alt: "algImg"
|
|
108
|
+
})), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
109
|
+
inset: true,
|
|
110
|
+
primary: this.getTranslatedName(subApp.definition)
|
|
111
|
+
})))))) : /*#__PURE__*/_react.default.createElement("a", {
|
|
112
|
+
style: style.a,
|
|
113
|
+
href: core.formatUrl((0, _functions.getUrl)(app.definition.metadata))
|
|
114
|
+
}, /*#__PURE__*/_react.default.createElement(_ListItem.default, {
|
|
115
|
+
button: true
|
|
116
|
+
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
117
|
+
src: this.props.core.formatUrl((0, _functions.getIconUrl)(app.definition.metadata)),
|
|
118
|
+
style: style.icon,
|
|
119
|
+
alt: "algImg"
|
|
120
|
+
})), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
121
|
+
primary: this.getTranslatedName(app.definition)
|
|
122
|
+
})))))));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
205
125
|
CoreAppBarDrawer.propTypes = {
|
|
206
126
|
open: _propTypes.default.bool.isRequired,
|
|
207
127
|
onClose: _propTypes.default.func.isRequired,
|
|
@@ -212,7 +132,4 @@ CoreAppBarDrawer.propTypes = {
|
|
|
212
132
|
CoreAppBarDrawer.defaultProps = {
|
|
213
133
|
apps: []
|
|
214
134
|
};
|
|
215
|
-
|
|
216
|
-
var _default = (0, _context.withCore)((0, _reactIntl.injectIntl)(CoreAppBarDrawer));
|
|
217
|
-
|
|
218
|
-
exports.default = _default;
|
|
135
|
+
var _default = exports.default = (0, _context.withCore)((0, _reactIntl.injectIntl)(CoreAppBarDrawer));
|
|
@@ -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 _CoreAppBar.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
var _CoreAppBar = _interopRequireDefault(require("./CoreAppBar"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -4,54 +4,38 @@ 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 _reactRouterDom = require("react-router-dom");
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _styles = require("@material-ui/core/styles");
|
|
15
|
-
|
|
16
11
|
var _ListItem = _interopRequireDefault(require("@material-ui/core/ListItem"));
|
|
17
|
-
|
|
18
12
|
var _ListItemIcon = _interopRequireDefault(require("@material-ui/core/ListItemIcon"));
|
|
19
|
-
|
|
20
13
|
var _ListItemText = _interopRequireDefault(require("@material-ui/core/ListItemText"));
|
|
21
|
-
|
|
22
14
|
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
23
|
-
|
|
24
15
|
var _reactIntl = require("react-intl");
|
|
25
|
-
|
|
26
16
|
var _Core = require("../../context/Core");
|
|
27
|
-
|
|
28
17
|
var _functions = require("../../functions");
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
var style = {
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
const styles = () => ({
|
|
20
|
+
listItemRoot: {
|
|
21
|
+
color: '#ffffff'
|
|
22
|
+
},
|
|
23
|
+
activeListItem: {
|
|
24
|
+
color: '#55b7dc'
|
|
25
|
+
},
|
|
26
|
+
svgIcon: {
|
|
27
|
+
verticalAlign: 'middle',
|
|
28
|
+
height: 24,
|
|
29
|
+
width: 24,
|
|
30
|
+
filter: 'invert(1)'
|
|
31
|
+
},
|
|
32
|
+
activeStyle: {
|
|
33
|
+
backgroundColor: '#3f5c67',
|
|
34
|
+
color: '#55b7dc',
|
|
35
|
+
pointerEvents: 'none'
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const style = {
|
|
55
39
|
navLink: {
|
|
56
40
|
textDecoration: 'none',
|
|
57
41
|
color: '#ffffff'
|
|
@@ -62,29 +46,27 @@ var style = {
|
|
|
62
46
|
},
|
|
63
47
|
normalStyle: {}
|
|
64
48
|
};
|
|
65
|
-
|
|
66
49
|
function AppLink(props) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
50
|
+
const {
|
|
51
|
+
core,
|
|
52
|
+
classes,
|
|
53
|
+
app,
|
|
54
|
+
location,
|
|
55
|
+
intl
|
|
56
|
+
} = props;
|
|
57
|
+
|
|
58
|
+
// console.log(location);
|
|
72
59
|
// console.log(getUrl(app.metadata));
|
|
60
|
+
const active = location.pathname === (0, _functions.getUrl)(app.metadata);
|
|
73
61
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
var appName = app.name;
|
|
77
|
-
|
|
62
|
+
// Look at translation array to get the appropriate name for the component
|
|
63
|
+
let appName = app.name;
|
|
78
64
|
if (app.translations) {
|
|
79
|
-
|
|
80
|
-
return x.languageCode === intl.locale;
|
|
81
|
-
});
|
|
82
|
-
|
|
65
|
+
const translation = app.translations.find(x => x.languageCode === intl.locale);
|
|
83
66
|
if (translation !== undefined) {
|
|
84
67
|
appName = translation.name;
|
|
85
68
|
}
|
|
86
69
|
}
|
|
87
|
-
|
|
88
70
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
89
71
|
style: active ? style.activeStyle : style.normalStyle
|
|
90
72
|
}, /*#__PURE__*/_react.default.createElement(_reactRouterDom.NavLink, {
|
|
@@ -94,9 +76,7 @@ function AppLink(props) {
|
|
|
94
76
|
activeStyle: style.activeStyle
|
|
95
77
|
}, /*#__PURE__*/_react.default.createElement(_ListItem.default, {
|
|
96
78
|
button: true,
|
|
97
|
-
onClick:
|
|
98
|
-
return props.appSelected(app);
|
|
99
|
-
}
|
|
79
|
+
onClick: () => props.appSelected(app)
|
|
100
80
|
}, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
101
81
|
title: appName
|
|
102
82
|
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
@@ -110,7 +90,6 @@ function AppLink(props) {
|
|
|
110
90
|
primary: appName
|
|
111
91
|
}))));
|
|
112
92
|
}
|
|
113
|
-
|
|
114
93
|
AppLink.propTypes = {
|
|
115
94
|
intl: _propTypes.default.shape().isRequired,
|
|
116
95
|
core: _propTypes.default.shape().isRequired,
|
|
@@ -119,7 +98,4 @@ AppLink.propTypes = {
|
|
|
119
98
|
app: _propTypes.default.shape().isRequired,
|
|
120
99
|
appSelected: _propTypes.default.func.isRequired
|
|
121
100
|
};
|
|
122
|
-
|
|
123
|
-
var _default = (0, _reactIntl.injectIntl)((0, _reactRouterDom.withRouter)((0, _Core.withCore)((0, _styles.withStyles)(styles)(AppLink))));
|
|
124
|
-
|
|
125
|
-
exports.default = _default;
|
|
101
|
+
var _default = exports.default = (0, _reactIntl.injectIntl)((0, _reactRouterDom.withRouter)((0, _Core.withCore)((0, _styles.withStyles)(styles)(AppLink))));
|