You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dashboard: Fix Import Engine form submit not working (#8064)
<!--
## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"
If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):
## Notes for the reviewer
Anything important to call out? Be sure to also clarify these in your comments.
## How to test
Unit tests, playground, etc.
-->
<!-- start pr-codex -->
---
## PR-Codex overview
This PR introduces a dialog for importing engine instances in the `ImportEngineButton` component, enhancing user interaction by managing the dialog state and updating UI elements.
### Detailed summary
- Added `useState` to manage the dialog's open state.
- Changed navigation from `router.push` to `router.refresh` after import.
- Wrapped the dialog in a conditional open state.
- Updated the layout and styling of the dialog content and links.
- Modified form field styles for better UI consistency.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* New Features
* Import dialog now closes automatically after a successful import and refreshes the current page.
* Added an in-dialog warning beneath the URL field for clearer guidance.
* Updated “Get started” link destination.
* Style
* Redesigned import dialog with improved layout, spacing, rounded content, and a bottom action bar; inputs use card styling.
* Refined labels, placeholders, and header padding for clearer readability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Copy file name to clipboardExpand all lines: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/import/import-engine-dialog.tsx
+39-37Lines changed: 39 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ import {
8
8
ExternalLinkIcon,
9
9
}from"lucide-react";
10
10
importLinkfrom"next/link";
11
+
import{useState}from"react";
11
12
import{useForm}from"react-hook-form";
12
13
import{toast}from"sonner";
13
14
import{z}from"zod";
@@ -17,7 +18,6 @@ import {
17
18
Dialog,
18
19
DialogContent,
19
20
DialogDescription,
20
-
DialogFooter,
21
21
DialogHeader,
22
22
DialogTitle,
23
23
DialogTrigger,
@@ -70,6 +70,7 @@ export function ImportEngineButton(props: {
70
70
teamSlug: string;
71
71
projectSlug: string;
72
72
}){
73
+
const[isOpen,setIsOpen]=useState(false);
73
74
constrouter=useDashboardRouter();
74
75
constform=useForm<ImportEngineParams>({
75
76
resolver: zodResolver(formSchema),
@@ -82,14 +83,15 @@ export function ImportEngineButton(props: {
0 commit comments