Files
speckle-server/packages/frontend-2/pages/settings/server/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

69 lines
1.7 KiB
Vue

<template>
<section>
<div class="md:max-w-5xl md:mx-auto pb-6 md:pb-0">
<SettingsSectionHeader title="Projects" text="Manage projects on your server" />
<SettingsSharedProjects
v-model:search="search"
:projects="projects"
:workspace-id="null"
:workspace="null"
/>
<InfiniteLoading
v-if="projects?.length"
:settings="{ identifier }"
class="py-4"
@infinite="onInfiniteLoad"
/>
</div>
</section>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { adminPanelProjectsQuery } from '~~/lib/server-management/graphql/queries'
import { usePaginatedQuery } from '~/lib/common/composables/graphql'
import { graphql } from '~/lib/common/generated/gql'
import type { Nullable } from '@speckle/shared'
graphql(`
fragment SettingsServerProjects_ProjectCollection on ProjectCollection {
totalCount
items {
...SettingsSharedProjects_Project
}
}
`)
definePageMeta({
layout: 'settings'
})
useHead({
title: 'Settings | Server - Projects'
})
const search = ref('')
const {
identifier,
onInfiniteLoad,
query: { result }
} = usePaginatedQuery({
query: adminPanelProjectsQuery,
baseVariables: computed(() => ({
query: search.value?.length ? search.value : null,
limit: 50,
cursor: null as Nullable<string>
})),
resolveKey: (vars) => [vars.query || ''],
resolveCurrentResult: (res) => res?.admin.projectList,
resolveNextPageVariables: (baseVars, cursor) => ({
...baseVars,
cursor
}),
resolveCursorFromVariables: (vars) => vars.cursor
})
const projects = computed(() => result.value?.admin.projectList.items || [])
</script>