@rh-support/troubleshoot 1.0.30 → 1.0.31

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.
@@ -162,7 +162,7 @@ export function RemoteSessionAgreementModal(props) {
162
162
  " ",
163
163
  React.createElement(DownloadIcon, { className: "pf-u-ml-xs" }))),
164
164
  React.createElement("div", null,
165
- React.createElement(Checkbox, { className: "pf-u-mt-md", id: "terms-accept-checkbox", label: React.createElement(React.Fragment, null,
165
+ React.createElement(Checkbox, { className: "pf-u-mt-md rsa-checkbox", id: "terms-accept-checkbox", label: React.createElement(React.Fragment, null,
166
166
  React.createElement(Trans, null, "I have read and agree to the"),
167
167
  ' ',
168
168
  React.createElement("a", { className: "pf-c-button pf-m-link pf-m-inline align-link-items", rel: "noopener noreferrer", target: "_blank", href: selectedTranslation.pdfDownloadUrl, "data-tracking-id": "case-details-request-remote-session-terms" },
@@ -1 +1 @@
1
- {"version":3,"file":"CaseActionPlan.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.tsx"],"names":[],"mappings":"AAkBA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,eAiHpC;kBAjHQ,cAAc;;;AAoHvB,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"CaseActionPlan.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.tsx"],"names":[],"mappings":"AAoBA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,eAmIpC;kBAnIQ,cAAc;;;AAsIvB,eAAe,cAAc,CAAC"}
@@ -7,9 +7,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ import { parseCommentMarkdown } from '@cee-eng/ui-toolkit';
10
11
  import { AlertMessage, AlertType, LoadingIndicator, TextAreaResizable, ToastNotification, } from '@rh-support/components';
11
12
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
12
13
  import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
14
+ import DOMPurify from 'dompurify';
13
15
  import isEmpty from 'lodash/isEmpty';
14
16
  import React, { useContext, useEffect, useState } from 'react';
15
17
  import { Trans, useTranslation } from 'react-i18next';
@@ -67,11 +69,18 @@ function CaseActionPlan(props) {
67
69
  };
68
70
  const isInternalWithoutSFDCUser = loggedInUserRights.data.isInternalWithoutSFDCUser();
69
71
  const isActionPlanEmpty = isEmpty(actionPlanState === null || actionPlanState === void 0 ? void 0 : actionPlanState.trim());
72
+ // To parse comment from markdown to html for action plan comments
73
+ // DOMPurify - a XSS sanitizer for HTML, MathML and SVG.
74
+ const commentMarkdown = (markdown) => {
75
+ var cleanMarkdown = DOMPurify.sanitize(markdown);
76
+ const htmlString = parseCommentMarkdown(cleanMarkdown, { showButtonForAttachmentLink: true }, { openLinksInNewTab: true, gfm: true, breaks: true });
77
+ return { __html: htmlString };
78
+ };
70
79
  return (React.createElement(React.Fragment, null,
71
80
  React.createElement(AlertMessage, { show: isInternalWithoutSFDCUser, variant: AlertType.WARNING, isInline: true, className: "pf-u-mb-lg", title: t('You need a Salesforce (SFDC) user to edit the action plan.') }),
72
81
  React.createElement("label", { htmlFor: "rha-action-plan", className: "sr-only" },
73
82
  React.createElement(Trans, null, "Action plan")),
74
- !canUpdateActionPlan && React.createElement("p", null, actionPlan ? `${actionPlan}` : t('No action plan to display.')),
83
+ !canUpdateActionPlan && (React.createElement("pre", { "aria-label": t('Case Action Plan'), dangerouslySetInnerHTML: actionPlan ? commentMarkdown(actionPlan) : t('No action plan to display.') })),
75
84
  canUpdateActionPlan && (React.createElement("form", null,
76
85
  React.createElement("div", { className: "hide-in-pdf" },
77
86
  React.createElement(TextAreaResizable, { className: "form-control", id: "rha-action-plan", disabled: isUpdating || isInternalWithoutSFDCUser, maxLength: 32768, name: "actionPlan", value: actionPlanState, onChange: onChange, rowsMin: 3 })),
@@ -1 +1 @@
1
- {"version":3,"file":"CaseAlternateId.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseAlternateId.tsx"],"names":[],"mappings":"AAiBA,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAOD,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eA6HrC;kBA7HQ,eAAe;;;AAgIxB,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"CaseAlternateId.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseAlternateId.tsx"],"names":[],"mappings":"AAiBA,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAOD,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eAqIrC;kBArIQ,eAAe;;;AAwIxB,eAAe,eAAe,CAAC"}
@@ -80,6 +80,12 @@ function CaseAlternateId(props) {
80
80
  });
81
81
  // To check if alternate ID is empty
82
82
  const isAlternateIDEmpty = isEmpty(alternateIdState === null || alternateIdState === void 0 ? void 0 : alternateIdState.trim());
83
+ // To populate the unsaved alternateId field with the previously saved value on onBlur event.
84
+ const onBlur = () => {
85
+ if (alternateId !== alternateIdState) {
86
+ setAlternateIdState(alternateId);
87
+ }
88
+ };
83
89
  return (React.createElement(React.Fragment, null,
84
90
  React.createElement(InlineEdit, { labelProps: { htmlFor: 'case-details-alternate-id' }, labelContent: React.createElement(React.Fragment, null,
85
91
  React.createElement(Trans, null, "Alternate case ID"),
@@ -90,7 +96,7 @@ function CaseAlternateId(props) {
90
96
  alternateIdState === alternateId ||
91
97
  isUpdating ||
92
98
  (alternateIdState === null || alternateIdState === void 0 ? void 0 : alternateIdState.length) > ALTERNATE_CASE_ID_LIMIT, loadingIndicator: isUpdating ? React.createElement(LoadingIndicator, { isInline: true }) : null },
93
- React.createElement("input", { value: alternateIdState, type: "text", className: "form-control", id: "case-details-alternate-id", placeholder: t(`Enter your case tracking number or internal incident ID`), onChange: onAlternateIdChange, disabled: isUpdating, "data-tracking-id": "case-details-alternate-id" })),
99
+ React.createElement("input", { value: alternateIdState, type: "text", className: "form-control", id: "case-details-alternate-id", placeholder: t(`Enter your case tracking number or internal incident ID`), onChange: onAlternateIdChange, disabled: isUpdating, "data-tracking-id": "case-details-alternate-id", onBlur: onBlur })),
94
100
  (alternateIdState === null || alternateIdState === void 0 ? void 0 : alternateIdState.length) > ALTERNATE_CASE_ID_LIMIT && (React.createElement("div", { className: "pull-top" },
95
101
  React.createElement("p", { className: "form-instructions form-invalid" },
96
102
  React.createElement(Trans, null, maxLengthErrorMessage))))));
@@ -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;AAG5E,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AAUjF,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,eA4WzC;kBA5WQ,mBAAmB;;;AA+W5B,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;AAG5E,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AAUjF,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,eA8WzC;kBA9WQ,mBAAmB;;;AAiX5B,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -174,7 +174,7 @@ function OpenshiftDropdownV4(props) {
174
174
  // recreate a new AbortController for each call
175
175
  let controller = new AbortController();
176
176
  abortControllerRef.current = controller;
177
- const archived = !showArchivedClusters ? " AND status!='Archived'" : '';
177
+ const clusterStatus = ` AND status not in ('Deprovisioned'${!showArchivedClusters ? ",'Archived'" : ''})`;
178
178
  const searchPhrase = search
179
179
  ? ` AND (external_cluster_id ILIKE '%${search}%' OR display_name ILIKE '%${search}%' OR console_url ILIKE '%${search}%')`
180
180
  : '';
@@ -183,7 +183,7 @@ function OpenshiftDropdownV4(props) {
183
183
  order: 'display_name asc',
184
184
  page,
185
185
  size: PER_PAGE,
186
- search: `external_cluster_id!='' ${archived} ${searchPhrase}`,
186
+ search: `external_cluster_id!='' ${clusterStatus} ${searchPhrase}`,
187
187
  fields: 'external_cluster_id,display_name,status,metrics.openshift_version,console_url',
188
188
  }, controller.signal);
189
189
  setInCache(`showArchived=${showArchivedClusters}input=${search}p=${page}`, clustersResponse);
@@ -595,6 +595,23 @@
595
595
  .grid-aside-content {
596
596
  padding: 1rem 1.5rem !important;
597
597
  height: 100%; // Warning: removing this will make the sidebar's content sticky
598
+ min-width: 300px;
599
+
600
+ @media (min-width: 992px) {
601
+ min-width: 400px;
602
+ }
603
+
604
+ @media (min-width: 1200px) {
605
+ min-width: 500px;
606
+ }
607
+
608
+ @media (min-width: 1450px) {
609
+ min-width: 550px;
610
+ }
611
+
612
+ @media (min-width: 2000px) {
613
+ min-width: 600px;
614
+ }
598
615
 
599
616
  & > * {
600
617
  margin: 1rem 0 2rem;
@@ -965,3 +982,10 @@ p.pref-case-popover-text {
965
982
  .rrs-light-grey-text {
966
983
  color: var(--pf-global--palette--black-600);
967
984
  }
985
+
986
+ .rsa-checkbox {
987
+ align-items: center;
988
+ input[type='checkbox'] {
989
+ margin: 0 5px 0 0;
990
+ }
991
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -73,15 +73,15 @@
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.13",
77
- "@rh-support/react-context": "1.0.16",
76
+ "@rh-support/components": "1.2.14",
77
+ "@rh-support/react-context": "1.0.17",
78
78
  "@rh-support/types": "0.2.0",
79
- "@rh-support/user-permissions": "1.0.10",
80
- "@rh-support/utils": "1.0.8",
79
+ "@rh-support/user-permissions": "1.0.11",
80
+ "@rh-support/utils": "1.0.9",
81
81
  "@types/react-redux": "^7.1.12",
82
82
  "@types/redux": "^3.6.0",
83
83
  "@webcomponents/webcomponentsjs": "^2.2.10",
84
- "dompurify": "^2.2.6",
84
+ "dompurify": "^2.4.1",
85
85
  "downshift": "^6.0.5",
86
86
  "i18next": "^19.0.1",
87
87
  "js-markdown-extra": "^1.2.4",
@@ -142,5 +142,5 @@
142
142
  "not ie <= 11",
143
143
  "not op_mini all"
144
144
  ],
145
- "gitHead": "00c3621a032251faa6c854fe60f297991768784b"
145
+ "gitHead": "627d7c3613245cf973dff8bee155a6f6fbe56686"
146
146
  }