@topconsultnpm/sdkui-react 6.20.0-dev1.121 → 6.20.0-dev1.123

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.
@@ -38,7 +38,7 @@ import WFDiagram from '../workflow/diagram/WFDiagram';
38
38
  import TMTooltip from '../../base/TMTooltip';
39
39
  import TMDcmtTasks from './TMDcmtTasks';
40
40
  import TMToppyMessage from '../../../helper/TMToppyMessage';
41
- import { getTaskAssignedToMe } from '../tasks/TMTasksUtils';
41
+ import { getTaskAssignedByMe, getTaskAssignedToMe } from '../tasks/TMTasksUtils';
42
42
  import TMCustomButton from '../../base/TMCustomButton';
43
43
  import { useCheckInOutOperations } from '../../../hooks/useCheckInOutOperations';
44
44
  import TMViewHistoryDcmt from '../search/TMViewHistoryDcmt';
@@ -1353,89 +1353,112 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
1353
1353
  'tmWF': false,
1354
1354
  'tmDcmtTasks': false,
1355
1355
  };
1356
- const initialPanels = useMemo(() => [
1357
- {
1358
- id: 'tmDcmtForm',
1359
- name: SDK_Localizator.Metadatas,
1360
- contentOptions: {
1361
- component: tmDcmtForm,
1362
- isClosable: isClosable,
1363
- panelContainer: {
1364
- showHeader: showHeader,
1365
- title: fromDTD?.nameLoc,
1366
- allowMaximize: !isMobile,
1367
- onBack: showBackButton ? (isClosable && deviceType !== DeviceType.MOBILE) ? undefined : handleClose : undefined,
1368
- onClose: isClosable ? () => { } : undefined,
1369
- toolbar: allowNavigation ? formToolbar : _jsx(_Fragment, {})
1356
+ const getDcmtTasksCounter = (TID, DID, allTasks) => {
1357
+ if (!TID || !DID || !allTasks || allTasks.length === 0) {
1358
+ return {
1359
+ assignedToMe: 0,
1360
+ assignedByMe: 0
1361
+ };
1362
+ }
1363
+ try {
1364
+ const assignedToMe = getTaskAssignedToMe(allTasks).filter(task => task.iD1?.toString() === TID.toString() && task.iD2?.toString() === DID.toString() && task.state !== Task_States.Completed).length ?? 0;
1365
+ const assignedByMe = getTaskAssignedByMe(allTasks).filter(task => task.iD1?.toString() === TID.toString() && task.iD2?.toString() === DID.toString() && task.state !== Task_States.Completed).length ?? 0;
1366
+ return {
1367
+ assignedToMe,
1368
+ assignedByMe
1369
+ };
1370
+ }
1371
+ catch (error) {
1372
+ return {
1373
+ assignedToMe: 0,
1374
+ assignedByMe: 0
1375
+ };
1376
+ }
1377
+ };
1378
+ const initialPanels = useMemo(() => {
1379
+ const { assignedToMe, assignedByMe } = getDcmtTasksCounter(TID, DID, allTasks);
1380
+ const panels = [
1381
+ {
1382
+ id: 'tmDcmtForm',
1383
+ name: SDK_Localizator.Metadatas,
1384
+ contentOptions: {
1385
+ component: tmDcmtForm,
1386
+ isClosable: isClosable,
1387
+ panelContainer: {
1388
+ showHeader: showHeader,
1389
+ title: fromDTD?.nameLoc,
1390
+ allowMaximize: !isMobile,
1391
+ onBack: showBackButton ? (isClosable && deviceType !== DeviceType.MOBILE) ? undefined : handleClose : undefined,
1392
+ onClose: isClosable ? () => { } : undefined,
1393
+ toolbar: allowNavigation ? formToolbar : _jsx(_Fragment, {})
1394
+ },
1370
1395
  },
1396
+ toolbarOptions: {
1397
+ icon: _jsx(IconPreview, { fontSize: 24 }),
1398
+ visible: true,
1399
+ orderNumber: 1,
1400
+ isActive: allInitialPanelVisibility['tmDcmtForm']
1401
+ }
1371
1402
  },
1372
- toolbarOptions: {
1373
- icon: _jsx(IconPreview, { fontSize: 24 }),
1374
- visible: true,
1375
- orderNumber: 1,
1376
- isActive: allInitialPanelVisibility['tmDcmtForm']
1377
- }
1378
- },
1379
- {
1380
- id: 'tmBlog',
1381
- name: SDKUI_Localizator.BlogCase,
1382
- contentOptions: { component: tmBlog, panelContainer: { title: SDKUI_Localizator.BlogCase, allowMaximize: !isMobile } },
1383
- toolbarOptions: {
1384
- icon: _jsx(IconBoard, { fontSize: 24 }),
1385
- visible: true,
1386
- disabled: isBoardDisabled,
1387
- orderNumber: 2,
1388
- isActive: allInitialPanelVisibility['tmBlog']
1389
- }
1390
- },
1391
- {
1392
- id: 'tmSysMetadata',
1393
- name: SDKUI_Localizator.MetadataSystem,
1394
- contentOptions: { component: tmSysMetadata, panelContainer: { title: SDKUI_Localizator.MetadataSystem, allowMaximize: !isMobile } },
1395
- toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: true, disabled: isSysMetadataDisabled, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
1396
- },
1397
- {
1398
- id: 'tmDcmtPreview',
1399
- name: SDKUI_Localizator.PreviewDocument,
1400
- contentOptions: { component: tmDcmtPreview },
1401
- toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), disabled: isPreviewDisabled, visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
1402
- },
1403
- {
1404
- id: 'tmWF',
1405
- name: "Workflow",
1406
- contentOptions: {
1407
- component: tmWF,
1408
- panelContainer: {
1409
- title: "Workflow", allowMaximize: !isMobile
1403
+ {
1404
+ id: 'tmBlog',
1405
+ name: SDKUI_Localizator.BlogCase,
1406
+ contentOptions: { component: tmBlog, panelContainer: { title: SDKUI_Localizator.BlogCase, allowMaximize: !isMobile } },
1407
+ toolbarOptions: {
1408
+ icon: _jsx(IconBoard, { fontSize: 24 }),
1409
+ visible: true,
1410
+ disabled: isBoardDisabled,
1411
+ orderNumber: 2,
1412
+ isActive: allInitialPanelVisibility['tmBlog']
1410
1413
  }
1411
1414
  },
1412
- toolbarOptions: {
1413
- icon: _jsx(IconWorkflow, { fontSize: 24 }),
1414
- visible: true,
1415
- disabled: isWFDisabled,
1416
- orderNumber: 5,
1417
- isActive: allInitialPanelVisibility['tmWF']
1418
- }
1419
- },
1420
- {
1421
- id: 'tmDcmtTasks',
1422
- name: SDKUI_Localizator.Widget_Activities,
1423
- contentOptions: {
1424
- component: tmDcmtTasks,
1415
+ {
1416
+ id: 'tmSysMetadata',
1417
+ name: SDKUI_Localizator.MetadataSystem,
1418
+ contentOptions: { component: tmSysMetadata, panelContainer: { title: SDKUI_Localizator.MetadataSystem, allowMaximize: !isMobile } },
1419
+ toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: true, disabled: isSysMetadataDisabled, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
1425
1420
  },
1426
- toolbarOptions: {
1427
- icon: _jsx(IconActivity, { fontSize: 24 }),
1428
- visible: layoutMode !== LayoutModes.Ark,
1429
- orderNumber: 6,
1430
- isActive: allInitialPanelVisibility['tmDcmtTasks'],
1431
- count: (TID && DID && allTasks && allTasks.length > 0) ?
1432
- getTaskAssignedToMe(allTasks).filter(task => task.iD1?.toString() === TID.toString()
1433
- && task.iD2?.toString() === DID.toString()
1434
- && task.state !== Task_States.Completed).length ?? 0
1435
- : 0
1436
- }
1437
- },
1438
- ], [fromDTD, showBackButton, tmDcmtForm, tmBlog, tmSysMetadata, tmDcmtPreview, tmWF, tmDcmtTasks, isPreviewDisabled, isSysMetadataDisabled, isBoardDisabled, isWFDisabled, inputFile, isClosable, allTasks, DID, TID]);
1421
+ {
1422
+ id: 'tmDcmtPreview',
1423
+ name: SDKUI_Localizator.PreviewDocument,
1424
+ contentOptions: { component: tmDcmtPreview },
1425
+ toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), disabled: isPreviewDisabled, visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
1426
+ },
1427
+ {
1428
+ id: 'tmWF',
1429
+ name: "Workflow",
1430
+ contentOptions: {
1431
+ component: tmWF,
1432
+ panelContainer: {
1433
+ title: "Workflow", allowMaximize: !isMobile
1434
+ }
1435
+ },
1436
+ toolbarOptions: {
1437
+ icon: _jsx(IconWorkflow, { fontSize: 24 }),
1438
+ visible: true,
1439
+ disabled: isWFDisabled,
1440
+ orderNumber: 5,
1441
+ isActive: allInitialPanelVisibility['tmWF']
1442
+ }
1443
+ },
1444
+ {
1445
+ id: 'tmDcmtTasks',
1446
+ name: SDKUI_Localizator.Widget_Activities,
1447
+ contentOptions: {
1448
+ component: tmDcmtTasks,
1449
+ },
1450
+ toolbarOptions: {
1451
+ icon: _jsx(IconActivity, { fontSize: 24 }),
1452
+ visible: layoutMode !== LayoutModes.Ark,
1453
+ orderNumber: 6,
1454
+ isActive: allInitialPanelVisibility['tmDcmtTasks'],
1455
+ count: assignedToMe + assignedByMe,
1456
+ tooltip: _jsx("div", { children: assignedToMe + assignedByMe === 0 ? (SDKUI_Localizator.Widget_Activities) : (_jsxs("div", { children: [_jsx("div", { style: { textAlign: 'center', fontWeight: 'bold' }, children: SDKUI_Localizator.Widget_Activities }), _jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [SDKUI_Localizator.AssignedToMe, ": ", assignedToMe] }), _jsxs("div", { children: [SDKUI_Localizator.AssignedByMe, ": ", assignedByMe] })] })] })) })
1457
+ }
1458
+ },
1459
+ ];
1460
+ return panels;
1461
+ }, [fromDTD, showBackButton, tmDcmtForm, tmBlog, tmSysMetadata, tmDcmtPreview, tmWF, tmDcmtTasks, isPreviewDisabled, isSysMetadataDisabled, isBoardDisabled, isWFDisabled, inputFile, isClosable, allTasks, DID, TID]);
1439
1462
  // Retrieves the current document form setting based on the normalized TID
