@ethisyscore/plugin-ui 1.103.0 → 1.105.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.
@@ -1113,6 +1113,9 @@ function hasUnmappedRequiredField(op) {
1113
1113
  function selectIncompleteOperations(operations) {
1114
1114
  return operations.filter(hasUnmappedRequiredField);
1115
1115
  }
1116
+ function selectRequiredUnmappedOperations(operations) {
1117
+ return operations.filter((op) => op.isRequired && !op.isToolMapped);
1118
+ }
1116
1119
  function selectRequiredIncompleteOperations(operations) {
1117
1120
  return operations.filter((op) => op.isRequired && hasUnmappedRequiredField(op));
1118
1121
  }
@@ -1148,9 +1151,15 @@ function MappingCompletenessBanner({
1148
1151
  disableSuggest = false,
1149
1152
  isProviderUnconfigured = false
1150
1153
  }) {
1151
- const required = selectRequiredIncompleteOperations(operations);
1152
- const optional = selectOptionalIncompleteOperations(operations);
1153
- if (!isProviderUnconfigured && required.length === 0 && optional.length === 0) {
1154
+ const unmapped = selectRequiredUnmappedOperations(operations);
1155
+ const unmappedKeys = new Set(unmapped.map((op) => op.operationKey));
1156
+ const required = selectRequiredIncompleteOperations(operations).filter(
1157
+ (op) => !unmappedKeys.has(op.operationKey)
1158
+ );
1159
+ const optional = selectOptionalIncompleteOperations(operations).filter(
1160
+ (op) => !unmappedKeys.has(op.operationKey)
1161
+ );
1162
+ if (!isProviderUnconfigured && unmapped.length === 0 && required.length === 0 && optional.length === 0) {
1154
1163
  return null;
1155
1164
  }
1156
1165
  const renderRow = (op) => {
@@ -1225,6 +1234,22 @@ function MappingCompletenessBanner({
1225
1234
  ]
1226
1235
  }
1227
1236
  ),
1237
+ unmapped.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
1238
+ material.Alert,
1239
+ {
1240
+ severity: "error",
1241
+ sx: { mb: required.length > 0 || optional.length > 0 ? 2 : 0 },
1242
+ "data-testid": "required-unmapped-alert",
1243
+ children: [
1244
+ /* @__PURE__ */ jsxRuntime.jsx(material.AlertTitle, { children: unmapped.length === 1 ? "A required operation has no tool mapped" : "Required operations have no tool mapped" }),
1245
+ /* @__PURE__ */ jsxRuntime.jsxs(material.Typography, { variant: "body2", children: [
1246
+ unmapped.length === 1 ? "This operation has nothing to call, so the module cannot do its job until a tool is chosen for it. " : `${unmapped.length} required operations have nothing to call, so the module cannot do its job until a tool is chosen for each. `,
1247
+ "Pick one on the row below. If this connector exposes nothing suitable, the module needs a different connector rather than a translation."
1248
+ ] }),
1249
+ /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { mt: 1 }, children: unmapped.map(renderRow) })
1250
+ ]
1251
+ }
1252
+ ),
1228
1253
  required.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(material.Alert, { severity: "warning", sx: { mb: optional.length > 0 ? 2 : 0 }, children: [
1229
1254
  /* @__PURE__ */ jsxRuntime.jsx(material.AlertTitle, { children: "Required operations are missing request-field mappings" }),
1230
1255
  /* @__PURE__ */ jsxRuntime.jsxs(material.Typography, { variant: "body2", children: [
@@ -2095,5 +2120,6 @@ exports.selectIncompleteOperations = selectIncompleteOperations;
2095
2120
  exports.selectMappingReadiness = selectMappingReadiness;
2096
2121
  exports.selectOptionalIncompleteOperations = selectOptionalIncompleteOperations;
2097
2122
  exports.selectRequiredIncompleteOperations = selectRequiredIncompleteOperations;
2123
+ exports.selectRequiredUnmappedOperations = selectRequiredUnmappedOperations;
2098
2124
  //# sourceMappingURL=index.cjs.map
2099
2125
  //# sourceMappingURL=index.cjs.map