Browse Source

Merge branch 'develop' into nc-refactor/ds

pull/8510/head
Raju Udava 7 months ago
parent
commit
99524d4e17
  1. 20
      packages/nc-gui/components/virtual-cell/Lookup.vue
  2. 8
      packages/nc-gui/composables/useCommandPalette/index.ts
  3. 26
      packages/nocodb/src/services/command-palette.service.ts
  4. 1
      packages/nocodb/src/services/org-users.service.ts
  5. 1
      packages/nocodb/src/utils/acl.ts

20
packages/nc-gui/components/virtual-cell/Lookup.vue

@ -20,22 +20,12 @@ const rowHeight = inject(RowHeightInj, ref(1) as any)
provide(RowHeightInj, providedHeightRef)
const relationColumn = computed(
() =>
const relationColumn = computed(
() =>
meta.value?.id ? metas.value[meta.value?.id]?.columns?.find(
const relationColumn = computed(() =>
meta.value?.id
? metas.value[meta.value?.id]?.columns?.find(
(c: ColumnType) => c.id === (column.value?.colOptions as LookupType)?.fk_relation_column_id,
) : undefined as
| (ColumnType & {
colOptions: LinkToAnotherRecordType | undefined
})
| undefined,
)
| (ColumnType & {
colOptions: LinkToAnotherRecordType | undefined
})
| undefined,
)
: undefined,
)
watch(

8
packages/nc-gui/composables/useCommandPalette/index.ts

@ -168,13 +168,6 @@ export const useCommandPalette = createSharedComposable(() => {
data: { base_id: route.value.params.baseId },
}
}
} else {
if (route.value.path.startsWith('/account')) {
if (activeScope.value.scope === 'account_settings') return
activeScope.value = { scope: 'account_settings', data: {} }
loadScope()
} else {
if (activeScope.value.scope === 'root') return
@ -182,7 +175,6 @@ export const useCommandPalette = createSharedComposable(() => {
loadScope()
}
}
},
{ immediate: true, deep: true },
)

26
packages/nocodb/src/services/command-palette.service.ts

@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { type UserType, ViewTypes } from 'nocodb-sdk';
import { Base } from '~/models';
import { BaseUser } from '~/models';
import { TablesService } from '~/services/tables.service';
import { deserializeJSON } from '~/utils/serialize';
@ -20,30 +20,9 @@ export class CommandPaletteService {
async commandPalette(param: { body: any; user: UserType }) {
const cmdData = [];
try {
const { scope } = param.body;
if (scope === 'root') {
const bases = await Base.list({ user: param.user });
for (const base of bases) {
cmdData.push({
id: `p-${base.id}`,
title: base.title,
icon: 'project',
iconColor: deserializeJSON(base.meta)?.iconColor,
section: 'Bases',
scopePayload: {
scope: `p-${base.id}`,
data: {
base_id: base.id,
},
},
});
}
} else if (scope.startsWith('p-')) {
const allBases = [];
const bases = await Base.list({ user: param.user });
const bases = await BaseUser.getProjectsList(param.user.id, param);
allBases.push(...bases);
@ -108,7 +87,6 @@ export class CommandPaletteService {
cmdData.push(...tableList);
cmdData.push(...vwList);
}
} catch (e) {
console.log(e);
return [];

1
packages/nocodb/src/services/org-users.service.ts

@ -52,7 +52,6 @@ export class OrgUsersService {
return await User.update(param.userId, {
...updateBody,
token_version: randomTokenString(),
});
}

1
packages/nocodb/src/utils/acl.ts

@ -276,6 +276,7 @@ const rolePermissions:
baseList: true,
testConnection: true,
isPluginActive: true,
commandPalette: true,
},
},
[OrgUserRoles.CREATOR]: {

Loading…
Cancel
Save