SolidOS / SolidOS/solid-ui

Handling multiple form definitions (ui:annotationForm)

Open
#474 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Form Language help wanted RDF Forms
Dominant language
TypeScript
Stars
153
Forks
46
Avg merge
1d 8h
Merged PRs (30d)
7

Description

It is possible for a single class to be assigned multiple forms with
ui:creationForm or ui:annotationForm

A permanent solution probably requires either a mechanism to give the user a choice, to hardcode an order of preference (e.g. based on the document ui:annotationForm is defined in) or allow a user to specify a priority level for the form.

For my immediate purposes I have the problem that the same ui:annotationForm statement can be specified in multiple documents, which results in the form being rendered multiple times.

The logic to return the form to be used is in:
https://github.com/solid/solid-ui/blob/766c3f7906f991c582baad50f29061c1c9836a55/src/widgets/forms.js#L992

My temporary solution is to remove duplicate forms (i.e. ignore which document the ui:annotationForm statement was defined in). The two lines of code are here:
https://github.com/josephguillaume/my-solidos-patches/blob/afad1a9cc443fc1c996eec5dcc9463f55c670a1f/solid-ui.diff#L46

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the form-selection logic in src/widgets/forms.js around line 992 and compare it with the linked temporary patch in solid-ui.diff. Determine how repeated ui:annotationForm statements from multiple documents are represented and define the intended handling for multiple forms; done should prevent the same form from being rendered repeatedly while accounting for the unresolved selection behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.