@rh-support/cases 2.6.194 → 2.6.196

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.
@@ -4,7 +4,7 @@ import isEmpty from 'lodash/isEmpty';
4
4
  import React, { useContext, useEffect, useState } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { SolrKeys } from '../../../enums/filters';
7
- import { filterNamesMap, PORTAL_DISPLAY_STATUSES } from '../../../utils/constants';
7
+ import { filterNamesMap, PORTAL_DISPLAY_STATUSES, PORTAL_OPEN_DISPLAY_STATUSES } from '../../../utils/constants';
8
8
  import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
9
9
  import { updateFilter } from '../CaseListFilterReducer';
10
10
  export function StatusFilter(props) {
@@ -59,9 +59,9 @@ export function StatusFilter(props) {
59
59
  return t('All cases');
60
60
  }
61
61
  else {
62
- const hasAllOpenSelected = selectedValues.includes('In Progress') &&
63
- selectedValues.includes('Waiting on Customer') &&
64
- !selectedValues.includes('Closed');
62
+ const hasAllOpenSelected = PORTAL_OPEN_DISPLAY_STATUSES.every((status) => selectedValues.includes(status)) &&
63
+ !selectedValues.includes('Closed') &&
64
+ !selectedValues.includes('Archived');
65
65
  if (hasAllOpenSelected) {
66
66
  return t('All open cases');
67
67
  }
@@ -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;AAQnD,OAAO,EAEH,oBAAoB,EAEvB,MAAM,+CAA+C,CAAC;AAMvD,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAW1F;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;AA0SD,wBAAsB,qCAAqC,CACvD,WAAW,EAAE,oBAAoB,EACjC,YAAY,EAAE,YAAY,EAC1B,eAAe,CAAC,EAAE,gBAAgB,GACnC,OAAO,CAAC,yBAAyB,CAAC,CA4HpC"}
1
+ {"version":3,"file":"caseListVariablesBuilder.d.ts","sourceRoot":"","sources":["../../../src/utils/caseListVariablesBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AASnD,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;AA0SD,wBAAsB,qCAAqC,CACvD,WAAW,EAAE,oBAAoB,EACjC,YAAY,EAAE,YAAY,EAC1B,eAAe,CAAC,EAAE,gBAAgB,GACnC,OAAO,CAAC,yBAAyB,CAAC,CA8HpC"}
@@ -7,8 +7,9 @@ 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 { GET_CONTACT_BY_SSO, GET_GROUP_IDS_BY_NAME, GET_USER_IDS_BY_FEDERATION, getTechnicalSupportRecordTypeId, } from '@rh-support/utils';
10
+ import { buildAccessRestrictionExclusionFilter, 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
+ import { CaseSearchQueryType } from '../enums/caseSearch';
12
13
  import { SolrKeys, SolrPivotKeys } from '../enums/filters';
13
14
  import { parseAdvanceSearchDate } from './advanceSearchUtils';
14
15
  import { expandStatusGroupsToApiValues } from './statusUtils';
@@ -17,10 +18,7 @@ export function getOwnerFederationIdsToResolve(filterState) {
17
18
  if (!filterInfo)
18
19
  return [];
19
20
  const ownerSso = filterInfo[SolrKeys.caseOwner];
20
- const contactSso = filterInfo[SolrKeys.caseContactSSO];
21
- const contactSsoSet = new Set(contactSso || []);
22
- const filteredOwnerSso = (ownerSso || []).filter((sso) => !contactSsoSet.has(sso));
23
- return [...new Set(filteredOwnerSso)];
21
+ return [...new Set((ownerSso || []).filter(Boolean))];
24
22
  }
25
23
  function buildOrderByFromSortInfo(sortInfo) {
26
24
  var _a;
@@ -294,6 +292,7 @@ export function createGraphQLVariablesFromFilterState(filterState, apolloClient,
294
292
  const first = (paginationInfo === null || paginationInfo === void 0 ? void 0 : paginationInfo.pageSize) || 10;
295
293
  const orderBy = buildOrderByFromSortInfo(sortInfo);
296
294
  const andConditions = [];
295
+ andConditions.push(buildAccessRestrictionExclusionFilter());
297
296
  if (filterInfo) {
298
297
  const statusFilter = buildStatusFilter(filterInfo[SolrKeys.status]);
299
298
  if (statusFilter)
@@ -336,16 +335,18 @@ export function createGraphQLVariablesFromFilterState(filterState, apolloClient,
336
335
  const ownerUserIds = (resolvedUserIds === null || resolvedUserIds === void 0 ? void 0 : resolvedUserIds.ownerUserIds) ||
337
336
  (assignedToValues.length ? yield resolveOwnerIdsBySearchTerms(assignedToValues, apolloClient) : []);
338
337
  const contactIdFilter = buildIdFilter('ContactId', contactIds, Boolean(contactValues === null || contactValues === void 0 ? void 0 : contactValues.length));
339
- if (contactIdFilter) {
340
- andConditions.push(contactIdFilter);
341
- }
342
338
  const ownerIdFilter = buildIdFilter('OwnerId', ownerUserIds, assignedToValues.length > 0);
343
- if (ownerIdFilter) {
344
- andConditions.push(ownerIdFilter);
345
- }
346
339
  const createdByFilter = buildRedHatSupportUserReferenceFilter('CreatedBy', createdByValues);
347
- if (createdByFilter) {
348
- andConditions.push(createdByFilter);
340
+ const isAdvancedSearch = (filterQueryInfo === null || filterQueryInfo === void 0 ? void 0 : filterQueryInfo.type) === CaseSearchQueryType.ADVANCED;
341
+ const usernameFilters = [contactIdFilter, ownerIdFilter, createdByFilter].filter(Boolean);
342
+ if (isAdvancedSearch) {
343
+ usernameFilters.forEach((filter) => andConditions.push(filter));
344
+ }
345
+ else if (usernameFilters.length === 1) {
346
+ andConditions.push(usernameFilters[0]);
347
+ }
348
+ else if (usernameFilters.length > 1) {
349
+ andConditions.push({ or: usernameFilters });
349
350
  }
350
351
  const lastModifiedByFilter = buildRedHatSupportUserReferenceFilter('LastModifiedBy', modifiedByValues);
351
352
  if (lastModifiedByFilter) {
@@ -1,5 +1,7 @@
1
1
  export declare const PORTAL_STATUS_GROUPS: Record<string, string[]>;
2
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[];
3
5
  export declare const filterNamesMap: {
4
6
  readonly case_status: any;
5
7
  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,CAazD,CAAC;AAEF,eAAO,MAAM,uBAAuB,UAAoC,CAAC;AAIzE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;CA6D1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,iDAAiD,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;CA6D1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,iDAAiD,CAAC"}
@@ -2,19 +2,28 @@ import i18n from 'i18next';
2
2
  import { SolrKeys } from '../enums/filters';
3
3
  export const PORTAL_STATUS_GROUPS = {
4
4
  'In Progress': [
5
- 'New',
6
5
  'In Progress',
7
- 'Needs New Owner',
6
+ 'New',
8
7
  'Waiting on Collab',
9
8
  'Waiting on Engineering',
10
9
  'Waiting on Sales',
11
10
  'Waiting on 3rd Party Vendor',
11
+ 'Needs New Owner',
12
+ // Legacy Solr value retained for case-list filter expansion
12
13
  'Waiting on Red Hat',
13
14
  ],
14
- 'Waiting on Customer': ['Waiting on Customer Action Required', 'Waiting on Customer Solution Delivered'],
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'],
15
21
  Closed: ['Closed'],
22
+ Archived: ['Archived'],
16
23
  };
17
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');
18
27
  // used for adding title text for different solr fields
19
28
  // test
20
29
  export const filterNamesMap = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/cases",
3
- "version": "2.6.194",
3
+ "version": "2.6.196",
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.190",
42
- "@rh-support/react-context": "2.5.284",
41
+ "@rh-support/components": "2.5.192",
42
+ "@rh-support/react-context": "2.5.286",
43
43
  "@rh-support/types": "2.0.26",
44
- "@rh-support/user-permissions": "2.5.136",
45
- "@rh-support/utils": "2.5.118",
44
+ "@rh-support/user-permissions": "2.5.138",
45
+ "@rh-support/utils": "2.5.120",
46
46
  "localforage": "^1.10.0",
47
47
  "lodash": "^4.17.21",
48
48
  "pegjs": "^0.10.0",
@@ -92,5 +92,5 @@
92
92
  "defaults and supports es6-module",
93
93
  "maintained node versions"
94
94
  ],
95
- "gitHead": "9017d17207b6357a27edbab889de8f10696e745b"
95
+ "gitHead": "84a00c5092469be74f67cb35e582d3120d0949b6"
96
96
  }