Feat: Added support for session graph and session essence templates. (#16851)

### Summary

Feat: Added support for session graph and session essence templates.
This commit is contained in:
balibabu
2026-07-13 14:48:02 +08:00
committed by GitHub
parent d549194562
commit 2b9569ff51
40 changed files with 212 additions and 827 deletions

View File

@@ -20,7 +20,7 @@ export interface IChunkListResult {
searchString?: string;
handleInputChange?: React.ChangeEventHandler<HTMLInputElement>;
pagination: PaginationProps;
setPagination?: (pagination: { page: number; pageSize: number }) => void;
setPagination?: (pagination: { page: number; pageSize?: number }) => void;
available: number | undefined;
handleSetAvailable: (available: number | undefined) => void;
dataUpdatedAt?: number; // Timestamp when data was last updated - useful for cache busting

View File

@@ -12,9 +12,11 @@ import {
getCompilationTemplateGroup,
updateCompilationTemplateGroup,
} from '@/services/compilation-template-group-service';
import { isCreateCompilationTemplateGroup } from '@/utils/compilation-template-util';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { useDebounce } from 'ahooks';
import { useCallback, useMemo } from 'react';
import { useParams } from 'react-router';
import {
useGetPaginationWithRouter,
@@ -98,15 +100,18 @@ export const useFetchCompilationTemplateGroupsByPage = () => {
};
};
export const useFetchCompilationTemplateGroup = (id?: string) => {
export const useFetchCompilationTemplateGroup = () => {
const { id } = useParams<{ id: string }>();
const isCreate = isCreateCompilationTemplateGroup(id);
const { data, isFetching: loading } = useQuery<
ICompilationTemplateGroup | undefined
>({
queryKey: CompilationTemplateGroupKeys.detail(id),
enabled: !!id && id !== 'create',
enabled: !isCreate,
gcTime: 0,
queryFn: async () => {
if (!id || id === 'create') return undefined;
if (isCreate) return undefined;
const { data } = await getCompilationTemplateGroup(id);
return data?.data as ICompilationTemplateGroup | undefined;
},