Browse Source

sync @1700

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/6227/head
Raju Udava 1 year ago
parent
commit
442d184953
  1. 1
      packages/nc-gui/components.d.ts
  2. 15
      packages/nc-gui/components/dashboard/Sidebar.vue
  3. 9
      packages/nc-gui/components/dashboard/TreeViewNew/TableNode.vue
  4. 2
      packages/nc-gui/components/dlg/share-and-collaborate/ShareBase.vue
  5. 6
      packages/nc-gui/components/dlg/share-and-collaborate/View.vue
  6. 4
      packages/nc-gui/components/nc/Dropdown.vue
  7. 2
      packages/nc-gui/components/nc/Select.vue
  8. 2
      packages/nc-gui/components/nc/Tabs.vue
  9. 12
      packages/nc-gui/components/project/AccessSettings.vue
  10. 17
      packages/nc-gui/components/project/InviteProjectCollabSection.vue
  11. 39
      packages/nc-gui/components/project/View.vue
  12. 9
      packages/nc-gui/components/smartsheet/details/Api.vue
  13. 2
      packages/nc-gui/components/smartsheet/header/Menu.vue
  14. 8
      packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue
  15. 6
      packages/nc-gui/components/smartsheet/sidebar/index.vue
  16. 10
      packages/nc-gui/components/webhook/Editor.vue
  17. 2
      packages/nc-gui/components/workspace/CreateProjectBtn.vue
  18. 2
      packages/nc-gui/components/workspace/CreateProjectDlg.vue
  19. 10
      packages/nc-gui/components/workspace/Menu.vue
  20. 16
      packages/nc-gui/pages/index-old/index/index.vue
  21. 4
      packages/nc-gui/pages/index/[typeOrId].vue
  22. 14
      packages/nc-gui/store/project.ts
  23. 10
      packages/nc-gui/store/projects.ts
  24. 17
      packages/nc-gui/store/views.ts
  25. 2
      packages/nc-gui/store/webhooks.ts
  26. 11
      packages/nocodb/src/middlewares/extract-ids/extract-ids.middleware.ts

1
packages/nc-gui/components.d.ts vendored

@ -151,6 +151,7 @@ declare module '@vue/runtime-core' {
MdiDotsVertical: typeof import('~icons/mdi/dots-vertical')['default']
MdiEarth: typeof import('~icons/mdi/earth')['default']
MdiEditOutline: typeof import('~icons/mdi/edit-outline')['default']
MdiEye: typeof import('~icons/mdi/eye')['default']
MdiFlag: typeof import('~icons/mdi/flag')['default']
MdiFolder: typeof import('~icons/mdi/folder')['default']
MdiHeart: typeof import('~icons/mdi/heart')['default']

15
packages/nc-gui/components/dashboard/Sidebar.vue

@ -55,6 +55,7 @@ const navigateToSettings = () => {
class="nc-sidebar flex flex-col bg-gray-50 outline-r-1 outline-gray-100 select-none"
:style="{
outlineWidth: '1px',
height: isSharedBase ? '100%' : null,
}"
>
<div class="flex flex-col" :style="{ height: isSharedBase ? 'auto' : 'var(--sidebar-top-height)' }">
@ -66,12 +67,7 @@ const navigateToSettings = () => {
href="https://github.com/nocodb/nocodb"
target="_blank"
>
<a-tooltip placement="bottom">
<template #title>
{{ currentVersion }}
</template>
<img width="25" alt="NocoDB" src="~/assets/img/icons/512x512-trans.png" />
</a-tooltip>
<img width="25" alt="NocoDB" src="~/assets/img/icons/512x512.png" />
</a>
<WorkspaceMenu :workspace="activeWorkspace" :is-open="true">
@ -135,6 +131,9 @@ const navigateToSettings = () => {
></div>
</div>
<LazyDashboardTreeViewNew
:class="{
'nc-shared-base': isSharedBase,
}"
@create-base-dlg="toggleDialog(true, 'dataSources', undefined, projectId)"
@on-scroll-top="onTreeViewScrollTop"
/>
@ -145,4 +144,8 @@ const navigateToSettings = () => {
.nc-sidebar-top-button {
@apply flex flex-row mx-1 px-3.5 rounded-md items-center py-0.75 my-0.5 gap-x-2 hover:bg-gray-200 cursor-pointer;
}
:deep(.nc-shared-base.nc-treeview-container) {
@apply !h-full;
}
</style>

9
packages/nc-gui/components/dashboard/TreeViewNew/TableNode.vue

@ -113,6 +113,15 @@ const { isSharedBase } = useProject()
</template>
<MdiTable
v-if="table.type === 'table'"
class="flex w-5 !text-gray-500 text-sm"
:class="{
'group-hover:text-gray-500': isUIAllowed('treeview-drag-n-drop', false, projectRole),
'!text-black': openedTableId === table.id,
}"
/>
<MdiEye
v-else
class="flex w-5 !text-gray-500 text-sm"
:class="{
'group-hover:text-gray-500': isUIAllowed('treeview-drag-n-drop', false, projectRole),

2
packages/nc-gui/components/dlg/share-and-collaborate/ShareBase.vue

@ -119,7 +119,7 @@ const onRoleToggle = async () => {
<div class="flex flex-col w-full p-3 border-1 border-gray-100 rounded-md">
<div class="flex flex-row w-full justify-between">
<div class="text-black font-medium">Enable Public Access</div>
<a-switch v-model:checked="isSharedBaseEnabled" :loading="isToggleBaseLoading" class="ml-2" @click="toggleSharedBase" />
<a-switch :checked="isSharedBaseEnabled" :loading="isToggleBaseLoading" class="ml-2" @click="toggleSharedBase" />
</div>
<div v-if="isSharedBaseEnabled" class="flex flex-col w-full mt-3 border-t-1 pt-3 border-gray-100">
<GeneralCopyUrl v-model:url="url" />

6
packages/nc-gui/components/dlg/share-and-collaborate/View.vue

@ -1,7 +1,7 @@
<script lang="ts" setup>
import { LoadingOutlined } from '@ant-design/icons-vue'
import ManageUsers from './ManageUsers.vue'
import {useViewsStore} from "~/store/views";
import { useViewsStore } from '~/store/views'
const { isViewToolbar } = defineProps<{
isViewToolbar?: boolean
@ -13,7 +13,7 @@ const { copy } = useCopy()
const { dashboardUrl } = useDashboard()
const projectStore = useProject()
const { project } = storeToRefs(projectStore)
const { navigateToProject } = projectStore
const { navigateToProjectPage } = projectStore
const { activeView } = storeToRefs(useViewsStore())
let view
@ -64,7 +64,7 @@ const copyInvitationLink = async () => {
const openManageAccess = async () => {
isOpeningManageAccess.value = true
try {
await navigateToProject({ projectId: project.value.id!, page: 'collaborators' })
await navigateToProjectPage({ page: 'collaborator' })
showShareModal.value = false
} catch (e) {
console.error(e)

4
packages/nc-gui/components/nc/Dropdown.vue

@ -1,8 +1,8 @@
<script lang="ts" setup>
const props = withDefaults(
defineProps<{
trigger: Array<'click' | 'hover' | 'contextmenu'>
visible: boolean | undefined
trigger?: Array<'click' | 'hover' | 'contextmenu'>
visible?: boolean | undefined
overlayClassName?: string | undefined
}>(),
{

2
packages/nc-gui/components/nc/Select.vue

@ -7,6 +7,7 @@ const props = defineProps<{
// filterOptions is a function
filterOption?: (input: string, option: any) => boolean
dropdownMatchSelectWidth?: boolean
allowClear?: boolean
}>()
const emits = defineEmits(['update:value', 'change'])
@ -38,6 +39,7 @@ const onChange = (value: string) => {
:filter-option="filterOption"
:dropdown-match-select-width="dropdownMatchSelectWidth"
@change="onChange"
:allow-clear="allowClear"
>
<template #suffixIcon>
<GeneralIcon icon="arrowDown" class="text-gray-800 nc-select-expand-btn" />

2
packages/nc-gui/components/nc/Tabs.vue

@ -1,6 +1,6 @@
<script lang="ts" setup>
const props = defineProps<{
modelValue: string
modelValue?: string
centered?: boolean
}>()

12
packages/nc-gui/components/project/AccessSettings.vue

@ -6,7 +6,7 @@ import { storeToRefs, stringToColour, timeAgo, useGlobal } from '#imports'
const { user } = useGlobal()
const projectsStore = useProjects()
const { getProjectUsers, createProjectUser, updateProjectUser } = projectsStore
const { getProjectUsers, createProjectUser, updateProjectUser, removeProjectUser } = projectsStore
const { activeProjectId } = storeToRefs(projectsStore)
const collaborators = ref<WorkspaceUserType[]>([])
@ -74,7 +74,10 @@ onMounted(async () => {
const updateCollaborator = async (collab, roles) => {
try {
if (collab.projectRoles) {
if (!roles) {
await removeProjectUser(activeProjectId.value!, collab)
collab.projectRoles = null
} else if (collab.projectRoles) {
await updateProjectUser(activeProjectId.value!, collab)
} else {
await createProjectUser(activeProjectId.value!, collab)
@ -184,7 +187,8 @@ const accessibleRoles = computed<(typeof ProjectRoles)[keyof typeof ProjectRoles
class="w-35 !rounded px-1"
:virtual="true"
:placeholder="$t('labels.noAccess')"
:disabled="collab.id === user?.id || !accessibleRoles.includes(collab.roles)"
:disabled="collab.id === user?.id"
allow-clear
@change="(value) => updateCollaborator(collab, value)"
>
<template #suffixIcon>
@ -195,7 +199,7 @@ const accessibleRoles = computed<(typeof ProjectRoles)[keyof typeof ProjectRoles
<p class="badge-text">{{ RoleLabels[userProjectRole] }}</p>
</NcBadge>
</a-select-option>
<a-select-option v-if="!accessibleRoles.includes(collab.roles)" :value="collab.roles">
<a-select-option v-if="collab.roles && !accessibleRoles.includes(collab.roles)" :value="collab.roles">
<NcBadge :color="RoleColors[collab.roles]">
<p class="badge-text">{{ RoleLabels[collab.roles] }}</p>
</NcBadge>

17
packages/nc-gui/components/project/InviteProjectCollabSection.vue

@ -46,9 +46,9 @@ const { copy } = useCopy(true)
const { t } = useI18n()
const copyUrl = async () => {
if (!inviteUrl) return
if (!inviteUrl.value) return
try {
await copy(inviteUrl)
await copy(inviteUrl.value)
// Copied shareable base url to clipboard!
message.success(t('msg.success.shareableURLCopied'))
@ -124,19 +124,19 @@ const copyUrl = async () => {
{{ role }}
</div>
</div> -->
<NcBadge v-if='role===ProjectRole.Owner' color="purple">
<NcBadge v-if="role === ProjectRole.Owner" color="purple">
<p class="badge-text">{{ role }}</p>
</NcBadge>
<NcBadge v-if="role===ProjectRole.Creator" color="blue">
<NcBadge v-if="role === ProjectRole.Creator" color="blue">
<p class="badge-text">{{ role }}</p>
</NcBadge>
<NcBadge v-if='role===ProjectRole.Editor' color="green">
<NcBadge v-if="role === ProjectRole.Editor" color="green">
<p class="badge-text">{{ role }}</p>
</NcBadge>
<NcBadge v-if="role===ProjectRole.Commenter" color="orange">
<NcBadge v-if="role === ProjectRole.Commenter" color="orange">
<p class="badge-text">{{ role }}</p>
</NcBadge>
<NcBadge v-if="role===ProjectRole.Viewer" color="yellow">
<NcBadge v-if="role === ProjectRole.Viewer" color="yellow">
<p class="badge-text">{{ role }}</p>
</NcBadge>
</a-select-option>
@ -162,8 +162,9 @@ const copyUrl = async () => {
<style scoped>
.badge-text {
@apply text-[14px] pt-1 text-center
@apply text-[14px] pt-1 text-center;
}
:deep(.ant-select .ant-select-selector) {
@apply rounded;
}

39
packages/nc-gui/components/project/View.vue

@ -5,7 +5,10 @@ const { openedProject } = storeToRefs(useProjects())
const { activeTables } = storeToRefs(useTablesStore())
const { activeWorkspace } = storeToRefs(useWorkspace())
const route = useRoute()
const { navigateToProjectPage } = useProject()
const router = useRouter()
const route = router.currentRoute
/* const defaultBase = computed(() => {
return openedProject.value?.bases?.[0]
@ -15,26 +18,34 @@ const { isUIAllowed } = useUIPermission()
const { isMobileMode } = useGlobal()
const activeKey = ref<'allTables' | 'collaborators' | 'data-sources'>('allTables')
const activeKey = ref<'allTable' | 'collaborator' | 'data-source'>('allTable')
const baseSettingsState = ref('')
watch(
() => route.query.page,
() => route.value.query?.page,
(newVal, oldVal) => {
if (newVal && newVal !== oldVal) {
if (newVal === 'collaborators') {
activeKey.value = 'collaborators'
} else if (newVal === 'data-sources') {
activeKey.value = 'data-sources'
if (newVal === 'collaborator') {
activeKey.value = 'collaborator'
} else if (newVal === 'data-source') {
activeKey.value = 'data-source'
} else {
activeKey.value = 'allTables'
activeKey.value = 'allTable'
}
}
},
{ immediate: true },
)
watch(activeKey, () => {
if (activeKey.value) {
navigateToProjectPage({
page: activeKey.value as any,
})
}
})
watch(
() => openedProject.value?.title,
() => {
@ -64,7 +75,7 @@ watch(
}"
>
<a-tabs v-model:activeKey="activeKey" class="w-full">
<a-tab-pane key="allTables">
<a-tab-pane key="allTable">
<template #tab>
<div class="tab-title" data-testid="proj-view-tab__all-tables">
<NcLayout />
@ -72,8 +83,8 @@ watch(
<div
class="flex pl-1.25 px-1.5 py-0.75 rounded-md text-xs"
:class="{
'bg-primary-selected': activeKey === 'allTables',
'bg-gray-50': activeKey !== 'allTables',
'bg-primary-selected': activeKey === 'allTable',
'bg-gray-50': activeKey !== 'allTable',
}"
>
{{ activeTables.length }}
@ -85,16 +96,16 @@ watch(
<!-- <a-tab-pane v-if="defaultBase" key="erd" tab="Project ERD" force-render class="pt-4 pb-12">
<ErdView :base-id="defaultBase!.id" class="!h-full" />
</a-tab-pane> -->
<a-tab-pane v-if="isUIAllowed('shareProject')" key="collaborators">
<a-tab-pane v-if="isUIAllowed('shareProject')" key="collaborator">
<template #tab>
<div class="tab-title" data-testid="proj-view-tab__access-settings">
<GeneralIcon icon="users" class="!h-3.5 !w-3.5" />
<div>Collaborators</div>
<div>Collaborator</div>
</div>
</template>
<ProjectAccessSettings />
</a-tab-pane>
<a-tab-pane v-if="isUIAllowed('createBase')" key="data-sources">
<a-tab-pane v-if="isUIAllowed('createBase')" key="data-source">
<template #tab>
<div class="tab-title" data-testid="proj-view-tab__data-sources">
<GeneralIcon icon="database" />

9
packages/nc-gui/components/smartsheet/details/Api.vue

@ -12,17 +12,10 @@ import {
useI18n,
useProject,
useSmartsheetStoreOrThrow,
useVModel,
useViewData,
watch,
} from '#imports'
const props = defineProps<{
modelValue: boolean
}>()
const emits = defineEmits(['update:modelValue'])
const { t } = useI18n()
const projectStore = useProject()
@ -40,8 +33,6 @@ const { queryParams } = useViewData(meta, view, xWhere)
const { copy } = useCopy()
const vModel = useVModel(props, 'modelValue', emits)
const langs = [
{
name: 'shell',

2
packages/nc-gui/components/smartsheet/header/Menu.vue

@ -21,7 +21,7 @@ import {
useUndoRedo,
} from '#imports'
const props = defineProps<{ virtual?: boolean; isOpen: boolean; close: () => void }>()
const props = defineProps<{ virtual?: boolean; isOpen: boolean }>()
const emit = defineEmits(['edit', 'addColumn', 'update:isOpen'])

8
packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue

@ -188,9 +188,9 @@ function changeView(view: ViewType) {
router.currentRoute.value.query.page &&
router.currentRoute.value.query.page === 'fields'
) {
router.push({ params: { viewTitle: view.title || '' }, query: router.currentRoute.value.query })
router.push({ params: { viewTitle: view.id || '' }, query: router.currentRoute.value.query })
} else {
router.push({ params: { viewTitle: view.title || '' } })
router.push({ params: { viewTitle: view.id || '' } })
}
if (view.type === ViewTypes.FORM && selected.value[0] === view.id) {
@ -213,7 +213,7 @@ async function onRename(view: ViewType, originalTitle?: string, undo = false) {
await router.replace({
params: {
viewTitle: view.title,
viewTitle: view.id,
},
})
@ -266,7 +266,7 @@ function openDeleteDialog(view: ViewType) {
// return to the default view
router.replace({
params: {
viewTitle: views[0].title,
viewTitle: views[0].id,
},
})
}

6
packages/nc-gui/components/smartsheet/sidebar/index.vue

@ -74,7 +74,7 @@ watch(
if (view) {
router.replace({
params: {
viewTitle: view.title,
viewTitle: view.id,
},
})
}
@ -83,7 +83,7 @@ watch(
/** if active view is not found, set it to last opened view */
router.replace({
params: {
viewTitle: lastOpenedView.title,
viewTitle: lastOpenedView.id,
},
})
} else {
@ -130,7 +130,7 @@ function onOpenModal({
await loadViews()
router.push({ params: { viewTitle: view.title || '' } })
router.push({ params: { viewTitle: view.id || '' } })
$e('a:view:create', { view: view.type })
},

10
packages/nc-gui/components/webhook/Editor.vue

@ -39,6 +39,8 @@ const { appInfo } = useGlobal()
const { hooks } = storeToRefs(useWebhooksStore())
const { project } = storeToRefs(useProject())
const meta = inject(MetaInj, ref())
const titleDomRef = ref<HTMLInputElement | undefined>()
@ -372,7 +374,13 @@ function onEventChange() {
async function loadPluginList() {
if (isEeUI) return
try {
const plugins = (await api.plugin.webhookList()).list!
const plugins = (
await api.plugin.webhookList({
query: {
project_id: project.value.id,
},
})
).list!
apps.value = plugins.reduce((o, p) => {
const plugin: { title: string; tags: string[]; parsedInput: Record<string, any> } = {

2
packages/nc-gui/components/workspace/CreateProjectBtn.vue

@ -2,7 +2,7 @@
import { NcProjectType, useRouter } from '#imports'
const props = defineProps<{
activeWorkspaceId: string
activeWorkspaceId?: string | undefined
modal?: boolean
type?: string
isOpen: boolean

2
packages/nc-gui/components/workspace/CreateProjectDlg.vue

@ -46,7 +46,7 @@ const createProject = async () => {
navigateToProject({
projectId: project.id!,
type: props.type,
workspaceId: 'default',
workspaceId: 'nc',
})
dialogShow.value = false
} catch (e: any) {

10
packages/nc-gui/components/workspace/Menu.vue

@ -33,14 +33,6 @@ const workspaceModalVisible = ref(false)
const isWorkspaceDropdownOpen = ref(false)
const isAuthTokenCopied = ref(false)
const createDlg = ref(false)
const onWorkspaceCreate = async (workspace: WorkspaceType) => {
createDlg.value = false
await loadWorkspaces()
navigateTo(`/${workspace.id}`)
}
const handleThemeColor = async (mode: 'swatch' | 'primary' | 'accent', color?: string) => {
switch (mode) {
case 'swatch': {
@ -346,8 +338,6 @@ onKeyStroke('Escape', () => {
</a-tabs>
</div>
</GeneralModal>
<WorkspaceCreateDlg v-model="createDlg" @success="onWorkspaceCreate" />
</div>
</template>

16
packages/nc-gui/pages/index-old/index/index.vue

@ -64,22 +64,6 @@ watch(
},
)
useDialog(resolveComponent('WorkspaceCreateDlg'), {
'modelValue': isCreateDlgOpen,
'onUpdate:modelValue': (isOpen: boolean) => (isCreateDlgOpen.value = isOpen),
'onSuccess': async () => {
isCreateDlgOpen.value = false
await loadWorkspaces()
await nextTick(() => {
;[...menuEl?.value?.$el?.querySelectorAll('li.ant-menu-item')]?.pop()?.scrollIntoView({
block: 'nearest',
inline: 'nearest',
})
selectedWorkspaceIndex.value = [workspacesList.value?.length - 1]
})
},
})
const tab = computed({
get() {
return route.value.query?.tab ?? 'projects'

4
packages/nc-gui/pages/index/[typeOrId].vue

@ -5,5 +5,7 @@ const route = router.currentRoute
</script>
<template>
<NuxtPage :transition="false" :page-key="route.params.typeOrId" />
<div>
<NuxtPage :transition="false" :page-key="route.params.typeOrId" />
</div>
</template>

14
packages/nc-gui/store/project.ts

@ -256,6 +256,19 @@ export const useProject = defineStore('projectStore', () => {
},
)
const navigateToProjectPage = async ({ page }: { page: 'all-table' | 'collaborator' | 'data-source' }) => {
await router.push({
name: 'index-typeOrId-projectId-index-index',
params: {
typeOrId: route.value.params.typeOrId,
projectId: route.value.params.projectId,
},
query: {
page,
},
})
}
return {
project,
bases,
@ -284,6 +297,7 @@ export const useProject = defineStore('projectStore', () => {
setProject,
projectUrl,
getBaseType,
navigateToProjectPage,
}
})

10
packages/nc-gui/store/projects.ts

@ -86,6 +86,11 @@ export const useProjects = defineStore('projectsStore', () => {
await api.auth.projectUserUpdate(projectId, user.id, user as ProjectUserReqType)
}
const removeProjectUser = async (projectId: string, user: User) => {
await api.auth.projectUserRemove(projectId, user.id)
}
const loadProjects = async (page: 'recent' | 'shared' | 'starred' | 'workspace' = 'recent') => {
// if shared base then get the shared project and create a list
if (route.value.params.typeOrId === 'base' && route.value.params.projectId) {
@ -102,7 +107,7 @@ export const useProjects = defineStore('projectsStore', () => {
projects.value.set(project.id!, {
...(projects.value.get(project.id!) || {}),
...project,
bases: [...(projects.value.get(project.id!)?.bases ?? []), ...(project.bases ?? [])],
bases: [...(project.bases ?? projects.value.get(project.id!)?.bases ?? [])],
isExpanded: route.value.params.projectId === project.id || projects.value.get(project.id!)?.isExpanded,
isLoading: false,
})
@ -224,7 +229,7 @@ export const useProjects = defineStore('projectsStore', () => {
linked_db_project_ids: projectPayload.linkedDbProjectIds,
},
{
baseURL: getBaseUrl('default'),
baseURL: getBaseUrl('nc'),
},
)
@ -310,6 +315,7 @@ export const useProjects = defineStore('projectsStore', () => {
createProjectUser,
updateProjectUser,
navigateToProject,
removeProjectUser
}
})

17
packages/nc-gui/store/views.ts

@ -15,8 +15,8 @@ export const useViewsStore = defineStore('viewsStore', () => {
const { activeTable } = storeToRefs(useTablesStore())
const activeViewTitle = computed(() => {
if (!route.value.params.viewTitle?.length) return views.value.length ? views.value[0].title : undefined
const activeViewTitleOrId = computed(() => {
if (!route.value.params.viewTitle?.length) return views.value.length ? views.value[0].id : undefined
return route.value.params.viewTitle
})
@ -42,9 +42,12 @@ export const useViewsStore = defineStore('viewsStore', () => {
if (!activeTable.value) return undefined
if (!activeViewTitle.value) return undefined
if (!activeViewTitleOrId.value) return undefined
return views.value.find((v) => v.title === activeViewTitle.value)
return (
views.value.find((v) => v.id === activeViewTitleOrId.value) ??
views.value.find((v) => v.title === activeViewTitleOrId.value)
)
},
set(_view: ViewType | undefined) {
if (sharedView.value) {
@ -55,7 +58,9 @@ export const useViewsStore = defineStore('viewsStore', () => {
if (!activeTable.value) return
if (!_view) return
const viewIndex = views.value.findIndex((v) => v.title === activeViewTitle.value)
const viewIndex =
views.value.findIndex((v) => v.id === activeViewTitleOrId.value) ??
views.value.findIndex((v) => v.title === activeViewTitleOrId.value)
if (viewIndex === -1) return
views.value[viewIndex] = _view
@ -86,7 +91,7 @@ export const useViewsStore = defineStore('viewsStore', () => {
projectId: route.value.params.projectId,
type: route.value.params.type,
viewId: route.value.params.viewId,
viewTitle: activeViewTitle.value,
viewTitle: activeViewTitleOrId.value,
slugs: [page],
},
})

2
packages/nc-gui/store/webhooks.ts

@ -178,7 +178,7 @@ export const useWebhooksStore = defineStore('webhooksStore', () => {
projectId: route.value.params.projectId,
type: route.value.params.type,
viewId: route.value.params.viewId,
viewTitle: activeView.title,
viewTitle: activeView.id,
slugs: openMainPage ? ['webhook'] : ['webhook', openCreatePage ? 'create' : hookId!],
},
}

11
packages/nocodb/src/middlewares/extract-ids/extract-ids.middleware.ts

@ -154,11 +154,14 @@ export class ExtractIdsMiddleware implements NestMiddleware, CanActivate {
});
req.ncProjectId = model?.project_id;
}
// extract project id from query params only if it's userMe endpoint
// extract project id from query params only if it's userMe endpoint or webhook plugin list
else if (
['/auth/user/me', '/api/v1/db/auth/user/me', '/api/v1/auth/user/me'].some(
(userMePath) => req.route.path === userMePath,
) &&
[
'/auth/user/me',
'/api/v1/db/auth/user/me',
'/api/v1/auth/user/me',
'/api/v1/db/meta/plugins/webhook',
].some((userMePath) => req.route.path === userMePath) &&
req.query.project_id
) {
req.ncProjectId = req.query.project_id;

Loading…
Cancel
Save