@topconsultnpm/sdkui-react 6.19.0-dev1.34 → 6.19.0-dev1.35

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.
@@ -153,18 +153,12 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
153
153
  return;
154
154
  if (!DID && layoutMode === LayoutModes.Update)
155
155
  return;
156
- // Esegui in parallelo GetMetadataAsync e LayoutCacheService.GetAsync
157
- // poiché non dipendono l'uno dall'altro
158
- const [getMetadataResult, resLayout] = await Promise.all([
159
- layoutMode === LayoutModes.Update
160
- ? SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(TID, DID, true)
161
- : Promise.resolve(undefined),
162
- LayoutCacheService.GetAsync(TID, layoutMode)
163
- ]);
164
- // DcmtTypeListCacheService dipende da getMetadataResult, quindi deve attendere
156
+ let getMetadataResult;
157
+ if (layoutMode === LayoutModes.Update) {
158
+ getMetadataResult = await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(TID, DID, true);
159
+ }
165
160
  let dtd = await DcmtTypeListCacheService.GetWithNotGrantedAsync(TID, DID, getMetadataResult);
166
161
  setFromDTD(dtd);
167
- setLayout(resLayout);
168
162
  if (layoutMode === LayoutModes.Update || (layoutMode === LayoutModes.Ark && DID)) {
169
163
  await setMetadataList(dtd?.metadata ?? [], getMetadataResult);
170
164
  }
@@ -175,6 +169,8 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
175
169
  setFormData(structuredClone(metadataList));
176
170
  formDataOrigRef.current = structuredClone(metadataList);
177
171
  }
172
+ let resLayout = await LayoutCacheService.GetAsync(TID, layoutMode);
173
+ setLayout(resLayout);
178
174
  (layoutMode === LayoutModes.Ark && !inputFile) && handleReset();
179
175
  }
180
176
  catch (e) {
@@ -288,9 +284,11 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
288
284
  return;
289
285
  if (!formData || formData.length === 0)
290
286
  return;
287
+ // Check if formData has actual user metadata (mid > 99), not just system metadata
288
+ if (!formData.some(md => md.mid && md.mid > 99))
289
+ return;
291
290
  if (appliedInputMidsRef.current && deepCompare(appliedInputMidsRef.current, inputMids))
292
291
  return;
293
- appliedInputMidsRef.current = inputMids;
294
292
  let data = structuredClone(formData);
295
293
  for (let md of data) {
296
294
  if (!md.mid)
@@ -321,6 +319,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
321
319
  }
322
320
  });
323
321
  setFormData(data);
322
+ appliedInputMidsRef.current = inputMids;
324
323
  }, [inputMids, layoutMode, formData, formDataOrig]);
325
324
  // Memoizza solo il valore WI_SetID per evitare re-render quando altri metadata cambiano
326
325
  const workItemSetIDValue = useMemo(() => formData.find(o => o.md?.name === WorkItemMetadataNames.WI_SetID)?.value, [formData]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.19.0-dev1.34",
3
+ "version": "6.19.0-dev1.35",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",