@ezeep/ezeep-js 1.0.240 → 1.0.242
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ezeep.cjs.js +1 -1
- package/dist/cjs/ezp-auth_15.cjs.entry.js +125 -15
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +126 -15
- package/dist/custom-elements/index.js +126 -16
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_15.entry.js +125 -15
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_15.entry.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/{p-c6949ecf.entry.js → p-412261e1.entry.js} +2 -2
- package/dist/ezeep/p-84bd195a.system.js +1 -1
- package/dist/ezeep/{p-d2371955.system.entry.js → p-9afd2743.system.entry.js} +3 -3
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +2 -0
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-c6949ecf.entry.js → p-412261e1.entry.js} +2 -2
- package/www/build/p-84bd195a.system.js +1 -1
- package/www/build/{p-d2371955.system.entry.js → p-9afd2743.system.entry.js} +3 -3
package/dist/cjs/ezeep.cjs.js
CHANGED
|
@@ -17,5 +17,5 @@ const patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(options => {
|
|
19
19
|
appGlobals.globalScripts();
|
|
20
|
-
return index.bootstrapLazy([["ezp-auth_15.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["ezp-auth_15.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
21
21
|
});
|
|
@@ -32815,6 +32815,7 @@ let EzpPrinterSelection = class {
|
|
|
32815
32815
|
this.printFailed = false;
|
|
32816
32816
|
this.notSupported = false;
|
|
32817
32817
|
this.noPrinters = false;
|
|
32818
|
+
this.hubDriverError = false;
|
|
32818
32819
|
this.userMenuOpen = false;
|
|
32819
32820
|
this.printStopped = false;
|
|
32820
32821
|
this.selectedPrinterConfig = {
|
|
@@ -32864,18 +32865,55 @@ let EzpPrinterSelection = class {
|
|
|
32864
32865
|
this.failedFiles = [];
|
|
32865
32866
|
this.successfulFiles = [];
|
|
32866
32867
|
this.partialSuccess = false;
|
|
32868
|
+
this.hubDriverError = false;
|
|
32867
32869
|
this.printCancel.emit();
|
|
32868
32870
|
};
|
|
32869
32871
|
this.validateData = (data) => {
|
|
32870
|
-
|
|
32871
|
-
|
|
32872
|
+
console.log('[validateData] Checking data:', data);
|
|
32873
|
+
const { jobstatus } = data;
|
|
32874
|
+
// Define status handlers
|
|
32875
|
+
const statusHandlers = {
|
|
32876
|
+
0: () => {
|
|
32877
|
+
// Success
|
|
32878
|
+
this.printSuccess = true;
|
|
32879
|
+
this.printProcessing = false;
|
|
32880
|
+
return true;
|
|
32881
|
+
},
|
|
32882
|
+
1246: () => false,
|
|
32883
|
+
129: () => false,
|
|
32884
|
+
3011: () => {
|
|
32885
|
+
// Failure
|
|
32886
|
+
this.printFailed = true;
|
|
32887
|
+
this.printProcessing = false;
|
|
32888
|
+
return true;
|
|
32889
|
+
},
|
|
32890
|
+
2: () => {
|
|
32891
|
+
// Failure
|
|
32892
|
+
this.printFailed = true;
|
|
32893
|
+
this.printProcessing = false;
|
|
32894
|
+
return true;
|
|
32895
|
+
},
|
|
32896
|
+
};
|
|
32897
|
+
// Check for hub printer driver errors
|
|
32898
|
+
const hubDriverErrorCodes = [412, 500, 503, 1048579];
|
|
32899
|
+
if (hubDriverErrorCodes.includes(jobstatus) && this.selectedPrinter.is_queue) {
|
|
32900
|
+
this.hubDriverError = true;
|
|
32872
32901
|
this.printProcessing = false;
|
|
32873
32902
|
return true;
|
|
32874
32903
|
}
|
|
32875
|
-
|
|
32904
|
+
// Use handler if exists, otherwise treat as failure
|
|
32905
|
+
const handler = statusHandlers[jobstatus];
|
|
32906
|
+
if (handler) {
|
|
32907
|
+
return handler();
|
|
32908
|
+
}
|
|
32909
|
+
// Unknown status, treat as failure for safety
|
|
32910
|
+
this.printFailed = true;
|
|
32911
|
+
this.printProcessing = false;
|
|
32912
|
+
return true;
|
|
32876
32913
|
};
|
|
32877
32914
|
this.POLL_INTERVAL = 2000;
|
|
32878
32915
|
this.MAX_POLL_ATTEMPTS = Infinity;
|
|
32916
|
+
this.HUB_TIMEOUT = 30000; // 30 seconds timeout for hub printers
|
|
32879
32917
|
/** Description... */
|
|
32880
32918
|
this.handlePrint = async () => {
|
|
32881
32919
|
this.printButton.blur();
|
|
@@ -32883,6 +32921,16 @@ let EzpPrinterSelection = class {
|
|
|
32883
32921
|
this.failedFiles = [];
|
|
32884
32922
|
this.successfulFiles = [];
|
|
32885
32923
|
this.partialSuccess = false;
|
|
32924
|
+
this.hubDriverError = false;
|
|
32925
|
+
// Set up timeout for hub printers to prevent infinite loading
|
|
32926
|
+
let hubTimeout;
|
|
32927
|
+
if (this.selectedPrinter.is_queue) {
|
|
32928
|
+
hubTimeout = setTimeout(() => {
|
|
32929
|
+
console.log('[handlePrint] Hub printer timeout reached, setting driver error');
|
|
32930
|
+
this.hubDriverError = true;
|
|
32931
|
+
this.printProcessing = false;
|
|
32932
|
+
}, this.HUB_TIMEOUT);
|
|
32933
|
+
}
|
|
32886
32934
|
// we have to initialse this obj with empty strings to display the select component
|
|
32887
32935
|
// but don't want to send any attributes with empty strings to the API
|
|
32888
32936
|
if (this.selectedPrinterConfig.Trays &&
|
|
@@ -32909,6 +32957,8 @@ let EzpPrinterSelection = class {
|
|
|
32909
32957
|
if (response.status === 200 && this.selectedPrinter.is_queue) {
|
|
32910
32958
|
this.printProcessing = false;
|
|
32911
32959
|
this.printSuccess = true;
|
|
32960
|
+
if (hubTimeout)
|
|
32961
|
+
clearTimeout(hubTimeout);
|
|
32912
32962
|
}
|
|
32913
32963
|
if (response.status === 412) {
|
|
32914
32964
|
response.json().then((data) => (this.fileid = data.fileid));
|
|
@@ -32922,8 +32972,19 @@ let EzpPrinterSelection = class {
|
|
|
32922
32972
|
if (data.code === 804) {
|
|
32923
32973
|
this.printFailed = true;
|
|
32924
32974
|
this.printProcessing = false;
|
|
32975
|
+
if (hubTimeout)
|
|
32976
|
+
clearTimeout(hubTimeout);
|
|
32977
|
+
}
|
|
32978
|
+
else if (this.selectedPrinter.is_queue &&
|
|
32979
|
+
(data.code === 412 || data.code === 500 || data.code === 503 || data.code === 1048579)) {
|
|
32980
|
+
// Hub printer specific errors - likely driver not assigned
|
|
32981
|
+
console.log('[handlePrint] Hub printer driver error detected:', data);
|
|
32982
|
+
this.hubDriverError = true;
|
|
32983
|
+
this.printProcessing = false;
|
|
32984
|
+
if (hubTimeout)
|
|
32985
|
+
clearTimeout(hubTimeout);
|
|
32925
32986
|
}
|
|
32926
|
-
if (data.jobid) {
|
|
32987
|
+
else if (data.jobid) {
|
|
32927
32988
|
printStore.state.jobID = data.jobid;
|
|
32928
32989
|
poll({
|
|
32929
32990
|
fn: this.printService.getPrintStatus,
|
|
@@ -32931,27 +32992,55 @@ let EzpPrinterSelection = class {
|
|
|
32931
32992
|
interval: this.POLL_INTERVAL,
|
|
32932
32993
|
maxAttempts: this.MAX_POLL_ATTEMPTS,
|
|
32933
32994
|
}).catch((err) => {
|
|
32934
|
-
console.warn(err);
|
|
32935
|
-
this
|
|
32995
|
+
console.warn('[handlePrint] Polling error:', err);
|
|
32996
|
+
// Check if this is a hub printer and the error might be driver-related
|
|
32997
|
+
if (this.selectedPrinter.is_queue) {
|
|
32998
|
+
this.hubDriverError = true;
|
|
32999
|
+
}
|
|
33000
|
+
else {
|
|
33001
|
+
this.printFailed = true;
|
|
33002
|
+
}
|
|
32936
33003
|
this.printProcessing = false;
|
|
33004
|
+
if (hubTimeout)
|
|
33005
|
+
clearTimeout(hubTimeout);
|
|
32937
33006
|
});
|
|
32938
33007
|
}
|
|
32939
33008
|
else {
|
|
32940
|
-
|
|
33009
|
+
// No job ID returned - check if it's a hub printer
|
|
33010
|
+
if (this.selectedPrinter.is_queue) {
|
|
33011
|
+
this.hubDriverError = true;
|
|
33012
|
+
}
|
|
33013
|
+
else {
|
|
33014
|
+
this.printFailed = true;
|
|
33015
|
+
}
|
|
32941
33016
|
this.printProcessing = false;
|
|
33017
|
+
if (hubTimeout)
|
|
33018
|
+
clearTimeout(hubTimeout);
|
|
32942
33019
|
}
|
|
32943
33020
|
})
|
|
32944
33021
|
.catch((error) => {
|
|
32945
|
-
console.log(error);
|
|
32946
|
-
this
|
|
33022
|
+
console.log('[handlePrint] Error caught:', error);
|
|
33023
|
+
// Check if this is a hub printer and the error might be driver-related
|
|
33024
|
+
if (this.selectedPrinter.is_queue) {
|
|
33025
|
+
this.hubDriverError = true;
|
|
33026
|
+
}
|
|
33027
|
+
else {
|
|
33028
|
+
this.printFailed = true;
|
|
33029
|
+
}
|
|
32947
33030
|
this.printProcessing = false;
|
|
33031
|
+
if (hubTimeout)
|
|
33032
|
+
clearTimeout(hubTimeout);
|
|
32948
33033
|
});
|
|
32949
33034
|
}
|
|
32950
33035
|
else if (this.files && this.files.length > 1) {
|
|
32951
33036
|
await this.processMultipleFiles(this.files, cleanPrintProperties);
|
|
33037
|
+
if (hubTimeout)
|
|
33038
|
+
clearTimeout(hubTimeout);
|
|
32952
33039
|
}
|
|
32953
33040
|
else if (this.files && this.files.length === 1) {
|
|
32954
33041
|
await this.processSingleFile(this.files[0], cleanPrintProperties);
|
|
33042
|
+
if (hubTimeout)
|
|
33043
|
+
clearTimeout(hubTimeout);
|
|
32955
33044
|
}
|
|
32956
33045
|
localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
|
|
32957
33046
|
localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
|
|
@@ -33005,12 +33094,12 @@ let EzpPrinterSelection = class {
|
|
|
33005
33094
|
this.printCancel.emit();
|
|
33006
33095
|
break;
|
|
33007
33096
|
case 'print-failed':
|
|
33008
|
-
this.printProcessing = false;
|
|
33009
33097
|
this.printFailed = false;
|
|
33010
|
-
this.failedFiles = [];
|
|
33011
|
-
this.successfulFiles = [];
|
|
33012
33098
|
break;
|
|
33013
|
-
case '
|
|
33099
|
+
case 'hub-driver-error':
|
|
33100
|
+
this.hubDriverError = false;
|
|
33101
|
+
break;
|
|
33102
|
+
case 'not-supported':
|
|
33014
33103
|
this.noPrinters = false;
|
|
33015
33104
|
break;
|
|
33016
33105
|
}
|
|
@@ -33025,6 +33114,11 @@ let EzpPrinterSelection = class {
|
|
|
33025
33114
|
this.printProcessing = false;
|
|
33026
33115
|
this.handlePrint();
|
|
33027
33116
|
break;
|
|
33117
|
+
case 'hub-driver-error':
|
|
33118
|
+
this.hubDriverError = false;
|
|
33119
|
+
this.printProcessing = false;
|
|
33120
|
+
this.handlePrint();
|
|
33121
|
+
break;
|
|
33028
33122
|
}
|
|
33029
33123
|
}
|
|
33030
33124
|
getPropertiesFromLocalStorage() {
|
|
@@ -33162,7 +33256,13 @@ let EzpPrinterSelection = class {
|
|
|
33162
33256
|
catch (error) {
|
|
33163
33257
|
console.error(`Error processing file ${file.name}:`, error);
|
|
33164
33258
|
this.failedFiles.push(file.name);
|
|
33165
|
-
//
|
|
33259
|
+
// Check if this is a hub driver error
|
|
33260
|
+
if (error.message && error.message.includes('Hub printer driver error')) {
|
|
33261
|
+
this.hubDriverError = true;
|
|
33262
|
+
this.printProcessing = false;
|
|
33263
|
+
return; // Stop processing other files if it's a hub driver issue
|
|
33264
|
+
}
|
|
33265
|
+
// Continue with the next file
|
|
33166
33266
|
}
|
|
33167
33267
|
}
|
|
33168
33268
|
// Determine final status based on results
|
|
@@ -33202,6 +33302,11 @@ let EzpPrinterSelection = class {
|
|
|
33202
33302
|
if (data.code === 804) {
|
|
33203
33303
|
throw new Error(`Print failed for file: ${file.name}`);
|
|
33204
33304
|
}
|
|
33305
|
+
// Check for hub printer driver errors
|
|
33306
|
+
if (this.selectedPrinter.is_queue &&
|
|
33307
|
+
(data.code === 412 || data.code === 500 || data.code === 503)) {
|
|
33308
|
+
throw new Error(`Hub printer driver error for file: ${file.name}`);
|
|
33309
|
+
}
|
|
33205
33310
|
if (data.jobid) {
|
|
33206
33311
|
printStore.state.jobID = data.jobid;
|
|
33207
33312
|
// Wait for this print job to complete before processing the next file
|
|
@@ -33238,6 +33343,11 @@ let EzpPrinterSelection = class {
|
|
|
33238
33343
|
// Failure
|
|
33239
33344
|
throw new Error('Print job failed: ' + (data.jobstatusstring || data.jobstatus));
|
|
33240
33345
|
}
|
|
33346
|
+
else if (this.selectedPrinter.is_queue &&
|
|
33347
|
+
(data.jobstatus === 412 || data.jobstatus === 500 || data.jobstatus === 503)) {
|
|
33348
|
+
// Hub printer driver error
|
|
33349
|
+
throw new Error('Hub printer driver error: ' + (data.jobstatusstring || data.jobstatus));
|
|
33350
|
+
}
|
|
33241
33351
|
else {
|
|
33242
33352
|
// Unknown status, treat as failure for safety
|
|
33243
33353
|
throw new Error('Unknown print job status: ' + data.jobstatus);
|
|
@@ -33404,7 +33514,7 @@ let EzpPrinterSelection = class {
|
|
|
33404
33514
|
? this.partialSuccess
|
|
33405
33515
|
? `${i18next.t('printer_selection.print_success')} (${this.successfulFiles.length}/${this.totalFiles} ${i18next.t('printer_selection.files')} - ${this.failedFiles.length} failed`
|
|
33406
33516
|
: `${i18next.t('printer_selection.print_success')} (${this.totalFiles} ${i18next.t('printer_selection.files')})`
|
|
33407
|
-
: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.noPrinters ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)), !this.hideheader && (index.h("div", { id: "header" }, index.h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }), index.h("ezp-label", { text: !this.notSupported
|
|
33517
|
+
: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.hubDriverError ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "hub-driver-error", close: true, retry: true })) : this.noPrinters ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)), !this.hideheader && (index.h("div", { id: "header" }, index.h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }), index.h("ezp-label", { text: !this.notSupported
|
|
33408
33518
|
? this.files && this.files.length > 1
|
|
33409
33519
|
? i18next.t('printer_selection.files_selected', { count: this.files.length })
|
|
33410
33520
|
: this.filename
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -16,7 +16,7 @@ const defineCustomElements = (win, options) => {
|
|
|
16
16
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
17
17
|
return patchEsm().then(() => {
|
|
18
18
|
appGlobals.globalScripts();
|
|
19
|
-
return index.bootstrapLazy([["ezp-auth_15.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
19
|
+
return index.bootstrapLazy([["ezp-auth_15.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -48,6 +48,7 @@ export class EzpPrinterSelection {
|
|
|
48
48
|
this.printFailed = false;
|
|
49
49
|
this.notSupported = false;
|
|
50
50
|
this.noPrinters = false;
|
|
51
|
+
this.hubDriverError = false;
|
|
51
52
|
this.userMenuOpen = false;
|
|
52
53
|
this.printStopped = false;
|
|
53
54
|
this.selectedPrinterConfig = {
|
|
@@ -97,18 +98,55 @@ export class EzpPrinterSelection {
|
|
|
97
98
|
this.failedFiles = [];
|
|
98
99
|
this.successfulFiles = [];
|
|
99
100
|
this.partialSuccess = false;
|
|
101
|
+
this.hubDriverError = false;
|
|
100
102
|
this.printCancel.emit();
|
|
101
103
|
};
|
|
102
104
|
this.validateData = (data) => {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
console.log('[validateData] Checking data:', data);
|
|
106
|
+
const { jobstatus } = data;
|
|
107
|
+
// Define status handlers
|
|
108
|
+
const statusHandlers = {
|
|
109
|
+
0: () => {
|
|
110
|
+
// Success
|
|
111
|
+
this.printSuccess = true;
|
|
112
|
+
this.printProcessing = false;
|
|
113
|
+
return true;
|
|
114
|
+
},
|
|
115
|
+
1246: () => false,
|
|
116
|
+
129: () => false,
|
|
117
|
+
3011: () => {
|
|
118
|
+
// Failure
|
|
119
|
+
this.printFailed = true;
|
|
120
|
+
this.printProcessing = false;
|
|
121
|
+
return true;
|
|
122
|
+
},
|
|
123
|
+
2: () => {
|
|
124
|
+
// Failure
|
|
125
|
+
this.printFailed = true;
|
|
126
|
+
this.printProcessing = false;
|
|
127
|
+
return true;
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
// Check for hub printer driver errors
|
|
131
|
+
const hubDriverErrorCodes = [412, 500, 503, 1048579];
|
|
132
|
+
if (hubDriverErrorCodes.includes(jobstatus) && this.selectedPrinter.is_queue) {
|
|
133
|
+
this.hubDriverError = true;
|
|
105
134
|
this.printProcessing = false;
|
|
106
135
|
return true;
|
|
107
136
|
}
|
|
108
|
-
|
|
137
|
+
// Use handler if exists, otherwise treat as failure
|
|
138
|
+
const handler = statusHandlers[jobstatus];
|
|
139
|
+
if (handler) {
|
|
140
|
+
return handler();
|
|
141
|
+
}
|
|
142
|
+
// Unknown status, treat as failure for safety
|
|
143
|
+
this.printFailed = true;
|
|
144
|
+
this.printProcessing = false;
|
|
145
|
+
return true;
|
|
109
146
|
};
|
|
110
147
|
this.POLL_INTERVAL = 2000;
|
|
111
148
|
this.MAX_POLL_ATTEMPTS = Infinity;
|
|
149
|
+
this.HUB_TIMEOUT = 30000; // 30 seconds timeout for hub printers
|
|
112
150
|
/** Description... */
|
|
113
151
|
this.handlePrint = async () => {
|
|
114
152
|
this.printButton.blur();
|
|
@@ -116,6 +154,16 @@ export class EzpPrinterSelection {
|
|
|
116
154
|
this.failedFiles = [];
|
|
117
155
|
this.successfulFiles = [];
|
|
118
156
|
this.partialSuccess = false;
|
|
157
|
+
this.hubDriverError = false;
|
|
158
|
+
// Set up timeout for hub printers to prevent infinite loading
|
|
159
|
+
let hubTimeout;
|
|
160
|
+
if (this.selectedPrinter.is_queue) {
|
|
161
|
+
hubTimeout = setTimeout(() => {
|
|
162
|
+
console.log('[handlePrint] Hub printer timeout reached, setting driver error');
|
|
163
|
+
this.hubDriverError = true;
|
|
164
|
+
this.printProcessing = false;
|
|
165
|
+
}, this.HUB_TIMEOUT);
|
|
166
|
+
}
|
|
119
167
|
// we have to initialse this obj with empty strings to display the select component
|
|
120
168
|
// but don't want to send any attributes with empty strings to the API
|
|
121
169
|
if (this.selectedPrinterConfig.Trays &&
|
|
@@ -142,6 +190,8 @@ export class EzpPrinterSelection {
|
|
|
142
190
|
if (response.status === 200 && this.selectedPrinter.is_queue) {
|
|
143
191
|
this.printProcessing = false;
|
|
144
192
|
this.printSuccess = true;
|
|
193
|
+
if (hubTimeout)
|
|
194
|
+
clearTimeout(hubTimeout);
|
|
145
195
|
}
|
|
146
196
|
if (response.status === 412) {
|
|
147
197
|
response.json().then((data) => (this.fileid = data.fileid));
|
|
@@ -155,8 +205,19 @@ export class EzpPrinterSelection {
|
|
|
155
205
|
if (data.code === 804) {
|
|
156
206
|
this.printFailed = true;
|
|
157
207
|
this.printProcessing = false;
|
|
208
|
+
if (hubTimeout)
|
|
209
|
+
clearTimeout(hubTimeout);
|
|
158
210
|
}
|
|
159
|
-
if (
|
|
211
|
+
else if (this.selectedPrinter.is_queue &&
|
|
212
|
+
(data.code === 412 || data.code === 500 || data.code === 503 || data.code === 1048579)) {
|
|
213
|
+
// Hub printer specific errors - likely driver not assigned
|
|
214
|
+
console.log('[handlePrint] Hub printer driver error detected:', data);
|
|
215
|
+
this.hubDriverError = true;
|
|
216
|
+
this.printProcessing = false;
|
|
217
|
+
if (hubTimeout)
|
|
218
|
+
clearTimeout(hubTimeout);
|
|
219
|
+
}
|
|
220
|
+
else if (data.jobid) {
|
|
160
221
|
printStore.state.jobID = data.jobid;
|
|
161
222
|
poll({
|
|
162
223
|
fn: this.printService.getPrintStatus,
|
|
@@ -164,27 +225,55 @@ export class EzpPrinterSelection {
|
|
|
164
225
|
interval: this.POLL_INTERVAL,
|
|
165
226
|
maxAttempts: this.MAX_POLL_ATTEMPTS,
|
|
166
227
|
}).catch((err) => {
|
|
167
|
-
console.warn(err);
|
|
168
|
-
this
|
|
228
|
+
console.warn('[handlePrint] Polling error:', err);
|
|
229
|
+
// Check if this is a hub printer and the error might be driver-related
|
|
230
|
+
if (this.selectedPrinter.is_queue) {
|
|
231
|
+
this.hubDriverError = true;
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
this.printFailed = true;
|
|
235
|
+
}
|
|
169
236
|
this.printProcessing = false;
|
|
237
|
+
if (hubTimeout)
|
|
238
|
+
clearTimeout(hubTimeout);
|
|
170
239
|
});
|
|
171
240
|
}
|
|
172
241
|
else {
|
|
173
|
-
|
|
242
|
+
// No job ID returned - check if it's a hub printer
|
|
243
|
+
if (this.selectedPrinter.is_queue) {
|
|
244
|
+
this.hubDriverError = true;
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
this.printFailed = true;
|
|
248
|
+
}
|
|
174
249
|
this.printProcessing = false;
|
|
250
|
+
if (hubTimeout)
|
|
251
|
+
clearTimeout(hubTimeout);
|
|
175
252
|
}
|
|
176
253
|
})
|
|
177
254
|
.catch((error) => {
|
|
178
|
-
console.log(error);
|
|
179
|
-
this
|
|
255
|
+
console.log('[handlePrint] Error caught:', error);
|
|
256
|
+
// Check if this is a hub printer and the error might be driver-related
|
|
257
|
+
if (this.selectedPrinter.is_queue) {
|
|
258
|
+
this.hubDriverError = true;
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
this.printFailed = true;
|
|
262
|
+
}
|
|
180
263
|
this.printProcessing = false;
|
|
264
|
+
if (hubTimeout)
|
|
265
|
+
clearTimeout(hubTimeout);
|
|
181
266
|
});
|
|
182
267
|
}
|
|
183
268
|
else if (this.files && this.files.length > 1) {
|
|
184
269
|
await this.processMultipleFiles(this.files, cleanPrintProperties);
|
|
270
|
+
if (hubTimeout)
|
|
271
|
+
clearTimeout(hubTimeout);
|
|
185
272
|
}
|
|
186
273
|
else if (this.files && this.files.length === 1) {
|
|
187
274
|
await this.processSingleFile(this.files[0], cleanPrintProperties);
|
|
275
|
+
if (hubTimeout)
|
|
276
|
+
clearTimeout(hubTimeout);
|
|
188
277
|
}
|
|
189
278
|
localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
|
|
190
279
|
localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
|
|
@@ -238,12 +327,12 @@ export class EzpPrinterSelection {
|
|
|
238
327
|
this.printCancel.emit();
|
|
239
328
|
break;
|
|
240
329
|
case 'print-failed':
|
|
241
|
-
this.printProcessing = false;
|
|
242
330
|
this.printFailed = false;
|
|
243
|
-
this.failedFiles = [];
|
|
244
|
-
this.successfulFiles = [];
|
|
245
331
|
break;
|
|
246
|
-
case '
|
|
332
|
+
case 'hub-driver-error':
|
|
333
|
+
this.hubDriverError = false;
|
|
334
|
+
break;
|
|
335
|
+
case 'not-supported':
|
|
247
336
|
this.noPrinters = false;
|
|
248
337
|
break;
|
|
249
338
|
}
|
|
@@ -258,6 +347,11 @@ export class EzpPrinterSelection {
|
|
|
258
347
|
this.printProcessing = false;
|
|
259
348
|
this.handlePrint();
|
|
260
349
|
break;
|
|
350
|
+
case 'hub-driver-error':
|
|
351
|
+
this.hubDriverError = false;
|
|
352
|
+
this.printProcessing = false;
|
|
353
|
+
this.handlePrint();
|
|
354
|
+
break;
|
|
261
355
|
}
|
|
262
356
|
}
|
|
263
357
|
getPropertiesFromLocalStorage() {
|
|
@@ -397,7 +491,13 @@ export class EzpPrinterSelection {
|
|
|
397
491
|
catch (error) {
|
|
398
492
|
console.error(`Error processing file ${file.name}:`, error);
|
|
399
493
|
this.failedFiles.push(file.name);
|
|
400
|
-
//
|
|
494
|
+
// Check if this is a hub driver error
|
|
495
|
+
if (error.message && error.message.includes('Hub printer driver error')) {
|
|
496
|
+
this.hubDriverError = true;
|
|
497
|
+
this.printProcessing = false;
|
|
498
|
+
return; // Stop processing other files if it's a hub driver issue
|
|
499
|
+
}
|
|
500
|
+
// Continue with the next file
|
|
401
501
|
}
|
|
402
502
|
}
|
|
403
503
|
// Determine final status based on results
|
|
@@ -437,6 +537,11 @@ export class EzpPrinterSelection {
|
|
|
437
537
|
if (data.code === 804) {
|
|
438
538
|
throw new Error(`Print failed for file: ${file.name}`);
|
|
439
539
|
}
|
|
540
|
+
// Check for hub printer driver errors
|
|
541
|
+
if (this.selectedPrinter.is_queue &&
|
|
542
|
+
(data.code === 412 || data.code === 500 || data.code === 503)) {
|
|
543
|
+
throw new Error(`Hub printer driver error for file: ${file.name}`);
|
|
544
|
+
}
|
|
440
545
|
if (data.jobid) {
|
|
441
546
|
printStore.state.jobID = data.jobid;
|
|
442
547
|
// Wait for this print job to complete before processing the next file
|
|
@@ -473,6 +578,11 @@ export class EzpPrinterSelection {
|
|
|
473
578
|
// Failure
|
|
474
579
|
throw new Error('Print job failed: ' + (data.jobstatusstring || data.jobstatus));
|
|
475
580
|
}
|
|
581
|
+
else if (this.selectedPrinter.is_queue &&
|
|
582
|
+
(data.jobstatus === 412 || data.jobstatus === 500 || data.jobstatus === 503)) {
|
|
583
|
+
// Hub printer driver error
|
|
584
|
+
throw new Error('Hub printer driver error: ' + (data.jobstatusstring || data.jobstatus));
|
|
585
|
+
}
|
|
476
586
|
else {
|
|
477
587
|
// Unknown status, treat as failure for safety
|
|
478
588
|
throw new Error('Unknown print job status: ' + data.jobstatus);
|
|
@@ -641,7 +751,7 @@ export class EzpPrinterSelection {
|
|
|
641
751
|
? this.partialSuccess
|
|
642
752
|
? `${i18next.t('printer_selection.print_success')} (${this.successfulFiles.length}/${this.totalFiles} ${i18next.t('printer_selection.files')} - ${this.failedFiles.length} failed`
|
|
643
753
|
: `${i18next.t('printer_selection.print_success')} (${this.totalFiles} ${i18next.t('printer_selection.files')})`
|
|
644
|
-
: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.noPrinters ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)),
|
|
754
|
+
: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.hubDriverError ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "hub-driver-error", close: true, retry: true })) : this.noPrinters ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)),
|
|
645
755
|
!this.hideheader && (h("div", { id: "header" },
|
|
646
756
|
h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }),
|
|
647
757
|
h("ezp-label", { text: !this.notSupported
|
|
@@ -925,6 +1035,7 @@ export class EzpPrinterSelection {
|
|
|
925
1035
|
"printFailed": {},
|
|
926
1036
|
"notSupported": {},
|
|
927
1037
|
"noPrinters": {},
|
|
1038
|
+
"hubDriverError": {},
|
|
928
1039
|
"userMenuOpen": {},
|
|
929
1040
|
"printStopped": {},
|
|
930
1041
|
"userName": {},
|