@rh-support/troubleshoot 1.0.1 → 1.0.3-beta.1
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/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +2 -2
- package/lib/esm/components/CaseInformation/CaseGroup.d.ts +1 -0
- package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.js +3 -1
- package/lib/esm/components/CaseManagement/CaseManagement.js +1 -1
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +2 -2
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +2 -4
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +7 -3
- package/package.json +6 -6
|
@@ -36,7 +36,7 @@ export function CaseOpenshiftClusterId() {
|
|
|
36
36
|
const caseDispatch = useCaseDispatch();
|
|
37
37
|
const { globalMetadataState: { allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
38
38
|
const majorVersion = (version && getVersion(version).major) || '';
|
|
39
|
-
const isOpenShiftV3 = majorVersion === '3';
|
|
39
|
+
const isOpenShiftV3 = product === 'OpenShift Container Platform' && majorVersion === '3';
|
|
40
40
|
const isCustomer = loggedInUserRights.data.isAccountSameAsLoggedInAccount(selectedAccountDetails.data.accountNumber);
|
|
41
41
|
const [showClusterId, setShowClusterId] = useState(false);
|
|
42
42
|
const [isClusterIdInvalid, setIsClusterIdInValid] = useState(false);
|
|
@@ -219,7 +219,7 @@ export function CaseOpenshiftClusterId() {
|
|
|
219
219
|
}
|
|
220
220
|
else {
|
|
221
221
|
return (React.createElement(React.Fragment, null,
|
|
222
|
-
React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: displayName.current, openshiftClusterIDState: localOpenshiftClusterIDState || selectedReason, onClusterIdStateUpdate: onClusterIdSave, isClusterIdInvalid: (isEmpty(localOpenshiftClusterIDState) && isEmpty(selectedReason)) || isClusterIdInvalid, clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData, isV3:
|
|
222
|
+
React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: displayName.current, openshiftClusterIDState: localOpenshiftClusterIDState || selectedReason, onClusterIdStateUpdate: onClusterIdSave, isClusterIdInvalid: (isEmpty(localOpenshiftClusterIDState) && isEmpty(selectedReason)) || isClusterIdInvalid, clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData, isV3: product !== 'OpenShift Container Platform', isDisabled: isClusterIdUpdating, noClusterIdReasonExplanation: noClusterIdReasonExplanation }),
|
|
223
223
|
noClusterIdReasonExplanation !== 'v3-cluster' &&
|
|
224
224
|
(dontKnowSelected || noClusterIdReasonExplanation || noClusterIdReason) && (React.createElement(NoClusterIDReasonSelector, { noClusterIdReasonExplanation: noClusterIdReasonExplanation, noClusterIdReason: noClusterIdReason, onReasonInputBoxChanged: debounceFn, onReasonChange: onReasonChange, isInValid: isInVaidNoClusterIdReason, isCustomer: isCustomer, isDisabled: isReasonUpdating })),
|
|
225
225
|
React.createElement(LoadingIndicator, { show: isClusterIdUpdating, size: "xs" })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAiBA,UAAU,MAAM;
|
|
1
|
+
{"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAiBA,UAAU,MAAM;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAID,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,eA2N/B;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -56,7 +56,9 @@ function CaseGroup(props) {
|
|
|
56
56
|
defaultMembers: [],
|
|
57
57
|
members: [],
|
|
58
58
|
};
|
|
59
|
-
|
|
59
|
+
groupNumber === '-1' &&
|
|
60
|
+
props.init &&
|
|
61
|
+
onCaseGroupChange(toOption(parsedFetchedDefaultGroup, { labelKey: 'name' }));
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
});
|
|
@@ -58,7 +58,7 @@ export default function CaseManagement(props) {
|
|
|
58
58
|
React.createElement(SupportLevel, null),
|
|
59
59
|
React.createElement(Severity, { showSeverityInfoIcon: true, onSeverityChange: onSeverityChange }),
|
|
60
60
|
React.createElement(Fts, { inlineEditable: false }),
|
|
61
|
-
React.createElement(CaseGroup,
|
|
61
|
+
React.createElement(CaseGroup, { init: true }),
|
|
62
62
|
React.createElement(CaseLanguageSelector, null),
|
|
63
63
|
canSeeEmailNotifications && React.createElement(CaseContactSelector, null),
|
|
64
64
|
React.createElement(RHAssociatesSelector, null),
|
|
@@ -60,7 +60,7 @@ export function OpenShiftClusterId() {
|
|
|
60
60
|
const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
|
|
61
61
|
const { clusterRecommendationsState: { clusterRecommendationsCache }, } = useContext(ClusterRecommendationsContext);
|
|
62
62
|
const majorVersion = (version && getVersion(version).major) || '';
|
|
63
|
-
const isOpenShiftV3 = majorVersion === '3';
|
|
63
|
+
const isOpenShiftV3 = product === 'OpenShift Container Platform' && majorVersion === '3';
|
|
64
64
|
const isCustomer = loggedInUserRights.data.isAccountSameAsLoggedInAccount(selectedAccountDetails.data.accountNumber);
|
|
65
65
|
const [showClusterId, setShowClusterId] = useState(false);
|
|
66
66
|
const [isClusterIdInvalid, setIsClusterIdInValid] = useState(false);
|
|
@@ -206,7 +206,7 @@ export function OpenShiftClusterId() {
|
|
|
206
206
|
return null;
|
|
207
207
|
return (React.createElement(React.Fragment, null,
|
|
208
208
|
!isOpenShiftV3 && (React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: openshiftDisplayName, openshiftClusterIDState: openshiftClusterID || selectedReason, onClusterIdStateUpdate: onClusterIdStateUpdate, isClusterIdInvalid: showValidationErrorAlert &&
|
|
209
|
-
((isEmpty(openshiftClusterID) && isEmpty(selectedReason)) || isClusterIdInvalid), clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData, isV3:
|
|
209
|
+
((isEmpty(openshiftClusterID) && isEmpty(selectedReason)) || isClusterIdInvalid), clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData, isV3: product !== 'OpenShift Container Platform' })),
|
|
210
210
|
noClusterIdReasonExplanation !== 'v3-cluster' && dontKnowSelected && !isOpenShiftV3 && (React.createElement(NoClusterIDReasonSelector, { noClusterIdReasonExplanation: noClusterIdReasonExplanation, noClusterIdReason: noClusterIdReason, onReasonInputBoxChanged: onReasonExplanationInputBoxChanged, onReasonChange: onReasonChange, isInValid: isInVaidNoClusterIdReason, isCustomer: isCustomer })),
|
|
211
211
|
(v3Selected || isOpenShiftV3) && (React.createElement(OpenShiftV3Inputbox, { v3ClusterName: v3ClusterName, onReasonInputBoxChanged: v3ClusterNameInputBoxChanged, isInValid: isEmpty(v3ClusterName.trim()) && showValidationErrorAlert, v3Selected: v3Selected }))));
|
|
212
212
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAQrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAQrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,eAyYtD"}
|
|
@@ -301,12 +301,10 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
301
301
|
const previousActiveSessionId = usePrevious(activeSessionId);
|
|
302
302
|
useEffect(() => {
|
|
303
303
|
var _a;
|
|
304
|
-
if (isEmpty(product) ||
|
|
305
|
-
isEmpty(version) ||
|
|
306
|
-
activeSessionId !== previousActiveSessionId ||
|
|
307
|
-
isEmpty(previousVersion))
|
|
304
|
+
if (isEmpty(product) || isEmpty(version) || activeSessionId !== previousActiveSessionId)
|
|
308
305
|
return;
|
|
309
306
|
// we need to reset openshift cluster states only when major version is different
|
|
307
|
+
// this logic can be removed when version 3 is depricated
|
|
310
308
|
const oldMajorVersion = previousVersion && getVersion(previousVersion).major;
|
|
311
309
|
const newMajorVersion = getVersion(version).major;
|
|
312
310
|
const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHelpers.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AACl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;AAIF,eAAO,MAAM,gBAAgB,cAAe,UAAU,wBAAwB,QAAQ,eAAe,CAAC,KAAG,OA2BxG,CAAC;AAEF,eAAO,MAAM,0BAA0B,cACxB,UAAU,wBACC,QAAQ,eAAe,CAAC,KAC/C,OAiBF,CAAC;AAIF,eAAO,MAAM,6BAA6B,cAC3B,UAAU,wBACC,QAAQ,eAAe,CAAC,KAC/C,OAuBF,CAAC;AAEF,eAAO,MAAM,iBAAiB,cACf,UAAU,gBACP,YAAY,iBACZ,OAAO,KACtB,QAAQ,YAAY,CAiEtB,CAAC;AAEF,eAAO,MAAM,wBAAwB,qBAAsB,YAAY,EAAE,KAAG,YAAY,EAEvF,CAAC;AACF,eAAO,MAAM,yBAAyB,qBAAsB,YAAY,EAAE,KAAG,OAE5E,CAAC;AAEF,eAAO,MAAM,yBAAyB,gBACrB,YAAY,6BACE,MAAM,mBAChB,MAAM,KACxB,QAAQ,YAAY,CA6BtB,CAAC;AACF,eAAO,MAAM,yBAAyB,gBACrB,QAAQ,YAAY,CAAC,gCACJ,QAAQ,EAAE,KACzC,eAyCF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { canManageCase, getAppVersion, getUserAgentForCaseMode, isPremiumEntitlement, showFtsOnCreateCasePage, } from '@rh-support/utils';
|
|
1
|
+
import { canManageCase, getAppVersion, getUserAgentForCaseMode, getVersion, isPremiumEntitlement, showFtsOnCreateCasePage, } from '@rh-support/utils';
|
|
2
2
|
import filter from 'lodash/filter';
|
|
3
3
|
import forEach from 'lodash/forEach';
|
|
4
4
|
import isEmpty from 'lodash/isEmpty';
|
|
@@ -102,6 +102,8 @@ export const getSeverityDescription = (severity) => {
|
|
|
102
102
|
export const isClusterIDValid = (caseState, allProducts) => {
|
|
103
103
|
const case_details = caseState.caseDetails;
|
|
104
104
|
const productHasClusterID = isClusterIdEnabledForProduct(case_details.product, allProducts);
|
|
105
|
+
const majorVersion = (case_details.version && getVersion(case_details.version).major) || '';
|
|
106
|
+
const isOpenShiftV3 = case_details.product === 'OpenShift Container Platform' && majorVersion === '3';
|
|
105
107
|
const hasValidClusterId = () => !isEmpty(case_details.openshiftClusterID) &&
|
|
106
108
|
isEmpty(case_details.noClusterIdReason) &&
|
|
107
109
|
isEmpty(case_details.noClusterIdReasonExplanation) &&
|
|
@@ -116,8 +118,10 @@ export const isClusterIDValid = (caseState, allProducts) => {
|
|
|
116
118
|
!isEmpty(case_details.noClusterIdReason) &&
|
|
117
119
|
case_details.noClusterIdReason === 'Other' &&
|
|
118
120
|
!isEmpty(case_details.noClusterIdReasonExplanation) &&
|
|
119
|
-
|
|
120
|
-
const hasValidV3ClusterName = () => isEmpty(case_details.openshiftClusterID) &&
|
|
121
|
+
case_details.noClusterIdReasonExplanation !== 'v3-cluster';
|
|
122
|
+
const hasValidV3ClusterName = () => isEmpty(case_details.openshiftClusterID) &&
|
|
123
|
+
!isEmpty(caseState.v3ClusterName) &&
|
|
124
|
+
(case_details.noClusterIdReasonExplanation === 'v3-cluster' || isOpenShiftV3);
|
|
121
125
|
return productHasClusterID
|
|
122
126
|
? hasValidClusterId() || hasValidReason() || hasValidReasonExplanation() || hasValidV3ClusterName()
|
|
123
127
|
: true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "1.0.1",
|
|
3
|
+
"version": "1.0.3-beta.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
"@patternfly/react-core": "4.202.16",
|
|
74
74
|
"@progress/kendo-drawing": "^1.6.0",
|
|
75
75
|
"@progress/kendo-react-pdf": "^3.12.0",
|
|
76
|
-
"@rh-support/components": "1.2.
|
|
77
|
-
"@rh-support/react-context": "1.0.
|
|
76
|
+
"@rh-support/components": "1.2.1",
|
|
77
|
+
"@rh-support/react-context": "1.0.2",
|
|
78
78
|
"@rh-support/types": "0.2.0",
|
|
79
|
-
"@rh-support/user-permissions": "1.0.
|
|
80
|
-
"@rh-support/utils": "1.0.
|
|
79
|
+
"@rh-support/user-permissions": "1.0.1",
|
|
80
|
+
"@rh-support/utils": "1.0.1",
|
|
81
81
|
"@types/react-redux": "^7.1.12",
|
|
82
82
|
"@types/redux": "^3.6.0",
|
|
83
83
|
"@webcomponents/webcomponentsjs": "^2.2.10",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"not ie <= 11",
|
|
143
143
|
"not op_mini all"
|
|
144
144
|
],
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "1ce877f2229e4c400830514e8465fb242d98b16e"
|
|
146
146
|
}
|