mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-04 15:36:49 +00:00
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:
@@ -1,21 +1,21 @@
|
||||
<script lang="ts" setup>
|
||||
import type { BaseType, ProjectType } from 'nocodb-sdk'
|
||||
import type { SourceType, BaseType } from 'nocodb-sdk'
|
||||
|
||||
const props = defineProps<{
|
||||
source: SourceType
|
||||
base: BaseType
|
||||
project: ProjectType
|
||||
}>()
|
||||
|
||||
const base = toRef(props, 'base')
|
||||
const source = toRef(props, 'source')
|
||||
|
||||
const { isUIAllowed } = useRoles()
|
||||
|
||||
const projectRole = inject(ProjectRoleInj)
|
||||
const baseRole = inject(ProjectRoleInj)
|
||||
|
||||
const { $e } = useNuxtApp()
|
||||
|
||||
function openAirtableImportDialog(baseId?: string) {
|
||||
if (!baseId) return
|
||||
function openAirtableImportDialog(sourceId?: string) {
|
||||
if (!sourceId) return
|
||||
|
||||
$e('a:actions:import-airtable')
|
||||
|
||||
@@ -23,7 +23,7 @@ function openAirtableImportDialog(baseId?: string) {
|
||||
|
||||
const { close } = useDialog(resolveComponent('DlgAirtableImport'), {
|
||||
'modelValue': isOpen,
|
||||
'baseId': baseId,
|
||||
'sourceId': sourceId,
|
||||
'onUpdate:modelValue': closeDialog,
|
||||
})
|
||||
|
||||
@@ -35,7 +35,7 @@ function openAirtableImportDialog(baseId?: string) {
|
||||
}
|
||||
|
||||
function openQuickImportDialog(type: string) {
|
||||
if (!base.value?.id) return
|
||||
if (!source.value?.id) return
|
||||
|
||||
$e(`a:actions:import-${type}`)
|
||||
|
||||
@@ -44,7 +44,7 @@ function openQuickImportDialog(type: string) {
|
||||
const { close } = useDialog(resolveComponent('DlgQuickImport'), {
|
||||
'modelValue': isOpen,
|
||||
'importType': type,
|
||||
'baseId': base.value.id,
|
||||
'sourceId': source.value.id,
|
||||
'onUpdate:modelValue': closeDialog,
|
||||
})
|
||||
|
||||
@@ -58,7 +58,7 @@ function openQuickImportDialog(type: string) {
|
||||
|
||||
<template>
|
||||
<!-- Quick Import From -->
|
||||
<NcSubMenu class="py-0" data-testid="nc-sidebar-project-import">
|
||||
<NcSubMenu class="py-0" data-testid="nc-sidebar-base-import">
|
||||
<template #title>
|
||||
<GeneralIcon icon="download" />
|
||||
|
||||
@@ -68,17 +68,17 @@ function openQuickImportDialog(type: string) {
|
||||
<template #expandIcon></template>
|
||||
|
||||
<NcMenuItem
|
||||
v-if="isUIAllowed('airtableImport', { roles: projectRole })"
|
||||
v-if="isUIAllowed('airtableImport', { roles: baseRole })"
|
||||
key="quick-import-airtable"
|
||||
v-e="['c:import:airtable']"
|
||||
@click="openAirtableImportDialog(base.id)"
|
||||
@click="openAirtableImportDialog(source.id)"
|
||||
>
|
||||
<GeneralIcon icon="airtable" class="max-w-3.75 group-hover:text-black" />
|
||||
<div class="ml-0.5">{{ $t('labels.airtable') }}</div>
|
||||
</NcMenuItem>
|
||||
|
||||
<NcMenuItem
|
||||
v-if="isUIAllowed('csvImport', { roles: projectRole })"
|
||||
v-if="isUIAllowed('csvImport', { roles: baseRole })"
|
||||
key="quick-import-csv"
|
||||
v-e="['c:import:csv']"
|
||||
@click="openQuickImportDialog('csv')"
|
||||
@@ -88,7 +88,7 @@ function openQuickImportDialog(type: string) {
|
||||
</NcMenuItem>
|
||||
|
||||
<NcMenuItem
|
||||
v-if="isUIAllowed('jsonImport', { roles: projectRole })"
|
||||
v-if="isUIAllowed('jsonImport', { roles: baseRole })"
|
||||
key="quick-import-json"
|
||||
v-e="['c:import:json']"
|
||||
@click="openQuickImportDialog('json')"
|
||||
@@ -98,7 +98,7 @@ function openQuickImportDialog(type: string) {
|
||||
</NcMenuItem>
|
||||
|
||||
<NcMenuItem
|
||||
v-if="isUIAllowed('excelImport', { roles: projectRole })"
|
||||
v-if="isUIAllowed('excelImport', { roles: baseRole })"
|
||||
key="quick-import-excel"
|
||||
v-e="['c:import:excel']"
|
||||
@click="openQuickImportDialog('excel')"
|
||||
|
||||
Reference in New Issue
Block a user