@topconsultnpm/sdkui-react 6.21.0-dev2.55 → 6.21.0-dev2.56
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/lib/components/forms/TMResultDialog.d.ts +1 -1
- package/lib/components/forms/TMResultDialog.js +4 -2
- package/lib/helper/SDKUI_Localizator.d.ts +1 -0
- package/lib/helper/SDKUI_Localizator.js +10 -0
- package/lib/hooks/useDcmtOperations.d.ts +1 -1
- package/lib/hooks/useDcmtOperations.js +8 -8
- package/package.json +1 -1
|
@@ -16,5 +16,5 @@ interface ITMResultDialogProps {
|
|
|
16
16
|
declare const TMResultDialog: React.FC<ITMResultDialogProps>;
|
|
17
17
|
export default TMResultDialog;
|
|
18
18
|
export declare class TMResultManager {
|
|
19
|
-
static show(result: ResultInfo[], title: string, id1Caption: string | undefined, id2Caption: string | undefined, customMsg?: string, customDuration?: number): void;
|
|
19
|
+
static show(result: ResultInfo[], title: string, id1Caption: string | undefined, id2Caption: string | undefined, customMsg?: string, customDuration?: number, showSuccessAlert?: boolean): void;
|
|
20
20
|
}
|
|
@@ -29,11 +29,13 @@ const TMResultDialog = ({ title, result, id1Caption, id2Caption }) => {
|
|
|
29
29
|
};
|
|
30
30
|
export default TMResultDialog;
|
|
31
31
|
export class TMResultManager {
|
|
32
|
-
static show(result, title, id1Caption, id2Caption, customMsg, customDuration) {
|
|
32
|
+
static show(result, title, id1Caption, id2Caption, customMsg, customDuration, showSuccessAlert = true) {
|
|
33
33
|
const warningsCount = result.filter(o => o.resultType == ResultTypes.WARNING).length;
|
|
34
34
|
const errorsCount = result.filter(o => o.resultType == ResultTypes.ERROR).length;
|
|
35
35
|
if (warningsCount <= 0 && errorsCount <= 0) {
|
|
36
|
-
|
|
36
|
+
if (showSuccessAlert) {
|
|
37
|
+
ShowAlert({ message: customMsg && customMsg.length > 0 ? customMsg : SDKUI_Localizator.OperationSuccess, mode: 'success', duration: customDuration && customDuration > 0 ? customDuration : 3000, title: title });
|
|
38
|
+
}
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
41
|
let container = document.createElement('div');
|
|
@@ -597,6 +597,7 @@ export declare class SDKUI_Localizator {
|
|
|
597
597
|
static get Previous(): "Vorherige" | "Previous" | "Anterior" | "Précédent" | "Precedente";
|
|
598
598
|
static get Priority(): string;
|
|
599
599
|
static get PriorityLegend(): "Legende der Prioritäten" | "Priority Legend" | "Leyenda de prioridades" | "Légende des priorités" | "Lenda das prioridades" | "Legenda delle priorità";
|
|
600
|
+
static get Print(): "Drucken" | "Print" | "Imprimir" | "Imprimer" | "Stampa";
|
|
600
601
|
static get ProceedAnyway(): "Dennoch fortfahren?" | "Proceed anyway?" | "¿Proceder de todos modos?" | "Procéder quand même ?" | "Prosseguir mesmo assim?" | "Procedere comunque?";
|
|
601
602
|
static get ProcessedItems(): "Durchdachte Elemente" | "Processed items" | "Elementos elaborados" | "Items traités" | "Itens processados" | "Elementi elaborati";
|
|
602
603
|
static get Properties(): "Eigenschaften" | "Properties" | "Propiedades" | "Propriétés" | "Propriedades" | "Proprietà";
|
|
@@ -5942,6 +5942,16 @@ export class SDKUI_Localizator {
|
|
|
5942
5942
|
default: return "Legenda delle priorità";
|
|
5943
5943
|
}
|
|
5944
5944
|
}
|
|
5945
|
+
static get Print() {
|
|
5946
|
+
switch (this._cultureID) {
|
|
5947
|
+
case CultureIDs.De_DE: return "Drucken";
|
|
5948
|
+
case CultureIDs.En_US: return "Print";
|
|
5949
|
+
case CultureIDs.Es_ES: return "Imprimir";
|
|
5950
|
+
case CultureIDs.Fr_FR: return "Imprimer";
|
|
5951
|
+
case CultureIDs.Pt_PT: return "Imprimir";
|
|
5952
|
+
default: return "Stampa";
|
|
5953
|
+
}
|
|
5954
|
+
}
|
|
5945
5955
|
static get ProceedAnyway() {
|
|
5946
5956
|
switch (this._cultureID) {
|
|
5947
5957
|
case CultureIDs.De_DE: return "Dennoch fortfahren?";
|
|
@@ -19,7 +19,7 @@ export interface UseDcmtOperationsReturn {
|
|
|
19
19
|
waitPanelTextSecondary: string;
|
|
20
20
|
waitPanelValueSecondary: number;
|
|
21
21
|
waitPanelMaxValueSecondary: number;
|
|
22
|
-
downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType?: DownloadTypes, downloadMode?: DownloadModes, onFileDownloaded?: (dcmtFile: File, dcmtInfo: DcmtInfo) => void | Promise<void>, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean, retrieveOptions?: RetrieveFormatOptions, useCache?: boolean) => Promise<void>;
|
|
22
|
+
downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType?: DownloadTypes, downloadMode?: DownloadModes, onFileDownloaded?: (dcmtFile: File, dcmtInfo: DcmtInfo) => void | Promise<void>, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean, retrieveOptions?: RetrieveFormatOptions, useCache?: boolean, showSuccessAlert?: boolean) => Promise<void>;
|
|
23
23
|
getDcmtFileAsync: (inputDcmt: DcmtInfo | undefined, rfo: RetrieveFileOptions, operationTitle: string, keepWaitPanelPrimary: boolean, bypassCache?: boolean) => Promise<{
|
|
24
24
|
file: File | undefined;
|
|
25
25
|
isFromCache: boolean;
|
|
@@ -75,7 +75,7 @@ export const useDcmtOperations = () => {
|
|
|
75
75
|
const [waitPanelMaxValueSecondary, setWaitPanelMaxValueSecondary] = useState(0);
|
|
76
76
|
const { OpenFileDialog } = useFileDialog();
|
|
77
77
|
const [selectFileSource, FileSourceDialog] = useFileSourceDialog();
|
|
78
|
-
const _downloadDcmtsAsync = async (inputDcmts, downloadMode = "download", onFileDownloaded, skipConfirmation = false, retrieveOptions, useCache = true) => {
|
|
78
|
+
const _downloadDcmtsAsync = async (inputDcmts, downloadMode = "download", onFileDownloaded, skipConfirmation = false, retrieveOptions, useCache = true, showSuccessAlert = true) => {
|
|
79
79
|
if (inputDcmts === undefined)
|
|
80
80
|
return;
|
|
81
81
|
if (inputDcmts.length <= 0)
|
|
@@ -189,9 +189,9 @@ export const useDcmtOperations = () => {
|
|
|
189
189
|
setWaitPanelMaxValueSecondary(0);
|
|
190
190
|
setWaitPanelValueSecondary(0);
|
|
191
191
|
setShowWaitPanel(false);
|
|
192
|
-
TMResultManager.show(result, operationTitle, "TID", "DID");
|
|
192
|
+
TMResultManager.show(result, operationTitle, "TID", "DID", undefined, undefined, showSuccessAlert);
|
|
193
193
|
};
|
|
194
|
-
const _downloadAttachmentsAsync = async (inputDcmts, confirmAttachments) => {
|
|
194
|
+
const _downloadAttachmentsAsync = async (inputDcmts, confirmAttachments, showSuccessAlert = true) => {
|
|
195
195
|
if (inputDcmts === undefined)
|
|
196
196
|
return;
|
|
197
197
|
if (inputDcmts.length !== 1)
|
|
@@ -239,7 +239,7 @@ export const useDcmtOperations = () => {
|
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
TMResultManager.show(result, operationTitle, "TID", "DID");
|
|
242
|
+
TMResultManager.show(result, operationTitle, "TID", "DID", undefined, undefined, showSuccessAlert);
|
|
243
243
|
}
|
|
244
244
|
catch (ex) {
|
|
245
245
|
TMSpinner.hide();
|
|
@@ -251,11 +251,11 @@ export const useDcmtOperations = () => {
|
|
|
251
251
|
TMExceptionBoxManager.show({ exception: err });
|
|
252
252
|
}
|
|
253
253
|
};
|
|
254
|
-
const downloadDcmtsAsync = async (inputDcmts, downloadType = DownloadTypes.Attachment, downloadMode = "download", onFileDownloaded, confirmAttachments, skipConfirmation = false, retrieveOptions, useCache = true) => {
|
|
254
|
+
const downloadDcmtsAsync = async (inputDcmts, downloadType = DownloadTypes.Attachment, downloadMode = "download", onFileDownloaded, confirmAttachments, skipConfirmation = false, retrieveOptions, useCache = true, showSuccessAlert = true) => {
|
|
255
255
|
switch (downloadType) {
|
|
256
|
-
case DownloadTypes.Dcmt: return await _downloadDcmtsAsync(inputDcmts, downloadMode, onFileDownloaded, skipConfirmation, retrieveOptions, useCache);
|
|
257
|
-
case DownloadTypes.Attachment: return await _downloadAttachmentsAsync(inputDcmts, confirmAttachments);
|
|
258
|
-
default: return await _downloadDcmtsAsync(inputDcmts, undefined, undefined, skipConfirmation, retrieveOptions, useCache);
|
|
256
|
+
case DownloadTypes.Dcmt: return await _downloadDcmtsAsync(inputDcmts, downloadMode, onFileDownloaded, skipConfirmation, retrieveOptions, useCache, showSuccessAlert);
|
|
257
|
+
case DownloadTypes.Attachment: return await _downloadAttachmentsAsync(inputDcmts, confirmAttachments, showSuccessAlert);
|
|
258
|
+
default: return await _downloadDcmtsAsync(inputDcmts, undefined, undefined, skipConfirmation, retrieveOptions, useCache, showSuccessAlert);
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
261
|
const uploadDcmtsAsync = async (inputDcmts, operationTitle, operType, actionAfterOperationAsync) => {
|