orc-shared 1.2.0-dev.1 → 1.2.0-dev.5
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/actions/applications.js +1 -1
- package/dist/actions/authentication.js +1 -1
- package/dist/actions/countries.js +1 -1
- package/dist/actions/locale.js +1 -1
- package/dist/actions/makeApiAction.js +1 -1
- package/dist/actions/metadata.js +1 -1
- package/dist/actions/modules.js +63 -1
- package/dist/actions/navigation.js +1 -1
- package/dist/actions/requestsApi.js +8 -8
- package/dist/actions/scopes.js +59 -22
- package/dist/actions/timezones.js +1 -1
- package/dist/actions/toasts.js +1 -1
- package/dist/actions/versionInfo.js +1 -1
- package/dist/actions/view.js +1 -1
- package/dist/buildStore.js +1 -1
- package/dist/components/AppFrame/About.js +4 -3
- package/dist/components/AppFrame/MenuItem.js +6 -15
- package/dist/components/AppFrame/Preferences.js +1 -1
- package/dist/components/AppFrame/Sidebar.js +20 -9
- package/dist/components/AppFrame/Topbar.js +1 -1
- package/dist/components/ApplicationModuleLoader.js +143 -0
- package/dist/components/Authenticate.js +13 -13
- package/dist/components/CategoryList.js +1 -1
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/DropMenu/Menu.js +1 -1
- package/dist/components/DropMenu/index.js +1 -1
- package/dist/components/Form/FieldList.js +1 -1
- package/dist/components/Form/Form.js +1 -1
- package/dist/components/Form/Inputs/Button.js +1 -1
- package/dist/components/Form/Inputs/FieldButtons.js +1 -1
- package/dist/components/Form/Inputs/Number.js +1 -1
- package/dist/components/Form/Inputs/ReadOnly.js +1 -1
- package/dist/components/Form/Inputs/SmallButton.js +1 -1
- package/dist/components/Form/Inputs/Text.js +1 -1
- package/dist/components/Form/Inputs/Time.js +1 -1
- package/dist/components/Form/Inputs/Toggles.js +1 -1
- package/dist/components/Form/Inputs/Translation.js +1 -1
- package/dist/components/List/HeadCell.js +1 -1
- package/dist/components/List/List.js +1 -1
- package/dist/components/List/Row.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/List.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/NotificationProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Translations.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/Table.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/TransferList.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/chipProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/collapsableListProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/dividerProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/index.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/modalProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/useTableSelection.js +1 -1
- package/dist/components/MaterialUI/Feedback/useNotification.js +1 -1
- package/dist/components/MaterialUI/Inputs/AutocompleteProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/CheckboxGroupProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/CheckboxProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/InputBase.js +1 -1
- package/dist/components/MaterialUI/Inputs/InputBaseProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
- package/dist/components/MaterialUI/Inputs/RadioProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/SelectProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/Switch.js +1 -1
- package/dist/components/MaterialUI/Inputs/SwitchProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/TimePicker.js +1 -1
- package/dist/components/MaterialUI/Inputs/createInput.js +1 -1
- package/dist/components/MaterialUI/Inputs/index.js +1 -1
- package/dist/components/MaterialUI/Inputs/standaloneRadioProps.js +1 -1
- package/dist/components/MaterialUI/Navigation/DropDownMenuProps.js +1 -1
- package/dist/components/MaterialUI/Navigation/ExternalLink.js +113 -0
- package/dist/components/MaterialUI/Surfaces/expansionPanelProps.js +1 -1
- package/dist/components/MaterialUI/Surfaces/paperProps.js +1 -1
- package/dist/components/MaterialUI/muiThemes.js +5 -0
- package/dist/components/MaterialUI/textProps.js +1 -1
- package/dist/components/Modules.js +126 -41
- package/dist/components/MultiSelector.js +1 -1
- package/dist/components/Navigation/Bar.js +1 -1
- package/dist/components/Navigation/Tab.js +1 -1
- package/dist/components/Navigation/useNavigationState.js +1 -1
- package/dist/components/Placeholder.js +1 -1
- package/dist/components/Routing/FullPage.js +3 -1
- package/dist/components/Routing/Page.js +5 -3
- package/dist/components/Routing/Segment.js +1 -1
- package/dist/components/Routing/SegmentPage.js +1 -1
- package/dist/components/Routing/withWaypointing.js +6 -2
- package/dist/components/Scope/ScopeNode.js +1 -1
- package/dist/components/Scope/Selector.js +1 -1
- package/dist/components/Scope/index.js +1 -1
- package/dist/components/Scope/useScopeConfirmationModalState.js +7 -16
- package/dist/components/Scope/useScopeData.js +4 -13
- package/dist/components/Scope/useScopeSelect.js +1 -1
- package/dist/components/Selector.js +1 -1
- package/dist/components/Spritesheet.js +1 -1
- package/dist/components/Switch.js +1 -1
- package/dist/components/Text.js +1 -1
- package/dist/components/ToastList.js +1 -1
- package/dist/components/Toolbar.js +1 -1
- package/dist/components/Treeview/Label.js +1 -1
- package/dist/components/Treeview/Leaf.js +1 -1
- package/dist/components/Treeview/Node.js +1 -1
- package/dist/components/Treeview/settings.js +1 -1
- package/dist/constants.js +19 -2
- package/dist/content/icons/orckestra-icon.svg +5 -0
- package/dist/content/iconsSheet.svg +8 -0
- package/dist/content/orckestra-logo-white.png +0 -0
- package/dist/hocs/withInfiniteScroll.js +1 -1
- package/dist/hooks/useDispatchWithModulesData.js +1 -1
- package/dist/hooks/useEditState.js +1 -1
- package/dist/hooks/useFullEntityEditState.js +1 -1
- package/dist/hooks/useLabelMessage.js +1 -1
- package/dist/hooks/useNavigationHandler.js +1 -1
- package/dist/hooks/useSelectorAndUnwrap.js +1 -1
- package/dist/reducers/metadata.js +1 -1
- package/dist/reducers/modules.js +39 -1
- package/dist/reducers/scopes.js +27 -0
- package/dist/reducers/settings.js +31 -2
- package/dist/schemas/countries.js +1 -1
- package/dist/schemas/definitions.js +1 -1
- package/dist/schemas/metadata.js +1 -1
- package/dist/schemas/productDefinitions.js +1 -1
- package/dist/schemas/timezones.js +1 -1
- package/dist/selectors/applications.js +1 -1
- package/dist/selectors/authentication.js +57 -18
- package/dist/selectors/countries.js +1 -1
- package/dist/selectors/locale.js +1 -1
- package/dist/selectors/metadata.js +1 -1
- package/dist/selectors/modules.js +15 -1
- package/dist/selectors/navigation.js +1 -1
- package/dist/selectors/requests.js +1 -1
- package/dist/selectors/scope.js +7 -1
- package/dist/selectors/settings.js +13 -1
- package/dist/selectors/versionInfo.js +1 -1
- package/dist/selectors/view.js +1 -1
- package/dist/spawnerMiddleware.js +1 -1
- package/dist/utils/displayModeHelper.js +1 -1
- package/dist/utils/localizationHelper.js +1 -1
- package/dist/utils/mapHelper.js +1 -1
- package/dist/utils/modelValidationHelper.js +1 -1
- package/dist/utils/parseHelper.js +1 -1
- package/dist/utils/propertyHelper.js +2 -2
- package/dist/utils/propertyValidator.js +1 -1
- package/dist/utils/setTranslationWithFallback.js +1 -1
- package/dist/utils/testUtils.js +2 -1
- package/dist/utils/unwrapImmutable.js +1 -1
- package/dist/utils/urlHelper.js +1 -1
- package/package.json +6 -5
- package/src/actions/modules.js +30 -0
- package/src/actions/modules.test.js +50 -1
- package/src/actions/scopes.js +33 -7
- package/src/actions/scopes.test.js +84 -14
- package/src/components/AppFrame/About.js +2 -2
- package/src/components/AppFrame/AppFrame.test.js +9 -0
- package/src/components/AppFrame/MenuItem.js +3 -5
- package/src/components/AppFrame/MenuItem.test.js +2 -24
- package/src/components/AppFrame/Sidebar.js +11 -12
- package/src/components/AppFrame/Sidebar.test.js +18 -0
- package/src/components/ApplicationModuleLoader.js +52 -0
- package/src/components/ApplicationModuleLoader.test.js +149 -0
- package/src/components/Authenticate.js +5 -4
- package/src/components/Authenticate.test.js +23 -4
- package/src/components/MaterialUI/Navigation/ExternalLink.js +25 -0
- package/src/components/MaterialUI/Navigation/ExternalLink.test.js +26 -0
- package/src/components/MaterialUI/muiThemes.js +5 -0
- package/src/components/Modules.js +103 -20
- package/src/components/Modules.test.js +315 -28
- package/src/components/Provision.test.js +34 -0
- package/src/components/Routing/FullPage.js +2 -1
- package/src/components/Routing/FullPage.test.js +23 -0
- package/src/components/Routing/Page.js +2 -2
- package/src/components/Routing/Page.test.js +20 -0
- package/src/components/Routing/Segment.js +1 -1
- package/src/components/Routing/withWaypointing.js +2 -2
- package/src/components/Routing/withWaypointing.test.js +33 -5
- package/src/components/Scope/useScopeConfirmationModalState.js +5 -16
- package/src/components/Scope/useScopeConfirmationModalState.test.js +39 -13
- package/src/components/Scope/useScopeData.js +0 -3
- package/src/components/Scope/useScopeData.test.js +0 -27
- package/src/constants.js +15 -0
- package/src/content/icons/orckestra-icon.svg +5 -0
- package/src/content/iconsSheet.svg +8 -0
- package/src/content/orckestra-logo-white.png +0 -0
- package/src/hocs/withScopeData.test.js +0 -31
- package/src/reducers/modules.js +48 -2
- package/src/reducers/modules.test.js +117 -2
- package/src/reducers/scopes.js +30 -0
- package/src/reducers/scopes.test.js +45 -1
- package/src/reducers/settings.js +26 -2
- package/src/reducers/settings.test.js +74 -6
- package/src/selectors/authentication.js +53 -27
- package/src/selectors/authentication.test.js +600 -12
- package/src/selectors/modules.js +7 -0
- package/src/selectors/modules.test.js +16 -1
- package/src/selectors/scope.js +2 -0
- package/src/selectors/scope.test.js +5 -0
- package/src/selectors/settings.js +6 -0
|
@@ -25,6 +25,12 @@ var _modules = require("../actions/modules");
|
|
|
25
25
|
|
|
26
26
|
var _settings = require("../selectors/settings");
|
|
27
27
|
|
|
28
|
+
var _modules2 = require("../selectors/modules");
|
|
29
|
+
|
|
30
|
+
var _urlPattern = _interopRequireDefault(require("url-pattern"));
|
|
31
|
+
|
|
32
|
+
var _constants = require("../constants");
|
|
33
|
+
|
|
28
34
|
var _excluded = ["customPath"];
|
|
29
35
|
|
|
30
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -69,42 +75,50 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
69
75
|
return a;
|
|
70
76
|
};
|
|
71
77
|
|
|
78
|
+
var rerouteOnScopeAndModule = function rerouteOnScopeAndModule(history, currentRoute, scope, module) {
|
|
79
|
+
var params = {
|
|
80
|
+
scope: scope
|
|
81
|
+
};
|
|
82
|
+
var pattern = new _urlPattern.default("/:scope/".concat(module));
|
|
83
|
+
var href = pattern.stringify(params);
|
|
84
|
+
|
|
85
|
+
if (currentRoute !== href) {
|
|
86
|
+
history.push(href);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
72
90
|
var Module = (0, _withErrorBoundary.default)("Module")(__signature__(__signature__(function (_ref) {
|
|
73
|
-
var
|
|
91
|
+
var id = _ref.id,
|
|
92
|
+
config = _ref.config,
|
|
74
93
|
path = _ref.path,
|
|
75
94
|
error = _ref.error,
|
|
76
95
|
location = _ref.location,
|
|
77
96
|
match = _ref.match,
|
|
78
97
|
modulePrependPath = _ref.modulePrependPath;
|
|
79
|
-
var currentRoute = (0, _reactRedux.useSelector)(_navigation.selectRouteHref);
|
|
80
98
|
var history = (0, _reactRouterDom.useHistory)();
|
|
81
|
-
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return typeof config.hide === "function" ? config.hide(state) : (_config$hide = config.hide) != null ? _config$hide : false;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
var isHidden = (0, _reactRedux.useSelector)(hideSelector);
|
|
99
|
+
var scope = (0, _reactRedux.useSelector)(_navigation.getCurrentScopeFromRoute);
|
|
100
|
+
var currentRoute = (0, _reactRedux.useSelector)(_navigation.selectRouteHref);
|
|
101
|
+
var moduleInfo = (0, _reactRedux.useSelector)(_modules2.getScopeModuleInformationSelector);
|
|
102
|
+
var isVisible = moduleInfo.scope != null && moduleInfo.visibleModules.length > 0 && moduleInfo.visibleModules.includes(id);
|
|
89
103
|
|
|
90
104
|
_react.default.useEffect(function () {
|
|
91
|
-
if (
|
|
92
|
-
history.
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
}, [isHidden, currentRoute, match.url]);
|
|
105
|
+
if (moduleInfo.scope != null && scope === moduleInfo.scope && moduleInfo.visibleModules.length > 0 && !isVisible) {
|
|
106
|
+
rerouteOnScopeAndModule(history, currentRoute, moduleInfo.scope, moduleInfo.visibleModules[0]);
|
|
107
|
+
}
|
|
108
|
+
}, [history, scope, isVisible, currentRoute, moduleInfo.scope, moduleInfo.visibleModules]);
|
|
96
109
|
|
|
97
110
|
return /*#__PURE__*/_react.default.createElement(_FullPage.default, {
|
|
98
111
|
path: path,
|
|
99
112
|
config: config,
|
|
100
113
|
location: location,
|
|
101
114
|
match: match,
|
|
102
|
-
modulePrependPath: modulePrependPath
|
|
115
|
+
modulePrependPath: modulePrependPath,
|
|
116
|
+
isVisible: isVisible
|
|
103
117
|
});
|
|
104
|
-
}, "
|
|
105
|
-
return [_reactRedux.useSelector,
|
|
106
|
-
}), "
|
|
107
|
-
return [_reactRedux.useSelector,
|
|
118
|
+
}, "useHistory{history}\nuseSelector{scope}\nuseSelector{currentRoute}\nuseSelector{moduleInfo}\nuseEffect{}", function () {
|
|
119
|
+
return [_reactRouterDom.useHistory, _reactRedux.useSelector, _reactRedux.useSelector, _reactRedux.useSelector];
|
|
120
|
+
}), "useHistory{history}\nuseSelector{scope}\nuseSelector{currentRoute}\nuseSelector{moduleInfo}\nuseEffect{}", function () {
|
|
121
|
+
return [_reactRouterDom.useHistory, _reactRedux.useSelector, _reactRedux.useSelector, _reactRedux.useSelector];
|
|
108
122
|
}));
|
|
109
123
|
exports.Module = Module;
|
|
110
124
|
|
|
@@ -112,26 +126,76 @@ var getHrefFromPath = function getHrefFromPath(path, scope) {
|
|
|
112
126
|
return path.replace(":scope", scope);
|
|
113
127
|
};
|
|
114
128
|
|
|
115
|
-
var
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
|
|
129
|
+
var CheckModuleVisibility = function CheckModuleVisibility(_ref2) {
|
|
130
|
+
var _moduleInfo$scope;
|
|
131
|
+
|
|
132
|
+
var id = _ref2.id,
|
|
133
|
+
config = _ref2.config,
|
|
134
|
+
moduleInfo = _ref2.moduleInfo;
|
|
135
|
+
var dispatch = (0, _reactRedux.useDispatch)();
|
|
136
|
+
var applicationModules = (0, _reactRedux.useSelector)(_settings.getApplicationModulesSelector);
|
|
137
|
+
var scopeFromRoute = (0, _reactRedux.useSelector)(_navigation.getCurrentScopeFromRoute);
|
|
138
|
+
|
|
139
|
+
var hideSelector = function hideSelector(state) {
|
|
140
|
+
return typeof config.hide === "function" ? config.hide(state) : function () {
|
|
141
|
+
var _config$hide;
|
|
142
|
+
|
|
143
|
+
return (_config$hide = config.hide) != null ? _config$hide : false;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
var isHidden = (0, _reactRedux.useSelector)(hideSelector((_moduleInfo$scope = moduleInfo.scope) != null ? _moduleInfo$scope : scopeFromRoute));
|
|
148
|
+
var moduleScope = moduleInfo.scope;
|
|
149
|
+
var moduleIsVisible = isHidden === false && !moduleInfo.visibleModules.includes(id);
|
|
150
|
+
|
|
151
|
+
_react.default.useEffect(function () {
|
|
152
|
+
// We need to wait for the ROUTE to be set the first time in the Redux/Store before to set module's visibility
|
|
153
|
+
if (scopeFromRoute !== null || applicationModules.includes(_constants.overtureModule.System)) {
|
|
154
|
+
if (moduleScope == null) {
|
|
155
|
+
dispatch((0, _modules.initializeFirstModuleScope)(scopeFromRoute));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (moduleIsVisible) {
|
|
159
|
+
dispatch((0, _modules.setModuleAsVisible)(id));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}, [moduleScope, moduleIsVisible, dispatch, id, scopeFromRoute, applicationModules]);
|
|
163
|
+
|
|
164
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
__signature__(CheckModuleVisibility, "useDispatch{dispatch}\nuseSelector{applicationModules}\nuseSelector{scopeFromRoute}\nuseSelector{isHidden}\nuseEffect{}", function () {
|
|
168
|
+
return [_reactRedux.useDispatch, _reactRedux.useSelector, _reactRedux.useSelector, _reactRedux.useSelector];
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
__signature__(CheckModuleVisibility, "useDispatch{dispatch}\nuseSelector{applicationModules}\nuseSelector{scopeFromRoute}\nuseSelector{isHidden}\nuseEffect{}", function () {
|
|
172
|
+
return [_reactRedux.useDispatch, _reactRedux.useSelector, _reactRedux.useSelector, _reactRedux.useSelector];
|
|
173
|
+
});
|
|
119
174
|
|
|
120
|
-
|
|
121
|
-
|
|
175
|
+
var Modules = function Modules(_ref3) {
|
|
176
|
+
var modules = _ref3.modules,
|
|
177
|
+
_ref3$pathConfig = _ref3.pathConfig;
|
|
178
|
+
_ref3$pathConfig = _ref3$pathConfig === void 0 ? {} : _ref3$pathConfig;
|
|
179
|
+
|
|
180
|
+
var customPath = _ref3$pathConfig.customPath,
|
|
181
|
+
otherConfigs = _objectWithoutProperties(_ref3$pathConfig, _excluded);
|
|
122
182
|
|
|
123
183
|
var dispatch = (0, _reactRedux.useDispatch)();
|
|
124
|
-
var
|
|
184
|
+
var currentScope = (0, _reactRedux.useSelector)(_navigation.getCurrentScope);
|
|
125
185
|
var isAuthorizedScope = (0, _reactRedux.useSelector)(_scope.isCurrentScopeAuthorizedSelector);
|
|
126
186
|
var defaultScope = (0, _reactRedux.useSelector)(_settings.defaultScopeSelector);
|
|
127
187
|
var history = (0, _reactRouterDom.useHistory)();
|
|
128
188
|
var location = (0, _reactRouterDom.useLocation)();
|
|
189
|
+
var currentRoute = (0, _reactRedux.useSelector)(_navigation.selectRouteHref);
|
|
190
|
+
var moduleInfo = (0, _reactRedux.useSelector)(_modules2.getScopeModuleInformationSelector);
|
|
191
|
+
var firstModuleName = Object.keys(modules)[0];
|
|
192
|
+
var destinationModule = moduleInfo.routingPerformed === false && moduleInfo.scope != null && moduleInfo.visibleModules.length > 0 && moduleInfo.moduleName != null ? moduleInfo.visibleModules.includes(moduleInfo.moduleName) ? moduleInfo.moduleName : moduleInfo.visibleModules[0] : null;
|
|
129
193
|
var scopePath = "/:scope/";
|
|
130
194
|
var prependPath = customPath || scopePath;
|
|
131
|
-
var prependHref = getHrefFromPath(prependPath,
|
|
195
|
+
var prependHref = getHrefFromPath(prependPath, currentScope);
|
|
132
196
|
Object.keys(otherConfigs).forEach(function (key) {
|
|
133
197
|
var moduleConfig = otherConfigs[key];
|
|
134
|
-
moduleConfig.prependHref = getHrefFromPath(moduleConfig.prependPath,
|
|
198
|
+
moduleConfig.prependHref = getHrefFromPath(moduleConfig.prependPath, currentScope);
|
|
135
199
|
});
|
|
136
200
|
(0, _react.useEffect)(function () {
|
|
137
201
|
dispatch((0, _navigation2.setHrefConfig)(prependPath, prependHref, otherConfigs));
|
|
@@ -144,27 +208,43 @@ var Modules = function Modules(_ref2) {
|
|
|
144
208
|
};
|
|
145
209
|
};
|
|
146
210
|
|
|
147
|
-
var firstModuleName = Object.keys(modules)[0];
|
|
148
211
|
(0, _react.useEffect)(function () {
|
|
149
212
|
var pathname = location.pathname,
|
|
150
213
|
search = location.search;
|
|
151
214
|
|
|
152
|
-
if (!isAuthorizedScope && pathname.includes(
|
|
153
|
-
history.push(pathname.replace(
|
|
215
|
+
if (!isAuthorizedScope && pathname.includes(currentScope) && defaultScope) {
|
|
216
|
+
history.push(pathname.replace(currentScope, defaultScope) + search);
|
|
154
217
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
155
218
|
|
|
156
|
-
}, [isAuthorizedScope, defaultScope, history,
|
|
219
|
+
}, [isAuthorizedScope, defaultScope, history, currentScope]);
|
|
157
220
|
|
|
158
221
|
_react.default.useEffect(function () {
|
|
159
222
|
dispatch((0, _modules.setModulesStructure)(modules));
|
|
160
223
|
}, [dispatch, modules]);
|
|
161
224
|
|
|
225
|
+
(0, _react.useEffect)(function () {
|
|
226
|
+
if (destinationModule != null) {
|
|
227
|
+
rerouteOnScopeAndModule(history, currentRoute, moduleInfo.scope, destinationModule);
|
|
228
|
+
dispatch((0, _modules.setRoutingPerformed)());
|
|
229
|
+
}
|
|
230
|
+
}, [dispatch, history, moduleInfo.scope, destinationModule, currentRoute]);
|
|
162
231
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Navigation.default, {
|
|
163
232
|
modules: modules
|
|
164
|
-
}),
|
|
165
|
-
var
|
|
166
|
-
name =
|
|
167
|
-
module =
|
|
233
|
+
}), Object.entries(modules).map(function (_ref4) {
|
|
234
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
235
|
+
name = _ref5[0],
|
|
236
|
+
module = _ref5[1];
|
|
237
|
+
|
|
238
|
+
return /*#__PURE__*/_react.default.createElement(CheckModuleVisibility, {
|
|
239
|
+
key: name,
|
|
240
|
+
id: name,
|
|
241
|
+
config: module,
|
|
242
|
+
moduleInfo: moduleInfo
|
|
243
|
+
});
|
|
244
|
+
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Switch, null, Object.entries(modules).map(function (_ref6) {
|
|
245
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
246
|
+
name = _ref7[0],
|
|
247
|
+
module = _ref7[1];
|
|
168
248
|
|
|
169
249
|
var moduleConfig = getModuleConfig(name);
|
|
170
250
|
var path = "".concat(moduleConfig.prependPath).concat(name);
|
|
@@ -173,6 +253,7 @@ var Modules = function Modules(_ref2) {
|
|
|
173
253
|
path: path,
|
|
174
254
|
render: function render(route) {
|
|
175
255
|
return /*#__PURE__*/_react.default.createElement(Module, _extends({
|
|
256
|
+
id: name,
|
|
176
257
|
modulePrependPath: moduleConfig.prependPath,
|
|
177
258
|
config: module,
|
|
178
259
|
path: path
|
|
@@ -186,12 +267,12 @@ var Modules = function Modules(_ref2) {
|
|
|
186
267
|
|
|
187
268
|
exports.Modules = Modules;
|
|
188
269
|
|
|
189
|
-
__signature__(Modules, "useDispatch{dispatch}\nuseSelector{
|
|
190
|
-
return [_reactRedux.useDispatch, _reactRedux.useSelector, _reactRedux.useSelector, _reactRedux.useSelector, _reactRouterDom.useHistory, _reactRouterDom.useLocation];
|
|
270
|
+
__signature__(Modules, "useDispatch{dispatch}\nuseSelector{currentScope}\nuseSelector{isAuthorizedScope}\nuseSelector{defaultScope}\nuseHistory{history}\nuseLocation{location}\nuseSelector{currentRoute}\nuseSelector{moduleInfo}\nuseEffect{}\nuseEffect{}\nuseEffect{}\nuseEffect{}", function () {
|
|
271
|
+
return [_reactRedux.useDispatch, _reactRedux.useSelector, _reactRedux.useSelector, _reactRedux.useSelector, _reactRouterDom.useHistory, _reactRouterDom.useLocation, _reactRedux.useSelector, _reactRedux.useSelector];
|
|
191
272
|
});
|
|
192
273
|
|
|
193
|
-
__signature__(Modules, "useDispatch{dispatch}\nuseSelector{
|
|
194
|
-
return [_reactRedux.useDispatch, _reactRedux.useSelector, _reactRedux.useSelector, _reactRedux.useSelector, _reactRouterDom.useHistory, _reactRouterDom.useLocation];
|
|
274
|
+
__signature__(Modules, "useDispatch{dispatch}\nuseSelector{currentScope}\nuseSelector{isAuthorizedScope}\nuseSelector{defaultScope}\nuseHistory{history}\nuseLocation{location}\nuseSelector{currentRoute}\nuseSelector{moduleInfo}\nuseEffect{}\nuseEffect{}\nuseEffect{}\nuseEffect{}", function () {
|
|
275
|
+
return [_reactRedux.useDispatch, _reactRedux.useSelector, _reactRedux.useSelector, _reactRedux.useSelector, _reactRouterDom.useHistory, _reactRouterDom.useLocation, _reactRedux.useSelector, _reactRedux.useSelector];
|
|
195
276
|
});
|
|
196
277
|
|
|
197
278
|
var _default = Modules;
|
|
@@ -207,8 +288,10 @@ exports.default = _default3;
|
|
|
207
288
|
return;
|
|
208
289
|
}
|
|
209
290
|
|
|
291
|
+
reactHotLoader.register(rerouteOnScopeAndModule, "rerouteOnScopeAndModule", "/home/vsts/work/1/s/src/components/Modules.js");
|
|
210
292
|
reactHotLoader.register(Module, "Module", "/home/vsts/work/1/s/src/components/Modules.js");
|
|
211
293
|
reactHotLoader.register(getHrefFromPath, "getHrefFromPath", "/home/vsts/work/1/s/src/components/Modules.js");
|
|
294
|
+
reactHotLoader.register(CheckModuleVisibility, "CheckModuleVisibility", "/home/vsts/work/1/s/src/components/Modules.js");
|
|
212
295
|
reactHotLoader.register(Modules, "Modules", "/home/vsts/work/1/s/src/components/Modules.js");
|
|
213
296
|
reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/Modules.js");
|
|
214
297
|
})();
|
|
@@ -229,8 +312,10 @@ exports.default = _default3;
|
|
|
229
312
|
return;
|
|
230
313
|
}
|
|
231
314
|
|
|
315
|
+
reactHotLoader.register(rerouteOnScopeAndModule, "rerouteOnScopeAndModule", "/home/vsts/work/1/s/src/components/Modules.js");
|
|
232
316
|
reactHotLoader.register(Module, "Module", "/home/vsts/work/1/s/src/components/Modules.js");
|
|
233
317
|
reactHotLoader.register(getHrefFromPath, "getHrefFromPath", "/home/vsts/work/1/s/src/components/Modules.js");
|
|
318
|
+
reactHotLoader.register(CheckModuleVisibility, "CheckModuleVisibility", "/home/vsts/work/1/s/src/components/Modules.js");
|
|
234
319
|
reactHotLoader.register(Modules, "Modules", "/home/vsts/work/1/s/src/components/Modules.js");
|
|
235
320
|
reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/Modules.js");
|
|
236
321
|
})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.useTabScroll = exports.default = exports.TabBar = exports.StyledMenu = exports.ScrollableBar = exports.MenuButton = exports.InnerBar = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.
|
|
4
|
+
exports.default = exports.TabText = exports.TabLink = exports.PageTab = exports.ModuleTab = exports.ModuleIcon = exports.CloseIcon = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.
|
|
4
|
+
exports.default = exports.PlaceholderTitle = exports.PlaceholderSubtitle = exports.PlaceholderIcon = exports.PlaceholderBox = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|
|
@@ -34,7 +34,8 @@ var FullPage = function FullPage(_ref) {
|
|
|
34
34
|
config = _ref.config,
|
|
35
35
|
location = _ref.location,
|
|
36
36
|
match = _ref.match,
|
|
37
|
-
modulePrependPath = _ref.modulePrependPath
|
|
37
|
+
modulePrependPath = _ref.modulePrependPath,
|
|
38
|
+
isVisible = _ref.isVisible;
|
|
38
39
|
var component = config.component,
|
|
39
40
|
componentProps = config.componentProps,
|
|
40
41
|
_config$pages = config.pages,
|
|
@@ -63,6 +64,7 @@ var FullPage = function FullPage(_ref) {
|
|
|
63
64
|
subpages: subpages,
|
|
64
65
|
location: location,
|
|
65
66
|
match: match,
|
|
67
|
+
isVisible: isVisible,
|
|
66
68
|
modulePrependPath: modulePrependPath
|
|
67
69
|
});
|
|
68
70
|
};
|
|
@@ -60,10 +60,12 @@ var Page = function Page(_ref) {
|
|
|
60
60
|
pages = _ref$pages === void 0 ? {} : _ref$pages,
|
|
61
61
|
_ref$subpages = _ref.subpages,
|
|
62
62
|
subpages = _ref$subpages === void 0 ? {} : _ref$subpages,
|
|
63
|
-
modulePrependPath = _ref.modulePrependPath
|
|
63
|
+
modulePrependPath = _ref.modulePrependPath,
|
|
64
|
+
_ref$isVisible = _ref.isVisible,
|
|
65
|
+
isVisible = _ref$isVisible === void 0 ? true : _ref$isVisible;
|
|
64
66
|
var WrappedView = (0, _react.useMemo)(function () {
|
|
65
|
-
return (0, _withErrorBoundary.default)(path)((0, _withWaypointing.default)(View));
|
|
66
|
-
}, [path, View]);
|
|
67
|
+
return (0, _withErrorBoundary.default)(path)((0, _withWaypointing.default)(View, isVisible));
|
|
68
|
+
}, [path, View, isVisible]);
|
|
67
69
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactRouter.Switch, null, Object.entries(pages).map(function (_ref2) {
|
|
68
70
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
69
71
|
subpath = _ref3[0],
|
|
@@ -43,7 +43,7 @@ var Segment = function Segment(_ref) {
|
|
|
43
43
|
componentProps = config.componentProps;
|
|
44
44
|
var path = location.pathname;
|
|
45
45
|
var View = (0, _react.useMemo)(function () {
|
|
46
|
-
return (0, _withErrorBoundary.default)(path)((0, _withWaypointing.default)(component, componentProps));
|
|
46
|
+
return (0, _withErrorBoundary.default)(path)((0, _withWaypointing.default)(component, true, componentProps));
|
|
47
47
|
}, [path, component, componentProps]);
|
|
48
48
|
return /*#__PURE__*/_react.default.createElement(View, {
|
|
49
49
|
location: location,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.
|
|
4
|
+
exports.default = exports.Wrapper = exports.SegmentItem = exports.List = exports.Item = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|
|
@@ -41,7 +41,11 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
41
41
|
return a;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
var withWaypointing = function withWaypointing(Comp, componentProps) {
|
|
44
|
+
var withWaypointing = function withWaypointing(Comp, isVisible, componentProps) {
|
|
45
|
+
if (isVisible === void 0) {
|
|
46
|
+
isVisible = true;
|
|
47
|
+
}
|
|
48
|
+
|
|
45
49
|
if (componentProps === void 0) {
|
|
46
50
|
componentProps = {};
|
|
47
51
|
}
|
|
@@ -72,7 +76,7 @@ var withWaypointing = function withWaypointing(Comp, componentProps) {
|
|
|
72
76
|
};
|
|
73
77
|
|
|
74
78
|
(0, _useLoader.default)(loadActions, cutout);
|
|
75
|
-
return /*#__PURE__*/_react.default.createElement(Comp, _extends({}, props, componentProps));
|
|
79
|
+
return isVisible ? /*#__PURE__*/_react.default.createElement(Comp, _extends({}, props, componentProps)) : null;
|
|
76
80
|
}, "useLocation{location}\nuseLoader{}", function () {
|
|
77
81
|
return [_reactRouterDom.useLocation, _useLoader.default];
|
|
78
82
|
}), "useLocation{location}\nuseLoader{}", function () {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.
|
|
4
|
+
exports.default = exports.ScopeText = exports.ScopeNode = exports.ScopeIcon = exports.ContentLabel = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.
|
|
4
|
+
exports.default = exports.Wrapper = exports.SelectorPanel = exports.Selector = exports.SearchInput = exports.InputBox = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.
|
|
4
|
+
exports.default = exports.ScopeBar = exports.Scope = exports.SCOPE_SELECTOR_NAME = exports.Bar = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
@@ -19,9 +19,7 @@ var _view = require("../../selectors/view");
|
|
|
19
19
|
|
|
20
20
|
var _constants = require("../../constants");
|
|
21
21
|
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
var _urlPattern = _interopRequireDefault(require("url-pattern"));
|
|
22
|
+
var _modules = require("../../actions/modules");
|
|
25
23
|
|
|
26
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
25
|
|
|
@@ -112,28 +110,21 @@ var ExecuteClosingTabHandlerActions = /*#__PURE__*/function () {
|
|
|
112
110
|
|
|
113
111
|
var useApplicationScopeChanger = function useApplicationScopeChanger(closingTabHandlerActions) {
|
|
114
112
|
var dispatch = (0, _reactRedux.useDispatch)();
|
|
115
|
-
var history = (0, _reactRouterDom.useHistory)();
|
|
116
113
|
var moduleName = (0, _useSelectorAndUnwrap.default)(_navigation.selectCurrentModuleName);
|
|
117
114
|
return function (previousScope, newScope) {
|
|
118
|
-
var params = {
|
|
119
|
-
scope: newScope
|
|
120
|
-
}; // did not find a more reliable way to get the URL for the first tab of the module
|
|
121
|
-
|
|
122
|
-
var pattern = new _urlPattern.default("/:scope/".concat(moduleName));
|
|
123
|
-
var href = pattern.stringify(params);
|
|
124
|
-
history.push(href);
|
|
125
115
|
ExecuteClosingTabHandlerActions(closingTabHandlerActions).then(function () {
|
|
126
|
-
|
|
116
|
+
dispatch((0, _modules.setNewScopeAndModuleName)(newScope, moduleName));
|
|
117
|
+
dispatch((0, _scopes.applicationScopeHasChanged)(previousScope, newScope));
|
|
127
118
|
});
|
|
128
119
|
};
|
|
129
120
|
};
|
|
130
121
|
|
|
131
|
-
__signature__(useApplicationScopeChanger, "useDispatch{dispatch}\
|
|
132
|
-
return [_reactRedux.useDispatch,
|
|
122
|
+
__signature__(useApplicationScopeChanger, "useDispatch{dispatch}\nuseSelectorAndUnwrap{moduleName}", function () {
|
|
123
|
+
return [_reactRedux.useDispatch, _useSelectorAndUnwrap.default];
|
|
133
124
|
});
|
|
134
125
|
|
|
135
|
-
__signature__(useApplicationScopeChanger, "useDispatch{dispatch}\
|
|
136
|
-
return [_reactRedux.useDispatch,
|
|
126
|
+
__signature__(useApplicationScopeChanger, "useDispatch{dispatch}\nuseSelectorAndUnwrap{moduleName}", function () {
|
|
127
|
+
return [_reactRedux.useDispatch, _useSelectorAndUnwrap.default];
|
|
137
128
|
});
|
|
138
129
|
|
|
139
130
|
var useScopeConfirmationModalState = function useScopeConfirmationModalState() {
|
|
@@ -5,16 +5,10 @@ exports.default = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _reactRedux = require("react-redux");
|
|
7
7
|
|
|
8
|
-
var _useLoader = _interopRequireDefault(require("../../hooks/useLoader"));
|
|
9
|
-
|
|
10
8
|
var _utils = require("../../utils");
|
|
11
9
|
|
|
12
10
|
var _scope = require("../../selectors/scope");
|
|
13
11
|
|
|
14
|
-
var _scopes = require("../../actions/scopes");
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
(function () {
|
|
19
13
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
20
14
|
enterModule && enterModule(module);
|
|
@@ -47,19 +41,16 @@ var buildDefaultNodeState = function buildDefaultNodeState(current, getScope) {
|
|
|
47
41
|
var useScopeData = function useScopeData() {
|
|
48
42
|
var currentScope = (0, _utils.unwrapImmutable)((0, _reactRedux.useSelector)(_scope.currentScopeSelector));
|
|
49
43
|
var getScope = (0, _reactRedux.useSelector)(_scope.scopeGetter);
|
|
50
|
-
(0, _useLoader.default)((0, _scopes.getScopes)(), function () {
|
|
51
|
-
return currentScope.name;
|
|
52
|
-
});
|
|
53
44
|
var defaultNodeState = buildDefaultNodeState(currentScope, getScope);
|
|
54
45
|
return [currentScope, defaultNodeState, getScope];
|
|
55
46
|
};
|
|
56
47
|
|
|
57
|
-
__signature__(useScopeData, "useSelector{}\nuseSelector{getScope}
|
|
58
|
-
return [_reactRedux.useSelector, _reactRedux.useSelector
|
|
48
|
+
__signature__(useScopeData, "useSelector{}\nuseSelector{getScope}", function () {
|
|
49
|
+
return [_reactRedux.useSelector, _reactRedux.useSelector];
|
|
59
50
|
});
|
|
60
51
|
|
|
61
|
-
__signature__(useScopeData, "useSelector{}\nuseSelector{getScope}
|
|
62
|
-
return [_reactRedux.useSelector, _reactRedux.useSelector
|
|
52
|
+
__signature__(useScopeData, "useSelector{}\nuseSelector{getScope}", function () {
|
|
53
|
+
return [_reactRedux.useSelector, _reactRedux.useSelector];
|
|
63
54
|
});
|
|
64
55
|
|
|
65
56
|
var _default = useScopeData;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.
|
|
4
|
+
exports.default = exports.Wrapper = exports.Selector = exports.SelectedValue = exports.SelectBox = exports.Placeholder = exports.Option = exports.InnerSelect = exports.Dropdown = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.
|
|
4
|
+
exports.default = exports.Wrapper = exports.Switch = exports.ContainedCheckbox = exports.Caption = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|
package/dist/components/Text.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.ToastList = exports.
|
|
4
|
+
exports.default = exports.ToastList = exports.ToastIcon = exports.ToastBox = exports.Toast = exports.CloseIcon = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.toolComponents = exports.default = exports.ToolbarRadioWrapper = exports.ToolbarRadio = exports.ToolbarLabel = exports.ToolbarInput = exports.ToolbarButton = exports.Toolbar = exports.ToolGroup = exports.Spacer = exports.Separator = exports.Bar = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.NonIndicator = exports.Label = exports.Indicator = exports.BeforeIndicator = void 0;
|
|
5
5
|
|
|
6
6
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.
|
|
4
|
+
exports.default = exports.TreeContext = exports.RootNode = exports.Node = exports.LeafNode = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|