Skip to content

Frontend crashes with special character '#' filter text box#5203

Merged
koku-ui-bot merged 2 commits into
project-koku:mainfrom
dlabrecq:COST-7507
May 23, 2026
Merged

Frontend crashes with special character '#' filter text box#5203
koku-ui-bot merged 2 commits into
project-koku:mainfrom
dlabrecq:COST-7507

Conversation

@dlabrecq
Copy link
Copy Markdown
Contributor

Frontend crashes with special character '#' filter text box
https://redhat.atlassian.net/browse/COST-7507

@dlabrecq dlabrecq requested review from a team as code owners May 23, 2026 23:09
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates several API query utilities and a component to enable URL encoding by setting "encode: true" in "qs.stringify" calls. The reviewer feedback indicates that explicitly setting "encode: true" is redundant as it is the default behavior of the library. It is recommended to remove this property for cleaner code and to consider centralizing the stringify configuration options into a shared constant to improve maintainability and ensure consistency across the application.


export function getProvidersQuery(query: ProvidersQuery) {
return stringify(query, { encode: false, indices: false });
return stringify(query, { encode: true, indices: false });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Explicitly setting encode: true is redundant as it is the default behavior for qs.stringify. Removing it makes the code cleaner and more idiomatic.

Suggested change
return stringify(query, { encode: true, indices: false });
return stringify(query, { indices: false });

// filter_by props are converted
export function getQuery(query: Query) {
return stringify(convertFilterBy(query), { encode: false, indices: false, sort: alphabeticalSort });
return stringify(convertFilterBy(query), { encode: true, indices: false, sort: alphabeticalSort });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Explicitly setting encode: true is redundant as it is the default behavior for qs.stringify. More importantly, the repetition of these configuration options (encode, indices, sort) across multiple functions and files is a maintainability risk. Consider centralizing the qs configuration into a shared constant to ensure consistent behavior (e.g., always applying the same sorting and encoding rules) and to simplify future updates.

Suggested change
return stringify(convertFilterBy(query), { encode: true, indices: false, sort: alphabeticalSort });
return stringify(convertFilterBy(query), { indices: false, sort: alphabeticalSort });

// filter_by props are not converted
export function getQueryRoute(query: Query) {
return stringify(query, { encode: false, indices: false, sort: alphabeticalSort });
return stringify(query, { encode: true, indices: false, sort: alphabeticalSort });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Explicitly setting encode: true is redundant as it is the default behavior for qs.stringify.

Suggested change
return stringify(query, { encode: true, indices: false, sort: alphabeticalSort });
return stringify(query, { indices: false, sort: alphabeticalSort });


export function getUserAccessQuery(query: UserAccessQuery) {
return stringify(query, { encode: false, indices: false });
return stringify(query, { encode: true, indices: false });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Explicitly setting encode: true is redundant as it is the default behavior for qs.stringify.

Suggested change
return stringify(query, { encode: true, indices: false });
return stringify(query, { indices: false });

};
return {
search: stringify(searchQuery, { encode: false, indices: false }),
search: stringify(searchQuery, { encode: true, indices: false }),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Explicitly setting encode: true is redundant as it is the default behavior for qs.stringify.

Suggested change
search: stringify(searchQuery, { encode: true, indices: false }),
search: stringify(searchQuery, { indices: false }),


export function getProvidersQuery(query: ProvidersQuery) {
return stringify(query, { encode: false, indices: false });
return stringify(query, { encode: true, indices: false });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Explicitly setting encode: true is redundant as it is the default behavior for qs.stringify.

Suggested change
return stringify(query, { encode: true, indices: false });
return stringify(query, { indices: false });

// filter_by props are converted
export function getQuery(query: Query) {
return stringify(convertFilterBy(query), { encode: false, indices: false, sort: alphabeticalSort });
return stringify(convertFilterBy(query), { encode: true, indices: false, sort: alphabeticalSort });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Explicitly setting encode: true is redundant as it is the default behavior for qs.stringify. Consider centralizing these options to improve maintainability and consistency across the application.

Suggested change
return stringify(convertFilterBy(query), { encode: true, indices: false, sort: alphabeticalSort });
return stringify(convertFilterBy(query), { indices: false, sort: alphabeticalSort });

// filter_by props are not converted
export function getQueryRoute(query: Query) {
return stringify(query, { encode: false, indices: false, sort: alphabeticalSort });
return stringify(query, { encode: true, indices: false, sort: alphabeticalSort });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Explicitly setting encode: true is redundant as it is the default behavior for qs.stringify.

Suggested change
return stringify(query, { encode: true, indices: false, sort: alphabeticalSort });
return stringify(query, { indices: false, sort: alphabeticalSort });


export function getUserAccessQuery(query: UserAccessQuery) {
return stringify(query, { encode: false, indices: false });
return stringify(query, { encode: true, indices: false });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Explicitly setting encode: true is redundant as it is the default behavior for qs.stringify.

Suggested change
return stringify(query, { encode: true, indices: false });
return stringify(query, { indices: false });

@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.93%. Comparing base (88d37d5) to head (23aa8db).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5203   +/-   ##
=======================================
  Coverage   78.93%   78.93%           
=======================================
  Files         742      742           
  Lines       16830    16830           
  Branches     4050     4046    -4     
=======================================
  Hits        13284    13284           
- Misses       3351     3354    +3     
+ Partials      195      192    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@koku-ui-bot koku-ui-bot merged commit 4222cc6 into project-koku:main May 23, 2026
8 checks 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.

2 participants