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

477 prepare for netbox 4.0 #495

Merged
merged 9 commits into from
Jun 5, 2024
Merged

Conversation

mattieserver
Copy link
Collaborator

No description provided.

@mattieserver mattieserver self-assigned this May 10, 2024
@vishnubraj
Copy link

Hello, @mattieserver @dreng is this completed? When will this get released?
is there any way I can help get this done?

@Creepios
Copy link

Hi, I have found a bug. The error always appears when you want to display the topology. Following error in browser console:
image

@dreng
Copy link
Collaborator

dreng commented May 24, 2024

is there any way I can help get this done?

Oh yes! Just have a look at the checklist in issue #477. If you like to contribute, go for it!

* Re-add overriding of default_renderer

Signed-off-by: Iain Buclaw <ibuclaw@gdcproject.org>

* Restore i18n of field names

Signed-off-by: Iain Buclaw <ibuclaw@gdcproject.org>

* Remove unnecessary FieldSets

Signed-off-by: Iain Buclaw <ibuclaw@gdcproject.org>

* Remove trailing whitespaces in forms.py

Signed-off-by: Iain Buclaw <ibuclaw@gdcproject.org>

* Fix error in resizeCanvas

Signed-off-by: Iain Buclaw <ibuclaw@gdcproject.org>

* Remove btn-sm class from buttons

Signed-off-by: Iain Buclaw <ibuclaw@gdcproject.org>

* Use htmx_partial instead of request.htmx

Signed-off-by: Iain Buclaw <ibuclaw@gdcproject.org>

---------

Signed-off-by: Iain Buclaw <ibuclaw@gdcproject.org>
@mattieserver
Copy link
Collaborator Author

mattieserver commented May 25, 2024

The search functionality does not work like it should.

When default_renderer = forms.renderers.DjangoTemplates() is not in the forms.py the custom filters are not applied when pressing the search option.
Example: I have the show_unconnected & show_cables on in the Individual Options, when i go to the topology i see the filters are active but i still have to press the search button to show the graph. When i click the search button the 2 options are gone and thus no graph is shown. If i select other options from netbox itself like site, region, those are then present after clicking search.

If we do not remove default_renderer = forms.renderers.DjangoTemplates(), the search button looks like this:
image
Other fields that are also broken:
image

@mattieserver mattieserver added the status: revisions needed This issue requires additional information to be actionable label May 25, 2024
@ibuclaw
Copy link
Contributor

ibuclaw commented May 25, 2024

The search functionality does not work like it should.

When default_renderer = forms.renderers.DjangoTemplates() is not in the forms.py the custom filters are not applied when pressing the search option. Example: I have the show_unconnected & show_cables on in the Individual Options, when i go to the topology i see the filters are active but i still have to press the search button to show the graph. When i click the search button the 2 options are gone and thus no graph is shown. If i select other options from netbox itself like site, region, those are then present after clicking search.

If we do not remove default_renderer = forms.renderers.DjangoTemplates(), the search button looks like this

Also the checkbox buttons are all over the place.

I've raised it as a bug in upstream (netbox-community/netbox#16293) - it's obvious what the cause is, and you can sort of mitigate it by turning on the (experimental) HTMX navigation feature in user preferences.

I'm opined to think that the appropriate fix would be for upstream to add the hidden input only if HTMX is enabled, but I don't have a good sense of how these templates piece together.

@ibuclaw
Copy link
Contributor

ibuclaw commented May 25, 2024

I'm opined to think that the appropriate fix would be for upstream to add the hidden input only if HTMX is enabled, but I don't have a good sense of how these templates piece together.

Otherwise these will have to be replaced with a NullBooleanField with a binary None/True choice, along with all the logic fix-ups that come with it.

@natm
Copy link
Member

natm commented Jun 3, 2024

@ibuclaw
Copy link
Contributor

ibuclaw commented Jun 3, 2024

Otherwise these will have to be replaced with a NullBooleanField with a binary None/True choice, along with all the logic fix-ups that come with it.

The only response I've gotten from upstream is that the use of BooleanField in searches being broken is not their problem. So migrating to NullBooleanField seems to be the only way out of this.

@dreng
Copy link
Collaborator

dreng commented Jun 3, 2024

The only response I've gotten from upstream is that the use of BooleanField in searches being broken is not their problem.

Very disappointing. Anyway, thanks for trying.

@mattieserver
Copy link
Collaborator Author

Yeah, with NullBooleanField it seems to work

@mattieserver mattieserver merged commit 2895294 into develop Jun 5, 2024
@mattieserver mattieserver deleted the 477_prepare_for_netbox_4.0 branch June 26, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: revisions needed This issue requires additional information to be actionable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants