mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-30 13:36:42 +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:
@@ -13,7 +13,7 @@ import {
|
||||
useDashboard,
|
||||
useI18n,
|
||||
useNuxtApp,
|
||||
useProject,
|
||||
useBase,
|
||||
useRoles,
|
||||
watchDebounced,
|
||||
} from '#imports'
|
||||
@@ -25,7 +25,7 @@ const { $e } = useNuxtApp()
|
||||
|
||||
const { api } = useApi()
|
||||
|
||||
const { project } = storeToRefs(useProject())
|
||||
const { base } = storeToRefs(useBase())
|
||||
|
||||
const { copy } = useCopy()
|
||||
|
||||
@@ -53,10 +53,10 @@ const searchText = ref<string>('')
|
||||
|
||||
const loadUsers = async (page = currentPage.value, limit = currentLimit.value) => {
|
||||
try {
|
||||
if (!project.value?.id) return
|
||||
if (!base.value?.id) return
|
||||
|
||||
// TODO: Types of api is not correct
|
||||
const response: any = await api.auth.projectUserList(project.value?.id, {
|
||||
const response: any = await api.auth.baseUserList(base.value?.id, {
|
||||
query: {
|
||||
limit,
|
||||
offset: (page - 1) * limit,
|
||||
@@ -75,16 +75,16 @@ const loadUsers = async (page = currentPage.value, limit = currentLimit.value) =
|
||||
|
||||
const inviteUser = async (user: User) => {
|
||||
try {
|
||||
if (!project.value?.id) return
|
||||
if (!base.value?.id) return
|
||||
|
||||
if (!user.roles) {
|
||||
// mark it as editor by default
|
||||
user.roles = 'editor'
|
||||
}
|
||||
|
||||
await api.auth.projectUserAdd(project.value.id, user as ProjectUserReqType)
|
||||
await api.auth.baseUserAdd(base.value.id, user as ProjectUserReqType)
|
||||
|
||||
// Successfully added user to project
|
||||
// Successfully added user to base
|
||||
message.success(t('msg.success.userAddedToProject'))
|
||||
await loadUsers()
|
||||
} catch (e: any) {
|
||||
@@ -96,11 +96,11 @@ const inviteUser = async (user: User) => {
|
||||
|
||||
const deleteUser = async () => {
|
||||
try {
|
||||
if (!project.value?.id || !selectedUser.value?.id) return
|
||||
if (!base.value?.id || !selectedUser.value?.id) return
|
||||
|
||||
await api.auth.projectUserRemove(project.value.id, selectedUser.value.id)
|
||||
await api.auth.baseUserRemove(base.value.id, selectedUser.value.id)
|
||||
|
||||
// Successfully deleted user from project
|
||||
// Successfully deleted user from base
|
||||
message.success(t('msg.success.userDeletedFromProject'))
|
||||
|
||||
await loadUsers()
|
||||
@@ -131,10 +131,10 @@ const onDelete = (user: User) => {
|
||||
}
|
||||
|
||||
const resendInvite = async (user: User) => {
|
||||
if (!project.value?.id) return
|
||||
if (!base.value?.id) return
|
||||
|
||||
try {
|
||||
await api.auth.projectUserResendInvite(project.value.id, user.id)
|
||||
await api.auth.baseUserResendInvite(base.value.id, user.id)
|
||||
|
||||
// Invite email sent successfully
|
||||
message.success(t('msg.success.inviteEmailSent'))
|
||||
@@ -209,7 +209,7 @@ const isSuperAdmin = (user: { main_roles?: string }) => {
|
||||
>
|
||||
<div class="flex flex-col h-full">
|
||||
<div class="flex flex-row justify-center mt-2 text-center w-full text-base">
|
||||
This action will remove this user from this project
|
||||
This action will remove this user from this base
|
||||
</div>
|
||||
<div class="flex mt-6 justify-end space-x-2">
|
||||
<a-button class="!rounded-md" @click="showUserDeleteModal = false"> {{ $t('general.cancel') }}</a-button>
|
||||
@@ -287,7 +287,7 @@ const isSuperAdmin = (user: { main_roles?: string }) => {
|
||||
</div>
|
||||
<div class="flex w-1/6 flex-wrap justify-end">
|
||||
<template v-if="!isSuperAdmin(user)">
|
||||
<a-tooltip v-if="user.project_id" placement="bottom">
|
||||
<a-tooltip v-if="user.base_id" placement="bottom">
|
||||
<template #title>
|
||||
<span>{{ $t('activity.editUser') }}</span>
|
||||
</template>
|
||||
@@ -299,8 +299,8 @@ const isSuperAdmin = (user: { main_roles?: string }) => {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
|
||||
<!-- Add user to project -->
|
||||
<a-tooltip v-if="!user.project_id" placement="bottom">
|
||||
<!-- Add user to base -->
|
||||
<a-tooltip v-if="!user.base_id" placement="bottom">
|
||||
<template #title>
|
||||
<span>{{ $t('activity.addUserToProject') }}</span>
|
||||
</template>
|
||||
@@ -312,7 +312,7 @@ const isSuperAdmin = (user: { main_roles?: string }) => {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
|
||||
<!-- Remove user from the project -->
|
||||
<!-- Remove user from the base -->
|
||||
<a-tooltip v-else placement="bottom">
|
||||
<template #title>
|
||||
<span>{{ $t('activity.deleteUser') }}</span>
|
||||
|
||||
Reference in New Issue
Block a user