Skip to content

Conversation

@abhi1693
Copy link
Member

@abhi1693 abhi1693 commented May 3, 2023

Fixes: #11599

@abhi1693 abhi1693 requested a review from jeremystretch May 3, 2023 23:11
Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on!

filterset = filtersets.ContactFilterSet
table = tables.ContactTable


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check that your IDE is not configured to automatically adjust whitespace unrelated to changes being made.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran pycodestyle --ignore=W504,E501 --exclude=node_modules netbox/ and it wanted me to fix these.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's very strange, as we have the same convention in many other files. I don't get any warnings or errors when running the same command against develop.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did revert the changes for whitespace and reran the command and happened again. I'm not sure why this would be different for me.

@abhi1693 abhi1693 requested a review from jeremystretch May 9, 2023 16:18
@@ -0,0 +1,27 @@
{% extends 'generic/object.html' %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to reference the default object template at the base template, as we do for the object journal and changelog views. This ensures that any customizations to the page header remain intact across tabs. For instance, if we use the generic object.html base template, we lose the breadcrumbs under the contacts tab:

breadcrumbs1


breadcrumbs2

IMO it's fine to replicate what we do for the other views:

        # Default to using "<app>/<model>.html" as the template, if it exists. Otherwise,
        # fall back to using base.html.
        if self.base_template is None:
            self.base_template = f"{model._meta.app_label}/{model._meta.model_name}.html"

@abhi1693 abhi1693 requested a review from jeremystretch May 10, 2023 14:56
@jeremystretch jeremystretch merged commit 4eb5e90 into develop May 12, 2023
@jeremystretch jeremystretch deleted the feat/11599-contacts branch May 12, 2023 14:26
@jeremystretch
Copy link
Member

Thanks @abhi1693!

jsenecal pushed a commit to jsenecal/netbox that referenced this pull request May 18, 2023
* adds contact tabs netbox-community#11599

* fixed lint issues

* changes as per review

* changes as per review

* replaces generic object template with base template
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move contacts panel on tenant object to ViewTab

3 participants