@topconsultnpm/sdkui-react 6.22.0-dev4.24 → 6.22.0-dev4.25

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.
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { ProcessHistoryLogDescriptor, ProcessStates } from '@topconsultnpm/sdk-ts';
3
+ export declare const getProcessStateColor: (state?: ProcessStates) => string;
4
+ interface ITMProcessHistoryLogViewProps {
5
+ /** Esecuzione da cui leggere stato, contatori e orari */
6
+ historyLog?: ProcessHistoryLogDescriptor;
7
+ /** Testo del log; se assente si usa historyLog.historyLog */
8
+ text?: string;
9
+ }
10
+ /** Stato finale, contatori e testo di un'esecuzione di processo */
11
+ export declare const TMProcessHistoryLogView: ({ historyLog, text }: ITMProcessHistoryLogViewProps) => React.JSX.Element;
12
+ interface ITMProcessHistoryLogModalProps {
13
+ /** 0 se il processo non e' noto: il server risolve l'esecuzione dal solo historyLogID */
14
+ processID?: number;
15
+ historyLogID: number;
16
+ onClose: () => void;
17
+ }
18
+ /** Modale che carica e mostra un'esecuzione di processo */
19
+ export declare const TMProcessHistoryLogModal: ({ processID, historyLogID, onClose }: ITMProcessHistoryLogModalProps) => React.JSX.Element;
20
+ export {};
@@ -0,0 +1,99 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import styled from 'styled-components';
4
+ import { ProcessEngine, ProcessStates, SDK_Globals } from '@topconsultnpm/sdk-ts';
5
+ import { calcResponsiveSizes, Globalization, IconCloseCircle, IconSuccessCirlce, IconWarning, SDKUI_Localizator } from '../../../helper';
6
+ import { FontSize, TMColors } from '../../../utils/theme';
7
+ import { useDeviceType } from '../../base/TMDeviceProvider';
8
+ import { TMExceptionBoxManager } from '../../base/TMPopUp';
9
+ import TMModal from '../../base/TMModal';
10
+ import TMSpinner from '../../base/TMSpinner';
11
+ import TMTooltip from '../../base/TMTooltip';
12
+ const StyledRoot = styled.div `
13
+ display: flex;
14
+ flex-direction: column;
15
+ gap: 10px;
16
+ width: 100%;
17
+ height: 100%;
18
+ min-height: 0;
19
+ box-sizing: border-box;
20
+ `;
21
+ const StyledSummary = styled.div `
22
+ display: flex;
23
+ flex-wrap: wrap;
24
+ align-items: center;
25
+ gap: 5px 10px;
26
+
27
+ .times {
28
+ margin-left: auto;
29
+ font-size: 0.8rem;
30
+ opacity: 0.75;
31
+ }
32
+ `;
33
+ const StyledState = styled.div `
34
+ padding: 5px 10px;
35
+ border-radius: 2px;
36
+ color: white;
37
+ background-color: ${p => p.$color};
38
+ `;
39
+ const StyledCounter = styled.div `
40
+ display: flex;
41
+ align-items: center;
42
+ gap: 5px;
43
+ padding: 0 3px;
44
+ height: 25px;
45
+ border-radius: 3px;
46
+ color: white;
47
+ font-weight: bold;
48
+ background-color: ${p => p.$color};
49
+ `;
50
+ const StyledLogText = styled.textarea `
51
+ flex: 1;
52
+ min-height: 0;
53
+ width: 100%;
54
+ padding: 5px;
55
+ box-sizing: border-box;
56
+ font-family: Consolas, "Courier New", monospace;
57
+ font-size: ${FontSize.defaultFontSize};
58
+ border: 1px solid rgb(219, 219, 219);
59
+ white-space: pre;
60
+ resize: none;
61
+ `;
62
+ export const getProcessStateColor = (state) => {
63
+ if (state === ProcessStates.Ready || state === ProcessStates.Started)
64
+ return TMColors.secondary;
65
+ if (state === ProcessStates.Completed)
66
+ return TMColors.success;
67
+ if (state === ProcessStates.Freezed)
68
+ return 'rgb(180,180,180)';
69
+ return TMColors.error;
70
+ };
71
+ /** Stato finale, contatori e testo di un'esecuzione di processo */
72
+ export const TMProcessHistoryLogView = ({ historyLog, text }) => {
73
+ return _jsxs(StyledRoot, { children: [_jsxs(StyledSummary, { children: [_jsxs("span", { children: [SDKUI_Localizator.FinalState, ":"] }), _jsx(StyledState, { $color: getProcessStateColor(historyLog?.state), children: historyLog?.state ?? '-' }), _jsx(TMTooltip, { content: SDKUI_Localizator.Successes, children: _jsxs(StyledCounter, { $color: TMColors.success, children: [_jsx(IconSuccessCirlce, { fontSize: 16 }), historyLog?.successes ?? 0] }) }), _jsx(TMTooltip, { content: SDKUI_Localizator.Warnings, children: _jsxs(StyledCounter, { $color: TMColors.warning, children: [_jsx(IconWarning, { fontSize: 16 }), historyLog?.warnings ?? 0] }) }), _jsx(TMTooltip, { content: SDKUI_Localizator.Errors, children: _jsxs(StyledCounter, { $color: TMColors.error, children: [_jsx(IconCloseCircle, { fontSize: 16 }), historyLog?.errors ?? 0] }) }), historyLog?.startTime && _jsxs("span", { className: 'times', children: [Globalization.getDateTimeDisplayValue(historyLog.startTime), historyLog.endTime && ' → ' + Globalization.getDateTimeDisplayValue(historyLog.endTime)] })] }), _jsx(StyledLogText, { value: text ?? historyLog?.historyLog ?? '', readOnly: true })] });
74
+ };
75
+ /** Modale che carica e mostra un'esecuzione di processo */
76
+ export const TMProcessHistoryLogModal = ({ processID = 0, historyLogID, onClose }) => {
77
+ const deviceType = useDeviceType();
78
+ const [historyLog, setHistoryLog] = useState();
79
+ useEffect(() => {
80
+ const load = async () => {
81
+ try {
82
+ TMSpinner.show({ description: SDKUI_Localizator.Loading });
83
+ let tmSession = SDK_Globals.tmSession;
84
+ let pe = new ProcessEngine(tmSession);
85
+ let log = await pe.HistoryLog_RetrieveAsync(processID, historyLogID);
86
+ setHistoryLog(log);
87
+ }
88
+ catch (e) {
89
+ TMExceptionBoxManager.show({ exception: e });
90
+ }
91
+ finally {
92
+ TMSpinner.hide();
93
+ }
94
+ };
95
+ load();
96
+ }, [processID, historyLogID]);
97
+ const title = SDKUI_Localizator.LogHistory + (historyLog?.processName ? ' - ' + historyLog.processName : '') + ' (ID: ' + historyLogID + ')';
98
+ return _jsx(TMModal, { title: title, width: calcResponsiveSizes(deviceType, '900px', '900px', '95%'), height: calcResponsiveSizes(deviceType, '650px', '650px', '95%'), resizable: true, expandable: true, onClose: onClose, children: _jsx("div", { style: { width: '100%', height: '100%', padding: '10px', boxSizing: 'border-box' }, children: _jsx(TMProcessHistoryLogView, { historyLog: historyLog }) }) });
99
+ };
@@ -87,6 +87,7 @@ export { default as TMTasksView } from './features/tasks/TMTasksView';
87
87
  export * from './features/tasks/TMTasksUtils';
