Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDE-62 Connect filter dialog and functionalities #30

Merged
merged 10 commits into from
Mar 19, 2024
Merged

Conversation

Aiga115
Copy link
Contributor

@Aiga115 Aiga115 commented Mar 11, 2024

Issue #CDE-62
Problem: Connect filter dialog and functionalities
Solution:
Add feature to filter data according to selected checkbox values

Recording.2024-03-11.123148.mp4

@afonsobspinto afonsobspinto changed the base branch from develop to feature/CDE-38 March 11, 2024 16:33
@afonsobspinto
Copy link
Member

afonsobspinto commented Mar 11, 2024

I instructed @Aiga115 to start from my branch because I had fixed a couple of problems there that she reported to me in private while was trying to resolve this issue.

With this context, I changed the target branch from develop to feature/CDE-38 as it facilitates the review of @Aiga115's work for CDE-62

Copy link
Member

@afonsobspinto afonsobspinto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but the reset filter is not connected:

image

I also think that given the filters structure we should always have at least one filter selected. Let me explain why I think that with a question:

If the filters state is the following what should we show? cc @syamace-metacell @ddelpiano
image

@@ -91,6 +91,12 @@ interface MappingProps {
defaultCollection: string;
}

interface CheckedState {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Unless there's a reason to, we should keep just one of the CheckedState interfaces. I see that it is defined both in the Mapping Tab and in the Mapping Search components

const isAnyTrue = Object.values(checked).some(value => value === true);

if (isAnyTrue) {
return checked[entityType];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note (non-blocking): This assumes that all filters will be on the row type. Ideally I would prefer a more generic approach but I won't mark it as a blocker since the code correctly addresses the current scope.

@Aiga115 Aiga115 changed the base branch from feature/CDE-38 to develop March 14, 2024 11:02
}

export default function MappingSearch({onChange}: MappingSearchProps) {

const [searchString, setSearchString] = useState('');
const [checked, setChecked] = React.useState({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking): Rename 'checked' to something more informative like for example filtersState

lib/models.ts Outdated
@@ -79,6 +79,12 @@ export interface SelectableCollection {
selected: boolean;
}

export interface CheckedState {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion (non-blocking): Rename CheckedState to FiltersState

@ddelpiano ddelpiano merged commit e3544d8 into develop Mar 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants