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

v1.3: JobResult filter form in UI points to wrong endpoint for "job" field. #1562

Closed
jathanism opened this issue Mar 29, 2022 · 3 comments · Fixed by #1591
Closed

v1.3: JobResult filter form in UI points to wrong endpoint for "job" field. #1562

jathanism opened this issue Mar 29, 2022 · 3 comments · Fixed by #1591
Assignees
Labels
type: bug Something isn't working as expected
Milestone

Comments

@jathanism
Copy link
Contributor

Environment

  • Python version: 3.9.2
  • Nautobot version: 1.3.0-beta.1

Steps to Reproduce

  1. Run some jobs so you have job results
  2. Navigate to Job Results list view in UI
  3. Click "Job" search field

Expected Behavior

There should be a drop-down of Job models to use for filtering.

Observed Behavior

Job_Results_-_Nautobot

The field is broken. Looks like JobResultFilterForm.job_model is pointing to a defunct endpoint (/api/extras/job-models/) and needs to be corrected.

@jathanism jathanism added type: bug Something isn't working as expected status: accepted labels Mar 29, 2022
@glennmatthews
Copy link
Contributor

Looks like this was a miss in #1521. Mea culpa!

@glennmatthews
Copy link
Contributor

This will be a little non-trivial to implement since the api/extras/jobs/ API endpoint is now versioned, and this dropdown should populate based on the 1.3 (non-default) version of the API. Most likely the fix here will be to:

  • extend nautobot.utilities.forms.widgets.APISelect (and implicitly APISelectMultiple) to include an api_version optional constructor argument that if set, sets the data-api-version attribute on the widget
  • extend nautobot/project-static/js/forms.js to look for the data-api-version attribute on the widget and set the Accept header version appropriately if present
  • modify JobResultFilterForm so that it creates its APISelectMultiple widget with the appropriate api_version="1.3" parameter.
  • Document this new feature/pattern in comments and the Nautobot developer documentation.

@bryanculver
Copy link
Member

Closed with #1591

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants