@rh-support/troubleshoot 2.6.45 → 2.6.47-hotfix

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":"CaseDetailsTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsTabs.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AA0BlE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAoS5C"}
1
+ {"version":3,"file":"CaseDetailsTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsTabs.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AA0BlE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAgT5C"}
@@ -5,6 +5,7 @@ import { ErrorBoundary, LoadingIndicator } from '@rh-support/components';
5
5
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
6
6
  import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
7
7
  import { getConfigField, PCM_CONFIG_FIELD_TYPE } from '@rh-support/utils';
8
+ import includes from 'lodash/includes';
8
9
  import isEqual from 'lodash/isEqual';
9
10
  import React, { Suspense, useContext, useRef, useState } from 'react';
10
11
  import { Trans, useTranslation } from 'react-i18next';
@@ -44,6 +45,12 @@ export function CaseDetailsTabs(props) {
44
45
  const isCaseSummaryViewActive = caseSummaryViewConfig === '1';
45
46
  const { isExportingPDF, pdfOption } = useContext(PDFContext);
46
47
  const canSeeRMEs = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_RMES);
48
+ /**
49
+ * Checks a list of account numbers for which the case summarization feature should be hidden.
50
+ */
51
+ const caseSummarizationBlockedAccountsConfig = getConfigField(pcmConfig.data, 'caseSummarizationBlockedAccounts', PCM_CONFIG_FIELD_TYPE.STRING);
52
+ const blockedAccounts = JSON.parse(caseSummarizationBlockedAccountsConfig || []);
53
+ const isAccountBlocked = includes(blockedAccounts, accountNumber);
47
54
  const [selectedTab, setSelectedTab] = useState(CaseDetailsTabsEnum.DISCUSSION);
48
55
  const discussionTabRef = useRef(null);
49
56
  // const bugZillaTabRef: React.MutableRefObject<HTMLDivElement> = useRef(null);
