Skip to content

Commit

Permalink
Add filter by package relationships availability #138
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <[email protected]>
  • Loading branch information
tdruez committed Jul 18, 2024
1 parent ce7faf7 commit 67cb308
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
9 changes: 9 additions & 0 deletions product_portfolio/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ class DependencyFilterSet(DataspacedFilterSet):
q = SearchFilter(
label=_("Search"),
search_fields=[
"dependency_uid",
"for_package__filename",
"for_package__type",
"for_package__namespace",
Expand All @@ -333,6 +334,14 @@ class DependencyFilterSet(DataspacedFilterSet):
"resolved_to_package__version",
],
)
sort = DefaultOrderingFilter(
label=_("Sort"),
fields=[
"dependency_uid",
"for_package",
"resolved_to_package",
],
)
for_package = HasRelationFilter(
widget=DropDownWidget(anchor="#dependencies"),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ help_texts.for_package }}">
{% trans 'For package' %}
</span>
{{ filter_dependency.form.for_package }}
<div class="float-end">
{{ filter_dependency.form.for_package }}
</div>
</th>
<th>
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ help_texts.resolved_to_package }}">
{% trans 'Resolved to package' %}
</span>
{{ filter_dependency.form.resolved_to_package }}
<div class="float-end">
{{ filter_dependency.form.resolved_to_package }}
</div>
</th>
<th>
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ help_texts.scope }}">
Expand All @@ -62,25 +66,33 @@
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ help_texts.is_runtime }}">
{% trans 'Runtime' %}
</span>
{{ filter_dependency.form.is_runtime }}
<div class="float-end">
{{ filter_dependency.form.is_runtime }}
</div>
</th>
<th style="min-width: 100px">
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ help_texts.is_optional }}">
{% trans 'Optional' %}
</span>
{{ filter_dependency.form.is_optional }}
<div class="float-end">
{{ filter_dependency.form.is_optional }}
</div>
</th>
<th style="min-width: 105px">
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ help_texts.is_resolved }}">
{% trans 'Resolved' %}
</span>
{{ filter_dependency.form.is_resolved }}
<div class="float-end">
{{ filter_dependency.form.is_resolved }}
</div>
</th>
<th style="min-width: 82px">
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ help_texts.is_direct }}">
{% trans 'Direct' %}
</span>
{{ filter_dependency.form.is_direct }}
<div class="float-end">
{{ filter_dependency.form.is_direct }}
</div>
</th>
</tr>
</thead>
Expand Down

0 comments on commit 67cb308

Please sign in to comment.