Naming updates
This commit is contained in:
@@ -1,21 +1,19 @@
|
||||
<template>
|
||||
<span class="text-foreground">
|
||||
<div
|
||||
v-tippy="description"
|
||||
class="border-b border-dashed border-outline-5 max-w-max select-none capitalize"
|
||||
>
|
||||
{{ seatType }}
|
||||
</div>
|
||||
</span>
|
||||
<div
|
||||
v-tippy="description"
|
||||
class="text-foreground border-b border-dashed border-outline-5 max-w-max select-none capitalize"
|
||||
>
|
||||
{{ seatType }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { WORKSPACE_SEAT_TYPE_DESCRIPTIONS } from '~/lib/settings/helpers/types'
|
||||
import type { WorkspaceSeatType } from '~/lib/common/generated/gql/graphql'
|
||||
import { WorkspaceSeatTypeDescriptions } from '~/lib/settings/helpers/constants'
|
||||
|
||||
const props = defineProps<{
|
||||
seatType: WorkspaceSeatType
|
||||
}>()
|
||||
|
||||
const description = computed(() => WORKSPACE_SEAT_TYPE_DESCRIPTIONS[props.seatType])
|
||||
const description = computed(() => WorkspaceSeatTypeDescriptions[props.seatType])
|
||||
</script>
|
||||
|
||||
@@ -44,8 +44,8 @@ import {
|
||||
} from '~/lib/workspaces/composables/management'
|
||||
import { useActiveUser } from '~/lib/auth/composables/activeUser'
|
||||
import {
|
||||
UPDATE_WORKSPACE_MEMBER_CONFIG,
|
||||
WORKSPACE_ROLE_DESCRIPTIONS
|
||||
UpdateWorkspaceMemberConfig,
|
||||
WorkspaceRoleDescriptions
|
||||
} from '~/lib/settings/helpers/constants'
|
||||
import type { WorkspaceSeatType } from '~/lib/common/generated/gql/graphql'
|
||||
|
||||
@@ -74,7 +74,7 @@ const filteredActionsItems = computed(() => {
|
||||
const mainItems: LayoutMenuItem[] = []
|
||||
const footerItems: LayoutMenuItem[] = []
|
||||
|
||||
Object.entries(UPDATE_WORKSPACE_MEMBER_CONFIG).forEach(([type, config]) => {
|
||||
Object.entries(UpdateWorkspaceMemberConfig).forEach(([type, config]) => {
|
||||
if (
|
||||
config.menu.show({
|
||||
isActiveUserWorkspaceAdmin: isActiveUserWorkspaceAdmin.value,
|
||||
@@ -147,7 +147,7 @@ const onRemoveUser = async () => {
|
||||
|
||||
const dialogConfig = computed(() => {
|
||||
if (!dialogType.value) return null
|
||||
const config = UPDATE_WORKSPACE_MEMBER_CONFIG[dialogType.value].dialog
|
||||
const config = UpdateWorkspaceMemberConfig[dialogType.value].dialog
|
||||
return {
|
||||
...config,
|
||||
mainMessage:
|
||||
@@ -155,7 +155,7 @@ const dialogConfig = computed(() => {
|
||||
? config.mainMessage(props.targetUser.seatType)
|
||||
: config.mainMessage,
|
||||
roleInfo: config.showRoleInfo
|
||||
? WORKSPACE_ROLE_DESCRIPTIONS[props.targetUser.role]
|
||||
? WorkspaceRoleDescriptions[props.targetUser.role]
|
||||
: undefined
|
||||
}
|
||||
})
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<p v-if="roleInfo" class="text-foreground-2 text-body-2xs">
|
||||
{{ roleInfo }}. More about
|
||||
<NuxtLink
|
||||
:to="LEARN_MORE_ROLES_SEATS_URL"
|
||||
:to="LearnMoreRolesSeatsUrl"
|
||||
target="_blank"
|
||||
class="text-foreground-2 underline"
|
||||
>
|
||||
@@ -38,7 +38,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { LayoutDialogButton } from '@speckle/ui-components'
|
||||
import type { UserItem } from '~/components/settings/workspaces/members/new/MembersTable.vue'
|
||||
import { LEARN_MORE_ROLES_SEATS_URL } from '~/lib/settings/helpers/constants'
|
||||
import { LearnMoreRolesSeatsUrl } from '~/lib/settings/helpers/constants'
|
||||
|
||||
const props = defineProps<{
|
||||
user: UserItem
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
Guests are external collaborators. They can't create or add others to workspace
|
||||
projects. Read more about
|
||||
<!-- TODO: Add link to roles and seats page -->
|
||||
<NuxtLink :to="LEARN_MORE_ROLES_SEATS_URL" class="underline">
|
||||
<NuxtLink :to="LearnMoreRolesSeatsUrl" class="underline">
|
||||
Speckle roles and seats.
|
||||
</NuxtLink>
|
||||
</template>
|
||||
@@ -90,7 +90,7 @@ import { graphql } from '~/lib/common/generated/gql'
|
||||
import { Roles, type MaybeNullOrUndefined } from '@speckle/shared'
|
||||
import { settingsWorkspacesMembersSearchQuery } from '~~/lib/settings/graphql/queries'
|
||||
import { useQuery } from '@vue/apollo-composable'
|
||||
import { LEARN_MORE_ROLES_SEATS_URL } from '~/lib/settings/helpers/constants'
|
||||
import { LearnMoreRolesSeatsUrl } from '~/lib/settings/helpers/constants'
|
||||
import SeatTypeDisplay from '../SeatTypeDisplay.vue'
|
||||
graphql(`
|
||||
fragment SettingsWorkspacesMembersNewGuestsTable_WorkspaceCollaborator on WorkspaceCollaborator {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
Workspace members can have a viewer or editor seat. Admins must be editors. Read
|
||||
more about
|
||||
<!-- TODO: Add link to roles and seats page -->
|
||||
<NuxtLink :to="LEARN_MORE_ROLES_SEATS_URL" class="underline">
|
||||
<NuxtLink :to="LearnMoreRolesSeatsUrl" class="underline">
|
||||
Speckle roles and seats.
|
||||
</NuxtLink>
|
||||
</template>
|
||||
@@ -93,7 +93,7 @@ import { useQuery } from '@vue/apollo-composable'
|
||||
import type { SettingsWorkspacesNewMembersTable_WorkspaceFragment } from '~~/lib/common/generated/gql/graphql'
|
||||
import { graphql } from '~/lib/common/generated/gql'
|
||||
import { ExclamationCircleIcon } from '@heroicons/vue/24/outline'
|
||||
import { LEARN_MORE_ROLES_SEATS_URL } from '~/lib/settings/helpers/constants'
|
||||
import { LearnMoreRolesSeatsUrl } from '~/lib/settings/helpers/constants'
|
||||
import SeatTypeDisplay from '../SeatTypeDisplay.vue'
|
||||
|
||||
export type UserItem = (typeof members)['value'][0]
|
||||
|
||||
@@ -2,172 +2,176 @@ import { UserUpdateActionTypes, type ActionConfig } from '~/lib/settings/helpers
|
||||
import { Roles } from '@speckle/shared'
|
||||
import { WorkspaceSeatType } from '~/lib/common/generated/gql/graphql'
|
||||
|
||||
export const LEARN_MORE_ROLES_SEATS_URL =
|
||||
export const LearnMoreRolesSeatsUrl =
|
||||
'https://speckle.guide/user/workspaces.html#roles-and-seats'
|
||||
|
||||
export const WORKSPACE_ROLE_DESCRIPTIONS: Record<string, string> = {
|
||||
export const WorkspaceRoleDescriptions: Record<string, string> = {
|
||||
[Roles.Workspace.Admin]:
|
||||
'Can edit workspaces, including settings, members and all projects',
|
||||
[Roles.Workspace.Member]: 'Can create and own projects',
|
||||
[Roles.Workspace.Guest]: "Can contribute to projects they're invited to"
|
||||
}
|
||||
|
||||
export const UPDATE_WORKSPACE_MEMBER_CONFIG: Record<
|
||||
UserUpdateActionTypes,
|
||||
ActionConfig
|
||||
> = {
|
||||
[UserUpdateActionTypes.MakeAdmin]: {
|
||||
menu: {
|
||||
title: 'Make admin...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentRole
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentRole !== Roles.Workspace.Admin &&
|
||||
targetUserCurrentRole !== Roles.Workspace.Guest
|
||||
export const WorkspaceSeatTypeDescriptions: Record<WorkspaceSeatType, string> = {
|
||||
[WorkspaceSeatType.Editor]: 'Can create new models and versions',
|
||||
[WorkspaceSeatType.Viewer]: 'Can view and receive models, but not send to them'
|
||||
}
|
||||
|
||||
export const UpdateWorkspaceMemberConfig: Record<UserUpdateActionTypes, ActionConfig> =
|
||||
{
|
||||
[UserUpdateActionTypes.MakeAdmin]: {
|
||||
menu: {
|
||||
title: 'Make admin...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentRole
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentRole !== Roles.Workspace.Admin &&
|
||||
targetUserCurrentRole !== Roles.Workspace.Guest
|
||||
},
|
||||
dialog: {
|
||||
title: 'Make an admin',
|
||||
mainMessage: (seatType) =>
|
||||
seatType === WorkspaceSeatType.Editor
|
||||
? 'They will become project owner for all existing and new workspace projects.'
|
||||
: 'They will be given an editor seat and become project owner for all existing and new workspace projects.',
|
||||
showRoleInfo: true,
|
||||
buttonText: 'Make an admin',
|
||||
seatCountMessage: true
|
||||
}
|
||||
},
|
||||
dialog: {
|
||||
title: 'Make an admin',
|
||||
mainMessage: (seatType) =>
|
||||
seatType === WorkspaceSeatType.Editor
|
||||
? 'They will become project owner for all existing and new workspace projects.'
|
||||
: 'They will be given an editor seat and become project owner for all existing and new workspace projects.',
|
||||
showRoleInfo: true,
|
||||
buttonText: 'Make an admin',
|
||||
seatCountMessage: true
|
||||
}
|
||||
},
|
||||
[UserUpdateActionTypes.RemoveAdmin]: {
|
||||
menu: {
|
||||
title: 'Remove as admin...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentRole
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentRole === Roles.Workspace.Admin
|
||||
[UserUpdateActionTypes.RemoveAdmin]: {
|
||||
menu: {
|
||||
title: 'Remove as admin...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentRole
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentRole === Roles.Workspace.Admin
|
||||
},
|
||||
dialog: {
|
||||
title: 'Remove as admin',
|
||||
mainMessage: 'They will lose admin privileges and become a member.',
|
||||
showRoleInfo: false,
|
||||
buttonText: 'Remove as admin',
|
||||
seatCountMessage: false
|
||||
}
|
||||
},
|
||||
dialog: {
|
||||
title: 'Remove as admin',
|
||||
mainMessage: 'They will lose admin privileges and become a member.',
|
||||
showRoleInfo: false,
|
||||
buttonText: 'Remove as admin',
|
||||
seatCountMessage: false
|
||||
}
|
||||
},
|
||||
[UserUpdateActionTypes.MakeGuest]: {
|
||||
menu: {
|
||||
title: 'Make guest...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentRole
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentRole !== Roles.Workspace.Guest
|
||||
[UserUpdateActionTypes.MakeGuest]: {
|
||||
menu: {
|
||||
title: 'Make guest...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentRole
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentRole !== Roles.Workspace.Guest
|
||||
},
|
||||
dialog: {
|
||||
title: 'Make a guest',
|
||||
mainMessage: 'They will lose access to all existing workspace projects.',
|
||||
showRoleInfo: true,
|
||||
buttonText: 'Make a guest'
|
||||
}
|
||||
},
|
||||
dialog: {
|
||||
title: 'Make a guest',
|
||||
mainMessage: 'They will lose access to all existing workspace projects.',
|
||||
showRoleInfo: true,
|
||||
buttonText: 'Make a guest'
|
||||
}
|
||||
},
|
||||
[UserUpdateActionTypes.MakeMember]: {
|
||||
menu: {
|
||||
title: 'Make member...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentRole
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentRole === Roles.Workspace.Guest
|
||||
[UserUpdateActionTypes.MakeMember]: {
|
||||
menu: {
|
||||
title: 'Make member...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentRole
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentRole === Roles.Workspace.Guest
|
||||
},
|
||||
dialog: {
|
||||
title: 'Make member',
|
||||
mainMessage: (seatType) =>
|
||||
seatType === WorkspaceSeatType.Editor
|
||||
? 'They will be given a viewer seat and lose project ownership.'
|
||||
: 'They will be given a viewer seat.',
|
||||
showRoleInfo: true,
|
||||
buttonText: 'Make a member'
|
||||
}
|
||||
},
|
||||
dialog: {
|
||||
title: 'Make member',
|
||||
mainMessage: (seatType) =>
|
||||
seatType === WorkspaceSeatType.Editor
|
||||
? 'They will be given a viewer seat and lose project ownership.'
|
||||
: 'They will be given a viewer seat.',
|
||||
showRoleInfo: true,
|
||||
buttonText: 'Make a member'
|
||||
}
|
||||
},
|
||||
[UserUpdateActionTypes.UpgradeEditor]: {
|
||||
menu: {
|
||||
title: 'Upgrade to editor seat...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentSeatType
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentSeatType === WorkspaceSeatType.Viewer
|
||||
[UserUpdateActionTypes.UpgradeEditor]: {
|
||||
menu: {
|
||||
title: 'Upgrade to editor seat...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentSeatType
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentSeatType === WorkspaceSeatType.Viewer
|
||||
},
|
||||
dialog: {
|
||||
title: 'Upgrade to an editor seat?',
|
||||
mainMessage:
|
||||
'An editor seat will allow them to create new models and versions.',
|
||||
buttonText: 'Upgrade to editor',
|
||||
seatCountMessage: true
|
||||
}
|
||||
},
|
||||
dialog: {
|
||||
title: 'Upgrade to an editor seat?',
|
||||
mainMessage: 'An editor seat will allow them to create new models and versions.',
|
||||
buttonText: 'Upgrade to editor',
|
||||
seatCountMessage: true
|
||||
}
|
||||
},
|
||||
[UserUpdateActionTypes.DowngradeEditor]: {
|
||||
menu: {
|
||||
title: 'Downgrade to viewer seat...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentSeatType
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentSeatType === WorkspaceSeatType.Editor
|
||||
[UserUpdateActionTypes.DowngradeEditor]: {
|
||||
menu: {
|
||||
title: 'Downgrade to viewer seat...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentSeatType
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentSeatType === WorkspaceSeatType.Editor
|
||||
},
|
||||
dialog: {
|
||||
title: 'Downgrade to a viewer seat?',
|
||||
mainMessage:
|
||||
'A viewer seat will allow them to view and receive model, but not send to it.',
|
||||
buttonText: 'Downgrade to viewer',
|
||||
seatCountMessage: true
|
||||
}
|
||||
},
|
||||
dialog: {
|
||||
title: 'Downgrade to a viewer seat?',
|
||||
mainMessage:
|
||||
'A viewer seat will allow them to view and receive model, but not send to it.',
|
||||
buttonText: 'Downgrade to viewer',
|
||||
seatCountMessage: true
|
||||
}
|
||||
},
|
||||
[UserUpdateActionTypes.RemoveMember]: {
|
||||
menu: {
|
||||
title: 'Remove from workspace...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentRole
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentRole === 'canRemove'
|
||||
[UserUpdateActionTypes.RemoveMember]: {
|
||||
menu: {
|
||||
title: 'Remove from workspace...',
|
||||
show: ({
|
||||
isActiveUserWorkspaceAdmin = false,
|
||||
isActiveUserTargetUser,
|
||||
targetUserCurrentRole
|
||||
}) =>
|
||||
isActiveUserWorkspaceAdmin &&
|
||||
!isActiveUserTargetUser &&
|
||||
targetUserCurrentRole === 'canRemove'
|
||||
},
|
||||
dialog: {
|
||||
title: 'Remove from workspace?',
|
||||
mainMessage: 'They will lose access to all existing workspace projects.',
|
||||
buttonText: 'Remove from workspace',
|
||||
seatCountMessage: true
|
||||
}
|
||||
},
|
||||
dialog: {
|
||||
title: 'Remove from workspace?',
|
||||
mainMessage: 'They will lose access to all existing workspace projects.',
|
||||
buttonText: 'Remove from workspace',
|
||||
seatCountMessage: true
|
||||
[UserUpdateActionTypes.LeaveWorkspace]: {
|
||||
menu: {
|
||||
title: 'Leave workspace...',
|
||||
show: ({ isActiveUserTargetUser = false }) => isActiveUserTargetUser
|
||||
},
|
||||
dialog: {
|
||||
title: 'Leave workspace?',
|
||||
mainMessage: 'You will lose access to all existing workspace projects.',
|
||||
buttonText: 'Leave workspace'
|
||||
}
|
||||
}
|
||||
},
|
||||
[UserUpdateActionTypes.LeaveWorkspace]: {
|
||||
menu: {
|
||||
title: 'Leave workspace...',
|
||||
show: ({ isActiveUserTargetUser = false }) => isActiveUserTargetUser
|
||||
},
|
||||
dialog: {
|
||||
title: 'Leave workspace?',
|
||||
mainMessage: 'You will lose access to all existing workspace projects.',
|
||||
buttonText: 'Leave workspace'
|
||||
}
|
||||
}
|
||||
} as const
|
||||
} as const
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { AvailableRoles } from '@speckle/shared'
|
||||
import { WorkspaceSeatType } from '~/lib/common/generated/gql/graphql'
|
||||
import type { WorkspaceSeatType } from '~/lib/common/generated/gql/graphql'
|
||||
|
||||
type BaseSettingsMenuItem = {
|
||||
title: string
|
||||
@@ -23,11 +23,6 @@ export enum UserUpdateActionTypes {
|
||||
DowngradeEditor = 'downgrade-editor'
|
||||
}
|
||||
|
||||
export const WORKSPACE_SEAT_TYPE_DESCRIPTIONS: Record<WorkspaceSeatType, string> = {
|
||||
[WorkspaceSeatType.Editor]: 'Can create new models and versions',
|
||||
[WorkspaceSeatType.Viewer]: 'Can view and receive models, but not send to them'
|
||||
}
|
||||
|
||||
export type WorkspaceSettingsMenuItem = BaseSettingsMenuItem & {
|
||||
name: string
|
||||
route: (slug: string) => string
|
||||
|
||||
Reference in New Issue
Block a user