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

UI 2.0: /api/ui/ Endpoint for Model, Filterset Definition to Schema #3582

Closed
4 tasks
Tracked by #3142
bryanculver opened this issue Apr 14, 2023 · 0 comments · Fixed by #4162
Closed
4 tasks
Tracked by #3142

UI 2.0: /api/ui/ Endpoint for Model, Filterset Definition to Schema #3582

bryanculver opened this issue Apr 14, 2023 · 0 comments · Fixed by #4162
Assignees
Labels
type: feature Introduction of new or enhanced functionality to the application
Milestone

Comments

@bryanculver
Copy link
Member

bryanculver commented Apr 14, 2023

Carved from #2806, Related (and blocking): #3583

Context:

  • The model field to filter field mapping at BaseFilterSet.FILTER_DEFAULTS needs to also include the correct UI widget types in the extra for the filter mapping
    • Prototype a JSON representation of the FilterSet to see if we can get away of needing widgets at all for the new UI. JSON Schema would be a good place to start/model from
    • Serve the above representation on the UI API by some convention to the react UI, Ask for a model and get it's filters and their classes and args. We likely will need to advance it to allow for plugin views which define their own filterset (so maybe the view may need to hint that it needs a different filterset than the default one by the model).
    • Build the filterset => widget logic in the React UI, similar to what has been done here:
      def get_filterset_parameter_form_field(model, parameter, filterset=None):
      , but in React

This Story:

Addresses that first two points:

  • Serializing field definitions into a schema, something like JSONSchema. So:
# For Device's Model Fields
{
   "device_type": {
       "type": "ForeignKey",
       "to": "dcim.DeviceType",
   },
   "name": {
       "type": "CharField"
   }
   "..."
}
  • Providing an API endpoint that returns the representation for a provided content type.
@bryanculver bryanculver added this to the v2.0.0 milestone Apr 14, 2023
@bryanculver bryanculver added the type: feature Introduction of new or enhanced functionality to the application label Apr 14, 2023
@timizuoebideri1 timizuoebideri1 self-assigned this Apr 28, 2023
@timizuoebideri1 timizuoebideri1 linked a pull request Jul 25, 2023 that will close this issue
7 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature Introduction of new or enhanced functionality to the application
Projects
No open projects
Archived in project
2 participants