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

Change the filter params #7051

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Change the filter params #7051

wants to merge 2 commits into from

Conversation

aeSouid
Copy link
Contributor

@aeSouid aeSouid commented Jan 29, 2025

CHnage the parsing of the query parms from url to the new format

Copy link
Contributor

@elevatebart elevatebart left a comment

Choose a reason for hiding this comment

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

Very nice PR
Thank you @aeSouid

I know we have not always been thorough enough about testing the Front-End.
But this feature is very abstract and all the edge case that could slip into encoding/decoding values should be tested.

Let's chat it you want to learns the antics of FE testing tomorrow.

@@ -42,7 +44,10 @@ export const encodeParams = (filters, OPTIONS) => {
}, {});
};

export const decodeParams = (query, include, OPTIONS) => {
export const decodeParams = (path, query, include, OPTIONS) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would love these two functions to be unit tested using vitest.
Create a spec file named tests/unit/filter/utils/helpers.spec.ts and add the test casses like what has been done in flowUtils and yamlUtils.

Copy link
Member

Choose a reason for hiding this comment

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

Alaa asked me about tests, I've told him to skip them for now as they were not existing already, but you do make a good point here. As we're not rushing with this for the 0.21.0 release (if I'm not mistaken) we can do the test coverage, also.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@elevatebart @MilosPaunovic thanks for the review, i will add the tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i pushed the helpers.spec.ts for testing, and i will add other case tests

Copy link
Member

@MilosPaunovic MilosPaunovic left a comment

Choose a reason for hiding this comment

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

We've now lost the ability to chose more than one value, example is Flows -> Scope. If the comparator is not multiple, but there are two comparators for the particular filter type, we should allow the selection of both of them, if I'm not mistaken.

So, on the case of Flows -> Scope, we should allow users to select one value for compartor IS and one for the IS NOT.

ui/src/components/filter/components/Label.vue Show resolved Hide resolved
IN: buildComparator(t(comparator("in"))),
BETWEEN: buildComparator(t(comparator("between"))),
STARTS_WITH: buildComparator(t(comparator("starts_with"))),
EQUALS: buildComparator(t(comparator("is")), "$eq"),
Copy link
Member

Choose a reason for hiding this comment

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

Potentially, might be a good idea to uniform the expressions - to not show label IS for EQUALS, but the EQUALS itself.

Although, this is more of a question for a product team, so pinging @Ben8t here for an opinion.

Copy link
Member

Choose a reason for hiding this comment

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

Not sure to understand: does it shows "IS" here? Can you give me a bit more context please?

Copy link
Member

Choose a reason for hiding this comment

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

It's the comparator chooser of filters:

image

For example, what is right now IS is going to be sent to backend as EQUALS when this is merged. Do we want to align the wording on that, so it's not labeled as IS anymore, but as EQUALS?

return params;
};

export const isSearchPath = (path: string) =>["/flows", "/executions", "/logs", "/dashboard"].includes(path);
Copy link
Member

Choose a reason for hiding this comment

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

Be aware here, as we might have search in some of the nested pages somewhere (not completely sure, needs checking), so it might be a better idea here to check the full route name in compassion.

Copy link
Member

Choose a reason for hiding this comment

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

Also, do we need this method exported, as I believe it's used only in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i will see how we can apply the filter encoding only when we call the search endpoint

Copy link
Contributor

@elevatebart elevatebart left a comment

Choose a reason for hiding this comment

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

Good with me

Copy link
Member

@MilosPaunovic MilosPaunovic left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@MilosPaunovic
Copy link
Member

As far as I'm concerned, this is ready to be merged, just sync it with the merge of PRs for the BE changes to have it all available at the same time, and make sure to NOT backport to previous release branches, as we're not including this in 0.21.x.

Good job here @aeSouid! 🚀

@aeSouid aeSouid force-pushed the feat/query-filter-client branch from 529666b to dd0e19e Compare February 4, 2025 10:25
Change the filters to the new search format

Feat Filter:
Add helpers unit test for encode and decode search params

chore(translations): auto generate values for languages other than english

Feat Filter:
handle start & end date params

feat(ui): display attempts status on taskrun on left

close #7030

Feat Filter:
Synchronise with develop

chore(translations): auto generate values for languages other than english

Feat Filter:
fix rendreding lables in bar filter

chore(translations): auto generate values for languages other than english

chore(translations): auto generate values for languages other than english

Add triggers page to the new search

chore(translations): auto generate values for languages other than english
@aeSouid aeSouid force-pushed the feat/query-filter-client branch from 395f305 to bf65aad Compare February 4, 2025 11:11
Copy link

sonarqubecloud bot commented Feb 4, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To review
Development

Successfully merging this pull request may close these issues.

5 participants