@rh-support/troubleshoot 0.2.133 → 0.2.136

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":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseInformation.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAW5D,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,eA8C5C"}
1
+ {"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseInformation.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAa5D,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,eAsD5C"}
@@ -2,16 +2,22 @@ import { encodeAngularBrackets, linkifyBZIDs, linkifyWithCaseIDs } from '@cee-en
2
2
  import { MoreOrLess } from '@rh-support/components';
3
3
  import { useGlobalStateContext } from '@rh-support/react-context';
4
4
  import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
5
+ import { isEqual } from 'lodash';
5
6
  import React from 'react';
6
7
  import { Trans } from 'react-i18next';
7
8
  import { useCaseSelector } from '../../../../context/CaseContext';
9
+ import { isClusterIdEnabledForProduct } from '../../../../utils/caseOpenshiftClusterIdUtils';
8
10
  import EditDescription from '../../../EditDescription/EditDescription';
9
11
  import { CaseHostname } from './CaseHostname';
10
12
  import { CaseOpenshiftClusterId } from './CaseOpenshiftClusterId/CaseOpenshiftClusterId';
11
13
  import ProductVersion from './ProductVersion';
12
14
  export function CaseInformation(props) {
13
- const description = useCaseSelector((state) => state.caseDetails.description);
14
- const { globalMetadataState: { navBarRef }, } = useGlobalStateContext();
15
+ var _a;
16
+ const { product, description } = useCaseSelector((state) => ({
17
+ product: state.caseDetails.product,
18
+ description: state.caseDetails.description,
19
+ }), isEqual);
20
+ const { globalMetadataState: { navBarRef, allProducts }, } = useGlobalStateContext();
15
21
  const linkifiedDescription = (text) => {
16
22
  text = encodeAngularBrackets(text);
17
23
  text = linkifyWithCaseIDs(text);
@@ -19,10 +25,11 @@ export function CaseInformation(props) {
19
25
  return { __html: text };
20
26
  };
21
27
  const canEditDescription = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_DESCRIPTION);
28
+ const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
22
29
  return (React.createElement("section", { className: "card card-sm card-white" },
23
30
  React.createElement("form", null,
24
31
  React.createElement(ProductVersion, null),
25
- React.createElement(CaseOpenshiftClusterId, null),
32
+ hasCluster && React.createElement(CaseOpenshiftClusterId, null),
26
33
  React.createElement(CaseHostname, { inlineEditable: true }),
27
34
  React.createElement("div", { className: "form-group" }, !canEditDescription ? (React.createElement(React.Fragment, null,
28
35
  React.createElement("label", { htmlFor: "case-description" },
@@ -1 +1 @@
1
- {"version":3,"file":"CaseDiscussion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAA0B,MAAM,yCAAyC,CAAC;AAmB1G,OAAO,KAAoE,MAAM,OAAO,CAAC;AAsCzF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAOD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,eAugBnD"}
1
+ {"version":3,"file":"CaseDiscussion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAA0B,MAAM,yCAAyC,CAAC;AAmB1G,OAAO,KAAoE,MAAM,OAAO,CAAC;AAsCzF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAOD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,eAqgBnD"}
@@ -315,9 +315,7 @@ export default function CaseDiscussion(props) {
315
315
  React.createElement("div", { className: "pfe-l-grid pfe-m-all-6-col pfe-m-gutters push-bottom hide-in-pdf" },
316
316
  React.createElement("div", { className: "pfe-m-12-col" }, allDiscussions.length > 20 && (React.createElement(CommentSearch, { caseDiscussions: computeFilteredComments || [], onCommentSearch: onCaseCommentSearch, isCommentSearchCleared: isCommentSearchCleared }))),
317
317
  React.createElement("span", { className: "push-top-narrow" },
318
- React.createElement(MultiSelectDropDownList, { placeholder: getDropdownBtnPlaceholder(t('Select a filter'), discussionFiltersListState
319
- .filter((i) => i.isSelected)
320
- .map((i) => i.filterLabel), ' ', list.length, t('All comments')), "data-tracking-id": "discussions-filter-comments-dropdown", id: "case-list-comments-dropdown", label: t('Filter by'), title: t('Filter by'), onChange: onFilterChange, selectedItems: toOptions(discussionFiltersListState.filter((item) => item.isSelected), {
318
+ React.createElement(MultiSelectDropDownList, { placeholder: getDropdownBtnPlaceholder(t('Select a filter'), list.filter((i) => i.isSelected).map((i) => i.filterLabel), ' ', list.length, t('All comments')), "data-tracking-id": "discussions-filter-comments-dropdown", id: "case-list-comments-dropdown", label: t('Filter by'), title: t('Filter by'), onChange: onFilterChange, selectedItems: toOptions(list.filter((item) => item.isSelected), {
321
319
  labelKey: 'filterLabel',
322
320
  disabledKey: 'isDisabled',
323
321
  }), list: toOptions(list, { labelKey: 'filterLabel', disabledKey: 'isDisabled' }) })),
@@ -1 +1 @@
1
- {"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAKnD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAKrF,UAAU,MAAM;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAgBD;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,4EAoKvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAKnD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAKrF,UAAU,MAAM;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAgBD;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,4EAgKvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -42,11 +42,6 @@ const AllProductsSelector = forwardRef((props, ref) => {
42
42
  version: state.caseDetails.version,
43
43
  contactSSOName: state.caseDetails.contactSSOName,
44
44
  }), isEqual);
45
- // const {
46
- // caseState: {
47
- // caseDetails: { product, version, contactSSOName },
48
- // },
49
- // } = useContext(CaseStateContext);
50
45
  const [selectedProductForDropdown, setSelectedProductForDropdown] = useState(defaultSelectedProduct);
51
46
  const { topContentState: { topContent }, } = useContext(TCStateContext);
52
47
  const [localProduct, setLocalProduct] = useState('');
@@ -81,7 +76,7 @@ const AllProductsSelector = forwardRef((props, ref) => {
81
76
  }
82
77
  }, [allProducts, product, props.isDropdownSelected, selectedProductForDropdown.product, version]);
83
78
  useEffect(() => {
84
- // after TC datat is loaded we open the modal
79
+ // after TC data is loaded we open the modal
85
80
  const showTCPopUpModalOnProductChange = props.loadTCOnChange && !props.showTCAfterButtonClicked && showModal;
86
81
  if (!topContent.isFetching && showTCPopUpModalOnProductChange) {
87
82
  topContent.data.length !== 0 && setIsModalOpen(true);
@@ -1 +1 @@
1
- {"version":3,"file":"ProductVersionDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductVersionDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAIrE,OAAO,KAA+D,MAAM,OAAO,CAAC;AAMpF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC;IACvD,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACnB;AAOD,QAAA,MAAM,8BAA8B,wEAqIlC,CAAC;AAEH,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
1
+ {"version":3,"file":"ProductVersionDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductVersionDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAIrE,OAAO,KAA+D,MAAM,OAAO,CAAC;AAMpF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC;IACvD,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACnB;AAOD,QAAA,MAAM,8BAA8B,wEAyIlC,CAAC;AAEH,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
@@ -18,12 +18,15 @@ const ProductVersionDropdownSelector = forwardRef((props, ref) => {
18
18
  const [isVersionBlured, setIsVersionBlured] = useState(false);
19
19
  const { routeState: { showValidationErrorAlert }, } = useContext(RouteContext);
20
20
  const versionsDetails = useCaseSelector((state) => state.versionsDetails, isEqual);
21
- const productVenisons = useMemo(() => versionsDetails.data.map(({ name }) => name),
21
+ const productVersions = useMemo(() => versionsDetails.data
22
+ .map(({ name }) => name)
23
+ .sort()
24
+ .reverse(),
22
25
  // eslint-disable-next-line react-hooks/exhaustive-deps
23
26
  [props.selectedProduct.name, versionsDetails.data]);
24
27
  // Here we are conditionally checking if selected product is having version and if not fallback to fetched version list ].
25
28
  const selectedProductVersion = isEmpty(props.selectedProduct.versions)
26
- ? productVenisons
29
+ ? productVersions
27
30
  : props.selectedProduct.versions;
28
31
  // On the basis of which version source we are using we need to use loading status of it.
29
32
  const isLoadingList = isEmpty(props.selectedProduct.versions) ? versionsDetails.isFetching : props.isLoading;
@@ -124,7 +124,7 @@ export default function UpdateSeverityModal(props) {
124
124
  }
125
125
  }
126
126
  catch (e) {
127
- yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, {
127
+ setCaseDetails(caseDispatch, {
128
128
  severity: currentSeverity,
129
129
  });
130
130
  onSuccessfulSubmit();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "0.2.133",
3
+ "version": "0.2.136",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -74,8 +74,8 @@
74
74
  "@progress/kendo-drawing": "^1.6.0",
75
75
  "@progress/kendo-react-pdf": "^3.12.0",
76
76
  "@rh-support/api": "0.3.24",
77
- "@rh-support/components": "1.1.77",
78
- "@rh-support/react-context": "0.2.83",
77
+ "@rh-support/components": "1.1.78",
78
+ "@rh-support/react-context": "0.2.84",
79
79
  "@rh-support/types": "0.2.0",
80
80
  "@rh-support/user-permissions": "0.2.63",
81
81
  "@rh-support/utils": "0.2.46",
@@ -143,5 +143,5 @@
143
143
  "not ie <= 11",
144
144
  "not op_mini all"
145
145
  ],
146
- "gitHead": "c049feffba16feb4ef0758eac9934b995b108341"
146
+ "gitHead": "abf4c47f33be247ab5bf3e0596a0dd8765c8a5b8"
147
147
  }