@topconsultnpm/sdkui-react 6.20.0-dev3.14 → 6.20.0-dev3.16

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.
@@ -100,7 +100,7 @@ export const TMUserTooltip = ({ ud, children }) => {
100
100
  .filter(Boolean)
101
101
  .join('\n');
102
102
  };
103
- return (_jsx("div", { title: buildTitle(ud), children: children }));
103
+ return (_jsx("span", { title: buildTitle(ud), style: { display: 'inline-flex', alignItems: 'center' }, children: children }));
104
104
  };
105
105
  const getCompleteUserName = (domain, name) => {
106
106
  if (!name)
@@ -78,10 +78,20 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
78
78
  setDynDataListsToBeRefreshed([]);
79
79
  return;
80
80
  }
81
- // Passiamo did = undefined, perché è già in cache
82
- DcmtTypeListCacheService.GetWithNotGrantedAsync(TID, undefined).then((resultDTD) => {
83
- setCurrentDTD(resultDTD);
84
- });
81
+ const fetchData = async () => {
82
+ try {
83
+ let resultDTD = await DcmtTypeListCacheService.GetAsync(TID);
84
+ if (!resultDTD) {
85
+ // Passiamo did = undefined, perché è già in cache
86
+ resultDTD = await DcmtTypeListCacheService.GetWithNotGrantedAsync(TID, undefined);
87
+ }
88
+ setCurrentDTD(resultDTD);
89
+ }
90
+ catch (error) {
91
+ TMExceptionBoxManager.show({ exception: error });
92
+ }
93
+ };
94
+ fetchData();
85
95
  }, [TID]);
86
96
  useEffect(() => {
87
97
  if (metadataValues.length <= 0)
@@ -358,7 +358,7 @@ const TaskFormResponseComment = (props) => {
358
358
  }, children: currentResponse && currentResponse.length > 0
359
359
  ? _jsx(TMHtmlContentDisplay, { markup: currentResponse ?? '-', isSelected: false })
360
360
  : _jsx("span", { style: { color: '#6c757d', fontStyle: 'italic' }, children: SDKUI_Localizator.NoAnswerProvided }) }) }))] })
