@topconsultnpm/sdkui-react 6.22.0-dev3.8 → 6.22.0-dev4.10

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.
Files changed (186) hide show
  1. package/lib/components/NewComponents/ContextMenu/styles.d.ts +43 -45
  2. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +60 -67
  3. package/lib/components/base/Styled.d.ts +77 -93
  4. package/lib/components/base/TMAlert.js +6 -8
  5. package/lib/components/base/TMAreaManager.js +53 -55
  6. package/lib/components/base/TMButton.js +4 -2
  7. package/lib/components/base/TMCounterBar.d.ts +2 -2
  8. package/lib/components/base/TMCounterContainer.d.ts +4 -3
  9. package/lib/components/base/TMCounterContainer.js +16 -1
  10. package/lib/components/base/TMCustomButton.d.ts +1 -1
  11. package/lib/components/base/TMCustomButton.js +40 -48
  12. package/lib/components/base/TMDataGrid.js +243 -223
  13. package/lib/components/base/TMDataGridExportForm.d.ts +1 -2
  14. package/lib/components/base/TMFileManager.d.ts +1 -2
  15. package/lib/components/base/TMFileManagerDataGridView.d.ts +1 -2
  16. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
  17. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
  18. package/lib/components/base/TMFileManagerUtils.d.ts +6 -4
  19. package/lib/components/base/TMLayout.d.ts +4 -4
  20. package/lib/components/base/TMList.d.ts +1 -2
  21. package/lib/components/base/TMListView.d.ts +1 -1
  22. package/lib/components/base/TMPanel.js +173 -170
  23. package/lib/components/base/TMSpinner.d.ts +3 -3
  24. package/lib/components/base/TMSpinner.js +9 -7
  25. package/lib/components/base/TMTab.d.ts +3 -4
  26. package/lib/components/base/TMTabControl.d.ts +7 -0
  27. package/lib/components/base/TMTabControl.js +225 -213
  28. package/lib/components/base/TMTooltip.d.ts +1 -1
  29. package/lib/components/base/TMTreeView.d.ts +8 -14
  30. package/lib/components/base/TMTreeView.js +20 -0
  31. package/lib/components/base/TMUserAvatar.d.ts +1 -2
  32. package/lib/components/base/TMVilViewer.d.ts +1 -2
  33. package/lib/components/base/TMWaitPanel.d.ts +2 -3
  34. package/lib/components/base/TMWaitPanel.js +1 -1
  35. package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
  36. package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
  37. package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +179 -0
  38. package/lib/components/base/waitPanel/TMWaitPanelManager.js +373 -0
  39. package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +57 -0
  40. package/lib/components/base/waitPanel/TMWaitPanelView.js +346 -0
  41. package/lib/components/base/waitPanel/index.d.ts +1 -0
  42. package/lib/components/base/waitPanel/index.js +1 -0
  43. package/lib/components/choosers/TMDistinctValues.js +3 -3
  44. package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
  45. package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +1 -2
  46. package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +1 -2
  47. package/lib/components/choosers/TMPathChooser.js +17 -34
  48. package/lib/components/choosers/TMQuickSearchInfo.d.ts +1 -2
  49. package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
  50. package/lib/components/choosers/TMUserChooser.d.ts +2 -2
  51. package/lib/components/editors/TMEditorStyled.d.ts +42 -20
  52. package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
  53. package/lib/components/editors/TMHtmlContentDisplay.d.ts +1 -2
  54. package/lib/components/editors/TMHtmlEditor.d.ts +1 -2
  55. package/lib/components/editors/TMTextBox.d.ts +4 -0
  56. package/lib/components/editors/TMTextBox.js +99 -11
  57. package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
  58. package/lib/components/features/archive/TMArchive.js +7 -2
  59. package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +28 -0
  60. package/lib/components/features/assistant/TMHelpOnLineChat.js +1231 -0
  61. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
  62. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
  63. package/lib/components/features/blog/TMBlogCommentForm.d.ts +1 -2
  64. package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
  65. package/lib/components/features/documents/TMCopyToFolderForm.js +50 -42
  66. package/lib/components/features/documents/TMDcmtForm.js +50 -61
  67. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
  68. package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -4
  69. package/lib/components/features/documents/TMDcmtIcon.js +3 -5
  70. package/lib/components/features/documents/TMDcmtPreview.d.ts +6 -8
  71. package/lib/components/features/documents/TMDcmtPreview.js +5 -3
  72. package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -2
  73. package/lib/components/features/documents/TMDcmtTasks.js +2 -9
  74. package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
  75. package/lib/components/features/documents/TMFileUploader.js +5 -5
  76. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
  77. package/lib/components/features/documents/TMMasterDetailDcmts.js +53 -141
  78. package/lib/components/features/documents/TMMasterInfoFields.d.ts +1 -2
  79. package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
  80. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
  81. package/lib/components/features/documents/TMMergeToPdfForm.js +59 -56
  82. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +1 -2
  83. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +14 -15
  84. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +5 -5
  85. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +3 -3
  86. package/lib/components/features/documents/TMRelationViewer.d.ts +13 -14
  87. package/lib/components/features/documents/TMRelationViewer.js +206 -143
  88. package/lib/components/features/documents/relationTreeState.d.ts +32 -0
  89. package/lib/components/features/documents/relationTreeState.js +89 -0
  90. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +1 -2
  91. package/lib/components/features/search/TMMetadataOutputForm.d.ts +1 -2
  92. package/lib/components/features/search/TMMetadataSorterForm.d.ts +1 -2
  93. package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
  94. package/lib/components/features/search/TMSearch.d.ts +1 -2
  95. package/lib/components/features/search/TMSearch.js +3 -4
  96. package/lib/components/features/search/TMSearchQueryPanel.d.ts +3 -9
  97. package/lib/components/features/search/TMSearchQueryPanel.js +0 -4
  98. package/lib/components/features/search/TMSearchResult.d.ts +5 -0
  99. package/lib/components/features/search/TMSearchResult.js +129 -102
  100. package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
  101. package/lib/components/features/search/TMSignatureInfoContent.d.ts +1 -2
  102. package/lib/components/features/search/TMTreeSelector.js +23 -27
  103. package/lib/components/features/search/TMViewHistoryDcmt.d.ts +1 -2
  104. package/lib/components/features/search/TMViewHistoryDcmt.js +15 -26
  105. package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
  106. package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
  107. package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
  108. package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
  109. package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
  110. package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
  111. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
  112. package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
  113. package/lib/components/features/tasks/TMTasksView.js +97 -90
  114. package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +2 -3
  115. package/lib/components/features/wg/TMWGsCopyMoveForm.js +95 -91
  116. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +7 -8
  117. package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -3
  118. package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -3
  119. package/lib/components/forms/Login/Chooser.d.ts +2 -2
  120. package/lib/components/forms/TMChooserForm.d.ts +1 -2
  121. package/lib/components/forms/TMResultDialog.js +1 -1
  122. package/lib/components/forms/TMSaveForm.d.ts +4 -4
  123. package/lib/components/grids/TMBlogAttachments.d.ts +1 -2
  124. package/lib/components/grids/TMBlogHeader.d.ts +1 -1
  125. package/lib/components/grids/TMBlogsPost.d.ts +1 -1
  126. package/lib/components/grids/TMBlogsPost.js +93 -97
  127. package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
  128. package/lib/components/grids/TMValidationItemsList.d.ts +1 -2
  129. package/lib/components/index.d.ts +5 -1
  130. package/lib/components/index.js +4 -1
  131. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -2
  132. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +4 -3
  133. package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +3 -2
  134. package/lib/components/layout/panelManager/TMPanelManagerContext.js +5 -1
  135. package/lib/components/layout/panelManager/TMPanelManagerLoader.d.ts +5 -0
  136. package/lib/components/layout/panelManager/TMPanelManagerLoader.js +18 -0
  137. package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +6 -5
  138. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +4 -8
  139. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
  140. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.js +2 -1
  141. package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
  142. package/lib/components/pages/TMPage.d.ts +1 -1
  143. package/lib/components/pages/TMPage.js +32 -31
  144. package/lib/components/query/TMQueryEditor.d.ts +13 -14
  145. package/lib/components/query/TMQueryEditor.js +2 -1
  146. package/lib/components/settings/SettingsAppearance.d.ts +1 -2
  147. package/lib/components/sidebar/TMAboutApp.d.ts +1 -2
  148. package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
  149. package/lib/components/sidebar/TMHeader.d.ts +4 -3
  150. package/lib/components/sidebar/TMHeader.js +2 -2
  151. package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -3
  152. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +2 -3
  153. package/lib/components/viewers/TMMidViewer.d.ts +2 -2
  154. package/lib/components/viewers/TMTidViewer.d.ts +2 -2
  155. package/lib/helper/Enum_Localizator.js +1 -0
  156. package/lib/helper/SDKUI_Globals.d.ts +7 -2
  157. package/lib/helper/SDKUI_Globals.js +7 -2
  158. package/lib/helper/SDKUI_Localizator.d.ts +31 -6
  159. package/lib/helper/SDKUI_Localizator.js +301 -51
  160. package/lib/helper/TMAppUpdatedModal.d.ts +1 -2
  161. package/lib/helper/TMAppUpdatedModal.js +93 -93
  162. package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
  163. package/lib/helper/TMIcons.d.ts +280 -280
  164. package/lib/helper/TMPdfViewer.d.ts +1 -2
  165. package/lib/helper/TMToppyMessage.d.ts +2 -2
  166. package/lib/helper/TMUtils.d.ts +4 -10
  167. package/lib/helper/ZipManager.d.ts +1 -1
  168. package/lib/helper/ZipManager.js +2 -1
  169. package/lib/helper/dcmtsHelper.d.ts +2 -0
  170. package/lib/helper/dcmtsHelper.js +3 -1
  171. package/lib/helper/helpers.d.ts +1 -1
  172. package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
  173. package/lib/hooks/useCheckInOutOperations.js +14 -34
  174. package/lib/hooks/useDcmtOperations.d.ts +3 -12
  175. package/lib/hooks/useDcmtOperations.js +201 -184
  176. package/lib/hooks/useDocumentOperations.d.ts +1 -0
  177. package/lib/hooks/useDocumentOperations.js +14 -25
  178. package/lib/hooks/useInputDialog.d.ts +1 -2
  179. package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
  180. package/lib/hooks/useMultiMasterDetailDcmts.js +70 -68
  181. package/lib/hooks/usePreventFileDrop.js +9 -0
  182. package/lib/hooks/useWorkflowApprove.js +33 -17
  183. package/lib/services/caseflow/CaseFlowService.d.ts +69 -9
  184. package/lib/services/caseflow/CaseFlowService.js +126 -58
  185. package/lib/services/platform_services.d.ts +2 -3
  186. package/package.json +2 -2
