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

Loading…
Cancel
Save