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

Stop defaulting values to derived property/filter/post-filter panel #2320

Closed
wants to merge 2 commits into from

Conversation

gayathrir11
Copy link
Contributor

@gayathrir11 gayathrir11 commented Jun 9, 2023

Summary

closes #2318

How did you test this change?

  • Test(s) added
  • Manual testing (please provide screenshots/recordings)
  • No testing (please provide an explanation)

Filter Panel

filter.mp4

Derived property panel

derived.mp4

@gayathrir11 gayathrir11 requested a review from a team as a code owner June 9, 2023 08:03
@changeset-bot
Copy link

changeset-bot bot commented Jun 9, 2023

🦋 Changeset detected

Latest commit: e74f76e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@finos/legend-query-builder Patch
@finos/legend-application-query Patch
@finos/legend-application-studio Patch
@finos/legend-extension-dsl-data-space Patch
@finos/legend-extension-dsl-service Patch
@finos/legend-manual-tests Patch
@finos/legend-application-query-bootstrap Patch
@finos/legend-application-studio-bootstrap Patch
@finos/legend-extension-assortment Patch
@finos/legend-extension-dsl-diagram Patch
@finos/legend-extension-dsl-mastery Patch
@finos/legend-extension-dsl-persistence Patch
@finos/legend-extension-dsl-text Patch
@finos/legend-extension-store-flat-data Patch
@finos/legend-extension-store-relational Patch
@finos/legend-extension-store-service-store Patch
@finos/legend-application-query-deployment Patch
@finos/legend-application-studio-deployment Patch
@finos/legend-application-pure-ide Patch
@finos/legend-application-pure-ide-deployment Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Jun 11, 2023

Codecov Report

Merging #2320 (45ce3fe) into master (4c953a4) will decrease coverage by 0.04%.
The diff coverage is 63.15%.

❗ Current head 45ce3fe differs from pull request most recent head e74f76e. Consider uploading reports for the commit e74f76e to get more accurate results

@@            Coverage Diff             @@
##           master    #2320      +/-   ##
==========================================
- Coverage   40.63%   40.60%   -0.04%     
==========================================
  Files        1539     1539              
  Lines       72764    73220     +456     
  Branches    17049    17205     +156     
==========================================
+ Hits        29569    29731     +162     
- Misses      43076    43369     +293     
- Partials      119      120       +1     
Impacted Files Coverage Δ
...ts/fetch-structure/QueryBuilderPostFilterPanel.tsx 10.95% <0.00%> (-0.23%) ⬇️
...perators/QueryBuilderPostFilterOperator_Contain.ts 20.58% <ø> (ø)
...perators/QueryBuilderPostFilterOperator_EndWith.ts 20.58% <ø> (ø)
.../operators/QueryBuilderPostFilterOperator_Equal.ts 66.10% <ø> (+1.10%) ⬆️
...tors/QueryBuilderPostFilterOperator_GreaterThan.ts 47.36% <ø> (ø)
...erators/QueryBuilderPostFilterOperator_LessThan.ts 47.36% <ø> (ø)
...rators/QueryBuilderPostFilterOperator_StartWith.ts 55.88% <ø> (ø)
...er/operators/QueryBuilderFilterOperator_Contain.ts 36.36% <ø> (ø)
...er/operators/QueryBuilderFilterOperator_EndWith.ts 36.36% <ø> (ø)
...lter/operators/QueryBuilderFilterOperator_Equal.ts 93.10% <ø> (-0.12%) ⬇️
... and 14 more

... and 30 files with indirect coverage changes

Copy link
Contributor

@akphi akphi left a comment

Choose a reason for hiding this comment

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

There are three points:

  1. In terms of the interface:
  • For derived property, we should warn when people are in the modal about required parameters which are not initialized
  • For warning in general, we should do what we did with duplicated projection column name, there's a red (X) circle icon and the whole input is bordered in red. Consistency is key here
  • There are subtleties and details we can get into, for example: initially, when no value provided, it should show red border, when people click on it to edit, the border is blue, the error icon is dismissed
  1. There are other places we should check if we need this: what about calendar? Remember that we have to select a property, if the property is not selected, can we have the same interface that warns about this error?

  2. You have done the check in the form (when people put in the value), in the state when we first create the filter condition, etc. but we lack this validation in the build-query-from-state flow (a.k.a. the backflow of the roundtrip), essentially, this happens when we call QueryBuilderState.buildQuery() when we build the lambda/query; ideally, I think we should throw when we encounter invalid InstanceValue when building the expression, but then, we have to try ... catch all the places which use buildQuery() and also make sure all the UI code path which potentially calls buildQuery() is guarded properly when the query is invalid, this increases the scope of this PR, but I think it must be done

if (node instanceof QueryBuilderFilterTreeConditionNodeData) {
if (
node.condition.value instanceof InstanceValue &&
!isValidInstanceValue(node.condition.value)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these validation utils method can be named better, clearly, they are used only to check if the value is empty or not, if that's the case, rename them so, if we keep this name, we make them generic validator, that spits out validation issues rather than just a boolean

@@ -157,28 +153,11 @@ export const generateValueSpecificationForParameter = (
),
),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

strange change here, why delete these blocks?

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 deleted these blocks so we don't add default values to the instanceValues

@stale
Copy link

stale bot commented Sep 17, 2023

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

@stale stale bot added the Resolution: Stale This is inactive and will be closed label Sep 17, 2023
@stale
Copy link

stale bot commented Sep 24, 2023

Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!

@stale stale bot closed this Sep 24, 2023
@gayathrir11 gayathrir11 deleted the defualt branch October 11, 2023 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Stale This is inactive and will be closed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Stop defaulting values on filter/post-filter/derived property editor
3 participants