@rh-support/troubleshoot 1.0.36 → 1.0.38

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAS,mBAAmB,EAAiD,MAAM,kBAAkB,CAAC;AAmB7G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,eAmLzC"}
1
+ {"version":3,"file":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAS,mBAAmB,EAAiD,MAAM,kBAAkB,CAAC;AAmB7G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,eAuLzC"}
@@ -114,7 +114,7 @@ export default function Case(props) {
114
114
  canReadCase &&
115
115
  (!isFetchingCaseDetails || !isEmpty(product)) &&
116
116
  !isFetchingCaseDetailsError && (React.createElement(React.Fragment, null,
117
- React.createElement(ErrorBoundary, null,
117
+ React.createElement(ErrorBoundary, { errorMsgInfo: t('There was an error loading cases. Please try refreshing the page.') },
118
118
  React.createElement(CaseOverview, { caseNumber: caseNumber })),
119
119
  React.createElement(Switch, null,
120
120
  React.createElement(Route, { path: `${path}/:activeTab?` },
@@ -196,7 +196,7 @@ export function CaseDetailsAside(props) {
196
196
  React.createElement(Checkbox, { label: t('Set to default'), isChecked: isDefaultBoxChecked, onChange: onDefaultCheckboxChange, id: "set-default-view-checkbox", name: "default-view-checkbox", isDisabled: isDefaultBoxChecked, className: 'defaultViewCheckbox' })))),
197
197
  React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading top solutions') } },
198
198
  React.createElement(CaseSolutions, { caseNumber: caseNumber, ref: topSolutionsRef, isSecureSupportAccount: isSecureSupportAccount })),
199
- !caseEscalations.isFetching && canViewACESection && (React.createElement(ErrorBoundary, null,
199
+ !caseEscalations.isFetching && canViewACESection && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading customer escalation') } },
200
200
  React.createElement(ActiveCustomerEscalation, { caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef }))),
201
201
  isExternal && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading remote session agreement') } },
202
202
  React.createElement(RemoteSessionAgreement, { caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef, acceptedRemoteSessionTerms: acceptedRemoteSessionTerms, readOnly: canReadCase })))))));
@@ -1 +1 @@
1
- {"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAkBA,UAAU,MAAM;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAID,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,eAgM/B;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAkBA,UAAU,MAAM;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAWD,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,eAsM/B;AAED,eAAe,SAAS,CAAC"}
@@ -20,7 +20,14 @@ import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage
20
20
  import { setCaseDetails, setSelectedCaseGroupUsers, updateCaseDetails } from '../../reducers/CaseReducer';
21
21
  import { CaseValuesToWatch } from '../shared/Constants';
22
22
  import { getChangedValueTooltip } from '../shared/utils';
