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

EES-5848 Remove default / auto-select filter option from public API #5605

Merged
merged 5 commits into from
Feb 18, 2025

Conversation

ntsim
Copy link
Collaborator

@ntsim ntsim commented Feb 14, 2025

This PR removes the IsAutoSelect from the public API's FilterMetaViewModel so this information is no longer directly available to consumers (for now).

It should be noted that the 'auto-select' option (referenced as FilterMeta.AutoSelectLabel) is still stored in the database, but it has been renamed to the more consumer-agnostic FilterMeta.DefaultFilterOptionId (not directly tied to table tool).

We have made DefaultFilterOptionId an ID that references the FilterOptionMeta table to gain referential integrity and allow for faster lookup of the default option in the future.

Changes to AssertDeepEqualTo

The AssertDeepEqualTo extension was previously performing unnecessary inequality checks after checking for deep equality. This was quite awkward as it was causing various failures in ImportMetadataFunctionTests that would have been hard to resolve without their removal.

We have now removed the inequality checks from AssertDeepEqualTo and renamed notEqualProperties to ignoreProperties to make this distinction clearer.

If you want to be certain that the object you're checking has specific properties that are unequal, the recommended approach is to just add those checks in yourself after the AssertDeepEqualTo. A good example is in release content cloning tests where we check that the cloned objects have new Created dates.

As part of this, we've also switched any usages of AssertExtensions.Except for ignoreProperties to much terser C# 8 collection expressions.

Other changes

  • Fixed incorrect rollback method for the EES4735_RenameIsAggregateToIsAutoSelect migration. We don't typically roll back migrations, but it irked me that this wasn't correctly implemented in case we ever needed to.
  • Added launch profile for the public API's seed data script to make it easier to run without having to set up your own

This flag is not needed currently, but is also the incorrect
implementation as it is specific to table tool. Anything related to the
public API should be agnostic in relation to its consumers.
This previously did not correctly set `IsAggregate` to true for the
'Total' filter option.
This is purely for convenience to make it easier to run the script
directly from the IDE.
This correctly implements default filter options in the public API using
the consumer-agnostic terminology 'default' instead of 'auto-select'.

Additionally, we add referential integrity and can determine the default
option more easily by using an ID instead of a label string.
@ntsim ntsim merged commit 74a3923 into dev Feb 18, 2025
10 checks passed
@ntsim ntsim deleted the ees-5848 branch February 18, 2025 18:04
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