Skip to content

Commit

Permalink
fix: CLIN-2916 fix saving custom filter after adding saved custom pil…
Browse files Browse the repository at this point in the history
…l to it
  • Loading branch information
meek0 committed Aug 7, 2024
1 parent ac3b78e commit d00bd7e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/ui/Release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 10.4.7-rc1 2024-08-07
- fix: CLIN-2916 saving custom filter after adding saved custom pill to it

### 10.4.6 2024-08-07
- feat: CQDG-830 add pattern restriction for name of Sets and Filters

Expand Down Expand Up @@ -36,7 +39,7 @@
- fix: SKFP-1172 Improve performance for big datasets

### 10.0.0 2024-07-03
- feat: FLUI-132 remove sass, migrate to vanilla css and custom properties
- feat: FLUI-132 remove sass, migrate to vanilla css and custom properties

### 9.21.4 2024-07-04
- fix: SKFP-1134 Adjust chart bar width for smaller dataset
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ferlab/ui",
"version": "10.4.6",
"version": "10.4.7-rc1",
"description": "Core components for scientific research data portals",
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
import { isEmpty } from 'lodash';
import { get, isEmpty } from 'lodash';
import { v4 } from 'uuid';

import { BooleanOperators, RangeOperators, TermOperators } from '../../../data/sqon/operators';
Expand All @@ -17,6 +17,7 @@ import {
getDefaultSyntheticSqon,
getUpdatedActiveQuery,
getUpdatedActiveQueryByFilterGroup,
isBooleanOperator,
removeFieldFromActiveQuery,
} from '../../../data/sqon/utils';
import { IFilter, IFilterGroup } from '../../filters/types';
Expand Down Expand Up @@ -215,7 +216,11 @@ export const removePillFromQueryBuilder = (pillId: string, queryBuilderId: strin

export const addPillToQueryBuilder = (pill: IValueQuery, queryBuilderId: string): void => {
const activeQuery = getActiveQuery(queryBuilderId);
updateQuery({ query: { ...activeQuery, content: [...activeQuery.content, pill] }, queryBuilderId });
let newPill = pill;
if (isBooleanOperator(pill) && pill.content.length === 1) {
newPill = { ...pill, content: get(pill.content[0], 'content', []) };
}
updateQuery({ query: { ...activeQuery, content: [...activeQuery.content, newPill] }, queryBuilderId });
};

/**
Expand Down

0 comments on commit d00bd7e

Please sign in to comment.