@rh-support/cases 0.2.76 → 0.2.83

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
@@ -16,3 +16,5 @@ export default function CasesApp(routeProps: RouteComponentProps<ICasesRouteURLP
16
16
  return (<Cases routeProps={routeProps} basePath="/cases" />);
17
17
  }
18
18
  ```
19
+
20
+ .
@@ -1 +1 @@
1
- {"version":3,"file":"CaseList.d.ts","sourceRoot":"","sources":["../../../../src/components/case-list/CaseList.tsx"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AA4BlC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAKH,0BAA0B,EAI7B,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,mBAAmB,EAAe,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAM1C,OAAO,EAAgB,WAAW,EAA2B,MAAM,uBAAuB,CAAC;AAmC3F,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC3D,YAAY,EAAE,cAAc,EAAE,CAAC;CAClC;AAED,oBAAY,YAAY,GAAG,0BAA0B,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC;AAM5F,MAAM,WAAW,gBAAgB;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,eA4crC"}
1
+ {"version":3,"file":"CaseList.d.ts","sourceRoot":"","sources":["../../../../src/components/case-list/CaseList.tsx"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AA4BlC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAKH,0BAA0B,EAI7B,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,mBAAmB,EAAe,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAM1C,OAAO,EAAgB,WAAW,EAA2B,MAAM,uBAAuB,CAAC;AAmC3F,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC3D,YAAY,EAAE,cAAc,EAAE,CAAC;CAClC;AAED,oBAAY,YAAY,GAAG,0BAA0B,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC;AAM5F,MAAM,WAAW,gBAAgB;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,eA6crC"}
@@ -70,7 +70,7 @@ export function CaseList(props) {
70
70
  const prevSearchType = usePrevious(filterState.filterQueryInfo.type);
71
71
  let isSearchTypeChanged = filterState.filterQueryInfo.type !== prevSearchType;
72
72
  const [hasError, setHasError] = useState(null);
73
- const [isSolrSearchDown, setSolrSearchDown] = useState(false);
73
+ const [isSolrSearchDown, setSolrSearchDown] = useState(true);
74
74
  const [defaultSavedSearchName, setDefaultSavedSearchName] = useState('');
75
75
  function getCases(currentFilterState) {
76
76
  return __awaiter(this, void 0, void 0, function* () {
@@ -87,7 +87,7 @@ export function CaseList(props) {
87
87
  abortControllerRef.current = controller;
88
88
  const { caseListResponse, isSolrSearchDownSFDCUp, showErrorMessage } = yield getCaseList(currentFilterState, loggedInUserRights.data, loggedInUsersAccount.data, controller.signal);
89
89
  showError = showErrorMessage;
90
- setSolrSearchDown(isSolrSearchDownSFDCUp);
90
+ setSolrSearchDown(!isSolrSearchDownSFDCUp);
91
91
  setFilterValuesFromFacetResponse(CaseListDispatch, solrResponseToFacetFields(caseListResponse));
92
92
  setPivotValues(CaseListDispatch, solrResponseToPivotFields(caseListResponse));
93
93
  setCaseList(CaseListDispatch, caseListResponse.response);
@@ -335,5 +335,5 @@ export function CaseList(props) {
335
335
  React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading filters') } },
336
336
  React.createElement(CaseListFilters, { filterValues: filterValuesFromFacetResponse, allCaseTypes: allCaseTypes, allCaseStatuses: allCaseStatuses, allCaseSeverities: allCaseSeverities, allProducts: allProducts, isSolrSearchDown: isSolrSearchDown })))))),
337
337
  React.createElement("section", { className: "case-search-table" },
338
- React.createElement(CaseListTable, { caseList: caseList, caseGroups: caseGroups.data || [], loggedInUserRights: loggedInUserRights.data, sortInfo: filterState.sortInfo, paginationInfo: filterState.paginationInfo, isCaseListPageLoading: isFetching, hasError: hasError })))));
338
+ React.createElement(CaseListTable, { caseList: caseList, caseGroups: caseGroups.data || [], loggedInUserRights: loggedInUserRights.data, sortInfo: filterState.sortInfo, paginationInfo: filterState.paginationInfo, isCaseListPageLoading: isFetching, hasError: hasError, isSolrDown: isSolrSearchDown })))));
339
339
  }
@@ -11,6 +11,7 @@ interface IProps {
11
11
  paginationInfo?: IPaginationInfo;
12
12
  isCaseListPageLoading: boolean;
13
13
  hasError: boolean;
14
+ isSolrDown?: boolean;
14
15
  }
15
16
  export declare function CaseListTable(props: IProps): JSX.Element;
16
17
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"CaseListTable.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/CaseListTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AA6B3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAWxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAEH,eAAe,EACf,SAAS,EAIZ,MAAM,0BAA0B,CAAC;AA2BlC,UAAU,MAAM;IACZ,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC3C,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,eA+W1C"}
1
+ {"version":3,"file":"CaseListTable.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/CaseListTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AA6B3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAWxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAEH,eAAe,EACf,SAAS,EAIZ,MAAM,0BAA0B,CAAC;AA2BlC,UAAU,MAAM;IACZ,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC3C,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,eAkX1C"}
@@ -295,7 +295,7 @@ export function CaseListTable(props) {
295
295
  React.createElement("div", { className: "case-list-table-toolbar pf-l-flex", ref: tableToolbarRef },
296
296
  React.createElement("div", { className: "toolbar-actions pf-l-flex pf-m-space-items-sm" },
297
297
  React.createElement(TableColumnSelector, { onColumnSelectorChange: onColumnSelectorChange }),
298
- React.createElement(ExportCaseListCSV, { currentFilteredCaseList: props.caseList }),
298
+ React.createElement(ExportCaseListCSV, { currentFilteredCaseList: props.caseList, isExportCsvDisabled: props.isSolrDown }),
299
299
  React.createElement(CloseCaseBtn, { selectedCases: selectedCases, caseList: caseListData, onCasesCloseSuccess: onCasesCloseSuccess })),
300
300
  React.createElement("span", { className: "toolbar-pagination" },
301
301
  React.createElement(TablePagination, { perPage: (_c = props.paginationInfo) === null || _c === void 0 ? void 0 : _c.pageSize, currentPage: (_d = props.paginationInfo) === null || _d === void 0 ? void 0 : _d.currentPage, onPerPageSelect: onPerPageSelect, onSetPage: onSetPage, variant: PaginationVariant.top, itemCount: getItemCount() }))),
@@ -2,6 +2,7 @@ import { ISolrResponse } from '@rh-support/types/shared';
2
2
  import { ICaseListResponse } from '../../../models/caseList';
3
3
  interface IProps {
4
4
  currentFilteredCaseList: ISolrResponse<ICaseListResponse>;
5
+ isExportCsvDisabled?: boolean;
5
6
  }
6
7
  export declare function ExportCaseListCSV(props: IProps): JSX.Element;
7
8
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ExportCaseListCSV.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/ExportCaseListCSV.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAgD7D,UAAU,MAAM;IACZ,uBAAuB,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;CAC7D;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,eA2E9C"}
1
+ {"version":3,"file":"ExportCaseListCSV.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/ExportCaseListCSV.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAgD7D,UAAU,MAAM;IACZ,uBAAuB,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC1D,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,eAuF9C"}
@@ -69,7 +69,7 @@ export function ExportCaseListCSV(props) {
69
69
  const [isFetchingSFDC, setIsFetchingSFDC] = useState(false);
70
70
  const isFetchingCSVData = isFetching || isFetchingSFDC;
71
71
  const isBtnDisabled = isFetchingCSVData || currentFilteredCaseCount === 0;
72
- const btnTitle = currentFilteredCaseCount >= MAX_LIMIT ? maxLengthTooltip : btnToolTip;
72
+ let btnTitle = currentFilteredCaseCount >= MAX_LIMIT ? maxLengthTooltip : btnToolTip;
73
73
  const filterState = useContext(CaseListFilterStateContext);
74
74
  const { globalMetadataState: { loggedInUserRights, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
75
75
  const isOrgAdmin = loggedInUserRights.data.isOrgAdmin();
@@ -98,7 +98,16 @@ export function ExportCaseListCSV(props) {
98
98
  ToastNotification.addDangerMessage(t('Could not export CSV'));
99
99
  }
100
100
  });
101
- return (React.createElement(Button, { variant: "tertiary", isDisabled: isBtnDisabled, onClick: loggedInUsersAccount.data.secureSupport ? onExportCSVClickSecureSupport : onExportCSVClick, title: btnTitle, "data-tracking-id": "case-list-toolbar-export-csv" }, isFetchingCSVData ? (React.createElement(React.Fragment, null,
102
- React.createElement(Trans, null, "Exporting CSV"),
103
- React.createElement("i", { className: "fa fa-circle-o-notch fa-spin fa-fw", "aria-label": "loading" }))) : (React.createElement(Trans, null, "Export CSV"))));
101
+ // To show tooltip if export csv is disabled when SOLR is down
102
+ const getTooltipContent = () => {
103
+ let tooltipText = t('Export Cases');
104
+ if (props.isExportCsvDisabled) {
105
+ tooltipText = t('Unable to export while access to search is limited');
106
+ }
107
+ return tooltipText;
108
+ };
109
+ return (React.createElement("span", { title: props.isExportCsvDisabled && getTooltipContent() },
110
+ React.createElement(Button, { variant: "tertiary", isDisabled: isBtnDisabled || props.isExportCsvDisabled, onClick: loggedInUsersAccount.data.secureSupport ? onExportCSVClickSecureSupport : onExportCSVClick, title: btnTitle, "data-tracking-id": "case-list-toolbar-export-csv" }, isFetchingCSVData ? (React.createElement(React.Fragment, null,
111
+ React.createElement(Trans, null, "Exporting CSV"),
112
+ React.createElement("i", { className: "fa fa-circle-o-notch fa-spin fa-fw", "aria-label": "loading" }))) : (React.createElement(Trans, null, "Export CSV")))));
104
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/cases",
3
- "version": "0.2.76",
3
+ "version": "0.2.83",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -26,7 +26,7 @@
26
26
  "lib/**/*"
27
27
  ],
28
28
  "peerDependencies": {
29
- "@cee-eng/hydrajs": "4.10.0",
29
+ "@cee-eng/hydrajs": "4.10.2",
30
30
  "@patternfly/patternfly": "4.185.1",
31
31
  "@patternfly/pfe-collapse": "1.12.3",
32
32
  "@patternfly/react-core": "4.202.16",
@@ -47,17 +47,17 @@
47
47
  "solr-query-builder": "1.0.1"
48
48
  },
49
49
  "dependencies": {
50
- "@cee-eng/hydrajs": "4.10.0",
50
+ "@cee-eng/hydrajs": "4.10.2",
51
51
  "@patternfly/patternfly": "4.185.1",
52
52
  "@patternfly/pfe-collapse": "1.12.3",
53
53
  "@patternfly/react-core": "4.202.16",
54
54
  "@patternfly/react-table": "4.71.16",
55
- "@rh-support/api": "0.3.18",
56
- "@rh-support/components": "1.1.62",
57
- "@rh-support/react-context": "0.2.64",
58
- "@rh-support/types": "0.3.0",
59
- "@rh-support/user-permissions": "0.2.50",
60
- "@rh-support/utils": "0.2.39",
55
+ "@rh-support/api": "0.3.21",
56
+ "@rh-support/components": "1.1.67",
57
+ "@rh-support/react-context": "0.2.71",
58
+ "@rh-support/types": "0.2.0",
59
+ "@rh-support/user-permissions": "0.2.57",
60
+ "@rh-support/utils": "0.2.43",
61
61
  "i18next": "^19.0.1",
62
62
  "localforage": "^1.7.3",
63
63
  "lodash": "^4.17.15",
@@ -101,5 +101,5 @@
101
101
  "not ie <= 11",
102
102
  "not op_mini all"
103
103
  ],
104
- "gitHead": "d079ee3127aa11ae00fa9febdf6519e9005140df"
104
+ "gitHead": "072b28907d0e79329f03ba2779242fb5c9384cac"
105
105
  }