orc-shared 1.4.0 → 1.5.0-dev.10
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 +14 -52
- package/dist/actions/authentication.js +10 -45
- package/dist/actions/countries.js +6 -36
- package/dist/actions/locale.js +14 -54
- package/dist/actions/makeApiAction.js +31 -79
- package/dist/actions/makeOrcApiAction.js +3 -26
- package/dist/actions/metadata.js +65 -174
- package/dist/actions/modules.js +0 -26
- package/dist/actions/navigation.js +3 -33
- package/dist/actions/requestState.js +0 -18
- package/dist/actions/requestsApi.js +0 -17
- package/dist/actions/scopes.js +14 -56
- package/dist/actions/timezones.js +6 -36
- package/dist/actions/toasts.js +3 -23
- package/dist/actions/versionInfo.js +6 -39
- package/dist/actions/view.js +0 -38
- package/dist/buildStore.js +3 -53
- package/dist/components/AppFrame/About.js +8 -70
- package/dist/components/AppFrame/Anchor.js +1 -25
- package/dist/components/AppFrame/AppFrame.js +23 -92
- package/dist/components/AppFrame/ApplicationSelector/ApplicationDialog.js +4 -35
- package/dist/components/AppFrame/ApplicationSelector/Header.js +1 -31
- package/dist/components/AppFrame/ApplicationSelector/index.js +1 -30
- package/dist/components/AppFrame/ConnectedToastList.js +0 -31
- package/dist/components/AppFrame/Help.js +0 -25
- package/dist/components/AppFrame/MenuItem.js +17 -70
- package/dist/components/AppFrame/Preferences.js +17 -79
- package/dist/components/AppFrame/Sidebar.js +8 -53
- package/dist/components/AppFrame/Topbar.js +9 -65
- package/dist/components/AppFrame/index.js +0 -20
- package/dist/components/AppFrame/useApplicationHelpUrl.js +0 -22
- package/dist/components/ApplicationModuleLoader.js +7 -46
- package/dist/components/Authenticate.js +5 -48
- package/dist/components/Button.js +0 -24
- package/dist/components/CategoryList.js +27 -82
- package/dist/components/Checkbox.js +3 -41
- package/dist/components/ColumnWrapper.js +0 -19
- package/dist/components/Culture.js +0 -29
- package/dist/components/DevPages.js +0 -21
- package/dist/components/DropMenu/Menu.js +4 -36
- package/dist/components/DropMenu/index.js +12 -50
- package/dist/components/ErrorPlaceholder.js +3 -31
- package/dist/components/Form/Combination.js +3 -28
- package/dist/components/Form/Field.js +6 -37
- package/dist/components/Form/FieldElements.js +9 -41
- package/dist/components/Form/FieldList.js +28 -92
- package/dist/components/Form/Fieldset.js +1 -27
- package/dist/components/Form/Form.js +6 -37
- package/dist/components/Form/FormElement.js +1 -20
- package/dist/components/Form/InputField.js +17 -66
- package/dist/components/Form/Inputs/Button.js +5 -35
- package/dist/components/Form/Inputs/Date.js +2 -28
- package/dist/components/Form/Inputs/FieldButtons.js +0 -25
- package/dist/components/Form/Inputs/Number.js +7 -46
- package/dist/components/Form/Inputs/ReadOnly.js +0 -29
- package/dist/components/Form/Inputs/SmallButton.js +6 -38
- package/dist/components/Form/Inputs/Text.js +8 -41
- package/dist/components/Form/Inputs/Time.js +4 -33
- package/dist/components/Form/Inputs/Toggles.js +5 -39
- package/dist/components/Form/Inputs/Translation.js +21 -78
- package/dist/components/Form/Inputs/index.js +0 -28
- package/dist/components/Form/index.js +0 -20
- package/dist/components/Head.js +0 -22
- package/dist/components/I18n.js +0 -28
- package/dist/components/Icon.js +1 -27
- package/dist/components/IconButton.js +2 -32
- package/dist/components/Input.js +2 -42
- package/dist/components/InternetExplorerWarningMessage.js +0 -31
- package/dist/components/List/DataCell.js +3 -42
- package/dist/components/List/HeadCell.js +3 -43
- package/dist/components/List/HeadRow.js +2 -25
- package/dist/components/List/List.js +37 -107
- package/dist/components/List/Row.js +7 -38
- package/dist/components/List/enhanceColumnDefs.js +3 -29
- package/dist/components/List/index.js +0 -20
- package/dist/components/Loader.js +5 -48
- package/dist/components/LoadingIcon.js +0 -24
- package/dist/components/MaterialUI/DataDisplay/Badge.js +2 -31
- package/dist/components/MaterialUI/DataDisplay/Chip.js +1 -33
- package/dist/components/MaterialUI/DataDisplay/CollapsableList.js +7 -51
- package/dist/components/MaterialUI/DataDisplay/Divider.js +0 -30
- package/dist/components/MaterialUI/DataDisplay/Icon.js +2 -28
- package/dist/components/MaterialUI/DataDisplay/List.js +16 -55
- package/dist/components/MaterialUI/DataDisplay/Modal.js +4 -37
- package/dist/components/MaterialUI/DataDisplay/Notification.js +17 -69
- package/dist/components/MaterialUI/DataDisplay/NotificationProps.js +3 -34
- package/dist/components/MaterialUI/DataDisplay/PopperedElements/PopperedIcon.js +0 -22
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/ActionModal.js +5 -37
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Address.js +1 -33
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/ConfirmationModal.js +7 -28
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/DiscountedPrice.js +2 -32
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +17 -57
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +4 -33
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/SectionTitle.js +0 -25
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +14 -60
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/TableInfoBar.js +0 -29
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Translations.js +15 -59
- package/dist/components/MaterialUI/DataDisplay/SelectionList.js +23 -70
- package/dist/components/MaterialUI/DataDisplay/Table.js +34 -123
- package/dist/components/MaterialUI/DataDisplay/TableHeaderCell.js +0 -35
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +3 -49
- package/dist/components/MaterialUI/DataDisplay/Timeline.js +1 -21
- package/dist/components/MaterialUI/DataDisplay/TimelineItem.js +4 -32
- package/dist/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.js +7 -46
- package/dist/components/MaterialUI/DataDisplay/TooltippedElements/TooltippedIcon.js +3 -29
- package/dist/components/MaterialUI/DataDisplay/TooltippedElements/TooltippedTypography.js +0 -21
- package/dist/components/MaterialUI/DataDisplay/TransferList.js +32 -97
- package/dist/components/MaterialUI/DataDisplay/chipProps.js +3 -38
- package/dist/components/MaterialUI/DataDisplay/collapsableListProps.js +3 -37
- package/dist/components/MaterialUI/DataDisplay/dividerProps.js +3 -41
- package/dist/components/MaterialUI/DataDisplay/index.js +0 -33
- package/dist/components/MaterialUI/DataDisplay/modalProps.js +3 -36
- package/dist/components/MaterialUI/DataDisplay/tableHelpers.js +5 -68
- package/dist/components/MaterialUI/DataDisplay/useTableSelection.js +11 -48
- package/dist/components/MaterialUI/Feedback/NotificationContext.js +5 -40
- package/dist/components/MaterialUI/Feedback/loadingScreen.js +5 -44
- package/dist/components/MaterialUI/Feedback/useNotification.js +0 -21
- package/dist/components/MaterialUI/Inputs/Autocomplete.js +5 -44
- package/dist/components/MaterialUI/Inputs/AutocompleteProps.js +3 -37
- package/dist/components/MaterialUI/Inputs/Checkbox.js +3 -40
- package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +3 -43
- package/dist/components/MaterialUI/Inputs/CheckboxGroupProps.js +3 -38
- package/dist/components/MaterialUI/Inputs/CheckboxProps.js +3 -39
- package/dist/components/MaterialUI/Inputs/DatePicker.js +18 -57
- package/dist/components/MaterialUI/Inputs/InputBase.js +7 -56
- package/dist/components/MaterialUI/Inputs/InputBaseProps.js +3 -51
- package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +12 -65
- package/dist/components/MaterialUI/Inputs/PredefinedElements/TitledSelect.js +3 -31
- package/dist/components/MaterialUI/Inputs/Radio.js +8 -54
- package/dist/components/MaterialUI/Inputs/RadioProps.js +3 -41
- package/dist/components/MaterialUI/Inputs/Select.js +10 -72
- package/dist/components/MaterialUI/Inputs/SelectProps.js +3 -46
- package/dist/components/MaterialUI/Inputs/StandaloneRadio.js +3 -35
- package/dist/components/MaterialUI/Inputs/Switch.js +4 -38
- package/dist/components/MaterialUI/Inputs/SwitchProps.js +3 -40
- package/dist/components/MaterialUI/Inputs/TimePicker.js +14 -91
- package/dist/components/MaterialUI/Inputs/createInput.js +5 -30
- package/dist/components/MaterialUI/Inputs/index.js +0 -35
- package/dist/components/MaterialUI/Inputs/standaloneRadioProps.js +3 -41
- package/dist/components/MaterialUI/Navigation/DropDownMenu.js +12 -56
- package/dist/components/MaterialUI/Navigation/DropDownMenuProps.js +3 -33
- package/dist/components/MaterialUI/Navigation/ExternalLink.js +2 -27
- package/dist/components/MaterialUI/Navigation/PredefinedElements/ActionMenu.js +4 -31
- package/dist/components/MaterialUI/Navigation/TabBar.js +22 -103
- package/dist/components/MaterialUI/Navigation/TabLabel.js +7 -41
- package/dist/components/MaterialUI/ScopeSelector/ScopeSelector.js +7 -42
- package/dist/components/MaterialUI/ScopeSelector/ScopeTreeView.js +22 -62
- package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +16 -68
- package/dist/components/MaterialUI/Surfaces/ExpansionPanel.js +15 -55
- package/dist/components/MaterialUI/Surfaces/Paper.js +1 -31
- package/dist/components/MaterialUI/Surfaces/PredefinedElements/TitledPaper.js +3 -28
- package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +19 -62
- package/dist/components/MaterialUI/Surfaces/expansionPanelProps.js +3 -55
- package/dist/components/MaterialUI/Surfaces/paperProps.js +3 -36
- package/dist/components/MaterialUI/componentProps.js +3 -29
- package/dist/components/MaterialUI/hocs/withDeferredPopper.js +10 -59
- package/dist/components/MaterialUI/hocs/withDeferredTooltip.js +8 -44
- package/dist/components/MaterialUI/muiThemes.js +5 -57
- package/dist/components/MaterialUI/textProps.js +3 -33
- package/dist/components/Modal/Background.js +0 -19
- package/dist/components/Modal/Dialog.js +2 -26
- package/dist/components/Modal/Wrapper.js +0 -26
- package/dist/components/Modal/index.js +8 -44
- package/dist/components/Modules.js +21 -93
- package/dist/components/MultiSelector.js +21 -74
- package/dist/components/Navigation/Bar.js +29 -90
- package/dist/components/Navigation/Tab.js +22 -74
- package/dist/components/Navigation/index.js +2 -21
- package/dist/components/Navigation/useNavigationState.js +90 -173
- package/dist/components/Placeholder.js +5 -43
- package/dist/components/Provision.js +4 -36
- package/dist/components/Routing/FullPage.js +14 -37
- package/dist/components/Routing/Page.js +14 -51
- package/dist/components/Routing/Segment.js +5 -30
- package/dist/components/Routing/SegmentPage.js +26 -106
- package/dist/components/Routing/SubPage.js +22 -59
- package/dist/components/Routing/withWaypointing.js +5 -36
- package/dist/components/Scope/ScopeModificationConfirmationDialog.js +3 -30
- package/dist/components/Scope/ScopeNode.js +8 -49
- package/dist/components/Scope/Selector.js +8 -44
- package/dist/components/Scope/index.js +29 -96
- package/dist/components/Scope/useScopeConfirmationModalState.js +33 -100
- package/dist/components/Scope/useScopeData.js +0 -25
- package/dist/components/Scope/useScopeSelect.js +0 -26
- package/dist/components/Selector.js +15 -76
- package/dist/components/Sidepanel.js +0 -28
- package/dist/components/Spritesheet.js +0 -26
- package/dist/components/Switch.js +11 -51
- package/dist/components/Text.js +6 -50
- package/dist/components/ToastList.js +5 -45
- package/dist/components/Toolbar.js +16 -74
- package/dist/components/Tooltip.js +0 -24
- package/dist/components/Treeview/Branch.js +0 -25
- package/dist/components/Treeview/Label.js +0 -29
- package/dist/components/Treeview/Leaf.js +0 -21
- package/dist/components/Treeview/Node.js +17 -55
- package/dist/components/Treeview/index.js +25 -66
- package/dist/components/Treeview/settings.js +0 -17
- package/dist/constants.js +5 -18
- package/dist/content/iconsSheet.svg +22 -0
- package/dist/content/orckestra-logo-white.png +0 -0
- package/dist/getTheme.js +0 -29
- package/dist/getThemeOverrides.js +3 -22
- package/dist/hocs/routingConnector.js +0 -21
- package/dist/hocs/withAuthentication.js +4 -26
- package/dist/hocs/withClickOutside.js +2 -28
- package/dist/hocs/withErrorBoundary.js +2 -37
- package/dist/hocs/withId.js +1 -30
- package/dist/hocs/withInfiniteScroll.js +15 -32
- package/dist/hocs/withInitialLoad.js +0 -20
- package/dist/hocs/withLocaleSwitch.js +0 -19
- package/dist/hocs/withNavigationLink.js +5 -32
- package/dist/hocs/withRequestActivity.js +0 -21
- package/dist/hocs/withScopeData.js +6 -33
- package/dist/hocs/withScrollBox.js +2 -31
- package/dist/hocs/withToggle.js +9 -37
- package/dist/hocs/withUpdateHandler.js +3 -23
- package/dist/hocs/withViewState.js +5 -32
- package/dist/hooks/useDispatchWithModulesData.js +0 -26
- package/dist/hooks/useEditState.js +10 -105
- package/dist/hooks/useEntityLoader.js +18 -67
- package/dist/hooks/useFullEntityEditState.js +9 -56
- package/dist/hooks/useInfiniteScroll.js +5 -33
- package/dist/hooks/useLabelMessage.js +3 -42
- package/dist/hooks/useLoader.js +0 -27
- package/dist/hooks/useMultipleFieldEditState.js +3 -40
- package/dist/hooks/useNavigationHandler.js +3 -28
- package/dist/hooks/useNotificationRequestState.js +17 -47
- package/dist/hooks/usePreviousModified.js +0 -24
- package/dist/hooks/useRequestState.js +8 -38
- package/dist/hooks/useSelectorAndUnwrap.js +0 -23
- package/dist/hooks/useToggle.js +5 -35
- package/dist/hooks/useViewState.js +0 -23
- package/dist/index.js +1 -2
- package/dist/reducers/applications.js +0 -23
- package/dist/reducers/authentication.js +6 -37
- package/dist/reducers/countries.js +0 -25
- package/dist/reducers/localeFactory.js +0 -30
- package/dist/reducers/metadata.js +3 -63
- package/dist/reducers/modules.js +0 -36
- package/dist/reducers/navigation.js +8 -47
- package/dist/reducers/request.js +0 -28
- package/dist/reducers/requestStates.js +0 -42
- package/dist/reducers/scopes.js +0 -28
- package/dist/reducers/settings.js +4 -39
- package/dist/reducers/timezones.js +0 -25
- package/dist/reducers/toasts.js +0 -27
- package/dist/reducers/versionInfo.js +0 -24
- package/dist/reducers/view.js +36 -84
- package/dist/schemas/countries.js +0 -17
- package/dist/schemas/definitions.js +0 -17
- package/dist/schemas/metadata.js +0 -17
- package/dist/schemas/productDefinitions.js +0 -17
- package/dist/schemas/scopes.js +0 -17
- package/dist/schemas/timezones.js +0 -17
- package/dist/selectors/applications.js +0 -20
- package/dist/selectors/authentication.js +17 -41
- package/dist/selectors/countries.js +0 -22
- package/dist/selectors/locale.js +1 -29
- package/dist/selectors/metadata.js +4 -45
- package/dist/selectors/modules.js +3 -22
- package/dist/selectors/navigation.js +9 -39
- package/dist/selectors/requestStates.js +0 -22
- package/dist/selectors/requests.js +2 -22
- package/dist/selectors/route.js +0 -21
- package/dist/selectors/scope.js +0 -32
- package/dist/selectors/settings.js +0 -18
- package/dist/selectors/timezones.js +0 -19
- package/dist/selectors/versionInfo.js +0 -18
- package/dist/selectors/view.js +3 -74
- package/dist/sharedMessages.js +0 -17
- package/dist/spawnerMiddleware.js +0 -24
- package/dist/utils/buildUrl.js +7 -38
- package/dist/utils/countryHelper.js +0 -18
- package/dist/utils/curry.js +0 -19
- package/dist/utils/debounce.js +1 -20
- package/dist/utils/displayModeHelper.js +0 -24
- package/dist/utils/domHelper.js +0 -17
- package/dist/utils/flatten.js +7 -38
- package/dist/utils/index.js +0 -31
- package/dist/utils/insertIcons.js +0 -21
- package/dist/utils/localizationHelper.js +0 -26
- package/dist/utils/logPass.js +1 -22
- package/dist/utils/mapHelper.js +1 -25
- package/dist/utils/memoize.js +0 -23
- package/dist/utils/modelValidationHelper.js +3 -42
- package/dist/utils/normalizeForSearch.js +2 -19
- package/dist/utils/objectHelper.js +2 -24
- package/dist/utils/parseHelper.js +0 -32
- package/dist/utils/profilerHelper.js +0 -18
- package/dist/utils/propertyHelper.js +1 -38
- package/dist/utils/propertyValidator.js +0 -25
- package/dist/utils/requestProcessingHelper.js +0 -24
- package/dist/utils/safeGet.js +0 -18
- package/dist/utils/setTranslation.js +1 -28
- package/dist/utils/setTranslationWithFallback.js +1 -33
- package/dist/utils/stripKey.js +1 -23
- package/dist/utils/styledPropFuncs.js +3 -29
- package/dist/utils/testUtils.js +14 -91
- package/dist/utils/timezoneHelper.js +8 -46
- package/dist/utils/unwrapImmutable.js +0 -19
- package/dist/utils/urlHelper.js +3 -28
- package/dist/whyDidYouRerender.js +0 -5
- package/package.json +1 -1
- package/src/components/Routing/SubPage.js +17 -2
- package/src/components/Routing/SubPage.test.js +168 -1
- package/src/constants.js +2 -0
- package/src/content/iconsSheet.svg +22 -0
- package/src/content/orckestra-logo-white.png +0 -0
- package/src/hooks/useEditState.js +12 -2
- package/src/hooks/useEditState.test.js +1 -1
- package/src/selectors/authentication.js +13 -0
- package/src/selectors/authentication.test.js +322 -0
package/dist/utils/urlHelper.js
CHANGED
|
@@ -2,39 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.tryGetNewEntityIdKey = exports.resolveEntityId = exports.getValueFromUrlByKey = exports.NEW_ENTITY_URL_KEY = void 0;
|
|
5
|
-
|
|
6
5
|
(function () {
|
|
7
6
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
8
7
|
enterModule && enterModule(module);
|
|
9
8
|
})();
|
|
10
|
-
|
|
11
9
|
(function () {
|
|
12
10
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
13
11
|
enterModule && enterModule(module);
|
|
14
12
|
})();
|
|
15
|
-
|
|
16
13
|
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
-
|
|
18
14
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
|
-
|
|
20
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
21
|
-
|
|
15
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
22
16
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
23
17
|
return a;
|
|
24
18
|
};
|
|
25
|
-
|
|
26
19
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
27
20
|
return a;
|
|
28
21
|
};
|
|
29
|
-
|
|
30
22
|
var getValueFromUrlByKey = function getValueFromUrlByKey(url, path, key) {
|
|
31
|
-
var valuesFromUrl = url.split("/");
|
|
23
|
+
var valuesFromUrl = url.split("/");
|
|
32
24
|
|
|
25
|
+
// remove the regex of the parameters, the part between parentheses (path to regex syntax)
|
|
33
26
|
var keysFromPath = path.replace(/(\([^/]+?\))/g, "").split("/");
|
|
34
27
|
var keyIndex = keysFromPath.indexOf(key);
|
|
35
28
|
return valuesFromUrl[keyIndex];
|
|
36
29
|
};
|
|
37
|
-
|
|
38
30
|
exports.getValueFromUrlByKey = getValueFromUrlByKey;
|
|
39
31
|
var NEW_ENTITY_URL_KEY = "new";
|
|
40
32
|
/* expected url formats for new mode:
|
|
@@ -43,13 +35,10 @@ var NEW_ENTITY_URL_KEY = "new";
|
|
|
43
35
|
/new{number} => new{number}
|
|
44
36
|
/new{number}/section => new{number}
|
|
45
37
|
*/
|
|
46
|
-
|
|
47
38
|
exports.NEW_ENTITY_URL_KEY = NEW_ENTITY_URL_KEY;
|
|
48
|
-
|
|
49
39
|
var tryGetNewEntityIdKey = function tryGetNewEntityIdKey(url) {
|
|
50
40
|
var valuesFromUrl = url.split("/");
|
|
51
41
|
if (valuesFromUrl.length < 2) return;
|
|
52
|
-
|
|
53
42
|
for (var _iterator = _createForOfIteratorHelperLoose(valuesFromUrl), _step; !(_step = _iterator()).done;) {
|
|
54
43
|
var section = _step.value;
|
|
55
44
|
if (section === NEW_ENTITY_URL_KEY) return section;
|
|
@@ -57,55 +46,41 @@ var tryGetNewEntityIdKey = function tryGetNewEntityIdKey(url) {
|
|
|
57
46
|
if (match) return match[1];
|
|
58
47
|
}
|
|
59
48
|
};
|
|
60
|
-
|
|
61
49
|
exports.tryGetNewEntityIdKey = tryGetNewEntityIdKey;
|
|
62
|
-
|
|
63
50
|
var resolveEntityId = function resolveEntityId(url, path, entityIdKey) {
|
|
64
51
|
var newKey = tryGetNewEntityIdKey(url);
|
|
65
52
|
var key = entityIdKey === newKey ? entityIdKey : ":".concat(entityIdKey);
|
|
66
53
|
return getValueFromUrlByKey(url, path, key);
|
|
67
54
|
};
|
|
68
|
-
|
|
69
55
|
exports.resolveEntityId = resolveEntityId;
|
|
70
56
|
;
|
|
71
|
-
|
|
72
57
|
(function () {
|
|
73
58
|
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
74
|
-
|
|
75
59
|
if (!reactHotLoader) {
|
|
76
60
|
return;
|
|
77
61
|
}
|
|
78
|
-
|
|
79
62
|
reactHotLoader.register(getValueFromUrlByKey, "getValueFromUrlByKey", "/home/vsts/work/1/s/src/utils/urlHelper.js");
|
|
80
63
|
reactHotLoader.register(NEW_ENTITY_URL_KEY, "NEW_ENTITY_URL_KEY", "/home/vsts/work/1/s/src/utils/urlHelper.js");
|
|
81
64
|
reactHotLoader.register(tryGetNewEntityIdKey, "tryGetNewEntityIdKey", "/home/vsts/work/1/s/src/utils/urlHelper.js");
|
|
82
65
|
reactHotLoader.register(resolveEntityId, "resolveEntityId", "/home/vsts/work/1/s/src/utils/urlHelper.js");
|
|
83
66
|
})();
|
|
84
|
-
|
|
85
67
|
;
|
|
86
|
-
|
|
87
68
|
(function () {
|
|
88
69
|
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
89
70
|
leaveModule && leaveModule(module);
|
|
90
71
|
})();
|
|
91
|
-
|
|
92
72
|
;
|
|
93
|
-
|
|
94
73
|
(function () {
|
|
95
74
|
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
96
|
-
|
|
97
75
|
if (!reactHotLoader) {
|
|
98
76
|
return;
|
|
99
77
|
}
|
|
100
|
-
|
|
101
78
|
reactHotLoader.register(getValueFromUrlByKey, "getValueFromUrlByKey", "/home/vsts/work/1/s/src/utils/urlHelper.js");
|
|
102
79
|
reactHotLoader.register(NEW_ENTITY_URL_KEY, "NEW_ENTITY_URL_KEY", "/home/vsts/work/1/s/src/utils/urlHelper.js");
|
|
103
80
|
reactHotLoader.register(tryGetNewEntityIdKey, "tryGetNewEntityIdKey", "/home/vsts/work/1/s/src/utils/urlHelper.js");
|
|
104
81
|
reactHotLoader.register(resolveEntityId, "resolveEntityId", "/home/vsts/work/1/s/src/utils/urlHelper.js");
|
|
105
82
|
})();
|
|
106
|
-
|
|
107
83
|
;
|
|
108
|
-
|
|
109
84
|
(function () {
|
|
110
85
|
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
111
86
|
leaveModule && leaveModule(module);
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _react = _interopRequireDefault(require("react"));
|
|
4
|
-
|
|
5
4
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
6
|
-
|
|
7
5
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
8
6
|
return a;
|
|
9
7
|
};
|
|
10
|
-
|
|
11
8
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
12
9
|
return a;
|
|
13
10
|
};
|
|
14
|
-
|
|
15
11
|
// If you want to investigate rerenderer of components, import that file before "react-hot-loader", usually in App.js
|
|
16
12
|
if (process.env.NODE_ENV === "development") {
|
|
17
13
|
var whyDidYouRender = require("@welldone-software/why-did-you-render");
|
|
18
|
-
|
|
19
14
|
whyDidYouRender(_react.default, {
|
|
20
15
|
trackAllPureComponents: true
|
|
21
16
|
});
|
package/package.json
CHANGED
|
@@ -78,9 +78,24 @@ export const SubPage = ({ config, match, location, history, root, modulePrependP
|
|
|
78
78
|
variant={action.isPrimary ? "contained" : "outlined"}
|
|
79
79
|
color={action.isPrimary ? "primary" : "default"}
|
|
80
80
|
disableElevation={action.isPrimary}
|
|
81
|
+
disabled={action.disabled}
|
|
81
82
|
onClick={e => {
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
if (!action.handler) {
|
|
84
|
+
closeSubPage();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let actionHandlerResult = action.handler(e);
|
|
89
|
+
if (typeof actionHandlerResult === "object") {
|
|
90
|
+
// promise
|
|
91
|
+
actionHandlerResult.then(actionResult => {
|
|
92
|
+
if (action.validateBeforeClose && !actionResult) return;
|
|
93
|
+
closeSubPage();
|
|
94
|
+
});
|
|
95
|
+
} else {
|
|
96
|
+
if (action.validateBeforeClose && !actionHandlerResult) return;
|
|
97
|
+
closeSubPage();
|
|
98
|
+
}
|
|
84
99
|
}}
|
|
85
100
|
>
|
|
86
101
|
<FormattedMessage {...action.label} />
|
|
@@ -180,7 +180,6 @@ describe("SubPage", () => {
|
|
|
180
180
|
expect(history.push, "to have calls satisfying", [{ args: ["/foo"] }]);
|
|
181
181
|
expect(dispatch, "to have calls satisfying", [{ args: [mapHref("/foo", "/foo")] }]);
|
|
182
182
|
});
|
|
183
|
-
|
|
184
183
|
it("renders action panel passed from props", () => {
|
|
185
184
|
const actions = () => [{ label: sharedMessages.cancel }, { label: sharedMessages.applyChanges }];
|
|
186
185
|
|
|
@@ -262,4 +261,172 @@ describe("SubPage", () => {
|
|
|
262
261
|
expect(applyButtonClassName, "to contain", "MuiButton-containedPrimary");
|
|
263
262
|
expect(someEvent, "was called");
|
|
264
263
|
});
|
|
264
|
+
|
|
265
|
+
it("Do not close when clicking action button has validateBeforeClose and result is false", () => {
|
|
266
|
+
const applyHandler = () => false;
|
|
267
|
+
|
|
268
|
+
const actions = () => [
|
|
269
|
+
{ label: sharedMessages.applyChanges, isPrimary: true, handler: applyHandler, validateBeforeClose: true },
|
|
270
|
+
];
|
|
271
|
+
|
|
272
|
+
const component = (
|
|
273
|
+
<TestWrapper provider={{ store }} intlProvider={intlProvider} stylesProvider muiThemeProvider={{ theme }}>
|
|
274
|
+
<div>
|
|
275
|
+
<div id="outer" />
|
|
276
|
+
<Router history={history}>
|
|
277
|
+
<Route
|
|
278
|
+
path="/foo/bar"
|
|
279
|
+
render={route => (
|
|
280
|
+
<SubPage
|
|
281
|
+
config={{
|
|
282
|
+
component: InnerView,
|
|
283
|
+
set: true,
|
|
284
|
+
title: "Item Details",
|
|
285
|
+
componentProps: { actionPanel: actions },
|
|
286
|
+
}}
|
|
287
|
+
root="/foo"
|
|
288
|
+
path="/foo/bar"
|
|
289
|
+
{...route}
|
|
290
|
+
/>
|
|
291
|
+
)}
|
|
292
|
+
/>
|
|
293
|
+
</Router>
|
|
294
|
+
</div>
|
|
295
|
+
</TestWrapper>
|
|
296
|
+
);
|
|
297
|
+
const mountedComponent = mount(component);
|
|
298
|
+
|
|
299
|
+
const applyButton = mountedComponent.find("button").at(0);
|
|
300
|
+
|
|
301
|
+
applyButton.invoke("onClick")();
|
|
302
|
+
expect(history.push, "not to have calls satisfying", [{ args: ["/foo"] }]);
|
|
303
|
+
expect(dispatch, "not to have calls satisfying", [{ args: [mapHref("/foo", "/foo")] }]);
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
it("Close when clicking action button has validateBeforeClose and result is true", () => {
|
|
307
|
+
const applyHandler = () => true;
|
|
308
|
+
|
|
309
|
+
const actions = () => [
|
|
310
|
+
{ label: sharedMessages.applyChanges, isPrimary: true, handler: applyHandler, validateBeforeClose: true },
|
|
311
|
+
];
|
|
312
|
+
|
|
313
|
+
const component = (
|
|
314
|
+
<TestWrapper provider={{ store }} intlProvider={intlProvider} stylesProvider muiThemeProvider={{ theme }}>
|
|
315
|
+
<div>
|
|
316
|
+
<div id="outer" />
|
|
317
|
+
<Router history={history}>
|
|
318
|
+
<Route
|
|
319
|
+
path="/foo/bar"
|
|
320
|
+
render={route => (
|
|
321
|
+
<SubPage
|
|
322
|
+
config={{
|
|
323
|
+
component: InnerView,
|
|
324
|
+
set: true,
|
|
325
|
+
title: "Item Details",
|
|
326
|
+
componentProps: { actionPanel: actions },
|
|
327
|
+
}}
|
|
328
|
+
root="/foo"
|
|
329
|
+
path="/foo/bar"
|
|
330
|
+
{...route}
|
|
331
|
+
/>
|
|
332
|
+
)}
|
|
333
|
+
/>
|
|
334
|
+
</Router>
|
|
335
|
+
</div>
|
|
336
|
+
</TestWrapper>
|
|
337
|
+
);
|
|
338
|
+
const mountedComponent = mount(component);
|
|
339
|
+
|
|
340
|
+
const applyButton = mountedComponent.find("button").at(0);
|
|
341
|
+
|
|
342
|
+
applyButton.invoke("onClick")();
|
|
343
|
+
expect(history.push, "to have calls satisfying", [{ args: ["/foo"] }]);
|
|
344
|
+
expect(dispatch, "to have calls satisfying", [{ args: [mapHref("/foo", "/foo")] }]);
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
it("Close when clicking action button has validateBeforeClose and result as promise with true", () => {
|
|
348
|
+
const applyHandler = () => Promise.resolve(true);
|
|
349
|
+
|
|
350
|
+
const actions = () => [
|
|
351
|
+
{ label: sharedMessages.applyChanges, isPrimary: true, handler: applyHandler, validateBeforeClose: true },
|
|
352
|
+
];
|
|
353
|
+
|
|
354
|
+
const component = (
|
|
355
|
+
<TestWrapper provider={{ store }} intlProvider={intlProvider} stylesProvider muiThemeProvider={{ theme }}>
|
|
356
|
+
<div>
|
|
357
|
+
<div id="outer" />
|
|
358
|
+
<Router history={history}>
|
|
359
|
+
<Route
|
|
360
|
+
path="/foo/bar"
|
|
361
|
+
render={route => (
|
|
362
|
+
<SubPage
|
|
363
|
+
config={{
|
|
364
|
+
component: InnerView,
|
|
365
|
+
set: true,
|
|
366
|
+
title: "Item Details",
|
|
367
|
+
componentProps: { actionPanel: actions },
|
|
368
|
+
}}
|
|
369
|
+
root="/foo"
|
|
370
|
+
path="/foo/bar"
|
|
371
|
+
{...route}
|
|
372
|
+
/>
|
|
373
|
+
)}
|
|
374
|
+
/>
|
|
375
|
+
</Router>
|
|
376
|
+
</div>
|
|
377
|
+
</TestWrapper>
|
|
378
|
+
);
|
|
379
|
+
const mountedComponent = mount(component);
|
|
380
|
+
|
|
381
|
+
const applyButton = mountedComponent.find("button").at(0);
|
|
382
|
+
|
|
383
|
+
applyButton.invoke("onClick")();
|
|
384
|
+
setTimeout(() => {
|
|
385
|
+
expect(history.push, "to have calls satisfying", [{ args: ["/foo"] }]);
|
|
386
|
+
expect(dispatch, "to have calls satisfying", [{ args: [mapHref("/foo", "/foo")] }]);
|
|
387
|
+
}, 200);
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
it("Do not Close when clicking action button has validateBeforeClose and result as promise with false", () => {
|
|
391
|
+
const applyHandler = () => Promise.resolve(false);
|
|
392
|
+
|
|
393
|
+
const actions = () => [
|
|
394
|
+
{ label: sharedMessages.applyChanges, isPrimary: true, handler: applyHandler, validateBeforeClose: true },
|
|
395
|
+
];
|
|
396
|
+
|
|
397
|
+
const component = (
|
|
398
|
+
<TestWrapper provider={{ store }} intlProvider={intlProvider} stylesProvider muiThemeProvider={{ theme }}>
|
|
399
|
+
<div>
|
|
400
|
+
<div id="outer" />
|
|
401
|
+
<Router history={history}>
|
|
402
|
+
<Route
|
|
403
|
+
path="/foo/bar"
|
|
404
|
+
render={route => (
|
|
405
|
+
<SubPage
|
|
406
|
+
config={{
|
|
407
|
+
component: InnerView,
|
|
408
|
+
set: true,
|
|
409
|
+
title: "Item Details",
|
|
410
|
+
componentProps: { actionPanel: actions },
|
|
411
|
+
}}
|
|
412
|
+
root="/foo"
|
|
413
|
+
path="/foo/bar"
|
|
414
|
+
{...route}
|
|
415
|
+
/>
|
|
416
|
+
)}
|
|
417
|
+
/>
|
|
418
|
+
</Router>
|
|
419
|
+
</div>
|
|
420
|
+
</TestWrapper>
|
|
421
|
+
);
|
|
422
|
+
const mountedComponent = mount(component);
|
|
423
|
+
|
|
424
|
+
const applyButton = mountedComponent.find("button").at(0);
|
|
425
|
+
|
|
426
|
+
applyButton.invoke("onClick")();
|
|
427
|
+
setTimeout(() => {
|
|
428
|
+
expect(history.push, "not to have calls satisfying", [{ args: ["/foo"] }]);
|
|
429
|
+
expect(dispatch, "not to have calls satisfying", [{ args: [mapHref("/foo", "/foo")] }]);
|
|
430
|
+
}, 200);
|
|
431
|
+
});
|
|
265
432
|
});
|
package/src/constants.js
CHANGED
|
@@ -13,11 +13,13 @@ export const platformRoles = {
|
|
|
13
13
|
Administrator: "Administrator",
|
|
14
14
|
Editor: "Editor",
|
|
15
15
|
Reader: "Reader",
|
|
16
|
+
Recipient: "Recipient",
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
export const roleGroups = {
|
|
19
20
|
Products: "Products",
|
|
20
21
|
Orders: "Orders",
|
|
22
|
+
OrderReturn: "OrderReturn",
|
|
21
23
|
Marketing: "Marketing",
|
|
22
24
|
Analytics: "Analytics",
|
|
23
25
|
Shopping: "Shopping",
|
|
@@ -708,4 +708,26 @@
|
|
|
708
708
|
<polygon fill="#FFF" points="9.6 12 16 8.4 9.6 4.8"/>
|
|
709
709
|
</g>
|
|
710
710
|
</symbol>
|
|
711
|
+
<symbol id="icon-barcode" viewBox="0 0 25 20" xmlns="http://www.w3.org/2000/svg">
|
|
712
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.00031 16.0315C1.27645 16.0315 1.50031 16.2554 1.50031 16.5315V19.0005H3.96931C4.24545 19.0005 4.46931 19.2244 4.46931 19.5005C4.46931 19.7766 4.24545 20.0005 3.96931 20.0005H1.00031C0.724163 20.0005 0.500305 19.7766 0.500305 19.5005V16.5315C0.500305 16.2554 0.724163 16.0315 1.00031 16.0315Z" fill="#333333"/>
|
|
713
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.5 0.500244C0.5 0.224102 0.723858 0.000244141 1 0.000244141H3.969C4.24514 0.000244141 4.469 0.224102 4.469 0.500244C4.469 0.776386 4.24514 1.00024 3.969 1.00024H1.5V3.46924C1.5 3.74539 1.27614 3.96924 1 3.96924C0.723858 3.96924 0.5 3.74539 0.5 3.46924V0.500244Z" fill="#333333"/>
|
|
714
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.5313 0.5C20.5313 0.223858 20.7552 0 21.0313 0H24.0003C24.2765 0 24.5003 0.223858 24.5003 0.5V3.469C24.5003 3.74514 24.2765 3.969 24.0003 3.969C23.7242 3.969 23.5003 3.74514 23.5003 3.469V1H21.0313C20.7552 1 20.5313 0.776142 20.5313 0.5Z" fill="#333333"/>
|
|
715
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M24.0005 16.0312C24.2766 16.0312 24.5005 16.2551 24.5005 16.5312V19.5002C24.5005 19.7764 24.2766 20.0002 24.0005 20.0002H21.0315C20.7554 20.0002 20.5315 19.7764 20.5315 19.5002C20.5315 19.2241 20.7554 19.0002 21.0315 19.0002H23.5005V16.5312C23.5005 16.2551 23.7244 16.0312 24.0005 16.0312Z" fill="#333333"/>
|
|
716
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.50031 15.0002V5.00024H4.50031V15.0002H3.50031Z" fill="#333333"/>
|
|
717
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.50031 12.0002V5.00024H6.50031V12.0002H5.50031Z" fill="#333333"/>
|
|
718
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.50031 12.0002V5.00024H8.50031V12.0002H7.50031Z" fill="#333333"/>
|
|
719
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.5003 12.0002V5.00024H11.5003V12.0002H10.5003Z" fill="#333333"/>
|
|
720
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.5003 12.0002V5.00024H13.5003V12.0002H12.5003Z" fill="#333333"/>
|
|
721
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.5003 12.0002V5.00024H15.5003V12.0002H14.5003Z" fill="#333333"/>
|
|
722
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.5003 12.0002V5.00024H17.5003V12.0002H16.5003Z" fill="#333333"/>
|
|
723
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.5003 12.0002V5.00024H19.5003V12.0002H18.5003Z" fill="#333333"/>
|
|
724
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.5003 15.0002V5.00024H21.5003V15.0002H20.5003Z" fill="#333333"/>
|
|
725
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.50031 13.0002H5.50031V14.0002H6.50031V13.0002Z" fill="#333333"/>
|
|
726
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.50031 13.0002H7.50031V14.0002H8.50031V13.0002Z" fill="#333333"/>
|
|
727
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.5003 13.0002H10.5003V14.0002H11.5003V13.0002Z" fill="#333333"/>
|
|
728
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.5003 13.0002H12.5003V14.0002H13.5003V13.0002Z" fill="#333333"/>
|
|
729
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.5003 13.0002H14.5003V14.0002H15.5003V13.0002Z" fill="#333333"/>
|
|
730
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.5003 13.0002H16.5003V14.0002H17.5003V13.0002Z" fill="#333333"/>
|
|
731
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.5003 13.0002H18.5003V14.0002H19.5003V13.0002Z" fill="#333333"/>
|
|
732
|
+
</symbol>
|
|
711
733
|
</svg>
|
|
Binary file
|
|
@@ -190,8 +190,18 @@ export const useDynamicEditState = (entityId, sectionName, extendedValidationRul
|
|
|
190
190
|
};
|
|
191
191
|
|
|
192
192
|
const resetEditState = (path = []) => {
|
|
193
|
-
const
|
|
194
|
-
|
|
193
|
+
const pathToField = getValidPath(path);
|
|
194
|
+
const fullPath = !path.length ? [...keys] : [...keys, "value", ...pathToField];
|
|
195
|
+
|
|
196
|
+
const initialFieldValue = !path.length ? initialValue : get(initialValue, pathToField);
|
|
197
|
+
|
|
198
|
+
dispatchWithModulesData(setEditModelField, [
|
|
199
|
+
fullPath,
|
|
200
|
+
initialFieldValue,
|
|
201
|
+
initialFieldValue,
|
|
202
|
+
entityId,
|
|
203
|
+
sectionName,
|
|
204
|
+
]);
|
|
195
205
|
};
|
|
196
206
|
|
|
197
207
|
const isEditStateValid = (value, path = [], errorTypes = [], dependencies = {}) => {
|
|
@@ -1171,7 +1171,7 @@ describe("useDynamicEditState", () => {
|
|
|
1171
1171
|
expect(useDispatchWithModulesDataSpy, "to have a call satisfying", {
|
|
1172
1172
|
args: [
|
|
1173
1173
|
setEditModelField,
|
|
1174
|
-
[["field", "value", "c", "d"], initialFieldValue, initialFieldValue, entityId, sectionName],
|
|
1174
|
+
[["field", "value", "c", "d"], initialFieldValue.c.d, initialFieldValue.c.d, entityId, sectionName],
|
|
1175
1175
|
],
|
|
1176
1176
|
});
|
|
1177
1177
|
|
|
@@ -42,6 +42,19 @@ export const hasEditorPermissionsForScope = (scope, roleGroup) =>
|
|
|
42
42
|
hasRolePermissions(appRolesClaims, scope, platformRoles.Editor, scopes),
|
|
43
43
|
);
|
|
44
44
|
|
|
45
|
+
export const hasPermissionsForRole = (roleGroup, role) =>
|
|
46
|
+
createSelector(
|
|
47
|
+
selectGroupRolesClaims(roleGroup),
|
|
48
|
+
getCurrentScope,
|
|
49
|
+
getScopesSelector,
|
|
50
|
+
(appRolesClaims, currentScope, scopes) => hasRolePermissions(appRolesClaims, currentScope, role, scopes),
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
export const hasPermissionsForRoleAndScope = (scope, roleGroup, role) =>
|
|
54
|
+
createSelector(selectGroupRolesClaims(roleGroup), getScopesSelector, (appRolesClaims, scopes) =>
|
|
55
|
+
hasRolePermissions(appRolesClaims, scope, role, scopes),
|
|
56
|
+
);
|
|
57
|
+
|
|
45
58
|
export const hasAdministratorPermissions = roleGroup =>
|
|
46
59
|
createSelector(
|
|
47
60
|
selectGroupRolesClaims(roleGroup),
|