@@ -1,6 +1,24 @@
1
- import { SDK_Globals, BlogPost, CaseFlowDcmt, CaseFlowInstanceDescriptor, CaseFlowParticipant, CaseFlowWIOperationDescriptor, MetadataValueDescriptor, CF_ParticipantRoles, CF_States, CF_WIOperations, CF_WorkItemCategories, CF_WorkItemStates, UserListCacheService, DcmtTypeListCacheService, } from '@topconsultnpm/sdk-ts';
1
+ import { SDK_Globals, BlogPost, CaseFlowDcmt, CaseFlowInstanceDescriptor, CaseFlowInstanceSearchDescriptor, CaseFlowParticipant, CaseFlowWIOperationDescriptor, MetadataValueDescriptor, CF_ParticipantRoles, CF_States, CF_WIOperations, CF_WorkItemCategories, CF_WorkItemStates, UserListCacheService, DcmtTypeListCacheService, } from '@topconsultnpm/sdk-ts';
2
2
  import { CaseFlowTemplateCacheService } from './CaseFlowTemplateCacheService';
3
- import { getTemplateNameSync, primeTemplateName, primeTemplateNames, primeActionNames } from './caseFlowNameCache';
3
+ import { primeTemplateName, primeTemplateNames, primeActionNames } from './caseFlowNameCache';
4
+ /** Numero massimo di pratiche restituite da una ricerca, se non indicato. */
5
+ export const CASEFLOW_SEARCH_DEFAULT_MAX_RESULTS = 500;
6
+ /**
7
+ * Tetto di `maxResults`. Il server non restituisce mai più di 5000 pratiche e
8
+ * se ne chiede una in più per sapere se il risultato è troncato: oltre 4999
9
+ * il troncamento non sarebbe più riconoscibile.
10
+ */
11
+ export const CASEFLOW_SEARCH_MAX_RESULTS = 4999;
12
+ /**
13
+ * Giorno `YYYY-MM-DD` come mezzanotte UTC. Il client lo invia con
14
+ * `toISOString()` e il server ne usa solo la data: una mezzanotte locale
15
+ * (`new Date(2026, 8, 30)` in Italia = `2026-09-29T22:00Z`) finirebbe sul
16
+ * giorno precedente.
17
+ */
18
+ function toUtcDay(day) {
19
+ const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(day ?? '');
20
+ return m ? new Date(Date.UTC(Number(m[1]), Number(m[2]) - 1, Number(m[3]))) : undefined;
21
+ }
4
22
  export class CaseFlowService {
5
23
  // ----- Template / tipi documento (invariati: cache condivise) ------------
6
24
  /** Elenco dei template reali (via CaseFlowTemplateCacheService). */
@@ -105,50 +123,59 @@ export class CaseFlowService {
105
123
  const all = await this.loadAllInstances();
106
124
  return all.filter(cf => cf.ownerID === userId);
107
125
  }
108
- /** Ricerca avanzata sulle istanze applicando i filtri indicati. */
126
+ /**
127
+ * Ricerca avanzata sulle istanze, eseguita dal server (`usp_Cfi_Search`):
128
+ * restituisce solo le pratiche visibili all'utente che soddisfano i
129
+ * criteri, già con la copertina. Tutti i confronti di testo sono
130
+ * "contiene", senza distinzione fra maiuscole e minuscole.
131
+ *
132
+ * Per riconoscere un risultato troncato si chiede al server una pratica
133
+ * in più di `maxResults`: se arriva, la si scarta e `truncated` vale true.
134
+ */
109
135
  static async searchCaseflows(criteria) {
110
- const all = await this.loadAllInstances();
111
- const lowerIncludes = (haystack, needle) => (haystack ?? '').toLowerCase().includes(needle.toLowerCase());
112
- return all.filter(cf => {
113
- if (criteria.templateId != null && cf.cftid !== criteria.templateId)
114
- return false;
115
- if (criteria.name && !lowerIncludes(cf.name, criteria.name))
116
- return false;
117
- if (criteria.description && !lowerIncludes(cf.description, criteria.description))
118
- return false;
119
- if (criteria.state && cf.state !== criteria.state)
120
- return false;
121
- if (criteria.dateFrom) {
122
- const from = new Date(criteria.dateFrom);
123
- if (cf.creationTime && cf.creationTime < from)
124
- return false;
125
- }
126
- if (criteria.dateTo) {
127
- const to = new Date(criteria.dateTo);
128
- if (cf.creationTime && cf.creationTime > to)
129
- return false;
130
- }
131
- if (criteria.metadataFilters && criteria.metadataFilters.length > 0) {
132
- for (const mf of criteria.metadataFilters) {
133
- if (!mf.value.trim())
134
- continue;
135
- const cfMeta = (cf.cover ?? []).find(m => m.mid === mf.mid);
136
- if (!cfMeta || !lowerIncludes(cfMeta.value, mf.value))
137
- return false;
138
- }
139
- }
140
- if (criteria.freeTextMetadata && criteria.freeTextMetadata.trim()) {
141
- const needle = criteria.freeTextMetadata.trim();
142
- const matchesCommon = lowerIncludes(cf.name, needle)
143
- || lowerIncludes(cf.description, needle)
144
- || lowerIncludes(cf.ownerName, needle)
145
- || lowerIncludes(getTemplateNameSync(cf.cftid), needle);
146
- const matchesMeta = (cf.cover ?? []).some(m => lowerIncludes(m.value, needle) || lowerIncludes(m.metadataName, needle));
147
- if (!matchesCommon && !matchesMeta)
148
- return false;
136
+ const engine = SDK_Globals.tmSession?.NewCaseFlowInstanceEngine();
137
+ if (!engine)
138
+ return { items: [], truncated: false };
139
+ const max = Math.min(Math.max(Math.trunc(criteria.maxResults ?? CASEFLOW_SEARCH_DEFAULT_MAX_RESULTS), 1), CASEFLOW_SEARCH_MAX_RESULTS);
140
+ const text = (s) => s?.trim() || undefined;
141
+ const filter = new CaseFlowInstanceSearchDescriptor();
142
+ filter.cftid = criteria.templateId ?? 0;
143
+ filter.name = text(criteria.name);
144
+ filter.description = text(criteria.description);
145
+ filter.state = criteria.state;
146
+ filter.dateFrom = toUtcDay(criteria.dateFrom);
147
+ filter.dateTo = toUtcDay(criteria.dateTo);
148
+ filter.freeText = text(criteria.freeTextMetadata);
149
+ const metadataFilters = (criteria.metadataFilters ?? [])
150
+ .filter(mf => mf.value.trim())
151
+ .map(mf => MetadataValueDescriptor.fromJS({ mid: mf.mid, value: mf.value.trim() }));
152
+ filter.metadataFilters = metadataFilters.length > 0 ? metadataFilters : undefined;
153
+ filter.top = max + 1;
154
+ const list = (await engine.SearchAsync(filter)) ?? [];
155
+ const truncated = list.length > max;
156
+ const items = truncated ? list.slice(0, max) : list;
157
+ // Il server restituisce la copertina con i soli MID e valori: i nomi
158
+ // dei metadati vengono dalla copertina del modello. Lo stesso giro
159
+ // popola le cache dei nomi di modello e azioni usate in rendering.
160
+ const cftids = [...new Set(items.map(i => i.cftid).filter((c) => c != null))];
161
+ const templates = new Map();
162
+ await Promise.all(cftids.map(async (cftid) => {
163
+ const tpl = await CaseFlowTemplateCacheService.GetAsync(cftid);
164
+ if (!tpl)
165
+ return;
166
+ templates.set(cftid, tpl);
167
+ primeTemplateName(tpl.id, tpl.name);
168
+ primeActionNames(tpl);
169
+ }));
170
+ for (const inst of items) {
171
+ const tplCover = inst.cftid != null ? templates.get(inst.cftid)?.cover : undefined;
172
+ for (const m of inst.cover ?? []) {
173
+ if (!m.metadataName)
174
+ m.metadataName = tplCover?.find(md => md.id === m.mid)?.name;
149
175
  }
150
- return true;
151
- });
176
+ }
177
+ await this.resolveUserNames(items);
178
+ return { items, truncated };
152
179
  }
153
180
  /** WorkItem pendenti assegnati all'utente, raggruppati per istanza. */
154
181
  static async getMyPendingWorkItems(userId) {
@@ -221,6 +248,25 @@ export class CaseFlowService {
221
248
  const id = await engine.CreateAsync(d);
222
249
  return id ?? 0;
223
250
  }
251
+ /**
252
+ * Avvia un'istanza tramite StartAsync(cftid, id): il backend porta la pratica
253
+ * da `New` a `InProgress` e materializza i workitem della prima azione.
254
+ *
255
+ * NON va chiamata dopo `CreateCaseFlowInstance`: la Create dell'API REST
256
+ * esegue già lo start internamente, quindi un'istanza appena creata è
257
+ * ancora `New` solo nel descrittore inviato, non lato server. Questa resta
258
+ * per le istanze che si trovano davvero in `New` (avvio differito); sulle
259
+ * altre il backend rifiuta.
260
+ */
261
+ static async startCaseflow(caseFlowId, cftid) {
262
+ const engine = SDK_Globals.tmSession?.NewCaseFlowInstanceEngine();
263
+ if (!engine)
264
+ throw new Error('Motore delle istanze CaseFlow non disponibile.');
265
+ const resolvedCftid = cftid ?? (await this.getCaseflow(caseFlowId))?.cftid;
266
+ if (resolvedCftid == null)
267
+ throw new Error(`Impossibile risolvere il template (cftid) per l'istanza id=${caseFlowId}.`);
268
+ await engine.StartAsync(resolvedCftid, caseFlowId);
269
+ }
224
270
  /**
225
271
  * Elimina un'istanza tramite DeleteAsync(cftid, id). Il cftid è preso dal
226
272
  * template fornito (se disponibile) oppure risolto dall'istanza.
@@ -490,11 +536,10 @@ export class CaseFlowService {
490
536
  /**
491
537
  * Stato "l'utente corrente segue questa pratica" letto dal descrittore.
492
538
  *
493
- * Restituisce `undefined` quando il descrittore non porta l'informazione —
494
- * cioè SEMPRE, finché il backend non aggiunge `IsFollow` in output a
495
- * `usp_Cfi_RetrieveAll`/`usp_Cfi_Retrieve` e la relativa proprietà al
496
- * contratto. Il tipo è tollerante perché la colonna è un BIT/NUMBER e può
497
- * arrivare come booleano, come 0/1 o come stringa.
539
+ * `isFollow` fa ormai parte del contratto (`CaseFlowInstanceDescriptor`):
540
+ * arriva valorizzato da `usp_Cfi_RetrieveAll`/`usp_Cfi_Retrieve`. Resta
541
+ * `undefined` solo quando il descrittore proviene da una sorgente che non
542
+ * popola il campo.
498
543
  *
499
544
  * Da NON dedurre dalla bacheca Home come fanno pratiche-dossier e gruppi di
500
545
  * lavoro (filtro su `HomeBlogPost.classID`): quella query prende `TOP 30`
@@ -503,14 +548,7 @@ export class CaseFlowService {
503
548
  * poi, non esiste nemmeno un ramo nella UNION.
504
549
  */
505
550
  static readFollowFlag(cf) {
506
- const raw = cf.isFollow;
507
- if (typeof raw === 'boolean')
508
- return raw;
509
- if (typeof raw === 'number')
510
- return raw !== 0;
511
- if (raw === '0' || raw === '1')
512
- return raw === '1';
513
- return undefined;
551
+ return cf.isFollow;
514
552
  }
515
553
  // ----- Workitem: movimentazione del flusso -------------------------------
516
554
  //
@@ -551,7 +589,37 @@ export class CaseFlowService {
551
589
  comment: response,
552
590
  }), cftid);
553
591
  }
