openlibhums / openlibhums/janeway

Improve handling of choice settings on all settigns screen (Raw JSON)

Open
#4,271 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Priority low Size XL
Dominant language
Python
Stars
238
Forks
97
Avg merge
9d 1h
Merged PRs (30d)
8

Description

Problem

JSON setting fields seem to be loaded with a select input in the generated settings forms:

https://github.com/BirkbeckCTP/janeway/blob/aa263dbd73d87be8269ae6e5ade487d60893af4c/src/core/forms/forms.py#L307-L310

https://github.com/BirkbeckCTP/janeway/blob/aa263dbd73d87be8269ae6e5ade487d60893af4c/src/core/forms/forms.py#L355-L358

Dev notes

  • We have conflated the meaning of the JSON setting type. We want to display the user a selection of choices for some settings. The setting has to be serialized as JSON for storage, however there will be other settings that want to use JSON but are not meant to be a choice. We We could have a setting type called choice-as-json or similar. similar.

  • The overload of JSON only works on the screen it was designed for, not on the "all settings" page. We need to handler the new setting type in the "all settings" screen.

  • There needs to be a mechanism to provide unselected choices to the all settings interface. At the moment it only displays whichever choices are selected (stored as JSON in the DB)

Image

User Stories

  • As a journal manager, I want to be able to configure certain parts of the system using choice fields. Some of these choice fields are shown as raw JSON on the ALL settings page.

Contributor guide

Open the contributing guide

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 in src/core/forms/forms.py at the linked lines around 307-310 and 355-358, then trace how the all settings screen builds its fields. Identify how choice-as-JSON settings and unselected choices are supplied there; done means raw JSON settings remain distinct from choice fields and all choices are available for selection.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.