1440
1463
  const getCurrentDcmtFormSetting = () => {
1441
1464
  const settings = SDKUI_Globals.userSettings.dcmtFormSettings;
@@ -417,7 +417,7 @@ const TMTaskForm = (props) => {
417
417
  const originLabel = getOriginLabel(formData.pdG, formData.iD1Name);
418
418
  if (!originLabel)
419
419
  return null;
420
- const maxLength = isMobileDevice ? 10 : 30;
420
+ const maxLength = isMobileDevice ? 10 : 25;
421
421
  const displayText = originLabel.length > maxLength
422
422
  ? originLabel.slice(0, maxLength) + "..."
423
423
  : originLabel;
@@ -263,7 +263,7 @@ export const WorkflowEndInstanceModal = ({ selectedInstances, onClose, onComplet
263
263
  ShowAlert({
264
264
  mode: 'success',
265
265
  position: 'TOP_RIGHT',
266
- title: 'Terminazione istanze',
266
+ title: SDKUI_Localizator.WorkflowEndInstance,
267
267
  message: `${selectedInstances.length} ${selectedInstances.length === 1 ? 'istanza terminata' : 'istanze terminate'} con successo`,
268
268
  duration: 3000
269
269
  });
@@ -277,9 +277,10 @@ export const WorkflowEndInstanceModal = ({ selectedInstances, onClose, onComplet
277
277
  TMSpinner.hide();
278
278
  }
279
279
  };
280
- const itemCount = selectedInstances.length > 0 ? `(${selectedInstances.length} ${selectedInstances.length === 1 ? 'istanza' : 'istanze'})` : '';
281
- const title = `Termina istanza ${itemCount}`;
282
- return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx("div", { style: { fontWeight: 600, marginBottom: '8px' }, children: "Motivazione (obbligatorio):" }), _jsx(StyledTextArea, { "$isValid": !disable, value: commentValue, onChange: (e) => setCommentValue(e.target.value), placeholder: "Inserisci il motivo della terminazione...", maxLength: 200 }), _jsxs(CharacterCounter, { children: [commentValue.length, "/200"] })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconStop, {}), caption: "Termina istanza", width: '150px', disabled: disable, onClick: () => !disable && endInstancesAsync(), advancedColor: TMColors.error }) })] }) }));
280
+ const title = selectedInstances.length === 1
281
+ ? `${SDKUI_Localizator.WorkflowEndInstance} (DID: ${selectedInstances[0].did})`
282
+ : `${SDKUI_Localizator.WorkflowEndInstance} (${selectedInstances.length} istanze)`;
283
+ return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx("div", { style: { fontWeight: 600, marginBottom: '8px' }, children: "Motivazione (obbligatorio):" }), _jsx(StyledTextArea, { "$isValid": !disable, value: commentValue, onChange: (e) => setCommentValue(e.target.value), placeholder: "Inserisci il motivo della terminazione...", maxLength: 200 }), _jsxs(CharacterCounter, { children: [commentValue.length, "/200"] })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconStop, {}), caption: SDKUI_Localizator.WorkflowEndInstance, width: '150px', disabled: disable, onClick: () => !disable && endInstancesAsync(), advancedColor: TMColors.error }) })] }) }));
283
284
  };
