Compare commits
55 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ee4e7576ad | |||
| 55afedab68 | |||
| a8d948ec71 | |||
| 65a9d3e485 | |||
| be631746b9 | |||
| 20c43f2108 | |||
| af0de85ef7 | |||
| 7c54845a05 | |||
| cbec244443 | |||
| a2a9ab1f4b | |||
| 2f87c34272 | |||
| 7fde35e639 | |||
| 97765d84ca | |||
| 9d15be73ad | |||
| 45f763a2ce | |||
| 3c6bda7af9 | |||
| 007794dae2 | |||
| f8912338cb | |||
| f932fa46a3 | |||
| 292d2bf0bb | |||
| 43340d9b52 | |||
| 4898a9e2e9 | |||
| 19b982e2e3 | |||
| e3cf896c14 | |||
| 34d855212f | |||
| 8d159547d4 | |||
| 0c3ee8b38f | |||
| c51f282644 | |||
| 1faea0aec2 | |||
| 5e97acf4c0 | |||
| 9c7413d630 | |||
| 89acd7ca80 | |||
| 2e51a2fb3c | |||
| 644754262c | |||
| b28129c30e | |||
| 305ad36cac | |||
| 554d0ee478 | |||
| 33fd9c65e3 | |||
| ebaee49fe8 | |||
| b877c1d321 | |||
| be4dc87b3e | |||
| 94ddc486aa | |||
| ac5984d184 | |||
| 8dae170592 | |||
| d6f371c7d2 | |||
| cbf9e8d578 | |||
| 6f10519e6f | |||
| 590b8b8872 | |||
| 2514b6c606 | |||
| af37112a5f | |||
| d224b33bc8 | |||
| 377cfc2f65 | |||
| fdd13170f5 | |||
| e70310654b | |||
| 8bb14d3389 |
+1
-1
@@ -1,4 +1,4 @@
|
||||
HOST=0.0.0.0
|
||||
HOST=127.0.0.1
|
||||
PORT=8082
|
||||
|
||||
NUXT_PUBLIC_MIXPANEL_TOKEN_ID=acd87c5a50b56df91a795e999812a3a4
|
||||
|
||||
@@ -13,15 +13,19 @@
|
||||
import { useMixpanel } from '~/lib/core/composables/mixpanel'
|
||||
import { useConfigStore } from '~/store/config'
|
||||
import { useAccountStore } from '~/store/accounts'
|
||||
import { useHostAppStore } from '~/store/hostApp'
|
||||
import { storeToRefs } from 'pinia'
|
||||
|
||||
const uiConfigStore = useConfigStore()
|
||||
const { isDarkTheme } = storeToRefs(uiConfigStore)
|
||||
const hostAppStore = useHostAppStore()
|
||||
const { connectorVersion, hostAppName, hostAppVersion } = storeToRefs(hostAppStore)
|
||||
|
||||
useHead({
|
||||
// Title suffix
|
||||
titleTemplate: (titleChunk) =>
|
||||
titleChunk ? `${titleChunk as string} - Speckle DUIv3` : 'Speckle DUIv3',
|
||||
title: computed(
|
||||
() =>
|
||||
`CNX: (hostApp: ${hostAppName.value}:v${hostAppVersion.value}),(version: ${connectorVersion.value})`
|
||||
),
|
||||
htmlAttrs: {
|
||||
lang: 'en',
|
||||
class: computed(() => (isDarkTheme.value ? `dark` : ``))
|
||||
@@ -50,5 +54,8 @@ onMounted(() => {
|
||||
uniqueEmails.add(email)
|
||||
}
|
||||
})
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { $intercom } = useNuxtApp() // needed her for initialisation
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -9,7 +9,13 @@
|
||||
<Component :is="iconAndColor.icon" :class="`w-4 h-4 ${iconAndColor.color}`" />
|
||||
</div>
|
||||
<div :class="`text-xs ${iconAndColor.color}`">
|
||||
{{ result.category }}: {{ result.objectIds.length }} affected elements
|
||||
{{ result.category }}:
|
||||
{{
|
||||
'objectIds' in props.result
|
||||
? props.result.objectIds.length
|
||||
: props.result.objectAppIds.length
|
||||
}}
|
||||
affected elements
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="result.message" class="text-xs text-foreground-2 pl-5">
|
||||
@@ -19,16 +25,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useQuery } from '@vue/apollo-composable'
|
||||
import {
|
||||
XMarkIcon,
|
||||
InformationCircleIcon,
|
||||
ExclamationTriangleIcon
|
||||
} from '@heroicons/vue/24/outline'
|
||||
import type { Automate } from '@speckle/shared'
|
||||
import { objectQuery } from '~/lib/graphql/mutationsAndQueries'
|
||||
import type { IModelCard } from '~/lib/models/card'
|
||||
import { useAccountStore } from '~/store/accounts'
|
||||
|
||||
type ObjectResult = Automate.AutomateTypes.ResultsSchema['values']['objectResults'][0]
|
||||
|
||||
@@ -37,38 +40,12 @@ const props = defineProps<{
|
||||
result: ObjectResult
|
||||
functionId?: string
|
||||
}>()
|
||||
|
||||
const accStore = useAccountStore()
|
||||
const app = useNuxtApp()
|
||||
const projectAccount = computed(() =>
|
||||
accStore.accountWithFallback(props.modelCard.accountId, props.modelCard.serverUrl)
|
||||
)
|
||||
const clientId = projectAccount.value.accountInfo.id
|
||||
|
||||
const applicationIds = ref<string[]>([])
|
||||
|
||||
type Data = {
|
||||
applicationId?: string
|
||||
}
|
||||
|
||||
// Loop over each objectId to run the query and collect application IDs
|
||||
props.result.objectIds.forEach((objectId) => {
|
||||
const { result: objectResult } = useQuery(
|
||||
objectQuery,
|
||||
() => ({
|
||||
projectId: props.modelCard.projectId,
|
||||
objectId
|
||||
}),
|
||||
() => ({ clientId })
|
||||
)
|
||||
|
||||
watch(objectResult, (newValue) => {
|
||||
const data = newValue?.project.object?.data as Data | undefined
|
||||
const applicationId = data?.applicationId
|
||||
if (applicationId && !applicationIds.value.includes(applicationId)) {
|
||||
applicationIds.value.push(applicationId)
|
||||
}
|
||||
})
|
||||
const applicationIds = computed(() => {
|
||||
// Old schema ignore
|
||||
if ('objectIds' in props.result) return []
|
||||
return Object.values(props.result.objectAppIds).filter((id) => id !== null)
|
||||
})
|
||||
|
||||
const handleClick = async () => {
|
||||
|
||||
@@ -17,9 +17,21 @@
|
||||
</div>
|
||||
<div class="flex items-center group">
|
||||
<FormButton
|
||||
v-if="notification.cta"
|
||||
v-if="notification.secondaryCta"
|
||||
v-tippy="notification.secondaryCta.tooltipText"
|
||||
size="sm"
|
||||
:color="notificationButtonColor(notification.level)"
|
||||
color="outline"
|
||||
full-width
|
||||
class="mr-1"
|
||||
@click.stop="notification.secondaryCta.action"
|
||||
>
|
||||
{{ notification.secondaryCta.name }}
|
||||
</FormButton>
|
||||
<FormButton
|
||||
v-if="notification.cta"
|
||||
v-tippy="notification.cta.tooltipText"
|
||||
size="sm"
|
||||
color="primary"
|
||||
full-width
|
||||
@click.stop="notification.cta?.action"
|
||||
>
|
||||
@@ -47,10 +59,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useTimeoutFn } from '@vueuse/core'
|
||||
import type {
|
||||
ModelCardNotification,
|
||||
ModelCardNotificationLevel
|
||||
} from '~/lib/models/card/notification'
|
||||
import type { ModelCardNotification } from '~/lib/models/card/notification'
|
||||
import { XMarkIcon } from '@heroicons/vue/24/outline'
|
||||
const props = defineProps<{
|
||||
notification: ModelCardNotification
|
||||
@@ -62,20 +71,20 @@ if (props.notification.timeout) {
|
||||
useTimeoutFn(() => emit('dismiss'), props.notification.timeout)
|
||||
}
|
||||
|
||||
const notificationButtonColor = (notificationLevel: ModelCardNotificationLevel) => {
|
||||
switch (notificationLevel) {
|
||||
case 'info':
|
||||
return 'outline'
|
||||
case 'danger':
|
||||
return 'danger'
|
||||
case 'success':
|
||||
return 'primary'
|
||||
case 'warning':
|
||||
return 'danger'
|
||||
default:
|
||||
return 'outline'
|
||||
}
|
||||
}
|
||||
// const notificationButtonColor = (notificationLevel: ModelCardNotificationLevel) => {
|
||||
// switch (notificationLevel) {
|
||||
// case 'info':
|
||||
// return 'outline'
|
||||
// case 'danger':
|
||||
// return 'danger'
|
||||
// case 'success':
|
||||
// return 'primary'
|
||||
// case 'warning':
|
||||
// return 'danger'
|
||||
// default:
|
||||
// return 'outline'
|
||||
// }
|
||||
// }
|
||||
|
||||
const textClassColor = computed(() => {
|
||||
switch (props.notification.level) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
color="neutral"
|
||||
size="xs"
|
||||
hide-icon
|
||||
class="mb-2 mt-1"
|
||||
class="mt-1"
|
||||
>
|
||||
<template #description>
|
||||
<div class="flex items-center">
|
||||
|
||||
@@ -12,8 +12,11 @@
|
||||
full-width
|
||||
color="foundation"
|
||||
/>
|
||||
<FormButton color="outline" size="sm" @click="selectAllCategories">
|
||||
{{ allSelected ? 'Deselect all' : 'Select all' }}
|
||||
</FormButton>
|
||||
</div>
|
||||
<div class="flex space-y-1 flex-col">
|
||||
<div class="flex space-y-1 flex-col max-h-48 simple-scrollbar overflow-auto">
|
||||
<div
|
||||
v-for="cat in selectedCategoriesObjects.sort((a, b) =>
|
||||
a.name.localeCompare(b.name)
|
||||
@@ -93,6 +96,25 @@ const searchResults = computed(() => {
|
||||
|
||||
const selectedCategories = ref<string[]>(props.filter.selectedCategories || [])
|
||||
|
||||
const selectAllCategories = () => {
|
||||
if (allSelected.value) {
|
||||
selectedCategories.value = []
|
||||
return
|
||||
}
|
||||
availableCategories.value.forEach((cat) => {
|
||||
const index = selectedCategories.value.indexOf(cat.id)
|
||||
if (index !== -1) {
|
||||
return
|
||||
} else {
|
||||
selectedCategories.value.push(cat.id)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const allSelected = computed(() => {
|
||||
return availableCategories.value.length === selectedCategories.value.length
|
||||
})
|
||||
|
||||
const selectOrUnselectCategory = (id: string) => {
|
||||
const index = selectedCategories.value.indexOf(id)
|
||||
if (index !== -1) {
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
v-tippy="'Documentation and help'"
|
||||
@click="
|
||||
app.$openUrl(
|
||||
`https://www.speckle.systems/connectors/${hostAppStore.hostAppName}?utm=dui`
|
||||
`https://docs.speckle.systems/connectors/${hostAppStore.hostAppName}?utm=dui`
|
||||
)
|
||||
"
|
||||
>
|
||||
@@ -63,7 +63,7 @@
|
||||
class="w-4 text-foreground-disabled group-hover:text-foreground-2"
|
||||
/>
|
||||
</HeaderButton>
|
||||
<HeaderButton v-tippy="'Send us feedback'" @click="showFeedbackDialog = true">
|
||||
<HeaderButton v-tippy="'Send us feedback'" @click="openFeedbackDialog()">
|
||||
<ChatBubbleLeftIcon
|
||||
class="w-4 text-foreground-disabled group-hover:text-foreground-2"
|
||||
/>
|
||||
@@ -99,4 +99,17 @@ app.$baseBinding.on('documentChanged', () => {
|
||||
showSendDialog.value = false
|
||||
showReceiveDialog.value = false
|
||||
})
|
||||
|
||||
const { $intercom } = useNuxtApp()
|
||||
|
||||
const openFeedbackDialog = () => {
|
||||
if (
|
||||
hostAppStore.hostAppName?.toLowerCase() === 'revit' &&
|
||||
hostAppStore.hostAppVersion?.includes('2022')
|
||||
) {
|
||||
showFeedbackDialog.value = true
|
||||
} else {
|
||||
$intercom.show()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
<template>
|
||||
<div class="p-0">
|
||||
<slot name="activator" :toggle="toggleDialog"></slot>
|
||||
<CommonDialog
|
||||
v-model:open="showModelCreateDialog"
|
||||
:title="canCreateModelInWorkspace ? `Create new model` : errorMessage?.title"
|
||||
fullscreen="none"
|
||||
>
|
||||
<form v-if="canCreateModelInWorkspace" @submit="onSubmitCreateNewModel">
|
||||
<div class="text-body-2xs mb-2 ml-1">Model name</div>
|
||||
<FormTextInput
|
||||
v-model="newModelName"
|
||||
class="text-xs"
|
||||
autocomplete="off"
|
||||
name="name"
|
||||
label="Model name"
|
||||
color="foundation"
|
||||
:show-clear="!!newModelName"
|
||||
:placeholder="hostAppStore.documentInfo?.name"
|
||||
:rules="[
|
||||
ValidationHelpers.isRequired,
|
||||
ValidationHelpers.isStringOfLength({ minLength: 3 })
|
||||
]"
|
||||
full-width
|
||||
/>
|
||||
<div class="mt-4 flex justify-end items-center space-x-2 w-full">
|
||||
<FormButton size="sm" text @click="showModelCreateDialog = false">
|
||||
Cancel
|
||||
</FormButton>
|
||||
<FormButton size="sm" submit :disabled="isCreatingModel">Create</FormButton>
|
||||
</div>
|
||||
</form>
|
||||
<div v-else class="m-2">
|
||||
{{ errorMessage?.description }}
|
||||
<div class="flex mt-2 space-x-2 justify-end">
|
||||
<FormButton size="sm" color="outline" @click="showModelCreateDialog = false">
|
||||
Close
|
||||
</FormButton>
|
||||
<FormButton
|
||||
v-if="errorMessage?.cta"
|
||||
size="sm"
|
||||
submit
|
||||
@click="errorMessage?.cta?.action(), (showModelCreateDialog = false)"
|
||||
>
|
||||
{{ errorMessage?.cta?.name }}
|
||||
</FormButton>
|
||||
</div>
|
||||
</div>
|
||||
</CommonDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useMutation, provideApolloClient, useQuery } from '@vue/apollo-composable'
|
||||
import type { ModelListModelItemFragment } from '~/lib/common/generated/gql/graphql'
|
||||
import { useForm } from 'vee-validate'
|
||||
import { ValidationHelpers } from '@speckle/ui-components'
|
||||
import type { DUIAccount } from '~/store/accounts'
|
||||
import { useAccountStore } from '~/store/accounts'
|
||||
import { useMixpanel } from '~/lib/core/composables/mixpanel'
|
||||
import { useHostAppStore } from '~/store/hostApp'
|
||||
import {
|
||||
canCreateModelInProjectQuery,
|
||||
createModelMutation
|
||||
} from '~/lib/graphql/mutationsAndQueries'
|
||||
|
||||
type WorkspacePermissionMessage = {
|
||||
title: string
|
||||
description: string
|
||||
cta?: {
|
||||
name: string
|
||||
action: () => void
|
||||
}
|
||||
}
|
||||
|
||||
const { $openUrl } = useNuxtApp()
|
||||
|
||||
const showModelCreateDialog = ref(false)
|
||||
const isCreatingModel = ref(false)
|
||||
|
||||
const props = defineProps<{
|
||||
projectId: string
|
||||
workspaceId?: string
|
||||
workspaceSlug?: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'model:created', model: ModelListModelItemFragment): void
|
||||
}>()
|
||||
|
||||
const { trackEvent } = useMixpanel()
|
||||
const accountStore = useAccountStore()
|
||||
const hostAppStore = useHostAppStore()
|
||||
const { activeAccount } = storeToRefs(accountStore)
|
||||
|
||||
const accountId = computed(() => activeAccount.value.accountInfo.id)
|
||||
const newModelName = ref<string>()
|
||||
const errorMessage = ref<WorkspacePermissionMessage>()
|
||||
|
||||
const toggleDialog = () => {
|
||||
showModelCreateDialog.value = !showModelCreateDialog.value
|
||||
}
|
||||
|
||||
const account = computed(() => {
|
||||
return accountStore.accounts.find(
|
||||
(acc) => acc.accountInfo.id === accountId.value
|
||||
) as DUIAccount
|
||||
})
|
||||
|
||||
const canCreateModelInWorkspace = ref<boolean>()
|
||||
|
||||
const { result: canCreateModelInWorkspaceResult } = useQuery(
|
||||
canCreateModelInProjectQuery,
|
||||
() => ({ projectId: props.projectId }),
|
||||
() => ({
|
||||
clientId: accountId.value,
|
||||
debounce: 500,
|
||||
fetchPolicy: 'network-only'
|
||||
})
|
||||
)
|
||||
|
||||
watch(canCreateModelInWorkspaceResult, (val) => {
|
||||
if (val?.project.permissions.canCreateModel.code !== 'OK') {
|
||||
switch (val?.project.permissions.canCreateModel.code) {
|
||||
case 'WorkspaceLimitsReached':
|
||||
errorMessage.value = {
|
||||
title: 'Plan limit reached',
|
||||
description:
|
||||
'The model limit for this workspace has been reached. Upgrade the workspace plan to create or move more models.',
|
||||
cta: {
|
||||
name: 'Explore Plans',
|
||||
action: () =>
|
||||
$openUrl(
|
||||
`${account.value.accountInfo.serverInfo.url}/settings/workspaces/${props.workspaceSlug}/billing`
|
||||
)
|
||||
}
|
||||
}
|
||||
break
|
||||
// TODO: we should add more cases later according to `code`
|
||||
default:
|
||||
errorMessage.value = {
|
||||
title: 'Workspace warning',
|
||||
description: val?.project.permissions.canCreateModel.message ?? 'error'
|
||||
}
|
||||
break
|
||||
}
|
||||
canCreateModelInWorkspace.value = false
|
||||
} else {
|
||||
canCreateModelInWorkspace.value = true
|
||||
}
|
||||
})
|
||||
|
||||
const createNewModel = async (name: string) => {
|
||||
isCreatingModel.value = true
|
||||
|
||||
void trackEvent('DUI3 Action', { name: 'Model Create' }, account.value.accountInfo.id)
|
||||
|
||||
const { mutate } = provideApolloClient(account.value.client)(() =>
|
||||
useMutation(createModelMutation)
|
||||
)
|
||||
const res = await mutate({ input: { projectId: props.projectId, name } })
|
||||
if (res?.data?.modelMutations.create) {
|
||||
emit('model:created', res?.data?.modelMutations.create)
|
||||
// refetch() // Sorts the list with newly created model otherwise it will put the model at the bottom.
|
||||
// emit('next', res?.data?.modelMutations.create)
|
||||
} else {
|
||||
let errorMessage = 'Undefined error'
|
||||
if (res?.errors && res?.errors.length !== 0) {
|
||||
errorMessage = res?.errors[0].message
|
||||
}
|
||||
|
||||
hostAppStore.setNotification({
|
||||
type: 1,
|
||||
title: 'Failed to create model',
|
||||
description: errorMessage
|
||||
})
|
||||
}
|
||||
isCreatingModel.value = false
|
||||
}
|
||||
|
||||
const { handleSubmit } = useForm<{ name: string }>()
|
||||
const onSubmitCreateNewModel = handleSubmit(() => {
|
||||
void createNewModel(newModelName.value as string)
|
||||
})
|
||||
</script>
|
||||
@@ -178,7 +178,7 @@ const expiredNotification = computed(() => {
|
||||
if (props.modelCard.latestVersionId === props.modelCard.selectedVersionId) return
|
||||
const notification = {} as ModelCardNotification
|
||||
notification.dismissible = true
|
||||
notification.level = 'info'
|
||||
notification.level = 'success'
|
||||
notification.text = 'Newer version available!'
|
||||
notification.cta = {
|
||||
name: 'Update',
|
||||
@@ -203,13 +203,6 @@ const receiveResultNotificationText = computed(() => {
|
||||
return 'Model loaded!'
|
||||
})
|
||||
|
||||
const receiveResultNotificationLevel = computed(() => {
|
||||
if (failRate.value > 80) {
|
||||
return 'warning'
|
||||
}
|
||||
return 'info'
|
||||
})
|
||||
|
||||
const receiveResultNotification = computed(() => {
|
||||
if (
|
||||
!props.modelCard.bakedObjectIds ||
|
||||
@@ -219,7 +212,7 @@ const receiveResultNotification = computed(() => {
|
||||
|
||||
const notification = {} as ModelCardNotification
|
||||
notification.dismissible = true
|
||||
notification.level = receiveResultNotificationLevel.value
|
||||
notification.level = 'success'
|
||||
notification.text = receiveResultNotificationText.value
|
||||
notification.report = props.modelCard.report
|
||||
notification.cta = {
|
||||
|
||||
+118
-1
@@ -41,6 +41,44 @@
|
||||
</div>
|
||||
</CommonDialog>
|
||||
|
||||
<CommonDialog
|
||||
v-model:open="showSetMessageDialog"
|
||||
title="Version message"
|
||||
fullscreen="none"
|
||||
>
|
||||
<form @submit="setVersionMessage(versionMessage as string)">
|
||||
<div class="text-body-2xs mb-2 ml-1">
|
||||
Describe your latest changes to help keep track of design intent.
|
||||
</div>
|
||||
<FormTextArea
|
||||
v-model="versionMessage"
|
||||
class="text-xs"
|
||||
placeholder="Moved elements to prevent clash"
|
||||
autocomplete="off"
|
||||
name="name"
|
||||
label="Version message"
|
||||
color="foundation"
|
||||
:show-clear="!!versionMessage"
|
||||
:rules="[ValidationHelpers.isStringOfLength({ minLength: 3 })]"
|
||||
full-width
|
||||
/>
|
||||
<CommonLoadingBar v-if="isUpdatingVersionMessage" loading />
|
||||
<div class="mt-4 flex justify-end items-center space-x-2 w-full">
|
||||
<FormButton size="sm" text @click="showSetMessageDialog = false">
|
||||
Cancel
|
||||
</FormButton>
|
||||
<FormButton
|
||||
size="sm"
|
||||
submit
|
||||
:disabled="
|
||||
isUpdatingVersionMessage || !versionMessage || versionMessage.length < 3
|
||||
"
|
||||
>
|
||||
Save
|
||||
</FormButton>
|
||||
</div>
|
||||
</form>
|
||||
</CommonDialog>
|
||||
<template #states>
|
||||
<CommonModelNotification
|
||||
v-if="expiredNotification"
|
||||
@@ -74,6 +112,11 @@ import type { ISendFilter, ISenderModelCard } from '~/lib/models/card/send'
|
||||
import type { ProjectModelGroup } from '~/store/hostApp'
|
||||
import { useHostAppStore } from '~/store/hostApp'
|
||||
import { useMixpanel } from '~/lib/core/composables/mixpanel'
|
||||
import { ToastNotificationType, ValidationHelpers } from '@speckle/ui-components'
|
||||
import { provideApolloClient, useMutation } from '@vue/apollo-composable'
|
||||
import { useAccountStore, type DUIAccount } from '~/store/accounts'
|
||||
import { setVersionMessageMutation } from '~/lib/graphql/mutationsAndQueries'
|
||||
const hostAppStore = useHostAppStore()
|
||||
|
||||
const { trackEvent } = useMixpanel()
|
||||
const app = useNuxtApp()
|
||||
@@ -97,6 +140,7 @@ const sendOrCancel = () => {
|
||||
}
|
||||
if (props.modelCard.progress) store.sendModelCancel(props.modelCard.modelCardId)
|
||||
else store.sendModel(props.modelCard.modelCardId, 'ModelCardButton')
|
||||
hasSetVersionMessage.value = false
|
||||
}
|
||||
|
||||
let newFilter: ISendFilter
|
||||
@@ -120,9 +164,63 @@ const saveFilter = async () => {
|
||||
openFilterDialog.value = false
|
||||
}
|
||||
|
||||
const showSetMessageDialog = ref(false)
|
||||
const isUpdatingVersionMessage = ref(false)
|
||||
const hasSetVersionMessage = ref(false)
|
||||
const versionMessage = ref<string>()
|
||||
|
||||
const accountStore = useAccountStore()
|
||||
const account = accountStore.accounts.find(
|
||||
(acc) => acc.accountInfo.id === props.project.accountId
|
||||
) as DUIAccount
|
||||
|
||||
const setVersionMessage = async (message: string) => {
|
||||
if (!props.modelCard.latestCreatedVersionId) {
|
||||
return
|
||||
}
|
||||
|
||||
void trackEvent('DUI3 Action', {
|
||||
name: 'Set version message'
|
||||
})
|
||||
|
||||
isUpdatingVersionMessage.value = true
|
||||
const { mutate } = provideApolloClient(account.client)(() =>
|
||||
useMutation(setVersionMessageMutation)
|
||||
)
|
||||
|
||||
const res = await mutate({
|
||||
input: {
|
||||
projectId: props.project.projectId,
|
||||
versionId: props.modelCard.latestCreatedVersionId,
|
||||
message
|
||||
}
|
||||
})
|
||||
|
||||
if (res?.data?.versionMutations.update.id) {
|
||||
// seemed to noisy, and autoclose does not work for some reason.
|
||||
// nicer ux to just close the dialog
|
||||
// hostAppStore.setNotification({
|
||||
// type: ToastNotificationType.Info,
|
||||
// title: 'Version message saved',
|
||||
// autoClose: true
|
||||
// })
|
||||
hasSetVersionMessage.value = true
|
||||
} else {
|
||||
hostAppStore.setNotification({
|
||||
type: ToastNotificationType.Danger,
|
||||
title: 'Request failed',
|
||||
description: 'Failed to update version message.',
|
||||
autoClose: true
|
||||
})
|
||||
}
|
||||
showSetMessageDialog.value = false
|
||||
isUpdatingVersionMessage.value = false
|
||||
}
|
||||
|
||||
const saveFilterAndSend = async () => {
|
||||
await saveFilter()
|
||||
store.sendModel(props.modelCard.modelCardId, 'Filter')
|
||||
hasSetVersionMessage.value = false
|
||||
}
|
||||
|
||||
const expiredNotification = computed(() => {
|
||||
@@ -139,6 +237,7 @@ const expiredNotification = computed(() => {
|
||||
notification.cta = {
|
||||
name: ctaType,
|
||||
action: async () => {
|
||||
hasSetVersionMessage.value = false
|
||||
if (props.modelCard.progress) {
|
||||
await store.sendModelCancel(props.modelCard.modelCardId)
|
||||
}
|
||||
@@ -188,8 +287,26 @@ const latestVersionNotification = computed(() => {
|
||||
notification.level = sendResultNotificationLevel.value
|
||||
notification.text = sendResultNotificationText.value
|
||||
notification.report = props.modelCard.report
|
||||
|
||||
// NOTE: this prevents us displaying the set message button for non-updated
|
||||
// connectors that send over the root object id over instead of the commit id
|
||||
if (
|
||||
props.modelCard.latestCreatedVersionId.length === 10 &&
|
||||
!hasSetVersionMessage.value
|
||||
) {
|
||||
notification.secondaryCta = {
|
||||
name: 'Set message',
|
||||
tooltipText: 'Describe your changes',
|
||||
action: () => {
|
||||
showSetMessageDialog.value = true
|
||||
versionMessage.value = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
notification.cta = {
|
||||
name: 'View version',
|
||||
name: 'View',
|
||||
tooltipText: 'Check your model in the browser!',
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
|
||||
action: () => cardBase.value?.viewModel()
|
||||
}
|
||||
|
||||
@@ -1,220 +0,0 @@
|
||||
<template>
|
||||
<div class="p-0">
|
||||
<slot name="activator" :toggle="toggleDialog"></slot>
|
||||
<CommonDialog
|
||||
v-model:open="showProjectCreateDialog"
|
||||
:title="`Create new project`"
|
||||
fullscreen="none"
|
||||
>
|
||||
<form @submit="onSubmitCreateNewProject">
|
||||
<div class="text-body-2xs mb-2 ml-1">Project name</div>
|
||||
<FormTextInput
|
||||
v-model="newProjectName"
|
||||
class="text-xs"
|
||||
placeholder="A Beautiful Home, A Small Bridge..."
|
||||
autocomplete="off"
|
||||
name="name"
|
||||
label="Project name"
|
||||
color="foundation"
|
||||
:show-clear="!!newProjectName"
|
||||
:rules="[
|
||||
ValidationHelpers.isRequired,
|
||||
ValidationHelpers.isStringOfLength({ minLength: 3 })
|
||||
]"
|
||||
full-width
|
||||
/>
|
||||
<div class="mt-4 flex justify-end items-center space-x-2 w-full">
|
||||
<FormButton size="sm" text @click="showProjectCreateDialog = false">
|
||||
Cancel
|
||||
</FormButton>
|
||||
<FormButton
|
||||
size="sm"
|
||||
submit
|
||||
:disabled="isCreatingProject || !canCreateProject"
|
||||
>
|
||||
Create
|
||||
</FormButton>
|
||||
</div>
|
||||
</form>
|
||||
</CommonDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useMutation, provideApolloClient, useQuery } from '@vue/apollo-composable'
|
||||
import type { ProjectListProjectItemFragment } from '~/lib/common/generated/gql/graphql'
|
||||
import {
|
||||
canCreatePersonalProjectQuery,
|
||||
canCreateProjectInWorkspaceQuery,
|
||||
createProjectInWorkspaceMutation,
|
||||
createProjectMutation
|
||||
} from '~/lib/graphql/mutationsAndQueries'
|
||||
import type { DUIAccount } from '~/store/accounts'
|
||||
import { useAccountStore } from '~/store/accounts'
|
||||
import { useMixpanel } from '~/lib/core/composables/mixpanel'
|
||||
import { useHostAppStore } from '~/store/hostApp'
|
||||
import { useForm } from 'vee-validate'
|
||||
import { ValidationHelpers } from '@speckle/ui-components'
|
||||
|
||||
const showProjectCreateDialog = ref(false)
|
||||
const isCreatingProject = ref(false)
|
||||
|
||||
const props = defineProps<{ workspaceId?: string }>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'project:created', result: ProjectListProjectItemFragment): void
|
||||
}>()
|
||||
|
||||
const { trackEvent } = useMixpanel()
|
||||
const accountStore = useAccountStore()
|
||||
const hostAppStore = useHostAppStore()
|
||||
const { activeAccount } = storeToRefs(accountStore)
|
||||
|
||||
const accountId = computed(() => activeAccount.value.accountInfo.id)
|
||||
const newProjectName = ref<string>()
|
||||
|
||||
const errorMessageForWorkspace = ref<string>()
|
||||
const errorMessageForPersonalProject = ref<string>()
|
||||
|
||||
const toggleDialog = () => {
|
||||
showProjectCreateDialog.value = !showProjectCreateDialog.value
|
||||
}
|
||||
|
||||
const account = computed(() => {
|
||||
return accountStore.accounts.find(
|
||||
(acc) => acc.accountInfo.id === accountId.value
|
||||
) as DUIAccount
|
||||
})
|
||||
|
||||
const canCreateProject = computed(() =>
|
||||
props.workspaceId === 'personalProject'
|
||||
? canCreatePersonalProject.value
|
||||
: canCreateProjectInWorkspace.value
|
||||
)
|
||||
|
||||
const { result: canCreatePersonalProjectResult } = useQuery(
|
||||
canCreatePersonalProjectQuery,
|
||||
() => ({}),
|
||||
() => ({
|
||||
clientId: accountId.value,
|
||||
debounce: 500,
|
||||
fetchPolicy: 'network-only'
|
||||
})
|
||||
)
|
||||
|
||||
watch(canCreatePersonalProjectResult, (val) => {
|
||||
if (val?.activeUser?.permissions.canCreatePersonalProject.code !== 'OK') {
|
||||
errorMessageForPersonalProject.value =
|
||||
val?.activeUser?.permissions.canCreatePersonalProject.message
|
||||
}
|
||||
})
|
||||
|
||||
const canCreatePersonalProject = computed(() => {
|
||||
try {
|
||||
return (
|
||||
canCreatePersonalProjectResult.value?.activeUser?.permissions
|
||||
.canCreatePersonalProject.code === 'OK'
|
||||
)
|
||||
} catch {
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
const { result: canCreateProjectInWorkspaceResult } = useQuery(
|
||||
canCreateProjectInWorkspaceQuery,
|
||||
() => ({ workspaceId: props.workspaceId ?? 'null' }), // TODO: i do not know the potential cause here
|
||||
() => ({
|
||||
clientId: accountId.value,
|
||||
debounce: 500,
|
||||
fetchPolicy: 'network-only'
|
||||
})
|
||||
)
|
||||
|
||||
watch(canCreateProjectInWorkspaceResult, (val) => {
|
||||
if (val?.workspace.permissions.canCreateProject.code !== 'OK') {
|
||||
errorMessageForWorkspace.value = val?.workspace.permissions.canCreateProject.message
|
||||
}
|
||||
})
|
||||
|
||||
const canCreateProjectInWorkspace = computed(() => {
|
||||
try {
|
||||
return (
|
||||
canCreateProjectInWorkspaceResult.value?.workspace.permissions.canCreateProject
|
||||
.code === 'OK'
|
||||
)
|
||||
} catch {
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
const { handleSubmit } = useForm<{ name: string }>()
|
||||
const onSubmitCreateNewProject = handleSubmit(() => {
|
||||
// TODO: Chat with Fabians
|
||||
// This works, but if we use handleSubmit(args) > args.name -> it is undefined in Production on netlify, but works fine on local dev
|
||||
void createNewProject(newProjectName.value as string)
|
||||
})
|
||||
|
||||
const createNewProject = async (name: string) => {
|
||||
isCreatingProject.value = true
|
||||
|
||||
if (props.workspaceId !== 'personalProject' && props.workspaceId !== undefined) {
|
||||
createNewProjectInWorkspace(name)
|
||||
isCreatingProject.value = false
|
||||
return
|
||||
}
|
||||
|
||||
void trackEvent(
|
||||
'DUI3 Action',
|
||||
{ name: 'Project Create', workspace: false },
|
||||
account.value.accountInfo.id
|
||||
)
|
||||
const { mutate } = provideApolloClient(account.value.client)(() =>
|
||||
useMutation(createProjectMutation)
|
||||
)
|
||||
const res = await mutate({ input: { name } })
|
||||
if (res?.data?.projectMutations.create) {
|
||||
emit('project:created', res?.data?.projectMutations.create)
|
||||
} else {
|
||||
let errorMessage = 'Undefined error'
|
||||
if (res?.errors && res?.errors.length !== 0) {
|
||||
errorMessage = res?.errors[0].message
|
||||
}
|
||||
|
||||
hostAppStore.setNotification({
|
||||
type: 1,
|
||||
title: 'Failed to create project',
|
||||
description: errorMessage
|
||||
})
|
||||
}
|
||||
isCreatingProject.value = false
|
||||
}
|
||||
|
||||
const createNewProjectInWorkspace = async (name: string) => {
|
||||
void trackEvent(
|
||||
'DUI3 Action',
|
||||
{ name: 'Project Create', workspace: true },
|
||||
account.value.accountInfo.id
|
||||
)
|
||||
const { mutate } = provideApolloClient(account.value.client)(() =>
|
||||
useMutation(createProjectInWorkspaceMutation)
|
||||
)
|
||||
const res = await mutate({
|
||||
input: { name, workspaceId: props.workspaceId as string }
|
||||
})
|
||||
if (res?.data?.workspaceMutations.projects.create) {
|
||||
emit('project:created', res?.data?.workspaceMutations.projects.create)
|
||||
} else {
|
||||
let errorMessage = 'Undefined error'
|
||||
if (res?.errors && res?.errors.length !== 0) {
|
||||
errorMessage = res?.errors[0].message
|
||||
}
|
||||
|
||||
hostAppStore.setNotification({
|
||||
type: 1,
|
||||
title: 'Failed to create project',
|
||||
description: errorMessage
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,141 +0,0 @@
|
||||
<template>
|
||||
<div class="p-0">
|
||||
<slot name="activator" :toggle="toggleDialog"></slot>
|
||||
<CommonDialog
|
||||
v-model:open="showProjectCreateDialog"
|
||||
:title="`Create new project`"
|
||||
fullscreen="none"
|
||||
>
|
||||
<form @submit="onSubmitCreateNewProject">
|
||||
<div class="text-body-2xs mb-2 ml-1">Project name</div>
|
||||
<FormTextInput
|
||||
v-model="newProjectName"
|
||||
class="text-xs"
|
||||
placeholder="A Beautiful Home, A Small Bridge..."
|
||||
autocomplete="off"
|
||||
name="name"
|
||||
label="Project name"
|
||||
color="foundation"
|
||||
:show-clear="!!newProjectName"
|
||||
:rules="[
|
||||
ValidationHelpers.isRequired,
|
||||
ValidationHelpers.isStringOfLength({ minLength: 3 })
|
||||
]"
|
||||
full-width
|
||||
/>
|
||||
<div class="mt-4 flex justify-end items-center space-x-2 w-full">
|
||||
<FormButton size="sm" text @click="showProjectCreateDialog = false">
|
||||
Cancel
|
||||
</FormButton>
|
||||
<FormButton
|
||||
size="sm"
|
||||
submit
|
||||
:disabled="isCreatingProject || !canCreatePersonalProject"
|
||||
>
|
||||
Create
|
||||
</FormButton>
|
||||
</div>
|
||||
</form>
|
||||
</CommonDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useMutation, provideApolloClient, useQuery } from '@vue/apollo-composable'
|
||||
import type { ProjectListProjectItemFragment } from '~/lib/common/generated/gql/graphql'
|
||||
import {
|
||||
canCreatePersonalProjectQuery,
|
||||
createProjectMutation
|
||||
} from '~/lib/graphql/mutationsAndQueries'
|
||||
import type { DUIAccount } from '~/store/accounts'
|
||||
import { useAccountStore } from '~/store/accounts'
|
||||
import { useMixpanel } from '~/lib/core/composables/mixpanel'
|
||||
import { useHostAppStore } from '~/store/hostApp'
|
||||
import { useForm } from 'vee-validate'
|
||||
import { ValidationHelpers } from '@speckle/ui-components'
|
||||
|
||||
const showProjectCreateDialog = ref(false)
|
||||
const isCreatingProject = ref(false)
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'project:created', result: ProjectListProjectItemFragment): void
|
||||
}>()
|
||||
|
||||
const { trackEvent } = useMixpanel()
|
||||
const accountStore = useAccountStore()
|
||||
const hostAppStore = useHostAppStore()
|
||||
const { activeAccount } = storeToRefs(accountStore)
|
||||
|
||||
const accountId = computed(() => activeAccount.value.accountInfo.id)
|
||||
const newProjectName = ref<string>()
|
||||
|
||||
const errorMessage = ref<string>()
|
||||
|
||||
const toggleDialog = () => {
|
||||
showProjectCreateDialog.value = !showProjectCreateDialog.value
|
||||
}
|
||||
|
||||
const account = computed(() => {
|
||||
return accountStore.accounts.find(
|
||||
(acc) => acc.accountInfo.id === accountId.value
|
||||
) as DUIAccount
|
||||
})
|
||||
|
||||
const canCreatePersonalProject = ref<boolean>(false)
|
||||
|
||||
const { result: canCreatePersonalProjectResult } = useQuery(
|
||||
canCreatePersonalProjectQuery,
|
||||
() => ({}),
|
||||
() => ({
|
||||
clientId: accountId.value,
|
||||
debounce: 500,
|
||||
fetchPolicy: 'network-only'
|
||||
})
|
||||
)
|
||||
|
||||
watch(canCreatePersonalProjectResult, (val) => {
|
||||
if (val?.activeUser?.permissions.canCreatePersonalProject.code !== 'OK') {
|
||||
errorMessage.value = val?.activeUser?.permissions.canCreatePersonalProject.message
|
||||
canCreatePersonalProject.value = false
|
||||
} else {
|
||||
canCreatePersonalProject.value = true
|
||||
}
|
||||
})
|
||||
|
||||
const { handleSubmit } = useForm<{ name: string }>()
|
||||
const onSubmitCreateNewProject = handleSubmit(() => {
|
||||
// TODO: Chat with Fabians
|
||||
// This works, but if we use handleSubmit(args) > args.name -> it is undefined in Production on netlify, but works fine on local dev
|
||||
void createNewProject(newProjectName.value as string)
|
||||
})
|
||||
|
||||
const createNewProject = async (name: string) => {
|
||||
isCreatingProject.value = true
|
||||
|
||||
void trackEvent(
|
||||
'DUI3 Action',
|
||||
{ name: 'Project Create', workspace: false },
|
||||
account.value.accountInfo.id
|
||||
)
|
||||
const { mutate } = provideApolloClient(account.value.client)(() =>
|
||||
useMutation(createProjectMutation)
|
||||
)
|
||||
const res = await mutate({ input: { name } })
|
||||
if (res?.data?.projectMutations.create) {
|
||||
emit('project:created', res?.data?.projectMutations.create)
|
||||
} else {
|
||||
let errorMessage = 'Undefined error'
|
||||
if (res?.errors && res?.errors.length !== 0) {
|
||||
errorMessage = res?.errors[0].message
|
||||
}
|
||||
|
||||
hostAppStore.setNotification({
|
||||
type: 1,
|
||||
title: 'Failed to create project',
|
||||
description: errorMessage
|
||||
})
|
||||
}
|
||||
isCreatingProject.value = false
|
||||
}
|
||||
</script>
|
||||
@@ -1,198 +0,0 @@
|
||||
<template>
|
||||
<div class="p-0">
|
||||
<slot name="activator" :toggle="toggleDialog"></slot>
|
||||
<CommonDialog
|
||||
v-model:open="showProjectCreateDialog"
|
||||
:title="canCreateProjectInWorkspace ? `Create new project` : errorMessage?.title"
|
||||
fullscreen="none"
|
||||
>
|
||||
<form v-if="canCreateProjectInWorkspace" @submit="onSubmitCreateNewProject">
|
||||
<div class="text-body-2xs mb-2 ml-1">Project name</div>
|
||||
<FormTextInput
|
||||
v-model="newProjectName"
|
||||
class="text-xs"
|
||||
placeholder="A Beautiful Home, A Small Bridge..."
|
||||
autocomplete="off"
|
||||
name="name"
|
||||
label="Project name"
|
||||
color="foundation"
|
||||
:show-clear="!!newProjectName"
|
||||
:rules="[
|
||||
ValidationHelpers.isRequired,
|
||||
ValidationHelpers.isStringOfLength({ minLength: 3 })
|
||||
]"
|
||||
full-width
|
||||
/>
|
||||
<div class="mt-4 flex justify-end items-center space-x-2 w-full">
|
||||
<FormButton
|
||||
size="sm"
|
||||
color="outline"
|
||||
@click="showProjectCreateDialog = false"
|
||||
>
|
||||
Cancel
|
||||
</FormButton>
|
||||
<FormButton size="sm" submit :disabled="isCreatingProject">Create</FormButton>
|
||||
</div>
|
||||
</form>
|
||||
<div v-else class="m-2">
|
||||
{{ errorMessage?.description }}
|
||||
<div class="flex mt-2 space-x-2 justify-end">
|
||||
<FormButton
|
||||
size="sm"
|
||||
color="outline"
|
||||
@click="showProjectCreateDialog = false"
|
||||
>
|
||||
Close
|
||||
</FormButton>
|
||||
<FormButton
|
||||
v-if="errorMessage?.cta"
|
||||
size="sm"
|
||||
submit
|
||||
@click="errorMessage?.cta?.action(), (showProjectCreateDialog = false)"
|
||||
>
|
||||
{{ errorMessage?.cta?.name }}
|
||||
</FormButton>
|
||||
</div>
|
||||
</div>
|
||||
</CommonDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useMutation, provideApolloClient, useQuery } from '@vue/apollo-composable'
|
||||
import type {
|
||||
ProjectListProjectItemFragment,
|
||||
WorkspaceListWorkspaceItemFragment
|
||||
} from '~/lib/common/generated/gql/graphql'
|
||||
import {
|
||||
canCreateProjectInWorkspaceQuery,
|
||||
createProjectInWorkspaceMutation
|
||||
} from '~/lib/graphql/mutationsAndQueries'
|
||||
import type { DUIAccount } from '~/store/accounts'
|
||||
import { useAccountStore } from '~/store/accounts'
|
||||
import { useMixpanel } from '~/lib/core/composables/mixpanel'
|
||||
import { useHostAppStore } from '~/store/hostApp'
|
||||
import { useForm } from 'vee-validate'
|
||||
import { ValidationHelpers } from '@speckle/ui-components'
|
||||
|
||||
type WorkspacePermissionMessage = {
|
||||
title: string
|
||||
description: string
|
||||
cta?: {
|
||||
name: string
|
||||
action: () => void
|
||||
}
|
||||
}
|
||||
|
||||
const { $openUrl } = useNuxtApp()
|
||||
|
||||
const showProjectCreateDialog = ref(false)
|
||||
const isCreatingProject = ref(false)
|
||||
|
||||
const props = defineProps<{ workspace?: WorkspaceListWorkspaceItemFragment }>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'project:created', result: ProjectListProjectItemFragment): void
|
||||
}>()
|
||||
|
||||
const { trackEvent } = useMixpanel()
|
||||
const accountStore = useAccountStore()
|
||||
const hostAppStore = useHostAppStore()
|
||||
const { activeAccount } = storeToRefs(accountStore)
|
||||
|
||||
const accountId = computed(() => activeAccount.value.accountInfo.id)
|
||||
const newProjectName = ref<string>()
|
||||
|
||||
const errorMessage = ref<WorkspacePermissionMessage>()
|
||||
|
||||
const toggleDialog = () => {
|
||||
showProjectCreateDialog.value = !showProjectCreateDialog.value
|
||||
}
|
||||
|
||||
const account = computed(() => {
|
||||
return accountStore.accounts.find(
|
||||
(acc) => acc.accountInfo.id === accountId.value
|
||||
) as DUIAccount
|
||||
})
|
||||
|
||||
const canCreateProjectInWorkspace = ref<boolean>()
|
||||
|
||||
const { result: canCreateProjectInWorkspaceResult } = useQuery(
|
||||
canCreateProjectInWorkspaceQuery,
|
||||
() => ({ workspaceId: props.workspace?.id ?? 'null' }), // TODO: i do not know the potential cause here
|
||||
() => ({
|
||||
clientId: accountId.value,
|
||||
debounce: 500,
|
||||
fetchPolicy: 'network-only'
|
||||
})
|
||||
)
|
||||
|
||||
watch(canCreateProjectInWorkspaceResult, (val) => {
|
||||
if (val?.workspace.permissions.canCreateProject.code !== 'OK') {
|
||||
switch (val?.workspace.permissions.canCreateProject.code) {
|
||||
case 'WorkspaceLimitsReached':
|
||||
errorMessage.value = {
|
||||
title: 'Plan limit reached',
|
||||
description:
|
||||
'The project limit for this workspace has been reached. Upgrade the workspace plan to create or move more projects.',
|
||||
cta: {
|
||||
name: 'Explore Plans',
|
||||
action: () =>
|
||||
$openUrl(
|
||||
`${account.value.accountInfo.serverInfo.url}/settings/workspaces/${props.workspace?.slug}/billing`
|
||||
)
|
||||
}
|
||||
}
|
||||
break
|
||||
// TODO: we should add more cases later according to `code`
|
||||
default:
|
||||
errorMessage.value = {
|
||||
title: 'Workspace warning',
|
||||
description: val?.workspace.permissions.canCreateProject.message ?? 'error'
|
||||
}
|
||||
break
|
||||
}
|
||||
canCreateProjectInWorkspace.value = false
|
||||
} else {
|
||||
canCreateProjectInWorkspace.value = true
|
||||
}
|
||||
})
|
||||
|
||||
const { handleSubmit } = useForm<{ name: string }>()
|
||||
const onSubmitCreateNewProject = handleSubmit(() => {
|
||||
// TODO: Chat with Fabians
|
||||
// This works, but if we use handleSubmit(args) > args.name -> it is undefined in Production on netlify, but works fine on local dev
|
||||
void createNewProjectInWorkspace(newProjectName.value as string)
|
||||
})
|
||||
|
||||
const createNewProjectInWorkspace = async (name: string) => {
|
||||
isCreatingProject.value = true
|
||||
void trackEvent(
|
||||
'DUI3 Action',
|
||||
{ name: 'Project Create', workspace: true },
|
||||
account.value.accountInfo.id
|
||||
)
|
||||
const { mutate } = provideApolloClient(account.value.client)(() =>
|
||||
useMutation(createProjectInWorkspaceMutation)
|
||||
)
|
||||
const res = await mutate({
|
||||
input: { name, workspaceId: props.workspace?.id as string }
|
||||
})
|
||||
if (res?.data?.workspaceMutations.projects.create) {
|
||||
emit('project:created', res?.data?.workspaceMutations.projects.create)
|
||||
} else {
|
||||
let errorMessage = 'Undefined error'
|
||||
if (res?.errors && res?.errors.length !== 0) {
|
||||
errorMessage = res?.errors[0].message
|
||||
}
|
||||
|
||||
hostAppStore.setNotification({
|
||||
type: 1,
|
||||
title: 'Failed to create project',
|
||||
description: errorMessage
|
||||
})
|
||||
}
|
||||
isCreatingProject.value = false
|
||||
}
|
||||
</script>
|
||||
@@ -12,6 +12,7 @@
|
||||
<WizardProjectSelector
|
||||
:is-sender="false"
|
||||
:show-new-project="false"
|
||||
:url-parse-error="urlParseError"
|
||||
@next="selectProject"
|
||||
@search-text-update="updateSearchText"
|
||||
/>
|
||||
@@ -39,7 +40,7 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="urlParseError" class="p-2 text-xs text-danger">{{ urlParseError }}</div>
|
||||
<div v-if="urlParseError" class="p-2 text-danger">{{ urlParseError }}</div>
|
||||
</CommonDialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<WizardProjectSelector
|
||||
is-sender
|
||||
disable-no-write-access-projects
|
||||
:url-parse-error="urlParseError"
|
||||
@next="selectProject"
|
||||
@search-text-update="updateSearchText"
|
||||
/>
|
||||
@@ -37,7 +38,7 @@
|
||||
<FormButton full-width @click="addModel">Publish</FormButton>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="urlParseError" class="p-2 text-xs text-danger">
|
||||
<div v-if="urlParseError" class="p-2 text-danger">
|
||||
{{ urlParseError }}
|
||||
</div>
|
||||
</CommonDialog>
|
||||
|
||||
@@ -13,22 +13,51 @@
|
||||
full-width
|
||||
color="foundation"
|
||||
/>
|
||||
<ModelCreateDialog
|
||||
:project-id="project.id"
|
||||
:workspace-id="workspaceId"
|
||||
:workspace-slug="workspaceSlug"
|
||||
@model:created="(result: ModelListModelItemFragment) => handleModelCreated(result)"
|
||||
<div
|
||||
v-tippy="
|
||||
canCreateModelResult?.project.permissions.canCreateModel.authorized
|
||||
? 'Create new model'
|
||||
: canCreateModelResult?.project.permissions.canCreateModel.message
|
||||
"
|
||||
>
|
||||
<template #activator="{ toggle }">
|
||||
<button
|
||||
v-tippy="'New model'"
|
||||
class="p-1.5 bg-foundation hover:bg-primary-muted rounded text-foreground border"
|
||||
@click="toggle()"
|
||||
<FormButton
|
||||
color="outline"
|
||||
:disabled="
|
||||
!canCreateModelResult?.project.permissions.canCreateModel.authorized
|
||||
"
|
||||
:class="`p-1.5 bg-foundation hover:bg-primary-muted rounded text-foreground border`"
|
||||
@click="showNewModelDialog = true"
|
||||
>
|
||||
<PlusIcon class="w-4 -mx-2" />
|
||||
</FormButton>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="
|
||||
canCreateModelResult &&
|
||||
!canCreateModelResult.project.permissions.canCreateModel.authorized
|
||||
"
|
||||
>
|
||||
<CommonAlert title="Cannot create new models" color="info" hide-icon>
|
||||
<template #description>
|
||||
{{ canCreateModelResult.project.permissions.canCreateModel.message }}
|
||||
|
||||
<FormButton
|
||||
v-if="workspaceSlug"
|
||||
full-width
|
||||
color="primary"
|
||||
size="sm"
|
||||
class="mt-2"
|
||||
@click="
|
||||
$openUrl(
|
||||
`${account.accountInfo.serverInfo.url}/settings/workspaces/${workspaceSlug}/billing`
|
||||
)
|
||||
"
|
||||
>
|
||||
<PlusIcon class="w-4" />
|
||||
</button>
|
||||
Explore Plans
|
||||
</FormButton>
|
||||
</template>
|
||||
</ModelCreateDialog>
|
||||
</CommonAlert>
|
||||
</div>
|
||||
<div class="relative grid grid-cols-1 gap-2">
|
||||
<CommonLoadingBar v-if="loading" loading />
|
||||
@@ -37,6 +66,7 @@
|
||||
v-for="model in models"
|
||||
:key="model.id"
|
||||
:model="model"
|
||||
:token="token"
|
||||
@click="handleModelSelect(model)"
|
||||
/>
|
||||
|
||||
@@ -77,6 +107,20 @@
|
||||
</template>
|
||||
</CommonDialog>
|
||||
<FormButton
|
||||
v-if="
|
||||
models?.length === 0 &&
|
||||
!!searchText &&
|
||||
canCreateModelResult?.project.permissions.canCreateModel?.authorized
|
||||
"
|
||||
full-width
|
||||
color="outline"
|
||||
:disabled="isCreatingModel"
|
||||
@click="createNewModel(searchText)"
|
||||
>
|
||||
Create "{{ searchText }}"
|
||||
</FormButton>
|
||||
<FormButton
|
||||
v-else
|
||||
color="outline"
|
||||
full-width
|
||||
:disabled="hasReachedEnd"
|
||||
@@ -91,7 +135,7 @@
|
||||
title="Create new model"
|
||||
fullscreen="none"
|
||||
>
|
||||
<form @submit="onSubmit">
|
||||
<form @submit="createNewModel(newModelName as string)">
|
||||
<FormTextInput
|
||||
v-model="newModelName"
|
||||
:rules="rules"
|
||||
@@ -107,7 +151,9 @@
|
||||
<FormButton size="sm" text @click="showNewModelDialog = false">
|
||||
Cancel
|
||||
</FormButton>
|
||||
<FormButton size="sm" submit :disabled="isCreatingModel">Create</FormButton>
|
||||
<FormButton size="sm" submit :disabled="isCreatingModel || !newModelName">
|
||||
Create
|
||||
</FormButton>
|
||||
</div>
|
||||
</form>
|
||||
</CommonDialog>
|
||||
@@ -122,10 +168,10 @@ import type {
|
||||
} from '~/lib/common/generated/gql/graphql'
|
||||
import { useModelNameValidationRules } from '~/lib/validation'
|
||||
import {
|
||||
canCreateModelInProjectQuery,
|
||||
createModelMutation,
|
||||
projectModelsQuery
|
||||
} from '~/lib/graphql/mutationsAndQueries'
|
||||
import { useForm } from 'vee-validate'
|
||||
import type { DUIAccount } from '~/store/accounts'
|
||||
import { useAccountStore } from '~/store/accounts'
|
||||
import { useHostAppStore } from '~/store/hostApp'
|
||||
@@ -152,13 +198,20 @@ const props = withDefaults(
|
||||
|
||||
const accountStore = useAccountStore()
|
||||
|
||||
const account = computed(
|
||||
() =>
|
||||
accountStore.accounts.find(
|
||||
(acc) => acc.accountInfo.id === props.accountId
|
||||
) as DUIAccount
|
||||
)
|
||||
|
||||
const showNewModelDialog = ref(false)
|
||||
const showSelectionHasProblemsDialog = ref(false)
|
||||
|
||||
const searchText = ref<string>()
|
||||
const newModelName = ref<string>()
|
||||
const newModelName = ref<string>(hostAppStore.documentInfo?.name ?? 'unnamed model')
|
||||
|
||||
watch(searchText, () => (newModelName.value = searchText.value))
|
||||
watch(searchText, () => (newModelName.value = searchText.value as string))
|
||||
|
||||
let selectedModel: ModelListModelItemFragment | undefined = undefined
|
||||
const existingModelProblem = ref(false)
|
||||
@@ -187,12 +240,6 @@ const confirmModelSelection = () => {
|
||||
}
|
||||
|
||||
const rules = useModelNameValidationRules()
|
||||
const { handleSubmit } = useForm<{ name: string }>()
|
||||
const onSubmit = handleSubmit(() => {
|
||||
// TODO: Chat with Fabians
|
||||
// This works, but if we use handleSubmit(args) > args.name -> it is undefined in Production on netlify, but works fine on local dev
|
||||
void createNewModel(newModelName.value as string)
|
||||
})
|
||||
|
||||
const handleModelCreated = (result: ModelListModelItemFragment) => {
|
||||
refetch() // Sorts the list with newly created project otherwise it will put the project at the bottom.
|
||||
@@ -200,21 +247,30 @@ const handleModelCreated = (result: ModelListModelItemFragment) => {
|
||||
}
|
||||
|
||||
const isCreatingModel = ref(false)
|
||||
|
||||
const createNewModel = async (name: string) => {
|
||||
if (!canCreateModelResult.value?.project.permissions.canCreateModel.authorized) {
|
||||
hostAppStore.setNotification({
|
||||
type: 1,
|
||||
title: 'Failed to create model',
|
||||
description:
|
||||
canCreateModelResult.value?.project.permissions.canCreateModel.message
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
isCreatingModel.value = true
|
||||
const account = accountStore.accounts.find(
|
||||
(acc) => acc.accountInfo.id === props.accountId
|
||||
) as DUIAccount
|
||||
|
||||
void trackEvent('DUI3 Action', { name: 'Model Create' }, account.accountInfo.id)
|
||||
void trackEvent('DUI3 Action', { name: 'Model Create' }, account.value.accountInfo.id)
|
||||
|
||||
const { mutate } = provideApolloClient(account.client)(() =>
|
||||
const { mutate } = provideApolloClient(account.value.client)(() =>
|
||||
useMutation(createModelMutation)
|
||||
)
|
||||
const res = await mutate({ input: { projectId: props.project.id, name } })
|
||||
if (res?.data?.modelMutations.create) {
|
||||
refetch() // Sorts the list with newly created model otherwise it will put the model at the bottom.
|
||||
emit('next', res?.data?.modelMutations.create)
|
||||
// emit('next', res?.data?.modelMutations.create)
|
||||
handleModelCreated(res?.data?.modelMutations.create)
|
||||
} else {
|
||||
let errorMessage = 'Undefined error'
|
||||
if (res?.errors && res?.errors.length !== 0) {
|
||||
@@ -230,6 +286,15 @@ const createNewModel = async (name: string) => {
|
||||
isCreatingModel.value = false
|
||||
}
|
||||
|
||||
const { result: canCreateModelResult } = useQuery(
|
||||
canCreateModelInProjectQuery,
|
||||
() => ({ projectId: props.project.id }),
|
||||
() => ({
|
||||
clientId: props.accountId,
|
||||
fetchPolicy: 'network-only'
|
||||
})
|
||||
)
|
||||
|
||||
const {
|
||||
result: projectModelsResult,
|
||||
loading,
|
||||
@@ -247,6 +312,7 @@ const {
|
||||
() => ({ clientId: props.accountId, debounce: 500, fetchPolicy: 'cache-and-network' })
|
||||
)
|
||||
|
||||
const token = computed(() => account.value.accountInfo.token)
|
||||
const models = computed(() => projectModelsResult.value?.project.models.items)
|
||||
const totalCount = computed(() => projectModelsResult.value?.project.models.totalCount)
|
||||
const hasReachedEnd = ref(false)
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
<template>
|
||||
<div class="space-y-2">
|
||||
<div class="space-y-2 relative">
|
||||
<div
|
||||
v-if="workspacesEnabled && workspaces"
|
||||
class="flex items-center space-x-2 bg-foundation -mx-3 -mt-2 px-3 py-2 shadow-sm border-b"
|
||||
>
|
||||
<div v-if="workspacesEnabled && workspaces" class="flex items-center space-x-2">
|
||||
<div class="flex-grow min-w-0">
|
||||
<!-- NO WORKSPACE YET -->
|
||||
<div v-if="workspaces.length === 0">
|
||||
@@ -44,7 +41,7 @@
|
||||
</template>
|
||||
</WorkspaceMenu>
|
||||
</div>
|
||||
<div class="px-0.5 shrink-0">
|
||||
<div class="shrink-0 pt-1 px-1">
|
||||
<AccountsMenu
|
||||
:current-selected-account-id="accountId"
|
||||
@select="(e) => selectAccount(e)"
|
||||
@@ -63,36 +60,58 @@
|
||||
color="foundation"
|
||||
/>
|
||||
<div class="flex justify-between items-center space-x-2">
|
||||
<ProjectCreateWorkspaceDialog
|
||||
v-if="selectedWorkspace && selectedWorkspace.id !== 'personalProject'"
|
||||
:workspace="selectedWorkspace"
|
||||
@project:created="(result : ProjectListProjectItemFragment) => handleProjectCreated(result)"
|
||||
<div
|
||||
v-tippy="
|
||||
canCreateProject
|
||||
? 'Create new project'
|
||||
: canCreateProjectPermissionCheck?.message
|
||||
"
|
||||
>
|
||||
<template #activator="{ toggle }">
|
||||
<button
|
||||
v-tippy="'New project in workspace'"
|
||||
class="p-1.5 bg-foundation hover:bg-primary-muted rounded text-foreground border"
|
||||
@click="toggle()"
|
||||
>
|
||||
<PlusIcon class="w-4" />
|
||||
</button>
|
||||
</template>
|
||||
</ProjectCreateWorkspaceDialog>
|
||||
<!-- TODO: once we deprecate personal projects, else block is bye bye -->
|
||||
<ProjectCreatePersonalDialog
|
||||
v-else
|
||||
@project:created="(result : ProjectListProjectItemFragment) => handleProjectCreated(result)"
|
||||
<FormButton
|
||||
color="outline"
|
||||
:disabled="!canCreateProject"
|
||||
:class="`p-1.5 bg-foundation hover:bg-primary-muted rounded text-foreground border`"
|
||||
@click="showProjectCreateDialog = true"
|
||||
>
|
||||
<PlusIcon class="w-4 -mx-2" />
|
||||
</FormButton>
|
||||
</div>
|
||||
<CommonDialog
|
||||
v-model:open="showProjectCreateDialog"
|
||||
:title="`Create new project`"
|
||||
fullscreen="none"
|
||||
>
|
||||
<template #activator="{ toggle }">
|
||||
<button
|
||||
v-tippy="'New personal project'"
|
||||
class="p-1.5 bg-foundation hover:bg-primary-muted rounded text-foreground border"
|
||||
@click="toggle()"
|
||||
>
|
||||
<PlusIcon class="w-4" />
|
||||
</button>
|
||||
</template>
|
||||
</ProjectCreatePersonalDialog>
|
||||
<form @submit="createProject(newProjectName as string)">
|
||||
<div class="text-body-2xs mb-2 ml-1">Project name</div>
|
||||
<FormTextInput
|
||||
v-model="newProjectName"
|
||||
class="text-xs"
|
||||
placeholder="A Beautiful Home, A Small Bridge..."
|
||||
autocomplete="off"
|
||||
name="name"
|
||||
label="Project name"
|
||||
color="foundation"
|
||||
:show-clear="!!newProjectName"
|
||||
:rules="[
|
||||
ValidationHelpers.isRequired,
|
||||
ValidationHelpers.isStringOfLength({ minLength: 3 })
|
||||
]"
|
||||
full-width
|
||||
/>
|
||||
<div class="mt-4 flex justify-end items-center space-x-2 w-full">
|
||||
<FormButton size="sm" text @click="showProjectCreateDialog = false">
|
||||
Cancel
|
||||
</FormButton>
|
||||
<FormButton
|
||||
size="sm"
|
||||
submit
|
||||
:disabled="isCreatingProject || !newProjectName"
|
||||
>
|
||||
Create
|
||||
</FormButton>
|
||||
</div>
|
||||
</form>
|
||||
</CommonDialog>
|
||||
<div v-if="!workspacesEnabled || !workspaces" class="mt-1">
|
||||
<AccountsMenu
|
||||
:current-selected-account-id="accountId"
|
||||
@@ -101,19 +120,34 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="isPersonalProjectsAsWorkspace">
|
||||
<!-- <CommonAlert size="xs" :color="'warning'">
|
||||
<div
|
||||
v-if="
|
||||
canCreateProjectPermissionCheck &&
|
||||
!canCreateProjectPermissionCheck.authorized
|
||||
"
|
||||
>
|
||||
<CommonAlert color="info" hide-icon>
|
||||
<template #description>
|
||||
You are listing legacy personal projects which will be deprecated end of
|
||||
2025. We suggest you to move your personal projects into a workspace
|
||||
before then.
|
||||
{{ canCreateProjectPermissionCheck.message }}
|
||||
<FormButton
|
||||
v-if="showUpgradeButton"
|
||||
full-width
|
||||
class="mt-2"
|
||||
color="primary"
|
||||
size="sm"
|
||||
@click="upgradeButtonAction()"
|
||||
>
|
||||
Upgrade now
|
||||
</FormButton>
|
||||
</template>
|
||||
</CommonAlert> -->
|
||||
<WizardPersonalProjectsWarning />
|
||||
</CommonAlert>
|
||||
</div>
|
||||
<CommonLoadingBar v-if="loading" loading />
|
||||
|
||||
<WizardPersonalProjectsWarning v-if="isPersonalProjectsAsWorkspace" />
|
||||
|
||||
<CommonLoadingBar v-if="loading || isCreatingProject" loading />
|
||||
</div>
|
||||
<div class="grid grid-cols-1 gap-2 relative z-0">
|
||||
<div v-if="!urlParseError" class="grid grid-cols-1 gap-2 relative z-0">
|
||||
<WizardListProjectCard
|
||||
v-for="project in projects"
|
||||
:key="project.id"
|
||||
@@ -121,7 +155,27 @@
|
||||
:is-sender="isSender"
|
||||
@click="handleProjectCardClick(project)"
|
||||
/>
|
||||
<p v-if="projects?.length === 0 && !!searchText" class="text-sm">
|
||||
No projects found
|
||||
</p>
|
||||
<FormButton
|
||||
v-if="
|
||||
projects?.length === 0 &&
|
||||
!!searchText &&
|
||||
canCreateProjectPermissionCheck?.authorized
|
||||
"
|
||||
full-width
|
||||
color="outline"
|
||||
:disabled="isCreatingProject"
|
||||
class="block truncate overflow-hidden"
|
||||
@click="createProject(searchText)"
|
||||
>
|
||||
Create "{{
|
||||
searchText.length > 10 ? searchText.substring(0, 10) + '...' : searchText
|
||||
}}"
|
||||
</FormButton>
|
||||
<FormButton
|
||||
v-else
|
||||
full-width
|
||||
:disabled="hasReachedEnd"
|
||||
color="outline"
|
||||
@@ -141,19 +195,25 @@ import type { DUIAccount } from '~/store/accounts'
|
||||
import { useAccountStore } from '~/store/accounts'
|
||||
import {
|
||||
activeWorkspaceQuery,
|
||||
canCreatePersonalProjectQuery,
|
||||
createProjectInWorkspaceMutation,
|
||||
createProjectMutation,
|
||||
projectsListQuery,
|
||||
serverInfoQuery,
|
||||
setActiveWorkspaceMutation,
|
||||
workspacesListQuery
|
||||
} from '~/lib/graphql/mutationsAndQueries'
|
||||
import { useMutation, provideApolloClient, useQuery } from '@vue/apollo-composable'
|
||||
import { ValidationHelpers } from '@speckle/ui-components'
|
||||
import type {
|
||||
ProjectListProjectItemFragment,
|
||||
WorkspaceListWorkspaceItemFragment
|
||||
} from '~/lib/common/generated/gql/graphql'
|
||||
import { useMixpanel } from '~/lib/core/composables/mixpanel'
|
||||
import { useConfigStore } from '~/store/config'
|
||||
import { useHostAppStore } from '~/store/hostApp'
|
||||
|
||||
const hostAppStore = useHostAppStore()
|
||||
const { trackEvent } = useMixpanel()
|
||||
const { $openUrl } = useNuxtApp()
|
||||
|
||||
@@ -175,6 +235,7 @@ const props = withDefaults(
|
||||
* For the send wizard - not allowing selecting projects we can't write to.
|
||||
*/
|
||||
disableNoWriteAccessProjects?: boolean
|
||||
urlParseError?: string
|
||||
}>(),
|
||||
{
|
||||
showNewProject: true,
|
||||
@@ -388,6 +449,156 @@ watch(projectsResult, (newVal) => {
|
||||
}
|
||||
})
|
||||
|
||||
const { result: canCreatePersonalProjectResult } = useQuery(
|
||||
canCreatePersonalProjectQuery,
|
||||
{},
|
||||
() => ({
|
||||
clientId: accountId.value
|
||||
})
|
||||
)
|
||||
|
||||
const canCreateProject = computed(() => {
|
||||
// If a workspace is selected, return that permission check
|
||||
if (selectedWorkspace.value && selectedWorkspace.value.permissions) {
|
||||
return selectedWorkspace.value.permissions.canCreateProject.authorized //as boolean
|
||||
}
|
||||
// Otherwise, check for personal projects
|
||||
if (canCreatePersonalProjectResult) {
|
||||
return canCreatePersonalProjectResult.value?.activeUser?.permissions
|
||||
.canCreatePersonalProject.authorized
|
||||
}
|
||||
// To be always safe, default to false
|
||||
return false
|
||||
})
|
||||
|
||||
const canCreateProjectPermissionCheck = computed(() => {
|
||||
if (selectedWorkspace.value && selectedWorkspace.value.permissions) {
|
||||
return selectedWorkspace.value.permissions.canCreateProject
|
||||
}
|
||||
if (canCreatePersonalProjectResult) {
|
||||
return canCreatePersonalProjectResult.value?.activeUser?.permissions
|
||||
.canCreatePersonalProject
|
||||
}
|
||||
return null
|
||||
})
|
||||
|
||||
const upgradeButtonAction = () => {
|
||||
if (!canCreateProjectPermissionCheck.value) return
|
||||
if (canCreateProjectPermissionCheck.value.code === 'WorkspaceNoEditorSeat') {
|
||||
// open url to workspace/settings/users
|
||||
$openUrl(
|
||||
`${account.value.accountInfo.serverInfo.url}/settings/workspaces/${selectedWorkspace.value?.slug}/members`
|
||||
)
|
||||
return
|
||||
}
|
||||
if (canCreateProjectPermissionCheck.value.code === 'WorkspaceLimitsReached') {
|
||||
// open url to workspace/billing
|
||||
$openUrl(
|
||||
`${account.value.accountInfo.serverInfo.url}/settings/workspaces/${selectedWorkspace.value?.slug}/billing`
|
||||
)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const showUpgradeButton = computed(() => {
|
||||
if (!canCreateProjectPermissionCheck.value) return false
|
||||
if (
|
||||
canCreateProjectPermissionCheck.value.code === 'WorkspaceNoEditorSeat' ||
|
||||
canCreateProjectPermissionCheck.value.code === 'WorkspaceLimitsReached'
|
||||
) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
const isCreatingProject = ref(false)
|
||||
const showProjectCreateDialog = ref(false)
|
||||
|
||||
const createProject = (name: string) => {
|
||||
if (
|
||||
canCreateProjectPermissionCheck.value &&
|
||||
!canCreateProjectPermissionCheck.value.authorized
|
||||
) {
|
||||
hostAppStore.setNotification({
|
||||
type: 1,
|
||||
title: 'Failed to create project',
|
||||
description: canCreateProjectPermissionCheck.value.message as string
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (isPersonalProjectsAsWorkspace.value || !selectedWorkspace.value) {
|
||||
return void createNewPersonalProject(name)
|
||||
} else {
|
||||
return void createNewWorkspaceProject(name)
|
||||
}
|
||||
}
|
||||
|
||||
const account = computed(() => {
|
||||
return accountStore.accounts.find(
|
||||
(acc) => acc.accountInfo.id === accountId.value
|
||||
) as DUIAccount
|
||||
})
|
||||
|
||||
const createNewWorkspaceProject = async (name: string) => {
|
||||
isCreatingProject.value = true
|
||||
void trackEvent(
|
||||
'DUI3 Action',
|
||||
{ name: 'Project Create', workspace: true },
|
||||
accountId.value
|
||||
)
|
||||
const { mutate, onError } = provideApolloClient(account.value.client)(() =>
|
||||
useMutation(createProjectInWorkspaceMutation)
|
||||
)
|
||||
|
||||
onError((err) => {
|
||||
hostAppStore.setNotification({
|
||||
type: 1,
|
||||
title: 'Failed to create project',
|
||||
description: err.cause?.message ?? err.message ?? 'Unknown error'
|
||||
})
|
||||
})
|
||||
|
||||
const res = await mutate({
|
||||
input: { name, workspaceId: selectedWorkspace.value?.id as string }
|
||||
})
|
||||
|
||||
if (res?.data?.workspaceMutations.projects.create) {
|
||||
handleProjectCreated(res?.data?.workspaceMutations.projects.create)
|
||||
}
|
||||
isCreatingProject.value = false
|
||||
}
|
||||
|
||||
const createNewPersonalProject = async (name: string) => {
|
||||
isCreatingProject.value = true
|
||||
|
||||
void trackEvent(
|
||||
'DUI3 Action',
|
||||
{ name: 'Project Create', workspace: false },
|
||||
account.value.accountInfo.id
|
||||
)
|
||||
|
||||
const { mutate, onError } = provideApolloClient(account.value.client)(() =>
|
||||
useMutation(createProjectMutation)
|
||||
)
|
||||
|
||||
onError((err) => {
|
||||
hostAppStore.setNotification({
|
||||
type: 1,
|
||||
title: 'Failed to create project',
|
||||
description: err.cause?.message ?? err.message ?? 'Unknown error'
|
||||
})
|
||||
})
|
||||
|
||||
const res = await mutate({ input: { name } })
|
||||
|
||||
if (res?.data?.projectMutations.create) {
|
||||
return handleProjectCreated(res?.data?.projectMutations.create)
|
||||
}
|
||||
|
||||
isCreatingProject.value = false
|
||||
}
|
||||
|
||||
const loadMore = () => {
|
||||
fetchMore({
|
||||
variables: { cursor: projectsResult.value?.activeUser?.projects.cursor },
|
||||
|
||||
@@ -4,9 +4,15 @@
|
||||
>
|
||||
<div class="flex items-center space-x-2 max-[275px]:space-x-0">
|
||||
<div class="max-[275px]:hidden">
|
||||
<div v-if="model.previewUrl" class="h-12 w-12">
|
||||
<div
|
||||
v-if="model.versions.totalCount === 0"
|
||||
class="h-12 w-12 bg-blue-500/10 rounded flex items-center justify-center"
|
||||
>
|
||||
<CubeTransparentIcon class="w-5 h-5 text-foreground-2" />
|
||||
</div>
|
||||
<div v-else-if="previewUrl" class="h-12 w-12">
|
||||
<img
|
||||
:src="model.previewUrl"
|
||||
:src="previewUrl"
|
||||
alt="preview image for model"
|
||||
class="h-12 w-12 object-cover"
|
||||
/>
|
||||
@@ -15,7 +21,7 @@
|
||||
v-else
|
||||
class="h-12 w-12 bg-blue-500/10 rounded flex items-center justify-center"
|
||||
>
|
||||
<CubeTransparentIcon class="w-5 h-5 text-foreground-2" />
|
||||
<CommonLoadingIcon />
|
||||
</div>
|
||||
</div>
|
||||
<div class="min-w-0 w-full">
|
||||
@@ -52,9 +58,16 @@ import { ClockIcon } from '@heroicons/vue/24/outline'
|
||||
import type { SourceAppName } from '@speckle/shared'
|
||||
import { SourceApps } from '@speckle/shared'
|
||||
import type { ModelListModelItemFragment } from '~/lib/common/generated/gql/graphql'
|
||||
import { computedAsync } from '@vueuse/core'
|
||||
import { usePreviewUrl } from '~/lib/core/composables/previewUrl'
|
||||
|
||||
const props = defineProps<{
|
||||
model: ModelListModelItemFragment
|
||||
/**
|
||||
* Token to retrieve preview url
|
||||
* @note by convention we pass around `accountId` but it doesn't make sense to get token for every model card. more efficient with this way.
|
||||
*/
|
||||
token: string
|
||||
}>()
|
||||
|
||||
const folderPath = computed(() => {
|
||||
@@ -68,6 +81,11 @@ const updatedAgo = computed(() => {
|
||||
return dayjs(props.model.updatedAt).from(dayjs())
|
||||
})
|
||||
|
||||
const previewUrl = computedAsync(async () => {
|
||||
if (props.model.previewUrl === null) return
|
||||
return await usePreviewUrl(props.token, props.model.previewUrl)
|
||||
})
|
||||
|
||||
const sourceApp = computed(() => {
|
||||
if (props.model.versions.items.length === 0) return
|
||||
const version = props.model.versions.items[0]
|
||||
|
||||
@@ -24,7 +24,15 @@
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="flex items-center justify-center w-full h-24">
|
||||
<img :src="version.previewUrl" alt="version preview" />
|
||||
<div v-if="previewUrl">
|
||||
<img :src="previewUrl" alt="preview image for version" />
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
class="h-12 w-12 bg-blue-500/10 rounded flex items-center justify-center"
|
||||
>
|
||||
<CommonLoadingIcon />
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-1.5 border-t dark:border-gray-700">
|
||||
<div class="flex space-x-2 items-center min-w-0">
|
||||
@@ -100,9 +108,14 @@ import dayjs from 'dayjs'
|
||||
import type { SourceAppName } from '@speckle/shared'
|
||||
import { SourceApps } from '@speckle/shared'
|
||||
import type { VersionListItemFragment } from '~/lib/common/generated/gql/graphql'
|
||||
import { useAccountStore, type DUIAccount } from '~/store/accounts'
|
||||
import { computedAsync } from '@vueuse/core'
|
||||
import { usePreviewUrl } from '~/lib/core/composables/previewUrl'
|
||||
// import { objectQuery } from '~/lib/graphql/mutationsAndQueries'
|
||||
// import { useQuery } from '@vue/apollo-composable'
|
||||
|
||||
const accountStore = useAccountStore()
|
||||
|
||||
const props = defineProps<{
|
||||
version: VersionListItemFragment
|
||||
index: number
|
||||
@@ -120,6 +133,18 @@ const createdAgo = computed(() => {
|
||||
|
||||
const isLimited = computed(() => props.version.referencedObject === null)
|
||||
|
||||
const token = computed(() => {
|
||||
const account = accountStore.accounts.find(
|
||||
(acc) => acc.accountInfo.id === props.accountId
|
||||
) as DUIAccount
|
||||
return account.accountInfo.token
|
||||
})
|
||||
|
||||
const previewUrl = computedAsync(async () => {
|
||||
if (props.version.previewUrl === null) return
|
||||
return await usePreviewUrl(token.value, props.version.previewUrl)
|
||||
})
|
||||
|
||||
// NOTE!!!: This logic somehow caused regression on versionList fetchMore, but we do not know exactly why yet.
|
||||
// const { result: objectQueryResult } = useQuery(
|
||||
// objectQuery,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
@select="
|
||||
$emit('workspace:selected', workspace), (showWorkspaceSelectorDialog = false)
|
||||
"
|
||||
></WorkspaceListItem>
|
||||
/>
|
||||
</CommonDialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -34,7 +34,7 @@ defineEmits<{
|
||||
}>()
|
||||
|
||||
const workspacesWithPersonalProjects = computed(() => [
|
||||
...props.workspaces,
|
||||
...props.workspaces.filter((w) => w.creationState?.completed !== false),
|
||||
{
|
||||
id: 'personalProject',
|
||||
name: 'Personal Projects'
|
||||
|
||||
@@ -16,18 +16,20 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-
|
||||
type Documents = {
|
||||
"\n mutation SetActiveWorkspaceMutation($slug: String) {\n activeUserMutations {\n setActiveWorkspace(slug: $slug)\n }\n }\n": typeof types.SetActiveWorkspaceMutationDocument,
|
||||
"\n mutation VersionMutations($input: CreateVersionInput!) {\n versionMutations {\n create(input: $input) {\n id\n }\n }\n }\n": typeof types.VersionMutationsDocument,
|
||||
"\n mutation Update($input: UpdateVersionInput!) {\n versionMutations {\n update(input: $input) {\n id\n }\n }\n }\n": typeof types.UpdateDocument,
|
||||
"\n mutation MarkReceivedVersion($input: MarkReceivedVersionInput!) {\n versionMutations {\n markReceived(input: $input)\n }\n }\n": typeof types.MarkReceivedVersionDocument,
|
||||
"\n mutation CreateModel($input: CreateModelInput!) {\n modelMutations {\n create(input: $input) {\n ...ModelListModelItem\n }\n }\n }\n": typeof types.CreateModelDocument,
|
||||
"\n mutation CreateProject($input: ProjectCreateInput) {\n projectMutations {\n create(input: $input) {\n ...ProjectListProjectItem\n }\n }\n }\n": typeof types.CreateProjectDocument,
|
||||
"\n mutation CreateProjectInWorkspace($input: WorkspaceProjectCreateInput!) {\n workspaceMutations {\n projects {\n create(input: $input) {\n ...ProjectListProjectItem\n }\n }\n }\n }\n": typeof types.CreateProjectInWorkspaceDocument,
|
||||
"\n mutation StreamAccessRequestCreate($input: String!) {\n streamAccessRequestCreate(streamId: $input) {\n id\n }\n }\n": typeof types.StreamAccessRequestCreateDocument,
|
||||
"\n fragment WorkspaceListWorkspaceItem on Workspace {\n id\n slug\n name\n description\n createdAt\n updatedAt\n logo\n role\n readOnly\n }\n": typeof types.WorkspaceListWorkspaceItemFragmentDoc,
|
||||
"\n fragment WorkspaceListWorkspaceItem on Workspace {\n id\n slug\n name\n description\n createdAt\n updatedAt\n logo\n role\n readOnly\n creationState {\n completed\n }\n permissions {\n canCreateProject {\n authorized\n code\n message\n }\n }\n }\n": typeof types.WorkspaceListWorkspaceItemFragmentDoc,
|
||||
"\n fragment AutomateFunctionItem on AutomateFunction {\n name\n isFeatured\n id\n creator {\n name\n }\n releases {\n items {\n inputSchema\n }\n }\n }\n": typeof types.AutomateFunctionItemFragmentDoc,
|
||||
"\n mutation CreateAutomation($projectId: ID!, $input: ProjectAutomationCreateInput!) {\n projectMutations {\n automationMutations(projectId: $projectId) {\n create(input: $input) {\n id\n name\n }\n }\n }\n }\n": typeof types.CreateAutomationDocument,
|
||||
"\n fragment AutomateFunctionRunItem on AutomateFunctionRun {\n id\n status\n statusMessage\n results\n contextView\n function {\n id\n name\n logo\n }\n }\n": typeof types.AutomateFunctionRunItemFragmentDoc,
|
||||
"\n fragment AutomationRunItem on AutomateRun {\n id\n status\n automation {\n id\n name\n }\n functionRuns {\n ...AutomateFunctionRunItem\n }\n }\n": typeof types.AutomationRunItemFragmentDoc,
|
||||
"\n query AutomationStatus($projectId: String!, $modelId: String!) {\n project(id: $projectId) {\n model(id: $modelId) {\n automationsStatus {\n id\n status\n automationRuns {\n ...AutomationRunItem\n }\n }\n }\n }\n }\n": typeof types.AutomationStatusDocument,
|
||||
"\n query WorkspaceListQuery(\n $limit: Int!\n $filter: UserWorkspacesFilter\n $cursor: String\n ) {\n activeUser {\n id\n workspaces(limit: $limit, filter: $filter, cursor: $cursor) {\n totalCount\n cursor\n items {\n ...WorkspaceListWorkspaceItem\n }\n }\n }\n }\n": typeof types.WorkspaceListQueryDocument,
|
||||
"\n query ActiveUser {\n activeUser {\n role\n id\n name\n }\n }\n": typeof types.ActiveUserDocument,
|
||||
"\n query CanCreatePersonalProject {\n activeUser {\n permissions {\n canCreatePersonalProject {\n authorized\n code\n message\n payload\n }\n }\n }\n }\n": typeof types.CanCreatePersonalProjectDocument,
|
||||
"\n query CanCreateProjectInWorkspace($workspaceId: String!) {\n workspace(id: $workspaceId) {\n permissions {\n canCreateProject {\n authorized\n code\n message\n payload\n }\n }\n }\n }\n": typeof types.CanCreateProjectInWorkspaceDocument,
|
||||
"\n query CanCreateModelInProject($projectId: String!) {\n project(id: $projectId) {\n permissions {\n canCreateModel {\n authorized\n code\n message\n }\n }\n }\n }\n": typeof types.CanCreateModelInProjectDocument,
|
||||
@@ -56,18 +58,20 @@ type Documents = {
|
||||
const documents: Documents = {
|
||||
"\n mutation SetActiveWorkspaceMutation($slug: String) {\n activeUserMutations {\n setActiveWorkspace(slug: $slug)\n }\n }\n": types.SetActiveWorkspaceMutationDocument,
|
||||
"\n mutation VersionMutations($input: CreateVersionInput!) {\n versionMutations {\n create(input: $input) {\n id\n }\n }\n }\n": types.VersionMutationsDocument,
|
||||
"\n mutation Update($input: UpdateVersionInput!) {\n versionMutations {\n update(input: $input) {\n id\n }\n }\n }\n": types.UpdateDocument,
|
||||
"\n mutation MarkReceivedVersion($input: MarkReceivedVersionInput!) {\n versionMutations {\n markReceived(input: $input)\n }\n }\n": types.MarkReceivedVersionDocument,
|
||||
"\n mutation CreateModel($input: CreateModelInput!) {\n modelMutations {\n create(input: $input) {\n ...ModelListModelItem\n }\n }\n }\n": types.CreateModelDocument,
|
||||
"\n mutation CreateProject($input: ProjectCreateInput) {\n projectMutations {\n create(input: $input) {\n ...ProjectListProjectItem\n }\n }\n }\n": types.CreateProjectDocument,
|
||||
"\n mutation CreateProjectInWorkspace($input: WorkspaceProjectCreateInput!) {\n workspaceMutations {\n projects {\n create(input: $input) {\n ...ProjectListProjectItem\n }\n }\n }\n }\n": types.CreateProjectInWorkspaceDocument,
|
||||
"\n mutation StreamAccessRequestCreate($input: String!) {\n streamAccessRequestCreate(streamId: $input) {\n id\n }\n }\n": types.StreamAccessRequestCreateDocument,
|
||||
"\n fragment WorkspaceListWorkspaceItem on Workspace {\n id\n slug\n name\n description\n createdAt\n updatedAt\n logo\n role\n readOnly\n }\n": types.WorkspaceListWorkspaceItemFragmentDoc,
|
||||
"\n fragment WorkspaceListWorkspaceItem on Workspace {\n id\n slug\n name\n description\n createdAt\n updatedAt\n logo\n role\n readOnly\n creationState {\n completed\n }\n permissions {\n canCreateProject {\n authorized\n code\n message\n }\n }\n }\n": types.WorkspaceListWorkspaceItemFragmentDoc,
|
||||
"\n fragment AutomateFunctionItem on AutomateFunction {\n name\n isFeatured\n id\n creator {\n name\n }\n releases {\n items {\n inputSchema\n }\n }\n }\n": types.AutomateFunctionItemFragmentDoc,
|
||||
"\n mutation CreateAutomation($projectId: ID!, $input: ProjectAutomationCreateInput!) {\n projectMutations {\n automationMutations(projectId: $projectId) {\n create(input: $input) {\n id\n name\n }\n }\n }\n }\n": types.CreateAutomationDocument,
|
||||
"\n fragment AutomateFunctionRunItem on AutomateFunctionRun {\n id\n status\n statusMessage\n results\n contextView\n function {\n id\n name\n logo\n }\n }\n": types.AutomateFunctionRunItemFragmentDoc,
|
||||
"\n fragment AutomationRunItem on AutomateRun {\n id\n status\n automation {\n id\n name\n }\n functionRuns {\n ...AutomateFunctionRunItem\n }\n }\n": types.AutomationRunItemFragmentDoc,
|
||||
"\n query AutomationStatus($projectId: String!, $modelId: String!) {\n project(id: $projectId) {\n model(id: $modelId) {\n automationsStatus {\n id\n status\n automationRuns {\n ...AutomationRunItem\n }\n }\n }\n }\n }\n": types.AutomationStatusDocument,
|
||||
"\n query WorkspaceListQuery(\n $limit: Int!\n $filter: UserWorkspacesFilter\n $cursor: String\n ) {\n activeUser {\n id\n workspaces(limit: $limit, filter: $filter, cursor: $cursor) {\n totalCount\n cursor\n items {\n ...WorkspaceListWorkspaceItem\n }\n }\n }\n }\n": types.WorkspaceListQueryDocument,
|
||||
"\n query ActiveUser {\n activeUser {\n role\n id\n name\n }\n }\n": types.ActiveUserDocument,
|
||||
"\n query CanCreatePersonalProject {\n activeUser {\n permissions {\n canCreatePersonalProject {\n authorized\n code\n message\n payload\n }\n }\n }\n }\n": types.CanCreatePersonalProjectDocument,
|
||||
"\n query CanCreateProjectInWorkspace($workspaceId: String!) {\n workspace(id: $workspaceId) {\n permissions {\n canCreateProject {\n authorized\n code\n message\n payload\n }\n }\n }\n }\n": types.CanCreateProjectInWorkspaceDocument,
|
||||
"\n query CanCreateModelInProject($projectId: String!) {\n project(id: $projectId) {\n permissions {\n canCreateModel {\n authorized\n code\n message\n }\n }\n }\n }\n": types.CanCreateModelInProjectDocument,
|
||||
@@ -116,6 +120,10 @@ export function graphql(source: "\n mutation SetActiveWorkspaceMutation($slug:
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function graphql(source: "\n mutation VersionMutations($input: CreateVersionInput!) {\n versionMutations {\n create(input: $input) {\n id\n }\n }\n }\n"): (typeof documents)["\n mutation VersionMutations($input: CreateVersionInput!) {\n versionMutations {\n create(input: $input) {\n id\n }\n }\n }\n"];
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function graphql(source: "\n mutation Update($input: UpdateVersionInput!) {\n versionMutations {\n update(input: $input) {\n id\n }\n }\n }\n"): (typeof documents)["\n mutation Update($input: UpdateVersionInput!) {\n versionMutations {\n update(input: $input) {\n id\n }\n }\n }\n"];
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
@@ -139,7 +147,7 @@ export function graphql(source: "\n mutation StreamAccessRequestCreate($input:
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function graphql(source: "\n fragment WorkspaceListWorkspaceItem on Workspace {\n id\n slug\n name\n description\n createdAt\n updatedAt\n logo\n role\n readOnly\n }\n"): (typeof documents)["\n fragment WorkspaceListWorkspaceItem on Workspace {\n id\n slug\n name\n description\n createdAt\n updatedAt\n logo\n role\n readOnly\n }\n"];
|
||||
export function graphql(source: "\n fragment WorkspaceListWorkspaceItem on Workspace {\n id\n slug\n name\n description\n createdAt\n updatedAt\n logo\n role\n readOnly\n creationState {\n completed\n }\n permissions {\n canCreateProject {\n authorized\n code\n message\n }\n }\n }\n"): (typeof documents)["\n fragment WorkspaceListWorkspaceItem on Workspace {\n id\n slug\n name\n description\n createdAt\n updatedAt\n logo\n role\n readOnly\n creationState {\n completed\n }\n permissions {\n canCreateProject {\n authorized\n code\n message\n }\n }\n }\n"];
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
@@ -164,6 +172,10 @@ export function graphql(source: "\n query AutomationStatus($projectId: String!,
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function graphql(source: "\n query WorkspaceListQuery(\n $limit: Int!\n $filter: UserWorkspacesFilter\n $cursor: String\n ) {\n activeUser {\n id\n workspaces(limit: $limit, filter: $filter, cursor: $cursor) {\n totalCount\n cursor\n items {\n ...WorkspaceListWorkspaceItem\n }\n }\n }\n }\n"): (typeof documents)["\n query WorkspaceListQuery(\n $limit: Int!\n $filter: UserWorkspacesFilter\n $cursor: String\n ) {\n activeUser {\n id\n workspaces(limit: $limit, filter: $filter, cursor: $cursor) {\n totalCount\n cursor\n items {\n ...WorkspaceListWorkspaceItem\n }\n }\n }\n }\n"];
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function graphql(source: "\n query ActiveUser {\n activeUser {\n role\n id\n name\n }\n }\n"): (typeof documents)["\n query ActiveUser {\n activeUser {\n role\n id\n name\n }\n }\n"];
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
|
||||
@@ -1191,8 +1191,12 @@ export type LimitedUserWorkspaceRoleArgs = {
|
||||
/** Workspace metadata visible to non-workspace members. */
|
||||
export type LimitedWorkspace = {
|
||||
__typename?: 'LimitedWorkspace';
|
||||
/** Workspace admins ordered by join date */
|
||||
adminTeam: Array<LimitedWorkspaceCollaborator>;
|
||||
/** Workspace description */
|
||||
description?: Maybe<Scalars['String']['output']>;
|
||||
/** If true, the users with a matching domain may join the workspace directly */
|
||||
discoverabilityAutoJoinEnabled: Scalars['Boolean']['output'];
|
||||
/** Workspace id */
|
||||
id: Scalars['ID']['output'];
|
||||
/** Optional base64 encoded workspace logo image */
|
||||
@@ -2024,6 +2028,7 @@ export type Project = {
|
||||
description?: Maybe<Scalars['String']['output']>;
|
||||
/** Public project-level configuration for embedded viewer */
|
||||
embedOptions: ProjectEmbedOptions;
|
||||
hasAccessToFeature: Scalars['Boolean']['output'];
|
||||
id: Scalars['ID']['output'];
|
||||
invitableCollaborators: WorkspaceCollaboratorCollection;
|
||||
/** Collaborators who have been invited, but not yet accepted. */
|
||||
@@ -2105,6 +2110,11 @@ export type ProjectCommentThreadsArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type ProjectHasAccessToFeatureArgs = {
|
||||
featureName: WorkspaceFeatureName;
|
||||
};
|
||||
|
||||
|
||||
export type ProjectInvitableCollaboratorsArgs = {
|
||||
cursor?: InputMaybe<Scalars['String']['input']>;
|
||||
filter?: InputMaybe<InvitableCollaboratorsFilter>;
|
||||
@@ -4102,12 +4112,14 @@ export type UserMeta = {
|
||||
__typename?: 'UserMeta';
|
||||
legacyProjectsExplainerCollapsed: Scalars['Boolean']['output'];
|
||||
newWorkspaceExplainerDismissed: Scalars['Boolean']['output'];
|
||||
speckleConBannerDismissed: Scalars['Boolean']['output'];
|
||||
};
|
||||
|
||||
export type UserMetaMutations = {
|
||||
__typename?: 'UserMetaMutations';
|
||||
setLegacyProjectsExplainerCollapsed: Scalars['Boolean']['output'];
|
||||
setNewWorkspaceExplainerDismissed: Scalars['Boolean']['output'];
|
||||
setSpeckleConBannerDismissed: Scalars['Boolean']['output'];
|
||||
};
|
||||
|
||||
|
||||
@@ -4120,6 +4132,11 @@ export type UserMetaMutationsSetNewWorkspaceExplainerDismissedArgs = {
|
||||
value: Scalars['Boolean']['input'];
|
||||
};
|
||||
|
||||
|
||||
export type UserMetaMutationsSetSpeckleConBannerDismissedArgs = {
|
||||
value: Scalars['Boolean']['input'];
|
||||
};
|
||||
|
||||
export type UserProjectCollection = {
|
||||
__typename?: 'UserProjectCollection';
|
||||
cursor?: Maybe<Scalars['String']['output']>;
|
||||
@@ -4445,7 +4462,11 @@ export type Workspace = {
|
||||
* region.
|
||||
*/
|
||||
defaultRegion?: Maybe<ServerRegionItem>;
|
||||
/** The default seat assigned to users that join a workspace. Used during workspace discovery or on invites without seat types. */
|
||||
defaultSeatType: WorkspaceSeatType;
|
||||
description?: Maybe<Scalars['String']['output']>;
|
||||
/** If true, allow users to automatically join discoverable workspaces (instead of requesting to join) */
|
||||
discoverabilityAutoJoinEnabled: Scalars['Boolean']['output'];
|
||||
/** Enable/Disable discovery of the workspace */
|
||||
discoverabilityEnabled: Scalars['Boolean']['output'];
|
||||
/** Enable/Disable restriction to invite users to workspace as Guests only */
|
||||
@@ -4545,6 +4566,7 @@ export type WorkspaceBillingMutationsUpgradePlanArgs = {
|
||||
/** Overridden by `WorkspaceCollaboratorGraphQLReturn` */
|
||||
export type WorkspaceCollaborator = {
|
||||
__typename?: 'WorkspaceCollaborator';
|
||||
email?: Maybe<Scalars['String']['output']>;
|
||||
id: Scalars['ID']['output'];
|
||||
/** Date that the user joined the workspace. */
|
||||
joinDate: Scalars['DateTime']['output'];
|
||||
@@ -4612,6 +4634,7 @@ export type WorkspaceEmbedOptions = {
|
||||
|
||||
export enum WorkspaceFeatureName {
|
||||
DomainBasedSecurityPolicies = 'domainBasedSecurityPolicies',
|
||||
HideSpeckleBranding = 'hideSpeckleBranding',
|
||||
OidcSso = 'oidcSso',
|
||||
WorkspaceDataRegionSpecificity = 'workspaceDataRegionSpecificity'
|
||||
}
|
||||
@@ -4687,6 +4710,7 @@ export type WorkspaceInviteUseInput = {
|
||||
export type WorkspaceJoinRequest = {
|
||||
__typename?: 'WorkspaceJoinRequest';
|
||||
createdAt: Scalars['DateTime']['output'];
|
||||
email?: Maybe<Scalars['String']['output']>;
|
||||
id: Scalars['String']['output'];
|
||||
status: WorkspaceJoinRequestStatus;
|
||||
user: LimitedUser;
|
||||
@@ -4840,6 +4864,7 @@ export type WorkspacePermissionChecks = {
|
||||
canEditEmbedOptions: PermissionCheckResult;
|
||||
canInvite: PermissionCheckResult;
|
||||
canMoveProjectToWorkspace: PermissionCheckResult;
|
||||
canReadMemberEmail: PermissionCheckResult;
|
||||
};
|
||||
|
||||
|
||||
@@ -4877,6 +4902,7 @@ export type WorkspacePlanUsage = {
|
||||
|
||||
export enum WorkspacePlans {
|
||||
Academia = 'academia',
|
||||
Enterprise = 'enterprise',
|
||||
Free = 'free',
|
||||
Pro = 'pro',
|
||||
ProUnlimited = 'proUnlimited',
|
||||
@@ -5076,7 +5102,9 @@ export type WorkspaceUpdateEmbedOptionsInput = {
|
||||
};
|
||||
|
||||
export type WorkspaceUpdateInput = {
|
||||
defaultSeatType?: InputMaybe<WorkspaceSeatType>;
|
||||
description?: InputMaybe<Scalars['String']['input']>;
|
||||
discoverabilityAutoJoinEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
discoverabilityEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
domainBasedMembershipProtectionEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
id: Scalars['String']['input'];
|
||||
@@ -5114,6 +5142,13 @@ export type VersionMutationsMutationVariables = Exact<{
|
||||
|
||||
export type VersionMutationsMutation = { __typename?: 'Mutation', versionMutations: { __typename?: 'VersionMutations', create: { __typename?: 'Version', id: string } } };
|
||||
|
||||
export type UpdateMutationVariables = Exact<{
|
||||
input: UpdateVersionInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type UpdateMutation = { __typename?: 'Mutation', versionMutations: { __typename?: 'VersionMutations', update: { __typename?: 'Version', id: string } } };
|
||||
|
||||
export type MarkReceivedVersionMutationVariables = Exact<{
|
||||
input: MarkReceivedVersionInput;
|
||||
}>;
|
||||
@@ -5149,7 +5184,7 @@ export type StreamAccessRequestCreateMutationVariables = Exact<{
|
||||
|
||||
export type StreamAccessRequestCreateMutation = { __typename?: 'Mutation', streamAccessRequestCreate: { __typename?: 'StreamAccessRequest', id: string } };
|
||||
|
||||
export type WorkspaceListWorkspaceItemFragment = { __typename?: 'Workspace', id: string, slug: string, name: string, description?: string | null, createdAt: string, updatedAt: string, logo?: string | null, role?: string | null, readOnly: boolean };
|
||||
export type WorkspaceListWorkspaceItemFragment = { __typename?: 'Workspace', id: string, slug: string, name: string, description?: string | null, createdAt: string, updatedAt: string, logo?: string | null, role?: string | null, readOnly: boolean, creationState?: { __typename?: 'WorkspaceCreationState', completed: boolean } | null, permissions: { __typename?: 'WorkspacePermissionChecks', canCreateProject: { __typename?: 'PermissionCheckResult', authorized: boolean, code: string, message: string } } };
|
||||
|
||||
export type AutomateFunctionItemFragment = { __typename?: 'AutomateFunction', name: string, isFeatured: boolean, id: string, creator?: { __typename?: 'LimitedUser', name: string } | null, releases: { __typename?: 'AutomateFunctionReleaseCollection', items: Array<{ __typename?: 'AutomateFunctionRelease', inputSchema?: {} | null }> } };
|
||||
|
||||
@@ -5180,7 +5215,12 @@ export type WorkspaceListQueryQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type WorkspaceListQueryQuery = { __typename?: 'Query', activeUser?: { __typename?: 'User', id: string, workspaces: { __typename?: 'WorkspaceCollection', totalCount: number, cursor?: string | null, items: Array<{ __typename?: 'Workspace', id: string, slug: string, name: string, description?: string | null, createdAt: string, updatedAt: string, logo?: string | null, role?: string | null, readOnly: boolean }> } } | null };
|
||||
export type WorkspaceListQueryQuery = { __typename?: 'Query', activeUser?: { __typename?: 'User', id: string, workspaces: { __typename?: 'WorkspaceCollection', totalCount: number, cursor?: string | null, items: Array<{ __typename?: 'Workspace', id: string, slug: string, name: string, description?: string | null, createdAt: string, updatedAt: string, logo?: string | null, role?: string | null, readOnly: boolean, creationState?: { __typename?: 'WorkspaceCreationState', completed: boolean } | null, permissions: { __typename?: 'WorkspacePermissionChecks', canCreateProject: { __typename?: 'PermissionCheckResult', authorized: boolean, code: string, message: string } } }> } } | null };
|
||||
|
||||
export type ActiveUserQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type ActiveUserQuery = { __typename?: 'Query', activeUser?: { __typename?: 'User', role?: string | null, id: string, name: string } | null };
|
||||
|
||||
export type CanCreatePersonalProjectQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
@@ -5204,7 +5244,7 @@ export type CanCreateModelInProjectQuery = { __typename?: 'Query', project: { __
|
||||
export type ActiveWorkspaceQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type ActiveWorkspaceQuery = { __typename?: 'Query', activeUser?: { __typename?: 'User', activeWorkspace?: { __typename?: 'Workspace', id: string, slug: string, name: string, description?: string | null, createdAt: string, updatedAt: string, logo?: string | null, role?: string | null, readOnly: boolean } | null } | null };
|
||||
export type ActiveWorkspaceQuery = { __typename?: 'Query', activeUser?: { __typename?: 'User', activeWorkspace?: { __typename?: 'Workspace', id: string, slug: string, name: string, description?: string | null, createdAt: string, updatedAt: string, logo?: string | null, role?: string | null, readOnly: boolean, creationState?: { __typename?: 'WorkspaceCreationState', completed: boolean } | null, permissions: { __typename?: 'WorkspacePermissionChecks', canCreateProject: { __typename?: 'PermissionCheckResult', authorized: boolean, code: string, message: string } } } | null } | null };
|
||||
|
||||
export type ProjectListProjectItemFragment = { __typename?: 'Project', id: string, name: string, role?: string | null, updatedAt: string, workspaceId?: string | null, workspace?: { __typename?: 'Workspace', id: string, name: string, slug: string, role?: string | null } | null, models: { __typename?: 'ModelCollection', totalCount: number }, permissions: { __typename?: 'ProjectPermissionChecks', canLoad: { __typename?: 'PermissionCheckResult', authorized: boolean, code: string, message: string }, canPublish: { __typename?: 'PermissionCheckResult', authorized: boolean, code: string, message: string } } };
|
||||
|
||||
@@ -5341,7 +5381,7 @@ export type ProjectCommentsUpdatedSubscriptionVariables = Exact<{
|
||||
|
||||
export type ProjectCommentsUpdatedSubscription = { __typename?: 'Subscription', projectCommentsUpdated: { __typename?: 'ProjectCommentsUpdatedMessage', type: ProjectCommentsUpdatedMessageType, comment?: { __typename?: 'Comment', id: string, hasParent: boolean, author: { __typename?: 'LimitedUser', avatar?: string | null, id: string, name: string }, parent?: { __typename?: 'Comment', id: string } | null } | null } };
|
||||
|
||||
export const WorkspaceListWorkspaceItemFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceListWorkspaceItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Workspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"readOnly"}}]}}]} as unknown as DocumentNode<WorkspaceListWorkspaceItemFragment, unknown>;
|
||||
export const WorkspaceListWorkspaceItemFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceListWorkspaceItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Workspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"readOnly"}},{"kind":"Field","name":{"kind":"Name","value":"creationState"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"completed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canCreateProject"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]}}]} as unknown as DocumentNode<WorkspaceListWorkspaceItemFragment, unknown>;
|
||||
export const AutomateFunctionItemFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isFeatured"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"creator"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"releases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"inputSchema"}}]}}]}}]}}]} as unknown as DocumentNode<AutomateFunctionItemFragment, unknown>;
|
||||
export const AutomateFunctionRunItemFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionRunItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionRun"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"statusMessage"}},{"kind":"Field","name":{"kind":"Name","value":"results"}},{"kind":"Field","name":{"kind":"Name","value":"contextView"}},{"kind":"Field","name":{"kind":"Name","value":"function"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}}]}}]}}]} as unknown as DocumentNode<AutomateFunctionRunItemFragment, unknown>;
|
||||
export const AutomationRunItemFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomationRunItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateRun"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"automation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"functionRuns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionRunItem"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionRunItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionRun"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"statusMessage"}},{"kind":"Field","name":{"kind":"Name","value":"results"}},{"kind":"Field","name":{"kind":"Name","value":"contextView"}},{"kind":"Field","name":{"kind":"Name","value":"function"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}}]}}]}}]} as unknown as DocumentNode<AutomationRunItemFragment, unknown>;
|
||||
@@ -5350,6 +5390,7 @@ export const VersionListItemFragmentDoc = {"kind":"Document","definitions":[{"ki
|
||||
export const ModelListModelItemFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ModelListModelItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Model"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"previewUrl"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"versions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"VersionListItem"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"VersionListItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Version"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"referencedObject"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"sourceApplication"}},{"kind":"Field","name":{"kind":"Name","value":"authorUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"previewUrl"}}]}}]} as unknown as DocumentNode<ModelListModelItemFragment, unknown>;
|
||||
export const SetActiveWorkspaceMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SetActiveWorkspaceMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"slug"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUserMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setActiveWorkspace"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"slug"}}}]}]}}]}}]} as unknown as DocumentNode<SetActiveWorkspaceMutationMutation, SetActiveWorkspaceMutationMutationVariables>;
|
||||
export const VersionMutationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"VersionMutations"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateVersionInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"versionMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]} as unknown as DocumentNode<VersionMutationsMutation, VersionMutationsMutationVariables>;
|
||||
export const UpdateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"Update"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateVersionInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"versionMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"update"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]} as unknown as DocumentNode<UpdateMutation, UpdateMutationVariables>;
|
||||
export const MarkReceivedVersionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"MarkReceivedVersion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"MarkReceivedVersionInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"versionMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"markReceived"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]}}]} as unknown as DocumentNode<MarkReceivedVersionMutation, MarkReceivedVersionMutationVariables>;
|
||||
export const CreateModelDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateModel"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateModelInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ModelListModelItem"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"VersionListItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Version"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"referencedObject"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"sourceApplication"}},{"kind":"Field","name":{"kind":"Name","value":"authorUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"previewUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ModelListModelItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Model"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"previewUrl"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"versions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"VersionListItem"}}]}}]}}]}}]} as unknown as DocumentNode<CreateModelMutation, CreateModelMutationVariables>;
|
||||
export const CreateProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateProject"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ProjectCreateInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"projectMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectListProjectItem"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectListProjectItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"role"}}]}},{"kind":"Field","name":{"kind":"Name","value":"models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canLoad"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canPublish"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]}}]} as unknown as DocumentNode<CreateProjectMutation, CreateProjectMutationVariables>;
|
||||
@@ -5357,11 +5398,12 @@ export const CreateProjectInWorkspaceDocument = {"kind":"Document","definitions"
|
||||
export const StreamAccessRequestCreateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"StreamAccessRequestCreate"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamAccessRequestCreate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"streamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<StreamAccessRequestCreateMutation, StreamAccessRequestCreateMutationVariables>;
|
||||
export const CreateAutomationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateAutomation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ProjectAutomationCreateInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"projectMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"automationMutations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"projectId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}}]} as unknown as DocumentNode<CreateAutomationMutation, CreateAutomationMutationVariables>;
|
||||
export const AutomationStatusDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AutomationStatus"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"model"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"automationsStatus"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"automationRuns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomationRunItem"}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionRunItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionRun"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"statusMessage"}},{"kind":"Field","name":{"kind":"Name","value":"results"}},{"kind":"Field","name":{"kind":"Name","value":"contextView"}},{"kind":"Field","name":{"kind":"Name","value":"function"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomationRunItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateRun"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"automation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"functionRuns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionRunItem"}}]}}]}}]} as unknown as DocumentNode<AutomationStatusQuery, AutomationStatusQueryVariables>;
|
||||
export const WorkspaceListQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"WorkspaceListQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UserWorkspacesFilter"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"workspaces"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}},{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceListWorkspaceItem"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceListWorkspaceItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Workspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"readOnly"}}]}}]} as unknown as DocumentNode<WorkspaceListQueryQuery, WorkspaceListQueryQueryVariables>;
|
||||
export const WorkspaceListQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"WorkspaceListQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UserWorkspacesFilter"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"workspaces"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}},{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceListWorkspaceItem"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceListWorkspaceItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Workspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"readOnly"}},{"kind":"Field","name":{"kind":"Name","value":"creationState"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"completed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canCreateProject"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]}}]} as unknown as DocumentNode<WorkspaceListQueryQuery, WorkspaceListQueryQueryVariables>;
|
||||
export const ActiveUserDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ActiveUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode<ActiveUserQuery, ActiveUserQueryVariables>;
|
||||
export const CanCreatePersonalProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CanCreatePersonalProject"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canCreatePersonalProject"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"payload"}}]}}]}}]}}]}}]} as unknown as DocumentNode<CanCreatePersonalProjectQuery, CanCreatePersonalProjectQueryVariables>;
|
||||
export const CanCreateProjectInWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CanCreateProjectInWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspace"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canCreateProject"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"payload"}}]}}]}}]}}]}}]} as unknown as DocumentNode<CanCreateProjectInWorkspaceQuery, CanCreateProjectInWorkspaceQueryVariables>;
|
||||
export const CanCreateModelInProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CanCreateModelInProject"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canCreateModel"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]}}]}}]} as unknown as DocumentNode<CanCreateModelInProjectQuery, CanCreateModelInProjectQueryVariables>;
|
||||
export const ActiveWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ActiveWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceListWorkspaceItem"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceListWorkspaceItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Workspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"readOnly"}}]}}]} as unknown as DocumentNode<ActiveWorkspaceQuery, ActiveWorkspaceQueryVariables>;
|
||||
export const ActiveWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ActiveWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceListWorkspaceItem"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceListWorkspaceItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Workspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"readOnly"}},{"kind":"Field","name":{"kind":"Name","value":"creationState"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"completed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canCreateProject"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]}}]} as unknown as DocumentNode<ActiveWorkspaceQuery, ActiveWorkspaceQueryVariables>;
|
||||
export const ProjectListQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProjectListQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UserProjectsFilter"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"projects"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}},{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectListProjectItem"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectListProjectItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"role"}}]}},{"kind":"Field","name":{"kind":"Name","value":"models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canLoad"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canPublish"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]}}]} as unknown as DocumentNode<ProjectListQueryQuery, ProjectListQueryQueryVariables>;
|
||||
export const ProjectModelsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProjectModels"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ProjectModelsFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"models"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ModelListModelItem"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"VersionListItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Version"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"referencedObject"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"sourceApplication"}},{"kind":"Field","name":{"kind":"Name","value":"authorUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"previewUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ModelListModelItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Model"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"previewUrl"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"versions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"VersionListItem"}}]}}]}}]}}]} as unknown as DocumentNode<ProjectModelsQuery, ProjectModelsQueryVariables>;
|
||||
export const ModelVersionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ModelVersions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ModelVersionsFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"model"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"versions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"VersionListItem"}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"VersionListItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Version"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"referencedObject"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"sourceApplication"}},{"kind":"Field","name":{"kind":"Name","value":"authorUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"previewUrl"}}]}}]} as unknown as DocumentNode<ModelVersionsQuery, ModelVersionsQueryVariables>;
|
||||
|
||||
@@ -7,7 +7,8 @@ import type {
|
||||
} from '~/lib/common/generated/gql/graphql'
|
||||
import {
|
||||
projectAddByUrlQueryWithoutVersion,
|
||||
projectAddByUrlQueryWithVersion
|
||||
projectAddByUrlQueryWithVersion,
|
||||
userInfoAndServerRoleQuery
|
||||
} from '~/lib/graphql/mutationsAndQueries'
|
||||
import { omit } from 'lodash-es'
|
||||
import { useDebounceFn } from '@vueuse/core'
|
||||
@@ -60,6 +61,7 @@ export function useAddByUrl() {
|
||||
|
||||
const { projectId, modelId, versionId } = params
|
||||
const apollo = (acc as DUIAccount).client
|
||||
const userInfoRes = await apollo.query({ query: userInfoAndServerRoleQuery })
|
||||
|
||||
let project: ProjectListProjectItemFragment | undefined = undefined,
|
||||
model: ModelListModelItemFragment | undefined = undefined,
|
||||
@@ -113,7 +115,7 @@ export function useAddByUrl() {
|
||||
? project.permissions.canPublish.authorized
|
||||
: project.permissions.canLoad.authorized
|
||||
|
||||
if (!hasAccess) {
|
||||
if (!hasAccess && userInfoRes.data.activeUser?.role !== 'server:admin') {
|
||||
urlParseError.value = errorMessage
|
||||
return
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @param previewUrl url that server returns but does not return the corresponding image if the project is private
|
||||
* @param token auth token to get proper image over url
|
||||
*/
|
||||
export async function usePreviewUrl(
|
||||
token: string,
|
||||
previewUrl?: string
|
||||
): Promise<string | undefined> {
|
||||
if (!previewUrl) return previewUrl
|
||||
const res = await fetch(previewUrl, {
|
||||
headers: { Authorization: `Bearer ${token}` }
|
||||
})
|
||||
|
||||
if (!res.ok) return previewUrl //
|
||||
const blob = await res.blob()
|
||||
return URL.createObjectURL(blob)
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { ToastNotification } from '@speckle/ui-components'
|
||||
import { ToastNotificationType } from '@speckle/ui-components'
|
||||
import { useConfigStore } from '~/store/config'
|
||||
import { useHostAppStore } from '~/store/hostApp'
|
||||
|
||||
type Versions = {
|
||||
@@ -18,31 +17,13 @@ export type Version = {
|
||||
|
||||
export function useUpdateConnector() {
|
||||
const hostApp = useHostAppStore()
|
||||
const config = useConfigStore()
|
||||
const { $openUrl } = useNuxtApp()
|
||||
|
||||
const versions = ref<Version[]>([])
|
||||
const latestAvailableVersion = ref<Version | null>(null)
|
||||
|
||||
const isUpToDate = computed(
|
||||
() => hostApp.connectorVersion === latestAvailableVersion.value?.Number
|
||||
)
|
||||
|
||||
async function checkUpdate() {
|
||||
try {
|
||||
await getVersions()
|
||||
if (!isUpToDate.value && !config.isDevMode) {
|
||||
const notification: ToastNotification = {
|
||||
type: ToastNotificationType.Success,
|
||||
title: `New connector update available`,
|
||||
description: latestAvailableVersion.value?.Number.replace('+0', ''), // TODO: currently versions end with "+0" Alan will have a look
|
||||
cta: {
|
||||
title: `Update`,
|
||||
onClick: () => downloadLatestVersion()
|
||||
}
|
||||
}
|
||||
hostApp.setNotification(notification)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
const notification: ToastNotification = {
|
||||
@@ -74,9 +55,5 @@ export function useUpdateConnector() {
|
||||
hostApp.setLatestAvailableVersion(sortedVersions[0])
|
||||
}
|
||||
|
||||
function downloadLatestVersion() {
|
||||
$openUrl(latestAvailableVersion.value?.Url as string)
|
||||
}
|
||||
|
||||
return { checkUpdate }
|
||||
}
|
||||
|
||||
@@ -18,6 +18,16 @@ export const createVersionMutation = graphql(`
|
||||
}
|
||||
`)
|
||||
|
||||
export const setVersionMessageMutation = graphql(`
|
||||
mutation Update($input: UpdateVersionInput!) {
|
||||
versionMutations {
|
||||
update(input: $input) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`)
|
||||
|
||||
export const markReceivedVersionMutation = graphql(`
|
||||
mutation MarkReceivedVersion($input: MarkReceivedVersionInput!) {
|
||||
versionMutations {
|
||||
@@ -77,6 +87,16 @@ export const workspaceListFragment = graphql(`
|
||||
logo
|
||||
role
|
||||
readOnly
|
||||
creationState {
|
||||
completed
|
||||
}
|
||||
permissions {
|
||||
canCreateProject {
|
||||
authorized
|
||||
code
|
||||
message
|
||||
}
|
||||
}
|
||||
}
|
||||
`)
|
||||
|
||||
@@ -173,6 +193,16 @@ export const workspacesListQuery = graphql(`
|
||||
}
|
||||
`)
|
||||
|
||||
export const userInfoAndServerRoleQuery = graphql(`
|
||||
query ActiveUser {
|
||||
activeUser {
|
||||
role
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
`)
|
||||
|
||||
export const canCreatePersonalProjectQuery = graphql(`
|
||||
query CanCreatePersonalProject {
|
||||
activeUser {
|
||||
|
||||
@@ -6,8 +6,14 @@ export type ModelCardNotification = {
|
||||
modelCardId: string
|
||||
text: string
|
||||
level: ModelCardNotificationLevel
|
||||
secondaryCta?: {
|
||||
name: string
|
||||
tooltipText?: string
|
||||
action: () => void
|
||||
}
|
||||
cta?: {
|
||||
name: string
|
||||
tooltipText?: string
|
||||
action: () => void
|
||||
}
|
||||
/**
|
||||
|
||||
+2
-4
@@ -17,9 +17,6 @@ export default defineNuxtConfig({
|
||||
// lodash: 'lodash-es'
|
||||
},
|
||||
|
||||
// pinia: {
|
||||
// autoImports: ['defineStore', 'storeToRefs']
|
||||
// },
|
||||
runtimeConfig: {
|
||||
public: {
|
||||
mixpanelApiHost: 'UNDEFINED',
|
||||
@@ -29,7 +26,8 @@ export default defineNuxtConfig({
|
||||
speckleUserId: process.env.SPECKLE_USER_ID,
|
||||
speckleUrl: process.env.SPECKLE_URL,
|
||||
speckleSampleProjectId: process.env.SPECKLE_SAMPLE_PROJECT_ID,
|
||||
speckleSampleModelId: process.env.SPECKLE_SAMPLE_MODEL_ID
|
||||
speckleSampleModelId: process.env.SPECKLE_SAMPLE_MODEL_ID,
|
||||
intercomAppId: ''
|
||||
}
|
||||
},
|
||||
vite: {
|
||||
|
||||
+7
-6
@@ -26,16 +26,17 @@
|
||||
"@apollo/client": "^3.7.14",
|
||||
"@headlessui/vue": "^1.7.13",
|
||||
"@heroicons/vue": "^2.0.12",
|
||||
"@intercom/messenger-js-sdk": "^0.0.14",
|
||||
"@jsonforms/core": "3.1.0",
|
||||
"@jsonforms/vue": "3.1.0",
|
||||
"@jsonforms/vue-vanilla": "3.1.0",
|
||||
"@pinia/nuxt": "^0.4.11",
|
||||
"@speckle/objectloader": "^2.24.0",
|
||||
"@speckle/objectsender": "^2.24.0",
|
||||
"@speckle/shared": "^2.24.0",
|
||||
"@speckle/tailwind-theme": "2.24.1-alpha.0",
|
||||
"@speckle/ui-components": "^2.24.0",
|
||||
"@speckle/ui-components-nuxt": "^2.24.0",
|
||||
"@speckle/objectloader": "^2.25.0",
|
||||
"@speckle/objectsender": "^2.25.0",
|
||||
"@speckle/shared": "^2.25.0",
|
||||
"@speckle/tailwind-theme": "2.25.0",
|
||||
"@speckle/ui-components": "^2.25.0",
|
||||
"@speckle/ui-components-nuxt": "^2.25.0",
|
||||
"@vue/apollo-composable": "^4.0.0-beta.5",
|
||||
"@vueuse/core": "^9.13.0",
|
||||
"apollo-upload-client": "^17.0.0",
|
||||
|
||||
+4
-4
@@ -74,7 +74,7 @@
|
||||
full-width
|
||||
@click="
|
||||
app.$openUrl(
|
||||
`https://speckle.systems/connectors/${store.hostAppName}`
|
||||
`https://docs.speckle.systems/connectors/${store.hostAppName}?utm=dui`
|
||||
)
|
||||
"
|
||||
>
|
||||
@@ -82,7 +82,7 @@
|
||||
documentation
|
||||
</FormButton>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<FormButton
|
||||
text
|
||||
size="sm"
|
||||
@@ -98,11 +98,11 @@
|
||||
<span class="text-foreground-2 text-body-3xs truncate line-clamp-1">
|
||||
New connectors announcement
|
||||
</span>
|
||||
</FormButton>
|
||||
</FormButton> -->
|
||||
</div>
|
||||
</LayoutPanel>
|
||||
</div>
|
||||
<div v-if="accounts.length !== 0 && !hasNoModelCards" class="space-y-2">
|
||||
<div v-if="accounts.length !== 0 && !hasNoModelCards" class="space-y-2 pb-24">
|
||||
<div v-for="project in store.projectModelGroups" :key="project.projectId">
|
||||
<CommonProjectModelGroup :project="project" />
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
import { watch, computed, ref } from 'vue'
|
||||
import Intercom, {
|
||||
shutdown,
|
||||
show,
|
||||
hide,
|
||||
update,
|
||||
trackEvent
|
||||
} from '@intercom/messenger-js-sdk'
|
||||
import { useAccountStore } from '~/store/accounts'
|
||||
import { storeToRefs } from 'pinia'
|
||||
|
||||
const disabledRoutes: string[] = []
|
||||
|
||||
export const useIntercom = () => {
|
||||
const route = useRoute()
|
||||
|
||||
const accountStore = useAccountStore()
|
||||
const { activeAccount } = storeToRefs(accountStore)
|
||||
|
||||
const isInitialized = ref(false)
|
||||
|
||||
const isRouteBlacklisted = computed(() => {
|
||||
return disabledRoutes.some((disabledRoute) => route.path.includes(disabledRoute))
|
||||
})
|
||||
|
||||
const shouldEnableIntercom = computed(() => !isRouteBlacklisted.value)
|
||||
|
||||
const bootIntercom = () => {
|
||||
if (!shouldEnableIntercom.value || isInitialized.value || !activeAccount.value)
|
||||
return
|
||||
|
||||
isInitialized.value = true
|
||||
Intercom({
|
||||
/* eslint-disable camelcase */
|
||||
app_id: 'hoiaq4wn', // note: needs to be harcoded as this is statically served
|
||||
user_id: activeAccount.value.accountInfo.userInfo.id || '',
|
||||
name: activeAccount.value.accountInfo.userInfo.name || '',
|
||||
email: activeAccount.value.accountInfo.userInfo.email || ''
|
||||
})
|
||||
window.Intercom = Intercom
|
||||
}
|
||||
|
||||
const showIntercom = () => {
|
||||
if (!isInitialized.value) return
|
||||
show()
|
||||
}
|
||||
|
||||
const hideIntercom = () => {
|
||||
if (!isInitialized.value) return
|
||||
hide()
|
||||
}
|
||||
|
||||
const shutdownIntercom = () => {
|
||||
if (!isInitialized.value) return
|
||||
shutdown()
|
||||
isInitialized.value = false
|
||||
}
|
||||
|
||||
const trackIntercom = (event: string, metadata?: Record<string, unknown>) => {
|
||||
if (!isInitialized.value) return
|
||||
trackEvent(event, metadata)
|
||||
}
|
||||
|
||||
const updateConnectorDetails = (
|
||||
hostAppName: string,
|
||||
hostAppVersion: string,
|
||||
connectorVersion: string
|
||||
) => {
|
||||
update({
|
||||
page_title: `CNX: (hostApp: ${hostAppName}:v${hostAppVersion}),(version: ${connectorVersion})`
|
||||
})
|
||||
}
|
||||
|
||||
// On route change, check if we need to shutodwn or boot Intercom
|
||||
watch(route, () => {
|
||||
if (isRouteBlacklisted.value) {
|
||||
shutdownIntercom()
|
||||
} else {
|
||||
bootIntercom()
|
||||
}
|
||||
})
|
||||
|
||||
watch(activeAccount, (newValue) => {
|
||||
if (newValue) {
|
||||
if (!isInitialized.value) {
|
||||
bootIntercom() // if active account changed and itercom is not initialised, do it
|
||||
return // we do not need to update, as that's done by default in the init
|
||||
}
|
||||
update({
|
||||
user_id: activeAccount.value.accountInfo.userInfo.id || '',
|
||||
name: activeAccount.value.accountInfo.userInfo.name,
|
||||
email: activeAccount.value.accountInfo.userInfo.email
|
||||
})
|
||||
} else {
|
||||
if (isInitialized.value) {
|
||||
shutdownIntercom()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
show: showIntercom,
|
||||
hide: hideIntercom,
|
||||
shutdown: shutdownIntercom,
|
||||
track: trackIntercom,
|
||||
updateConnectorDetails
|
||||
}
|
||||
}
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
return {
|
||||
provide: {
|
||||
intercom: useIntercom()
|
||||
}
|
||||
}
|
||||
})
|
||||
+18
-1
@@ -677,7 +677,7 @@ export const useHostAppStore = defineStore('hostAppStore', () => {
|
||||
'documentChanged',
|
||||
() =>
|
||||
setTimeout(async () => {
|
||||
void trackEvent('DUI3 Action', { name: 'Document changed' })
|
||||
// void trackEvent('DUI3 Action', { name: 'Document changed' }) // noisy
|
||||
void refreshDocumentInfo()
|
||||
await refreshDocumentModelStore() // need to awaited since upgrading the card settings need documentModelStore in place
|
||||
void refreshSendFilters()
|
||||
@@ -694,6 +694,23 @@ export const useHostAppStore = defineStore('hostAppStore', () => {
|
||||
await refreshSendFilters()
|
||||
await getSendSettings()
|
||||
tryToUpgradeModelCardSettings(sendSettings.value || [], 'SenderModelCard')
|
||||
|
||||
// Intercom shenanningans below
|
||||
// Do not poke intercom in ancient revit version
|
||||
if (
|
||||
hostAppName.value?.toLowerCase() === 'revit' &&
|
||||
hostAppVersion.value?.includes('2022')
|
||||
)
|
||||
return
|
||||
|
||||
// guards against intercom being sometimes slower to init
|
||||
setTimeout(() => {
|
||||
app.$intercom.updateConnectorDetails(
|
||||
hostAppName.value as string,
|
||||
hostAppVersion.value as string,
|
||||
connectorVersion.value as string
|
||||
)
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
initializeApp()
|
||||
|
||||
@@ -2437,6 +2437,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@intercom/messenger-js-sdk@npm:^0.0.14":
|
||||
version: 0.0.14
|
||||
resolution: "@intercom/messenger-js-sdk@npm:0.0.14"
|
||||
checksum: 10c0/b5873e85938380534c3887a0fc8d2c91f4bbd819e9b25d38e07e6985c3562905e694e6f9399d778ef744b712739cad1263a4a5655a5ee213f342a1929d44d77f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@ioredis/commands@npm:^1.1.1":
|
||||
version: 1.2.0
|
||||
resolution: "@ioredis/commands@npm:1.2.0"
|
||||
@@ -3818,35 +3825,35 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@speckle/objectloader@npm:^2.24.0":
|
||||
version: 2.24.0
|
||||
resolution: "@speckle/objectloader@npm:2.24.0"
|
||||
"@speckle/objectloader@npm:^2.25.0":
|
||||
version: 2.25.0
|
||||
resolution: "@speckle/objectloader@npm:2.25.0"
|
||||
dependencies:
|
||||
"@babel/core": "npm:^7.17.9"
|
||||
"@speckle/shared": "npm:^2.24.0"
|
||||
"@speckle/shared": "npm:^2.25.0"
|
||||
core-js: "npm:^3.21.1"
|
||||
lodash: "npm:^4.17.21"
|
||||
lodash-es: "npm:^4.17.21"
|
||||
regenerator-runtime: "npm:^0.13.7"
|
||||
checksum: 10c0/d4352caa1162b07ac71575dfbc7080e811428482203ce8e8b4ab0c23826cd67824470dd52a33a42c81032d42bbd825277dbba2b920ab172018d208cede8dd805
|
||||
checksum: 10c0/e1c3021e74a140d790ee6645ddb78254f70bee4a6750de1a77c9216f51ccb20d4dd43d544baaf8a458ba3a0f9e0dfe1b2703d9d4fd43e524985443e8566aa5cc
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@speckle/objectsender@npm:^2.24.0":
|
||||
version: 2.24.0
|
||||
resolution: "@speckle/objectsender@npm:2.24.0"
|
||||
"@speckle/objectsender@npm:^2.25.0":
|
||||
version: 2.25.0
|
||||
resolution: "@speckle/objectsender@npm:2.25.0"
|
||||
dependencies:
|
||||
"@speckle/shared": "npm:^2.24.0"
|
||||
"@speckle/shared": "npm:^2.25.0"
|
||||
lodash: "npm:^4.17.21"
|
||||
lodash-es: "npm:^4.17.21"
|
||||
reflect-metadata: "npm:^0.2.2"
|
||||
checksum: 10c0/5d463e696858cf5b1baaf327a09181bbcbc64f852b403fecc87b0565ddb055909779e5780ca4f818a44a694b7c74de493cd26ec728531b1dfb7b31a0044730c0
|
||||
checksum: 10c0/8956f049847037e33c824053adeefbd119b978343d29764f316dc9af6f5c13fa8bb35d3025ce5a876a25d408d5d84c14ff17fe56c70f984d6ec1fe1ab0ea384e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@speckle/shared@npm:^2.24.0":
|
||||
version: 2.24.0
|
||||
resolution: "@speckle/shared@npm:2.24.0"
|
||||
"@speckle/shared@npm:^2.25.0":
|
||||
version: 2.25.0
|
||||
resolution: "@speckle/shared@npm:2.25.0"
|
||||
dependencies:
|
||||
dayjs: "npm:^1.11.13"
|
||||
lodash: "npm:^4.17.21"
|
||||
@@ -3856,6 +3863,7 @@ __metadata:
|
||||
type-fest: "npm:^3.11.1"
|
||||
peerDependencies:
|
||||
"@tiptap/core": ^2.0.0-beta.176
|
||||
bull: "*"
|
||||
knex: "*"
|
||||
mixpanel: ^0.17.0
|
||||
pino: ^8.7.0
|
||||
@@ -3864,42 +3872,42 @@ __metadata:
|
||||
ua-parser-js: ^1.0.38
|
||||
znv: ^0.4.0
|
||||
zod: ^3.22.4
|
||||
checksum: 10c0/5e9be7e83a74a6de2094999dfbe3f41356790886381e44648250a4bc883764d47799157e526a89285e40d029332d5487b3c013d91fee084b2fb1b74537e831e8
|
||||
checksum: 10c0/c6fac64887926b23ab88502c8a97ec0cbc67d59094daacf22c838902fd3568a614fab64dff8542871961084276368976fc586c75c0463843ac1f68ffba3be1b8
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@speckle/tailwind-theme@npm:2.24.1-alpha.0":
|
||||
version: 2.24.1-alpha.0
|
||||
resolution: "@speckle/tailwind-theme@npm:2.24.1-alpha.0"
|
||||
"@speckle/tailwind-theme@npm:2.25.0":
|
||||
version: 2.25.0
|
||||
resolution: "@speckle/tailwind-theme@npm:2.25.0"
|
||||
dependencies:
|
||||
"@tailwindcss/forms": "npm:^0.5.3"
|
||||
peerDependencies:
|
||||
postcss: ^8.4.18
|
||||
postcss-nesting: ^10.2.0
|
||||
tailwindcss: ^3.3.2
|
||||
checksum: 10c0/ece3ecfa80162f0a4dc0f6bcb28839331e2c4208bf922c478d00c859248f6e77b8267e06f4c505f98fd625682006b22f8c5f63c2749c7b4efa277dcab75c2d0f
|
||||
checksum: 10c0/ba647af26d446b1d09fd0f82de80e9691825264ebb0e2cbd4f4049e44912c941dc10b7d603a1e41864e16f1fd76fe52df1aeb2102c001d0dc7b615725288f1ac
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@speckle/ui-components-nuxt@npm:^2.24.0":
|
||||
version: 2.24.0
|
||||
resolution: "@speckle/ui-components-nuxt@npm:2.24.0"
|
||||
"@speckle/ui-components-nuxt@npm:^2.25.0":
|
||||
version: 2.25.0
|
||||
resolution: "@speckle/ui-components-nuxt@npm:2.25.0"
|
||||
dependencies:
|
||||
lodash-es: "npm:^4.0.0"
|
||||
peerDependencies:
|
||||
"@nuxt/kit": ^3.2.0
|
||||
"@speckle/ui-components": "*"
|
||||
checksum: 10c0/dbd89f3511a586c63104d787220e24aeeb8fbf40c3c11a21c107633eecf0a6fddf2730a23070d4ed4f6822863cce008b421b228498a4ad764fc81c3b4cd541c1
|
||||
checksum: 10c0/73ab79982176abff0de491ff7e33d25266ffd824a8212bea482396b3f4b16914adb46a28083e2cb017d26659ef0aacdc826a7766f2d5afc56122d2b91d098a40
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@speckle/ui-components@npm:^2.24.0":
|
||||
version: 2.24.0
|
||||
resolution: "@speckle/ui-components@npm:2.24.0"
|
||||
"@speckle/ui-components@npm:^2.25.0":
|
||||
version: 2.25.0
|
||||
resolution: "@speckle/ui-components@npm:2.25.0"
|
||||
dependencies:
|
||||
"@headlessui/vue": "npm:^1.7.18"
|
||||
"@heroicons/vue": "npm:^2.0.12"
|
||||
"@speckle/shared": "npm:^2.24.0"
|
||||
"@speckle/shared": "npm:^2.25.0"
|
||||
"@storybook/test": "npm:^8.1.10"
|
||||
"@vueuse/core": "npm:^9.13.0"
|
||||
lodash: "npm:^4.0.0"
|
||||
@@ -3911,7 +3919,7 @@ __metadata:
|
||||
peerDependencies:
|
||||
vee-validate: ^4.7.0
|
||||
vue: ^3.3.0
|
||||
checksum: 10c0/e1632132cb6635423e7aec1c8c9b671012db98d3b71f21a080f1a6d7b1b86013ad901593ab67d915c2f817168d8bf9c66df7c837eea45e6f7d90b3b5c0032d39
|
||||
checksum: 10c0/be321d8fb492e62e6e38d42d3d9622c4091cc0b2bcc0b90ae15954bd31359a1680ef7963a2f026ece0fd327663e0fba614023585e8fa987d19064f73ad9fca8b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -14668,6 +14676,7 @@ __metadata:
|
||||
"@graphql-codegen/client-preset": "npm:^4.3.0"
|
||||
"@headlessui/vue": "npm:^1.7.13"
|
||||
"@heroicons/vue": "npm:^2.0.12"
|
||||
"@intercom/messenger-js-sdk": "npm:^0.0.14"
|
||||
"@jsonforms/core": "npm:3.1.0"
|
||||
"@jsonforms/vue": "npm:3.1.0"
|
||||
"@jsonforms/vue-vanilla": "npm:3.1.0"
|
||||
@@ -14675,12 +14684,12 @@ __metadata:
|
||||
"@nuxtjs/tailwindcss": "npm:^6.14.0"
|
||||
"@parcel/watcher": "npm:^2.5.1"
|
||||
"@pinia/nuxt": "npm:^0.4.11"
|
||||
"@speckle/objectloader": "npm:^2.24.0"
|
||||
"@speckle/objectsender": "npm:^2.24.0"
|
||||
"@speckle/shared": "npm:^2.24.0"
|
||||
"@speckle/tailwind-theme": "npm:2.24.1-alpha.0"
|
||||
"@speckle/ui-components": "npm:^2.24.0"
|
||||
"@speckle/ui-components-nuxt": "npm:^2.24.0"
|
||||
"@speckle/objectloader": "npm:^2.25.0"
|
||||
"@speckle/objectsender": "npm:^2.25.0"
|
||||
"@speckle/shared": "npm:^2.25.0"
|
||||
"@speckle/tailwind-theme": "npm:2.25.0"
|
||||
"@speckle/ui-components": "npm:^2.25.0"
|
||||
"@speckle/ui-components-nuxt": "npm:^2.25.0"
|
||||
"@types/apollo-upload-client": "npm:^17.0.1"
|
||||
"@types/eslint": "npm:^9.6.1"
|
||||
"@types/lodash-es": "npm:^4.17.6"
|
||||
|
||||
Reference in New Issue
Block a user