Skip to content

Commit adbfa3b

Browse files
authored
UI - Misc Fixes 5 (#172)
* Revert duration * Update minimum width for process details table * Fix output variable not formatting correctly * Fix resolving bug
1 parent bb39410 commit adbfa3b

File tree

3 files changed

+66
-40
lines changed

3 files changed

+66
-40
lines changed

cws-ui/src/main/webapp/css/history.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,8 @@ summary {
9393

9494
#logDataNest {
9595
font-size: 95%;
96+
}
97+
98+
.procInstId-cell {
99+
width: 300px;
96100
}

install/cws-ui/history.ftl

Lines changed: 62 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
var downloadValue = $(this).attr('data-downloadValue');
6060
var downloadName = $(this).attr('data-downloadName');
6161
downloadFile(downloadValue, downloadName);
62+
$(this).attr('aria-label', 'Downloaded!');
63+
setTimeout(function () {
64+
$('.copy').attr('aria-label', 'Download');
65+
}, 2000);
6266
return;
6367
}
6468
var copyValue = $(this).attr('data-copyValue');
@@ -234,7 +238,7 @@
234238
}
235239
236240
$('#procDefKey').html(data.procDefKey);
237-
$('#procInstId').html(data.procInstId);
241+
$('#procInstId').html(`<div class="procInstId-cell">` + data.procInstId + `</div>`);
238242
var momentStart;
239243
var momentEnd;
240244
if (data.startTime !== null && data.startTime !== undefined && data.startTime !== "") {
@@ -249,27 +253,8 @@
249253
} else {
250254
$('#procEndTime').html("");
251255
}
252-
if (momentStart !== undefined && momentEnd !== undefined) {
253-
var procDuration = moment.duration(momentEnd.diff(momentStart));
254-
var procDurationStr = ""
255-
if (procDuration.days() > 0) {
256-
procDurationStr += procDuration.days() + "d ";
257-
}
258-
if (procDuration.hours() > 0) {
259-
procDurationStr += procDuration.hours() + "h ";
260-
}
261-
if (procDuration.minutes() > 0) {
262-
procDurationStr += procDuration.minutes() + "m ";
263-
}
264-
if (procDuration.seconds() > 0) {
265-
procDurationStr += procDuration.seconds() + "s ";
266-
}
267-
if (procDuration.milliseconds() > 0) {
268-
procDurationStr += procDuration.milliseconds() + "ms ";
269-
}
270-
$('#procDuration').html(procDurationStr);
271-
} else {
272-
$('#procDuration').html("N/A");
256+
if (data.duration !== 0) {
257+
$('#procDuration').html(convertMillis(data.duration));
273258
}
274259
275260
$.ajax({
@@ -640,7 +625,7 @@
640625
+ `</span></div></div>`;
641626
} else if (key.includes("{")) {
642627
var fileName = tempKey.substring(tempKey.indexOf("{") + 1, tempKey.indexOf("}"));
643-
tempKey = tempKey.substring(0, tempKey.indexOf(" {"));
628+
tempKey = tempKey.substring(tempKey.indexOf("]") + 1, tempKey.indexOf(" {"));
644629
temp = `<div class="proc-var-flex-main">`
645630
+ `<div class="proc-var-flex-main-sub-1">`
646631
+ `<div class="proc-var-flex-main-sub-2"><b>` + tempKey + `: </b></div>`
@@ -729,7 +714,7 @@
729714
+ `</span></div></div>`;
730715
} else if (tempKey.includes("{")) {
731716
var fileName = tempKey.substring(tempKey.indexOf("{") + 1, tempKey.indexOf("}"));
732-
tempKey = tempKey.substring(0, tempKey.indexOf(" {"));
717+
tempKey = tempKey.substring(tempKey.indexOf("]")+1, tempKey.indexOf(" {"));
733718
temp = `<div class="proc-var-flex-main">`
734719
+ `<div class="proc-var-flex-main-sub-1">`
735720
+ `<div class="proc-var-flex-main-sub-2"><b>` + tempKey + `: </b></div>`
@@ -801,7 +786,7 @@
801786
+ `</span></div></div>`;
802787
} else if (tempKey.includes("{")) {
803788
var fileName = tempKey.substring(tempKey.indexOf("{") + 1, tempKey.indexOf("}"));
804-
tempKey = tempKey.substring(0, tempKey.indexOf(" {"));
789+
tempKey = tempKey.substring(tempKey.indexOf("]")+1, tempKey.indexOf(" {"));
805790
temp = `<div class="proc-var-flex-main">`
806791
+ `<div class="proc-var-flex-main-sub-1">`
807792
+ `<div class="proc-var-flex-main-sub-2"><b>` + tempKey + `: </b></div>`
@@ -856,23 +841,63 @@
856841
var tempVal = value;
857842
var tempKey = key.substring(7);
858843
if (tempKey.includes("(file, image")) {
859-
tempKey = tempKey.substring(0, tempKey.indexOf(" ("));
860-
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>`;
844+
tempKey = tempKey.replace("file, ", "");
845+
temp = `<div class="proc-var-flex-main">`
846+
+ `<div class="proc-var-flex-main-sub-1">`
847+
+ `<div class="proc-var-flex-main-sub-2"><b>` + tempKey + `: </b></div>`
848+
+ `<div class="proc-var-flex-main-sub-3">`
849+
+ `<img class="grow historyLimitSize" src='` + tempVal + `'></div></div>`
850+
+ `<div class="proc-var-flex-btn">`
851+
+ `<span aria-label="Copy to clipboard" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="true" data-copyValue="` + tempVal + `" onClick=''>`
852+
+ `<img src="images/copy.svg" class="copy-icon clipboard">`
853+
+ `</span></div></div>`;
861854
} else if (tempKey.includes("{")) {
862855
var fileName = tempKey.substring(tempKey.indexOf("{") + 1, tempKey.indexOf("}"));
863-
tempKey = tempKey.substring(0, tempKey.indexOf(" {"));
864-
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>`;
856+
tempKey = tempKey.substring(tempKey.indexOf("]")+1, tempKey.indexOf(" {"));
857+
temp = `<div class="proc-var-flex-main">`
858+
+ `<div class="proc-var-flex-main-sub-1">`
859+
+ `<div class="proc-var-flex-main-sub-2"><b>` + tempKey + `: </b></div>`
860+
+ `<div class="proc-var-flex-main-sub-3">`
861+
+ `<i>` + fileName + `</i></div></div>`
862+
+ `<div class="proc-var-flex-btn">`
863+
+ `<span aria-label="Download" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="false" data-downloadValue="` + tempVal + `" data-downloadName="` + fileName + `" onClick=''>`
864+
+ `<img src="images/download.svg" class="copy-icon clipboard">`
865+
+ `</span></div></div>`;
865866
} else if (checkforImageURL(tempVal)) {
866-
tempKey = tempKey.substring(0, tempKey.indexOf(" ("));
867-
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>`;
867+
tempKey = tempKey.replace("string", "url");
868+
temp = `<div class="proc-var-flex-main">`
869+
+ `<div class="proc-var-flex-main-sub-1">`
870+
+ `<div class="proc-var-flex-main-sub-2">`
871+
+ `<b>` + tempKey + `: </b></div>`
872+
+ `<div class="proc-var-flex-main-sub-3">`
873+
+ `<img class="grow historyLimitSize" src="` + tempVal + `"></div></div>`
874+
+ `<div class="proc-var-flex-btn">`
875+
+ `<span aria-label="Copy to clipboard" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="false" data-copyValue="` + tempVal + `" onClick=''>`
876+
+ `<img src="images/copy.svg" class="copy-icon clipboard">`
877+
+ `</span></div></div>`;
868878
} else if (checkForURL(tempVal)) {
869-
tempKey = tempKey.substring(0, tempKey.indexOf(" ("));
870-
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>`;
879+
tempKey = tempKey.replace("string", "url");
880+
temp = `<div class="proc-var-flex-main">`
881+
+ `<div class="proc-var-flex-main-sub-1">`
882+
+ `<div class="proc-var-flex-main-sub-2">`
883+
+ `<b>` + tempKey + `: </b></div>`
884+
+ `<div class="proc-var-flex-main-sub-3">`
885+
+ `<a href="` + tempVal + `">` + tempVal + `</a></div></div>`
886+
+ `<div class="proc-var-flex-btn">`
887+
+ `<span aria-label="Copy to clipboard" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="true" data-copyValue="` + tempVal + `" onClick=''>`
888+
+ `<img src="images/copy.svg" class="copy-icon clipboard">`
889+
+ `</span></div></div>`;
871890
} else {
872-
if (tempKey.includes("(string)")) {
873-
tempKey = tempKey.substring(0, tempKey.indexOf(" ("));
874-
}
875-
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>`;
891+
temp = `<div class="proc-var-flex-main">`
892+
+ `<div class="proc-var-flex-main-sub-1">`
893+
+ `<div class="proc-var-flex-main-sub-2">`
894+
+ `<b>` + tempKey + `: </b></div>`
895+
+ `<div class="proc-var-flex-main-sub-3">`
896+
+ tempVal + `</div></div>`
897+
+ `<div class="proc-var-flex-btn">`
898+
+ `<span aria-label="Copy to clipboard" data-microtip-position="top-left" role="tooltip" class="copy" data-isImage="true" data-copyValue="` + tempVal + `" onClick=''>`
899+
+ `<img src="images/copy.svg" class="copy-icon clipboard">`
900+
+ `</span></div></div>`;
876901
}
877902
output = output + temp;
878903
}

install/cws-ui/processes.ftl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,9 +1652,6 @@
16521652
$.ajax({
16531653
type: "POST",
16541654
url: "/${base}/rest/processes/markResolved",
1655-
Accept: "application/json",
1656-
contentType: "application/json",
1657-
dataType: "json",
16581655
data: JSON.stringify(getSelectedRowUuids())
16591656
})
16601657
.done(function (msg) {

0 commit comments

Comments
 (0)