finos / legend-studio

Legend Studio
https://legend.finos.org
Apache License 2.0
87 stars 114 forks source link

[Fix] Improve handling of changing const/param/derivation types #3434

Closed travisstebbins closed 3 weeks ago

travisstebbins commented 4 weeks ago

Summary

This PR re-commits the changes to improve the handling of changing constant/parameter/derivation types, but without the useEffect hook that was causing a bug.

The below is taken from the original PR:

Improve how we handle when a user changes the type of a constant/parameter/derivation. This PR implements new behavior such that if a user changes the type of a constant/parameter/derivation, if the value is used in the filter or post-filter panels and is no longer compatible, we show it as an error. This ensures users can't change the types of these values and accidentally create an invalid query.

How did you test this change?

Changing const type: ChangingConst

Changing param type: ChangingParam

Changing derivation type when used as post-filter condition left value: DerivationLeftValue

Changing derivation type when used as post-filter condition right value: DerivationRightValue

Derivation is maintained when "edit pure" modal is opened and closed (bug that was occurring previously with the useEffect hook): DerivationEditPure

changeset-bot[bot] commented 4 weeks ago

🦋 Changeset detected

Latest commit: 45808540e7dc553c20e42e6a855e59b21e31a723

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

This PR includes changesets to release 23 packages | Name | Type | | --------------------------------------------- | ----- | | @finos/legend-application-query-bootstrap | Patch | | @finos/legend-query-builder | Patch | | @finos/legend-application-query-deployment | Patch | | @finos/legend-application-query | Patch | | @finos/legend-application-studio | Patch | | @finos/legend-extension-dsl-data-quality | Patch | | @finos/legend-extension-dsl-data-space-studio | Patch | | @finos/legend-extension-dsl-data-space | Patch | | @finos/legend-extension-dsl-service | Patch | | @finos/legend-application-studio-bootstrap | Patch | | @finos/legend-extension-assortment | Patch | | @finos/legend-extension-dsl-diagram | 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-vscode-extension-dependencies | Patch | | @finos/legend-application-studio-deployment | Patch | | @finos/legend-application-pure-ide | Patch | | @finos/legend-application-pure-ide-deployment | Patch | | @finos/legend-application-repl-deployment | Patch | | @finos/legend-server-showcase-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[bot] commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 46.32%. Comparing base (a408fa8) to head (4580854). Report is 4 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3434 +/- ## ========================================== - Coverage 46.42% 46.32% -0.10% ========================================== Files 2097 2097 Lines 361504 361576 +72 Branches 15746 15677 -69 ========================================== - Hits 167818 167491 -327 - Misses 192989 193141 +152 - Partials 697 944 +247 ``` | [Files](https://app.codecov.io/gh/finos/legend-studio/pull/3434?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos) | Coverage Δ | | |---|---|---| | [...ts/fetch-structure/QueryBuilderPostFilterPanel.tsx](https://app.codecov.io/gh/finos/legend-studio/pull/3434?src=pr&el=tree&filepath=packages%2Flegend-query-builder%2Fsrc%2Fcomponents%2Ffetch-structure%2FQueryBuilderPostFilterPanel.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos#diff-cGFja2FnZXMvbGVnZW5kLXF1ZXJ5LWJ1aWxkZXIvc3JjL2NvbXBvbmVudHMvZmV0Y2gtc3RydWN0dXJlL1F1ZXJ5QnVpbGRlclBvc3RGaWx0ZXJQYW5lbC50c3g=) | `84.29% <100.00%> (+0.28%)` | :arrow_up: | | [...omponents/fetch-structure/QueryBuilderTDSPanel.tsx](https://app.codecov.io/gh/finos/legend-studio/pull/3434?src=pr&el=tree&filepath=packages%2Flegend-query-builder%2Fsrc%2Fcomponents%2Ffetch-structure%2FQueryBuilderTDSPanel.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos#diff-cGFja2FnZXMvbGVnZW5kLXF1ZXJ5LWJ1aWxkZXIvc3JjL2NvbXBvbmVudHMvZmV0Y2gtc3RydWN0dXJlL1F1ZXJ5QnVpbGRlclREU1BhbmVsLnRzeA==) | `74.11% <100.00%> (+0.04%)` | :arrow_up: | | [.../src/components/filter/QueryBuilderFilterPanel.tsx](https://app.codecov.io/gh/finos/legend-studio/pull/3434?src=pr&el=tree&filepath=packages%2Flegend-query-builder%2Fsrc%2Fcomponents%2Ffilter%2FQueryBuilderFilterPanel.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos#diff-cGFja2FnZXMvbGVnZW5kLXF1ZXJ5LWJ1aWxkZXIvc3JjL2NvbXBvbmVudHMvZmlsdGVyL1F1ZXJ5QnVpbGRlckZpbHRlclBhbmVsLnRzeA==) | `89.94% <100.00%> (+0.04%)` | :arrow_up: | | [...src/stores/QueryBuilderValueSpecificationHelper.ts](https://app.codecov.io/gh/finos/legend-studio/pull/3434?src=pr&el=tree&filepath=packages%2Flegend-query-builder%2Fsrc%2Fstores%2FQueryBuilderValueSpecificationHelper.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos#diff-cGFja2FnZXMvbGVnZW5kLXF1ZXJ5LWJ1aWxkZXIvc3JjL3N0b3Jlcy9RdWVyeUJ1aWxkZXJWYWx1ZVNwZWNpZmljYXRpb25IZWxwZXIudHM=) | `85.00% <100.00%> (+0.03%)` | :arrow_up: | | [...ure/tds/post-filter/QueryBuilderPostFilterState.ts](https://app.codecov.io/gh/finos/legend-studio/pull/3434?src=pr&el=tree&filepath=packages%2Flegend-query-builder%2Fsrc%2Fstores%2Ffetch-structure%2Ftds%2Fpost-filter%2FQueryBuilderPostFilterState.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos#diff-cGFja2FnZXMvbGVnZW5kLXF1ZXJ5LWJ1aWxkZXIvc3JjL3N0b3Jlcy9mZXRjaC1zdHJ1Y3R1cmUvdGRzL3Bvc3QtZmlsdGVyL1F1ZXJ5QnVpbGRlclBvc3RGaWx0ZXJTdGF0ZS50cw==) | `78.00% <100.00%> (+0.59%)` | :arrow_up: | | [...ilder/src/stores/filter/QueryBuilderFilterState.ts](https://app.codecov.io/gh/finos/legend-studio/pull/3434?src=pr&el=tree&filepath=packages%2Flegend-query-builder%2Fsrc%2Fstores%2Ffilter%2FQueryBuilderFilterState.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos#diff-cGFja2FnZXMvbGVnZW5kLXF1ZXJ5LWJ1aWxkZXIvc3JjL3N0b3Jlcy9maWx0ZXIvUXVlcnlCdWlsZGVyRmlsdGVyU3RhdGUudHM=) | `89.46% <100.00%> (-0.02%)` | :arrow_down: | ... and [288 files with indirect coverage changes](https://app.codecov.io/gh/finos/legend-studio/pull/3434/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=finos)