@@ -41,6 +53,7 @@ export default function Page({
id="title"
{...register("name")}
placeholder="Enter the title"
+ onChange={(e) => setTitle(e.target.value)}
/>
{errors.name ? (
@@ -50,28 +63,35 @@ export default function Page({
""
)}
-
- {
- setFilename(path);
- }}
- isDataset={true}
- />
+ ({
resolver: zodResolver(createProjectSchema),
});
@@ -94,46 +87,15 @@ export default function Page({
);
}
- const currentOrganisation = organisations.find(
- (org) => parseInt(org.id) === parseInt(orgId),
- );
+ const titleValue = watch("title");
+
+ const disableButton = titleValue === undefined || titleValue === "";``
return (
({
resolver: zodResolver(createProjectSchema),
});
@@ -60,40 +53,14 @@ export default function Page({
getOrganisations();
}, []);
+ const watchTitle = watch("title");
+ const disableButton = watchTitle === undefined || watchTitle === "" || orgId === undefined || orgId === "";
+
return (
-
-
diff --git a/studio/web/app/home/organisations/page.tsx b/studio/web/app/home/organisations/page.tsx
index 8570dd4..8e7109f 100644
--- a/studio/web/app/home/organisations/page.tsx
+++ b/studio/web/app/home/organisations/page.tsx
@@ -1,5 +1,6 @@
"use client";
import React, { useEffect } from "react";
+import { useRouter } from "next/navigation";
import { SearchBar } from "@/components/ui/searchBar";
import { Organisation } from "../../../components/ui/Organisation";
import { Organisation as OrganisationType } from "@/types/organisation";
@@ -17,6 +18,7 @@ export default function Page() {
const [loading, setLoading] = React.useState(true);
const { organisations, setOrganisations } = useOrganisationsStore();
const serverUrl = getServerUrl();
+ const router = useRouter();
useEffect(() => {
async function getOrganisations() {
@@ -29,6 +31,10 @@ export default function Page() {
...kavachAxiosConfig,
});
setOrganisations(resp.data.organisations);
+ if (resp.data.organisations.length === 0) {
+ router.push("/home/organisations/new");
+ toast.error("No organisations found. Create a new one");
+ }
} catch (err) {
console.log(err);
toast.error("Error getting organisations");
@@ -36,7 +42,7 @@ export default function Page() {
setLoading(false);
}
}
- getOrganisations();
+ getOrganisations()
}, []);
const [selectedOrg, setSelectedOrg] = React.useState(null);
@@ -57,6 +63,8 @@ export default function Page() {
}
};
+
+
return (
+
+
-
-
-
+
+
diff --git a/studio/web/app/home/organisations/[organisationId]/projects/[projectId]/edit/page.tsx b/studio/web/app/home/organisations/[organisationId]/projects/[projectId]/edit/page.tsx
index 90800c5..e341ca5 100644
--- a/studio/web/app/home/organisations/[organisationId]/projects/[projectId]/edit/page.tsx
+++ b/studio/web/app/home/organisations/[organisationId]/projects/[projectId]/edit/page.tsx
@@ -4,14 +4,6 @@ import { Button } from "@/components/ui/Button";
import { Input } from "@/components/dataEntry/input";
import { Label } from "@/components/dataEntry/label";
import { Textarea } from "@/components/dataEntry/textarea";
-import {
- Select,
- SelectContent,
- SelectGroup,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from "@/components/ui/select";
import Link from "next/link";
import { useForm } from "react-hook-form";
import { useOrganisationsStore } from "@/lib/zustand/organisation";
@@ -39,6 +31,7 @@ export default function Page({
register,
formState: { errors },
setValue,
+ watch,
} = useForm
+
Edit {project.title}
-
-
+
+
diff --git a/studio/web/app/home/organisations/[organisationId]/projects/new/page.tsx b/studio/web/app/home/organisations/[organisationId]/projects/new/page.tsx
index 3f06614..0172c3d 100644
--- a/studio/web/app/home/organisations/[organisationId]/projects/new/page.tsx
+++ b/studio/web/app/home/organisations/[organisationId]/projects/new/page.tsx
@@ -4,14 +4,6 @@ import { Button } from "@/components/ui/Button";
import { Input } from "@/components/dataEntry/input";
import { Label } from "@/components/dataEntry/label";
import { Textarea } from "@/components/dataEntry/textarea";
-import {
- Select,
- SelectContent,
- SelectGroup,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from "@/components/ui/select";
import Link from "next/link";
import { useForm } from "react-hook-form";
import { useOrganisationsStore } from "@/lib/zustand/organisation";
@@ -38,6 +30,7 @@ export default function Page({
handleSubmit,
register,
formState: { errors },
+ watch
} = useForm
+
Create New Project
-
-
+
+
diff --git a/studio/web/app/home/organisations/new/page.tsx b/studio/web/app/home/organisations/new/page.tsx
index bed1f8b..c4821d1 100644
--- a/studio/web/app/home/organisations/new/page.tsx
+++ b/studio/web/app/home/organisations/new/page.tsx
@@ -114,16 +114,6 @@ export default function Page() {
+
-
-
-
+
+
+
+
+
diff --git a/studio/web/assets/document.png b/studio/web/assets/document.png
new file mode 100644
index 0000000..3d2dda9
Binary files /dev/null and b/studio/web/assets/document.png differ
diff --git a/studio/web/components/ui/feature/searchSql.tsx b/studio/web/components/ui/feature/searchSql.tsx
index 8b91254..6e3c0ab 100644
--- a/studio/web/components/ui/feature/searchSql.tsx
+++ b/studio/web/components/ui/feature/searchSql.tsx
@@ -8,6 +8,13 @@ import {
fetchRowsForTable,
fetchSchemaForTable,
} from "@/lib/actions/features/getSchema";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@/components/ui/select";
import { convertTextToSql } from "@/lib/actions/features/textToSql";
import Loading from "../loading";
import { fetchSqlForQuery } from "@/lib/actions/features/searchSql";
@@ -77,6 +84,11 @@ function SearchSql({ dataset }: { dataset: File }) {
setLoading(false);
}
};
+
+ const selectOptions = [
+ { label: "Schema", value: "Schema" },
+ { label: "Rows", value: "Rows" },
+ ];
return (
@@ -106,20 +118,22 @@ function SearchSql({ dataset }: { dataset: File }) {
{textToSqlEnabled ? (
<>
-
+
Search Results in:
-
- Schema
-
- setSelectedOption(
- selectedOption === "Rows" ? "Schema" : "Rows",
- )
- }
- />
- Rows
-
+