versacall-core-library-react 2.0.68 → 2.0.70
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/package.json +1 -1
- package/dist/components/CoreAlert/CoreAlert.js +0 -86
- package/dist/components/CoreAlert/index.js +0 -13
- package/dist/components/CoreAlert/readme.md +0 -21
- package/dist/components/CoreAppBar/CoreAppBar.js +0 -365
- package/dist/components/CoreAppBar/CoreAppBarDrawer.js +0 -135
- package/dist/components/CoreAppBar/README.md +0 -27
- package/dist/components/CoreAppBar/index.js +0 -13
- package/dist/components/CoreAppBar/screenshot.png +0 -0
- package/dist/components/CoreAppSelector/AppLink.js +0 -101
- package/dist/components/CoreAppSelector/CoreAppSelector.js +0 -156
- package/dist/components/CoreAppSelector/index.js +0 -13
- package/dist/components/CoreDialogueToolBar/CoreDialogueToolBar.js +0 -123
- package/dist/components/CoreDialogueToolBar/index.js +0 -13
- package/dist/components/CoreDrawer/CoreDrawer.js +0 -237
- package/dist/components/CoreDrawer/README.md +0 -36
- package/dist/components/CoreDrawer/index.js +0 -13
- package/dist/components/CoreDrawer/screenshot_collapsed.png +0 -0
- package/dist/components/CoreDrawer/screenshot_expanded.png +0 -0
- package/dist/components/CoreDropDownTextfield/CoreDropDownTextfield.js +0 -86
- package/dist/components/CoreDropDownTextfield/index.js +0 -13
- package/dist/components/CoreElapsedTime/CoreElapsedTime.js +0 -58
- package/dist/components/CoreElapsedTime/index.js +0 -13
- package/dist/components/CoreFrame/CoreFrame.js +0 -64
- package/dist/components/CoreFrame/index.js +0 -13
- package/dist/components/CoreImportDialog/CoreImportDialog.js +0 -351
- package/dist/components/CoreImportDialog/index.js +0 -13
- package/dist/components/CoreImportResultsDialog/CoreImportResultsDialog.js +0 -103
- package/dist/components/CoreImportResultsDialog/index.js +0 -13
- package/dist/components/CoreImporting/CoreImporting.js +0 -60
- package/dist/components/CoreImporting/index.js +0 -13
- package/dist/components/CorePlugin/CorePlugin.js +0 -135
- package/dist/components/CorePlugin/OldCorePlugin.js +0 -125
- package/dist/components/CorePlugin/index.js +0 -13
- package/dist/components/CoreSaveChangesDialog/CoreSaveChangesDialog.js +0 -62
- package/dist/components/CoreSaveChangesDialog/index.js +0 -13
- package/dist/components/CoreShiftTagFilter/CoreShiftTagFilter.js +0 -351
- package/dist/components/CoreShiftTagFilter/OldCoreShiftTagFilter.js +0 -209
- package/dist/components/CoreShiftTagFilter/index.js +0 -13
- package/dist/components/CoreSideBar/CoreSideBar.js +0 -738
- package/dist/components/CoreSideBar/CoreSideBarDrawer.js +0 -173
- package/dist/components/CoreSideBar/index.js +0 -13
- package/dist/components/CoreSnackBar/CoreSnackBar.js +0 -117
- package/dist/components/CoreSnackBar/index.js +0 -13
- package/dist/components/CoreSnackBar/readme.md +0 -23
- package/dist/components/CoreTable/CoreTable.js +0 -316
- package/dist/components/CoreTable/CoreTableChips.js +0 -50
- package/dist/components/CoreTable/CoreTableHead.js +0 -176
- package/dist/components/CoreTable/CoreTableToolbar.js +0 -108
- package/dist/components/CoreTable/index.js +0 -13
- package/dist/components/CoreTable/readMe.md +0 -79
- package/dist/components/CoreTagFilter/CoreTagFilter.js +0 -276
- package/dist/components/CoreTagFilter/OldCoreTagFilter.js +0 -342
- package/dist/components/CoreTagFilter/OldTagChip.js +0 -44
- package/dist/components/CoreTagFilter/OldTagFilterSelector.js +0 -106
- package/dist/components/CoreTagFilter/OldTagOption.js +0 -53
- package/dist/components/CoreTagFilter/TagFilterBuilder.js +0 -488
- package/dist/components/CoreTagFilter/index.js +0 -13
- package/dist/components/CoreTextField/CoreTextField.js +0 -110
- package/dist/components/CoreTextField/index.js +0 -13
- package/dist/components/CoreTheme/CoreTheme.css +0 -9
- package/dist/components/CoreTheme/CoreTheme.js +0 -51
- package/dist/components/CoreTheme/README.md +0 -3
- package/dist/components/CoreTheme/index.js +0 -13
- package/dist/components/CoreTile/CoreTile.js +0 -62
- package/dist/components/CoreTile/CoreTileToolbar.js +0 -62
- package/dist/components/CoreTile/index.js +0 -13
- package/dist/components/CoreTimerInput/CoreTimerInput.js +0 -203
- package/dist/components/CoreTimerInput/CoreTimerInputOld.js +0 -146
- package/dist/components/CoreTimerInput/index.js +0 -13
- package/dist/components/CoreToolbar/CoreToolbar.js +0 -206
- package/dist/components/CoreToolbar/index.js +0 -13
- package/dist/components/CoreTracker/CoreTracker.js +0 -53
- package/dist/components/CoreTracker/index.js +0 -13
- package/dist/components/CoreTranslate/CoreTranslate.js +0 -62
- package/dist/components/CoreTranslate/README.md +0 -5
- package/dist/components/CoreTranslate/index.js +0 -13
- package/dist/components/CoreTranslate/translations/en.json +0 -451
- package/dist/components/CoreTranslate/translations/es.json +0 -433
- package/dist/components/CoreTranslateWrapper/CoreTranslateWrapper.js +0 -36
- package/dist/components/CoreTranslateWrapper/index.js +0 -13
- package/dist/components/CoreWidget/CoreWidget.js +0 -121
- package/dist/components/CoreWidget/index.js +0 -13
- package/dist/components/CoreWrapper/CoreWrapper.js +0 -51
- package/dist/components/CoreWrapper/README.md +0 -41
- package/dist/components/CoreWrapper/index.js +0 -13
- package/dist/components/index.js +0 -202
- package/dist/constants/index.js +0 -20
- package/dist/constants/testOrganization.js +0 -31
- package/dist/constants/testToken.js +0 -33
- package/dist/context/Authentication/AuthenticationContext.js +0 -10
- package/dist/context/Authentication/AuthenticationProvider.js +0 -226
- package/dist/context/Authentication/README.md +0 -47
- package/dist/context/Authentication/index.js +0 -27
- package/dist/context/Authentication/withAuthentication.js +0 -15
- package/dist/context/Channels/ChannelsConsumer.js +0 -43
- package/dist/context/Channels/ChannelsContext.js +0 -10
- package/dist/context/Channels/ChannelsProvider.js +0 -259
- package/dist/context/Channels/DataChannel.js +0 -68
- package/dist/context/Channels/EntityChannel.js +0 -69
- package/dist/context/Channels/EveryoneChannel.js +0 -55
- package/dist/context/Channels/OrganizationChannel.js +0 -69
- package/dist/context/Channels/README.md +0 -52
- package/dist/context/Channels/UserChannel.js +0 -60
- package/dist/context/Channels/index.js +0 -69
- package/dist/context/Channels/withChannels.js +0 -15
- package/dist/context/Core/CoreContext.js +0 -10
- package/dist/context/Core/CoreProvider.js +0 -108
- package/dist/context/Core/README.md +0 -43
- package/dist/context/Core/index.js +0 -27
- package/dist/context/Core/withCore.js +0 -15
- package/dist/context/Organization/OrganizationContext.js +0 -10
- package/dist/context/Organization/OrganizationProvider.js +0 -80
- package/dist/context/Organization/README.md +0 -82
- package/dist/context/Organization/index.js +0 -27
- package/dist/context/Organization/withOrganization.js +0 -15
- package/dist/context/Plugin/PluginContext.js +0 -10
- package/dist/context/Plugin/PluginProvider.js +0 -79
- package/dist/context/Plugin/index.js +0 -27
- package/dist/context/Plugin/withPlugin.js +0 -15
- package/dist/context/index.js +0 -60
- package/dist/css/index.js +0 -20
- package/dist/css/junk.module.css +0 -3
- package/dist/css/scrollbar.css +0 -35
- package/dist/css/scrollbar.module.css +0 -37
- package/dist/functions/TagEvaluator.js +0 -165
- package/dist/functions/compareObjects.js +0 -27
- package/dist/functions/formatElapsedTime.js +0 -18
- package/dist/functions/formatNameFileSafe.js +0 -16
- package/dist/functions/getIconUrl.js +0 -15
- package/dist/functions/getParameterByName.js +0 -34
- package/dist/functions/getProperty.js +0 -17
- package/dist/functions/getUrl.js +0 -15
- package/dist/functions/index.js +0 -62
- package/dist/icons/CopyIcon.js +0 -42
- package/dist/icons/DeleteIcon.js +0 -42
- package/dist/icons/DuplicateIcon.js +0 -42
- package/dist/icons/EditIcon.js +0 -42
- package/dist/icons/FabAddIcon.js +0 -78
- package/dist/icons/PasteIcon.js +0 -42
- package/dist/icons/index.js +0 -48
- package/dist/index.js +0 -71
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _reactRouterDom = require("react-router-dom");
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var _styles = require("@material-ui/core/styles");
|
|
11
|
-
var _ListItem = _interopRequireDefault(require("@material-ui/core/ListItem"));
|
|
12
|
-
var _ListItemIcon = _interopRequireDefault(require("@material-ui/core/ListItemIcon"));
|
|
13
|
-
var _ListItemText = _interopRequireDefault(require("@material-ui/core/ListItemText"));
|
|
14
|
-
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
15
|
-
var _reactIntl = require("react-intl");
|
|
16
|
-
var _Core = require("../../context/Core");
|
|
17
|
-
var _functions = require("../../functions");
|
|
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 = {
|
|
39
|
-
navLink: {
|
|
40
|
-
textDecoration: 'none',
|
|
41
|
-
color: '#ffffff'
|
|
42
|
-
},
|
|
43
|
-
activeStyle: {
|
|
44
|
-
backgroundColor: '#3f5c67',
|
|
45
|
-
pointerEvents: 'none'
|
|
46
|
-
},
|
|
47
|
-
normalStyle: {}
|
|
48
|
-
};
|
|
49
|
-
function AppLink(props) {
|
|
50
|
-
const {
|
|
51
|
-
core,
|
|
52
|
-
classes,
|
|
53
|
-
app,
|
|
54
|
-
location,
|
|
55
|
-
intl
|
|
56
|
-
} = props;
|
|
57
|
-
|
|
58
|
-
// console.log(location);
|
|
59
|
-
// console.log(getUrl(app.metadata));
|
|
60
|
-
const active = location.pathname === (0, _functions.getUrl)(app.metadata);
|
|
61
|
-
|
|
62
|
-
// Look at translation array to get the appropriate name for the component
|
|
63
|
-
let appName = app.name;
|
|
64
|
-
if (app.translations) {
|
|
65
|
-
const translation = app.translations.find(x => x.languageCode === intl.locale);
|
|
66
|
-
if (translation !== undefined) {
|
|
67
|
-
appName = translation.name;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
-
style: active ? style.activeStyle : style.normalStyle
|
|
72
|
-
}, /*#__PURE__*/_react.default.createElement(_reactRouterDom.NavLink, {
|
|
73
|
-
to: (0, _functions.getUrl)(app.metadata),
|
|
74
|
-
key: app.componentID,
|
|
75
|
-
style: style.navLink,
|
|
76
|
-
activeStyle: style.activeStyle
|
|
77
|
-
}, /*#__PURE__*/_react.default.createElement(_ListItem.default, {
|
|
78
|
-
button: true,
|
|
79
|
-
onClick: () => props.appSelected(app)
|
|
80
|
-
}, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
81
|
-
title: appName
|
|
82
|
-
}, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
83
|
-
src: core.formatUrl((0, _functions.getIconUrl)(app.metadata)),
|
|
84
|
-
className: classes.svgIcon,
|
|
85
|
-
alt: "icon"
|
|
86
|
-
}))), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
87
|
-
classes: {
|
|
88
|
-
primary: classes.listItemRoot
|
|
89
|
-
},
|
|
90
|
-
primary: appName
|
|
91
|
-
}))));
|
|
92
|
-
}
|
|
93
|
-
AppLink.propTypes = {
|
|
94
|
-
intl: _propTypes.default.shape().isRequired,
|
|
95
|
-
core: _propTypes.default.shape().isRequired,
|
|
96
|
-
location: _propTypes.default.shape().isRequired,
|
|
97
|
-
classes: _propTypes.default.shape().isRequired,
|
|
98
|
-
app: _propTypes.default.shape().isRequired,
|
|
99
|
-
appSelected: _propTypes.default.func.isRequired
|
|
100
|
-
};
|
|
101
|
-
var _default = exports.default = (0, _reactIntl.injectIntl)((0, _reactRouterDom.withRouter)((0, _Core.withCore)((0, _styles.withStyles)(styles)(AppLink))));
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _reactRouterDom = require("react-router-dom");
|
|
10
|
-
var _Core = require("../../context/Core");
|
|
11
|
-
var _Authentication = require("../../context/Authentication");
|
|
12
|
-
var _Organization = require("../../context/Organization");
|
|
13
|
-
var _Channels = require("../../context/Channels");
|
|
14
|
-
var _CoreSideBar = _interopRequireDefault(require("../CoreSideBar"));
|
|
15
|
-
var _CoreFrame = _interopRequireDefault(require("../CoreFrame"));
|
|
16
|
-
var _AppLink = _interopRequireDefault(require("./AppLink"));
|
|
17
|
-
var _functions = require("../../functions");
|
|
18
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
-
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); }
|
|
20
|
-
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; }
|
|
21
|
-
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 { CoreSideBar, CoreFrame } from '..';
|
|
22
|
-
const namespace = 'CoreAppSelector';
|
|
23
|
-
class CoreAppSelector extends _react.Component {
|
|
24
|
-
constructor(props) {
|
|
25
|
-
super(props);
|
|
26
|
-
this.state = {
|
|
27
|
-
apps: []
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
componentDidMount() {
|
|
31
|
-
this.props.core.log('verbose', namespace, 'componentDidMount()', 'Start');
|
|
32
|
-
this.updateApps();
|
|
33
|
-
}
|
|
34
|
-
componentDidUpdate(prevProps) {
|
|
35
|
-
if (this.props.authentication.didChange(prevProps.authentication) || this.props.organization.didChange(prevProps.organization)) {
|
|
36
|
-
this.updateApps();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
getAppVersion(routeProps) {
|
|
40
|
-
const path = routeProps.match.params.app;
|
|
41
|
-
if (path !== undefined) {
|
|
42
|
-
const component = this.state.apps.find(_component => (0, _functions.getUrl)(_component.metadata) === "/".concat(path));
|
|
43
|
-
if (component) {
|
|
44
|
-
return component.version;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
selectApp(app) {
|
|
50
|
-
if (typeof this.props.updateComponentID === 'function') {
|
|
51
|
-
this.props.updateComponentID(app.componentID);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
updateApps() {
|
|
55
|
-
if (this.props.authentication.authenticated && this.props.organization.organization !== null && this.props.organization.entity !== null) {
|
|
56
|
-
this.props.authentication.http({
|
|
57
|
-
method: 'get',
|
|
58
|
-
url: "".concat(this.props.core.baseUrl, "/api/components"),
|
|
59
|
-
params: {
|
|
60
|
-
type: this.props.componentType,
|
|
61
|
-
organizationId: this.props.organization.organization.id,
|
|
62
|
-
entityId: this.props.organization.entity.id
|
|
63
|
-
}
|
|
64
|
-
}).then(res => {
|
|
65
|
-
this.props.core.log('debug', namespace, 'updateApps()', res.data);
|
|
66
|
-
if (res.data.length > 0 && window.location.hash === '#/') {
|
|
67
|
-
window.location.hash = "#".concat((0, _functions.getUrl)(res.data[0].metadata));
|
|
68
|
-
}
|
|
69
|
-
if (typeof this.props.updateComponentID === 'function') {
|
|
70
|
-
const component = res.data.find(_component => (0, _functions.getUrl)(_component.metadata) === window.location.hash.substr(1));
|
|
71
|
-
if (component) {
|
|
72
|
-
this.props.updateComponentID(component.componentID);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
this.setState({
|
|
76
|
-
apps: res.data
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
processMessage(channel, obj) {
|
|
82
|
-
if (obj.what !== undefined) {
|
|
83
|
-
if (obj.what === 'package_enabled' || obj.what === 'package_disabled' || obj.what === 'package_added' || obj.what === 'package_updated' || obj.what === 'package_deleted') {
|
|
84
|
-
this.updateApps();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/* <NavLink
|
|
90
|
-
to={getUrl(app.metadata)}
|
|
91
|
-
key={app.componentID}
|
|
92
|
-
style={style.navLink}
|
|
93
|
-
activeStyle={style.activeStyle}
|
|
94
|
-
>
|
|
95
|
-
<ListItem
|
|
96
|
-
button
|
|
97
|
-
onClick={() => this.selectApp(app)}
|
|
98
|
-
>
|
|
99
|
-
<Tooltip title={this.getTranslatedName(app)}>
|
|
100
|
-
<ListItemIcon>
|
|
101
|
-
<img src={this.props.core.formatUrl(getIconUrl(app.metadata))} className={classes.svgIcon} alt="icon" />
|
|
102
|
-
</ListItemIcon>
|
|
103
|
-
</Tooltip>
|
|
104
|
-
<ListItemText classes={{ primary: classes.listItemRoot }} primary={this.getTranslatedName(app)} />
|
|
105
|
-
</ListItem>
|
|
106
|
-
</NavLink> */
|
|
107
|
-
|
|
108
|
-
render() {
|
|
109
|
-
const {
|
|
110
|
-
title,
|
|
111
|
-
componentID,
|
|
112
|
-
sandbox
|
|
113
|
-
} = this.props;
|
|
114
|
-
const {
|
|
115
|
-
apps
|
|
116
|
-
} = this.state;
|
|
117
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Channels.ChannelsConsumer, {
|
|
118
|
-
id: "coreappselector",
|
|
119
|
-
handler: (channel, obj) => this.processMessage(channel, obj)
|
|
120
|
-
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.HashRouter, null, /*#__PURE__*/_react.default.createElement(_CoreSideBar.default, {
|
|
121
|
-
title: title,
|
|
122
|
-
componentID: componentID,
|
|
123
|
-
showEntity: true,
|
|
124
|
-
apps: apps,
|
|
125
|
-
updateComponentID: id => this.props.updateComponentID(id),
|
|
126
|
-
content: apps.map(app => /*#__PURE__*/_react.default.createElement(_AppLink.default, {
|
|
127
|
-
key: app.componentID,
|
|
128
|
-
app: app,
|
|
129
|
-
appSelected: () => this.selectApp(app)
|
|
130
|
-
}))
|
|
131
|
-
}, this.props.children, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
132
|
-
path: "/:app*",
|
|
133
|
-
render: routeProps => /*#__PURE__*/_react.default.createElement(_CoreFrame.default, _extends({}, routeProps, {
|
|
134
|
-
sandbox: sandbox,
|
|
135
|
-
version: this.getAppVersion(routeProps)
|
|
136
|
-
}))
|
|
137
|
-
}))));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
CoreAppSelector.propTypes = {
|
|
141
|
-
title: _propTypes.default.string.isRequired,
|
|
142
|
-
componentID: _propTypes.default.string.isRequired,
|
|
143
|
-
componentType: _propTypes.default.string.isRequired,
|
|
144
|
-
sandbox: _propTypes.default.string,
|
|
145
|
-
updateComponentID: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.bool]),
|
|
146
|
-
core: _propTypes.default.shape().isRequired,
|
|
147
|
-
authentication: _propTypes.default.shape().isRequired,
|
|
148
|
-
organization: _propTypes.default.shape().isRequired,
|
|
149
|
-
children: _propTypes.default.node
|
|
150
|
-
};
|
|
151
|
-
CoreAppSelector.defaultProps = {
|
|
152
|
-
sandbox: '',
|
|
153
|
-
updateComponentID: false,
|
|
154
|
-
children: null
|
|
155
|
-
};
|
|
156
|
-
var _default = exports.default = (0, _Core.withCore)((0, _Authentication.withAuthentication)((0, _Organization.withOrganization)(CoreAppSelector)));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _CoreAppSelector.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _CoreAppSelector = _interopRequireDefault(require("./CoreAppSelector"));
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _styles = require("@material-ui/core/styles");
|
|
9
|
-
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
10
|
-
var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
|
|
11
|
-
var _Print = _interopRequireDefault(require("@material-ui/icons/Print"));
|
|
12
|
-
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
13
|
-
var _Toolbar = _interopRequireDefault(require("@material-ui/core/Toolbar"));
|
|
14
|
-
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
15
|
-
var _Save = _interopRequireDefault(require("@material-ui/icons/Save"));
|
|
16
|
-
var _AppBar = _interopRequireDefault(require("@material-ui/core/AppBar"));
|
|
17
|
-
var _Badge = _interopRequireDefault(require("@material-ui/core/Badge"));
|
|
18
|
-
var _reactIntl = require("react-intl");
|
|
19
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
20
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
|
-
const styles = theme => ({
|
|
22
|
-
fab: {
|
|
23
|
-
margin: 0,
|
|
24
|
-
top: 'auto',
|
|
25
|
-
right: 20,
|
|
26
|
-
bottom: 20,
|
|
27
|
-
left: 'auto',
|
|
28
|
-
position: 'fixed'
|
|
29
|
-
},
|
|
30
|
-
appBar: {
|
|
31
|
-
position: 'relative'
|
|
32
|
-
},
|
|
33
|
-
flex: {
|
|
34
|
-
flex: 1
|
|
35
|
-
},
|
|
36
|
-
root: {
|
|
37
|
-
flexGrow: 1
|
|
38
|
-
},
|
|
39
|
-
separator: {
|
|
40
|
-
display: 'inline',
|
|
41
|
-
width: 2,
|
|
42
|
-
height: 36,
|
|
43
|
-
background: '#0086b3',
|
|
44
|
-
margin: 7
|
|
45
|
-
},
|
|
46
|
-
paper: {
|
|
47
|
-
margin: '10px 10px 10px 10px',
|
|
48
|
-
padding: theme.spacing.unit * 2,
|
|
49
|
-
textAlign: 'center',
|
|
50
|
-
color: theme.palette.text.secondary
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
function CoreDialogueToolBar(props) {
|
|
54
|
-
const {
|
|
55
|
-
title,
|
|
56
|
-
warning,
|
|
57
|
-
intl,
|
|
58
|
-
classes
|
|
59
|
-
} = props;
|
|
60
|
-
return /*#__PURE__*/_react.default.createElement(_AppBar.default, {
|
|
61
|
-
className: classes.appBar,
|
|
62
|
-
color: "secondary"
|
|
63
|
-
}, /*#__PURE__*/_react.default.createElement(_Toolbar.default, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
64
|
-
variant: "h6",
|
|
65
|
-
color: "inherit",
|
|
66
|
-
className: classes.flex
|
|
67
|
-
}, title), props.children, props.handlePrint && /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
68
|
-
title: intl.formatMessage({
|
|
69
|
-
id: '__print'
|
|
70
|
-
})
|
|
71
|
-
}, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
72
|
-
color: "inherit",
|
|
73
|
-
"aria-label": intl.formatMessage({
|
|
74
|
-
id: '__print'
|
|
75
|
-
}),
|
|
76
|
-
onClick: () => props.handlePrint()
|
|
77
|
-
}, /*#__PURE__*/_react.default.createElement(_Print.default, null))), (props.handlePrint || props.children) && /*#__PURE__*/_react.default.createElement("div", {
|
|
78
|
-
className: classes.separator
|
|
79
|
-
}), props.handleSave && /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
80
|
-
title: intl.formatMessage({
|
|
81
|
-
id: '__save'
|
|
82
|
-
})
|
|
83
|
-
}, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
84
|
-
color: "inherit",
|
|
85
|
-
"aria-label": intl.formatMessage({
|
|
86
|
-
id: '__save'
|
|
87
|
-
}),
|
|
88
|
-
onClick: () => props.handleSave()
|
|
89
|
-
}, /*#__PURE__*/_react.default.createElement(_Badge.default, {
|
|
90
|
-
badgeContent: "!",
|
|
91
|
-
color: "error",
|
|
92
|
-
invisible: !warning
|
|
93
|
-
}, /*#__PURE__*/_react.default.createElement(_Save.default, null)))), props.handleClose && /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
94
|
-
title: intl.formatMessage({
|
|
95
|
-
id: '__close'
|
|
96
|
-
})
|
|
97
|
-
}, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
98
|
-
color: "inherit",
|
|
99
|
-
"aria-label": intl.formatMessage({
|
|
100
|
-
id: '__close'
|
|
101
|
-
}),
|
|
102
|
-
onClick: () => props.handleClose()
|
|
103
|
-
}, /*#__PURE__*/_react.default.createElement(_Close.default, null)))));
|
|
104
|
-
}
|
|
105
|
-
CoreDialogueToolBar.propTypes = {
|
|
106
|
-
title: _propTypes.default.string,
|
|
107
|
-
warning: _propTypes.default.bool,
|
|
108
|
-
handlePrint: _propTypes.default.func,
|
|
109
|
-
handleSave: _propTypes.default.func,
|
|
110
|
-
handleClose: _propTypes.default.func,
|
|
111
|
-
intl: _propTypes.default.shape().isRequired,
|
|
112
|
-
classes: _propTypes.default.shape().isRequired,
|
|
113
|
-
children: _propTypes.default.node
|
|
114
|
-
};
|
|
115
|
-
CoreDialogueToolBar.defaultProps = {
|
|
116
|
-
title: '',
|
|
117
|
-
warning: false,
|
|
118
|
-
handlePrint: null,
|
|
119
|
-
handleSave: null,
|
|
120
|
-
handleClose: null,
|
|
121
|
-
children: null
|
|
122
|
-
};
|
|
123
|
-
var _default = exports.default = (0, _reactIntl.injectIntl)((0, _styles.withStyles)(styles)(CoreDialogueToolBar));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _CoreDialogueToolBar.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _CoreDialogueToolBar = _interopRequireDefault(require("./CoreDialogueToolBar"));
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactRouterDom = require("react-router-dom");
|
|
9
|
-
var _UnfoldMore = _interopRequireDefault(require("@material-ui/icons/UnfoldMore"));
|
|
10
|
-
var _UnfoldLess = _interopRequireDefault(require("@material-ui/icons/UnfoldLess"));
|
|
11
|
-
var _ListItemIcon = _interopRequireDefault(require("@material-ui/core/ListItemIcon"));
|
|
12
|
-
var _ListItemText = _interopRequireDefault(require("@material-ui/core/ListItemText"));
|
|
13
|
-
var _styles = require("@material-ui/core/styles");
|
|
14
|
-
var _ListItem = _interopRequireDefault(require("@material-ui/core/ListItem"));
|
|
15
|
-
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
16
|
-
var _Divider = _interopRequireDefault(require("@material-ui/core/Divider"));
|
|
17
|
-
var _Drawer = _interopRequireDefault(require("@material-ui/core/Drawer"));
|
|
18
|
-
var _reactIntl = require("react-intl");
|
|
19
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
20
|
-
var _Authentication = require("../../context/Authentication");
|
|
21
|
-
var _Organization = require("../../context/Organization");
|
|
22
|
-
var _Channels = require("../../context/Channels");
|
|
23
|
-
var _functions = require("../../functions");
|
|
24
|
-
var _Core = require("../../context/Core");
|
|
25
|
-
var _CoreFrame = _interopRequireDefault(require("../CoreFrame"));
|
|
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')]: {
|
|
46
|
-
width: theme.spacing.unit * 9
|
|
47
|
-
}
|
|
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 = {
|
|
75
|
-
navLink: {
|
|
76
|
-
textDecoration: 'none'
|
|
77
|
-
},
|
|
78
|
-
activeStyle: {
|
|
79
|
-
background: '#CFD8DC',
|
|
80
|
-
pointerEvents: 'none'
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
class CoreDrawer extends _react.Component {
|
|
84
|
-
constructor() {
|
|
85
|
-
super();
|
|
86
|
-
this.state = {
|
|
87
|
-
apps: [],
|
|
88
|
-
drawerOpen: true
|
|
89
|
-
};
|
|
90
|
-
}
|
|
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)) {
|
|
97
|
-
this.updateApps();
|
|
98
|
-
}
|
|
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;
|
|
105
|
-
}
|
|
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;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
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
|
|
132
|
-
}
|
|
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
|
-
});
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
selectApp(app) {
|
|
149
|
-
if (typeof this.props.updateComponentID === 'function') {
|
|
150
|
-
this.props.updateComponentID(app.componentID);
|
|
151
|
-
}
|
|
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();
|
|
157
|
-
}
|
|
158
|
-
}
|
|
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
|
|
178
|
-
}
|
|
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
|
-
}
|
|
219
|
-
CoreDrawer.propTypes = {
|
|
220
|
-
componentType: _propTypes.default.string.isRequired,
|
|
221
|
-
intl: _propTypes.default.shape({
|
|
222
|
-
locale: _propTypes.default.string
|
|
223
|
-
}).isRequired,
|
|
224
|
-
updateComponentID: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.bool]),
|
|
225
|
-
sandbox: _propTypes.default.string,
|
|
226
|
-
core: _propTypes.default.shape().isRequired,
|
|
227
|
-
authentication: _propTypes.default.shape().isRequired,
|
|
228
|
-
organization: _propTypes.default.shape().isRequired,
|
|
229
|
-
classes: _propTypes.default.shape().isRequired,
|
|
230
|
-
children: _propTypes.default.node
|
|
231
|
-
};
|
|
232
|
-
CoreDrawer.defaultProps = {
|
|
233
|
-
updateComponentID: false,
|
|
234
|
-
sandbox: '',
|
|
235
|
-
children: null
|
|
236
|
-
};
|
|
237
|
-
var _default = exports.default = (0, _reactIntl.injectIntl)((0, _Core.withCore)((0, _Authentication.withAuthentication)((0, _Organization.withOrganization)((0, _styles.withStyles)(styles)(CoreDrawer)))));
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# CoreDrawer
|
|
2
|
-
|
|
3
|
-
This component is used in "main" applications that have "sub" applications. It makes a call to [components-api](https://github.com/versacall/components-api) to get a list of all components that match the specified type.
|
|
4
|
-
|
|
5
|
-
Expanded:
|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
Collapsed:
|
|
9
|
-

|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
import CoreAppBar from 'core-library-react';
|
|
13
|
-
import CoreDrawer from 'core-library-react';
|
|
14
|
-
|
|
15
|
-
...
|
|
16
|
-
|
|
17
|
-
render() {
|
|
18
|
-
return(
|
|
19
|
-
<CoreAppBar title="Communications" />
|
|
20
|
-
<CoreDrawer componentType="communications.ui" />
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Props
|
|
26
|
-
- componentType : This is the type of component to get. Defined in the componentDefinition file of a package. Example: communications.ui
|
|
27
|
-
|
|
28
|
-
## componentDefinition
|
|
29
|
-
|
|
30
|
-
This works with componentDefinition elements stored in [packages-api](https://github.com/versacall/packages-api). Here are a couple of
|
|
31
|
-
key elements:
|
|
32
|
-
- name : This is the name that is shown.
|
|
33
|
-
- type : This is the type that is searched for by the componentType prop.
|
|
34
|
-
- metadata
|
|
35
|
-
- url : This is the url to open when the item is clicked on. Can be relative or absolute.
|
|
36
|
-
- iconUrl : This is the url of the icon to show.
|