Browse Source

improved faxbox number finding reliability; added help tooltip

ruhnet4.3
Ruel Tmeizeh - RuhNet 2 weeks ago
parent
commit
7df45938ba
6 changed files with 49 additions and 15 deletions
  1. +16
    -14
      app.js
  2. +1
    -0
      i18n/de-DE.json
  3. +1
    -0
      i18n/en-US.json
  4. +15
    -0
      style/app.css
  5. +15
    -0
      style/app.scss
  6. +1
    -1
      views/outbound-faxes.html

+ 16
- 14
app.js View File

@ -918,22 +918,24 @@ define(function(require) {
self.getCallflows(function(callflows) { //get all callflows self.getCallflows(function(callflows) { //get all callflows
let done = new Promise((resolve, reject) => { //let these finish before proceeding let done = new Promise((resolve, reject) => { //let these finish before proceeding
if (callflows.length == 0) resolve(); if (callflows.length == 0) resolve();
_.each(callflows, function(cf, idx) {
if (cf.modules.includes('faxbox')) { //if callflow uses the faxbox module, get it individually
self.getCallflow(cf.id, function(callflow) {
var fbid = findFaxboxId(callflow.flow); //search for the faxbox ID
if (fbid) faxboxNumbers[fbid] = [];
_.each(cf.numbers, function(cfnum) { //check each callflow number to see if it's a real DID
if (numbers.includes(cfnum)) {
faxboxNumbers[fbid].push(cfnum); //add the number (if it's a DID) to the list for this faxbox ID
}
});
if (faxboxNumbers[fbid] && faxboxNumbers[fbid].length == 0) { //this faxbox has no DIDs routing to it
console.log('Warning: faxbox '+fbid+' has no DIDs routing to it!');
var faxCallflows = _.filter(callflows, function(cf) { //ignore non-faxbox callflows
return cf.modules.includes('faxbox');
});
if (faxCallflows.length == 0) resolve();
_.each(faxCallflows, function(cf, idx) {
self.getCallflow(cf.id, function(callflow) { //this callflow has faxbox, so get it for details
var fbid = findFaxboxId(callflow.flow); //search for the faxbox ID
if (fbid) faxboxNumbers[fbid] = [];
_.each(cf.numbers, function(cfnum) { //check each callflow number to see if it's a real DID
if (numbers.includes(cfnum)) {
faxboxNumbers[fbid].push(cfnum); //add the number (if it's a DID) to the list for this faxbox ID
} }
}); });
}
if ((idx + 1) == callflows.length) resolve(); //processed all callflows so we're done
if (faxboxNumbers[fbid] && faxboxNumbers[fbid].length == 0) { //this faxbox has no DIDs routing to it
console.log('Warning: faxbox '+fbid+' has no DIDs routing to it!');
}
if ((idx + 1) == faxCallflows.length) resolve(); //processed all callflows so we're done
});
}); });
}); });
done.then(() => { done.then(() => {


+ 1
- 0
i18n/de-DE.json View File

@ -82,6 +82,7 @@
"enterToNumber": "Enter Fax To Number", "enterToNumber": "Enter Fax To Number",
"fromNumber": "From Number", "fromNumber": "From Number",
"fromNumberAll": "From Number [All Numbers]", "fromNumberAll": "From Number [All Numbers]",
"help": "After a fax has been queued, please allow several minutes for it to send before expecting it to be available in the outbound faxes table below.",
"missingFile": "You must choose a PDF or TIFF file to send", "missingFile": "You must choose a PDF or TIFF file to send",
"missingFrom": "You must select the source number.", "missingFrom": "You must select the source number.",
"missingTo": "You must enter the destination fax number.", "missingTo": "You must enter the destination fax number.",


+ 1
- 0
i18n/en-US.json View File

@ -12,6 +12,7 @@
"enterToNumber": "Enter Fax To Number", "enterToNumber": "Enter Fax To Number",
"fromNumber": "From Number", "fromNumber": "From Number",
"fromNumberAll": "From Number [All Numbers]", "fromNumberAll": "From Number [All Numbers]",
"help": "After a fax has been queued, please allow several minutes for it to send before expecting it to be available in the outbound faxes table below.",
"missingFile": "You must choose a PDF or TIFF file to send", "missingFile": "You must choose a PDF or TIFF file to send",
"missingFrom": "You must select the source number.", "missingFrom": "You must select the source number.",
"missingTo": "You must enter the destination fax number.", "missingTo": "You must enter the destination fax number.",


+ 15
- 0
style/app.css View File

@ -217,3 +217,18 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
} }
.sendbutton-help {
display: flex;
flex-direction: row;
}
button.sendbutton-help {
font-size: +1.6em;
}
#send_help {
font-size: +1.5em;
margin-left: 12px;
color: #555;
}

+ 15
- 0
style/app.scss View File

@ -261,3 +261,18 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
} }
.sendbutton-help {
display: flex;
flex-direction: row;
}
button.sendbutton-help {
font-size: +1.6em;
}
#send_help {
font-size: +1.5em;
margin-left: 12px;
color: #555;
}

+ 1
- 1
views/outbound-faxes.html View File

@ -39,7 +39,7 @@
<i class="fa fa-plus show-all-numbers"></i> <i class="fa fa-plus show-all-numbers"></i>
</div> </div>
</div> </div>
<button class="monster-button-primary send-fax-button outbound-hidden" disabled>{{i18n.fax.outbound.sendFax}}</button>
<div class="sendbutton-help"><button class="monster-button-primary send-fax-button outbound-hidden" disabled>{{i18n.fax.outbound.sendFax}}</button><i id="send_help" class="fa fa-question-circle outbound-hidden" data-toggle="tooltip" title="{{ i18n.fax.outbound.help }}"></i></div>
</div> </div>
<!-- END OF SEND OUTBOUND FAX VIA API --> <!-- END OF SEND OUTBOUND FAX VIA API -->


Loading…
Cancel
Save