@ethisyscore/plugin-ui 1.100.5 → 1.101.0

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.
@@ -39,7 +39,10 @@ var ConnectorMappingService = class {
39
39
  responseFieldPaths: responseFieldPaths ?? null,
40
40
  staticRequestFields: staticRequestFields ?? null
41
41
  });
42
- return response?.rowVersion ?? null;
42
+ return {
43
+ rowVersion: response?.rowVersion ?? null,
44
+ findings: response?.findings ?? []
45
+ };
43
46
  }
44
47
  async deleteMapping(connectorId, moduleKey, operationKey, rowVersion) {
45
48
  await this.tool("connectors:mappings:delete", {
@@ -321,6 +324,9 @@ function dispatchToast(title, description, variant) {
321
324
  function showSuccessToast(title, description) {
322
325
  dispatchToast(title, description, "success");
323
326
  }
327
+ function showWarningToast(title, description) {
328
+ dispatchToast(title, description, "warning");
329
+ }
324
330
 
325
331
  // src/connector-mappings/types.ts
326
332
  var MAPPING_SOURCE = {
@@ -372,7 +378,8 @@ function useConnectorMappingMutations({
372
378
  connectorId,
373
379
  moduleKey,
374
380
  onMappingSaved,
375
- showSuccessToast: showSuccessToast2 = showSuccessToast
381
+ showSuccessToast: showSuccessToast2 = showSuccessToast,
382
+ showWarningToast: showWarningToast2 = showWarningToast
376
383
  }) {
377
384
  const queryClient = reactQuery.useQueryClient();
378
385
  const [autoMatchSummary, setAutoMatchSummary] = react.useState(null);
@@ -415,12 +422,20 @@ function useConnectorMappingMutations({
415
422
  args.staticRequestFields
416
423
  ),
417
424
  meta: { errorTitle: "Update failed" },
418
- onSuccess: () => {
425
+ onSuccess: (outcome) => {
419
426
  invalidateMappingsAndCompleteness();
420
427
  if (connectorId) {
421
428
  onMappingSaved?.(connectorId, moduleKey);
422
429
  }
423
- showSuccessToast2("Mapping updated", "The tool mapping was saved.");
430
+ const findings = outcome?.findings ?? [];
431
+ if (findings.length === 0) {
432
+ showSuccessToast2("Mapping updated", "The tool mapping was saved.");
433
+ return;
434
+ }
435
+ showWarningToast2(
436
+ findings.length === 1 ? "Mapping saved, with a warning" : `Mapping saved, with ${findings.length} warnings`,
437
+ findings.map((f) => `${f.message}${f.detail ? ` ${f.detail}` : ""} (${f.code})`).join(" ")
438
+ );
424
439
  }
425
440
  });
426
441
  const deleteMapping = reactQuery.useMutation({