Files
speckle-server/packages/frontend-2/pages/settings/workspaces/[slug]/projects.vue
T
Kristaps Fabians Geikins 596312ab0e feat(frontend): personal project limit disclaimers & prompts (#4822)
* ProjectsAdd wrapper

* WorkspaceMoveProject wrapper added

* move wrapper finalized

* passing through location

* more cleanup

* model add wrapper

* permissions cleanup

* add invite wrapper

* vue-tippy bugfix

* ViewerLimitsDialog prep

* upgrade limit alert prep

* limit alerts

* movemanager fix

* new add flow

* slug update fix

* add model flow

* invites?

* some extra fixes

* move unmount fix?

* more fixes

* vue-tsc update

* style: remove h-32 for smaller screens

* vue-tsc parser fix

* prep for new viewer limits dialog

* updated viewer dialogs

* comment variant cleanup

* CR comments

---------

Co-authored-by: michalspeckle <michal@speckle.systems>
2025-05-28 12:12:18 +03:00

98 lines
2.5 KiB
Vue

<template>
<section>
<div class="md:max-w-5xl md:mx-auto pb-6 md:pb-0">
<SettingsSectionHeader
title="Projects"
text="Manage projects in your workspace"
/>
<div v-if="loading && !projects.length" class="flex justify-center py-8">
<CommonLoadingIcon />
</div>
<SettingsSharedProjects
v-else
v-model:search="search"
:projects="projects"
:workspace-id="result?.workspaceBySlug.id"
:workspace="workspace"
/>
<InfiniteLoading
v-if="projects?.length"
:settings="{ identifier }"
class="py-4"
@infinite="onInfiniteLoad"
/>
</div>
</section>
</template>
<script setup lang="ts">
import { settingsWorkspacesProjectsQuery } from '~~/lib/settings/graphql/queries'
import { usePaginatedQuery } from '~/lib/common/composables/graphql'
import { graphql } from '~/lib/common/generated/gql'
import { useWorkspaceProjectsUpdatedTracking } from '~/lib/workspaces/composables/projectUpdates'
import type { Nullable } from '@speckle/shared'
graphql(`
fragment SettingsWorkspacesProjects_ProjectCollection on ProjectCollection {
totalCount
items {
...SettingsSharedProjects_Project
}
}
`)
graphql(`
fragment SettingsWorkspacesProjects_Workspace on Workspace {
id
name
slug
plan {
name
}
role
permissions {
canCreateProject {
...FullPermissionCheckResult
}
}
}
`)
definePageMeta({
layout: 'settings'
})
useHead({
title: 'Settings | Workspace - Projects'
})
const route = useRoute()
const search = ref('')
const slug = computed(() => (route.params.slug as string) || '')
const {
identifier,
onInfiniteLoad,
query: { result, loading }
} = usePaginatedQuery({
query: settingsWorkspacesProjectsQuery,
baseVariables: computed(() => ({
limit: 50,
filter: { search: search.value?.length ? search.value : null },
slug: slug.value,
cursor: null as Nullable<string>
})),
resolveKey: (vars) => [vars.slug, vars.filter?.search || ''],
resolveCurrentResult: (res) => res?.workspaceBySlug.projects,
resolveNextPageVariables: (baseVars, cursor) => ({
...baseVars,
cursor
}),
resolveCursorFromVariables: (vars) => vars.cursor
})
const workspace = computed(() => result.value?.workspaceBySlug)
const projects = computed(() => result.value?.workspaceBySlug.projects.items || [])
useWorkspaceProjectsUpdatedTracking(computed(() => slug.value))
</script>