23
- const emptyCaseGroup = { groupNum: '', name: '', isPrivate: false, isDefault: false, defaultMembers: [], members: [] };
23
+ const emptyCaseGroup = {
24
+ groupNum: '',
25
+ name: '',
26
+ isPrivate: false,
27
+ isDefault: false,
28
+ defaultMembers: [],
29
+ members: [],
30
+ };
24
31
  function CaseGroup(props) {
25
32
  const { t } = useTranslation();
26
33
  const caseUpdateError = useCaseUpdateErrorMessage();
@@ -95,7 +102,10 @@ function CaseGroup(props) {
95
102
  if (isGroupMandatory) {
96
103
  // having group selected for case is mandatory, make 'UnGrouped Case' option disabled
97
104
  const listItems = list.map((item) => (Object.assign(Object.assign({}, item), { disabled: item.groupNum === '-1' })));
98
- return toOptions(listItems, { labelKey: 'name', disabledKey: 'disabled' });
105
+ return toOptions(listItems, {
106
+ labelKey: 'name',
107
+ disabledKey: 'disabled',
108
+ });
99
109
  }
100
110
  else {
101
111
  return toOptions(list, { labelKey: 'name' });
@@ -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,eAoatD"}
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,eAuZtD"}
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { useDebounce, usePrevious } from '@rh-support/components';
11
- import { GlobalMetadataStateContext, useUserPreferences } from '@rh-support/react-context';
11
+ import { GlobalMetadataStateContext } from '@rh-support/react-context';
12
12
  import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
13
13
  import { getUrlParsedParams, getVersion, getVersionIfOnlyVersion, isOnlyVersion } from '@rh-support/utils';
14
14
  import findIndex from 'lodash/findIndex';
@@ -37,7 +37,7 @@ export function GlobalTroubleshootEffects(props) {
37
37
  const { routeState: { activeSection, appRouteSectionsSequence, appRouteConfugurations, sectionsToHide }, } = useContext(RouteContext);
38
38
  const { globalMetadataState: { allProducts, loggedInUser, managedAccounts, loggedInUserRights, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
39
39
  const { sessionRestore: { activeSessionId }, } = useContext(SessionRestoreStateContext);
40
- const { accountNumber, product, version, contactSsoUsername, summary, issue, environment, periodicityOfIssue, timeFramesAndUrgency, caseType, language, selectedAccountDetails, ownersCaseGroups, } = useCaseSelector((state) => ({
40
+ const { accountNumber, product, version, contactSsoUsername, summary, issue, environment, periodicityOfIssue, timeFramesAndUrgency, caseType, language, selectedAccountDetails, } = useCaseSelector((state) => ({
41
41
  accountNumber: state.caseDetails.accountNumberRef,
42
42
  product: state.caseDetails.product,
43
43
  version: state.caseDetails.version,
@@ -50,9 +50,7 @@ export function GlobalTroubleshootEffects(props) {
50
50
  caseType: state.caseDetails.caseType,
51
51
  language: state.caseDetails.caseLanguage,
52
52
  selectedAccountDetails: state.selectedAccountDetails,
53
- ownersCaseGroups: state.ownersCaseGroups,
54
53
  }), isEqual);
55
- const { getDefaultGroup } = useUserPreferences();
56
54
  const versionsDetails = useCaseSelector((state) => {
57
55
  if (isEmpty(state.versionsDetails.data))
58
56
  return [];
@@ -82,14 +80,20 @@ export function GlobalTroubleshootEffects(props) {
82
80
  const productFromUrl = parsedUrlParams.product || initialCaseState.caseDetails.product;
83
81
  if (isEmpty(productFromUrl)) {
84
82
  // Reset case state
85
- setCaseDetails(caseDispatch, { product: productFromUrl, version: undefined });
83
+ setCaseDetails(caseDispatch, {
84
+ product: productFromUrl,
85
+ version: undefined,
86
+ });
86
87
  return;
87
88
  }
88
89
  const versionFromUrl = parsedUrlParams.version || initialCaseState.caseDetails.version;
89
90
  const index = findIndex(allProducts.data.productsResult, (p) => p.product === productFromUrl);
90
91
  if (index === -1) {
91
92
  // invalid product, reset url
92
- const newParams = { product: undefined, version: undefined };
93
+ const newParams = {
94
+ product: undefined,
95
+ version: undefined,
96
+ };
93
97
  RouteUtils.updateQueryParams(props.routeProps, newParams);
94
98
  }
95
99
  else {
@@ -104,13 +108,19 @@ export function GlobalTroubleshootEffects(props) {
104
108
  // version is also valid
105
109
  const versionToSet = isVersionFromURLValid ? versionFromUrl : undefined;
106
110
  if (product !== productFromUrl || version !== versionToSet) {
107
- setCaseDetails(caseDispatch, { product: productFromUrl, version: versionToSet });
111
+ setCaseDetails(caseDispatch, {
112
+ product: productFromUrl,
113
+ version: versionToSet,
114
+ });
108
115
  }
109
116
  }
110
117
  else if (!isMultiVersionProduct) {
111
118
  // no version or invalid version and there is only 1 version we set default version in url that will trigger the flow with valid version this time
112
119
  const defaultVersion = getVersionIfOnlyVersion(productVersions);
113
- const newParams = { product: productFromUrl, version: defaultVersion };
120
+ const newParams = {
121
+ product: productFromUrl,
122
+ version: defaultVersion,
123
+ };
114
124
  RouteUtils.updateQueryParams(props.routeProps, newParams);
115
125
  }
116
126
  }
@@ -251,7 +261,9 @@ export function GlobalTroubleshootEffects(props) {
251
261
  language,
252
262
  accountNumber,
253
263
  session_id: activeSessionId,
254
- }, accountType: { isSecure: selectedAccountDetails.data.securedEnvironment || false }, userType: { canAddAttachments }, fields: ['title', 'cta', 'description', 'rule_type', 'rule_sub_type', 'rule_id'] }, ((selectedLocalFiles === null || selectedLocalFiles === void 0 ? void 0 : selectedLocalFiles.length) && {
264
+ }, accountType: {
265
+ isSecure: selectedAccountDetails.data.securedEnvironment || false,
266
+ }, userType: { canAddAttachments }, fields: ['title', 'cta', 'description', 'rule_type', 'rule_sub_type', 'rule_id'] }, ((selectedLocalFiles === null || selectedLocalFiles === void 0 ? void 0 : selectedLocalFiles.length) && {
255
267
  attachment: selectedLocalFiles.map((file) => ({
256
268
  uuid: file.attachmentId,
257
269
  fileName: file.name,
@@ -324,25 +336,5 @@ export function GlobalTroubleshootEffects(props) {
324
336
  }
325
337
  // eslint-disable-next-line react-hooks/exhaustive-deps
326
338
  }, [product, version, allProducts.data.productsResult, caseDispatch]);
327
- // when user opens a case, sets group to the default group saved in preferences
328
- useEffect(() => {
329
- const userPreferredFilter = () => __awaiter(this, void 0, void 0, function* () {
330
- const fetchedDefaultGroupKey = yield getDefaultGroup();
331
- const groupObj = ownersCaseGroups.data
332
- ? ownersCaseGroups.data.map((group) => ({ value: group.name, key: group.groupNum }))
333
- : [];
334
- if (!isEmpty(groupObj)) {
335
- const preferredGroupObj = groupObj.find((group) => group.key === fetchedDefaultGroupKey);
336
- if (preferredGroupObj === null || preferredGroupObj === void 0 ? void 0 : preferredGroupObj.value) {
337
- setCaseDetails(caseDispatch, {
338
- groupNumber: fetchedDefaultGroupKey,
339
- groupName: preferredGroupObj.value,
340
- });
341
- }
342
- }
343
- });
344
- userPreferredFilter();
345
- // eslint-disable-next-line react-hooks/exhaustive-deps
346
- }, [ownersCaseGroups.data]);
347
339
  return React.createElement(React.Fragment, null);
348
340
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -73,8 +73,8 @@
73
73
  "@patternfly/react-core": "4.264.0",
74
74
  "@progress/kendo-drawing": "^1.6.0",
75
75
  "@progress/kendo-react-pdf": "^3.12.0",
76
- "@rh-support/components": "1.2.14",
77
- "@rh-support/react-context": "1.0.21",
76
+ "@rh-support/components": "1.2.15",
77
+ "@rh-support/react-context": "1.0.22",
78
78
  "@rh-support/types": "0.2.0",
79
79
  "@rh-support/user-permissions": "1.0.11",
80
80
  "@rh-support/utils": "1.0.9",
@@ -142,5 +142,5 @@
142
142
  "not ie <= 11",
143
143
  "not op_mini all"
144
144
  ],
145
- "gitHead": "d4fbbe579089bd4548af29de257b62106e1ec9c6"
145
+ "gitHead": "5bcb813517a4aff493587c48665551d4aeb1d00e"
146
146
  }