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

fix: alias form model names so we do not get naming collisions #771

Merged
merged 2 commits into from
Nov 18, 2022

Conversation

lyonsbp
Copy link
Member

@lyonsbp lyonsbp commented Nov 18, 2022

Issue #, if available:

Description of changes:
This changes handles the possibility of naming collisions within form relationships. Currently, the Studio Data Modeler will name the connected field {ModelName} with a capital letter when creating a belongsTo relationship. Since this name would conflict with the model name/import, a collision happened. This is resolved by aliasing the model import to import {ModelName} as {ModelName}0

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@lyonsbp lyonsbp requested a review from a team as a code owner November 18, 2022 00:42
@codecov-commenter
Copy link

Codecov Report

Merging #771 (e6fdc1a) into tagged-release/cms-support (5433d47) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@                     Coverage Diff                     @@
##           tagged-release/cms-support     #771   +/-   ##
===========================================================
  Coverage                       92.02%   92.02%           
===========================================================
  Files                             115      115           
  Lines                            4387     4391    +4     
  Branches                         1220     1221    +1     
===========================================================
+ Hits                             4037     4041    +4     
  Misses                            329      329           
  Partials                           21       21           
Impacted Files Coverage Δ
...act/lib/forms/form-renderer-helper/relationship.ts 100.00% <100.00%> (ø)
...eact/lib/forms/form-renderer-helper/type-helper.ts 100.00% <100.00%> (ø)
.../codegen-ui-react/lib/forms/react-form-renderer.ts 84.02% <100.00%> (ø)
.../codegen-ui-react/lib/imports/import-collection.ts 97.14% <100.00%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5433d47...e6fdc1a. Read the comment docs.

Copy link
Contributor

@zchenwei zchenwei left a comment

Choose a reason for hiding this comment

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

LGTM

@lyonsbp lyonsbp merged commit 2746004 into tagged-release/cms-support Nov 18, 2022
@lyonsbp lyonsbp deleted the alias-form-models branch November 18, 2022 20:57
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.

None yet

4 participants