|
|
@ -10,6 +10,7 @@ import { |
|
|
|
} from 'nocodb-sdk' |
|
|
|
} from 'nocodb-sdk' |
|
|
|
import type { Roles, WorkspaceUserRoles } from 'nocodb-sdk' |
|
|
|
import type { Roles, WorkspaceUserRoles } from 'nocodb-sdk' |
|
|
|
import { isEeUI, storeToRefs, useUserSorts } from '#imports' |
|
|
|
import { isEeUI, storeToRefs, useUserSorts } from '#imports' |
|
|
|
|
|
|
|
import type { User } from '#imports' |
|
|
|
|
|
|
|
|
|
|
|
const basesStore = useBases() |
|
|
|
const basesStore = useBases() |
|
|
|
const { getBaseUsers, createProjectUser, updateProjectUser, removeProjectUser } = basesStore |
|
|
|
const { getBaseUsers, createProjectUser, updateProjectUser, removeProjectUser } = basesStore |
|
|
@ -85,7 +86,7 @@ const updateCollaborator = async (collab: any, roles: ProjectRoles) => { |
|
|
|
WorkspaceRolesToProjectRoles[currentCollaborator.workspace_roles as WorkspaceUserRoles] === roles && |
|
|
|
WorkspaceRolesToProjectRoles[currentCollaborator.workspace_roles as WorkspaceUserRoles] === roles && |
|
|
|
isEeUI) |
|
|
|
isEeUI) |
|
|
|
) { |
|
|
|
) { |
|
|
|
await removeProjectUser(activeProjectId.value!, currentCollaborator as any) |
|
|
|
await removeProjectUser(activeProjectId.value!, currentCollaborator as unknown as User) |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
currentCollaborator.workspace_roles && |
|
|
|
currentCollaborator.workspace_roles && |
|
|
|
WorkspaceRolesToProjectRoles[currentCollaborator.workspace_roles as WorkspaceUserRoles] === roles && |
|
|
|
WorkspaceRolesToProjectRoles[currentCollaborator.workspace_roles as WorkspaceUserRoles] === roles && |
|
|
@ -97,11 +98,11 @@ const updateCollaborator = async (collab: any, roles: ProjectRoles) => { |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (currentCollaborator.base_roles) { |
|
|
|
} else if (currentCollaborator.base_roles) { |
|
|
|
currentCollaborator.roles = roles |
|
|
|
currentCollaborator.roles = roles |
|
|
|
await updateProjectUser(activeProjectId.value!, currentCollaborator as any) |
|
|
|
await updateProjectUser(activeProjectId.value!, currentCollaborator as unknown as User) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
currentCollaborator.roles = roles |
|
|
|
currentCollaborator.roles = roles |
|
|
|
currentCollaborator.base_roles = roles |
|
|
|
currentCollaborator.base_roles = roles |
|
|
|
await createProjectUser(activeProjectId.value!, currentCollaborator as any) |
|
|
|
await createProjectUser(activeProjectId.value!, currentCollaborator as unknown as User) |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e: any) { |
|
|
|
} catch (e: any) { |
|
|
|
message.error(await extractSdkResponseErrorMsg(e)) |
|
|
|
message.error(await extractSdkResponseErrorMsg(e)) |
|
|
|