@rh-support/manage 0.2.22 → 0.2.26
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/lib/esm/ManageTabs.d.ts.map +1 -1
- package/lib/esm/ManageTabs.js +14 -1
- package/lib/esm/Routes.d.ts +1 -0
- package/lib/esm/Routes.d.ts.map +1 -1
- package/lib/esm/Routes.js +6 -0
- package/lib/esm/components/Configs/ConfigInLineEdit.d.ts +10 -0
- package/lib/esm/components/Configs/ConfigInLineEdit.d.ts.map +1 -0
- package/lib/esm/components/Configs/ConfigInLineEdit.js +40 -0
- package/lib/esm/components/Configs/ConfigSwitch.d.ts +10 -0
- package/lib/esm/components/Configs/ConfigSwitch.d.ts.map +1 -0
- package/lib/esm/components/Configs/ConfigSwitch.js +20 -0
- package/lib/esm/components/Configs/ConfigsTable.d.ts +2 -0
- package/lib/esm/components/Configs/ConfigsTable.d.ts.map +1 -0
- package/lib/esm/components/Configs/ConfigsTable.js +124 -0
- package/lib/esm/components/Configs/index.d.ts +2 -0
- package/lib/esm/components/Configs/index.d.ts.map +1 -0
- package/lib/esm/components/Configs/index.js +1 -0
- package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts.map +1 -1
- package/lib/esm/components/Groups/GroupSelect/GroupSelect.js +2 -1
- package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.d.ts.map +1 -1
- package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +3 -2
- package/lib/esm/constants/Configs.d.ts +3 -0
- package/lib/esm/constants/Configs.d.ts.map +1 -0
- package/lib/esm/constants/Configs.js +2 -0
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageTabs.d.ts","sourceRoot":"","sources":["../../src/ManageTabs.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ManageTabs.d.ts","sourceRoot":"","sources":["../../src/ManageTabs.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAsBvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;CACvC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,eA0JvC"}
|
package/lib/esm/ManageTabs.js
CHANGED
|
@@ -4,6 +4,7 @@ import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-supp
|
|
|
4
4
|
import { CustomElements, getConfigField, PCM_CONFIG_FIELD_TYPE, requireCustomElement } from '@rh-support/utils';
|
|
5
5
|
import map from 'lodash/map';
|
|
6
6
|
import React, { useContext } from 'react';
|
|
7
|
+
import { ConfigsTable } from './components/Configs/ConfigsTable';
|
|
7
8
|
import { ManageGroupUsers } from './components/Groups/ManageGroupUsers';
|
|
8
9
|
import { ManageBookmarkedAccountsTab, ManageGroupedBookmarkedAccountsTab, } from './components/ManageBookmarkedAccountsTab';
|
|
9
10
|
import { ManagePreferences } from './components/ManagePreferences';
|
|
@@ -21,7 +22,7 @@ requireCustomElement([
|
|
|
21
22
|
export function ManageTabs(props) {
|
|
22
23
|
var _a, _b;
|
|
23
24
|
const history = props.routeProps.history;
|
|
24
|
-
const { groupsRoute, bookmarkedAccountsRoute, topContentRoute, notificationEmailsRoute, preferencesRoute } = Routes.getPaths();
|
|
25
|
+
const { groupsRoute, bookmarkedAccountsRoute, topContentRoute, notificationEmailsRoute, preferencesRoute, configsRoute, } = Routes.getPaths();
|
|
25
26
|
const { globalMetadataState: { pcmConfig }, } = useContext(GlobalMetadataStateContext);
|
|
26
27
|
const isGroupBookmarkEnabled = getConfigField(pcmConfig.data, 'isGroupBookmarkEnabled', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
|
|
27
28
|
const isPreferencesPageEnabled = getConfigField(pcmConfig.data, 'allowPreferencesPage', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
|
|
@@ -38,6 +39,7 @@ export function ManageTabs(props) {
|
|
|
38
39
|
const canManageBookmarkAccounts = ability.can(resourceActions.CREATE, resources.BOOKMARK_ACCOUNTS) && canViewManageTab;
|
|
39
40
|
const canViewEmailNotificationTab = ability.can(resourceActions.READ, resources.NOTIFICATION_EMAIL);
|
|
40
41
|
const canAddCustomNotification = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS);
|
|
42
|
+
const canViewConfigsTab = ability.can(resourceActions.READ, resources.APP_INTERNAL_CONFIGS);
|
|
41
43
|
const tabsToRender = [];
|
|
42
44
|
canManageBookmarkAccounts &&
|
|
43
45
|
tabsToRender.push({
|
|
@@ -95,6 +97,17 @@ export function ManageTabs(props) {
|
|
|
95
97
|
},
|
|
96
98
|
component: React.createElement(TopContentManagement, null),
|
|
97
99
|
});
|
|
100
|
+
canViewConfigsTab &&
|
|
101
|
+
tabsToRender.push({
|
|
102
|
+
title: 'Internal Configs',
|
|
103
|
+
key: 'pcm-internal-configs-tab',
|
|
104
|
+
'data-tracking-id': 'pcm-config-admin-tab',
|
|
105
|
+
routePath: configsRoute,
|
|
106
|
+
onClick: () => {
|
|
107
|
+
changeRouteThunk(configsRoute);
|
|
108
|
+
},
|
|
109
|
+
component: React.createElement(ConfigsTable, null),
|
|
110
|
+
});
|
|
98
111
|
/**
|
|
99
112
|
* Render without tabs if there is only one element
|
|
100
113
|
*/
|
package/lib/esm/Routes.d.ts
CHANGED
package/lib/esm/Routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Routes.d.ts","sourceRoot":"","sources":["../../src/Routes.ts"],"names":[],"mappings":"AAAA,UAAU,KAAK;IACX,QAAQ,CAAC,OAAO,EAAE,MAAM,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,YAAY;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,KAAK,CAAC;IAC1B,eAAe,EAAE,KAAK,CAAC;IACvB,QAAQ,EAAE,MAAM;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC1C,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;IAC9B,MAAM,EAAE,KAAK,CAAC;IACd,aAAa,EAAE,KAAK,CAAC;IACrB,UAAU,EAAE,KAAK,CAAC;IAClB,WAAW,EAAE,KAAK,CAAC;IACnB,kBAAkB,EAAE,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"Routes.d.ts","sourceRoot":"","sources":["../../src/Routes.ts"],"names":[],"mappings":"AAAA,UAAU,KAAK;IACX,QAAQ,CAAC,OAAO,EAAE,MAAM,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,YAAY;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,KAAK,CAAC;IAC1B,eAAe,EAAE,KAAK,CAAC;IACvB,QAAQ,EAAE,MAAM;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC1C,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;IAC9B,MAAM,EAAE,KAAK,CAAC;IACd,aAAa,EAAE,KAAK,CAAC;IACrB,UAAU,EAAE,KAAK,CAAC;IAClB,WAAW,EAAE,KAAK,CAAC;IACnB,kBAAkB,EAAE,KAAK,CAAC;IAC1B,OAAO,EAAE,KAAK,CAAC;CAClB;AAED,eAAO,MAAM,MAAM,EAAE,YAmEpB,CAAC"}
|
package/lib/esm/Routes.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface IProps {
|
|
2
|
+
id: number;
|
|
3
|
+
onSave: (fieldName: string, fieldValue: string, id: number) => void;
|
|
4
|
+
isUpdating: boolean;
|
|
5
|
+
fieldName: string;
|
|
6
|
+
fieldValue: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ConfigInLineEdit(props: IProps): JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=ConfigInLineEdit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigInLineEdit.d.ts","sourceRoot":"","sources":["../../../../src/components/Configs/ConfigInLineEdit.tsx"],"names":[],"mappings":"AAKA,UAAU,MAAM;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAqD7C"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { InlineEdit, LoadingIndicator, TextAreaAutosize } from '@rh-support/components';
|
|
11
|
+
import React, { useEffect, useState } from 'react';
|
|
12
|
+
import { CONFIG_FIELD_VALUE_LIMIT } from '../../constants/Configs';
|
|
13
|
+
export function ConfigInLineEdit(props) {
|
|
14
|
+
const [input, setInput] = useState(props.fieldValue);
|
|
15
|
+
const [hasLargeInput, setHasLargeInput] = useState(false);
|
|
16
|
+
const onSave = () => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
props.onSave(props.fieldName, input, props.id);
|
|
18
|
+
});
|
|
19
|
+
const onCancel = () => {
|
|
20
|
+
setInput(props.fieldValue);
|
|
21
|
+
};
|
|
22
|
+
const onChange = (e) => {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
const inputValue = (_b = (_a = e.target.value) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '';
|
|
25
|
+
setHasLargeInput(inputValue.length > CONFIG_FIELD_VALUE_LIMIT);
|
|
26
|
+
setInput(inputValue);
|
|
27
|
+
};
|
|
28
|
+
// when user filter search result if the textarea is open, need to update the internal state
|
|
29
|
+
// otherwise it shows wrong content
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setInput(props.fieldValue);
|
|
32
|
+
}, [props.fieldValue]);
|
|
33
|
+
return (React.createElement(React.Fragment, null,
|
|
34
|
+
React.createElement(InlineEdit, { labelProps: { htmlFor: 'case-details-custom-email' }, allowInlineEdit: true, initialIsEditing: false, onSave: onSave, onCancel: onCancel, saveDisabled: input === props.fieldValue || props.isUpdating || hasLargeInput, loadingIndicator: React.createElement(LoadingIndicator, { show: props.isUpdating, isInline: true }) },
|
|
35
|
+
React.createElement(TextAreaAutosize, { id: `config-value-${props.id}`, name: `config-value-${props.id}`, "aria-invalid": hasLargeInput, className: `form-control${hasLargeInput ? ' form-invalid' : ''}`, value: input, "data-tracking-id": "open-case-describe-ktQ1-issue", onChange: onChange, disabled: props.isUpdating }),
|
|
36
|
+
hasLargeInput && (React.createElement("p", { className: "form-instructions form-invalid" },
|
|
37
|
+
"Config value cannot be more than ",
|
|
38
|
+
CONFIG_FIELD_VALUE_LIMIT,
|
|
39
|
+
" characters")))));
|
|
40
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface IProps {
|
|
2
|
+
id: number;
|
|
3
|
+
onChange: (fieldName: string, fieldValue: string, id: number) => void;
|
|
4
|
+
isChecked: boolean;
|
|
5
|
+
isUpdating: boolean;
|
|
6
|
+
fieldName: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ConfigSwitch(props: IProps): JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=ConfigSwitch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/Configs/ConfigSwitch.tsx"],"names":[],"mappings":"AAIA,UAAU,MAAM;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,eAiBzC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Switch } from '@patternfly/react-core';
|
|
11
|
+
import { LoadingIndicator } from '@rh-support/components';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
export function ConfigSwitch(props) {
|
|
14
|
+
const onSwitchChange = (isChecked) => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
props.onChange(props.fieldName, isChecked ? '1' : '0', props.id);
|
|
16
|
+
});
|
|
17
|
+
return (React.createElement(React.Fragment, null,
|
|
18
|
+
React.createElement(Switch, { id: `${props.id}`, isChecked: props.isChecked, onChange: onSwitchChange, isDisabled: props.isUpdating, "aria-label": props.fieldName }),
|
|
19
|
+
props.isUpdating && React.createElement(LoadingIndicator, { isInline: true })));
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigsTable.d.ts","sourceRoot":"","sources":["../../../../src/components/Configs/ConfigsTable.tsx"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY,mBAyJxB,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { configuration, maintenance } from '@cee-eng/hydrajs';
|
|
11
|
+
import { SearchInput } from '@patternfly/react-core';
|
|
12
|
+
import { defaultTableSortMethod, ErrorBoundary, ToastNotification, useFetch } from '@rh-support/components/';
|
|
13
|
+
import { formatDate } from '@rh-support/utils';
|
|
14
|
+
import isEmpty from 'lodash/isEmpty';
|
|
15
|
+
import React, { useEffect, useState } from 'react';
|
|
16
|
+
import { Trans } from 'react-i18next';
|
|
17
|
+
import { ManageTable } from '../ManageTable/ManageTable';
|
|
18
|
+
import { ConfigInLineEdit } from './ConfigInLineEdit';
|
|
19
|
+
import { ConfigSwitch } from './ConfigSwitch';
|
|
20
|
+
export const ConfigsTable = () => {
|
|
21
|
+
const [configValues, setConfigValues] = useState([]);
|
|
22
|
+
const [filteredValues, setFilteredValues] = useState([]);
|
|
23
|
+
const [searchString, setSearchString] = useState('');
|
|
24
|
+
const [keepPageNumberOnDataChange, setKeepPageNumberOnDataChange] = useState(undefined);
|
|
25
|
+
const { request: getConfigs, isFetching } = useFetch(configuration.getConfig);
|
|
26
|
+
const { request: updateConfig, isFetching: isUpdating } = useFetch(maintenance.updateHydraConfiguration, {
|
|
27
|
+
propgateErrors: true,
|
|
28
|
+
});
|
|
29
|
+
const configType = "pcm_configurations" /* pcm_configurations */;
|
|
30
|
+
const onSearchChange = (str) => {
|
|
31
|
+
setKeepPageNumberOnDataChange(false);
|
|
32
|
+
setSearchString(str);
|
|
33
|
+
};
|
|
34
|
+
const onUpdate = (fieldName, fieldValue, id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
+
try {
|
|
36
|
+
yield updateConfig({
|
|
37
|
+
id,
|
|
38
|
+
type: configType,
|
|
39
|
+
fieldName,
|
|
40
|
+
fieldValue,
|
|
41
|
+
});
|
|
42
|
+
ToastNotification.addSuccessMessage('Successfully updated config');
|
|
43
|
+
const updatedData = configValues.map((config) => {
|
|
44
|
+
if (config.id === id) {
|
|
45
|
+
return Object.assign(Object.assign({}, config), { fieldValue });
|
|
46
|
+
}
|
|
47
|
+
return config;
|
|
48
|
+
});
|
|
49
|
+
setKeepPageNumberOnDataChange(true);
|
|
50
|
+
setConfigValues(updatedData);
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
ToastNotification.addDangerMessage('Failed to update config');
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const columns = [
|
|
57
|
+
{
|
|
58
|
+
accessor: (data) => data.fieldName,
|
|
59
|
+
id: 'config-name',
|
|
60
|
+
title: 'Configuration',
|
|
61
|
+
cellWidth: 20,
|
|
62
|
+
sortable: true,
|
|
63
|
+
sortMethod: (a, b) => {
|
|
64
|
+
const aname = a.toLowerCase();
|
|
65
|
+
const bname = b.toLowerCase();
|
|
66
|
+
return defaultTableSortMethod(aname, bname);
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
cell: (data) => () => {
|
|
71
|
+
const value = data.fieldValue;
|
|
72
|
+
const name = data.fieldName;
|
|
73
|
+
if (value === '0' || value === '1') {
|
|
74
|
+
return (React.createElement(ConfigSwitch, { id: data.id, isChecked: value === '1' ? true : false, onChange: onUpdate, isUpdating: isUpdating, fieldName: name }));
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
return (React.createElement(ConfigInLineEdit, { id: data.id, onSave: onUpdate, isUpdating: isUpdating, fieldName: name, fieldValue: value }));
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
id: 'config-value',
|
|
81
|
+
title: 'Value',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
accessor: (data) => formatDate(data.createdDate),
|
|
85
|
+
id: 'created-date',
|
|
86
|
+
title: 'Created Date',
|
|
87
|
+
cellWidth: 15,
|
|
88
|
+
sortable: true,
|
|
89
|
+
sortMethod: (a, b) => {
|
|
90
|
+
const aDate = new Date(a);
|
|
91
|
+
const bDate = new Date(b);
|
|
92
|
+
return defaultTableSortMethod(aDate, bDate);
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
const loadConfig = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
98
|
+
const data = yield getConfigs(configType);
|
|
99
|
+
setConfigValues(data);
|
|
100
|
+
setFilteredValues(data);
|
|
101
|
+
});
|
|
102
|
+
loadConfig();
|
|
103
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
104
|
+
}, [configType]);
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
if (!isEmpty(searchString)) {
|
|
107
|
+
const filteredValues = configValues.filter((c) => c.fieldName.toLowerCase().includes(searchString.toLowerCase()));
|
|
108
|
+
setFilteredValues(filteredValues);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
setFilteredValues(configValues);
|
|
112
|
+
}
|
|
113
|
+
}, [searchString, configValues]);
|
|
114
|
+
return (React.createElement("section", { id: "notification-emails" },
|
|
115
|
+
React.createElement("header", null,
|
|
116
|
+
React.createElement("h2", null, "Internal app configs"),
|
|
117
|
+
"Edit app configs that used as flags or other settings here."),
|
|
118
|
+
React.createElement("div", { className: "toolbar" },
|
|
119
|
+
React.createElement("div", { className: "toolbar-right" },
|
|
120
|
+
React.createElement("label", { htmlFor: "search-config-filelds" }, "Filter by"),
|
|
121
|
+
React.createElement(SearchInput, { className: "pf-u-flex-grow-1 pf-c-search-input pf-u-background-color-100", id: "search-config-filelds", placeholder: "Search for an existing config name", value: searchString, onChange: onSearchChange, onClear: () => onSearchChange(''), "aria-label": "Search for an existing config name" }))),
|
|
122
|
+
React.createElement(ErrorBoundary, { errorMsgInfo: { message: 'There was an error loading config page' } },
|
|
123
|
+
React.createElement(ManageTable, { sortInfo: { column: 'created-date', direction: 'desc' }, ariaLabel: 'Table to manage pcm config', columns: columns, data: filteredValues, isFetching: isFetching, isError: false, errorTitle: 'Config table error', errorComponent: React.createElement(Trans, null, "Could not get configs"), keepPageNumberOnDataChange: keepPageNumberOnDataChange }))));
|
|
124
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Configs/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ConfigsTable';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/GroupSelect/GroupSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AA0B3E,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD;AAKD,eAAO,MAAM,WAAW,UAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"GroupSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/GroupSelect/GroupSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AA0B3E,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD;AAKD,eAAO,MAAM,WAAW,UAAW,MAAM,gBAmbxC,CAAC"}
|
|
@@ -310,7 +310,8 @@ export const GroupSelect = (props) => {
|
|
|
310
310
|
return (React.createElement("div", { ref: manageActionsRef, className: "toolbar-left" },
|
|
311
311
|
showErrorMessage && (React.createElement(AlertMessage, { variant: AlertType.DANGER, title: t('Could not create group'), show: true })),
|
|
312
312
|
!showErrorMessage && !showInput && (React.createElement(React.Fragment, null,
|
|
313
|
-
React.createElement("label", null,
|
|
313
|
+
React.createElement("label", null,
|
|
314
|
+
React.createElement(Trans, null, "Group")),
|
|
314
315
|
React.createElement(Select, { variant: SelectVariant.typeahead, isDisabled: caseGroups.isFetching || caseGroups.isError || props.isDisabled || disableOnFetch, "aria-label": "Select a group to view accounts", onToggle: toggleIsOpen, onSelect: onSelect, onClear: onClear, noResultsFoundText: t('No results found'), selections: selectedGroup, isOpen: isOpen, "aria-labelledby": selectAGroupText, placeholderText: selectAGroupText, "data-tracking-id": "group-list-selector" }, (caseGroups.data || [])
|
|
315
316
|
.filter((g) => g.groupNum !== unGroupedCaseGroupNumber)
|
|
316
317
|
.map((data, index) => (React.createElement(SelectOption, { key: index, isSelected: data.name === selectedGroup, value: data.name }, data.name)))))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageGroupUsers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/ManageGroupUsers/ManageGroupUsers.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ManageGroupUsers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/ManageGroupUsers/ManageGroupUsers.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,gBAAgB,mBA+L5B,CAAC"}
|
|
@@ -22,7 +22,7 @@ export const ManageGroupUsers = () => {
|
|
|
22
22
|
const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights }, } = useGlobalStateContext();
|
|
23
23
|
const disableGroupSelect = !loggedInUsersAccount || !loggedInUsersAccount.data || !loggedInUsersAccount.data.accountNumber;
|
|
24
24
|
const [selectedGroup, setSelectedGroup] = useState();
|
|
25
|
-
const { clearResponse, isFetching, request, data: response } = useFetch(publicApi.caseGroups.getCaseGroupUsers);
|
|
25
|
+
const { clearResponse, isFetching, request, data: response, } = useFetch(publicApi.caseGroups.getCaseGroupUsers);
|
|
26
26
|
const groupUsers = useMemo(() => response || [], [response]);
|
|
27
27
|
// errors
|
|
28
28
|
function onPermissionError(error, user) {
|
|
@@ -139,7 +139,8 @@ export const ManageGroupUsers = () => {
|
|
|
139
139
|
React.createElement("div", { className: "toolbar" },
|
|
140
140
|
React.createElement(GroupSelect, { isDisabled: isFetching || disableGroupSelect, onSelect: onGroupSelect }),
|
|
141
141
|
React.createElement("span", { className: "toolbar-right" },
|
|
142
|
-
React.createElement("label", { htmlFor: "account-group-filter" },
|
|
142
|
+
React.createElement("label", { htmlFor: "account-group-filter" },
|
|
143
|
+
React.createElement(Trans, null, "Filter by")),
|
|
143
144
|
React.createElement(Input, { id: "account-group-filter", isDisabled: isFetching || !selectedGroup, onChange: onGroupUserSearch, placeholder: t('Search for people in this group'), ariaLabel: "Group search input" }))),
|
|
144
145
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading group users list') } },
|
|
145
146
|
React.createElement(ManageTable, { ariaLabel: t('Table to manage groups'), columns: columns, data: data, sortInfo: { column: 'first-name', direction: 'asc' }, isFetching: isFetching, isError: false }))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Configs.d.ts","sourceRoot":"","sources":["../../../src/constants/Configs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAC7C,eAAO,MAAM,uBAAuB,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/manage",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.26",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@patternfly/pfe-tabs": "1.1.0",
|
|
59
59
|
"@patternfly/react-core": "4.128.2",
|
|
60
60
|
"@patternfly/react-table": "4.26.7",
|
|
61
|
-
"@rh-support/api": "
|
|
61
|
+
"@rh-support/api": "0.3.9",
|
|
62
62
|
"@rh-support/components": "^0.1.3",
|
|
63
63
|
"@rh-support/react-context": "^0.1.3",
|
|
64
64
|
"@rh-support/types": "^0.1.3",
|
|
@@ -96,13 +96,13 @@
|
|
|
96
96
|
"@patternfly/pfe-tabs": "1.1.0",
|
|
97
97
|
"@patternfly/react-core": "4.128.2",
|
|
98
98
|
"@patternfly/react-table": "4.26.7",
|
|
99
|
-
"@rh-support/api": "0.3.
|
|
100
|
-
"@rh-support/components": "1.1.
|
|
101
|
-
"@rh-support/configs": "0.2.
|
|
102
|
-
"@rh-support/react-context": "0.2.
|
|
99
|
+
"@rh-support/api": "0.3.9",
|
|
100
|
+
"@rh-support/components": "1.1.18",
|
|
101
|
+
"@rh-support/configs": "0.2.3",
|
|
102
|
+
"@rh-support/react-context": "0.2.20",
|
|
103
103
|
"@rh-support/types": "0.2.0",
|
|
104
|
-
"@rh-support/user-permissions": "0.2.
|
|
105
|
-
"@rh-support/utils": "0.2.
|
|
104
|
+
"@rh-support/user-permissions": "0.2.14",
|
|
105
|
+
"@rh-support/utils": "0.2.13",
|
|
106
106
|
"@types/react-beautiful-dnd": "^13.0.0",
|
|
107
107
|
"i18next": ">=17.0.1",
|
|
108
108
|
"lodash": ">=4.17.15",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"react-i18next": ">=10.11.0",
|
|
114
114
|
"react-router-dom": ">=5.1.2"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "b9f20c8bd5998759479b46035e8dc8202977f527"
|
|
117
117
|
}
|