Browse Source

feat(gui-v2): add isValid & apply tailwindcss on Editor

pull/2795/head
Wing-Kam Wong 2 years ago
parent
commit
7247c5980d
  1. 17
      packages/nc-gui-v2/components/template/Editor.vue

17
packages/nc-gui-v2/components/template/Editor.vue

@ -259,13 +259,24 @@ async function importTemplate() {
} catch (e: any) {
toast.error(await extractSdkResponseErrorMsg(e))
} finally {
// TODO: close dialog when the integration is ready
isImporting.value = false
}
}
const isValid = () => {
for (const [_, o] of Object.entries(validateInfos)) {
if (o?.validateStatus) {
if (o.validateStatus === 'error') {
return false
}
}
}
return true
}
defineExpose({
importTemplate,
isValid,
})
</script>
@ -288,8 +299,8 @@ defineExpose({
<a-form-item v-if="editableTn[tableIdx]" v-bind="validateInfos[`tables.${tableIdx}.table_name`]" no-style>
<a-input
v-model:value="table.table_name"
class="max-w-xs"
size="large"
style="max-width: 300px"
hide-details
@click="(e) => e.stopPropagation()"
@blur="setEditableTn(tableIdx, false)"
@ -355,10 +366,10 @@ defineExpose({
<a-form-item v-bind="validateInfos[`tables.${tableIdx}.columns.${record.key}.${column.key}`]">
<a-auto-complete
v-model:value="record.uidt"
class="w-52"
size="large"
:options="uiTypeOptions"
:filter-option="filterOption"
style="width: 200px"
/>
</a-form-item>
</template>

Loading…
Cancel
Save