From 0f5b12fa56dac5d537faf7f0bdf16906a0e8839c Mon Sep 17 00:00:00 2001 From: waleed Date: Mon, 17 Nov 2025 17:24:04 -0800 Subject: [PATCH] fix(workflows): fixed workflow loading in without start block, added templates RQ hook, cleaned up unused templates code --- apps/sim/app/(landing)/components/nav/nav.tsx | 2 +- apps/sim/app/templates/[id]/template.tsx | 88 +- .../templates/components/template-card.tsx | 134 +--- apps/sim/app/templates/templates.tsx | 27 +- .../templates/components/template-card.tsx | 133 +-- .../[workspaceId]/templates/templates.tsx | 28 +- .../template-deploy/template-deploy.tsx | 146 ++-- .../control-bar/components/index.ts | 1 - .../template-modal/template-modal.tsx | 756 ------------------ .../[workspaceId]/w/[workflowId]/workflow.tsx | 27 +- .../app/workspace/[workspaceId]/w/page.tsx | 6 +- apps/sim/hooks/queries/templates.ts | 396 +++++++++ apps/sim/hooks/queries/workflows.ts | 21 +- apps/sim/hooks/use-collaborative-workflow.ts | 17 +- 14 files changed, 525 insertions(+), 1257 deletions(-) delete mode 100644 apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/template-modal/template-modal.tsx create mode 100644 apps/sim/hooks/queries/templates.ts diff --git a/apps/sim/app/(landing)/components/nav/nav.tsx b/apps/sim/app/(landing)/components/nav/nav.tsx index 2f03f148ed4..dbf722e4882 100644 --- a/apps/sim/app/(landing)/components/nav/nav.tsx +++ b/apps/sim/app/(landing)/components/nav/nav.tsx @@ -20,7 +20,7 @@ interface NavProps { } export default function Nav({ hideAuthButtons = false, variant = 'landing' }: NavProps = {}) { - const [githubStars, setGithubStars] = useState('18k') + const [githubStars, setGithubStars] = useState('18.5k') const [isHovered, setIsHovered] = useState(false) const [isLoginHovered, setIsLoginHovered] = useState(false) const router = useRouter() diff --git a/apps/sim/app/templates/[id]/template.tsx b/apps/sim/app/templates/[id]/template.tsx index 1d7ccf55168..4f87e24b15f 100644 --- a/apps/sim/app/templates/[id]/template.tsx +++ b/apps/sim/app/templates/[id]/template.tsx @@ -34,9 +34,9 @@ import { createLogger } from '@/lib/logs/console/logger' import { getBaseUrl } from '@/lib/urls/utils' import { cn } from '@/lib/utils' import type { CredentialRequirement } from '@/lib/workflows/credential-extractor' -import type { Template } from '@/app/templates/templates' import { WorkflowPreview } from '@/app/workspace/[workspaceId]/w/components/workflow-preview/workflow-preview' import { getBlock } from '@/blocks/registry' +import { useStarTemplate, useTemplate } from '@/hooks/queries/templates' const logger = createLogger('TemplateDetails') @@ -52,16 +52,14 @@ export default function TemplateDetails({ isWorkspaceContext = false }: Template const workspaceId = isWorkspaceContext ? (params?.workspaceId as string) : null const { data: session } = useSession() - const [template, setTemplate] = useState