Skip to content

Commit

Permalink
Refine the Dependencies tab UI #138
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <tdruez@nexb.com>
  • Loading branch information
tdruez committed Jul 25, 2024
1 parent c1530b9 commit eb07b7f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
<button type="button" data-bs-toggle="tooltip" title="Edit" class="btn btn-link p-0" aria-label="Edit object"><i class="far fa-edit fa-sm"></i></button>
</span>
{% endif %}
{% if relation.package_id and relation.package.declared_dependencies.exists %}
<a href="{{ product.get_absolute_url }}?dependencies-for_package__uuid={{ relation.package.uuid }}#dependencies" class="ms-1" data-bs-toggle="tooltip" title="Dependencies" aria-label="Dependencies"><i class="fa-solid fa-share-nodes"></i></a>
{% endif %}
{% elif instance.is_active or is_product %}
<a href="{{ instance.get_absolute_url }}#hierarchy">{{ instance }}</a>
{% if relation.component_id and has_edit_productcomponent %}
Expand Down
3 changes: 2 additions & 1 deletion dje/templates/includes/filters_breadcrumbs.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% for filter in filterset.get_filters_breadcrumbs %}
<a href="?{% if filter.remove_url %}{{ filter.remove_url }}{% else %}all=true{% endif %}" class="text-decoration-none me-1">
<a href="?{% if filter.remove_url %}{{ filter.remove_url }}{% else %}all=true{% endif %}{% if fragment %}#{{ fragment }}{% endif %}"
class="text-decoration-none me-1">
<span class="badge text-bg-secondary rounded-pill ">
{{ filter.label }}: "{{ filter.value|truncatechars:40 }}" <i class="fas fa-times-circle"></i>
</span>
Expand Down
3 changes: 2 additions & 1 deletion product_portfolio/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1404,4 +1404,5 @@ def __str__(self):

@property
def package_url(self):
return self.dependency_uid.split("?")[0]
if self.dependency_uid.startswith("pkg:"):
return self.dependency_uid.split("?")[0]
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
</span>
{% endif %}
{% if relation.package_id and relation.package.declared_dependencies.exists %}
<a href="{{ product.get_absolute_url }}?dependencies-for_package__uuid={{ relation.package.uuid }}#dependencies" class="ms-1" data-bs-toggle="tooltip" title="Dependencies" aria-label="Dependencies"><i class="fa-solid fa-sitemap"></i></a>
<a href="{{ product.get_absolute_url }}?dependencies-for_package__uuid={{ relation.package.uuid }}#dependencies" class="ms-1" data-bs-toggle="tooltip" title="Dependencies" aria-label="Dependencies"><i class="fa-solid fa-share-nodes"></i></a>
{% endif %}
{% endspaceless %}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</li>
</ul>
<div class="mt-1">
{% include 'includes/filters_breadcrumbs.html' with filterset=filter_dependency only %}
{% include 'includes/filters_breadcrumbs.html' with filterset=filter_dependency fragment=tab_id only %}
</div>
</div>
<div class="col-auto">
Expand Down Expand Up @@ -119,7 +119,7 @@
{% endif %}
</td>
<td>
{{ dependency.package_url }}
{{ dependency.package_url|default_if_none:"" }}
</td>
<td>
{{ dependency.scope }}
Expand Down

0 comments on commit eb07b7f

Please sign in to comment.