feat(activity): moved project roles to activity (#5019)
* feat: moved project roles to activity * fix: added previous project role filed on activity * fix: remvoke does not get logged as an actvity for every project in a workspace when removed from workspace * fix: on delete user account, emit also seat and project event Co-authored-by: Charles Driesler <chuck@speckle.systems>
This commit is contained in:
committed by
GitHub
parent
3fbaf6c252
commit
ba3d9ade22
@@ -27,4 +27,8 @@ export type GetUserWorkspaceCountFactory = (params: {
|
||||
userId: string
|
||||
}) => Promise<number>
|
||||
|
||||
export type GetUserWorkspaceSeatsFactory = (params: {
|
||||
userId: string
|
||||
}) => Promise<WorkspaceSeat[]>
|
||||
|
||||
export type GetTotalWorkspaceCountFactory = () => Promise<number>
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
import {
|
||||
GetTotalWorkspaceCountFactory,
|
||||
GetUserWorkspaceCountFactory
|
||||
GetUserWorkspaceCountFactory,
|
||||
GetUserWorkspaceSeatsFactory
|
||||
} from '@/modules/workspacesCore/domain/operations'
|
||||
import { Workspace, WorkspaceAcl } from '@/modules/workspacesCore/domain/types'
|
||||
import {
|
||||
Workspace,
|
||||
WorkspaceAcl,
|
||||
WorkspaceSeat
|
||||
} from '@/modules/workspacesCore/domain/types'
|
||||
import {
|
||||
WorkspaceAcl as WorkspaceAclDb,
|
||||
Workspaces
|
||||
Workspaces,
|
||||
WorkspaceSeats
|
||||
} from '@/modules/workspacesCore/helpers/db'
|
||||
import { Knex } from 'knex'
|
||||
|
||||
const tables = {
|
||||
workspaces: (db: Knex) => db<Workspace>(Workspaces.name),
|
||||
workspaceAcl: (db: Knex) => db<WorkspaceAcl>(WorkspaceAclDb.name)
|
||||
workspaceAcl: (db: Knex) => db<WorkspaceAcl>(WorkspaceAclDb.name),
|
||||
workspaceSeats: (db: Knex) => db<WorkspaceSeat>(WorkspaceSeats.name)
|
||||
}
|
||||
|
||||
export const getUserWorkspaceCountFactory =
|
||||
@@ -27,6 +34,14 @@ export const getUserWorkspaceCountFactory =
|
||||
return parseInt(count)
|
||||
}
|
||||
|
||||
export const getUserWorkspaceSeatsFactory =
|
||||
(deps: { db: Knex }): GetUserWorkspaceSeatsFactory =>
|
||||
async ({ userId }: { userId: string }) => {
|
||||
const workspaceSeats = await tables.workspaceSeats(deps.db).where({ userId })
|
||||
|
||||
return workspaceSeats
|
||||
}
|
||||
|
||||
export const getTotalWorkspaceCountFactory =
|
||||
(deps: { db: Knex }): GetTotalWorkspaceCountFactory =>
|
||||
async () => {
|
||||
|
||||
Reference in New Issue
Block a user