Instead of passing a context in "HomeboxForm", divide the Form into two seperate forms

Created on 11 April 2024, 3 months ago

Problem/Motivation

As stated by @Anybody in πŸ› Issues when creating homebox presets / other people's homeboxes Fixed :

[...]
I'm not really sure the context parameter is the best possible solution.
I'm a bit more in favor of using inheritance and two different form classes inheritng from the base class.
That's typically the better polymorphysm pattern instead of if's that tend to grow by time and code becomes ugly.

Furthermore, in the current implementation you have to ensure the context parameter is always present, which is also a sign of improvable design. In that case two separate same-based routes / URLs could do the job better without edge-cases like

unexpected value for context
missing context
which for routes the system would handle itself by design (404)

Meaning, instead of passing a context in "HomeboxForm", we should have a "HomeboxFormBase" with two deriving Forms called "HomeboxFormPreset" and "HomeboxFormUser" instead. This way, it is way easier for us to separate the Form logic, and we have a cleaner seperation between the two.

Steps to reproduce

Proposed resolution

Fix the issue.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Grevil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024