From 2b3499635c6ecffbb52a05e14dcf90587c7ad7dc Mon Sep 17 00:00:00 2001 From: Dmytro Trotsko Date: Mon, 30 Dec 2024 18:19:58 +0200 Subject: [PATCH] Changed what 'name' is displayed in 'Show selected signals' modal --- src/signals/models.py | 6 ++---- src/signals/resources.py | 2 +- src/templates/signal_sets/signal_sets.html | 5 +++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/signals/models.py b/src/signals/models.py index 28ace69..1c054f2 100644 --- a/src/signals/models.py +++ b/src/signals/models.py @@ -515,12 +515,10 @@ def clean(self) -> None: @property def get_display_name(self): - if self.member_short_name: - return self.member_short_name - if self.member_name: - return self.member_name if self.display_name: return self.display_name + if self.member_name: + return self.member_name else: return self.name diff --git a/src/signals/resources.py b/src/signals/resources.py index 8d0977d..b12134c 100644 --- a/src/signals/resources.py +++ b/src/signals/resources.py @@ -330,7 +330,7 @@ class Meta: "name", "display_name", "member_name", - "member+_short_name", + "member_short_name", "member_description", "pathogen", "signal_type", diff --git a/src/templates/signal_sets/signal_sets.html b/src/templates/signal_sets/signal_sets.html index 38a12b7..3520017 100644 --- a/src/templates/signal_sets/signal_sets.html +++ b/src/templates/signal_sets/signal_sets.html @@ -414,7 +414,8 @@

signal: element.dataset.signal, time_type: element.dataset.timetype, }); - updateSelectedSignals(element.dataset.datasource, element.dataset.signal, element.dataset.signalSet); + console.log(element.dataset); + updateSelectedSignals(element.dataset.datasource, element.dataset.signalDisplayname, element.dataset.signalSet); } else { checkedSignalMembers = checkedSignalMembers.filter(signal => signal.signal !== element.dataset.signal); document.getElementById(`${element.dataset.datasource}_${element.dataset.signal}`).remove(); @@ -550,7 +551,7 @@

checked = checkedSignalMembers.filter((obj) => obj.data_source == signal.source && obj.signal == signal.name).length; checked = checked ? "checked" : "" tableMarkup += ''+ - ``+ + ``+ `${signal.display_name}`+ `${signal.description}`+ ''+