@rh-support/manage 2.5.80 → 2.5.83
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/Manage.d.ts.map +1 -1
- package/lib/esm/Manage.js +0 -1
- package/lib/esm/components/Configs/ConfigsTable.d.ts.map +1 -1
- package/lib/esm/components/Configs/ConfigsTable.js +27 -5
- package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.d.ts.map +1 -1
- package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.js +17 -4
- package/lib/esm/constants/PartnershipLink.d.ts +3 -0
- package/lib/esm/constants/PartnershipLink.d.ts.map +1 -0
- package/lib/esm/constants/PartnershipLink.js +2 -0
- package/package.json +6 -6
package/lib/esm/Manage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manage.d.ts","sourceRoot":"","sources":["../../src/Manage.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Manage.d.ts","sourceRoot":"","sources":["../../src/Manage.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAI3B,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAS,mBAAmB,EAAU,MAAM,kBAAkB,CAAC;AAItE,MAAM,WAAW,qBAAqB;CAAG;AACzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;IACvD,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,oBAAoB,EAAE,GAAG,CAAC;QAC1B,MAAM,EAAE,GAAG,CAAC;QACZ,KAAK,EAAE,GAAG,CAAC;QACX,aAAa,EAAE;YACX,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC;SACnB,CAAC;KACL;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;IAED,UAAU,GAAG,CAAC;QACV,UAAU,iBAAkB,SAAQ,QAAQ;SAAG;KAClD;CACJ;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,qBAYnC"}
|
package/lib/esm/Manage.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigsTable.d.ts","sourceRoot":"","sources":["../../../../src/components/Configs/ConfigsTable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfigsTable.d.ts","sourceRoot":"","sources":["../../../../src/components/Configs/ConfigsTable.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,eAAO,MAAM,YAAY,yBAqLxB,CAAC"}
|
|
@@ -10,9 +10,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { configuration, maintenance } from '@cee-eng/hydrajs';
|
|
11
11
|
import { SearchInput } from '@patternfly/react-core';
|
|
12
12
|
import { defaultTableSortMethod, ErrorBoundary, ToastNotification, useFetch } from '@rh-support/components/';
|
|
13
|
-
import {
|
|
13
|
+
import { GlobalMetadataDispatchContext, GlobalMetadataReducerConstants } from '@rh-support/react-context';
|
|
14
|
+
import { formatDate, getApiResourceObject } from '@rh-support/utils';
|
|
14
15
|
import isEmpty from 'lodash/isEmpty';
|
|
15
|
-
import React, { useEffect, useState } from 'react';
|
|
16
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
16
17
|
import { Trans, useTranslation } from 'react-i18next';
|
|
17
18
|
import { ManageTable } from '../ManageTable/ManageTable';
|
|
18
19
|
import { ConfigInLineEdit } from './ConfigInLineEdit';
|
|
@@ -23,6 +24,7 @@ export const ConfigsTable = () => {
|
|
|
23
24
|
const [filteredValues, setFilteredValues] = useState([]);
|
|
24
25
|
const [searchString, setSearchString] = useState('');
|
|
25
26
|
const [keepPageNumberOnDataChange, setKeepPageNumberOnDataChange] = useState(undefined);
|
|
27
|
+
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
26
28
|
const { request: getConfigs, isFetching } = useFetch(configuration.getConfig);
|
|
27
29
|
const { request: updateConfig, isFetching: isUpdating } = useFetch(maintenance.updateHydraConfiguration, {
|
|
28
30
|
propgateErrors: true,
|
|
@@ -32,6 +34,23 @@ export const ConfigsTable = () => {
|
|
|
32
34
|
setKeepPageNumberOnDataChange(false);
|
|
33
35
|
setSearchString(str);
|
|
34
36
|
};
|
|
37
|
+
// Function to reload all configs and update the global context
|
|
38
|
+
const reloadAndUpdateContext = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
+
try {
|
|
40
|
+
const allConfigs = yield configuration.getConfig(configType);
|
|
41
|
+
setConfigValues(allConfigs);
|
|
42
|
+
setFilteredValues(allConfigs);
|
|
43
|
+
if (dispatchToGlobalMetadataReducer) {
|
|
44
|
+
dispatchToGlobalMetadataReducer({
|
|
45
|
+
type: GlobalMetadataReducerConstants.setPcmConfig,
|
|
46
|
+
payload: { pcmConfig: getApiResourceObject(allConfigs) },
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.error('Failed to reload configurations', error);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
35
54
|
const onUpdate = (fieldName, fieldValue, id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
55
|
try {
|
|
37
56
|
yield updateConfig({
|
|
@@ -49,6 +68,7 @@ export const ConfigsTable = () => {
|
|
|
49
68
|
});
|
|
50
69
|
setKeepPageNumberOnDataChange(true);
|
|
51
70
|
setConfigValues(updatedData);
|
|
71
|
+
yield reloadAndUpdateContext();
|
|
52
72
|
}
|
|
53
73
|
catch (e) {
|
|
54
74
|
ToastNotification.addDangerMessage('Failed to update config');
|
|
@@ -98,9 +118,11 @@ export const ConfigsTable = () => {
|
|
|
98
118
|
];
|
|
99
119
|
useEffect(() => {
|
|
100
120
|
const loadConfig = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
121
|
+
if (getConfigs) {
|
|
122
|
+
const data = yield getConfigs(configType);
|
|
123
|
+
setConfigValues(data);
|
|
124
|
+
setFilteredValues(data);
|
|
125
|
+
}
|
|
104
126
|
});
|
|
105
127
|
loadConfig();
|
|
106
128
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestCollaborationModal.d.ts","sourceRoot":"","sources":["../../../../src/components/ManagePartnerships/RequestCollaborationModal.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAsC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RequestCollaborationModal.d.ts","sourceRoot":"","sources":["../../../../src/components/ManagePartnerships/RequestCollaborationModal.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,UAAU,MAAM;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACrC;AAID,eAAO,MAAM,yBAAyB,UAAW,MAAM,sBA8QtD,CAAC"}
|
|
@@ -14,6 +14,7 @@ import { ToastNotification, useCopyToClipboard } from '@rh-support/components';
|
|
|
14
14
|
import isEmpty from 'lodash/isEmpty';
|
|
15
15
|
import React, { useRef, useState } from 'react';
|
|
16
16
|
import { Trans, useTranslation } from 'react-i18next';
|
|
17
|
+
import { PARTNERSHIP_LINK_LIMIT, PARTNERSHIP_LINK_LIMIT_EXCEED_ERROR } from '../../constants/PartnershipLink';
|
|
17
18
|
import { useManagePartnershipsDispatchContext } from '../../context/ManagePartnershipsProvider';
|
|
18
19
|
import { setIsUpdatingRequests } from '../../reducers/ManagePartnershipsReducer';
|
|
19
20
|
export const RequestCollaborationModal = (props) => {
|
|
@@ -37,13 +38,16 @@ export const RequestCollaborationModal = (props) => {
|
|
|
37
38
|
setLocalLinkName(link);
|
|
38
39
|
setFriendlyName(link);
|
|
39
40
|
setIsDuplicateLinkName(false);
|
|
40
|
-
if (isEmpty(link.trim()) && nextButtonIsClicked) {
|
|
41
|
+
if ((isEmpty(link.trim()) && nextButtonIsClicked) || isInvalidPartnershipLink(link)) {
|
|
41
42
|
setValidated('error');
|
|
42
43
|
}
|
|
43
44
|
else {
|
|
44
45
|
setValidated('success');
|
|
45
46
|
}
|
|
46
47
|
};
|
|
48
|
+
const isInvalidPartnershipLink = (link) => {
|
|
49
|
+
return link.length > PARTNERSHIP_LINK_LIMIT;
|
|
50
|
+
};
|
|
47
51
|
const handleKeyDown = (e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
52
|
if (validated !== 'error' && e.keyCode === 13) {
|
|
49
53
|
onNext && onNext();
|
|
@@ -124,14 +128,23 @@ export const RequestCollaborationModal = (props) => {
|
|
|
124
128
|
React.createElement(Form, { className: "pf-v6-u-mt-md" },
|
|
125
129
|
React.createElement(Grid, { sm: 12, md: 12, lg: 12 },
|
|
126
130
|
React.createElement(GridItem, null,
|
|
127
|
-
React.createElement(FormGroup, { label:
|
|
128
|
-
|
|
131
|
+
React.createElement(FormGroup, { label: React.createElement(React.Fragment, null,
|
|
132
|
+
t('Name your link'),
|
|
133
|
+
React.createElement("span", { className: "form-required", "aria-hidden": "true" }, "*")), labelInfo: React.createElement("span", { className: isInvalidPartnershipLink(friendlyName)
|
|
134
|
+
? 'pf-v6-u-text-color-status-danger'
|
|
135
|
+
: '' },
|
|
136
|
+
friendlyName.length,
|
|
137
|
+
"/",
|
|
138
|
+
PARTNERSHIP_LINK_LIMIT), type: "string", fieldId: partnershipLinkId },
|
|
139
|
+
React.createElement(TextInput, { isRequired: true, className: showDone || isRequestingAgain ? 'request-collaboration-input' : '', value: localLinkName || props.sendReqAgainFriendlyName, id: partnershipLinkId, "aria-describedby": "age-1-helper", onChange: handleLinkNameChange, onKeyDown: handleKeyDown, placeholder: t('e.g. Customer name'), isDisabled: showDone || isRequestingAgain, validated: isInvalidPartnershipLink(friendlyName) ? 'error' : 'default' }),
|
|
129
140
|
React.createElement(FormHelperText, null,
|
|
130
141
|
React.createElement(HelperText, null, validated !== 'error' ? (React.createElement(HelperTextItem, null,
|
|
131
142
|
React.createElement(Trans, null, "Please enter a name for your request"))) : (React.createElement(HelperTextItem, { variant: "error" },
|
|
132
143
|
React.createElement(Trans, null, isDuplicateLinkName
|
|
133
144
|
? t('Link name already used. Please enter a unique name')
|
|
134
|
-
:
|
|
145
|
+
: isInvalidPartnershipLink(friendlyName)
|
|
146
|
+
? PARTNERSHIP_LINK_LIMIT_EXCEED_ERROR
|
|
147
|
+
: t('Please enter a name for your request')))))))))),
|
|
135
148
|
showDone && (React.createElement(React.Fragment, null, !isRequestingAgain ? (React.createElement(React.Fragment, null,
|
|
136
149
|
React.createElement("h4", { className: "label-text-size" },
|
|
137
150
|
React.createElement("strong", null, "Copy and send")),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PartnershipLink.d.ts","sourceRoot":"","sources":["../../../src/constants/PartnershipLink.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,mCAAmC,qEAAqE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/manage",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.83",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -79,12 +79,12 @@
|
|
|
79
79
|
"@patternfly/patternfly": "6.2.1",
|
|
80
80
|
"@patternfly/react-core": "6.2.1",
|
|
81
81
|
"@patternfly/react-table": "6.2.1",
|
|
82
|
-
"@rh-support/components": "2.5.
|
|
82
|
+
"@rh-support/components": "2.5.65",
|
|
83
83
|
"@rh-support/configs": "2.0.21",
|
|
84
|
-
"@rh-support/react-context": "2.5.
|
|
84
|
+
"@rh-support/react-context": "2.5.81",
|
|
85
85
|
"@rh-support/types": "2.0.5",
|
|
86
|
-
"@rh-support/user-permissions": "2.5.
|
|
87
|
-
"@rh-support/utils": "2.5.
|
|
86
|
+
"@rh-support/user-permissions": "2.5.32",
|
|
87
|
+
"@rh-support/utils": "2.5.28",
|
|
88
88
|
"@types/react-beautiful-dnd": "^13.0.0",
|
|
89
89
|
"i18next": "^23.15.0",
|
|
90
90
|
"lodash": ">=4.17.15",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"defaults and supports es6-module",
|
|
104
104
|
"maintained node versions"
|
|
105
105
|
],
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "5bd0b48bd344b4362efb801ad01b96f0bba0df1a"
|
|
107
107
|
}
|