Skip to content

Commit f2aa77e

Browse files
authored
Add dataset types and form builder (#5572)
* feat(datasets): add dataset_type to postgres * feat(components): create FormBuilder component * fix: pre-commit config * feat(components): include boolean type on form builder
1 parent 2616e96 commit f2aa77e

File tree

17 files changed

+674
-30
lines changed

17 files changed

+674
-30
lines changed

.lintstagedrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"**/*.{js,jsx,ts,tsx,sol}": [
3-
"eslint --flag v10_config_lookup_from_file --fix --max-warnings 0",
3+
"eslint --flag v10_config_lookup_from_file --fix --max-warnings 0 --no-warn-ignored",
44
"prettier --ignore-path .gitignore --write",
55
"prettier --ignore-path .gitignore --log-level warn --check"
66
],

apps/frontend/app/api/v1/osograph/schema.graphql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ type Invitation @key(fields: "id") {
8080
acceptedBy: User
8181
}
8282

83+
enum DatasetType {
84+
USER_MODEL
85+
DATA_CONNECTOR
86+
DATA_INGESTION
87+
}
88+
8389
"""
8490
Notebook entity - represents a computational notebook
8591
"""
@@ -114,6 +120,7 @@ type Dataset @key(fields: "id") {
114120
createdBy: ID!
115121
isPublic: Boolean!
116122
tables: [Table!]!
123+
datasetType: DatasetType!
117124
}
118125

119126
"""

apps/frontend/app/api/v1/osograph/schema/resolvers/dataset.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ export const datasetResolver: GraphQLResolverModule<GraphQLContext> = {
228228
schema: (parent: DatasetsRow) => parent.schema,
229229
createdBy: (parent: DatasetsRow) => parent.created_by,
230230
isPublic: (parent: DatasetsRow) => parent.is_public,
231+
datasetType: (parent: DatasetsRow) => parent.dataset_type,
231232
},
232233
};
233234

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"use client";
2+
3+
import * as React from "react";
4+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
5+
import { Check } from "lucide-react";
6+
7+
import { cn } from "@/lib/utils";
8+
9+
const Checkbox = React.forwardRef<
10+
React.ElementRef<typeof CheckboxPrimitive.Root>,
11+
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
12+
>(({ className, ...props }, ref) => (
13+
<CheckboxPrimitive.Root
14+
ref={ref}
15+
className={cn(
16+
"grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
17+
className,
18+
)}
19+
{...props}
20+
>
21+
<CheckboxPrimitive.Indicator
22+
className={cn("grid place-content-center text-current")}
23+
>
24+
<Check className="h-4 w-4" />
25+
</CheckboxPrimitive.Indicator>
26+
</CheckboxPrimitive.Root>
27+
));
28+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
29+
30+
export { Checkbox };

0 commit comments

Comments
 (0)