@@ -75,11 +75,17 @@ class EndOfLifeDependencyAdmin(DefaultModelAdmin, DefaultFilterMixin, EndOfLifeD
7575 "no_support" ,
7676 "is_discontinued" ,
7777 "is_lts" ,
78- "link " ,
78+ "get_link " ,
7979 ]
8080 list_filter = ["product" , EndOfLifeDependencyBoolFilter , LTSFilter , DiscontinuedFilter , SupportFilter ]
8181 search_fields = ["product" ]
8282
83+ @admin .display (description = "Link" )
84+ def get_link (self , obj ):
85+ if obj .link :
86+ return format_html (f'<a target="_blank" href="{ obj .link } ">{ obj .link } </a>' )
87+ return ""
88+
8389
8490class SCADependencyForm (forms .ModelForm ):
8591 class Meta :
@@ -248,7 +254,16 @@ class SCAProjectAdmin(DefaultModelAdmin):
248254 "git_source" ,
249255 ("git_source__apps" , RelatedFieldAjaxListFilter ),
250256 ]
251- search_fields = ["name" , "purl" , "depends_on__name" , "depends_on__purl" , "git_source__repo_url" ]
257+ search_fields = [
258+ "name" ,
259+ "purl" ,
260+ "depends_on__name" ,
261+ "depends_on__purl" ,
262+ "git_source__repo_url" ,
263+ "dependencies_list" ,
264+ ]
265+
266+ readonly_fields = []
252267
253268 def change_view (self , request , object_id , form_url = "" , extra_context = None ):
254269 extra_context = extra_context or {}
@@ -276,7 +291,11 @@ def change_view(self, request, object_id, form_url="", extra_context=None):
276291
277292 vulnerabilities = self .get_vulnerabilities (obj )
278293 # set fixed_in as True by default if not passed in the request
279- if "fixed_in" not in request .GET :
294+ if (
295+ "fixed_in" not in request .GET
296+ and int (request .GET .get ("finding_type" , models .SCAFinding .FindingType .VULN ))
297+ != models .SCAFinding .FindingType .EOL
298+ ):
280299 request .GET = request .GET .copy ()
281300 request .GET ["fixed_in" ] = "true"
282301 extra_context ["vulns_filter" ] = SCAFindingFilter (request .GET , queryset = vulnerabilities )
@@ -372,7 +391,7 @@ def get_git_source(self, obj):
372391 def get_sbom_link (self , obj ):
373392 if obj .sbom_uuid :
374393 return format_html (
375- '<a href="{}" target="_blank"> Download sbom json </a>' ,
394+ '<a href="{}" target="_blank" title=" Download SBOM JSON" aria-label="Download SBOM JSON"><span class="material-symbols-outlined text-lg">download</span> </a>' ,
376395 reverse ("sca:download_sbom_as_json" , args = [obj .sbom_uuid , obj .name ]),
377396 )
378397
0 commit comments