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

Page title + favicon in API pages #6834

Closed
sdktr opened this issue Jul 28, 2021 · 6 comments
Closed

Page title + favicon in API pages #6834

sdktr opened this issue Jul 28, 2021 · 6 comments
Assignees
Labels
beta Concerns a bug/feature in a beta release status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@sdktr
Copy link
Contributor

sdktr commented Jul 28, 2021

NetBox version

v3.0-beta1

Feature type

Change to existing functionality

Proposed functionality

Add a favicon to both GraphiQL workspace and REST API. Plus add a page title to the GraphiQL playground.

Use case

When testing Netbox API calls the tabs in a browser do not stand out very recognizable. The page title for the REST API pages reflects the path one is on. The GraphiQL playground has no title so it renders the full query URL in the tab title.

Database changes

N/A

External dependencies

N/A

@sdktr sdktr added the type: feature Introduction of new functionality to the application label Jul 28, 2021
@ryanmerolle ryanmerolle added the beta Concerns a bug/feature in a beta release label Jul 28, 2021
@jeremystretch
Copy link
Member

@sdktr want to try taking this on? I'm not really sure how involved it would be.

@jeremystretch jeremystretch added the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation label Jul 29, 2021
@jeremystretch
Copy link
Member

While we're at it we should see if it's feasible to serve the GraphiQL UI's static resources locally (as opposed to via a CDN), to better support isolated NetBox deployments.

@kkthxbye-code
Copy link
Contributor

kkthxbye-code commented Jul 29, 2021

@jeremystretch - I'm not sure there is a clean solution for that other than creating a pull request for graphene-django or forking it. Maybe it's possible to overwrite the path to the template and having a local version with the changes (local resources, favicon and title).

https://github.com/graphql-python/graphene-django/blob/e7f7d8da07ba1020f9916153f17e97b0ec037712/graphene_django/views.py#L58

But from my quick look any solution (including the above) would require monkey patching which seems like a bad idea.

@jeremystretch
Copy link
Member

We're already subclassing the stock GraphQLView, so it should be pretty easy to swap in our own template. The template actually looks pretty minimal; should be easy to tweak. We just need to ensure we keep resources in sync for future releases; that will be the more tricky part.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Jul 29, 2021
@jeremystretch jeremystretch self-assigned this Jul 29, 2021
@jeremystretch
Copy link
Member

Ok, I've got the title and favicon sorted in #6847, and we should be able to bundle the necessary static resources using our existing workflow. Just need to sync with @thatmattlove to confirm.

@jeremystretch
Copy link
Member

#6847 addressed the original issues above. I've opened #6855 to cover serving GraphiQL's static assets locally.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beta Concerns a bug/feature in a beta release status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

4 participants