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

ROU-4691: Column Filter does not reflect the correct value when using FilterByCondition API #392

Merged
merged 4 commits into from
Jan 18, 2024

Conversation

OS-giulianasilva
Copy link
Contributor

@OS-giulianasilva OS-giulianasilva commented Jan 17, 2024

This PR is to fix the filter popup not displaying the correct value when using FilterByCondition API in a Currency Column. It also corrects the issue of the filter not being applied to the correct column when the Grid has columns with the same binding.

What was happening

  • When using the FilterByCondition API to set a filter on a Currency column, the value passed to the _getFilterConditionValue was a string instead of a number.
    • This prevented the condition value from appearing correctly in the filter popup.
  • When using the FilterByCondition API to set a filter to a column with duplicated binding in a Grid, the filter was always applied to the first column corresponding to the binding.

What was done

  • In the ColumnFilter.byCondition method, added an evaluation was added to check if the target column is numerical. If true, we check if the value is a number and convert it.
  • In the ColumnFilter.byCondition and ColumnFilter.byValue, edit how a filter is applied to a column. Instead of using the binding, now we use the column provider's instance.

Test Steps

Test 1:

  1. Go to a page with a Grid that contains a Currency column
  2. Use the FilterByCondition API to set a new filter to the Currency column
  3. Open the column filter
  4. Check that the condition value is displayed correctly

Test 2:

  1. Go to a page with a Grid that contains two columns with the same binding
  2. Use the FilterByCondition API to set a new filter to a column
  3. Check that the desired column is filtered correctly
  4. Repeat for another column with the same binding.

Screenshots

Before first fix:
filterbycondition_isse

After first fix:
filterbycondition_fix

Before second fix:
filterbycondition_samebinding_issue

After second fix:
filterbycondition_samebinding_fix

Checklist

  • tested locally
  • documented the code
  • clean all warnings and errors of eslint
  • requires changes in OutSystems (if so, provide a module with changes)
  • requires new sample page in OutSystems (if so, provide a module with changes)

@OS-giulianasilva OS-giulianasilva requested a review from a team as a code owner January 17, 2024 14:46
@outsystemsbot outsystemsbot bot added the cla:yes This code submission conforms with the OutSystems CLA or the CLA is not required for this PR label Jan 17, 2024
@bmarcelino-fe
Copy link
Contributor

@OS-giulianasilva please check the Sonar Cloud because it failed on Quality Gate.

Copy link

sonarqubecloud bot commented Jan 18, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@OS-giulianasilva OS-giulianasilva merged commit 1974f49 into dev Jan 18, 2024
13 checks passed
@OS-giulianasilva OS-giulianasilva deleted the ROU-4691 branch January 18, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes This code submission conforms with the OutSystems CLA or the CLA is not required for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants