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 UI COG - Part 1 (add and visualize COG in forms) #5185

Closed
Tracked by #1150
CarolineDenis opened this issue Aug 5, 2024 · 0 comments · Fixed by #5360
Closed
Tracked by #1150

Add UI COG - Part 1 (add and visualize COG in forms) #5185

CarolineDenis opened this issue Aug 5, 2024 · 0 comments · Fixed by #5360
Assignees
Labels
1 - Request Improvements or extensions to existing behavior
Milestone

Comments

@CarolineDenis
Copy link
Contributor

CarolineDenis commented Aug 5, 2024

To use the new COG feature, the user will follow this simple workflow:

  1. Open the New COG Form:

    • Navigate to Data Entry > COG Table to open a new COG form.
  2. COG Form Layout:

    • The form includes:
      • A label named "Name" with an associated input box.
      • An empty subview with a "+" button.
  3. Add COG/CO:

    • Click the "+" button.
    • A dialog opens with the following options:
      • Add COG:
        • Create a new COG.
        • Use QB (Query Builder) to search for an existing COG.
      • Add CO:
        • Create a new CO.
        • Use QB to search for an existing CO.
  4. Create or Select Records:

    • The user can either create a new record and save it or select one or several records from the QB search results and add them to the COG parent.
  5. Updated Parent COG Subview:

    • A new record line is added to the Parent COG subview. This line includes:
      • COG/CO information in a collapsed subview.
      • Attributes from COJO (e.g., isPrimary, isSubstrate).
      • A trash can icon at the end of each line to remove the record from the parent COG.
      • An arrow at the front of each line to expand the form.
      • Clicking on the record link opens a new page with the record form
  6. Expand Record Form:

    • When the arrow is clicked to uncollapse the line, it opens the corresponding record form using a conditional format based on whether the foreign key (FK) CO or FK COG is present.

Screenshot 2024-08-05 at 12 32 05 PM
Screenshot 2024-08-05 at 12 32 13 PM
Screenshot 2024-08-05 at 12 32 23 PM
Screenshot 2024-08-05 at 12 32 31 PM
Screenshot 2024-08-05 at 12 32 39 PM

@CarolineDenis CarolineDenis added the 1 - Request Improvements or extensions to existing behavior label Aug 5, 2024
@CarolineDenis CarolineDenis added this to the 7.9.8 milestone Aug 5, 2024
@CarolineDenis CarolineDenis self-assigned this Sep 17, 2024
CarolineDenis added a commit that referenced this issue Sep 17, 2024
sharadsw added a commit that referenced this issue Nov 5, 2024
* Allow independent subviews

Fixes #114

* Turn independent sub views into buttons

Fixes #3127

* Lint code with ESLint and Prettier

Triggered by dfaa5d0 on branch refs/heads/issue-114

* Lint code with ESLint and Prettier

Triggered by 1359149 on branch refs/heads/issue-114

* Allow modifying remote side of indedpenent resources via API

* Add tests for inline independent resources

* Write test for reassigning to-one relationship from to-many side

* Modify frontend orm to handle indpendent to-many relationships

* Add Independent Collection to Collection API

* Recompute resource delete blockers on save

* Don't default independent subviews as buttons

* Propagate save blockers on independent resources to related record

This is not likely the behavior we want, so this is something to be discussed.
See related #3127

* Add CO -> isMemberOfCOG virtual field to frontend

* Improve date backendfilters on frontend

* Allow creating new records in Independent ToMany Collections

* Allow creating new resources from independent to-one side

* Remove toApiJSON method declaration on independent to-one resources

* Remove changedResources on IndependentCollection

* Display loading indicator while fetching collection

* Use ResourceView dialog when adding independent resource

* Only show loading indicators for non-button subviews

* Only show ResourceView dialog when specified viewname differs from table view

* Use aria-pressed on add button when ResourceView is open

* Refactor getDependentToMany

* Fix bug when fetching independent collection when related is initializing

* Only update related version when changed

* Fix test not being automatically ran

* Show helpful error when rendering to-many as querycbx

* Hide relationship when needed to avoid cyclical rendering

* Resolve type errors

* Resolve frontend tests

* Check independent update permission when removing from relationship

* Don't render SubView if reverse relationship doesn't exist

* Insert removal of independent to-manys into auditlog