361
- : (_jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", "$isValid": true, value: currentResponse ?? '', onChange: onAnswerChange ? onAnswerChange : undefined, "$isModifiedWhen": currentResponse !== originalResponse }), _jsx(ResponseCommentLabel, { htmlFor: "responseId", "$isModifiedWhen": currentResponse !== originalResponse, children: SDKUI_Localizator.Answer }), _jsx(ResponseCommentCharacterCounter, { children: `${500 - (currentResponse ?? '').length} ${SDKUI_Localizator.CharactersRemaining}` })] })) }));
361
+ : (_jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", "$isValid": true, value: currentResponse ?? '', onChange: onAnswerChange ? onAnswerChange : undefined }), _jsx(ResponseCommentLabel, { htmlFor: "responseId", children: SDKUI_Localizator.Answer }), _jsx(ResponseCommentCharacterCounter, { children: `${500 - (currentResponse ?? '').length} ${SDKUI_Localizator.CharactersRemaining}` })] })) }));
362
362
  };
363
363
  // Stile comune per i container dei campi
364
364
  const fieldContainerStyle = { width: '100%' };
@@ -10,7 +10,7 @@ import TMTextBox from '../../../editors/TMTextBox';
10
10
  import TMButton from '../../../base/TMButton';
11
11
  import styled from 'styled-components';
12
12
  import TMQuerySummary from '../../../query/TMQuerySummary';
13
- import { CultureIDs, DcmtTypeListCacheService, FromItem, MetadataDataDomains, SDK_Globals, SearchEngine, Severities, WFAppTypes, WorkItemSetRules } from '@topconsultnpm/sdk-ts';
13
+ import { CultureIDs, DcmtTypeListCacheService, FromItem, MetadataDataDomains, ResultTypes, SDK_Globals, SearchEngine, Severities, WFAppTypes, WorkItemSetRules } from '@topconsultnpm/sdk-ts';
14
14
  import TMLocalizedTextBox from '../../../editors/TMLocalizedTextBox';
15
15
  import TMDataListItemPicker from '../../../choosers/TMDataListItemPicker';
16
16
  import WorkitemRecipientsEditor, { actorsToTos, RecipientsContainer, tosToActors } from './WorkitemRecipientsEditor';
@@ -30,9 +30,16 @@ import { DiagramItemProps, wfDiagramItemValidator } from './workflowHelpers';
30
30
  const FormContainer = styled.div `
31
31
  display: flex;
32
32
  flex-direction: column;
33
- gap: 5px;
33
+ height: 100%;
34
34
  padding: 10px;
35
35
  `;
36
+ const FieldsContainer = styled.div `
37
+ display: flex;
38
+ flex-direction: column;
39
+ gap: 5px;
40
+ flex: 1;
41
+ overflow-y: auto;
42
+ `;
36
43
  const FlexContainer = styled.div `
37
44
  display: flex;
38
45
  align-items: center;
@@ -580,38 +587,38 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
580
587
  setDossierTypes(formattedList);
581
588
  });
582
589
  }, [localItem.Type]);
583
- // Gestione di Tos e Tos2
584
- const { andRecipients: tosRecipients } = useMemo(() => {
585
- return tosToActors(localItem.Tos ?? '');
586
- }, [localItem.Tos]);
587
- const { andRecipients: tos2Recipients } = useMemo(() => {
590
+ // Owner = Tos2, Participants = Tos
591
+ const { andRecipients: ownerRecipients } = useMemo(() => {
588
592
  return tosToActors(localItem.Tos2 ?? '');
589
593
  }, [localItem.Tos2]);
590
- const handleAddTosRecipients = useCallback((newRecipients, orValue) => {
591
- const { andRecipients } = tosToActors(localItem.Tos ?? '');
592
- const updatedRecipients = [...andRecipients, ...newRecipients.map(r => ({ ...r, Or: orValue }))];
593
- const newTos = actorsToTos(updatedRecipients);
594
- handleTosChange(newTos);
595
- }, [localItem.Tos, handleTosChange]);
596
- const handleRemoveTosRecipient = useCallback((recipientToRemove) => {
597
- const { andRecipients } = tosToActors(localItem.Tos ?? '');
598
- const updatedRecipients = andRecipients.filter(r => r.ActorType !== recipientToRemove.ActorType || r.ActorID !== recipientToRemove.ActorID);
599
- const newTos = actorsToTos(updatedRecipients);
600
- handleTosChange(newTos);
601
- }, [localItem.Tos, handleTosChange]);
602
- const handleAddTos2Recipients = useCallback((newRecipients, orValue) => {
594
+ const { andRecipients: participantRecipients } = useMemo(() => {
595
+ return tosToActors(localItem.Tos ?? '');
596
+ }, [localItem.Tos]);
597
+ const handleAddOwnerRecipients = useCallback((newRecipients, orValue) => {
603
598
  const { andRecipients } = tosToActors(localItem.Tos2 ?? '');
604
599
  const updatedRecipients = [...andRecipients, ...newRecipients.map(r => ({ ...r, Or: orValue }))];
605
600
  const newTos = actorsToTos(updatedRecipients);
606
601
  handleTos2Change(newTos);
607
602
  }, [localItem.Tos2, handleTos2Change]);
608
- const handleRemoveTos2Recipient = useCallback((recipientToRemove) => {
603
+ const handleRemoveOwnerRecipient = useCallback((recipientToRemove) => {
609
604
  const { andRecipients } = tosToActors(localItem.Tos2 ?? '');
610
605
  const updatedRecipients = andRecipients.filter(r => r.ActorType !== recipientToRemove.ActorType || r.ActorID !== recipientToRemove.ActorID);
611
606
  const newTos = actorsToTos(updatedRecipients);
612
607
  handleTos2Change(newTos);
613
608
  }, [localItem.Tos2, handleTos2Change]);
614
- return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${SDKUI_Localizator.Dossier})`, value: localItem.PlatformObjName, valueOrig: localItemOrig.PlatformObjName, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjName ?? '') !== (localItemOrig.PlatformObjName ?? ''), onValueChanged: handlePlatformObjNameChange }), _jsx(TMDropDown, { dataSource: dossierTypes, label: `${SDKUI_Localizator.Description} (${SDKUI_Localizator.Dossier})`, value: localItem.Value3asInt, isModifiedWhen: (localItem.Value3asInt ?? 0) !== (localItemOrig.Value3asInt ?? 0), onValueChanged: (e) => { handleValue3asIntChange(e.target.value); } }), _jsx(TMTextExpression, { label: `${SDKUI_Localizator.Description} (${SDKUI_Localizator.Dossier})`, value: localItem.PlatformObjDescr, valueOrig: localItemOrig.PlatformObjDescr, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjDescr ?? '') !== (localItemOrig.PlatformObjDescr ?? ''), onValueChanged: handlePlatformObjDescrChange }), _jsx(TMCultureIDPicker, { label: SDKUI_Localizator.Format, selectedValue: localItem.FormatCultureID, isModifiedWhen: localItem.FormatCultureID !== localItemOrig.FormatCultureID, openChooserBySingleClick: true, onSelectCultureID: handleFormatCultureIDChange }), _jsx(TMTextExpression, { label: `${SDKUI_Localizator.CommentText} (${SDKUI_Localizator.BlogCase})`, placeHolder: 'Inserisci il valore', rows: 2, value: localItem.Value1asString, valueOrig: localItemOrig.Value1asString, tid: wf?.MTID, isModifiedWhen: (localItem.Value1asString ?? '') !== (localItemOrig.Value1asString ?? ''), onValueChanged: handleValue1asStringChange }), _jsx(TMCheckBox, { value: localItem.Value1asInt ?? 0, label: SDKUI_Localizator.WorkflowAddDcmtAsAttachment, isModifiedWhen: localItem.Value1asInt !== localItemOrig.Value1asInt, onValueChanged: handleValue1asIntChange }), _jsx(TMCheckBox, { value: localItem.Value2asInt ?? 0, label: SDKUI_Localizator.WorkflowAddDcmtToDossier, isModifiedWhen: localItem.Value2asInt !== localItemOrig.Value2asInt, onValueChanged: handleValue2asIntChange }), _jsx(TMCheckBox, { value: localItem.Trunc ?? 0, label: SDKUI_Localizator.TruncateString, isModifiedWhen: localItem.Trunc !== localItemOrig.Trunc, onValueChanged: handleTruncChange }), _jsxs(RecipientsContainer, { children: [_jsx(RecipientList, { recipients: tosRecipients, title: SDKUI_Localizator.OwnerName, tid: wf?.MTID, onAdd: (newRecipients) => handleAddTosRecipients(newRecipients, 0), onRemove: handleRemoveTosRecipient }), _jsx(RecipientList, { recipients: tos2Recipients, title: SDKUI_Localizator.Participants, tid: wf?.MTID, onAdd: (newRecipients) => handleAddTos2Recipients(newRecipients, 0), onRemove: handleRemoveTos2Recipient })] })] }));
609
+ const handleAddParticipantRecipients = useCallback((newRecipients, orValue) => {
610
+ const { andRecipients } = tosToActors(localItem.Tos ?? '');
611
+ const updatedRecipients = [...andRecipients, ...newRecipients.map(r => ({ ...r, Or: orValue }))];
612
+ const newTos = actorsToTos(updatedRecipients);
613
+ handleTosChange(newTos);
614
+ }, [localItem.Tos, handleTosChange]);
615
+ const handleRemoveParticipantRecipient = useCallback((recipientToRemove) => {
616
+ const { andRecipients } = tosToActors(localItem.Tos ?? '');
617
+ const updatedRecipients = andRecipients.filter(r => r.ActorType !== recipientToRemove.ActorType || r.ActorID !== recipientToRemove.ActorID);
618
+ const newTos = actorsToTos(updatedRecipients);
619
+ handleTosChange(newTos);
620
+ }, [localItem.Tos, handleTosChange]);
621
+ return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${SDKUI_Localizator.Dossier})`, value: localItem.PlatformObjName, valueOrig: localItemOrig.PlatformObjName, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjName ?? '') !== (localItemOrig.PlatformObjName ?? ''), onValueChanged: handlePlatformObjNameChange }), _jsx(TMDropDown, { dataSource: dossierTypes, label: SDKUI_Localizator.DossierType, value: localItem.Value3asInt, isModifiedWhen: (localItem.Value3asInt ?? 0) !== (localItemOrig.Value3asInt ?? 0), onValueChanged: (e) => { handleValue3asIntChange(e.target.value); } }), _jsx(TMTextExpression, { label: `${SDKUI_Localizator.Description} (${SDKUI_Localizator.Dossier})`, value: localItem.PlatformObjDescr, valueOrig: localItemOrig.PlatformObjDescr, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjDescr ?? '') !== (localItemOrig.PlatformObjDescr ?? ''), onValueChanged: handlePlatformObjDescrChange }), _jsx(TMCultureIDPicker, { label: SDKUI_Localizator.Format, selectedValue: localItem.FormatCultureID, isModifiedWhen: localItem.FormatCultureID !== localItemOrig.FormatCultureID, openChooserBySingleClick: true, onSelectCultureID: handleFormatCultureIDChange }), _jsx(TMTextExpression, { label: `${SDKUI_Localizator.CommentText} (${SDKUI_Localizator.BlogCase})`, placeHolder: 'Inserisci il valore', rows: 2, value: localItem.Value1asString, valueOrig: localItemOrig.Value1asString, tid: wf?.MTID, isModifiedWhen: (localItem.Value1asString ?? '') !== (localItemOrig.Value1asString ?? ''), onValueChanged: handleValue1asStringChange }), _jsx(TMCheckBox, { value: localItem.Value1asInt ?? 0, label: SDKUI_Localizator.WorkflowAddDcmtAsAttachment, isModifiedWhen: localItem.Value1asInt !== localItemOrig.Value1asInt, onValueChanged: handleValue1asIntChange }), _jsx(TMCheckBox, { value: localItem.Value2asInt ?? 0, label: SDKUI_Localizator.WorkflowAddDcmtToDossier, isModifiedWhen: localItem.Value2asInt !== localItemOrig.Value2asInt, onValueChanged: handleValue2asIntChange }), _jsx(TMCheckBox, { value: localItem.Trunc ?? 0, label: SDKUI_Localizator.TruncateString, isModifiedWhen: localItem.Trunc !== localItemOrig.Trunc, onValueChanged: handleTruncChange }), _jsxs(RecipientsContainer, { children: [_jsx(RecipientList, { recipients: ownerRecipients, title: SDKUI_Localizator.OwnerName, tid: wf?.MTID, maxRecipients: 1, validationItems: validationItems.filter(v => v.PropertyName === DiagramItemProps.Tos2), onAdd: (newRecipients) => handleAddOwnerRecipients(newRecipients, 0), onRemove: handleRemoveOwnerRecipient }), _jsx(RecipientList, { recipients: participantRecipients, title: SDKUI_Localizator.Participants, tid: wf?.MTID, onAdd: (newRecipients) => handleAddParticipantRecipients(newRecipients, 0), onRemove: handleRemoveParticipantRecipient })] })] }));
615
622
  };
616
623
  const renderAddPartsFields = () => {
617
624
  const { andRecipients: tosRecipients } = useMemo(() => {
@@ -679,7 +686,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
679
686
  default:
680
687
  specificFields = null;
681
688
  }
682
- return (_jsxs(FormContainer, { children: [renderCommonFields(), specificFields, _jsxs(ButtonsContainer, { children: [_jsx(TMButton, { caption: 'Applica', btnStyle: 'advanced', advancedColor: TMColors.tertiary, icon: _jsx(IconApply, {}), showTooltip: false, disabled: !isModified, onClick: handleSave }), _jsx(TMButton, { caption: 'Annulla', btnStyle: 'toolbar', color: 'primary', icon: _jsx(IconUndo, {}), showTooltip: false, disabled: !isModified, onClick: handleCancel })] })] }));
689
+ return (_jsxs(FormContainer, { children: [_jsxs(FieldsContainer, { children: [renderCommonFields(), specificFields] }), _jsxs(ButtonsContainer, { children: [_jsx(TMButton, { caption: 'Applica', btnStyle: 'advanced', advancedColor: TMColors.tertiary, icon: _jsx(IconApply, {}), showTooltip: false, disabled: !isModified || validationItems.some(v => v.ResultType === ResultTypes.ERROR), onClick: handleSave }), _jsx(TMButton, { caption: 'Annulla', btnStyle: 'toolbar', color: 'primary', icon: _jsx(IconUndo, {}), showTooltip: false, disabled: !isModified, onClick: handleCancel })] })] }));
683
690
  };
684
691
  return (_jsx(TMModal, { title: LocalizeDiagramItemType(localItem.Type), onClose: onClose, isModal: true, width: calculatedWidth, height: calculatedHeight, children: renderForm() }));
685
692
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { QueryDescriptor } from '@topconsultnpm/sdk-ts';
2
+ import { QueryDescriptor, ValidationItem } from '@topconsultnpm/sdk-ts';
3
3
  export declare enum WorkItemActorTypes {
4
4
  None = 0,
5
5
  UID = 1,
@@ -19,6 +19,8 @@ interface RecipientListProps {
19
19
  title: string;
20
20
  tid?: number;
21
21
  qd?: QueryDescriptor;
22
+ maxRecipients?: number;
23
+ validationItems?: ValidationItem[];
22
24
  onQDChange?: (newQd: QueryDescriptor | undefined) => void;
23
25
  onAdd: (recipient: WorkItemActor[]) => void;
24
26
  onRemove: (recipient: WorkItemActor) => void;
@@ -7,6 +7,7 @@ import { TMUserChooserForm } from '../../../choosers/TMUserChooser';
7
7
  import { TMGroupChooserForm, TMGroupIdViewer } from '../../../choosers/TMGroupChooser';
8
8
  import { TMMidViewer } from '../../../viewers/TMMidViewer';
9
9
  import { SDK_Globals, SDK_Localizator } from '@topconsultnpm/sdk-ts';
10
+ import TMVilViewer from '../../../base/TMVilViewer';
10
11
  import { useOutsideClick } from '../../../../hooks/useOutsideClick';
11
12
  import { FormModes } from '../../../../ts';
12
13
  import { TMMessageBoxManager, ButtonNames } from '../../../base/TMPopUp';
@@ -70,7 +71,7 @@ const FloatingMenu = styled.div `
70
71
  const FloatingMenuButton = (props) => {
71
72
  return _jsx(TMButton, { width: "100%", ...props });
72
73
  };
