@redhat-cloud-services/frontend-components-utilities 3.2.20 → 3.2.23
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/MiddlewareListener/MiddlewareListener.d.ts +1 -1
- package/RBAC/RBAC.d.ts +1 -1
- package/RBACHook/RBACHook.js +11 -6
- package/ReducerRegistry/ReducerRegistry.d.ts +1 -1
- package/esm/RBACHook/RBACHook.js +13 -8
- package/esm/ReducerRegistry/ReducerRegistry.js +1 -1
- package/esm/RouterParams/RouterParams.js +1 -1
- package/esm/interceptors/interceptors.js +1 -1
- package/esm/inventoryDependencies/inventoryDependencies.js +1 -1
- package/esm/useInventory/useInventory.js +2 -2
- package/package.json +2 -2
package/RBAC/RBAC.d.ts
CHANGED
package/RBACHook/RBACHook.js
CHANGED
|
@@ -59,6 +59,7 @@ function usePermissions(appName, permissionsList, disableCache, checkAll) {
|
|
|
59
59
|
permissions: [],
|
|
60
60
|
}), permissions = _a[0], setPermissions = _a[1];
|
|
61
61
|
(0, react_1.useEffect)(function () {
|
|
62
|
+
var ignore = false;
|
|
62
63
|
setPermissions(function (prev) { return (__assign(__assign({}, prev), { isLoading: true })); });
|
|
63
64
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
64
65
|
var _a, isOrgAdmin, userPermissions;
|
|
@@ -67,16 +68,20 @@ function usePermissions(appName, permissionsList, disableCache, checkAll) {
|
|
|
67
68
|
case 0: return [4, (0, RBAC_1.getRBAC)(appName, disableCache)];
|
|
68
69
|
case 1:
|
|
69
70
|
_a = _b.sent(), isOrgAdmin = _a.isOrgAdmin, userPermissions = _a.permissions;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
!ignore &&
|
|
72
|
+
setPermissions({
|
|
73
|
+
isLoading: false,
|
|
74
|
+
isOrgAdmin: isOrgAdmin,
|
|
75
|
+
permissions: userPermissions,
|
|
76
|
+
hasAccess: checkAll ? (0, RBAC_1.hasAllPermissions)(userPermissions, permissionsList) : (0, RBAC_1.doesHavePermissions)(userPermissions, permissionsList),
|
|
77
|
+
});
|
|
76
78
|
return [2];
|
|
77
79
|
}
|
|
78
80
|
});
|
|
79
81
|
}); })();
|
|
82
|
+
return function () {
|
|
83
|
+
ignore = true;
|
|
84
|
+
};
|
|
80
85
|
}, [appName, disableCache]);
|
|
81
86
|
return permissions;
|
|
82
87
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActionCreator, Middleware, Reducer, Store, compose } from 'redux';
|
|
2
2
|
export declare function applyReducerHash(reducerHash: any, initialState?: Record<string, unknown>): (state: Record<string, unknown> | undefined, action: {
|
|
3
3
|
type: PropertyKey;
|
|
4
4
|
}) => any;
|
package/esm/RBACHook/RBACHook.js
CHANGED
|
@@ -45,8 +45,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
48
|
+
import { useEffect, useState } from 'react';
|
|
49
|
+
import { doesHavePermissions, getRBAC, hasAllPermissions } from '../RBAC';
|
|
50
50
|
export function usePermissions(appName, permissionsList, disableCache, checkAll) {
|
|
51
51
|
var _this = this;
|
|
52
52
|
var _a = useState({
|
|
@@ -56,6 +56,7 @@ export function usePermissions(appName, permissionsList, disableCache, checkAll)
|
|
|
56
56
|
permissions: [],
|
|
57
57
|
}), permissions = _a[0], setPermissions = _a[1];
|
|
58
58
|
useEffect(function () {
|
|
59
|
+
var ignore = false;
|
|
59
60
|
setPermissions(function (prev) { return (__assign(__assign({}, prev), { isLoading: true })); });
|
|
60
61
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
61
62
|
var _a, isOrgAdmin, userPermissions;
|
|
@@ -64,16 +65,20 @@ export function usePermissions(appName, permissionsList, disableCache, checkAll)
|
|
|
64
65
|
case 0: return [4, getRBAC(appName, disableCache)];
|
|
65
66
|
case 1:
|
|
66
67
|
_a = _b.sent(), isOrgAdmin = _a.isOrgAdmin, userPermissions = _a.permissions;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
!ignore &&
|
|
69
|
+
setPermissions({
|
|
70
|
+
isLoading: false,
|
|
71
|
+
isOrgAdmin: isOrgAdmin,
|
|
72
|
+
permissions: userPermissions,
|
|
73
|
+
hasAccess: checkAll ? hasAllPermissions(userPermissions, permissionsList) : doesHavePermissions(userPermissions, permissionsList),
|
|
74
|
+
});
|
|
73
75
|
return [2];
|
|
74
76
|
}
|
|
75
77
|
});
|
|
76
78
|
}); })();
|
|
79
|
+
return function () {
|
|
80
|
+
ignore = true;
|
|
81
|
+
};
|
|
77
82
|
}, [appName, disableCache]);
|
|
78
83
|
return permissions;
|
|
79
84
|
}
|
|
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { applyMiddleware, combineReducers,
|
|
12
|
+
import { applyMiddleware, combineReducers, compose, createStore } from 'redux';
|
|
13
13
|
export function applyReducerHash(reducerHash, initialState) {
|
|
14
14
|
if (initialState === void 0) { initialState = {}; }
|
|
15
15
|
return function (state, action) {
|
|
@@ -37,7 +37,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
37
37
|
};
|
|
38
38
|
import React from 'react';
|
|
39
39
|
import PropTypes from 'prop-types';
|
|
40
|
-
import {
|
|
40
|
+
import { matchPath, withRouter } from 'react-router-dom';
|
|
41
41
|
import { connect } from 'react-redux';
|
|
42
42
|
import isEqual from 'lodash/isEqual';
|
|
43
43
|
var RouterParams = (function (_super) {
|
|
@@ -61,7 +61,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
import axios from 'axios';
|
|
64
|
-
import {
|
|
64
|
+
import { captureException, configureScope } from '@sentry/browser';
|
|
65
65
|
var HttpError = (function (_super) {
|
|
66
66
|
__extends(HttpError, _super);
|
|
67
67
|
function HttpError(description) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Badge, Bullseye, Button, Checkbox,
|
|
1
|
+
import { Badge, Bullseye, Button, Checkbox, Chip, ChipGroup, ClipboardCopy, Drawer, DrawerActions, DrawerCloseButton, DrawerContent, DrawerContentBody, DrawerHead, DrawerPanelBody, DrawerPanelContent, Dropdown, DropdownItem, DropdownPosition, DropdownToggle, DropdownToggleCheckbox, EmptyState, EmptyStateBody, EmptyStateIcon, EmptyStateVariant, Flex, FlexItem, Form, FormGroup, FormSelect, FormSelectOption, Grid, GridItem, KebabToggle, Label, Level, LevelItem, Modal, Pagination, PaginationVariant, Radio, Select, SelectGroup, SelectOption, SelectVariant, Spinner, Split, SplitItem, Stack, StackItem, Switch, Tab, Tabs, TextInput, Title, Toolbar, ToolbarContent, ToolbarGroup, ToolbarItem, Tooltip, } from '@patternfly/react-core';
|
|
2
2
|
import { CubesIcon, ExclamationTriangleIcon } from '@patternfly/react-icons';
|
|
3
3
|
export var reactIcons = {
|
|
4
4
|
CubesIcon: CubesIcon,
|
|
@@ -45,9 +45,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
import {
|
|
48
|
+
import { useEffect, useState } from 'react';
|
|
49
49
|
import * as reactRouterDom from 'react-router-dom';
|
|
50
|
-
import { Table as PfTable,
|
|
50
|
+
import { Table as PfTable, SortByDirection, TableBody, TableGridBreakpoint, TableHeader, TableVariant, cellWidth, expandable, sortable, } from '@patternfly/react-table';
|
|
51
51
|
console.error('"useInventory" hook is deprecated and will be removed in v4. Please use Chrome 2.0 compatible Inventory version.');
|
|
52
52
|
export var useInventory = function (_a) {
|
|
53
53
|
var store = _a.store, tableReducer = _a.tableReducer, detailReducer = _a.detailReducer, getRegistry = _a.getRegistry;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redhat-cloud-services/frontend-components-utilities",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.23",
|
|
4
4
|
"description": "Util functions for RedHat Cloud Services project.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@sentry/browser": "^5.4.0",
|
|
40
|
-
"@redhat-cloud-services/types": "0.0.
|
|
40
|
+
"@redhat-cloud-services/types": "^0.0.5",
|
|
41
41
|
"awesome-debounce-promise": "^2.1.0",
|
|
42
42
|
"axios": "^0.25.0",
|
|
43
43
|
"commander": ">=2.20.0",
|