Skip to content

Commit

Permalink
Changed what 'name' is displayed in 'Show selected signals' modal
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytrotsko committed Dec 30, 2024
1 parent beb544c commit 2b34996
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/signals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/signals/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ class Meta:
"name",
"display_name",
"member_name",
"member+_short_name",
"member_short_name",
"member_description",
"pathogen",
"signal_type",
Expand Down
5 changes: 3 additions & 2 deletions src/templates/signal_sets/signal_sets.html
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ <h2 class="accordion-header" id="flush-heading_{{ form.data_source.auto_id }}">
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();
Expand Down Expand Up @@ -550,7 +551,7 @@ <h2 class="accordion-header" id="flush-heading_{{ form.data_source.auto_id }}">
checked = checkedSignalMembers.filter((obj) => obj.data_source == signal.source && obj.signal == signal.name).length;
checked = checked ? "checked" : ""
tableMarkup += '<tr>'+
`<td><input type="checkbox" name="selectedSignal" onclick="addSelectedSignal(this)" data-signal-displayname="${signal.display_name}" data-endpoint="${signal.endpoint}" data-datasource="${signal.source}" data-signal="${signal.name}" data-time-type="${signal.time_type}" data-signal-set="${signal.signal_set_name}" ${checked}></td>`+
`<td><input type="checkbox" name="selectedSignal" onclick="addSelectedSignal(this)" data-signal-displayname='${signal.display_name}' data-endpoint="${signal.endpoint}" data-datasource="${signal.source}" data-signal="${signal.name}" data-time-type="${signal.time_type}" data-signal-set="${signal.signal_set_name}" ${checked}></td>`+
`<td>${signal.display_name}</td>`+
`<td>${signal.description}</td>`+
'<td style="width: 60%"></td>'+
Expand Down

0 comments on commit 2b34996

Please sign in to comment.