554
- /** Assegna un'azione a un utente creando il relativo workitem (operazione Assign). */
592
+ /**
593
+ * Prende in carico un'azione per se stessi (operazione Claim): il backend
594
+ * crea il workitem intestato al chiamante e porta l'azione in lavorazione.
595
+ *
596
+ * Non e' un caso particolare di `createWorkItemForAction`: assegnare e'
597
+ * riservato a Owner e Supervisore, prendere in carico e' di chiunque lavori
598
+ * alla pratica. Passando dall'operazione Assign, un Partecipante si vedeva
599
+ * rifiutare la presa in carico (TMC-2789).
600
+ */
601
+ static async claimAction(caseFlowId, actionID, cftid) {
602
+ await this.executeWorkItemOperation(caseFlowId, CaseFlowWIOperationDescriptor.fromJS({
603
+ operation: CF_WIOperations.Claim,
604
+ actionID,
605
+ }), cftid);
606
+ }
607
+ /**
608
+ * Rilascia un workitem preso in carico (operazione ReleaseClaim): il backend
609
+ * lo cancella e, se per quell'azione non restano altri destinatari, la riporta
610
+ * disponibile per la presa in carico.
611
+ *
612
+ * Stessa chiamata per due gesti diversi, e' la guardia della SP a distinguerli:
613
+ * il detentore rilascia il proprio workitem, un Owner/Supervisore annulla
614
+ * l'assegnazione di un altro. Chi chiama non deve dire quale dei due sta facendo.
615
+ */
616
+ static async releaseClaim(caseFlowId, workItemId, cftid) {
617
+ await this.executeWorkItemOperation(caseFlowId, CaseFlowWIOperationDescriptor.fromJS({
618
+ operation: CF_WIOperations.ReleaseClaim,
619
+ wiid: workItemId,
620
+ }), cftid);
621
+ }
622
+ /** Assegna un'azione a un ALTRO utente creando il relativo workitem (operazione Assign). */
555
623
  static async createWorkItemForAction(caseFlowId, actionID, toUserID, description, cftid) {
556
624
  await this.executeWorkItemOperation(caseFlowId, CaseFlowWIOperationDescriptor.fromJS({
557
625
  operation: CF_WIOperations.Assign,
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { JobTypes, ObjectClasses, ProcessDescriptor, DcmtTypeDescriptor } from "@topconsultnpm/sdk-ts";
3
2
  export declare class PlatformObjectService {
4
3
  static readonly retrieveAllAsync: (objClass: ObjectClasses, refreshCache?: boolean) => Promise<import("@topconsultnpm/sdk-ts").AreaDescriptor[] | import("@topconsultnpm/sdk-ts").NotificationDescriptor[] | import("@topconsultnpm/sdk-ts").RelationDescriptor[] | import("@topconsultnpm/sdk-ts").TaskDescriptor[] | import("@topconsultnpm/sdk-ts").WorkingGroupDescriptor[] | undefined>;
@@ -14,6 +13,6 @@ export declare class PlatformObjectService {
14
13
  static readonly createAsync: (objClass: ObjectClasses, jobType: JobTypes, d: any) => Promise<number | undefined>;
15
14
  static readonly deleteAsync: (objClass: ObjectClasses, id: number) => Promise<number | undefined>;
16
15
  static readonly getName: (objClass: ObjectClasses, jobType?: JobTypes, isPlural?: boolean) => string;
17
- static readonly getIcon: (objClass: ObjectClasses, d: any) => React.JSX.Element;
18
- static readonly getTooltip: (objClass: ObjectClasses, d: any) => React.JSX.Element | null;
16
+ static readonly getIcon: (objClass: ObjectClasses, d: any) => import("react/jsx-runtime").JSX.Element;
17
+ static readonly getTooltip: (objClass: ObjectClasses, d: any) => import("react/jsx-runtime").JSX.Element | null;
19
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.22.0-dev3.8",
3
+ "version": "6.22.0-dev4.10",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -42,7 +42,7 @@
42
42
  "lib"
43
43
  ],
44
44
  "dependencies": {
45
- "@topconsultnpm/sdk-ts": "6.22.0-dev3.3",
45
+ "@topconsultnpm/sdk-ts": "6.22.0-dev4.3",
46
46
  "@zip.js/zip.js": "2.8.26",
47
47
  "buffer": "^6.0.3",
48
48
  "devextreme": "^26.1.4",