refactor: rename project and base

- Rename `Project`  => `Base`
- Rename `Base` => `Source`
- Remove `db` from data/meta api endpoints
- Add backward compatibility for old apis
- Migrations for renaming table and columns

Signed-off-by: Pranav C <pranavxc@gmail.com>
This commit is contained in:
Pranav C
2023-10-02 22:38:43 +05:30
parent 93e4e8ae47
commit e790abdbaf
547 changed files with 10267 additions and 9773 deletions

View File

@@ -3,7 +3,7 @@ import type { RuleObject } from 'ant-design-vue/es/form'
import type { Form, Input } from 'ant-design-vue'
import type { VNodeRef } from '@vue/runtime-core'
import { computed } from '@vue/reactivity'
import { NcProjectType, extractSdkResponseErrorMsg, projectTitleValidator, ref, useGlobal, useVModel } from '#imports'
import { NcProjectType, extractSdkResponseErrorMsg, baseTitleValidator, ref, useGlobal, useVModel } from '#imports'
const props = defineProps<{
modelValue: boolean
@@ -14,10 +14,10 @@ const emit = defineEmits(['update:modelValue'])
const dialogShow = useVModel(props, 'modelValue', emit)
const projectType = computed(() => props.type ?? NcProjectType.DB)
const baseType = computed(() => props.type ?? NcProjectType.DB)
const projectsStore = useProjects()
const { createProject: _createProject } = projectsStore
const basesStore = useBases()
const { createProject: _createProject } = basesStore
const { navigateToProject } = useGlobal()
@@ -26,7 +26,7 @@ const nameValidationRules = [
required: true,
message: 'Database name is required',
},
projectTitleValidator,
baseTitleValidator,
] as RuleObject[]
const form = ref<typeof Form>()
@@ -40,14 +40,14 @@ const creating = ref(false)
const createProject = async () => {
creating.value = true
try {
const project = await _createProject({
type: projectType.value,
const base = await _createProject({
type: baseType.value,
title: formState.value.title,
})
navigateToProject({
projectId: project.id!,
type: projectType.value,
baseId: base.id!,
type: baseType.value,
workspaceId: 'nc',
})
dialogShow.value = false
@@ -70,7 +70,7 @@ watch(dialogShow, async (n, o) => {
form.value?.resetFields()
formState.value = {
title: 'Untitled Database',
title: 'Untitled Base',
}
await nextTick()
@@ -81,10 +81,10 @@ watch(dialogShow, async (n, o) => {
})
const typeLabel = computed(() => {
switch (projectType.value) {
switch (baseType.value) {
case NcProjectType.DB:
default:
return 'Database'
return 'Base'
}
})
</script>
@@ -94,7 +94,7 @@ const typeLabel = computed(() => {
<template #header>
<!-- Create A New Table -->
<div class="flex flex-row items-center">
<GeneralProjectIcon :type="projectType" class="mr-2.5 !text-lg !h-4" />
<GeneralProjectIcon :type="baseType" class="mr-2.5 !text-lg !h-4" />
Create {{ typeLabel }}
</div>
</template>
@@ -114,7 +114,7 @@ const typeLabel = computed(() => {
ref="input"
v-model:value="formState.title"
name="title"
class="nc-metadb-project-name nc-input-md"
class="nc-metadb-base-name nc-input-md"
placeholder="Title"
/>
</a-form-item>