@rh-support/troubleshoot 0.2.41 → 0.2.42

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":"CaseDetailsAside.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsAside.tsx"],"names":[],"mappings":"AAwBA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAkL7C"}
1
+ {"version":3,"file":"CaseDetailsAside.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsAside.tsx"],"names":[],"mappings":"AAwBA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAsL7C"}
@@ -43,7 +43,8 @@ export function CaseDetailsAside(props) {
43
43
  const isXLScreen = breakPoint.xl;
44
44
  const toggleCustomerViewRef = useRef(null);
45
45
  const isFirstMountRef = useRef(true);
46
- const { globalMetadataState: { navBarRef, viewAsCustomer }, } = useGlobalStateContext();
46
+ const { globalMetadataState: { navBarRef, viewAsCustomer, loggedInUsersAccount }, } = useGlobalStateContext();
47
+ const isSecureSupportAccount = loggedInUsersAccount.data.secureSupport;
47
48
  const onToggleAside = (ev) => {
48
49
  var _a;
49
50
  toggleAside(!((_a = caseDetailsAsidePanelRef.current) === null || _a === void 0 ? void 0 : _a.expanded));
@@ -99,7 +100,7 @@ export function CaseDetailsAside(props) {
99
100
  React.createElement("span", { className: "customer-view-switch-label" }, viewAsCustomer ? t('Customer view') : t('Internal view')),
100
101
  React.createElement(Switch, { title: viewAsCustomer ? t('Customer view') : t('Internal view'), "data-tracking-id": viewAsCustomer ? 'disable-view-as-customer' : 'enable-view-as-customer', "aria-label": viewAsCustomer ? 'disable view as customer' : 'enable view as customer', id: "customer-view-switch", className: "pf-u-ml-auto", isChecked: viewAsCustomer, onChange: () => toggleViewAsCustomerFlag(globalMetadataDispatchContext) }))),
101
102
  React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading top solutions') } },
102
- React.createElement(CaseSolutions, { caseNumber: caseNumber, ref: topSolutionsRef })),
103
+ React.createElement(CaseSolutions, { caseNumber: caseNumber, ref: topSolutionsRef, isSecureSupportAccount: isSecureSupportAccount })),
103
104
  !caseEscalations.isFetching && canViewACESection && (React.createElement(ErrorBoundary, null,
104
105
  React.createElement(ActiveCustomerEscalation, { caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef })))))));
105
106
  }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  interface IProps {
3
3
  caseNumber: string;
4
+ isSecureSupportAccount: boolean;
4
5
  }
5
6
  export declare const CaseSolutions: React.ForwardRefExoticComponent<IProps & React.RefAttributes<HTMLDivElement>>;
6
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAsD,MAAM,OAAO,CAAC;AA8D3E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAUD,eAAO,MAAM,aAAa,+EA6XxB,CAAC"}
1
+ {"version":3,"file":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAsD,MAAM,OAAO,CAAC;AA8D3E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAUD,eAAO,MAAM,aAAa,+EAmYxB,CAAC"}
@@ -90,7 +90,7 @@ export const CaseSolutions = forwardRef((props, ref) => {
90
90
  const caseDispatch = useCaseDispatch();
91
91
  const { recommendationState: { isLoadingRecommendations, allDocs }, } = useRecommendationStateContext();
92
92
  const recommendationsDispatch = useRecommendationDispatchContext();
93
- const { caseNumber } = props;
93
+ const { caseNumber, isSecureSupportAccount } = props;
94
94
  const [isPinLoading, setIsPinLoading] = useState({});
95
95
  const [expanded, setExpanded] = useState('sol-handpicked');
96
96
  const [recommendations, setRecommendations] = useState([]);
@@ -169,11 +169,11 @@ export const CaseSolutions = forwardRef((props, ref) => {
169
169
  function fetchRecs() {
170
170
  if (product && version && summary && description) {
171
171
  const payload = { product, version, summary, description };
172
- fetchRecommendations(recommendationsDispatch, payload, 50, 5, 300);
172
+ fetchRecommendations(recommendationsDispatch, payload, 50, 5, 300, false, caseNumber, isSecureSupportAccount);
173
173
  }
174
174
  }
175
175
  fetchRecs();
176
- }, [product, version, summary, description, recommendationsDispatch]);
176
+ }, [product, version, summary, description, recommendationsDispatch, caseNumber, isSecureSupportAccount]);
177
177
  // populate solutions when result is ready
178
178
  useEffect(() => {
179
179
  const mapRecommendation = (doc) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Recommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/Recommendations.tsx"],"names":[],"mappings":"AAwCA,MAAM,CAAC,OAAO,UAAU,eAAe,gBAoNtC"}
1
+ {"version":3,"file":"Recommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/Recommendations.tsx"],"names":[],"mappings":"AA0CA,MAAM,CAAC,OAAO,UAAU,eAAe,gBAyNtC"}
@@ -9,6 +9,7 @@ import isEqual from 'lodash/isEqual';
9
9
  import map from 'lodash/map';
10
10
  import React, { useContext, useEffect, useRef, useState } from 'react';
11
11
  import { Trans } from 'react-i18next';
12
+ import { useParams } from 'react-router-dom';
12
13
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
13
14
  import { RecommendationDispatchContext, RecommendationStateContext } from '../../context/RecommendationContext';
14
15
  import { RouteContext } from '../../context/RouteContext';
@@ -32,7 +33,10 @@ export default function Recommendations() {
32
33
  caseResourceLinks: state.caseDetails.caseResourceLinks,
33
34
  }), isEqual);
