-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into iain/github-action-test-fe2
- Loading branch information
Showing
19 changed files
with
372 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
packages/frontend-2/components/settings/workspaces/members/GuestsTable.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<template> | ||
<div> | ||
<SettingsWorkspacesMembersTableHeader | ||
search-placeholder="Search guests..." | ||
:workspace-id="workspaceId" | ||
:workspace="workspace" | ||
/> | ||
<LayoutTable | ||
class="mt-6 md:mt-8" | ||
:columns="[ | ||
{ id: 'name', header: 'Name', classes: 'col-span-3' }, | ||
{ id: 'company', header: 'Company', classes: 'col-span-3' }, | ||
{ id: 'verified', header: 'Status', classes: 'col-span-3' } | ||
]" | ||
:items="guests" | ||
> | ||
<template #name="{ item }"> | ||
<div class="flex items-center gap-2"> | ||
<UserAvatar :user="item" /> | ||
<span class="truncate text-body-xs text-foreground">{{ item.name }}</span> | ||
</div> | ||
</template> | ||
<template #company="{ item }"> | ||
<span class="text-body-xs text-foreground"> | ||
{{ item.company ? item.company : '-' }} | ||
</span> | ||
</template> | ||
<template #verified="{ item }"> | ||
<span class="text-body-xs text-foreground-2"> | ||
{{ item.verified ? 'Verified' : 'Unverified' }} | ||
</span> | ||
</template> | ||
</LayoutTable> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
// Todo: Enable searching once supported | ||
import type { SettingsWorkspacesMembersMembersTable_WorkspaceFragment } from '~~/lib/common/generated/gql/graphql' | ||
import { graphql } from '~/lib/common/generated/gql' | ||
import { Roles } from '@speckle/shared' | ||
graphql(` | ||
fragment SettingsWorkspacesMembersGuestsTable_WorkspaceCollaborator on WorkspaceCollaborator { | ||
id | ||
role | ||
user { | ||
id | ||
avatar | ||
name | ||
company | ||
verified | ||
} | ||
} | ||
`) | ||
graphql(` | ||
fragment SettingsWorkspacesMembersGuestsTable_Workspace on Workspace { | ||
id | ||
...SettingsWorkspacesMembersTableHeader_Workspace | ||
team { | ||
id | ||
...SettingsWorkspacesMembersGuestsTable_WorkspaceCollaborator | ||
} | ||
} | ||
`) | ||
const props = defineProps<{ | ||
workspace?: SettingsWorkspacesMembersMembersTable_WorkspaceFragment | ||
workspaceId: string | ||
}>() | ||
const guests = computed(() => | ||
(props.workspace?.team || []) | ||
.filter(({ role }) => role === Roles.Workspace.Guest) | ||
.map(({ user, ...rest }) => ({ | ||
...user, | ||
...rest | ||
})) | ||
) | ||
</script> |
Oops, something went wrong.