73
- const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange }) => {
74
+ const RecipientList = ({ recipients, title, tid, qd, maxRecipients, validationItems, onAdd, onRemove, onQDChange }) => {
74
75
  const [uiState, setUiState] = useState({
75
76
  isMenuOpen: false,
76
77
  showUserChooser: false,
@@ -102,7 +103,7 @@ const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange
102
103
  onAdd(recipientsToAdd);
103
104
  }
104
105
  setUiState(prevState => ({ ...prevState, showUserChooser: false }));
105
- }, []);
106
+ }, [onAdd]);
106
107
  const handleGroupChosen = useCallback((IDs) => {
107
108
  if (IDs && IDs.length > 0) {
108
109
  const recipientsToAdd = IDs.map(id => ({
@@ -113,7 +114,7 @@ const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange
113
114
  onAdd(recipientsToAdd);
114
115
  }
115
116
  setUiState(prevState => ({ ...prevState, showGroupChooser: false }));
116
- }, []);
117
+ }, [onAdd]);
117
118
  const handleMetadataChosen = useCallback((IDs) => {
118
119
  if (IDs && IDs.length > 0) {
119
120
  const recipientsToAdd = IDs.map(item => ({
@@ -124,8 +125,11 @@ const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange
124
125
  onAdd(recipientsToAdd);
125
126
  }
126
127
  setUiState(prevState => ({ ...prevState, showMetadataChooser: false }));
127
- }, []);
128
+ }, [onAdd]);
129
+ const isMaxReached = maxRecipients !== undefined && recipients.length >= maxRecipients;
128
130
  const handleAddClick = () => {
131
+ if (isMaxReached)
132
+ return;
129
133
  setUiState(prevState => ({ ...prevState, isMenuOpen: !prevState.isMenuOpen }));
130
134
  };
131
135
  const handleRecipientClick = useCallback((index) => {
@@ -195,11 +199,11 @@ const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange
195
199
  document.removeEventListener('keydown', handleKeyPress);
196
200
  };
197
201
  }, [handleKeyPress]);
198
- return (_jsxs(RecipientsColumn, { children: [_jsxs(HeaderContainer, { children: [_jsx("p", { style: { fontWeight: 600 }, children: title }), _jsx(TMButton, { btnStyle: 'icon', caption: SDKUI_Localizator.AddRecipient, icon: _jsx(IconAdd, {}), onClick: handleAddClick }), uiState.isMenuOpen && renderFloatingMenu()] }), _jsx("div", { style: { height: '150px', overflowY: 'auto', gap: '5px', display: 'flex', flexDirection: 'column' }, children: recipients.map((recipient, index) => (_jsxs(RecipientItem, { "$isSelected": uiState.selectedRecipientIndex === index, onClick: () => handleRecipientClick(index), tabIndex: 0, children: [_jsx(IconDelete, { color: '#c00', cursor: 'pointer', onClick: (e) => {
199
- e.stopPropagation();
200
- onRemove(recipient);
201
- setUiState(prevState => ({ ...prevState, selectedRecipientIndex: null })); // Resetta la selezione
202
- } }), renderActorViewer(recipient)] }, index))) }), uiState.showUserChooser && _jsx(TMUserChooserForm, { allowMultipleSelection: true, allowSorting: true, onClose: () => setUiState(prevState => ({ ...prevState, showUserChooser: false })), onChoose: (IDs) => handleUserChosen(IDs) }), uiState.showGroupChooser && _jsx(TMGroupChooserForm, { allowMultipleSelection: true, allowSorting: true, onClose: () => setUiState(prevState => ({ ...prevState, showGroupChooser: false })), onChoose: (IDs) => handleGroupChosen(IDs) }), uiState.showMetadataChooser && tid && _jsx(TMMetadataChooserForm, { allowMultipleSelection: true, allowSorting: true, tids: [tid], onClose: () => setUiState(prevState => ({ ...prevState, showMetadataChooser: false })), onChoose: (IDs) => handleMetadataChosen(IDs) }), uiState.showQdEditor &&
202
+ return (_jsxs(RecipientsColumn, { children: [_jsxs(HeaderContainer, { children: [_jsx("p", { style: { fontWeight: 600 }, children: title }), _jsx(TMButton, { btnStyle: 'icon', caption: SDKUI_Localizator.AddRecipient, icon: _jsx(IconAdd, {}), onClick: handleAddClick, disabled: isMaxReached }), uiState.isMenuOpen && !isMaxReached && renderFloatingMenu()] }), _jsx(TMVilViewer, { vil: validationItems }), _jsx("div", { style: { height: '150px', overflowY: 'auto', gap: '5px', display: 'flex', flexDirection: 'column' }, children: recipients.map((recipient, index) => (_jsxs(RecipientItem, { "$isSelected": uiState.selectedRecipientIndex === index, onClick: () => handleRecipientClick(index), tabIndex: 0, children: [_jsx("span", { style: { display: 'flex', alignItems: 'center', flexShrink: 0 }, children: _jsx(IconDelete, { color: '#c00', cursor: 'pointer', onClick: (e) => {
203
+ e.stopPropagation();
204
+ onRemove(recipient);
205
+ setUiState(prevState => ({ ...prevState, selectedRecipientIndex: null }));
206
+ } }) }), _jsx("span", { style: { flex: 1, minWidth: 0, display: 'flex', alignItems: 'center' }, children: renderActorViewer(recipient) })] }, index))) }), uiState.showUserChooser && _jsx(TMUserChooserForm, { allowMultipleSelection: true, allowSorting: true, onClose: () => setUiState(prevState => ({ ...prevState, showUserChooser: false })), onChoose: (IDs) => handleUserChosen(IDs) }), uiState.showGroupChooser && _jsx(TMGroupChooserForm, { allowMultipleSelection: true, allowSorting: true, onClose: () => setUiState(prevState => ({ ...prevState, showGroupChooser: false })), onChoose: (IDs) => handleGroupChosen(IDs) }), uiState.showMetadataChooser && tid && _jsx(TMMetadataChooserForm, { allowMultipleSelection: true, allowSorting: true, tids: [tid], onClose: () => setUiState(prevState => ({ ...prevState, showMetadataChooser: false })), onChoose: (IDs) => handleMetadataChosen(IDs) }), uiState.showQdEditor &&
203
207
  _jsx(TMModal, { title: SDKUI_Localizator.QueryDefine, onClose: () => setUiState(prevState => ({ ...prevState, showQdEditor: false })), children: _jsx(TMQueryEditor, { inputData: qd, formMode: FormModes.Update, showDistinct: true, onApplied: handleQdChosen, onClose: () => setUiState(prevState => ({ ...prevState, showQdEditor: false })) }) })] }));
204
208
  };
205
209
  export default RecipientList;
@@ -1,6 +1,7 @@
1
1
  import { PlatformObjectValidator, QueryValidatorOptions, ResultTypes, ValidationItem, WorkItemStatus } from '@topconsultnpm/sdk-ts';
2
2
  import { DiagramItemTypes, ArrowSymbol } from './interfaces'; // Assicurati che il percorso sia corretto
3
3
  import { generateUUID, LocalizeDiagramItemType, SDKUI_Localizator } from '../../../../helper';
4
+ import { tosToActors } from './WorkitemRecipientsEditor';
4
5
  /**
5
6
  * Calculates the angle in degrees of an arrow based on two points.
6
7
  * @param prevPoint The previous point on the trajectory.
@@ -484,6 +485,16 @@ export const wfDiagramItemValidator = async (d) => {
484
485
  vil.push(new ValidationItem(ResultTypes.ERROR, LocalizeDiagramItemType(d.Type), `La query della condizione '${d.ItemName}' non contiene criteri di selezione`, [DiagramItemProps.QD]));
485
486
  }
486
487
  break;
488
+ case DiagramItemTypes.CaseFlow_Create:
489
+ PlatformObjectValidator.RequiredStringValidator(d.ItemName, DiagramItemProps.ItemName, vil, SDKUI_Localizator.Name);
490
+ PlatformObjectValidator.RequiredStringValidator(d.Tos2, DiagramItemProps.Tos2, vil, SDKUI_Localizator.OwnerName);
491
+ if (d.Tos2) {
492
+ const { andRecipients } = tosToActors(d.Tos2);
493
+ if (andRecipients.length > 1) {
494
+ vil.push(new ValidationItem(ResultTypes.ERROR, DiagramItemProps.Tos2, SDKUI_Localizator.WorkflowOnlyOneOwnerAllowed));
495
+ }
496
+ }
497
+ break;
487
498
  }
488
499
  return vil;
489
500
  };
@@ -38,11 +38,12 @@ export const TMMidViewer = ({ isMetadataSelected = false, color, tmSession, tid_
38
38
  color: md?.isRequired == 1 ? 'red' : color,
39
39
  }, children: [showIcon && _jsx(TMMetadataIcon, { isMetadataSelected: isMetadataSelected, tid: tid_mid?.tid, md: md, color: color }), _jsx("p", { title: displayName(), style: {
40
40
  textAlign: 'left',
41
+ margin: 0,
41
42
  marginLeft: showIcon ? '5px' : '',
42
43
  whiteSpace: 'nowrap',
43
44
  overflow: 'hidden',
44
45
  textOverflow: 'ellipsis'
45
- }, children: displayName() }), showId && _jsx("p", { style: { padding: '0px 3px' }, children: `(MID: ${tid_mid?.mid})` })] }));
46
+ }, children: displayName() }), showId && _jsx("p", { style: { padding: '0px 3px', margin: 0 }, children: `(MID: ${tid_mid?.mid})` })] }));
46
47
  };
47
48
  export const TMMetadataIcon = ({ tid, md, color, layoutMode = LayoutModes.Update, isMetadataSelected = false, elementStyle }) => {
48
49
  let selectedMetadataStyle = { borderBottom: isMetadataSelected ? `thick solid ${TMColors.text_normal}` : 'none', height: 'max-content' };
@@ -202,6 +202,7 @@ export declare class SDKUI_Localizator {
202
202
  static get Domain(): "Domäne" | "Domain" | "Dominio" | "Domaine";
203
203
  static get Dossier(): "Übung" | "Dossier" | "Expediente" | "Pratique" | "Prática" | "Pratica";
204
204
  static get Dossiers(): "Akten" | "Dossiers" | "Expedientes" | "Pratiques" | "Práticas" | "Pratiche";
205
+ static get DossierType(): "Aktentyp" | "Dossier Type" | "Tipo de Expediente" | "Type de Pratique" | "Tipo de Prática" | "Modello di Pratica";
205
206
  static get DownloadFile(): string;
206
207
  static get Download_in_Process(): "Download läuft" | "Download in progress" | "Descarga en curso" | "Téléchargement en cours" | "Download em progresso" | "Download in corso";
207
208
  static get DownloadXMLAttachments(): string;
@@ -771,6 +772,7 @@ export declare class SDKUI_Localizator {
771
772
  static get WorkflowStartAfterArchive(): "Starten Sie die Instanz beim Archivieren des Dokuments" | "Start the instance when you archive the document" | "Iniciar la instancia cuando se almacena el documento" | "Démarrer l'instance lorsque vous archivez le document" | "Inicie a instância quando você fizer check in no documento" | "Avviare l'istanza quando si archivia il documento";
772
773
  static get WorkflowStartAfterUpdate(): "Starten Sie die Instanz beim Bearbeiten der folgenden Methadaten" | "Start the instance when updating the following metadata" | "Iniciar la instancia cuando se modifican los siguientes metadatos" | "Démarrer l'instance lors de l'édition des métadonnées suivantes" | "Inicie a instância ao editar os seguintes metadados" | "Avviare l'istanza quando si modificano i seguenti metadati";
773
774
  static get WorkflowGetRecipientsFromQuery(): "Ermitteln Sie die Empfänger aus der ABFRAGE" | "Get the recipients from QUERY" | "Obtenga los destinatarios de QUERY" | "Obtenez les destinataires de QUERY" | "Obtenha os destinatários de QUERY" | "Ottieni i destinatari da QUERY";
775
+ static get WorkflowOnlyOneOwnerAllowed(): "Es ist nur ein Eigentümer zulässig" | "Only one owner is allowed" | "Solo se permite un propietario" | "Un seul propriétaire est autorisé" | "Apenas um proprietário é permitido" | "È consentito un solo proprietario";
774
776
  static get WorkflowOnlyOneQueryForRecipients(): "Nur eine Abfrage für die Empfänger definieren" | "Define only one query for recipients" | "Definir solo una consulta para los destinatarios" | "Définissez une seule requête pour les destinataires" | "Defina apenas uma query para os destinatários" | "Definire solo una query per i destinatari";
775
777
  static get WorkflowRecipientSetRule(): "Verwalten Sie Empfänger mit der folgenden Regel" | "Manage recipients with the following rule" | "Gestionar los destinatarios con la siguiente regla" | "Gérer les destinataires avec la règle suivante" | "Gerenciar destinatários com a seguinte regra" | "Gestisci i destinatari con la seguente regola";
776
778
  static get WorkGroup(): "Arbeitsgruppe" | "Work Group" | "Grupo de Trabajo" | "Groupe de travail" | "Grupo de Trabalho" | "Gruppo di lavoro";
@@ -1969,6 +1969,16 @@ export class SDKUI_Localizator {
1969
1969
  default: return "Pratiche";
1970
1970
  }
1971
1971
  }
1972
+ static get DossierType() {
1973
+ switch (this._cultureID) {
1974
+ case CultureIDs.De_DE: return "Aktentyp";
1975
+ case CultureIDs.En_US: return "Dossier Type";
1976
+ case CultureIDs.Es_ES: return "Tipo de Expediente";
1977
+ case CultureIDs.Fr_FR: return "Type de Pratique";
1978
+ case CultureIDs.Pt_PT: return "Tipo de Prática";
1979
+ default: return "Modello di Pratica";
1980
+ }
1981
+ }
1972
1982
  static get DownloadFile() {
1973
1983
  switch (this._cultureID) {
1974
1984
  case CultureIDs.De_DE: return "Datei herunterladen";
@@ -7694,6 +7704,16 @@ export class SDKUI_Localizator {
7694
7704
  default: return "Ottieni i destinatari da QUERY";
7695
7705
  }
7696
7706
  }
7707
+ static get WorkflowOnlyOneOwnerAllowed() {
7708
+ switch (this._cultureID) {
7709
+ case CultureIDs.De_DE: return "Es ist nur ein Eigentümer zulässig";
7710
+ case CultureIDs.En_US: return "Only one owner is allowed";
7711
+ case CultureIDs.Es_ES: return "Solo se permite un propietario";
7712
+ case CultureIDs.Fr_FR: return "Un seul propriétaire est autorisé";
7713
+ case CultureIDs.Pt_PT: return "Apenas um proprietário é permitido";
7714
+ default: return "È consentito un solo proprietario";
7715
+ }
7716
+ }
7697
7717
  static get WorkflowOnlyOneQueryForRecipients() {
7698
7718
  switch (this._cultureID) {
7699
7719
  case CultureIDs.De_DE: return "Nur eine Abfrage für die Empfänger definieren";
@@ -76,14 +76,14 @@ export const useDataUserIdItem = () => {
76
76
  return null;
77
77
  if (!userId)
78
78
  return null;
79
- return ud ? _jsx(TMUserIcon, { ud: ud }) : _jsx("div", { title: showTitile ? SDKUI_Localizator.ValueNotPresent : undefined, children: _jsx(IconWarning, { color: TMColors.warning }) });
79
+ return ud ? _jsx(TMUserIcon, { ud: ud }) : _jsx("span", { title: showTitile ? SDKUI_Localizator.ValueNotPresent : undefined, style: { display: 'inline-flex', alignItems: 'center' }, children: _jsx(IconWarning, { color: TMColors.warning }) });
80
80
  };
81
81
  const getDescription = () => {
82
82
  if (!userId)
83
83
  return undefined;
84
84
  return ud ? getCompleteUserName(ud.domain, ud.name) : userId.toString() ?? SDKUI_Localizator.NoneSelection;
85
85
  };
86
- return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '4px' }, children: [getIcon(), _jsx("span", { children: getDescription() })] }));
86
+ return (_jsxs("span", { style: { display: 'inline-flex', alignItems: 'center', gap: '4px', lineHeight: 1 }, children: [getIcon(), _jsx("span", { style: { lineHeight: 'normal' }, children: getDescription() })] }));
87
87
  }, [getUserItem, getCompleteUserName]);
88
88
  return {
89
89
  loadUsersAsync,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.20.0-dev3.14",
3
+ "version": "6.20.0-dev3.16",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",