34
35
  const caseDispatch = useCaseDispatch();
35
- const { globalMetadataState: { navBarRef }, } = useGlobalStateContext();
36
+ // Use Case Number
37
+ const { caseNumber } = useParams();
38
+ const { globalMetadataState: { navBarRef, loggedInUsersAccount }, } = useGlobalStateContext();
39
+ const isSecureSupportAccount = loggedInUsersAccount.data.secureSupport;
36
40
  const { routeState: { activeSection }, } = useContext(RouteContext);
37
41
  const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
38
42
  const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
@@ -77,7 +81,7 @@ export default function Recommendations() {
77
81
  // recreate a new AbortController for each call
78
82
  let controller = new AbortController();
79
83
  abortControllerRef.current = controller;
80
- fetchRecommendations(recommendationDispatch, payload, MAXROW, recPageSize, 0, true, queryFilters, controller.signal);
84
+ fetchRecommendations(recommendationDispatch, payload, MAXROW, recPageSize, 0, true, caseNumber, isSecureSupportAccount, queryFilters, controller.signal);
81
85
  }, [
82
86
  activeSection,
83
87
  environment,
@@ -31,7 +31,7 @@ export declare enum RecommendationsConstants {
31
31
  resetRecommendations = "resetRecommendations"
32
32
  }
33
33
  export declare const recommandationsReducer: (state: IRecommendationsState, action: IActionType) => IRecommendationsState;
34
- export declare const fetchRecommendations: (dispatch: RecommendationsReducerDispatchType, body: IRecommendationsPayload, max_rows: number, page_size: number, highlighted_fragment_size: number, seQueryFields?: boolean, additionalFilters?: IRecommendationAdditionalFilters, abortSignal?: AbortSignal) => Promise<void>;
34
+ export declare const fetchRecommendations: (dispatch: RecommendationsReducerDispatchType, body: IRecommendationsPayload, max_rows: number, page_size: number, highlighted_fragment_size: number, seQueryFields: boolean, caseNumber: string, isSecureSupportAccount: boolean, additionalFilters?: IRecommendationAdditionalFilters, abortSignal?: AbortSignal) => Promise<void>;
35
35
  export declare const setVisibleDocs: (dispatch: RecommendationsReducerDispatchType, visDocs: ISolrRecommendation[]) => void;
36
36
  export declare const setCurrentPage: (dispatch: RecommendationsReducerDispatchType, pageNum: number) => void;
37
37
  export declare const setInsighResultsKcsIds: (dispatch: RecommendationsReducerDispatchType, insightsKcsIds: string[]) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"RecommendationsReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/RecommendationsReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAoB,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAiB,MAAM,0CAA0C,CAAC;AAC5G,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAiB,gCAAgC,EAA2B,MAAM,mBAAmB,CAAC;AAE7G,aAAK,WAAW,GAAG,OAAO,CAAC,wBAAwB,EAAE,qBAAqB,CAAC,CAAC;AAC5E,oBAAY,kCAAkC,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;AAE9E,MAAM,WAAW,qBAAqB;IAClC,wBAAwB,EAAE,OAAO,CAAC;IAClC,6BAA6B,EAAE,OAAO,CAAC;IACvC,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,kBAAkB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,uBAAuB,EAAE,uBAAuB,CAAC;CACpD;AAED,eAAO,MAAM,2BAA2B,EAAE,qBAYzC,CAAC;AAEF,oBAAY,wBAAwB;IAChC,sBAAsB,2BAA2B;IACjD,uBAAuB,4BAA4B;IACnD,4BAA4B,iCAAiC;IAC7D,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;IACjC,4BAA4B,iCAAiC;IAC7D,4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AQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,kBAAkB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,uBAAuB,EAAE,uBAAuB,CAAC;CACpD;AAED,eAAO,MAAM,2BAA2B,EAAE,qBAYzC,CAAC;AAEF,oBAAY,wBAAwB;IAChC,sBAAsB,2BAA2B;IACjD,uBAAuB,4BAA4B;IACnD,4BAA4B,iCAAiC;IAC7D,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;IACjC,4BAA4B,iCAAiC;IAC7D,4BAA4B,iCAAiC;IAC7D,sBAAsB,2BAA2B;IACjD,2BAA2B,gCAAgC;IAC3D,oBAAoB,yBAAyB;CAChD;AAGD,eAAO,MAAM,sBAAsB,UAAW,qBAAqB,0BAAwB,qBAmD1F,CAAC;AAGF,eAAO,MAAM,oBAAoB,aACnB,kCAAkC,QACtC,uBAAuB,YACnB,MAAM,aACL,MAAM,6BACU,MAAM,sCAErB,MAAM,0BACM,OAAO,sBACX,gCAAgC,gBACtC,WAAW,kBAkC5B,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,kCAAkC,WAAW,mBAAmB,EAAE,SAE1G,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,kCAAkC,WAAW,MAAM,SAE3F,CAAC;AAEF,eAAO,MAAM,sBAAsB,aAAc,kCAAkC,kBAAkB,MAAM,EAAE,SAE5G,CAAC;AAEF,eAAO,MAAM,oBAAoB,aAAc,kCAAkC,SAEhF,CAAC"}
