@rh-support/troubleshoot 2.2.68 → 2.2.69

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/README.md CHANGED
@@ -6,7 +6,6 @@ Pluggable troubleshoot module.
6
6
 
7
7
  ```
8
8
  import {
9
- RootTroubleshootProvider,
10
9
  Troubleshoot
11
10
  } from '@rh-support/troubleshoot';
12
11
  <!-- import '@rh-support/troubleshoot/lib/troubleshoot.css'; -->
@@ -14,9 +13,7 @@ import React from 'react';
14
13
  import { RouteComponentProps } from 'react-router-dom';
15
14
 
16
15
  export function TroubleshootApp(routeProps: RouteComponentProps<{}>) {
17
- return (<RootTroubleshootProvider>
18
- <Troubleshoot routeProps={routeProps} basePath="/troubleshoot"/>
19
- </RootTroubleshootProvider>);
16
+ return (<Troubleshoot routeProps={routeProps} basePath="/troubleshoot"/>);
20
17
  }
21
18
 
22
19
  ```
@@ -43,6 +43,7 @@ export function EARuleInfoInline({ eaRules = [] }) {
43
43
  const isSecureSupportAccount = loggedInUsersAccount.data.secureSupport;
44
44
  const validEARulesLength = eaRules.length;
45
45
  const isAnyRuleResolved = some(eaRules, (item) => item.resolved);
46
+ const visibleRule = eaRules[currentPage > validEARulesLength ? validEARulesLength - 1 : currentPage - 1];
46
47
  // if user ignores a rule on last page, we need to handle the scenario
47
48
  useEffect(() => {
48
49
  if (currentPage > validEARulesLength) {
@@ -52,7 +53,7 @@ export function EARuleInfoInline({ eaRules = [] }) {
52
53
  }, [validEARulesLength]);
53
54
  const onPaginationChange = (currentPage) => {
54
55
  createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.EDMOUND_ABOTT, [
55
- getSessResFromRules(null, SessionResourceVisibility.PRESENTED, eaRules[currentPage - 1].rule_id, currentPage),
56
+ getSessResFromRules(visibleRule.cta, SessionResourceVisibility.PRESENTED, eaRules[currentPage - 1].rule_id, currentPage),
56
57
  ], JSON.stringify({ product, version }));
57
58
  setCurrentPage(currentPage);
58
59
  };
@@ -89,7 +90,6 @@ export function EARuleInfoInline({ eaRules = [] }) {
89
90
  React.createElement(Trans, null, "Resolved"))) : isAnyRuleResolved ? null : (React.createElement(Button, { isDisabled: isFetching, isLoading: isFetching, className: "se-recommended ts-known-vuln", variant: ButtonVariant.link, isInline: true, "data-tracking-id": "se-recommended-asa-resolve", type: "button", onClick: onResolveClick }, isFetching ? null : React.createElement(Trans, null, "This resolved my issue")));
90
91
  if (validEARulesLength < 1)
91
92
  return null;
92
- const visibleRule = eaRules[currentPage > validEARulesLength ? validEARulesLength - 1 : currentPage - 1];
93
93
  return (React.createElement(React.Fragment, null,
94
94
  React.createElement(RecommendationFeedbackModal, { isModalOpen: isModalVisible, handleModalToggle: onModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
95
95
  React.createElement(EARule, { rule: visibleRule },
@@ -1 +1 @@
1
- {"version":3,"file":"EARuleWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleWidget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAWrD,wBAAgB,YAAY,sBA2C3B"}
1
+ {"version":3,"file":"EARuleWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleWidget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAWrD,wBAAgB,YAAY,sBAkD3B"}
@@ -26,7 +26,9 @@ export function EARuleWidget() {
26
26
  if (visibleValidEARules &&
27
27
  differenceBy([visibleValidEARules === null || visibleValidEARules === void 0 ? void 0 : visibleValidEARules.rule_id], presentedIds).length > 0 &&
28
28
  !isEmpty(activeSessionId)) {
29
- createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.EDMOUND_ABOTT, [getSessResFromRules(null, SessionResourceVisibility.PRESENTED, visibleValidEARules.rule_id, 1)], JSON.stringify({ product, version }));
29
+ createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.EDMOUND_ABOTT, [
30
+ getSessResFromRules(visibleValidEARules.cta, SessionResourceVisibility.PRESENTED, visibleValidEARules.rule_id, 1),
31
+ ], JSON.stringify({ product, version }));
30
32
  }
31
33
  // eslint-disable-next-line react-hooks/exhaustive-deps
32
34
  }, [validEARules, activeSessionId]);
@@ -1 +1 @@
1
- {"version":3,"file":"WizardLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardLayout.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAavG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,qBAgJzC"}
1
+ {"version":3,"file":"WizardLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardLayout.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAavG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,qBAoKzC"}
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { Grid, GridItem } from '@patternfly/react-core';
11
11
  import { SupportFeedbackForm } from '@rh-support/components';
12
- import { GlobalMetadataStateContext } from '@rh-support/react-context';
12
+ import { fetchProducts, GlobalMetadataDispatchContext, GlobalMetadataStateContext } from '@rh-support/react-context';
13
13
  import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
14
14
  import { getVersionIfOnlyVersion, pendoTrackEvent, PreviousCaseTypes } from '@rh-support/utils';
15
15
  import findIndex from 'lodash/findIndex';
16
16
  import isEqual from 'lodash/isEqual';
17
- import React, { useContext, useRef, useState } from 'react';
17
+ import React, { useContext, useEffect, useRef, useState } from 'react';
18
18
  import { Trans } from 'react-i18next';
19
19
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
20
20
  import { RouteContext } from '../../context/RouteContext';
@@ -32,11 +32,18 @@ import WizardAside from './WizardAside';
32
32
  import WizardMain from './WizardMain';
33
33
  export function WizardLayout(props) {
34
34
  const { routeState: { activeSection, isCaseCreate }, } = useContext(RouteContext);
35
- const caseState = useCaseSelector((state) => state, isEqual);
35
+ const { caseCreationError, contactSSOName, caseType, product, caseState } = useCaseSelector((state) => ({
36
+ caseState: state,
37
+ caseCreationError: state.caseCreationError,
38
+ contactSSOName: state.caseDetails.contactSSOName,
39
+ caseType: state.caseDetails.caseType,
40
+ product: state.caseDetails.product,
41
+ }), isEqual);
36
42
  const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
37
43
  const caseDispatch = useCaseDispatch();
38
44
  const { sessionRestore: { activeSessionId, previousSessions }, } = useContext(SessionRestoreStateContext);
39
45
  const { globalMetadataState: { allProducts, loggedInUser, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
46
+ const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
40
47
  const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
41
48
  const { attachmentState } = useContext(AttachmentStateContext);
42
49
  const isAnyFileAttachedLocal = isAnyFileAttached(attachmentState.caseFiles.selectedLocalFiles);
@@ -54,11 +61,10 @@ export function WizardLayout(props) {
54
61
  RouteUtils.updateQueryParams(props.routeProps, newParams);
55
62
  };
56
63
  const checkForConfirmationModalsOnReview = () => {
57
- var _a, _b;
58
- if (((_a = caseState === null || caseState === void 0 ? void 0 : caseState.caseDetails) === null || _a === void 0 ? void 0 : _a.caseType) === PreviousCaseTypes.FEATURE_ENHANCEMENT)
64
+ if (caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT)
59
65
  return false;
60
66
  let isModalPresent = false;
61
- if (((_b = caseState === null || caseState === void 0 ? void 0 : caseState.caseDetails) === null || _b === void 0 ? void 0 : _b.product) === 'Red Hat OpenShift Cluster Manager' &&
67
+ if (product === 'Red Hat OpenShift Cluster Manager' &&
62
68
  !viewedConfirmationModalsList.current.includes(PreCaseConfirmationModalsEnum.ROCM_MODAL)) {
63
69
  setConfirmationModalType(PreCaseConfirmationModalsEnum.ROCM_MODAL);
64
70
  viewedConfirmationModalsList.current.push(PreCaseConfirmationModalsEnum.ROCM_MODAL);
@@ -108,9 +114,14 @@ export function WizardLayout(props) {
108
114
  }
109
115
  setConfirmationModalType(null);
110
116
  };
117
+ // Loading app metadata
118
+ useEffect(() => {
119
+ fetchProducts(dispatchToGlobalMetadataReducer, contactSSOName);
120
+ // eslint-disable-next-line react-hooks/exhaustive-deps
121
+ }, [contactSSOName, dispatchToGlobalMetadataReducer]);
111
122
  return (React.createElement(React.Fragment, null,
112
123
  React.createElement(GlobalTroubleshootEffects, { routeProps: props.routeProps }),
113
- activeSection !== AppRouteSections.DESCRIBE_IDEA && (React.createElement(PreCaseConfirmationModals, { onModalClose: onModalClose, confirmationModalType: confirmationModalType, onConfirm: () => submitCaseAndNavigate(caseState.caseCreationError) })),
124
+ activeSection !== AppRouteSections.DESCRIBE_IDEA && (React.createElement(PreCaseConfirmationModals, { onModalClose: onModalClose, confirmationModalType: confirmationModalType, onConfirm: () => submitCaseAndNavigate(caseCreationError) })),
114
125
  React.createElement(Grid, { style: { height: '100%' } },
115
126
  React.createElement(GridItem, { sm: 12, md: 12, lg: 8, xl2: 8 },
116
127
  React.createElement(WizardMain, { routeProps: props.routeProps, submitCaseAndNavigate: submitCaseAndNavigate, confirmSupportModal: confirmSupportModal })),
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,6CAA6C,CAAC;AACrD,OAAO,mBAAmB,CAAC;AAC3B,OAAO,0BAA0B,CAAC;AAClC,OAAO,+BAA+B,CAAC;AACvC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,2CAA2C,CAAC;AAInD,OAAO,KAAgC,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAIlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,oBAAoB,EAAE,GAAG,CAAC;QAC1B,MAAM,EAAE,GAAG,CAAC;QACZ,KAAK,EAAE,GAAG,CAAC;QACX,aAAa,EAAE;YACX,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC;SACnB,CAAC;KACL;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;CACJ;AAED,eAAO,MAAM,YAAY,UAAW,MAAM,sBAgBzC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,6CAA6C,CAAC;AACrD,OAAO,mBAAmB,CAAC;AAC3B,OAAO,0BAA0B,CAAC;AAClC,OAAO,+BAA+B,CAAC;AACvC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,2CAA2C,CAAC;AAGnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,oBAAoB,EAAE,GAAG,CAAC;QAC1B,MAAM,EAAE,GAAG,CAAC;QACZ,KAAK,EAAE,GAAG,CAAC;QACX,aAAa,EAAE;YACX,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC;SACnB,CAAC;KACL;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;CACJ;AAED,eAAO,MAAM,YAAY,UAAW,MAAM,sBAYzC,CAAC"}
@@ -5,23 +5,16 @@ import '../../css/productSelector.css';
5
5
  import '../../css/results.css';
6
6
  import '../shared/fileUpload/css/fileSelector.css';
7
7
  import { useDocumentTitle } from '@rh-support/components';
8
- import { fetchProducts, GlobalMetadataDispatchContext } from '@rh-support/react-context';
9
- import React, { useContext, useEffect } from 'react';
10
- import { useCaseSelector } from '../../context/CaseContext';
8
+ import React from 'react';
9
+ import { RootTroubleshootProvider } from '../../context/RootTroubleshootProvider';
11
10
  import { PageTitle } from '../../enums/pageTitle';
12
11
  import RouteUtils from '../../utils/routeUtils';
13
12
  import { WizardLayout } from './WizardLayout';
14
13
  export const Troubleshoot = (props) => {
15
14
  const isCaseCreate = RouteUtils.getQueryParams(props.routeProps).caseCreate === 'true';
16
15
  useDocumentTitle(isCaseCreate ? PageTitle.NEW_CASE : PageTitle.TROUBLESHOOT);
17
- const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
18
- const contactSSOName = useCaseSelector((state) => state.caseDetails.contactSSOName);
19
16
  RouteUtils.seBasePath = props.basePath || '';
20
- // Loading app metadata
21
- useEffect(() => {
22
- fetchProducts(dispatchToGlobalMetadataReducer, contactSSOName);
23
- // eslint-disable-next-line react-hooks/exhaustive-deps
24
- }, [contactSSOName, dispatchToGlobalMetadataReducer]);
25
17
  return (React.createElement("div", { id: "se-solution-engine" },
26
- React.createElement(WizardLayout, { routeProps: props.routeProps })));
18
+ React.createElement(RootTroubleshootProvider, null,
19
+ React.createElement(WizardLayout, { routeProps: props.routeProps }))));
27
20
  };
@@ -2,7 +2,6 @@ export declare const CASE_DETAILS_ACTIVE_TAB_SEARCH_PARAM = "activeCaseDetailsTa
2
2
  export declare enum CaseDetailsTabsEnum {
3
3
  DISCUSSION = "Discussion",
4
4
  MANAGEMENT = "Management",
5
- BUGZILLA = "Bugzilla",
6
5
  ACTION_PLAN = "Action plan",
7
6
  PRIVATE_NOTES = "Private Notes",
8
7
  ESCALATION = "Escalations",
@@ -1 +1 @@
1
- {"version":3,"file":"caseDetailsConstants.d.ts","sourceRoot":"","sources":["../../../src/constants/caseDetailsConstants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oCAAoC,yBAAyB,CAAC;AAE3E,oBAAY,mBAAmB;IAC3B,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,UAAU,gBAAgB;IAC1B,aAAa,kBAAkB;CAClC;AAED,oBAAY,cAAc;IACtB,MAAM,WAAW;IACjB,mBAAmB,wBAAwB;IAC3C,iBAAiB,uBAAuB;CAC3C;AAED,oBAAY,0BAA0B;IAClC,OAAO,MAAM;IACb,WAAW,OAAO;IAClB,OAAO,MAAM;CAChB;AAED,eAAO,MAAM,0BAA0B,6DAA6D,CAAC;AAErG,eAAO,MAAM,mBAAmB,uCAAuC,CAAC;AAExE,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAE7D,eAAO,MAAM,iBAAiB,8EAA8E,CAAC"}
1
+ {"version":3,"file":"caseDetailsConstants.d.ts","sourceRoot":"","sources":["../../../src/constants/caseDetailsConstants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oCAAoC,yBAAyB,CAAC;AAE3E,oBAAY,mBAAmB;IAC3B,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,UAAU,gBAAgB;IAC1B,aAAa,kBAAkB;CAClC;AAED,oBAAY,cAAc;IACtB,MAAM,WAAW;IACjB,mBAAmB,wBAAwB;IAC3C,iBAAiB,uBAAuB;CAC3C;AAED,oBAAY,0BAA0B;IAClC,OAAO,MAAM;IACb,WAAW,OAAO;IAClB,OAAO,MAAM;CAChB;AAED,eAAO,MAAM,0BAA0B,6DAA6D,CAAC;AAErG,eAAO,MAAM,mBAAmB,uCAAuC,CAAC;AAExE,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAE7D,eAAO,MAAM,iBAAiB,8EAA8E,CAAC"}
@@ -3,7 +3,6 @@ export var CaseDetailsTabsEnum;
3
3
  (function (CaseDetailsTabsEnum) {
4
4
  CaseDetailsTabsEnum["DISCUSSION"] = "Discussion";
5
5
  CaseDetailsTabsEnum["MANAGEMENT"] = "Management";
6
- CaseDetailsTabsEnum["BUGZILLA"] = "Bugzilla";
7
6
  CaseDetailsTabsEnum["ACTION_PLAN"] = "Action plan";
8
7
  CaseDetailsTabsEnum["PRIVATE_NOTES"] = "Private Notes";
9
8
  CaseDetailsTabsEnum["ESCALATION"] = "Escalations";
@@ -1,5 +1,4 @@
1
1
  import './scss/index.scss';
2
- export { RootTroubleshootProvider } from './context/RootTroubleshootProvider';
3
2
  export { Troubleshoot } from './components/wizardLayout';
4
3
  export { CaseApp } from './components/CaseEditView';
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
package/lib/esm/index.js CHANGED
@@ -1,4 +1,3 @@
1
1
  import './scss/index.scss';
2
- export { RootTroubleshootProvider } from './context/RootTroubleshootProvider';
3
2
  export { Troubleshoot } from './components/wizardLayout';
4
3
  export { CaseApp } from './components/CaseEditView';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.2.68",
3
+ "version": "2.2.69",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -132,5 +132,5 @@
132
132
  "defaults and supports es6-module",
133
133
  "maintained node versions"
134
134
  ],
135
- "gitHead": "f95bf012016d8a689c69d518b98266a3ac0292d9"
135
+ "gitHead": "19f893dca537531c7f828ffa92daf8fe40649d78"
136
136
  }
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- interface IProps {
3
- }
4
- export default function CaseBugzilla(props: IProps): React.JSX.Element;
5
- export {};
6
- //# sourceMappingURL=CaseBugzilla.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CaseBugzilla.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseBugzilla/CaseBugzilla.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAM1C,UAAU,MAAM;CAAG;AAEnB,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,qBAmDjD"}
@@ -1,29 +0,0 @@
1
- import isEqual from 'lodash/isEqual';
2
- import React, { useContext } from 'react';
3
- import { Trans } from 'react-i18next';
4
- import { useCaseSelector } from '../../../../context/CaseContext';
5
- import { PDFContext } from '../../PDFContainer';
6
- export default function CaseBugzilla(props) {
7
- const bugzillas = useCaseSelector((state) => state.caseDetails.bugzillas, isEqual);
8
- const { isExportingPDF } = useContext(PDFContext);
9
- const bugzillaRow = (bugzilla) => (React.createElement("tr", { key: bugzilla.bugzillaNumber },
10
- React.createElement("td", { id: `th-bug${bugzilla.bugzillaNumber}`, headers: "th-bug-number" },
11
- React.createElement("a", { href: bugzilla.bugzillaLink, target: "_blank", rel: "noopener noreferrer" }, bugzilla.bugzillaNumber)),
12
- React.createElement("td", { headers: `th-bug${bugzilla.bugzillaNumber} th-bug-summary` }, bugzilla.summary)));
13
- const bugzillasList = (bugzillas) => {
14
- return (React.createElement("table", { className: "table table-naked table-hover table-respond", style: { fontFamily: isExportingPDF ? 'DejaVu Sans' : '' } },
15
- React.createElement("thead", null,
16
- React.createElement("tr", null,
17
- React.createElement("td", { id: "th-bug-number" },
18
- React.createElement("strong", null,
19
- React.createElement(Trans, null, "Request number"))),
20
- React.createElement("td", { id: "th-bug-summary" },
21
- React.createElement("strong", null,
22
- React.createElement(Trans, null, "Summary"))))),
23
- React.createElement("tbody", null, bugzillas.map((item) => bugzillaRow(item)))));
24
- };
25
- return (React.createElement(React.Fragment, null,
26
- (bugzillas || []).length < 1 && (React.createElement("p", null,
27
- React.createElement(Trans, null, "There aren't any linked Bugzilla tickets."))),
28
- bugzillas && bugzillas.length > 0 && bugzillasList(bugzillas)));
29
- }