Commit 5fef0752 authored by bensinober's avatar bensinober
Browse files

DEICH-5889 koha: add handling (and colour) for c/o items checkin

parent ba389873
......@@ -434,9 +434,14 @@ class RFIDConnectorEventSource extends HTMLElement {
<div id="checkins" class="output-table">
<style>
:root {
--deich-lilac: #ae87f8;
--deich-red: #f9869d;
--deich-orange: #f8aa87;
--deich-green: #53f3c5; /* col-ok-2 */
--deich-green-dark: #085c58; /* col-ok-3 */
--deich-beige: #dac9bc; /* col-ok-4 */
--deich-orange: #fbcd83; /* col-ok-5 */
--deich-lightred: #fb9687; /* col-ok-6 */
--deich-darkred: #fa4343; /* col-red */
--deich-yellow: #fffe07; /* col-yellow */
--green: #87f8bc;
--blue: #87dff8;
--backgrey: #eee;
......@@ -446,17 +451,18 @@ class RFIDConnectorEventSource extends HTMLElement {
.table thead th { background-color: var(--tblgrey2); }
.table td { background-color: transparent !important; }
.alert { background-color: var(--deich-orange); }
.co { background-color: var(--blue); }
.fail { background-color: var(--deich-red); }
.pickup { background-color: var(--deich-lilac); }
.highlight-green {
background-color: lightgreen;
background-color: var(--deich-green);
animation-name: fade;
animation-fill-mode: forwards;
animation-duration: 3s;
animation-delay: 0s;
}
@keyframes fade {
0% { background-color: lightgreen; }
0% { background-color: var(--deich-green); }
100% { background-color: transparent; }
}
</style>
......@@ -481,13 +487,12 @@ class RFIDConnectorEventSource extends HTMLElement {
</div>`
doc.appendChild(div)
}
_updateCheckInTable(msg, item) {
const checkInItems = document.getElementById("rfidItems")
const newRow = document.createElement("tr")
const { title, author } = item.biblio
let mediatype = ""
if (item.medtadata) {
if (item.metadata) {
mediatype = item.metadata.mediatype
}
const { itemcallnumber, location, timestamp, barcode } = item.item
......@@ -500,8 +505,9 @@ class RFIDConnectorEventSource extends HTMLElement {
} else if (DataCorrupted) {
error = `Feil/manglede brikker: ${DataCorrupted}`
}
/* Destination is always calculated on checkin, based on location goes/co/lives, so we do not care about location */
if (item.destination) {
sortLabel = item.destination.destLabel ? item.destination.destLabel : item.destination.destBranch
sortLabel = item.destination.destLabel ? `${item.destination.destBranch} ${item.destination.destLabel}` : item.destination.destBranch
alert = item.destination.note ? item.destination.note : null
destBranch = item.destination.dest.split(".")[0]
if (/pickup/.test(item.destination.dest)) {
......@@ -560,6 +566,8 @@ class RFIDConnectorEventSource extends HTMLElement {
if (error) {
newRow.classList.add("fail")
} else if (item.location.co) {
newRow.classList.add("co")
} else if (alert) {
newRow.classList.add("alert")
} else if (pickup) {
......@@ -584,10 +592,18 @@ class RFIDConnectorEventSource extends HTMLElement {
:root {
--deich-lilac: #ae87f8;
--deich-red: #f9869d;
--deich-orange: #f8aa87;
--green: #87f8bc;
--blue: #87dff8;
--backgrey: #eee;
--deich-blue: #38396a; /* col-ok-1 */
--deich-green: #53f3c5; /* col-ok-2 */
--deich-green-dark: #085c58; /* col-ok-3 */
--deich-beige: #dac9bc; /* col-ok-4 */
--deich-orange: #fbcd83; /* col-ok-5 */
--deich-lightred: #fb9687; /* col-ok-6 */
--deich-darkred: #fa4343; /* col-red */
--deich-yellow: #fffe07; /* col-yellow */
--backgrey: #eaeaea;
--tblgrey1: #ddd;
--tblgrey2: #ccc;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment