Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI - Misc Fixes 5 #172

Merged
merged 4 commits into from
Aug 10, 2023
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
4 changes: 4 additions & 0 deletions cws-ui/src/main/webapp/css/history.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,8 @@ summary {

#logDataNest {
font-size: 95%;
}

.procInstId-cell {
width: 300px;
}
99 changes: 62 additions & 37 deletions install/cws-ui/history.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
var downloadValue = $(this).attr('data-downloadValue');
var downloadName = $(this).attr('data-downloadName');
downloadFile(downloadValue, downloadName);
$(this).attr('aria-label', 'Downloaded!');
setTimeout(function () {
$('.copy').attr('aria-label', 'Download');
}, 2000);
return;
}
var copyValue = $(this).attr('data-copyValue');
Expand Down Expand Up @@ -234,7 +238,7 @@
}

$('#procDefKey').html(data.procDefKey);
$('#procInstId').html(data.procInstId);
$('#procInstId').html(`<div class="procInstId-cell">` + data.procInstId + `</div>`);
var momentStart;
var momentEnd;
if (data.startTime !== null && data.startTime !== undefined && data.startTime !== "") {
Expand All @@ -249,27 +253,8 @@
} else {
$('#procEndTime').html("");
}
if (momentStart !== undefined && momentEnd !== undefined) {
var procDuration = moment.duration(momentEnd.diff(momentStart));
var procDurationStr = ""
if (procDuration.days() > 0) {
procDurationStr += procDuration.days() + "d ";
}
if (procDuration.hours() > 0) {
procDurationStr += procDuration.hours() + "h ";
}
if (procDuration.minutes() > 0) {
procDurationStr += procDuration.minutes() + "m ";
}
if (procDuration.seconds() > 0) {
procDurationStr += procDuration.seconds() + "s ";
}
if (procDuration.milliseconds() > 0) {
procDurationStr += procDuration.milliseconds() + "ms ";
}
$('#procDuration').html(procDurationStr);
} else {
$('#procDuration').html("N/A");
if (data.duration !== 0) {
$('#procDuration').html(convertMillis(data.duration));
}

$.ajax({
Expand Down Expand Up @@ -640,7 +625,7 @@
+ `</span></div></div>`;
} else if (key.includes("{")) {
var fileName = tempKey.substring(tempKey.indexOf("{") + 1, tempKey.indexOf("}"));
tempKey = tempKey.substring(0, tempKey.indexOf(" {"));
tempKey = tempKey.substring(tempKey.indexOf("]") + 1, tempKey.indexOf(" {"));
temp = `<div class="proc-var-flex-main">`
+ `<div class="proc-var-flex-main-sub-1">`
+ `<div class="proc-var-flex-main-sub-2"><b>` + tempKey + `: </b></div>`
Expand Down Expand Up @@ -729,7 +714,7 @@
+ `</span></div></div>`;
} else if (tempKey.includes("{")) {
var fileName = tempKey.substring(tempKey.indexOf("{") + 1, tempKey.indexOf("}"));
tempKey = tempKey.substring(0, tempKey.indexOf(" {"));
tempKey = tempKey.substring(tempKey.indexOf("]")+1, tempKey.indexOf(" {"));
temp = `<div class="proc-var-flex-main">`
+ `<div class="proc-var-flex-main-sub-1">`
+ `<div class="proc-var-flex-main-sub-2"><b>` + tempKey + `: </b></div>`
Expand Down Expand Up @@ -801,7 +786,7 @@
+ `</span></div></div>`;
} else if (tempKey.includes("{")) {
var fileName = tempKey.substring(tempKey.indexOf("{") + 1, tempKey.indexOf("}"));
tempKey = tempKey.substring(0, tempKey.indexOf(" {"));
tempKey = tempKey.substring(tempKey.indexOf("]")+1, tempKey.indexOf(" {"));
temp = `<div class="proc-var-flex-main">`
+ `<div class="proc-var-flex-main-sub-1">`
+ `<div class="proc-var-flex-main-sub-2"><b>` + tempKey + `: </b></div>`
Expand Down Expand Up @@ -856,23 +841,63 @@
var tempVal = value;
var tempKey = key.substring(7);
if (tempKey.includes("(file, image")) {
tempKey = tempKey.substring(0, tempKey.indexOf(" ("));
temp = `<div class="proc-var-flex-main"><div style="align-self: start"><b>` + tempKey + `: </b><img class="grow historyLimitSize" src="` + tempVal + `"></div><div class="proc-var-flex-btn"><span aria-label="Copy to clipboard" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="true" data-copyValue="` + tempVal + `" onClick=''><img src="images/copy.svg" class="copy-icon clipboard"></span></div></div>`;
tempKey = tempKey.replace("file, ", "");
temp = `<div class="proc-var-flex-main">`
+ `<div class="proc-var-flex-main-sub-1">`
+ `<div class="proc-var-flex-main-sub-2"><b>` + tempKey + `: </b></div>`
+ `<div class="proc-var-flex-main-sub-3">`
+ `<img class="grow historyLimitSize" src='` + tempVal + `'></div></div>`
+ `<div class="proc-var-flex-btn">`
+ `<span aria-label="Copy to clipboard" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="true" data-copyValue="` + tempVal + `" onClick=''>`
+ `<img src="images/copy.svg" class="copy-icon clipboard">`
+ `</span></div></div>`;
} else if (tempKey.includes("{")) {
var fileName = tempKey.substring(tempKey.indexOf("{") + 1, tempKey.indexOf("}"));
tempKey = tempKey.substring(0, tempKey.indexOf(" {"));
temp = `<div class="proc-var-flex-main"><div style="align-self: start"><b>` + tempKey + `: </b><i>` + fileName + `</i></div><div class="proc-var-flex-btn"><span aria-label="Download" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="false" data-downloadValue="` + tempVal + `" data-downloadName="` + fileName + `" onClick=''><img src="images/download.svg" class="copy-icon clipboard"></span></div></div>`;
tempKey = tempKey.substring(tempKey.indexOf("]")+1, tempKey.indexOf(" {"));
temp = `<div class="proc-var-flex-main">`
+ `<div class="proc-var-flex-main-sub-1">`
+ `<div class="proc-var-flex-main-sub-2"><b>` + tempKey + `: </b></div>`
+ `<div class="proc-var-flex-main-sub-3">`
+ `<i>` + fileName + `</i></div></div>`
+ `<div class="proc-var-flex-btn">`
+ `<span aria-label="Download" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="false" data-downloadValue="` + tempVal + `" data-downloadName="` + fileName + `" onClick=''>`
+ `<img src="images/download.svg" class="copy-icon clipboard">`
+ `</span></div></div>`;
} else if (checkforImageURL(tempVal)) {
tempKey = tempKey.substring(0, tempKey.indexOf(" ("));
temp = `<div class="proc-var-flex-main"><div style="align-self: start"><b>` + tempKey + `: </b><img class="grow historyLimitSize" src="` + tempVal + `"></div><div class="proc-var-flex-btn"><span aria-label="Copy to clipboard" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="false" data-copyValue="` + tempVal + `" onClick=''><img src="images/copy.svg" class="copy-icon clipboard"></span></div></div>`;
tempKey = tempKey.replace("string", "url");
temp = `<div class="proc-var-flex-main">`
+ `<div class="proc-var-flex-main-sub-1">`
+ `<div class="proc-var-flex-main-sub-2">`
+ `<b>` + tempKey + `: </b></div>`
+ `<div class="proc-var-flex-main-sub-3">`
+ `<img class="grow historyLimitSize" src="` + tempVal + `"></div></div>`
+ `<div class="proc-var-flex-btn">`
+ `<span aria-label="Copy to clipboard" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="false" data-copyValue="` + tempVal + `" onClick=''>`
+ `<img src="images/copy.svg" class="copy-icon clipboard">`
+ `</span></div></div>`;
} else if (checkForURL(tempVal)) {
tempKey = tempKey.substring(0, tempKey.indexOf(" ("));
temp = `<div class="proc-var-flex-main"><div style="align-self: start"><b>` + tempKey + `: </b><a href="` + tempVal + `">` + tempVal + `</a></div><div class="proc-var-flex-btn"><span aria-label="Copy to clipboard" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="true" data-copyValue="` + tempVal + `" onClick=''><img src="images/copy.svg" class="copy-icon clipboard"></span></div></div>`;
tempKey = tempKey.replace("string", "url");
temp = `<div class="proc-var-flex-main">`
+ `<div class="proc-var-flex-main-sub-1">`
+ `<div class="proc-var-flex-main-sub-2">`
+ `<b>` + tempKey + `: </b></div>`
+ `<div class="proc-var-flex-main-sub-3">`
+ `<a href="` + tempVal + `">` + tempVal + `</a></div></div>`
+ `<div class="proc-var-flex-btn">`
+ `<span aria-label="Copy to clipboard" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="true" data-copyValue="` + tempVal + `" onClick=''>`
+ `<img src="images/copy.svg" class="copy-icon clipboard">`
+ `</span></div></div>`;
} else {
if (tempKey.includes("(string)")) {
tempKey = tempKey.substring(0, tempKey.indexOf(" ("));
}
temp = `<div class="proc-var-flex-main"><div style="align-self: start"><b>` + tempKey + `: </b>` + tempVal + `</a></div><div class="proc-var-flex-btn"><span aria-label="Copy to clipboard" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="true" data-copyValue="` + tempVal + `" onClick=''><img src="images/copy.svg" class="copy-icon clipboard"></span></div></div>`;
temp = `<div class="proc-var-flex-main">`
+ `<div class="proc-var-flex-main-sub-1">`
+ `<div class="proc-var-flex-main-sub-2">`
+ `<b>` + tempKey + `: </b></div>`
+ `<div class="proc-var-flex-main-sub-3">`
+ tempVal + `</div></div>`
+ `<div class="proc-var-flex-btn">`
+ `<span aria-label="Copy to clipboard" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="true" data-copyValue="` + tempVal + `" onClick=''>`
+ `<img src="images/copy.svg" class="copy-icon clipboard">`
+ `</span></div></div>`;
}
output = output + temp;
}
Expand Down
3 changes: 0 additions & 3 deletions install/cws-ui/processes.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -1652,9 +1652,6 @@
$.ajax({
type: "POST",
url: "/${base}/rest/processes/markResolved",
Accept: "application/json",
contentType: "application/json",
dataType: "json",
data: JSON.stringify(getSelectedRowUuids())
})
.done(function (msg) {
Expand Down