versacall-core-library-react 2.0.66 → 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 +153 -268
- 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,128 +1,77 @@
|
|
|
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 _reactRouterDom = require("react-router-dom");
|
|
13
|
-
|
|
14
9
|
var _UnfoldMore = _interopRequireDefault(require("@material-ui/icons/UnfoldMore"));
|
|
15
|
-
|
|
16
10
|
var _UnfoldLess = _interopRequireDefault(require("@material-ui/icons/UnfoldLess"));
|
|
17
|
-
|
|
18
11
|
var _ListItemIcon = _interopRequireDefault(require("@material-ui/core/ListItemIcon"));
|
|
19
|
-
|
|
20
12
|
var _ListItemText = _interopRequireDefault(require("@material-ui/core/ListItemText"));
|
|
21
|
-
|
|
22
13
|
var _styles = require("@material-ui/core/styles");
|
|
23
|
-
|
|
24
14
|
var _ListItem = _interopRequireDefault(require("@material-ui/core/ListItem"));
|
|
25
|
-
|
|
26
15
|
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
27
|
-
|
|
28
16
|
var _Divider = _interopRequireDefault(require("@material-ui/core/Divider"));
|
|
29
|
-
|
|
30
17
|
var _Drawer = _interopRequireDefault(require("@material-ui/core/Drawer"));
|
|
31
|
-
|
|
32
18
|
var _reactIntl = require("react-intl");
|
|
33
|
-
|
|
34
19
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
35
|
-
|
|
36
20
|
var _Authentication = require("../../context/Authentication");
|
|
37
|
-
|
|
38
21
|
var _Organization = require("../../context/Organization");
|
|
39
|
-
|
|
40
22
|
var _Channels = require("../../context/Channels");
|
|
41
|
-
|
|
42
23
|
var _functions = require("../../functions");
|
|
43
|
-
|
|
44
24
|
var _Core = require("../../context/Core");
|
|
45
|
-
|
|
46
25
|
var _CoreFrame = _interopRequireDefault(require("../CoreFrame"));
|
|
47
|
-
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
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); }
|
|
69
|
-
|
|
70
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
71
|
-
|
|
72
|
-
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; } }
|
|
73
|
-
|
|
74
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
75
|
-
|
|
76
|
-
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; }
|
|
77
|
-
|
|
78
|
-
var namespace = 'CoreDrawer';
|
|
79
|
-
|
|
80
|
-
var styles = function styles(theme) {
|
|
81
|
-
return {
|
|
82
|
-
root: {
|
|
83
|
-
display: 'flex',
|
|
84
|
-
height: 'calc(100vh - 64px)',
|
|
85
|
-
overflow: 'hidden'
|
|
86
|
-
},
|
|
87
|
-
drawerPaper: {
|
|
88
|
-
position: 'relative',
|
|
89
|
-
whiteSpace: 'nowrap'
|
|
90
|
-
},
|
|
91
|
-
drawerPaperClose: _defineProperty({
|
|
92
|
-
position: 'relative',
|
|
93
|
-
overflowX: 'hidden',
|
|
94
|
-
width: theme.spacing.unit * 7
|
|
95
|
-
}, theme.breakpoints.up('sm'), {
|
|
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 _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); }
|
|
30
|
+
const namespace = 'CoreDrawer';
|
|
31
|
+
const styles = theme => ({
|
|
32
|
+
root: {
|
|
33
|
+
display: 'flex',
|
|
34
|
+
height: 'calc(100vh - 64px)',
|
|
35
|
+
overflow: 'hidden'
|
|
36
|
+
},
|
|
37
|
+
drawerPaper: {
|
|
38
|
+
position: 'relative',
|
|
39
|
+
whiteSpace: 'nowrap'
|
|
40
|
+
},
|
|
41
|
+
drawerPaperClose: {
|
|
42
|
+
position: 'relative',
|
|
43
|
+
overflowX: 'hidden',
|
|
44
|
+
width: theme.spacing.unit * 7,
|
|
45
|
+
[theme.breakpoints.up('sm')]: {
|
|
96
46
|
width: theme.spacing.unit * 9
|
|
97
|
-
}),
|
|
98
|
-
content: {
|
|
99
|
-
position: 'relative',
|
|
100
|
-
width: '100%'
|
|
101
|
-
},
|
|
102
|
-
icon: {
|
|
103
|
-
verticalAlign: 'middle',
|
|
104
|
-
height: 24,
|
|
105
|
-
width: 24
|
|
106
|
-
},
|
|
107
|
-
rotate: {
|
|
108
|
-
'-webkit-transform': 'rotate(90deg)',
|
|
109
|
-
'-moz-transform': 'rotate(90deg)',
|
|
110
|
-
'-ms-transform': 'rotate(90deg)',
|
|
111
|
-
'-o-transform': 'rotate(90deg)',
|
|
112
|
-
transform: 'rotate(90deg)'
|
|
113
|
-
},
|
|
114
|
-
dividerRootStart: {
|
|
115
|
-
height: 2
|
|
116
|
-
},
|
|
117
|
-
dividerRoot: {
|
|
118
|
-
height: 2,
|
|
119
|
-
marginTop: 8,
|
|
120
|
-
marginBottom: 8
|
|
121
47
|
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
48
|
+
},
|
|
49
|
+
content: {
|
|
50
|
+
position: 'relative',
|
|
51
|
+
width: '100%'
|
|
52
|
+
},
|
|
53
|
+
icon: {
|
|
54
|
+
verticalAlign: 'middle',
|
|
55
|
+
height: 24,
|
|
56
|
+
width: 24
|
|
57
|
+
},
|
|
58
|
+
rotate: {
|
|
59
|
+
'-webkit-transform': 'rotate(90deg)',
|
|
60
|
+
'-moz-transform': 'rotate(90deg)',
|
|
61
|
+
'-ms-transform': 'rotate(90deg)',
|
|
62
|
+
'-o-transform': 'rotate(90deg)',
|
|
63
|
+
transform: 'rotate(90deg)'
|
|
64
|
+
},
|
|
65
|
+
dividerRootStart: {
|
|
66
|
+
height: 2
|
|
67
|
+
},
|
|
68
|
+
dividerRoot: {
|
|
69
|
+
height: 2,
|
|
70
|
+
marginTop: 8,
|
|
71
|
+
marginBottom: 8
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
const style = {
|
|
126
75
|
navLink: {
|
|
127
76
|
textDecoration: 'none'
|
|
128
77
|
},
|
|
@@ -131,206 +80,142 @@ var style = {
|
|
|
131
80
|
pointerEvents: 'none'
|
|
132
81
|
}
|
|
133
82
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
var _super = _createSuper(CoreDrawer);
|
|
139
|
-
|
|
140
|
-
function CoreDrawer() {
|
|
141
|
-
var _this;
|
|
142
|
-
|
|
143
|
-
_classCallCheck(this, CoreDrawer);
|
|
144
|
-
|
|
145
|
-
_this = _super.call(this);
|
|
146
|
-
_this.state = {
|
|
83
|
+
class CoreDrawer extends _react.Component {
|
|
84
|
+
constructor() {
|
|
85
|
+
super();
|
|
86
|
+
this.state = {
|
|
147
87
|
apps: [],
|
|
148
88
|
drawerOpen: true
|
|
149
89
|
};
|
|
150
|
-
return _this;
|
|
151
90
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
91
|
+
componentDidMount() {
|
|
92
|
+
this.props.core.log('verbose', namespace, 'componentDidMount()', 'Start');
|
|
93
|
+
this.updateApps();
|
|
94
|
+
}
|
|
95
|
+
componentDidUpdate(prevProps) {
|
|
96
|
+
if (this.props.authentication.didChange(prevProps.authentication) || this.props.organization.didChange(prevProps.organization)) {
|
|
157
97
|
this.updateApps();
|
|
158
98
|
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
99
|
+
}
|
|
100
|
+
getTranslatedName(app) {
|
|
101
|
+
// Look at translation array to get the appropriate name for the component
|
|
102
|
+
const translation = app.translations.find(x => x.languageCode === this.props.intl.locale);
|
|
103
|
+
if (translation !== undefined) {
|
|
104
|
+
return translation.name;
|
|
165
105
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
if (translation !== undefined) {
|
|
177
|
-
return translation.name;
|
|
106
|
+
return app.name;
|
|
107
|
+
}
|
|
108
|
+
getAppVersion(routeProps) {
|
|
109
|
+
const path = routeProps.match.params.app;
|
|
110
|
+
if (path !== undefined) {
|
|
111
|
+
const component = this.state.apps.find(_component => (0, _functions.getUrl)(_component.metadata) === "/".concat(path));
|
|
112
|
+
if (component) {
|
|
113
|
+
return component.version;
|
|
178
114
|
}
|
|
179
|
-
|
|
180
|
-
return app.name;
|
|
181
115
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
handleClick() {
|
|
119
|
+
this.setState(prevState => ({
|
|
120
|
+
drawerOpen: !prevState.drawerOpen
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
updateApps() {
|
|
124
|
+
if (this.props.authentication.authenticated && this.props.organization.organization !== null && this.props.organization.entity !== null) {
|
|
125
|
+
this.props.authentication.http({
|
|
126
|
+
method: 'get',
|
|
127
|
+
url: "".concat(this.props.core.baseUrl, "/api/components"),
|
|
128
|
+
params: {
|
|
129
|
+
type: this.props.componentType,
|
|
130
|
+
organizationId: this.props.organization.organization.id,
|
|
131
|
+
entityId: this.props.organization.entity.id
|
|
194
132
|
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
133
|
+
}).then(res => {
|
|
134
|
+
this.props.core.log('debug', namespace, 'updateApps()', res.data);
|
|
135
|
+
if (res.data.length > 0 && window.location.hash === '#/') {
|
|
136
|
+
window.location.hash = "#".concat((0, _functions.getUrl)(res.data[0].metadata));
|
|
137
|
+
}
|
|
138
|
+
if (typeof this.props.updateComponentID === 'function') {
|
|
139
|
+
const component = res.data.find(_component => (0, _functions.getUrl)(_component.metadata) === window.location.hash.substr(1));
|
|
140
|
+
this.props.updateComponentID(component.componentID);
|
|
141
|
+
}
|
|
142
|
+
this.setState({
|
|
143
|
+
apps: res.data
|
|
144
|
+
});
|
|
206
145
|
});
|
|
207
146
|
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (this.props.authentication.authenticated && this.props.organization.organization !== null && this.props.organization.entity !== null) {
|
|
214
|
-
this.props.authentication.http({
|
|
215
|
-
method: 'get',
|
|
216
|
-
url: "".concat(this.props.core.baseUrl, "/api/components"),
|
|
217
|
-
params: {
|
|
218
|
-
type: this.props.componentType,
|
|
219
|
-
organizationId: this.props.organization.organization.id,
|
|
220
|
-
entityId: this.props.organization.entity.id
|
|
221
|
-
}
|
|
222
|
-
}).then(function (res) {
|
|
223
|
-
_this3.props.core.log('debug', namespace, 'updateApps()', res.data);
|
|
224
|
-
|
|
225
|
-
if (res.data.length > 0 && window.location.hash === '#/') {
|
|
226
|
-
window.location.hash = "#".concat((0, _functions.getUrl)(res.data[0].metadata));
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
if (typeof _this3.props.updateComponentID === 'function') {
|
|
230
|
-
var component = res.data.find(function (_component) {
|
|
231
|
-
return (0, _functions.getUrl)(_component.metadata) === window.location.hash.substr(1);
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
_this3.props.updateComponentID(component.componentID);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
_this3.setState({
|
|
238
|
-
apps: res.data
|
|
239
|
-
});
|
|
240
|
-
});
|
|
241
|
-
}
|
|
147
|
+
}
|
|
148
|
+
selectApp(app) {
|
|
149
|
+
if (typeof this.props.updateComponentID === 'function') {
|
|
150
|
+
this.props.updateComponentID(app.componentID);
|
|
242
151
|
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
if (
|
|
247
|
-
this.
|
|
152
|
+
}
|
|
153
|
+
processMessage(channel, obj) {
|
|
154
|
+
if (obj.what !== undefined) {
|
|
155
|
+
if (obj.what === 'package_enabled' || obj.what === 'package_disabled' || obj.what === 'package_added' || obj.what === 'package_updated' || obj.what === 'package_deleted') {
|
|
156
|
+
this.updateApps();
|
|
248
157
|
}
|
|
249
158
|
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
159
|
+
}
|
|
160
|
+
render() {
|
|
161
|
+
const {
|
|
162
|
+
sandbox,
|
|
163
|
+
classes
|
|
164
|
+
} = this.props;
|
|
165
|
+
const {
|
|
166
|
+
apps,
|
|
167
|
+
drawerOpen
|
|
168
|
+
} = this.state;
|
|
169
|
+
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.HashRouter, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
170
|
+
className: classes.root
|
|
171
|
+
}, /*#__PURE__*/_react.default.createElement(_Channels.ChannelsConsumer, {
|
|
172
|
+
id: "coredrawer",
|
|
173
|
+
handler: (channel, obj) => this.processMessage(channel, obj)
|
|
174
|
+
}), /*#__PURE__*/_react.default.createElement(_Drawer.default, {
|
|
175
|
+
variant: "permanent",
|
|
176
|
+
classes: {
|
|
177
|
+
paper: drawerOpen ? classes.drawerPaper : classes.drawerPaperClose
|
|
257
178
|
}
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
alt: "icon"
|
|
299
|
-
}))), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
300
|
-
primary: _this4.getTranslatedName(app)
|
|
301
|
-
})));
|
|
302
|
-
}), /*#__PURE__*/_react.default.createElement(_Divider.default, {
|
|
303
|
-
classes: {
|
|
304
|
-
root: apps.length > 0 ? classes.dividerRoot : classes.dividerRootStart
|
|
305
|
-
}
|
|
306
|
-
}), /*#__PURE__*/_react.default.createElement(_ListItem.default, {
|
|
307
|
-
onClick: function onClick() {
|
|
308
|
-
return _this4.handleClick();
|
|
309
|
-
},
|
|
310
|
-
button: true
|
|
311
|
-
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, drawerOpen ? /*#__PURE__*/_react.default.createElement(_UnfoldLess.default, {
|
|
312
|
-
className: classes.rotate
|
|
313
|
-
}) : /*#__PURE__*/_react.default.createElement(_UnfoldMore.default, {
|
|
314
|
-
className: classes.rotate
|
|
315
|
-
})), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
316
|
-
primary: "Collapse"
|
|
317
|
-
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
318
|
-
className: classes.content
|
|
319
|
-
}, this.props.children, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
320
|
-
path: "/:app*",
|
|
321
|
-
render: function render(routeProps) {
|
|
322
|
-
return /*#__PURE__*/_react.default.createElement(_CoreFrame.default, _extends({}, routeProps, {
|
|
323
|
-
sandbox: sandbox,
|
|
324
|
-
version: _this4.getAppVersion(routeProps)
|
|
325
|
-
}));
|
|
326
|
-
}
|
|
327
|
-
}))));
|
|
328
|
-
}
|
|
329
|
-
}]);
|
|
330
|
-
|
|
331
|
-
return CoreDrawer;
|
|
332
|
-
}(_react.Component);
|
|
333
|
-
|
|
179
|
+
}, apps.map(app => /*#__PURE__*/_react.default.createElement(_reactRouterDom.NavLink, {
|
|
180
|
+
to: (0, _functions.getUrl)(app.metadata),
|
|
181
|
+
key: app.componentID,
|
|
182
|
+
style: style.navLink,
|
|
183
|
+
activeStyle: style.activeStyle
|
|
184
|
+
}, /*#__PURE__*/_react.default.createElement(_ListItem.default, {
|
|
185
|
+
button: true,
|
|
186
|
+
onClick: () => this.selectApp(app)
|
|
187
|
+
}, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
188
|
+
title: this.getTranslatedName(app)
|
|
189
|
+
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
190
|
+
src: this.props.core.formatUrl((0, _functions.getIconUrl)(app.metadata)),
|
|
191
|
+
className: classes.icon,
|
|
192
|
+
alt: "icon"
|
|
193
|
+
}))), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
194
|
+
primary: this.getTranslatedName(app)
|
|
195
|
+
})))), /*#__PURE__*/_react.default.createElement(_Divider.default, {
|
|
196
|
+
classes: {
|
|
197
|
+
root: apps.length > 0 ? classes.dividerRoot : classes.dividerRootStart
|
|
198
|
+
}
|
|
199
|
+
}), /*#__PURE__*/_react.default.createElement(_ListItem.default, {
|
|
200
|
+
onClick: () => this.handleClick(),
|
|
201
|
+
button: true
|
|
202
|
+
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, drawerOpen ? /*#__PURE__*/_react.default.createElement(_UnfoldLess.default, {
|
|
203
|
+
className: classes.rotate
|
|
204
|
+
}) : /*#__PURE__*/_react.default.createElement(_UnfoldMore.default, {
|
|
205
|
+
className: classes.rotate
|
|
206
|
+
})), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
207
|
+
primary: "Collapse"
|
|
208
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
209
|
+
className: classes.content
|
|
210
|
+
}, this.props.children, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
211
|
+
path: "/:app*",
|
|
212
|
+
render: routeProps => /*#__PURE__*/_react.default.createElement(_CoreFrame.default, _extends({}, routeProps, {
|
|
213
|
+
sandbox: sandbox,
|
|
214
|
+
version: this.getAppVersion(routeProps)
|
|
215
|
+
}))
|
|
216
|
+
}))));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
334
219
|
CoreDrawer.propTypes = {
|
|
335
220
|
componentType: _propTypes.default.string.isRequired,
|
|
336
221
|
intl: _propTypes.default.shape({
|
|
@@ -349,7 +234,4 @@ CoreDrawer.defaultProps = {
|
|
|
349
234
|
sandbox: '',
|
|
350
235
|
children: null
|
|
351
236
|
};
|
|
352
|
-
|
|
353
|
-
var _default = (0, _reactIntl.injectIntl)((0, _Core.withCore)((0, _Authentication.withAuthentication)((0, _Organization.withOrganization)((0, _styles.withStyles)(styles)(CoreDrawer)))));
|
|
354
|
-
|
|
355
|
-
exports.default = _default;
|
|
237
|
+
var _default = exports.default = (0, _reactIntl.injectIntl)((0, _Core.withCore)((0, _Authentication.withAuthentication)((0, _Organization.withOrganization)((0, _styles.withStyles)(styles)(CoreDrawer)))));
|
|
@@ -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 _CoreDrawer.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
var _CoreDrawer = _interopRequireDefault(require("./CoreDrawer"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|