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

WIP - Add Software Notice Model and Views #408

Open
wants to merge 5 commits into
base: next3.0
Choose a base branch
from

Conversation

romanukes
Copy link

Adding “Software Notices” model. Like the Hardware Notices, this model will store additional dates for the Software Versions (End of Sale, End of SW Releases, End of Security Patches, End of Support). Optionally, a notice could store different dates per Device Type.

@bradh11 bradh11 requested review from cmsirbu, smk4664 and bradh11 and removed request for jvanderaa and progala January 22, 2025 21:47
Comment on lines +53 to +68
NavMenuButton(
link="plugins:nautobot_device_lifecycle_mgmt:softwarenotice_add",
title="Add",
icon_class="mdi mdi-plus-thick",
button_class=ButtonColorChoices.GREEN,
permissions=[
"nautobot_device_lifecycle_mgmt.add_softwarenotice",
],
),
NavMenuButton(
link="plugins:nautobot_device_lifecycle_mgmt:softwarenotice_import",
title="Import",
icon_class="mdi mdi-database-import-outline",
button_class=ButtonColorChoices.BLUE,
permissions=["nautobot_device_lifecycle_mgmt.add_softwarenotice"],
),

Choose a reason for hiding this comment

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

  1. Use NavMenuAddButton instead of a generic NavMenuButton for the "Add" button.
  2. In current core versions we don't have an Import button in most nav menu entries any more.

"""Table for SoftwareNotice list view."""

pk = ToggleColumn()
id = tables.LinkColumn(

Choose a reason for hiding this comment

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

LinkColumn is deprecated in django-tables2, use a regular Column with linkify=True instead.

@@ -0,0 +1,68 @@
{% extends 'generic/object_detail.html' %}

Choose a reason for hiding this comment

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

Can this version target Nautobot 2.4 as a minimum and use the UI Component Framework for this view instead of the below HTML?


<tr>
<td>Release Date</td>
<td>{% if object.software_version.release_date %} {{ object.software_version.release_date }} {% else %} &mdash; {% endif %}</td>

Choose a reason for hiding this comment

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

If unable to use the component framework, please at least make use of standard helper template tags like {{ object.software_version.release_date|placeholder }} and {{ object.device_type|hyperlinked_object }}

Comment on lines +187 to +200
software_version_id = django_filters.ModelMultipleChoiceFilter(
field_name="software_version",
queryset=SoftwareVersion.objects.all(),
label="Software Version",
)
software_version = django_filters.ModelMultipleChoiceFilter(
field_name="software_version", queryset=SoftwareVersion.objects.all(), label="Software Version"
)
software_version_version = django_filters.ModelMultipleChoiceFilter(
field_name="software_version__version",
queryset=SoftwareVersion.objects.all(),
to_field_name="version",
label="Software Version (String)",
)

Choose a reason for hiding this comment

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

Can/should these three be consolidated into a single filter using NaturalKeyOrPKMultipleChoiceFilter? Same comment on others below.

Comment on lines +222 to +224
end_of_support__gte = django_filters.DateFilter(field_name="end_of_support", lookup_expr="gte")
end_of_support__lte = django_filters.DateFilter(field_name="end_of_support", lookup_expr="lte")
end_of_support__isnull = django_filters.BooleanFilter(field_name="end_of_support", lookup_expr="isnull")

Choose a reason for hiding this comment

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

Are these extensions not automatically added to a DateFilter by core?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants