d2f2d7bcfd
* feat(automate): expose function regeneration endpoint * chore(automate): remember to call the function * fix(automate): use correct auth code action * fix(automate): token regenerate policy * fix(automate): expose function regen token policy * feat(automate): workspace automation settings tab * feat(automate): function token regeneration dialog * fix(automate): improve gql usage in vue components * chore(authz): tests for automate function policies * fix(automate): use paginated query * fix(automate): resolve initial result
60 lines
1.6 KiB
Vue
60 lines
1.6 KiB
Vue
<template>
|
|
<section>
|
|
<div class="md:max-w-5xl md:mx-auto pb-6 md:pb-0">
|
|
<SettingsSectionHeader
|
|
title="Automation"
|
|
text="Manage workspace functions and project automations"
|
|
/>
|
|
<SettingsWorkspacesAutomationFunctions
|
|
:workspace-functions="workspaceFunctions"
|
|
/>
|
|
<InfiniteLoading :settings="{ identifier }" @infinite="onInfiniteLoad" />
|
|
</div>
|
|
</section>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import type { Nullable } from '@speckle/shared'
|
|
import { usePaginatedQuery } from '~/lib/common/composables/graphql'
|
|
import { settingsWorkspacesAutomationQuery } from '~/lib/settings/graphql/queries'
|
|
|
|
definePageMeta({
|
|
layout: 'settings'
|
|
})
|
|
|
|
useHead({
|
|
title: 'Settings | Workspace - Automation'
|
|
})
|
|
|
|
const route = useRoute()
|
|
const slug = computed(() => (route.params.slug as string) || '')
|
|
const isAutomateEnabled = useIsAutomateModuleEnabled()
|
|
|
|
const {
|
|
identifier,
|
|
onInfiniteLoad,
|
|
query: { result }
|
|
} = usePaginatedQuery({
|
|
query: settingsWorkspacesAutomationQuery,
|
|
baseVariables: computed(() => ({
|
|
slug: slug.value,
|
|
cursor: null as Nullable<string>
|
|
})),
|
|
options: () => ({
|
|
enabled: isAutomateEnabled.value
|
|
}),
|
|
resolveCurrentResult: (res) => res?.workspaceBySlug?.automateFunctions,
|
|
resolveInitialResult: () => ({
|
|
items: [],
|
|
cursor: undefined
|
|
}),
|
|
resolveNextPageVariables: (baseVars, cursor) => ({ ...baseVars, cursor }),
|
|
resolveKey: (vars) => [vars.slug],
|
|
resolveCursorFromVariables: (vars) => vars.cursor
|
|
})
|
|
|
|
const workspaceFunctions = computed(
|
|
() => result?.value?.workspaceBySlug.automateFunctions.items ?? []
|
|
)
|
|
</script>
|