File tree 6 files changed +75
-2
lines changed
6 files changed +75
-2
lines changed Original file line number Diff line number Diff line change @@ -1980,6 +1980,12 @@ class DiscoveredDependency(
1980
1980
),
1981
1981
)
1982
1982
1983
+ def __str__ (self ):
1984
+ return self .purl or str (self .uuid )
1985
+
1986
+ def get_absolute_url (self ):
1987
+ return reverse ("dependency_detail" , args = [self .project_id , self .pk ])
1988
+
1983
1989
@classmethod
1984
1990
def create_from_data (cls , project , dependency_data ):
1985
1991
"""
Original file line number Diff line number Diff line change
1
+ {% extends "scanpipe/base.html" %}
2
+ {% load static humanize %}
3
+
4
+ {% block title %}ScanCode.io: {{ project.name }} - {{ object.name }}{% endblock %}
5
+
6
+ {% block content %}
7
+ < div class ="container is-max-desktop ">
8
+ {% include 'scanpipe/includes/navbar_header.html' %}
9
+ < div class ="mx-5 mb-2 "> {% include 'scanpipe/includes/messages.html' %}</ div >
10
+
11
+ < section class ="mx-5 mb-3 ">
12
+ < nav class ="breadcrumb is-medium mb-1 " aria-label ="breadcrumbs ">
13
+ < ul >
14
+ < li > < a href ="{% url 'project_list' %} "> Projects</ a > </ li >
15
+ < li > < a href ="{{ project.get_absolute_url }} "> {{ project.name }}</ a > </ li >
16
+ < li > < a href ="{% url 'project_dependencies' project.uuid %} "> Discovered Dependencies</ a > </ li >
17
+ </ ul >
18
+ </ nav >
19
+ < div class ="tags has-addons my-3 ">
20
+ < span class ="tag is-dark "> Package URL</ span >
21
+ < span class ="tag is-info "> {{ object }}</ span >
22
+ </ div >
23
+ </ section >
24
+
25
+ < div class ="tabs is-boxed mx-5 ">
26
+ < ul >
27
+ < li class ="is-active ">
28
+ < a data-target ="tab-details ">
29
+ < span class ="icon is-small "> < i class ="fas fa-info-circle "> </ i > </ span >
30
+ < span > Details</ span >
31
+ </ a >
32
+ </ li >
33
+ </ ul >
34
+ </ div >
35
+
36
+ < section id ="tab-details " class ="tab-content is-active mx-5 ">
37
+ < dl >
38
+ {% for field, value in dependency_data.items %}
39
+ < dt class ="has-text-weight-semibold ">
40
+ {{ field }}
41
+ </ dt >
42
+ < dd class ="mb-4 ">
43
+ < pre > {{ value|default_if_none:'' }}</ pre >
44
+ </ dd >
45
+ {% endfor %}
46
+ </ dl >
47
+ </ section >
48
+ </ div >
49
+ {% endblock %}
Original file line number Diff line number Diff line change 34
34
{% for dependency in object_list %}
35
35
< tr class ="break-word ">
36
36
< td style ="min-width: 500px; " title ="{{ dependency.purl }} ">
37
- {{ dependency.purl }}
37
+ < a href =" {{ dependency.get_absolute_url }} " > {{ dependency. purl }}</ a >
38
38
</ td >
39
39
< td >
40
40
{{ dependency.extracted_requirement }}
Original file line number Diff line number Diff line change 27
27
< tbody >
28
28
{% for package in object_list %}
29
29
< tr class ="break-word ">
30
- < td style ="min-width: 500px; " title ="{{ package.package_uid }} ">
30
+ < td style ="min-width: 500px; " title ="{{ package.package_url }} ">
31
31
< a href ="{{ package.get_absolute_url }} "> {{ package.package_url }}</ a >
32
32
</ td >
33
33
< td style ="min-width: 300px; max-width: 400px; ">
Original file line number Diff line number Diff line change 41
41
views .DiscoveredPackageDetailsView .as_view (),
42
42
name = "package_detail" ,
43
43
),
44
+ path (
45
+ "project/<uuid:uuid>/dependencies/<int:pk>/" ,
46
+ views .DiscoveredDependencyDetailsView .as_view (),
47
+ name = "dependency_detail" ,
48
+ ),
44
49
path (
45
50
"project/<uuid:uuid>/resources/" ,
46
51
views .CodebaseResourceListView .as_view (),
Original file line number Diff line number Diff line change 43
43
44
44
from scancodeio .auth import ConditionalLoginRequired
45
45
from scancodeio .auth import conditional_login_required
46
+ from scanpipe .api .serializers import DiscoveredDependencySerializer
46
47
from scanpipe .api .serializers import DiscoveredPackageSerializer
47
48
from scanpipe .filters import DependencyFilterSet
48
49
from scanpipe .filters import ErrorFilterSet
@@ -702,6 +703,18 @@ def get_context_data(self, **kwargs):
702
703
return context
703
704
704
705
706
+ class DiscoveredDependencyDetailsView (
707
+ ConditionalLoginRequired , ProjectRelatedViewMixin , generic .DetailView
708
+ ):
709
+ model = DiscoveredDependency
710
+ template_name = "scanpipe/dependency_detail.html"
711
+
712
+ def get_context_data (self , ** kwargs ):
713
+ context = super ().get_context_data (** kwargs )
714
+ context ["dependency_data" ] = DiscoveredDependencySerializer (self .object ).data
715
+ return context
716
+
717
+
705
718
@conditional_login_required
706
719
def run_detail_view (request , uuid ):
707
720
template = "scanpipe/includes/run_modal_content.html"
You can’t perform that action at this time.
0 commit comments