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

Modal form framework #5354

Closed
21 of 32 tasks
Tracked by #5212
SchrodingersGat opened this issue Jul 27, 2023 · 16 comments
Closed
21 of 32 tasks
Tracked by #5212

Modal form framework #5354

SchrodingersGat opened this issue Jul 27, 2023 · 16 comments
Labels
Platform UI Related to the React based User Interface
Milestone

Comments

@SchrodingersGat
Copy link
Member

SchrodingersGat commented Jul 27, 2023

reimplement the existing "API forms" framework in react

Tasks

@SchrodingersGat SchrodingersGat added the Platform UI Related to the React based User Interface label Jul 27, 2023
@wolflu05
Copy link
Contributor

I would like to extend this a bit:

  • Add sub forms
  • Add a generic ApiView to the backend with some typing so the we can easily define such forms
  • Dependent settings
  • Input type: array list
  • Input Type: Date, time, datetime
  • validations: int, min, max, regex, ...

@SchrodingersGat
Copy link
Member Author

I would like to extend this a bit:

  • Add sub forms - like, secondary forms which open from the first one?
  • Add a generic ApiView to the backend with some typing so the we can easily define such forms - example?
  • Dependent settings - example?
  • Input type: array list - example?
  • Input Type: Date, time, datetime
  • validations: int, min, max, regex, ...

@wolflu05
Copy link
Contributor

Sub forms

They are an array of other form definitions that are rendered indented. Maybe also collapsable if they want to.

Generic Django Views

I tried to provide the idea a bit in #5295 . If I want to have a form defined from the backend I currently have no type hints and generic views to do so, I need to implement them again and again. I imagine having a View where I can define the form inputs somewhere in the class or via a getter and this view automatically handles advertisement via OPTIONS and calls a function like formSubmit. It should also handle api choices fields.

Dependent settings

This is for choices fields. Sometimes one choice field needs the value of other fields to calculate the choices. E.g. useful for providing the machine first and then conditionally get the specific machines printing form.

Array list

Just an input to provide a list. You start with one input, then there is a button + where you can add some inputs and each input has a delete button to remove it.

@SchrodingersGat
Copy link
Member Author

If I want to have a form defined from the backend I currently have no type hints and generic views to do so, I need to implement them again and again.

Use either a DRF serializer or Django model, and it will be taken care of for you. Check out metadata.py - this is where most of the magic happens. All of the current "front end" forms are constructed from that data.

@SchrodingersGat
Copy link
Member Author

This is for choices fields. Sometimes one choice field needs the value of other fields to calculate the choices. E.g. useful for providing the machine first and then conditionally get the specific machines printing form.

Choice fields can specify a "choicesFunc" method, which gets us some of the way there. However your advanced usage probably comes after this PR is merged in (as a starting point)

@wolflu05
Copy link
Contributor

Use either a DRF serializer or Django model, and it will be taken care of for you. Check out metadata.py - this is where most of the magic happens. All of the current "front end" forms are constructed from that data.

I still think we need something generic with our own options. I don't think that DRF serializers have e.g. dependent options, sub forms, and also a lot of the stuff you Implement.

@matmair
Copy link
Member

matmair commented Jul 27, 2023

If it touches the python API I wold probaly move it to another PR as we probably need to bump the API version

@SchrodingersGat
Copy link
Member Author

This issue (and linked PR) are only to re-implement functionality we already have in the "classic" UI

@wolflu05
Copy link
Contributor

We could probably implement an icon picker like the emoji keyboard on phones / the glyphs keyboard from iOS and maybe I bit more dense.

Copy link
Contributor

This issue seems stale. Please react to show this is still important.

@github-actions github-actions bot added the inactive Indicates lack of activity label Nov 20, 2023
@wolflu05
Copy link
Contributor

not stale

@github-actions github-actions bot removed the inactive Indicates lack of activity label Nov 21, 2023
Copy link
Contributor

This issue seems stale. Please react to show this is still important.

@github-actions github-actions bot added the inactive Indicates lack of activity label Jan 20, 2024
@SchrodingersGat
Copy link
Member Author

Not stale, long running issue in progress

@github-actions github-actions bot removed the inactive Indicates lack of activity label Jan 21, 2024
@XanderLuciano
Copy link
Contributor

XanderLuciano commented Mar 13, 2024

Make "footer" (buttons etc) stick to the bottom of the modal (no scroll)

Big +1 on this, the ability to click "submit" without having to scroll to the bottom is a killer advantage of the old UI vs. the new UI currently

Also, I know the old UI also handles "enter" as a modal form submission. This behavior also should be kept / added to the new UI.

This is a task I'm interested in submitting a PR for.

EDIT: Related Issue: https://github.com/orgs/mantinedev/discussions/1141

@matmair
Copy link
Member

matmair commented May 7, 2024

@SchrodingersGat is this still open/relevant and are the action items on top all still valid?

@SchrodingersGat
Copy link
Member Author

This is sufficiently advanced that we can close it out. Nice work everyone :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform UI Related to the React based User Interface
Projects
None yet
Development

No branches or pull requests

4 participants