Skip to content

Commit efd3fd6

Browse files
Merge pull request #1169 from NASA-IMPACT/1116-add-a-column-to-display-affected-delta-and-curated-urls-in-the-urls-patterns-pages
Added affected curated urls count on url pattern pages
2 parents 2660973 + 909c9a6 commit efd3fd6

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

sde_collections/serializers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,14 @@ def get_tree_root(self, obj):
261261
class BasePatternSerializer(serializers.ModelSerializer):
262262
match_pattern_type_display = serializers.CharField(source="get_match_pattern_type_display", read_only=True)
263263
delta_urls_count = serializers.SerializerMethodField(read_only=True)
264+
curated_urls_count = serializers.SerializerMethodField(read_only=True)
264265

265266
def get_delta_urls_count(self, instance):
266267
return instance.delta_urls.count()
267268

269+
def get_curated_urls_count(self, instance):
270+
return instance.curated_urls.count()
271+
268272
class Meta:
269273
fields = (
270274
"id",
@@ -273,6 +277,7 @@ class Meta:
273277
"match_pattern_type",
274278
"match_pattern_type_display",
275279
"delta_urls_count",
280+
"curated_urls_count",
276281
)
277282
abstract = True
278283

sde_indexing_helper/static/js/delta_url_list.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,11 @@ function initializeDataTable() {
605605
class: "text-center whiteText",
606606
sortable: true,
607607
},
608+
{
609+
data: "curated_urls_count",
610+
class: "text-center whiteText",
611+
sortable: true,
612+
},
608613
{
609614
data: null,
610615
sortable: false,
@@ -686,6 +691,11 @@ function initializeDataTable() {
686691
class: "text-center whiteText",
687692
sortable: true,
688693
},
694+
{
695+
data: "curated_urls_count",
696+
class: "text-center whiteText",
697+
sortable: true,
698+
},
689699
{
690700
data: null,
691701
sortable: false,
@@ -766,6 +776,11 @@ function initializeDataTable() {
766776
class: "text-center whiteText",
767777
sortable: true,
768778
},
779+
{
780+
data: "curated_urls_count",
781+
class: "text-center whiteText",
782+
sortable: true,
783+
},
769784
{
770785
data: null,
771786
sortable: false,
@@ -878,6 +893,11 @@ function initializeDataTable() {
878893
class: "text-center whiteText",
879894
sortable: true,
880895
},
896+
{
897+
data: "curated_urls_count",
898+
class: "text-center whiteText",
899+
sortable: true,
900+
},
881901
{
882902
data: null,
883903
sortable: false,
@@ -979,6 +999,11 @@ var division_patterns_table = $("#division_patterns_table").DataTable({
979999
class: "text-center whiteText",
9801000
sortable: true,
9811001
},
1002+
{
1003+
data: "curated_urls_count",
1004+
class: "text-center whiteText",
1005+
sortable: true,
1006+
},
9821007
{
9831008
data: null,
9841009
sortable: false,

sde_indexing_helper/templates/sde_collections/delta_urls_list.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ <h3 class="whiteText deltaTitle">
231231
<th scope="col" class="text-center col-1"><strong>Match Pattern Type</strong></th>
232232
<th scope="col" class="text-center col-1"><strong>Reason</strong></th>
233233
<th scope="col" class="text-center col-1"><strong>Affected Delta URLs</strong></th>
234+
<th scope="col" class="text-center col-1"><strong>Affected Curated URLs</strong></th>
234235
<th scope="col" class="text-center col-1"><strong>Actions</strong></th>
235236
<th scope="col" class="text-center col-1"><strong>ID</strong></th>
236237
</tr>
@@ -263,6 +264,9 @@ <h3 class="whiteText deltaTitle">
263264
<th scope="col" class="text-center col-1">
264265
<strong>Affected Delta URLs</strong>
265266
</th>
267+
<th scope="col" class="text-center col-1">
268+
<strong>Affected Curated URLs</strong>
269+
</th>
266270
<th scope="col" class="text-center col-1">
267271
<strong>Actions</strong>
268272
</th>
@@ -300,6 +304,9 @@ <h3 class="whiteText deltaTitle">
300304
<th scope="col" class="text-center col-1">
301305
<strong>Affected Delta URLs</strong>
302306
</th>
307+
<th scope="col" class="text-center col-1">
308+
<strong>Affected Curated URLs</strong>
309+
</th>
303310
<th scope="col" class="text-center col-1">
304311
<strong>Actions</strong>
305312
</th>
@@ -337,6 +344,9 @@ <h3 class="whiteText deltaTitle">
337344
<th scope="col" class="text-center col-1">
338345
<strong>Affected Delta URLs</strong>
339346
</th>
347+
<th scope="col" class="text-center col-1">
348+
<strong>Affected Curated URLs</strong>
349+
</th>
340350
<th scope="col" class="text-center col-1">
341351
<strong>Actions</strong>
342352
</th>
@@ -372,6 +382,7 @@ <h3 class="whiteText deltaTitle">
372382
<th scope="col" class="text-center col-1"><strong>Match Pattern Type</strong></th>
373383
<th scope="col" class="text-center col-1"><strong>Division</strong></th>
374384
<th scope="col" class="text-center col-1"><strong>Affected Delta URLs</strong></th>
385+
<th scope="col" class="text-center col-1"><strong>Affected Curated URLs</strong></th>
375386
<th scope="col" class="text-center col-1"><strong>Actions</strong></th>
376387
<th scope="col" class="text-center col-1"><strong>ID</strong></th>
377388
</tr>

0 commit comments

Comments
 (0)