@@ -126,6 +133,7 @@ export function CaseDetailsTabs(props) {
126
133
  !loggedInUsersAccount.data.secureSupport &&
127
134
  !loggedInUsersAccount.data.hasConfirmedStatesideSupport &&
128
135
  isCaseSummaryViewActive &&
136
+ !isAccountBlocked &&
129
137
  tabsToRender.push({
130
138
  'data-tracking-id': 'generate-ai-case-summary-tab',
131
139
  title: CaseDetailsTabsEnum.GENERATE_AI_CASE_SUMMARY,
@@ -13,8 +13,5 @@ interface IProps extends IDClassNameProps {
13
13
  openshiftDisplayName?: string;
14
14
  }
15
15
  declare function OpenshiftDropdownV4(props: IProps): React.JSX.Element;
16
- declare namespace OpenshiftDropdownV4 {
17
- var defaultProps: {};
18
- }
19
16
  export { OpenshiftDropdownV4 };
20
17
  //# sourceMappingURL=OpenshiftDropdownV4.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAiB5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA2D,MAAM,OAAO,CAAC;AAOhF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC;AAuBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBA8czC;kBA9cQ,mBAAmB;;;AAid5B,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAgB5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA2D,MAAM,OAAO,CAAC;AAOhF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC;AAgBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAmdzC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { cloud } from '@cee-eng/hydrajs';
11
- import { Button, Checkbox, Divider, MenuToggle, Select, SelectList, SelectOption, Spinner, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
11
+ import { Button, Divider, MenuToggle, Select, SelectList, SelectOption, Spinner, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
12
12
  import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
13
13
  import { useLRUCache, useSelectKeyboardNavigator } from '@rh-support/components';
14
14
  import debounce from 'lodash/debounce';
@@ -19,12 +19,6 @@ import { Trans, useTranslation } from 'react-i18next';
19
19
  import { getDisplayNameForCluster } from '../../utils/caseOpenshiftClusterIdUtils';
20
20
  import { PDFContext } from '../CaseEditView/PDFContainer';
21
21
  import CaseOpenShiftPopover from '../CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftPopover';
22
- const defaultProps = {
23
- className: '',
24
- id: '',
25
- isDisabled: false,
26
- openshiftDisplayName: '',
27
- };
28
22
  const createState = (external_cluster_id, display_name, openshift_version) => {
29
23
  return {
30
24
  display_name,
@@ -90,7 +84,7 @@ function OpenshiftDropdownV4(props) {
90
84
  setClustersRawResponse([]);
91
85
  setInputVal('');
92
86
  }
93
- else {
87
+ else if (selectedCluster !== 'loader') {
94
88
  props.onClusterIdStateUpdate(selectedCluster);
95
89
  const displayName = selectedCluster.display_name || selectedCluster.toString();
96
90
  setInputVal(displayName);
@@ -127,8 +121,7 @@ function OpenshiftDropdownV4(props) {
127
121
  },
128
122
  });
129
123
  const dropdownHeaderOptions = useMemo(() => [
130
- React.createElement(SelectOption, { key: 'show-hide-archived-clusters', value: { type: 'checkbox' } },
131
- React.createElement(Checkbox, { label: t('Show archived clusters'), key: "show-archived-clusters", "aria-label": t('Show archived clusters'), id: "show-archived-clusters", "data-tracking-id": "show-hide-archived-clusters", isChecked: showArchivedClusters || false, className: "archived-clusters-checkbox" })),
124
+ React.createElement(SelectOption, { hasCheckbox: true, key: "show-archived-clusters", "aria-label": t('Show archived clusters'), id: "show-archived-clusters", className: "archived-clusters-checkbox", "data-tracking-id": "show-hide-archived-clusters", value: { type: 'checkbox' }, isSelected: showArchivedClusters }, t('Show archived clusters')),
132
125
  React.createElement(Divider, { component: "div", key: 'cluster-id-options-divider-e' }),
133
126
  React.createElement(SelectOption, { key: 'dont-have-id', value: createState('dont-have-id', t("I don't have my Cluster ID")), "data-tracking-id": "dont-have-cluster-id", isFocused: focusedItemIndex === 1 }, "I don't have my Cluster ID"),
134
127
  ...(props.isV3
@@ -153,15 +146,19 @@ function OpenshiftDropdownV4(props) {
153
146
  const clusterOptions = [];
154
147
  domainNames.forEach((domain, index) => {
155
148
  domain !== '' &&
156
- clusterOptions.push(React.createElement(SelectOption, { isDisabled: true, className: "pf-v6-u-font-weight-bold pf-v6-u-color-400", value: createState(domain, domain), key: domain + index }));
149
+ clusterOptions.push(React.createElement(SelectOption, { isDisabled: true, className: "pf-v6-u-font-weight-bold pf-v6-u-color-400", value: createState(domain, domain), key: domain + index }, domain));
157
150
  clustersResponseGrouped[domain] &&
158
151
  clustersResponseGrouped[domain].forEach((cluster, i) => {
159
- clusterOptions.push(React.createElement(SelectOption, { key: cluster.external_cluster_id, value: createState(cluster.external_cluster_id, getDisplayNameForCluster(cluster) || cluster.external_cluster_id, cluster.openshift_version) }));
152
+ clusterOptions.push(React.createElement(SelectOption, { key: cluster.external_cluster_id, value: createState(cluster.external_cluster_id, getDisplayNameForCluster(cluster) || cluster.external_cluster_id, cluster.openshift_version) }, getDisplayNameForCluster(cluster) || cluster.external_cluster_id));
160
153
  });
161
154
  clusterOptions.push(React.createElement(Divider, { component: "div", key: index + domain }));
162
155
  });
163
- if (!isFetchingClusters && clustersRawResponse.length < totalResultsNo) {
164
- clusterOptions.push(React.createElement(SelectOption, { key: "load-more-option", value: {}, onClick: onViewMoreClick, isDisabled: false, className: "pf-v6-u-font-weight-bold" }, "Display additional results"));
156
+ if (isFetchingClusters) {
157
+ clusterOptions.push(React.createElement(SelectOption, { isLoading: true, disabled: true },
158
+ React.createElement(Spinner, { size: "lg" })));
159
+ }
160
+ else if (!isFetchingClusters && clustersRawResponse.length < totalResultsNo) {
161
+ clusterOptions.push(React.createElement(SelectOption, { isLoadButton: true, onClick: onViewMoreClick, value: "loader" }, "Display additional results"));
165
162
  }
166
163
  return [
167
164
  ...dropdownHeaderOptions,
@@ -336,5 +333,4 @@ function OpenshiftDropdownV4(props) {
336
333
  React.createElement(SelectList, { id: "openshift-cluster-selector-listbox" }, clustersSelectOptions)),
337
334
  React.createElement("div", { id: "clusterID-validate-helper", className: `form-instructions ${props.isClusterIdInvalid ? 'form-invalid' : ''}` }, props.clusterIdDropdownFormInstructions))));
338
335
  }
339
- OpenshiftDropdownV4.defaultProps = defaultProps;
340
336
  export { OpenshiftDropdownV4 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.6.45",
3
+ "version": "2.6.47-hotfix",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -134,5 +134,5 @@
134
134
  "defaults and supports es6-module",
135
135
  "maintained node versions"
136
136
  ],
137
- "gitHead": "7c863ffbb7b897925e55fa610b76584e78c6accc"
137
+ "gitHead": "bc2d54e30493e170069aa68ef56a171e55284378"
138
138
  }