Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix(frontend): remove named slot syntax in TSX component to fix vnode error (#18207)

p0nybfe1e45c4adb
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/StepsTable.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/StepsTable.vue
index da9862defd..22ec1180a3 100644
--- a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/StepsTable.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/StepsTable.vue
@@ -20,7 +20,7 @@
</div>
</template>
-<script lang="tsx" setup>
+<script lang="ts" setup>
/* eslint-disable vue/no-mutating-props */
import {
ArrowDownIcon,
@@ -30,7 +30,7 @@ import {
} from "lucide-vue-next";
import type { DataTableColumn } from "naive-ui";
import { NButton, NDataTable } from "naive-ui";
-import { computed } from "vue";
+import { computed, h } from "vue";
import { useI18n } from "vue-i18n";
import { RoleSelect } from "@/components/v2";
import { SpinnerButton } from "@/components/v2/Form";
@@ -70,18 +70,16 @@ const columns = computed(
resizable: true,
render: (stepData) => {
if (props.editable) {
- return (
- <RoleSelect
- suffix=""
- value={stepData.role}
- style="width: 80%"
- onUpdate:value={(val: string | string[]) => {
- const role = Array.isArray(val) ? val[0] : val;
- props.flow.roles[stepData.index] = role;
- emit("update");
- }}
- />
- );
+ return h(RoleSelect, {
+ suffix: "",
+ value: stepData.role,
+ style: "width: 80%",
+ "onUpdate:value": (val: string | string[]) => {
+ const role = Array.isArray(val) ? val[0] : val;
+ props.flow.roles[stepData.index] = role;
+ emit("update");
+ },
+ });
}
return displayRoleTitle(stepData.role);
},
@@ -92,33 +90,38 @@ const columns = computed(
cols.push({
title: t("common.operations"),
key: "operations",
- render: (stepData, index) => (
- <div class="flex gap-x-1">
- <NButton
- disabled={index === 0 || !allowAdmin.value}
- size="tiny"
- onClick={() => reorder(stepData, -1)}
- >
- <ArrowUpIcon class={"w-4"} />
- </NButton>
- <NButton
- disabled={index === steps.value.length - 1 || !allowAdmin.value}
- size="tiny"
- onClick={() => reorder(stepData, 1)}
- >
- <ArrowDownIcon class={"w-4"} />
- </NButton>
- {allowAdmin.value && (
- <SpinnerButton
- size="tiny"
- tooltip={t("custom-approval.approval-flow.node.delete")}
- onConfirm={() => removeStep(stepData)}
- >
- <TrashIcon class={"w-3"} />
- </SpinnerButton>
- )}
- </div>
- ),
+ render: (stepData, index) =>
+ h("div", { class: "flex gap-x-1" }, [
+ h(
+ NButton,
+ {
+ disabled: index === 0 || !allowAdmin.value,
+ size: "tiny",
+ onClick: () => reorder(stepData, -1),
+ },
+ () => h(ArrowUpIcon, { class: "w-4" })
+ ),
+ h(
+ NButton,
+ {
+ disabled: index === steps.value.length - 1 || !allowAdmin.value,
+ size: "tiny",
+ onClick: () => reorder(stepData, 1),
+ },
+ () => h(ArrowDownIcon, { class: "w-4" })
+ ),
+ allowAdmin.value
+ ? h(
+ SpinnerButton,
+ {
+ size: "tiny",
+ tooltip: t("custom-approval.approval-flow.node.delete"),
+ onConfirm: () => removeStep(stepData),
+ },
+ () => h(TrashIcon, { class: "w-3" })
+ )
+ : null,
+ ]),
});
}