fix(workspaces): add pagination to workspace team members (#2644)

* fix(workspaces): a suggestion of paginated teams

* fix(workspaces): workspace team pagination (?)

* fix(workspaces): pagination based on acl createdAt

* fix(workspaces): fix some roles-related tests

* fix(workspaces): improve query and tests

* fix(workspaces): collaborators query without incorrect groupBy

* fix(workspaces): add default values to migration

* Fixed queries and fragments

* Merged main

* Remove comment

* chore(workspaces): update WorkspaceCollaboratorCollection mocks

* chore(workspaces): fix role test

* chore(workspaces); ope

* fix(workspaces): move workspace acl timestamps to separate table

* Merge?

* fix(workspaces) drop that table

* fix(workspaces): cursor

* fix(workspaceInvites): undo merge borkage

* fix(workspaces): rework workspace member pagination

* fix(workspaces): fix test

* fix(workspaces): test test

* fix(workspaces): literally garbage

---------

Co-authored-by: Mike Tasset <mike.tasset@gmail.com>
Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
This commit is contained in:
Chuck Driesler
2024-08-29 20:17:37 +01:00
committed by GitHub
parent 03f8fd1176
commit bbd5146e5a
38 changed files with 754 additions and 206 deletions
@@ -154,7 +154,23 @@ const config: SpeckleModuleMocksConfig = FF_WORKSPACES_MODULE_ENABLED
},
Workspace: {
role: resolveFromMockParent(),
team: resolveFromMockParent(),
team: resolveAndCache((_parent, args) => {
const id = faker.string.uuid()
return getMockRef('WorkspaceCollaboratorCollection', {
values: {
items: [...new Array(args.limit)].map(() => ({
id,
role: faker.helpers.arrayElement(Object.values(Roles.Workspace)),
user: {
id,
name: faker.person.fullName()
}
})),
totalCount: args.limit,
cursor: null
}
})
}),
invitedTeam: resolveFromMockParent({
mapRefs: (mock, { parent }) =>
addMockRefValues(mock, {
@@ -224,7 +240,6 @@ const config: SpeckleModuleMocksConfig = FF_WORKSPACES_MODULE_ENABLED
name: workspaceName(),
description: faker.lorem.sentence(),
role: faker.helpers.arrayElement(Object.values(Roles.Workspace)),
team: listMock(1, 5),
invitedTeam: listMock(1, 5)
}),
WorkspaceCollaborator: () => ({