@datatechsolutions/ui 2.11.44 → 2.11.46

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.
@@ -1218,7 +1218,8 @@ function DatasourceNodeConfigForm({
1218
1218
  onCancel,
1219
1219
  datasources,
1220
1220
  onLoadTables,
1221
- onLoadSchema
1221
+ onLoadSchema,
1222
+ readOnly = false
1222
1223
  }) {
1223
1224
  const t = chunkYXN2K77G_js.useTranslations("agents.workflow.datasourceNodeConfig");
1224
1225
  const [activeSectionId, setActiveSectionId] = react.useState("connection");
@@ -1340,9 +1341,12 @@ function DatasourceNodeConfigForm({
1340
1341
  {
1341
1342
  type: "button",
1342
1343
  onClick: () => {
1343
- handleDatasourceChange(datasource.id);
1344
- setActiveSectionId("table");
1344
+ if (!readOnly) {
1345
+ handleDatasourceChange(datasource.id);
1346
+ setActiveSectionId("table");
1347
+ }
1345
1348
  },
1349
+ disabled: readOnly && datasource.id !== selectedDatasourceId,
1346
1350
  className: `flex items-center gap-3 rounded-xl border px-3 py-2.5 text-left transition-all ${isSelected ? "border-cyan-500/50 bg-cyan-500/5 ring-1 ring-cyan-500/20 dark:border-cyan-400/40 dark:bg-cyan-400/5" : "border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm dark:border-white/10 dark:bg-white/[0.03] dark:hover:border-white/20"}`,
1347
1351
  children: [
1348
1352
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-9 w-9 shrink-0 items-center justify-center", children: logo2 ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo2, alt: datasource.dialect, className: "h-7 w-7" }) : /* @__PURE__ */ jsxRuntime.jsx(outline.ServerStackIcon, { className: "h-6 w-6 text-gray-400" }) }),
@@ -1384,8 +1388,10 @@ function DatasourceNodeConfigForm({
1384
1388
  {
1385
1389
  type: "button",
1386
1390
  onClick: () => {
1387
- handleTableChange(table);
1388
- setActiveSectionId("columns");
1391
+ if (!readOnly) {
1392
+ handleTableChange(table);
1393
+ setActiveSectionId("columns");
1394
+ }
1389
1395
  },
1390
1396
  className: `flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-xs transition-colors ${isSelected ? "bg-cyan-500/10 font-semibold text-cyan-700 dark:text-cyan-300" : "text-gray-700 hover:bg-gray-100/60 dark:text-gray-300 dark:hover:bg-white/5"}`,
1391
1397
  children: [
@@ -1409,7 +1415,7 @@ function DatasourceNodeConfigForm({
1409
1415
  availableColumns.length,
1410
1416
  " selected"
1411
1417
  ] }),
1412
- /* @__PURE__ */ jsxRuntime.jsx(
1418
+ !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
1413
1419
  "button",
1414
1420
  {
1415
1421
  type: "button",
@@ -1443,7 +1449,9 @@ function DatasourceNodeConfigForm({
1443
1449
  "button",
1444
1450
  {
1445
1451
  type: "button",
1446
- onClick: () => handleToggleColumn(column.name),
1452
+ onClick: () => {
1453
+ if (!readOnly) handleToggleColumn(column.name);
1454
+ },
1447
1455
  className: `flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-left transition-colors ${isSelected ? "bg-cyan-500/8 dark:bg-cyan-400/5" : "hover:bg-gray-100/60 dark:hover:bg-white/5"}`,
1448
1456
  children: [
1449
1457
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors ${isSelected ? "border-cyan-500 bg-cyan-500 dark:border-cyan-400 dark:bg-cyan-400" : "border-gray-300 dark:border-gray-600"}`, children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(outline.CheckIcon, { className: "h-2.5 w-2.5 text-white" }) }),
@@ -1464,7 +1472,7 @@ function DatasourceNodeConfigForm({
1464
1472
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
1465
1473
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
1466
1474
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: t("filtersHelp") }),
1467
- /* @__PURE__ */ jsxRuntime.jsxs(
1475
+ !readOnly && /* @__PURE__ */ jsxRuntime.jsxs(
1468
1476
  "button",
1469
1477
  {
1470
1478
  type: "button",
@@ -1498,7 +1506,8 @@ function DatasourceNodeConfigForm({
1498
1506
  {
1499
1507
  value: columnName,
1500
1508
  onChange: (event) => handleUpdateFilterField(variableName, event.target.value),
1501
- className: "flex-1 rounded bg-transparent text-xs text-gray-900 outline-none dark:text-white",
1509
+ disabled: readOnly,
1510
+ className: "flex-1 rounded bg-transparent text-xs text-gray-900 outline-none disabled:opacity-60 dark:text-white",
1502
1511
  children: [
1503
1512
  /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: t("columnName") }),
1504
1513
  availableColumns.map((column) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: column.name, children: column.name }, column.name))
@@ -1513,10 +1522,11 @@ function DatasourceNodeConfigForm({
1513
1522
  value: variableName,
1514
1523
  onChange: (event) => handleUpdateFilterVariable(variableName, event.target.value),
1515
1524
  placeholder: t("variableReference"),
1525
+ readOnly,
1516
1526
  className: "flex-1 bg-transparent text-xs text-gray-900 outline-none placeholder:text-gray-400 dark:text-white dark:placeholder:text-gray-500"
1517
1527
  }
1518
1528
  ),
1519
- /* @__PURE__ */ jsxRuntime.jsx(
1529
+ !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
1520
1530
  "button",
1521
1531
  {
1522
1532
  type: "button",
@@ -1541,6 +1551,7 @@ function DatasourceNodeConfigForm({
1541
1551
  value: outputVariable,
1542
1552
  onChange: (event) => setOutputVariable(event.target.value),
1543
1553
  placeholder: "datasourceResult",
1554
+ readOnly,
1544
1555
  className: "flex-1 bg-transparent text-sm text-gray-900 outline-none placeholder:text-gray-400 dark:text-white dark:placeholder:text-gray-500"
1545
1556
  }
1546
1557
  )
@@ -1557,6 +1568,7 @@ function DatasourceNodeConfigForm({
1557
1568
  onChange: (event) => setLimit(Math.max(1, Number.parseInt(event.target.value, 10) || 1)),
1558
1569
  min: 1,
1559
1570
  max: 1e4,
1571
+ readOnly,
1560
1572
  className: "w-32 rounded-xl border border-gray-200 bg-white px-3 py-2.5 text-sm text-gray-900 outline-none focus:border-cyan-400 dark:border-white/10 dark:bg-white/[0.03] dark:text-white"
1561
1573
  }
1562
1574
  )
@@ -1622,10 +1634,10 @@ function DatasourceNodeConfigForm({
1622
1634
  activeSectionId,
1623
1635
  onSectionChange: setActiveSectionId
1624
1636
  },
1625
- footer: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2 px-6 py-3", children: [
1637
+ footer: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end gap-2 px-6 py-3", children: readOnly ? /* @__PURE__ */ jsxRuntime.jsx(chunkKEUOCEOO_js.Button, { outline: true, onClick: onCancel, children: "Close" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1626
1638
  /* @__PURE__ */ jsxRuntime.jsx(chunkKEUOCEOO_js.Button, { outline: true, onClick: onCancel, children: t("cancel") }),
1627
1639
  /* @__PURE__ */ jsxRuntime.jsx(chunkKEUOCEOO_js.Button, { color: "cyan", onClick: handleSave, disabled: !canSave, children: t("save") })
1628
- ] }),
1640
+ ] }) }),
1629
1641
  children: renderSection()
1630
1642
  }
1631
1643
  );
@@ -3433,7 +3445,7 @@ var DatasourceFlowNode = react.memo(function DatasourceFlowNode2({ id, data, sel
3433
3445
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3434
3446
  /* @__PURE__ */ jsxRuntime.jsx(NodeRunningIndicator, { nodeId: id }),
3435
3447
  /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "target", position: react$1.Position.Left, id: "left-in", colorClass: "!bg-cyan-400" }),
3436
- readOnly || !onEdit ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: content }) : /* @__PURE__ */ jsxRuntime.jsx(
3448
+ !onEdit ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: content }) : /* @__PURE__ */ jsxRuntime.jsx(
3437
3449
  "button",
3438
3450
  {
3439
3451
  type: "button",
@@ -7670,6 +7682,7 @@ function WorkflowCanvasInner({
7670
7682
  open: true,
7671
7683
  nodeId: editingLogicNode.nodeId,
7672
7684
  config: editingLogicNode.config,
7685
+ readOnly: Boolean(nodes.find((n) => n.id === editingLogicNode.nodeId)?.data?.readOnly),
7673
7686
  onSave: (updatedConfig) => {
7674
7687
  handleSaveLogicNodeConfig(editingLogicNode.nodeId, updatedConfig);
7675
7688
  setEditingLogicNodeId(null);
@@ -7880,5 +7893,5 @@ exports.useModalStore = useModalStore;
7880
7893
  exports.useWorkflowBuilderClient = useWorkflowBuilderClient;
7881
7894
  exports.useWorkflowBuilderClientOptional = useWorkflowBuilderClientOptional;
7882
7895
  exports.useWorkflowStore = useWorkflowStore;
7883
- //# sourceMappingURL=chunk-36EAW7JS.js.map
7884
- //# sourceMappingURL=chunk-36EAW7JS.js.map
7896
+ //# sourceMappingURL=chunk-3B5V4VUC.js.map
7897
+ //# sourceMappingURL=chunk-3B5V4VUC.js.map