Skip to content

Only create remote to-one resources after object is created#6147

Merged
CarolineDenis merged 3 commits into
productionfrom
issue-6139
Jan 23, 2025
Merged

Only create remote to-one resources after object is created#6147
CarolineDenis merged 3 commits into
productionfrom
issue-6139

Conversation

@melton-jason

@melton-jason melton-jason commented Jan 23, 2025

Copy link
Copy Markdown
Contributor

Fixes #6139

This Issue is actually caused by a combination of changes from #6073 and #6038.

Specifically, from:

  • 0db66b6: where the logic to handle remote to-one relationships was made generic. The records for remote to-one relationships were being created before the "main" record was being saved without setting the corresponding relationship, and then the relationship was being set from the "concrete" side.

    • In the context of CO/COGs: when creating/updating a CO/COG with information for a cojo, the cojo was being created before the CO/COG was created, and the COJO -> childCo/childCog relationship was only set after both the CO/COG and the COJO were created
  • 7be6316: where the businessrules to enforce that a CollectionObjectGroupJoin didn't have neither a childCO or childCOG or both a childCO and childCOG was re-enabled (see Allow to upload COG in WB #6073 (comment))

From #6139 (comment)

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add automated tests
  • Add relevant issue to release milestone
  • Add relevant documentation (Tester - Dev)

Testing instructions

  • On either the CollectionObject (CO) or CollectionObjectGroup (COG) form, add a CollectionObjectGroupJoin (COJO) via the cojo relationship
  • Save the CO/COG
  • Ensure the COJO is properly set on the CO/COG
    • Immediately after the save button is pressed
    • After the page is refreshed
  • Go to the Parent Cog of the CO or COG and ensure the newly added child correctly appears in the COGs children
  • Remove the COJO from the CO/COG form and save the CO/COG: ensure the COJO is properly set on the CO/COG
    • Immediately after the save button is pressed
    • After the page is refreshed
  • Ensure that both new and existing children can be added to a COG

@melton-jason melton-jason added this to the 7.10 milestone Jan 23, 2025
@melton-jason
melton-jason requested review from a team January 23, 2025 13:13

@pashiav pashiav left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • Ensure the COJO is properly set on the CO/COG
    • Immediately after the save button is pressed
    • After the page is refreshed
  • Go to the Parent Cog of the CO or COG and ensure the newly added child correctly appears in the COGs children
  • Remove the COJO from the CO/COG form and save the CO/COG: ensure the COJO is properly set on the CO/COG
    • Immediately after the save button is pressed
    • After the page is refreshed
  • Ensure that both new and existing children can be added to a COG

Looks good - working as expected!

Note: noticed that when adding/deleting a COJO from a CO, it appears that there are two duplicate records in the navigator (consistently reproduced).
Issue made: #6149

@pashiav
pashiav requested a review from a team January 23, 2025 14:53

@emenslin emenslin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • Ensure the COJO is properly set on the CO/COG
  • Go to the Parent Cog of the CO or COG and ensure the newly added child correctly appears in the COGs children
  • Remove the COJO from the CO/COG form and save the CO/COG: ensure the COJO is properly set on the CO/COG
  • Ensure that both new and existing children can be added to a COG

Checked on both the CO and COG form and didn't run into any issues aside from what Pashia mentioned.

@emenslin
emenslin requested a review from a team January 23, 2025 16:30

@lexiclevenger lexiclevenger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Testing instructions

  • On either the CollectionObject (CO) or CollectionObjectGroup (COG) form, add a CollectionObjectGroupJoin (COJO) via the cojo relationship
  • Save the CO/COG
  • Ensure the COJO is properly set on the CO/COG
    • Immediately after the save button is pressed
    • After the page is refreshed
  • Go to the Parent Cog of the CO or COG and ensure the newly added child correctly appears in the COGs children
  • Remove the COJO from the CO/COG form and save the CO/COG: ensure the COJO is properly set on the CO/COG
    • Immediately after the save button is pressed
    • After the page is refreshed
  • Ensure that both new and existing children can be added to a COG

Looks good to me, too!

@CarolineDenis
CarolineDenis merged commit 185b8c8 into production Jan 23, 2025
@CarolineDenis
CarolineDenis deleted the issue-6139 branch January 23, 2025 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

Cannot add collection object group to a collection object

5 participants