284
285
  export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose, onCompleted }) => {
285
286
  const [users, setUsers] = useState([]);
@@ -302,7 +302,7 @@ export declare class SDKUI_Localizator {
302
302
  static get GetFileUploadErrorMessage(): "Fehler beim Hochladen" | "Error during upload" | "Error al subir el archivo" | "Erreur lors du téléchargement" | "Erro ao carregar o arquivo" | "Errore nel caricamento";
303
303
  static get GetFolderDeletionErrorMessage(): "Fehler beim Löschen des Ordners" | "Error deleting the folder" | "Error al eliminar la carpeta" | "Erreur lors de la suppression du dossier" | "Erro ao excluir a pasta" | "Errore nell'eliminazione della cartella";
304
304
  static get GoTo(): "Gehe zu" | "Go to" | "Ir a" | "Aller à" | "Vai a";
305
- static get GoToDocument(): "Gehe zum Dokument" | "Go to document" | "Ir al documento" | "Aller au document" | "Ir ao documento" | "Vai al documento";
305
+ static get GoToDocument(): "Zum Dokumentformular gehen" | "Go to the document form" | "Ir al formulario del documento" | "Aller au formulaire du document" | "Ir para o formulário do documento" | "Vai al form del documento";
306
306
  static get GoToDossier(): "Gehe zur Praxis" | "Go to practice" | "Ir a la práctica" | "Aller à la pratique" | "Ir à prática" | "Vai alla pratica";
307
307
  static get GoToToday(): "Gehe zu heute" | "Go to today" | "Ir a hoy" | "Aller à aujourd'hui" | "Ir para hoje" | "Vai a oggi";
308
308
  static get GoToWorkgroup(): "Gehe zur Arbeitsgruppe" | "Go to workgroup" | "Ir al grupo de trabajo" | "Aller au groupe de travail" | "Ir para grupo de trabalho" | "Vai al gruppo di lavoro";
@@ -2988,12 +2988,12 @@ export class SDKUI_Localizator {
2988
2988
  }
2989
2989
  static get GoToDocument() {
2990
2990
  switch (this._cultureID) {
2991
- case CultureIDs.De_DE: return "Gehe zum Dokument";
2992
- case CultureIDs.En_US: return "Go to document";
2993
- case CultureIDs.Es_ES: return "Ir al documento";
2994
- case CultureIDs.Fr_FR: return "Aller au document";
2995
- case CultureIDs.Pt_PT: return "Ir ao documento";
2996
- default: return "Vai al documento";
2991
+ case CultureIDs.De_DE: return "Zum Dokumentformular gehen";
2992
+ case CultureIDs.En_US: return "Go to the document form";
2993
+ case CultureIDs.Es_ES: return "Ir al formulario del documento";
2994
+ case CultureIDs.Fr_FR: return "Aller au formulaire du document";
2995
+ case CultureIDs.Pt_PT: return "Ir para o formulário do documento";
2996
+ default: return "Vai al form del documento";
2997
2997
  }
2998
2998
  }
2999
2999
  static get GoToDossier() {
@@ -27,7 +27,7 @@ const openApps = async (appModule, tmSession, appRoutes) => {
27
27
  toTMSession.SessionDescr = toSessionDescr;
28
28
  let str = (JSON.stringify(toTMSession));
29
29
  let sessionToBase64 = Buffer.from(str).toString("base64");
30
- window.open(appRoutes?.find(route => route.appName === appModule).URL + '/Homepage' + '?session=' + sessionToBase64);
30
+ window.open(appRoutes?.find(route => route.appName === appModule).URL + '/Homepage' + '?session=' + encodeURIComponent(sessionToBase64));
31
31
  }
32
32
  catch (e) {
33
33
  TMExceptionBoxManager.show({ exception: e.message });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.20.0-dev1.121",
3
+ "version": "6.20.0-dev1.123",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",