Skip to content

Commit

Permalink
Merge branch 'test' into bugfix-1743-fix-processing-time
Browse files Browse the repository at this point in the history
  • Loading branch information
manjencic authored Dec 8, 2023
2 parents dde0f51 + 1549573 commit 4822021
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1,407 deletions.
35 changes: 35 additions & 0 deletions zmscalldisplay/js/block/queueList.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ class View extends BaseView {
this.hideMessages(0);
$('#queueImport').html(data);
var audioCheck = new RingAudio();

// currently the logic to detect new queue ids is located in the RingAudio
// we should probably pull this functionality out of RingAudio and refactor it.
let newIds = audioCheck.getNewQueueIds();
newIds.forEach((id) => {
var spansToBlink = $('span[data-appointment="' + id + '"]');
this.blinkElements(spansToBlink, 3, 900);
});

audioCheck.initSoundCheck();
this.getDestinationToNumber();
})
Expand Down Expand Up @@ -67,6 +76,32 @@ class View extends BaseView {
}, delay)
}
}

async blinkElements(elements, blinkCount, blinkTime) {
var blinkColor = 'rgb(27, 152, 213)';

const blinkAllOnce = async () => {
// Store the original colors for each element
const originalColors = elements.map(function() {
return $(this).css('color');
});

// Set all elements to the blink color
elements.css('color', blinkColor);
await new Promise(resolve => setTimeout(resolve, blinkTime));

// Reset all elements to their original colors
elements.each(function(index) {
$(this).css('color', originalColors[index]);
});
await new Promise(resolve => setTimeout(resolve, blinkTime));
};

for (let i = 0; i < blinkCount; i++) {
await blinkAllOnce();
}
}

}

export default View;
8 changes: 6 additions & 2 deletions zmscalldisplay/js/block/ringAudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ class View extends BaseView {
this.writeCalledQueueIds(newQueueIds);
}

hasNewQueueId() {
getNewQueueIds() {
let newQueueIds = this.getCalledQueueIds();
let oldQueueIds = window.bo.zmscalldisplay.queue.calledIds;
let diff = $(newQueueIds).not(oldQueueIds).get();
return (0 < diff.length);
return diff;
}

hasNewQueueId() {
return (0 < this.getNewQueueIds().length);
}

getCalledQueueIds() {
Expand Down
Loading

0 comments on commit 4822021

Please sign in to comment.