@rh-support/cases 2.6.212 → 2.6.214

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":"CaseList.d.ts","sourceRoot":"","sources":["../../../../src/components/case-list/CaseList.tsx"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AAuClC,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAE,mBAAmB,EAAe,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAqC1C,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACzD;AAMD,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,qBAqpBrC"}
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;AAuClC,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAE,mBAAmB,EAAe,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAqC1C,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACzD;AAMD,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,qBAspBrC"}
@@ -495,5 +495,5 @@ export function CaseList(props) {
495
495
  React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading filters') } },
496
496
  React.createElement(CaseListFilters, { allCaseTypes: allCaseTypes, allCaseStatuses: allCaseStatuses, allCaseSeverities: allCaseSeverities, allProducts: allProducts }))))),
497
497
  React.createElement("section", { className: "case-search-table pf-v6-u-display-flex pf-v6-u-flex-direction-column" },
498
- React.createElement(CaseListTable, { caseList: caseList, caseGroups: caseGroups.data || [], loggedInUserRights: loggedInUserRights.data, sortInfo: filterState.sortInfo, isCaseListPageLoading: isFetching, hasError: hasError, hasNextPage: hasNextPage, isLoadingMore: isLoadingMore, loadMoreError: loadMoreError, loadMoreRetryCount: loadMoreRetryCount, onRetryLoadMore: retryLoadMore, sentinelRef: sentinelRef }))))));
498
+ React.createElement(CaseListTable, { caseList: caseList, caseGroups: caseGroups.data || [], loggedInUserRights: loggedInUserRights.data, sortInfo: filterState.sortInfo, isCaseListPageLoading: isFetching, hasError: hasError, hasNextPage: hasNextPage, isLoadingMore: isLoadingMore, loadMoreError: loadMoreError, loadMoreRetryCount: loadMoreRetryCount, onRetryLoadMore: retryLoadMore, onCasesCloseSuccess: () => getCases(filterState), sentinelRef: sentinelRef }))))));
499
499
  }
@@ -16,6 +16,7 @@ interface IProps {
16
16
  loadMoreError: boolean;
17
17
  loadMoreRetryCount: number;
18
18
  onRetryLoadMore: () => void;
19
+ onCasesCloseSuccess?: () => void;
19
20
  sentinelRef?: (node?: Element | null) => void;
20
21
  }
21
22
  export declare function CaseListTable(props: IProps): React.JSX.Element;
@@ -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;AAsB3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAQxD,OAAO,KAAkD,MAAM,OAAO,CAAC;AAKvE,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAC;AAGpF,OAAO,EAAgB,SAAS,EAAyC,MAAM,0BAA0B,CAAC;AA4B1G,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,qBAAqB,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;CACjD;AAsBD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,qBA0oB1C"}
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;AAsB3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAaxD,OAAO,KAAkD,MAAM,OAAO,CAAC;AAKvE,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAC;AAEpF,OAAO,EAAgB,SAAS,EAAc,MAAM,0BAA0B,CAAC;AA4B/E,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,qBAAqB,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;CACjD;AAsBD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,qBA0oB1C"}
@@ -3,7 +3,7 @@ import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
3
3
  import { Table, TableVariant, Tbody, Td, Th, Thead, Tr, Visibility } from '@patternfly/react-table';
4
4
  import { TableComponent } from '@rh-support/components';
5
5
  import { GlobalMetadataDispatchContext, updateUserPreferences, useGlobalStateContext, UserPreferencesKeys, } from '@rh-support/react-context';
6
- import { dtmTrackEventCaseStepEncountered, formatDate, toNewCaseTypeSwitcher } from '@rh-support/utils';
6
+ import { dtmTrackEventCaseStepEncountered, formatDate, mapSfdcStatusToPortalStatus, toNewCaseTypeSwitcher, } from '@rh-support/utils';
7
7
  import find from 'lodash/find';
8
8
  import flatMap from 'lodash/flatMap';
9
9
  import includes from 'lodash/includes';
@@ -14,9 +14,8 @@ import React, { useContext, useEffect, useRef, useState } from 'react';
14
14
  import { Trans, useTranslation } from 'react-i18next';
15
15
  import { Link } from 'react-router-dom';
16
16
  import { CaseListColumnIds } from '../../../enums/case';
17
- import { mapSfdcStatusToPortalStatus } from '../../../utils/statusUtils';
18
17
  import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
19
- import { clearFilters, resetFilterToDefaultState, updateSort } from '../CaseListFilterReducer';
18
+ import { clearFilters, updateSort } from '../CaseListFilterReducer';
20
19
  import SeverityLabel from './SeverityLabel';
21
20
  import { TableColumnSelector } from './table-column-selector/TableColumnSelector';
22
21
  import { TableActionsDropdown } from './TableActionsDropdown';
@@ -207,7 +206,7 @@ export function CaseListTable(props) {
207
206
  React.createElement(EmptyState, { variant: EmptyStateVariant.sm },
208
207
  React.createElement(Spinner, { size: "xl" }))))));
209
208
  const onCasesCloseSuccess = () => {
210
- resetFilterToDefaultState(dispatch);
209
+ props.onCasesCloseSuccess && props.onCasesCloseSuccess();
211
210
  };
212
211
  const getItemCount = () => {
213
212
  var _a, _b;
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadCSVFileModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/DownloadCSVFileModal.tsx"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC;AAyBrC,OAAO,KAAuC,MAAM,OAAO,CAAC;AAM5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,oBAAoB,CAAC;IAClC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAWD,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBA8WzD"}
1
+ {"version":3,"file":"DownloadCSVFileModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/DownloadCSVFileModal.tsx"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC;AA+BrC,OAAO,KAAuC,MAAM,OAAO,CAAC;AAK5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,oBAAoB,CAAC;IAClC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAWD,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBA8WzD"}
@@ -13,13 +13,12 @@ import { Button, Checkbox, Form, FormGroup, Grid, GridItem, InputGroup, Modal, M
13
13
  import DownloadIcon from '@patternfly/react-icons/dist/js/icons/download-icon';
14
14
  import TimesCircleIcon from '@patternfly/react-icons/dist/js/icons/times-circle-icon';
15
15
  import { ToastNotification } from '@rh-support/components';
16
- import { downloadCSV, formatDateTime, toNewCaseTypeSwitcher } from '@rh-support/utils';
16
+ import { downloadCSV, formatDateTime, mapSfdcStatusToPortalStatus, toNewCaseTypeSwitcher, } from '@rh-support/utils';
17
17
  import { isEmpty } from 'lodash';
18
18
  import React, { useEffect, useMemo, useState } from 'react';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { SolrKeys } from '../../../enums/filters';
21
21
  import { getCaseListFromGraphQL } from '../../../utils/caseListGraphQLUtils';
22
- import { mapSfdcStatusToPortalStatus } from '../../../utils/statusUtils';
23
22
  const csvHeaders = [
24
23
  { label: 'Case number', key: SolrKeys.caseNumber },
25
24
  {
@@ -1,10 +1,15 @@
1
1
  import { SFDCKeys, SolrKeys } from './filters';
2
2
  export declare enum CaseStatus {
3
- WaitingOnCustomer = "Waiting on Customer",
4
- WaitingOnRedHat = "Waiting on Red Hat",
3
+ WaitingOnCustomerActionRequired = "Waiting on Customer Action Required",
4
+ WaitingOnCustomerSolutionDelivered = "Waiting on Customer Solution Delivered",
5
+ InProgress = "In Progress",
5
6
  Open = "All open cases",
6
7
  Closed = "Closed",
7
- All = "All cases"
8
+ All = "All cases",
9
+ /** @deprecated Legacy alias -- do not use for new writes */
10
+ WaitingOnCustomer = "Waiting on Customer",
11
+ /** @deprecated Legacy alias -- do not use for new writes */
12
+ WaitingOnRedHat = "Waiting on Red Hat"
8
13
  }
9
14
  export declare enum CaseSeverity {
10
15
  Urgent = "1 - Urgent",
@@ -1 +1 @@
1
- {"version":3,"file":"case.d.ts","sourceRoot":"","sources":["../../../src/enums/case.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE/C,oBAAY,UAAU;IAClB,iBAAiB,wBAAwB;IACzC,eAAe,uBAAuB;IACtC,IAAI,mBAAmB;IACvB,MAAM,WAAW;IACjB,GAAG,cAAc;CACpB;AAED,oBAAY,YAAY;IACpB,MAAM,eAAe;IACrB,SAAS,kBAAkB;IAC3B,MAAM,eAAe;IACrB,GAAG,YAAY;CAClB;AAED,eAAO,MAAM,cAAc,0UACgT,CAAC;AAE5U,oBAAY,iBAAiB;IACzB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,KAAK,gBAAgB;IACrB,OAAO,gBAAgB;IACvB,MAAM,WAAW;IACjB,QAAQ,qBAAqB;IAC7B,iBAAiB,YAAY;IAC7B,aAAa,kBAAkB;IAC/B,KAAK,eAAe;IACpB,eAAe,oBAAoB;IACnC,IAAI,SAAS;IACb,cAAc,eAAe;CAChC;AAED,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;CAa1C,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;CAa1C,CAAC;AAGF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAWpE,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;CAatC,CAAC"}
1
+ {"version":3,"file":"case.d.ts","sourceRoot":"","sources":["../../../src/enums/case.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE/C,oBAAY,UAAU;IAClB,+BAA+B,wCAAwC;IACvE,kCAAkC,2CAA2C;IAC7E,UAAU,gBAAgB;IAC1B,IAAI,mBAAmB;IACvB,MAAM,WAAW;IACjB,GAAG,cAAc;IACjB,4DAA4D;IAC5D,iBAAiB,wBAAwB;IACzC,4DAA4D;IAC5D,eAAe,uBAAuB;CACzC;AAED,oBAAY,YAAY;IACpB,MAAM,eAAe;IACrB,SAAS,kBAAkB;IAC3B,MAAM,eAAe;IACrB,GAAG,YAAY;CAClB;AAED,eAAO,MAAM,cAAc,0UACgT,CAAC;AAE5U,oBAAY,iBAAiB;IACzB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,KAAK,gBAAgB;IACrB,OAAO,gBAAgB;IACvB,MAAM,WAAW;IACjB,QAAQ,qBAAqB;IAC7B,iBAAiB,YAAY;IAC7B,aAAa,kBAAkB;IAC/B,KAAK,eAAe;IACpB,eAAe,oBAAoB;IACnC,IAAI,SAAS;IACb,cAAc,eAAe;CAChC;AAED,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;CAa1C,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;CAa1C,CAAC;AAGF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAWpE,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;CAatC,CAAC"}
@@ -1,11 +1,16 @@
1
1
  import { SFDCKeys, SolrKeys } from './filters';
2
2
  export var CaseStatus;
3
3
  (function (CaseStatus) {
4
- CaseStatus["WaitingOnCustomer"] = "Waiting on Customer";
5
- CaseStatus["WaitingOnRedHat"] = "Waiting on Red Hat";
4
+ CaseStatus["WaitingOnCustomerActionRequired"] = "Waiting on Customer Action Required";
5
+ CaseStatus["WaitingOnCustomerSolutionDelivered"] = "Waiting on Customer Solution Delivered";
6
+ CaseStatus["InProgress"] = "In Progress";
6
7
  CaseStatus["Open"] = "All open cases";
7
8
  CaseStatus["Closed"] = "Closed";
8
9
  CaseStatus["All"] = "All cases";
10
+ /** @deprecated Legacy alias -- do not use for new writes */
11
+ CaseStatus["WaitingOnCustomer"] = "Waiting on Customer";
12
+ /** @deprecated Legacy alias -- do not use for new writes */
13
+ CaseStatus["WaitingOnRedHat"] = "Waiting on Red Hat";
9
14
  })(CaseStatus || (CaseStatus = {}));
10
15
  export var CaseSeverity;
11
16
  (function (CaseSeverity) {
@@ -1 +1 @@
1
- {"version":3,"file":"useCloseCase.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCloseCase.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CACpC;AAQD,wBAAgB,YAAY,CAAC,KAAK,EAAE,kBAAkB;;;;;;;;;;;;;EAoGrD"}
1
+ {"version":3,"file":"useCloseCase.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCloseCase.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CACpC;AAQD,wBAAgB,YAAY,CAAC,KAAK,EAAE,kBAAkB;;;;;;;;;;;;;EAyHrD"}
@@ -7,10 +7,10 @@ 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 { publicApi } from '@cee-eng/hydrajs';
11
- import { ToastNotification, useFetch } from '@rh-support/components';
10
+ import { useApolloClient } from '@apollo/client/react';
11
+ import { ToastNotification } from '@rh-support/components';
12
12
  import { useCanCreateCase } from '@rh-support/react-context';
13
- import { dtmTrackEventCaseStepEncountered } from '@rh-support/utils';
13
+ import { CREATE_CASE_COMMENT, dtmTrackEventCaseStepEncountered, sanitizeForSalesforce, updateCaseDetailsByGraphQL, } from '@rh-support/utils';
14
14
  import filter from 'lodash/filter';
15
15
  import find from 'lodash/find';
16
16
  import includes from 'lodash/includes';
@@ -21,8 +21,9 @@ const reflect = (p) => p.then((v) => ({ v, status: 'fulfilled' }), (e) => ({ e,
21
21
  export function useCloseCase(props) {
22
22
  const { caseList, selectedCases, onCasesCloseSuccess } = props;
23
23
  const { t } = useTranslation();
24
+ const apolloClient = useApolloClient();
24
25
  const maxCasesSelected = (selectedCases || []).length > MAX_ALLOWED_CASES;
25
- const { request, isFetching } = useFetch(publicApi.kase.updateCase);
26
+ const [isFetching, setIsFetching] = useState(false);
26
27
  const closedCaseIds = filter(selectedCases, (selected) => {
27
28
  const caseDetails = find(caseList, (caseObj) => caseObj['case_number'] === selected);
28
29
  return caseDetails && caseDetails['case_status'] !== 'Closed' ? false : true;
@@ -38,10 +39,7 @@ export function useCloseCase(props) {
38
39
  isFetching;
39
40
  const [isModalOpen, setIsModalOpen] = useState(false);
40
41
  const canCreateCase = useCanCreateCase();
41
- const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
42
- propgateErrors: true,
43
- });
44
- // To handle button click
42
+ const [isPostingComment, setIsPostingComment] = useState(false);
45
43
  const onBtnClick = () => {
46
44
  if (canCreateCase.alert()) {
47
45
  return;
@@ -53,29 +51,48 @@ export function useCloseCase(props) {
53
51
  const onConfirm = (commentBody) => __awaiter(this, void 0, void 0, function* () {
54
52
  const promiseArr = [];
55
53
  setIsModalOpen(false);
54
+ setIsFetching(true);
56
55
  const toastId = ToastNotification.addSuccessMessage(t(`Closing selected cases`));
57
- filter(selectedCases, (selected) => !includes(closedCaseIds, selected)).forEach((caseNumber, i) => {
58
- const product = caseList[i].case_product[0];
59
- const version = caseList[i].case_version;
60
- const p = request(caseNumber, { status: 'Closed' });
56
+ const casesToClose = filter(selectedCases, (selected) => !includes(closedCaseIds, selected));
57
+ casesToClose.forEach((caseNumber) => {
58
+ const caseDetails = find(caseList, (caseObj) => caseObj.case_number === caseNumber);
59
+ if (!caseDetails)
60
+ return;
61
+ const salesforceCaseId = caseDetails.id;
62
+ const product = caseDetails.case_product[0];
63
+ const version = caseDetails.case_version;
64
+ const p = updateCaseDetailsByGraphQL(apolloClient, salesforceCaseId, { Status: 'Closed' });
61
65
  promiseArr.push(p);
62
- p.then((res) => __awaiter(this, void 0, void 0, function* () {
63
- yield postCommentRequest({
64
- caseNumber,
65
- commentBody,
66
- contentType: `markdown`,
67
- doNotChangeStatus: true,
68
- });
66
+ p.then(() => __awaiter(this, void 0, void 0, function* () {
67
+ if (commentBody) {
68
+ setIsPostingComment(true);
69
+ try {
70
+ yield apolloClient.mutate({
71
+ mutation: CREATE_CASE_COMMENT,
72
+ variables: {
73
+ commentInput: {
74
+ Case__c: salesforceCaseId,
75
+ Body__c: sanitizeForSalesforce(commentBody),
76
+ Visibility__c: 'Public',
77
+ IsAssociate__c: false,
78
+ },
79
+ },
80
+ });
81
+ }
82
+ finally {
83
+ setIsPostingComment(false);
84
+ }
85
+ }
69
86
  ToastNotification.clearToast(toastId);
70
87
  ToastNotification.addSuccessMessage(t('Case {{caseNumber}} successfully closed', { caseNumber }));
71
- // Only call dtm track event only when the case has been closed successfully.
72
88
  dtmTrackEventCaseStepEncountered('close', caseNumber, product, version);
73
- }), (err) => {
89
+ }), () => {
74
90
  ToastNotification.clearToast(toastId);
75
91
  ToastNotification.addDangerMessage(t('Could not close case {{caseNumber}}', { caseNumber }));
76
92
  });
77
93
  });
78
94
  yield Promise.all(promiseArr.map(reflect));
95
+ setIsFetching(false);
79
96
  onCasesCloseSuccess && onCasesCloseSuccess();
80
97
  });
81
98
  const onCancel = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"caseListVariablesBuilder.d.ts","sourceRoot":"","sources":["../../../src/utils/caseListVariablesBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAanD,OAAO,EAEH,oBAAoB,EAEvB,MAAM,+CAA+C,CAAC;AAOvD,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAM1F;AAED,MAAM,WAAW,yBAAyB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC7B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAqaD,wBAAsB,qCAAqC,CACvD,WAAW,EAAE,oBAAoB,EACjC,YAAY,EAAE,YAAY,EAC1B,eAAe,CAAC,EAAE,gBAAgB,GACnC,OAAO,CAAC,yBAAyB,CAAC,CAuIpC"}
1
+ {"version":3,"file":"caseListVariablesBuilder.d.ts","sourceRoot":"","sources":["../../../src/utils/caseListVariablesBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAcnD,OAAO,EAEH,oBAAoB,EAEvB,MAAM,+CAA+C,CAAC;AAMvD,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAM1F;AAED,MAAM,WAAW,yBAAyB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC7B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAqaD,wBAAsB,qCAAqC,CACvD,WAAW,EAAE,oBAAoB,EACjC,YAAY,EAAE,YAAY,EAC1B,eAAe,CAAC,EAAE,gBAAgB,GACnC,OAAO,CAAC,yBAAyB,CAAC,CAuIpC"}
@@ -7,12 +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 { buildAccessRestrictionExclusionFilter, GET_CASE_GROUPS, GET_CASE_NUMBERS_BY_CASE_LABEL, GET_CONTACT_BY_SSO, GET_GROUP_IDS_BY_NAME, GET_USER_IDS_BY_FEDERATION, getTechnicalSupportRecordTypeId, } from '@rh-support/utils';
10
+ import { buildAccessRestrictionExclusionFilter, expandStatusGroupsToApiValues, GET_CASE_GROUPS, GET_CASE_NUMBERS_BY_CASE_LABEL, GET_CONTACT_BY_SSO, GET_GROUP_IDS_BY_NAME, GET_USER_IDS_BY_FEDERATION, getTechnicalSupportRecordTypeId, } from '@rh-support/utils';
11
11
  import { CaseListColumnIds, caseListSortColumnIdsToGraphQLMap } from '../enums/case';
12
12
  import { CaseSearchQueryType } from '../enums/caseSearch';
13
13
  import { SolrKeys, SolrPivotKeys } from '../enums/filters';
14
14
  import { parseAdvanceSearchDate } from './advanceSearchUtils';
15
- import { expandStatusGroupsToApiValues } from './statusUtils';
16
15
  export function getOwnerFederationIdsToResolve(filterState) {
17
16
  const { filterInfo } = filterState;
18
17
  if (!filterInfo)
@@ -1,7 +1,4 @@
1
- export declare const PORTAL_STATUS_GROUPS: Record<string, string[]>;
2
- export declare const PORTAL_DISPLAY_STATUSES: string[];
3
- /** Statuses treated as open (excludes Closed and Archived). */
4
- export declare const PORTAL_OPEN_DISPLAY_STATUSES: string[];
1
+ export { PORTAL_STATUS_GROUPS, PORTAL_DISPLAY_STATUSES, PORTAL_USER_SELECTABLE_STATUSES, PORTAL_OPEN_DISPLAY_STATUSES, } from '@rh-support/utils';
5
2
  export declare const filterNamesMap: {
6
3
  readonly case_status: any;
7
4
  readonly case_severity: any;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAoBzD,CAAC;AAEF,eAAO,MAAM,uBAAuB,UAAoC,CAAC;AAEzE,+DAA+D;AAC/D,eAAO,MAAM,4BAA4B,UAExC,CAAC;AAIF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;CAgE1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,iDAAiD,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,oBAAoB,EACpB,uBAAuB,EACvB,+BAA+B,EAC/B,4BAA4B,GAC/B,MAAM,mBAAmB,CAAC;AAI3B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;CAgE1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,iDAAiD,CAAC"}
@@ -1,29 +1,6 @@
1
1
  import i18n from 'i18next';
2
2
  import { SolrKeys } from '../enums/filters';
3
- export const PORTAL_STATUS_GROUPS = {
4
- 'In Progress': [
5
- 'In Progress',
6
- 'New',
7
- 'Waiting on Collab',
8
- 'Waiting on Engineering',
9
- 'Waiting on Sales',
10
- 'Waiting on 3rd Party Vendor',
11
- 'Needs New Owner',
12
- // Legacy Solr value retained for case-list filter expansion
13
- 'Waiting on Red Hat',
14
- ],
15
- 'Waiting on Customer Action Required': [
16
- 'Waiting on Customer Action Required',
17
- // Legacy Solr value
18
- 'Waiting on Customer',
19
- ],
20
- 'Waiting on Customer Solution Delivered': ['Waiting on Customer Solution Delivered'],
21
- Closed: ['Closed'],
22
- Archived: ['Archived'],
23
- };
24
- export const PORTAL_DISPLAY_STATUSES = Object.keys(PORTAL_STATUS_GROUPS);
25
- /** Statuses treated as open (excludes Closed and Archived). */
26
- export const PORTAL_OPEN_DISPLAY_STATUSES = PORTAL_DISPLAY_STATUSES.filter((status) => status !== 'Closed' && status !== 'Archived');
3
+ export { PORTAL_STATUS_GROUPS, PORTAL_DISPLAY_STATUSES, PORTAL_USER_SELECTABLE_STATUSES, PORTAL_OPEN_DISPLAY_STATUSES, } from '@rh-support/utils';
27
4
  // used for adding title text for different solr fields
28
5
  // test
29
6
  export const filterNamesMap = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/cases",
3
- "version": "2.6.212",
3
+ "version": "2.6.214",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -38,11 +38,11 @@
38
38
  "@patternfly/patternfly": "6.2.1",
39
39
  "@patternfly/react-core": "6.2.1",
40
40
  "@patternfly/react-table": "6.2.1",
41
- "@rh-support/components": "2.5.207",
42
- "@rh-support/react-context": "2.5.302",
41
+ "@rh-support/components": "2.5.209",
42
+ "@rh-support/react-context": "2.5.304",
43
43
  "@rh-support/types": "2.0.26",
44
- "@rh-support/user-permissions": "2.5.154",
45
- "@rh-support/utils": "2.5.135",
44
+ "@rh-support/user-permissions": "2.5.156",
45
+ "@rh-support/utils": "2.5.137",
46
46
  "localforage": "^1.10.0",
47
47
  "lodash": "^4.17.21",
48
48
  "pegjs": "^0.10.0",
@@ -94,5 +94,5 @@
94
94
  "defaults and supports es6-module",
95
95
  "maintained node versions"
96
96
  ],
97
- "gitHead": "0ee7395e3f501d247910c0ac5f91a4f2e3195e07"
97
+ "gitHead": "56082a7ae9e90099d5504236da82ee1d2688048c"
98
98
  }
@@ -1,4 +0,0 @@
1
- export declare function expandStatusGroupsToApiValues(selectedStatuses: string[]): string[];
2
- export declare function mapSfdcStatusToPortalStatus(sfdcStatus: string): string;
3
- export declare function resolvePortalStatusToApiValue(portalStatus: string, currentApiStatus?: string | null): string;
4
- //# sourceMappingURL=statusUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"statusUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/statusUtils.ts"],"names":[],"mappings":"AAEA,wBAAgB,6BAA6B,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAWlF;AAED,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAOtE;AAED,wBAAgB,6BAA6B,CAAC,YAAY,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAgB5G"}
@@ -1,36 +0,0 @@
1
- import { PORTAL_STATUS_GROUPS } from './constants';
2
- export function expandStatusGroupsToApiValues(selectedStatuses) {
3
- const expanded = [];
4
- selectedStatuses.forEach((status) => {
5
- const group = PORTAL_STATUS_GROUPS[status];
6
- if (group) {
7
- expanded.push(...group);
8
- }
9
- else {
10
- expanded.push(status);
11
- }
12
- });
13
- return expanded;
14
- }
15
- export function mapSfdcStatusToPortalStatus(sfdcStatus) {
16
- for (const [portalStatus, sfdcStatuses] of Object.entries(PORTAL_STATUS_GROUPS)) {
17
- if (sfdcStatuses.includes(sfdcStatus)) {
18
- return portalStatus;
19
- }
20
- }
21
- return sfdcStatus;
22
- }
23
- export function resolvePortalStatusToApiValue(portalStatus, currentApiStatus) {
24
- const group = PORTAL_STATUS_GROUPS[portalStatus];
25
- if (!group) {
26
- return portalStatus;
27
- }
28
- const currentPortalStatus = currentApiStatus ? mapSfdcStatusToPortalStatus(currentApiStatus) : null;
29
- if (currentPortalStatus === portalStatus && currentApiStatus && group.includes(currentApiStatus)) {
30
- return currentApiStatus;
31
- }
32
- if (portalStatus === 'In Progress') {
33
- return 'In Progress';
34
- }
35
- return group[0];
36
- }