Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class WebAlarm {

public WebAlarm(Alarm alarm) {
collectionID = alarm.getCollectionID() == null ? "" : alarm.getCollectionID();
fileID = alarm.getFileID() == null ? "" : alarm.getFileID();
fileID = (alarm.getFileID() == null) ? "" : alarm.getFileID();
origDateTime = TimeUtils.shortDate(CalendarUtils.convertFromXMLGregorianCalendar(alarm.getOrigDateTime()));
alarmRaiser = alarm.getAlarmRaiser();
alarmCode = alarm.getAlarmCode();
Expand Down
13 changes: 9 additions & 4 deletions bitrepository-webclient/src/main/webapp/alarm-service.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
.complete {
display: none;
}

.description {
width: 50%;
}
Expand Down Expand Up @@ -112,6 +113,7 @@
<th>Date</th>
<th>Component</th>
<th>Collection</th>
<th>FileID</th>
<th>Alarm code</th>
<th>Description</th>
</tr>
Expand Down Expand Up @@ -169,6 +171,7 @@
<td>${j[i].origDateTime}</td>
<td>${j[i].alarmRaiser}</td>
<td>${nameMapper.getName(j[i].collectionID)}</td>
<td>${j[i].fileID}</td>
<td>${j[i].alarmCode}</td>
<td class="description"><p class="teaser">${nl2br(j[i].alarmText)}</p></td>
</tr>`;
Expand Down Expand Up @@ -204,9 +207,11 @@
const maxLength = 80;
$(".teaser").each(function () {
let index = $(this).closest("tr").find("td:eq(0)").text() + $(this).text();
if (!descriptionMapper.hasOwnProperty(index) || descriptionMapper[index] === "none") {
let string = $(this).html();
let string = $(this).html();

if (descriptionMapper.hasOwnProperty(index) && descriptionMapper[index] !== "none") {
$(this).empty().html(`<span class="complete" style="display: inline">${string}</span>`);
} else {
if (string.length > maxLength) {
let newString = string.substring(0, maxLength);
let removedString = string.substring(maxLength, string.length);
Expand All @@ -232,8 +237,8 @@
function getDescriptionState() {
descriptionMapper = {};
$("#alarms-table-body tr").each(function () {
let identifier = $(this).find("td:eq(0)").text() + $(this).find("td:eq(4)").text();
descriptionMapper[identifier] = $(this).find("td:eq(4)").find(".complete").css("display");
let identifier = $(this).find("td:eq(0)").text() + $(this).find("td:eq(5)").text();
descriptionMapper[identifier] = $(this).find("td:eq(5)").find(".complete").css("display");
});
}

Expand Down