@@ -74,7 +74,7 @@ export const recommandationsReducer = (state, action) => {
74
74
  }
75
75
  };
76
76
  // Actions
77
- export const fetchRecommendations = (dispatch, body, max_rows, page_size, highlighted_fragment_size, seQueryFields = false, additionalFilters, abortSignal) => __awaiter(void 0, void 0, void 0, function* () {
77
+ export const fetchRecommendations = (dispatch, body, max_rows, page_size, highlighted_fragment_size, seQueryFields = false, caseNumber, isSecureSupportAccount, additionalFilters, abortSignal) => __awaiter(void 0, void 0, void 0, function* () {
78
78
  dispatch({
79
79
  type: RecommendationsConstants.requestRecommendations,
80
80
  payload: { prevRecommendationsBody: Object.assign({}, body) },
@@ -85,7 +85,8 @@ export const fetchRecommendations = (dispatch, body, max_rows, page_size, highli
85
85
  body.description = body.description && body.description.replace(/\?\?/g, '');
86
86
  }
87
87
  const searchParams = getSolrParams(max_rows, highlighted_fragment_size, additionalFilters, seQueryFields);
88
- const response = yield search.getRecommendationsForCase(body, searchParams, abortSignal);
88
+ const response = yield search.getRecommendationsForCase(body, Object.assign(Object.assign({}, searchParams), { caseNumber, isSecureSupportAccount }), // Need to pass caseNumber and isSecureSupportAccount flag with SOLR parameter which will be used in service worker strategy.
89
+ abortSignal);
89
90
  const docs = replaceHighlightingData(response.response.docs, response.highlighting);
90
91
  dispatch({
91
92
  type: RecommendationsConstants.receivedRecommendations,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "0.2.41",
3
+ "version": "0.2.42",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -142,5 +142,5 @@
142
142
  "not ie <= 11",
143
143
  "not op_mini all"
144
144
  ],
145
- "gitHead": "2e8ecad772429f43844ab8f4dbc4de2cdc7e157c"
145
+ "gitHead": "cdaf99c40c84eb9dbf63b52cc8c227e1e3d131a4"
146
146
  }