88
88
  export * from './features/tasks/TMTasksUtilsView';
89
89
  export { default as TMWGsCopyMoveForm } from './features/wg/TMWGsCopyMoveForm';
90
+ export * from './features/process/TMProcessHistoryLog';
90
91
  export * from './base/TMTab';
91
92
  export { default as TMHeader } from "./sidebar/TMHeader";
92
93
  export { default as TMSidebar } from "./sidebar/TMSidebar";
@@ -98,6 +98,8 @@ export * from './features/tasks/TMTasksUtils';
98
98
  export * from './features/tasks/TMTasksUtilsView';
99
99
  // wg
100
100
  export { default as TMWGsCopyMoveForm } from './features/wg/TMWGsCopyMoveForm';
101
+ // process
102
+ export * from './features/process/TMProcessHistoryLog';
101
103
  //tab
102
104
  export * from './base/TMTab';
103
105
  // others
@@ -298,6 +298,7 @@ export declare class SDKUI_Localizator {
298
298
  static get EnterNameForAccess(): "Enter a name for access" | "Entrez un nom pour l'accès" | "Geben Sie einen Namen für den Zugriff ein" | "Inserire un nome per l'accesso" | "Insira um nome para o acesso" | "Introduzca un nombre para el acceso";
299
299
  static get EnterValue(): "Digite um valor" | "Enter a value" | "Entrez une valeur" | "Geben Sie einen Wert ein" | "Inserire un valore" | "Introducir un valor";
300
300
  static get Error(): "Erreur" | "Erro" | "Error" | "Errore" | "Fehler";
301
+ static get Errors(): "Erreurs" | "Errores" | "Errori" | "Errors" | "Erros" | "Fehler";
301
302
  static get ErrorLoadingDocument(): string;
302
303
  static get ErrorParsingFileContent(): "Erreur lors de l'analyse du contenu du fichier. Assurez-vous que le fichier est dans le bon format." | "Erro ao analisar o conteúdo do arquivo. Certifique-se de que o arquivo está no formato correto." | "Error al analizar el contenido del archivo. Asegúrese de que el archivo esté en el formato correcto." | "Error parsing the file content. Ensure the file is in the correct format." | "Errore durante l'analisi del contenuto del file. Assicurati che il file sia nel formato corretto." | "Fehler beim Parsen des Dateiinhalts. Stellen Sie sicher, dass die Datei im richtigen Format vorliegt.";
303
304
  static get ErrorEndRemDate(): "Erreur dans les dates (2)" | "Erro nas datas (2)" | "Error en las fechas (2)" | "Error in the dates (2)" | "Errore nelle date (2)" | "Fehler bei den Daten (2)";
@@ -345,6 +346,7 @@ export declare class SDKUI_Localizator {
345
346
  static get FEFormats_SDI_HTML(): "Feuille de style SdI (HTML)" | "Foglio di stile SdI (HTML)" | "Folha de estilo SdI (HTML)" | "Hoja de estilo SdI (HTML)" | "SdI Style Sheet (HTML)";
346
347
  static get FEFormats_SDI_PDF(): "Feuille de style SdI (PDF)" | "Foglio di stile SdI (PDF)" | "Folha de estilo SdI (PDF)" | "Hoja de estilo SdI (PDF)" | "SdI Style Sheet (PDF)";
347
348
  static get Field(): string;
349
+ static get FinalState(): "Endgültiger Zustand" | "Estado final" | "Final state" | "Stato finale" | "État final";
348
350
  static get FileCheck(): string;
349
351
  static get FileExtensionNotViewable(): string;
350
352
  static get FileConversion(): string;
@@ -516,6 +518,7 @@ export declare class SDKUI_Localizator {
516
518
  static get LogDelete(): "Cancelación lógica" | "Cancellazione logica" | "Logical delete" | "Lógica de cancelamento" | "Löschen der Logik" | "Suppression logique";
517
519
  static get Logout(): "Abmelden" | "Cerrar sesión" | "Déconnexion" | "Esci" | "Logout" | "Sair";
518
520
  static get LogFolder(): "Carpeta de registro" | "Cartella di log" | "Dossier de journal" | "Log folder" | "Pasta de registro" | "Protokollordner";
521
+ static get LogHistory(): "Historial de registro" | "Historique des journaux" | "Histórico de registro" | "Log history" | "Protokollverlauf" | "Storico del log";
519
522
  static get Low(): "Baixa" | "Baja" | "Bassa" | "Faible" | "Low" | "Niedrig";
520
523
  static get MakeEditable(): "Bearbeitbar machen" | "Faça editável" | "Hacer editable" | "Make editable" | "Rendi editabile" | "Rendre modifiable";
521
524
  static get ManageFromTaskPanel(): string;
@@ -875,6 +878,7 @@ export declare class SDKUI_Localizator {
875
878
  static get StatusAndAnswer(): "Estado e resposta" | "Estado y respuesta" | "Stato e risposta" | "Status and answer" | "Status und Antwort" | "Statut et réponse";
876
879
  static get StopOnFirstError(): "Arrêter à la première erreur" | "Beim ersten Fehler abbrechen" | "Detener en el primer error" | "Interrompi al primo errore" | "Parar no primeiro erro" | "Stop at the first error";
877
880
  static get Subject(): "Assunto" | "Asunto" | "Betreff" | "Objet" | "Oggetto" | "Subject";
881
+ static get Successes(): "Erfolge" | "Successes" | "Successi" | "Succès" | "Sucessos" | "Éxitos";
878
882
  static get Summary(): "Resumen" | "Resumo" | "Riepilogo" | "Résumé" | "Summary" | "Zusammenfassung";
879
883
  static get SwitchUser(): "Benutzer wechseln" | "Cambia utente" | "Cambiar usuario" | "Changer d'utilisateur" | "Mudar de usuário" | "Switch user";
880
884
  static get SystemUser(): string;
@@ -953,6 +957,7 @@ export declare class SDKUI_Localizator {
953
957
  static get Visible(): "Sichtbar" | "Visibiles" | "Visibili" | "Visible" | "Visibles" | "Visíveis";
954
958
  static get VisibleItems(): "Elementi visibili" | "Visible items" | "elementos visibles" | "itens visíveis" | "sichtbare Elemente" | "éléments visibles";
955
959
  static get Warning(): "Avviso" | "Warning" | "Warnung" | "advertencia" | "avertissement" | "aviso";
960
+ static get Warnings(): "Advertencias" | "Avertissements" | "Avisos" | "Avvertenze" | "Warnings" | "Warnungen";
956
961
  static get Welcome(): "Bem-vindo" | "Benvenuto" | "Bienvenido" | "Bienvenue" | "Welcome" | "Willkommen";
957
962
  static get WelcomeTo(): "Bem-vindo à {{0}}" | "Benvenuto su {{0}}" | "Bienvenido a {{0}}" | "Bienvenue sur {{0}}" | "Welcome to {{0}}" | "Willkommen bei {{0}}";
958
963
  static get WhatWouldYouLikeToArchive(): "Cosa vorresti archiviare?" | "O que gostaria de arquivar?" | "Que souhaitez-vous archiver?" | "Was möchten Sie archivieren?" | "What would you like to archive?" | "¿Qué te gustaría archivar?";
@@ -2947,6 +2947,16 @@ export class SDKUI_Localizator {
2947
2947
  default: return "Errore";
2948
2948
  }
2949
2949
  }
2950
+ static get Errors() {
2951
+ switch (this._cultureID) {
2952
+ case CultureIDs.De_DE: return "Fehler";
2953
+ case CultureIDs.En_US: return "Errors";
2954
+ case CultureIDs.Es_ES: return "Errores";
2955
+ case CultureIDs.Fr_FR: return "Erreurs";
2956
+ case CultureIDs.Pt_PT: return "Erros";
2957
+ default: return "Errori";
2958
+ }
2959
+ }
2950
2960
  static get ErrorLoadingDocument() {
2951
2961
  switch (this._cultureID) {
2952
2962
  case CultureIDs.De_DE: return "Fehler beim Laden des Dokuments";
@@ -3417,6 +3427,16 @@ export class SDKUI_Localizator {
3417
3427
  default: return "Campo";
3418
3428
  }
3419
3429
  }
3430
+ static get FinalState() {
3431
+ switch (this._cultureID) {
3432
+ case CultureIDs.De_DE: return "Endgültiger Zustand";
3433
+ case CultureIDs.En_US: return "Final state";
3434
+ case CultureIDs.Es_ES: return "Estado final";
3435
+ case CultureIDs.Fr_FR: return "État final";
3436
+ case CultureIDs.Pt_PT: return "Estado final";
3437
+ default: return "Stato finale";
3438
+ }
3439
+ }
3420
3440
  static get FileCheck() {
3421
3441
  switch (this._cultureID) {
3422
3442
  case CultureIDs.De_DE: return "Dateikontrolle";
@@ -5128,6 +5148,16 @@ export class SDKUI_Localizator {
5128
5148
  default: return "Cartella di log";
5129
5149
  }
5130
5150
  }
5151
+ static get LogHistory() {
5152
+ switch (this._cultureID) {
5153
+ case CultureIDs.De_DE: return "Protokollverlauf";
5154
+ case CultureIDs.En_US: return "Log history";
5155
+ case CultureIDs.Es_ES: return "Historial de registro";
5156
+ case CultureIDs.Fr_FR: return "Historique des journaux";
5157
+ case CultureIDs.Pt_PT: return "Histórico de registro";
5158
+ default: return "Storico del log";
5159
+ }
5160
+ }
5131
5161
  static get Low() {
5132
5162
  switch (this._cultureID) {
5133
5163
  case CultureIDs.De_DE: return "Niedrig";
@@ -8730,6 +8760,16 @@ export class SDKUI_Localizator {
8730
8760
  default: return "Oggetto";
8731
8761
  }
8732
8762
  }
8763
+ static get Successes() {
8764
+ switch (this._cultureID) {
8765
+ case CultureIDs.De_DE: return "Erfolge";
8766
+ case CultureIDs.En_US: return "Successes";
8767
+ case CultureIDs.Es_ES: return "Éxitos";
8768
+ case CultureIDs.Fr_FR: return "Succès";
8769
+ case CultureIDs.Pt_PT: return "Sucessos";
8770
+ default: return "Successi";
8771
+ }
8772
+ }
8733
8773
  static get Summary() {
8734
8774
  switch (this._cultureID) {
8735
8775
  case CultureIDs.De_DE: return "Zusammenfassung";
@@ -9522,6 +9562,16 @@ export class SDKUI_Localizator {
9522
9562
  default: return "Avviso";
9523
9563
  }
9524
9564
  }
9565
+ static get Warnings() {
9566
+ switch (this._cultureID) {
9567
+ case CultureIDs.De_DE: return "Warnungen";
9568
+ case CultureIDs.En_US: return "Warnings";
9569
+ case CultureIDs.Es_ES: return "Advertencias";
9570
+ case CultureIDs.Fr_FR: return "Avertissements";
9571
+ case CultureIDs.Pt_PT: return "Avisos";
9572
+ default: return "Avvertenze";
9573
+ }
9574
+ }
9525
9575
  static get Welcome() {
9526
9576
  switch (this._cultureID) {
9527
9577
  case CultureIDs.De_DE: return "Willkommen";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.22.0-dev4.24",
3
+ "version": "6.22.0-dev4.25",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",