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

Add support for "belongsTo" relationships for create forms #755

Merged
merged 7 commits into from
Nov 15, 2022

Conversation

lyonsbp
Copy link
Member

@lyonsbp lyonsbp commented Nov 11, 2022

Issue #, if available:

Description of changes:
This change supports "belongsTo" relationships for forms, putting an <Autocomplete> field into the form allowing one related model to be selected.

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 11, 2022 01:46
@lyonsbp lyonsbp marked this pull request as draft November 11, 2022 01:48
@lgtm-com
Copy link

lgtm-com bot commented Nov 11, 2022

This pull request introduces 1 alert when merging 67d905e into f63a424 - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

@lgtm-com
Copy link

lgtm-com bot commented Nov 15, 2022

This pull request introduces 1 alert when merging 8ecda9e into f63a424 - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog.

@lyonsbp lyonsbp self-assigned this Nov 15, 2022
@lyonsbp lyonsbp marked this pull request as ready for review November 15, 2022 02:17
@lgtm-com
Copy link

lgtm-com bot commented Nov 15, 2022

This pull request introduces 1 alert when merging 25daa7c into f63a424 - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog.

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2022

Codecov Report

Merging #755 (2d428b2) into tagged-release/cms-support (f63a424) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@                     Coverage Diff                     @@
##           tagged-release/cms-support     #755   +/-   ##
===========================================================
  Coverage                       92.05%   92.05%           
===========================================================
  Files                             114      114           
  Lines                            4204     4204           
  Branches                         1164     1163    -1     
===========================================================
  Hits                             3870     3870           
  Misses                            313      313           
  Partials                           21       21           
Impacted Files Coverage Δ
...-react/lib/forms/form-renderer-helper/all-props.ts 100.00% <100.00%> (ø)
...ct/lib/forms/form-renderer-helper/display-value.ts 94.91% <100.00%> (ø)
.../forms/form-renderer-helper/event-handler-props.ts 98.78% <100.00%> (ø)
...b/forms/form-renderer-helper/render-array-field.ts 100.00% <100.00%> (ø)
...-ui-react/lib/utils/forms/array-field-component.ts 100.00% <100.00%> (ø)
...te-form-definition/helpers/model-fields-configs.ts 100.00% <100.00%> (ø)

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 f63a424...2d428b2. Read the comment docs.

@lyonsbp lyonsbp requested review from zchenwei and cwoolum November 15, 2022 20:50
cwoolum
cwoolum previously approved these changes Nov 15, 2022
@lgtm-com
Copy link

lgtm-com bot commented Nov 15, 2022

This pull request introduces 1 alert when merging 8ce437a into f63a424 - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog.

@lgtm-com
Copy link

lgtm-com bot commented Nov 15, 2022

This pull request introduces 1 alert when merging 2d428b2 into f63a424 - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog.

@lyonsbp lyonsbp merged commit 2697241 into tagged-release/cms-support Nov 15, 2022
@lyonsbp lyonsbp deleted the belongs-to-support branch November 15, 2022 23:32
scottyoung pushed a commit that referenced this pull request Nov 16, 2022
* feat: wip belongs to support

* feat: belongsTo working for create form

* chore: add golden file for belongsTo create form

* fix: arrayfield/autocomplete bugs

* chore: update snapshots

* chore: handle review comments

* chore: add tests and update snapshots
zchenwei added a commit that referenced this pull request Nov 17, 2022
* feat: init form support for has-one relationship (#718)

Co-authored-by: Hein Jeong <heinje@amazon.com>

* chore: wrap relationship fields in ArrayField (#719)

Co-authored-by: Hein Jeong <heinje@amazon.com>

* chore: split up form-renderer-helper (#720)

Co-authored-by: Hein Jeong <heinje@amazon.com>

* chore: map props on relationship-based Autocomplete (#721)

Co-authored-by: Hein Jeong <heinje@amazon.com>

* feat: add relationship suggestion query to forms (#722)

* feat: add relationship suggestion query

* chore: map props on relationship-based Autocomplete (#721)

Co-authored-by: Hein Jeong <heinje@amazon.com>

* feat: add relationship suggestion query

* fix: remove extra declarations

Co-authored-by: Scott Young <scoyou@amazon.com>
Co-authored-by: Hein Jeong <73264629+hein-j@users.noreply.github.com>
Co-authored-by: Hein Jeong <heinje@amazon.com>

* fix: hide cancel button by default (#696)

* chore: modify ArrayField to support has-one relationships (#724)

Co-authored-by: Hein Jeong <heinje@amazon.com>

* chore: support not-model HAS_ONE relationships (#726)

Co-authored-by: Hein Jeong <heinje@amazon.com>

* chore: map type file for model fields (#727)

Co-authored-by: Hein Jeong <heinje@amazon.com>

* feat: add handling for excluded sectional elements

* fix: cli test fix

* fix: handle association breaking changes for new schema

* Add support for "belongsTo" relationships for create forms (#755)

* feat: wip belongs to support

* feat: belongsTo working for create form

* chore: add golden file for belongsTo create form

* fix: arrayfield/autocomplete bugs

* chore: update snapshots

* chore: handle review comments

* chore: add tests and update snapshots

* feat: adding many to many support for form creation

* test: fix tests

* test: fix test

* feat: adding many-to-many relationship create form golden file

* chore: update create file

* test: fix test

* test: fix unit tests

* test: fix tests

* fix: fix merge conflicts

* test: fix timestamp type

* chore: add tag update form golden file with manyToMany relationship

Co-authored-by: Hein Jeong <73264629+hein-j@users.noreply.github.com>
Co-authored-by: Hein Jeong <heinje@amazon.com>
Co-authored-by: Scott Young <snyoung@gmail.com>
Co-authored-by: Scott Young <scoyou@amazon.com>
Co-authored-by: Josue Ruiz <7465495+SwaySway@users.noreply.github.com>
Co-authored-by: Roshane Pascual <rotp@amazon.com>
Co-authored-by: Brandon Lyons <lyonsbp@amazon.com>
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.

4 participants