Skip to content

Commit

Permalink
Revert "HQ Escalations demo"
Browse files Browse the repository at this point in the history
This reverts commit 93a2f29.
  • Loading branch information
OSPFNeighbour committed Nov 12, 2024
1 parent 6fc9d8d commit 0115aab
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 91 deletions.
13 changes: 0 additions & 13 deletions src/contentscripts/jobs/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,16 +274,6 @@ let job_nearest_lhq = (
</div>
);

let job_escalations_lhq = (
<div class="form-group" id="escalations-lhq" style="display: none;">
<label class="col-xs-3 col-sm-2 col-md-4 col-lg-3 control-label"><img style="margin-left:-21px;width:16px;vertical-align:inherit;margin-right:5px"
src={chrome.runtime.getURL("icons/lh-black.png")} />HQ Escalations</label>
<div id="escalations-lhq-box" class="col-xs-9 col-sm-10 col-md-8 col-lg-9">
<p id="escalations-lhq-text" class="form-control-static">Waiting...</p>
</div>
</div>
);

let job_nearest_rescue_lhq = (
<div class="form-group" id="nearest-rescue-lhq-group" style="display: none;">
<label class="col-xs-3 col-sm-2 col-md-4 col-lg-3 control-label"><img style="margin-left:-21px;width:16px;vertical-align:inherit;margin-right:5px"
Expand Down Expand Up @@ -432,9 +422,6 @@ $('fieldset.col-md-12').each(function(k,v){
$('#editRfaForm > fieldset.col-md-8 > div > label').each(function(k,v){
var $v = $(v);
if (v.innerText == 'LGA') {

$v.parent().before(job_escalations_lhq)

$v.parent().after(job_nearest_rescue_lhq)

$v.parent().after(job_nearest_lhq)
Expand Down
78 changes: 0 additions & 78 deletions src/injectscripts/jobs/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1527,84 +1527,6 @@ whenJobIsReady(function () {

$('#nearest-rescue-lhq-text').append(searchButton);
}

if (user.currentHqId == 1) { //only show for SOC
if (masterViewModel.entityAssignedTo.peek() != null) {
$('#escalations-lhq').show()
$.ajax({
type: 'GET',
url:
urls.Base +
'/Api/v1/ContactGroups/Search?EntityIds%5B%5D=' +
masterViewModel.entityAssignedTo.peek().Id +
'&PageIndex=1&PageSize=100&SortField=JobReceived&SortOrder=desc&_=1730938352523',
beforeSend: function (n) {
n.setRequestHeader('Authorization', 'Bearer ' + user.accessToken);
},
cache: false,
dataType: 'json',
data: { LighthouseFunction: 'InstantSectorButton', userId: user.Id },
complete: function (response, textStatus) {
if (textStatus == 'success') {
if (response.responseJSON.Results.length) {
let groups = [];
let jobType = masterViewModel.jobType.peek().Name
switch (jobType) {
case "FR":
jobType = "Flood Rescue"
break;
case "Flood Misc":
jobType = "Flood/Storm"
break;
case "GLR":
jobType = "General Land Rescue"
break;
case "VR":
jobType = "Vertical Rescue"
break;
default:
jobType = masterViewModel.jobType.peek().Name
}
response.responseJSON.Results.forEach(function (group) {
if (group.Escalation == true) {
if (group.Types.some(function (i) {
if (i.Name.includes(jobType)) {
return true
}
})) {
let groupDom = (
<a type="button" style="margin-bottom:5px; margin-right: 5px;" class="btn btn-primary btn-xs" data-unit={group.Id}>
{group.Name}
</a>
);
$(groupDom).click(function () {
window.open(`/ContactGroups/${group.Id}/Edit`, '_blank').focus();
});
groups.push(groupDom);
} else {
let groupDom = (
<a type="button" style="margin-bottom:5px; margin-right: 5px;" class="btn btn-default btn-xs mr-1" data-unit={group.Id}>
{group.Name}
</a>
);
$(groupDom).click(function (e) {
console.log(e)
window.open(`/ContactGroups/${group.Id}/Edit`, '_blank').focus();
});
groups.push(groupDom);
}
}
})
$('#escalations-lhq-text').empty();
$('#escalations-lhq-text').append(groups);
}
}
}
})

}
}

});

whenLighthouseIsReady(function () {
Expand Down

0 comments on commit 0115aab

Please sign in to comment.