* Resolve backend tests

* Resolve frontend tests

* Make independent subview lazy

* Cleanup handle_to_many code

* Cleanup API for to-many Collections

* Don't automatically fetch Independent ToOne Collections when modified

* Initialize totalCount variable for lazy collections

* Remove import + chnage url test

* Add cogtype helpers

* Add COG business rules

* Lint code with ESLint and Prettier

Triggered by c1e8978 on branch refs/heads/issue-5246

* Indep-to-many: use Django fieldnames over datamodel field names

* Generate new types
- frontend and backend fieldNames were out of sync

* Change business rules to new fieldnames

* fix typecheck

* cleanup

* Add COG children picker to forms

Fixes #5185

* Chnage key

* Add useEffect to create newResource

* Add search dialog

* Handle add

* Typo

* Reset resource

* Unhide geo tables

* Define useCollection hook, reset collection on parent save, fix formtable subviews

* Resolve TS errors

* Resolve backend tests, update URI for frontend format test

* Change ordering for setting of _neverFetched

* Improve orderby resolution for to-many subviews

* Resolving failing frontend test

* Create utils for business rules

* add cog business rule test

* Prevent storing independent toMany if fetch not successful

* Add empty check for value conditions

* Regenerate datamodel test file

* Update tests to be inline with updated datamodel test file

* Lint code with ESLint and Prettier

Triggered by 3a1224c on branch refs/heads/issue-5246

* Add test case for substrate

* Set independent toOne on resource change

* Fetch independnet toOne when rgetPromise called

* Move empty value keyword to a variable

* Lint code with ESLint and Prettier

Triggered by 1a81c71 on branch refs/heads/issue-5246

* Remove unused localization

* Change casing

Co-authored-by: Max Patiiuk <[email protected]>

* Fix casing

* Change parentCojos to cojo

* Separate isComplete logic for Lazy/Relationship fetch calls

* Lint code with ESLint and Prettier

Triggered by bab5e1d on branch refs/heads/issue-114-backend

* Add cojo dialog to subview

* Lint code with ESLint and Prettier

Triggered by 33a95dd on branch refs/heads/issue-5185

* Write frontend tests for Independent Collections

* Lint code with ESLint and Prettier

Triggered by 91b8031 on branch refs/heads/issue-114-backend

* Check totalCount

* Always respect options to collection fetch calls

* Write test for collection fetch options

* Fix type error in test

* Change child field

* Research and tries

* Add parentUrl

* Handle mutliple COs added at same time

* Remove some comments

* Remove duplication

* Remove log

* Remove import

* Set cojo on parent

* Remove code

* Remove import

* Datamodel improvements

* Remove unecessary code

* Propagate change from toMany relationship collections to related

* Lint code with ESLint and Prettier

Triggered by fb3dc17 on branch refs/heads/issue-114-backend

* Remove comment

* Remove condition

* Lint code with ESLint and Prettier

Triggered by 7c45847 on branch refs/heads/issue-114-backend

* Improve collection fetching for Grid-based Subviews

* Add field check for childCOJOs

* Add to do

* Test setting parentCojo

* Allow passing filters to resource.rgetCollection

* Lint code with ESLint and Prettier

Triggered by c6c9d8c on branch refs/heads/issue-114-backend

* Update comment in fetchToOneCollection

* Add cojo back to COG

* Use children relationship for opening COJO dialog

* Remove unused import

* Save parentCojo on childCog

* Remove unused import

* Chnage resource to save

* Remove unecessary code

* Remove import

* Test bus rule on delte cojo for parent

* update types

* Update business rule with new types

* Fix typecheck

* fix snapshots

* Revert "fix snapshots"

This reverts commit 22de47c.

* Revert "Merge remote-tracking branch 'origin/issue-5185' into issue-5246"

This reverts commit 9c00cca, reversing
changes made to aac3197.

* Update datamodel

* Fix business rule when childCo is undefined

---------

Co-authored-by: Max Patiiuk <[email protected]>
Co-authored-by: Grant Fitzsimmons <[email protected]>
Co-authored-by: Caroline D <[email protected]>
Co-authored-by: Jason Melton <[email protected]>
Co-authored-by: melton-jason <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - Request Improvements or extensions to existing behavior
Projects
None yet
1 participant