Skip to content

Commit ce01bd8

Browse files
author
Nico Sammito
authored
Merge pull request #85 from code0-tech/feat/#81
Move dashboard Pictor components to sculptor
2 parents 551ae40 + 3994cb1 commit ce01bd8

138 files changed

Lines changed: 9793 additions & 477 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
EDITION=ce
22
SAGITTARIUS_GRAPHQL_URL=http://localhost:3010/graphql
33
NEXT_PUBLIC_SCULPTOR_VERSION=0.0.0
4-
NEXT_PUBLIC_PICTOR_VERSION=0.0.0-mvp.46
4+
NEXT_PUBLIC_PICTOR_VERSION=0.0.0-mvp.47

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"dependencies": {
1717
"@apollo/client": "^4.0.9",
18-
"@code0-tech/pictor": "^0.0.0-mvp.46",
18+
"@code0-tech/pictor": "^0.0.0-mvp.47",
1919
"date-fns": "^4.1.0",
2020
"graphql": "^16.12.0",
2121
"graphql-tag": "^2.12.6",

src/app/(auth)/layout.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import {
55
Col,
66
Container,
77
ContextStoreProvider,
8-
DFullScreen,
9-
DUserView,
108
Flex, Spacing,
119
Text
1210
} from "@code0-tech/pictor";
@@ -16,14 +14,16 @@ import {GraphqlClient} from "@core/util/graphql-client";
1614
import Image from "next/image";
1715
import React from "react";
1816
import {usePersistentReactiveArrayService} from "@/hooks/usePersistentReactiveArrayService";
17+
import {UserView} from "@edition/user/services/User.view";
18+
import {FullScreen} from "@code0-tech/pictor/dist/components/fullscreen/FullScreen";
1919

2020
export default function AuthLayout({children}: Readonly<{ children: React.ReactNode }>) {
2121

2222
const client = useApolloClient()
23-
const [store, service] = usePersistentReactiveArrayService<DUserView, UserService>("auth-users", (store) => new UserService(new GraphqlClient(client), store))
23+
const [store, service] = usePersistentReactiveArrayService<UserView, UserService>("auth-users", (store) => new UserService(new GraphqlClient(client), store))
2424

2525
return (
26-
<DFullScreen>
26+
<FullScreen>
2727
<AuroraBackground/>
2828
<ContextStoreProvider services={[[store, service]]}>
2929
<Container h={"100%"} w={"100%"}>
@@ -61,6 +61,6 @@ export default function AuthLayout({children}: Readonly<{ children: React.ReactN
6161
</Flex>
6262
</div>
6363

64-
</DFullScreen>
64+
</FullScreen>
6565
);
6666
}

src/app/(dashboard)/layout.tsx

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,7 @@ import {useApolloClient} from "@apollo/client/react";
55
import {
66
AuroraBackground,
77
ContextStoreProvider,
8-
DLayout,
9-
DNamespaceMemberView,
10-
DNamespaceProjectView,
11-
DNamespaceRoleView,
12-
DNamespaceView,
13-
DOrganizationView,
14-
DRuntimeView,
15-
DUserView,
16-
Flex,
17-
useUserSession
8+
Flex
189
} from "@code0-tech/pictor";
1910
import {UserService} from "@edition/user/services/User.service";
2011
import {GraphqlClient} from "@core/util/graphql-client";
@@ -28,6 +19,15 @@ import {ProjectService} from "@edition/project/services/Project.service";
2819
import {RoleService} from "@edition/role/services/Role.service";
2920
import Image from "next/image";
3021
import {Application, ApplicationService} from "@edition/application/services/Application.service";
22+
import {useUserSession} from "@edition/user/hooks/User.session.hook";
23+
import {UserView} from "@edition/user/services/User.view";
24+
import {OrganizationView} from "@edition/organization/services/Organization.view";
25+
import {MemberView} from "@edition/member/services/Member.view";
26+
import {NamespaceView} from "@edition/namespace/services/Namespace.view";
27+
import {RuntimeView} from "@edition/runtime/services/Runtime.view";
28+
import {ProjectView} from "@edition/project/services/Project.view";
29+
import {RoleView} from "@edition/role/services/Role.view";
30+
import {Layout} from "@code0-tech/pictor/dist/components/layout/Layout";
3131

3232
interface ApplicationLayoutProps {
3333
children: React.ReactNode
@@ -43,19 +43,19 @@ const ApplicationLayout: React.FC<ApplicationLayoutProps> = ({children, bar, tab
4343

4444
const graphqlClient = React.useMemo(() => new GraphqlClient(client), [client])
4545

46-
const user = usePersistentReactiveArrayService<DUserView, UserService>(`dashboard::users::${currentSession?.id}`, (store) => new UserService(graphqlClient, store))
47-
const organization = usePersistentReactiveArrayService<DOrganizationView, OrganizationService>(`dashboard::organizations::${currentSession?.id}`, (store) => new OrganizationService(graphqlClient, store))
48-
const member = usePersistentReactiveArrayService<DNamespaceMemberView, MemberService>(`dashboard::members::${currentSession?.id}`, (store) => new MemberService(graphqlClient, store))
49-
const namespace = usePersistentReactiveArrayService<DNamespaceView, NamespaceService>(`dashboard::namespaces::${currentSession?.id}`, (store) => new NamespaceService(graphqlClient, store))
50-
const runtime = usePersistentReactiveArrayService<DRuntimeView, RuntimeService>(`dashboard::global_runtimes::${currentSession?.id}`, (store) => new RuntimeService(graphqlClient, store))
51-
const project = usePersistentReactiveArrayService<DNamespaceProjectView, ProjectService>(`dashboard::projects::${currentSession?.id}`, (store) => new ProjectService(graphqlClient, store))
52-
const role = usePersistentReactiveArrayService<DNamespaceRoleView, RoleService>(`dashboard::roles::${currentSession?.id}`, (store) => new RoleService(graphqlClient, store))
46+
const user = usePersistentReactiveArrayService<UserView, UserService>(`dashboard::users::${currentSession?.id}`, (store) => new UserService(graphqlClient, store))
47+
const organization = usePersistentReactiveArrayService<OrganizationView, OrganizationService>(`dashboard::organizations::${currentSession?.id}`, (store) => new OrganizationService(graphqlClient, store))
48+
const member = usePersistentReactiveArrayService<MemberView, MemberService>(`dashboard::members::${currentSession?.id}`, (store) => new MemberService(graphqlClient, store))
49+
const namespace = usePersistentReactiveArrayService<NamespaceView, NamespaceService>(`dashboard::namespaces::${currentSession?.id}`, (store) => new NamespaceService(graphqlClient, store))
50+
const runtime = usePersistentReactiveArrayService<RuntimeView, RuntimeService>(`dashboard::global_runtimes::${currentSession?.id}`, (store) => new RuntimeService(graphqlClient, store))
51+
const project = usePersistentReactiveArrayService<ProjectView, ProjectService>(`dashboard::projects::${currentSession?.id}`, (store) => new ProjectService(graphqlClient, store))
52+
const role = usePersistentReactiveArrayService<RoleView, RoleService>(`dashboard::roles::${currentSession?.id}`, (store) => new RoleService(graphqlClient, store))
5353
const application = usePersistentReactiveArrayService<Application, ApplicationService>(`dashboard::application::${currentSession?.id}`, (store) => new ApplicationService(graphqlClient, store))
5454

5555
if (currentSession === null) router.push("/login")
5656

5757
return <ContextStoreProvider services={[user, organization, member, namespace, runtime, project, role, application]}>
58-
<DLayout style={{zIndex: 0}} layoutGap={"0"} showLayoutSplitter={false} leftContent={
58+
<Layout style={{zIndex: 0}} layoutGap={"0"} showLayoutSplitter={false} leftContent={
5959
<Flex p={0.7} pt={1} align={"center"} style={{flexDirection: "column", gap: "0.7rem"}}>
6060
<div style={{
6161
position: "absolute",
@@ -83,12 +83,12 @@ const ApplicationLayout: React.FC<ApplicationLayoutProps> = ({children, bar, tab
8383
{tab}
8484
</Flex>
8585
}>
86-
<DLayout px={0.7} layoutGap={"0"} topContent={<>{bar}</>}>
87-
<DLayout>
86+
<Layout px={0.7} layoutGap={"0"} topContent={<>{bar}</>}>
87+
<Layout>
8888
<>{children}</>
89-
</DLayout>
90-
</DLayout>
91-
</DLayout>
89+
</Layout>
90+
</Layout>
91+
</Layout>
9292
</ContextStoreProvider>
9393
}
9494

src/app/(flow)/@tab/namespace/[namespaceId]/project/[projectId]/default.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
import {Tab, TabList, TabTrigger} from "@code0-tech/pictor/dist/components/tab/Tab";
44
import {Button, Text, Tooltip, TooltipContent, TooltipPortal, TooltipTrigger} from "@code0-tech/pictor";
5-
import {IconBuilding, IconHome, IconSettings} from "@tabler/icons-react";
5+
import {IconHome, IconSettings} from "@tabler/icons-react";
66
import React from "react";
77
import {useParams, usePathname, useRouter} from "next/navigation";
8-
import {hashToColor} from "@code0-tech/pictor/dist/components/d-flow/DFlow.util";
98

109
export default function Page() {
1110

@@ -45,7 +44,8 @@ export default function Page() {
4544
<Tooltip>
4645
<TooltipTrigger asChild>
4746
<TabTrigger value={"settings"} asChild={true}>
48-
<Button variant={"none"} paddingSize={"xs"} onClick={() => router.push(`/namespace/${namespaceId}/project/${projectId}/settings`)}>
47+
<Button variant={"none"} paddingSize={"xs"}
48+
onClick={() => router.push(`/namespace/${namespaceId}/project/${projectId}/settings`)}>
4949
<IconSettings size={16}/>
5050
</Button>
5151
</TabTrigger>

src/app/(flow)/layout.tsx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,7 @@ import {useParams, useRouter} from "next/navigation";
55
import {
66
AuroraBackground,
77
ContextStoreProvider,
8-
DataTypeView,
9-
DLayout,
10-
DNamespaceMemberView,
11-
DNamespaceProjectView,
12-
DNamespaceRoleView,
13-
DNamespaceView,
14-
DOrganizationView,
15-
DRuntimeView,
16-
DUserView,
178
Flex,
18-
FlowTypeView,
19-
FunctionDefinitionView,
20-
useUserSession
219
} from "@code0-tech/pictor";
2210
import React from "react";
2311
import {GraphqlClient} from "@core/util/graphql-client";
@@ -33,12 +21,24 @@ import {RoleService} from "@edition/role/services/Role.service";
3321
import {FlowService} from "@edition/flow/services/Flow.service";
3422
import {FunctionService} from "@edition/function/services/Function.service";
3523
import {DatatypeService} from "@edition/datatype/services/Datatype.service";
36-
import {FlowTypeService} from "@edition/flowtype/services/FlowTypeService";
24+
import {FlowTypeService} from "@edition/flowtype/services/FlowType.service";
3725
import {FileTabsView} from "@code0-tech/pictor/dist/components/file-tabs/FileTabs.view";
3826
import {FileTabsService} from "@code0-tech/pictor/dist/components/file-tabs/FileTabs.service";
3927
import Image from "next/image";
28+
import {UserView} from "@edition/user/services/User.view";
29+
import {OrganizationView} from "@edition/organization/services/Organization.view";
30+
import {MemberView} from "@edition/member/services/Member.view";
31+
import {NamespaceView} from "@edition/namespace/services/Namespace.view";
32+
import {RuntimeView} from "@edition/runtime/services/Runtime.view";
33+
import {ProjectView} from "@edition/project/services/Project.view";
34+
import {RoleView} from "@edition/role/services/Role.view";
35+
import {FunctionView} from "@edition/function/services/Function.view";
36+
import {DataTypeView} from "@edition/datatype/services/DataType.view";
37+
import {FlowTypeView} from "@edition/flowtype/services/FlowType.view";
38+
import {useUserSession} from "@edition/user/hooks/User.session.hook";
39+
import {Layout} from "@code0-tech/pictor/dist/components/layout/Layout";
4040

41-
export default function Layout({bar, tab, children}: {
41+
export default function FlowLayout({bar, tab, children}: {
4242
bar: React.ReactNode,
4343
tab: React.ReactNode,
4444
children: React.ReactNode
@@ -59,15 +59,15 @@ export default function Layout({bar, tab, children}: {
5959

6060
if (currentSession === null) router.push("/login")
6161

62-
const user = usePersistentReactiveArrayService<DUserView, UserService>(`dashboard::users::${currentSession?.id}`, (store) => new UserService(graphqlClient, store))
63-
const organization = usePersistentReactiveArrayService<DOrganizationView, OrganizationService>(`dashboard::organizations::${currentSession?.id}`, (store) => new OrganizationService(graphqlClient, store))
64-
const member = usePersistentReactiveArrayService<DNamespaceMemberView, MemberService>(`dashboard::members::${currentSession?.id}`, (store) => new MemberService(graphqlClient, store))
65-
const namespace = usePersistentReactiveArrayService<DNamespaceView, NamespaceService>(`dashboard::namespaces::${currentSession?.id}`, (store) => new NamespaceService(graphqlClient, store))
66-
const runtime = usePersistentReactiveArrayService<DRuntimeView, RuntimeService>(`dashboard::global_runtimes::${currentSession?.id}`, (store) => new RuntimeService(graphqlClient, store))
67-
const project = usePersistentReactiveArrayService<DNamespaceProjectView, ProjectService>(`dashboard::projects::${currentSession?.id}`, (store) => new ProjectService(graphqlClient, store))
68-
const role = usePersistentReactiveArrayService<DNamespaceRoleView, RoleService>(`dashboard::roles::${currentSession?.id}`, (store) => new RoleService(graphqlClient, store))
62+
const user = usePersistentReactiveArrayService<UserView, UserService>(`dashboard::users::${currentSession?.id}`, (store) => new UserService(graphqlClient, store))
63+
const organization = usePersistentReactiveArrayService<OrganizationView, OrganizationService>(`dashboard::organizations::${currentSession?.id}`, (store) => new OrganizationService(graphqlClient, store))
64+
const member = usePersistentReactiveArrayService<MemberView, MemberService>(`dashboard::members::${currentSession?.id}`, (store) => new MemberService(graphqlClient, store))
65+
const namespace = usePersistentReactiveArrayService<NamespaceView, NamespaceService>(`dashboard::namespaces::${currentSession?.id}`, (store) => new NamespaceService(graphqlClient, store))
66+
const runtime = usePersistentReactiveArrayService<RuntimeView, RuntimeService>(`dashboard::global_runtimes::${currentSession?.id}`, (store) => new RuntimeService(graphqlClient, store))
67+
const project = usePersistentReactiveArrayService<ProjectView, ProjectService>(`dashboard::projects::${currentSession?.id}`, (store) => new ProjectService(graphqlClient, store))
68+
const role = usePersistentReactiveArrayService<RoleView, RoleService>(`dashboard::roles::${currentSession?.id}`, (store) => new RoleService(graphqlClient, store))
6969
const flow = usePersistentReactiveArrayService<Flow, FlowService>(`dashboard::flows::${currentSession?.id}`, (store) => new FlowService(graphqlClient, store))
70-
const functions = usePersistentReactiveArrayService<FunctionDefinitionView, FunctionService>(`dashboard::functions::${currentSession?.id}`, (store) => new FunctionService(graphqlClient, store))
70+
const functions = usePersistentReactiveArrayService<FunctionView, FunctionService>(`dashboard::functions::${currentSession?.id}`, (store) => new FunctionService(graphqlClient, store))
7171
const datatype = usePersistentReactiveArrayService<DataTypeView, DatatypeService>(`dashboard::datatypes::${currentSession?.id}`, (store) => new DatatypeService(graphqlClient, store))
7272
const flowtype = usePersistentReactiveArrayService<FlowTypeView, FlowTypeService>(`dashboard::flowtypes::${currentSession?.id}`, (store) => new FlowTypeService(graphqlClient, store))
7373
const file = usePersistentReactiveArrayService<FileTabsView, FileTabsService>(`dashboard::files::${flowId}`, FileTabsService, [])
@@ -86,7 +86,7 @@ export default function Layout({bar, tab, children}: {
8686

8787
return <ContextStoreProvider
8888
services={[user, organization, member, namespace, runtime, project, role, flow, functions, datatype, flowtype, file]}>
89-
<DLayout layoutGap={0} style={{zIndex: 0}} showLayoutSplitter={false} leftContent={
89+
<Layout layoutGap={0} style={{zIndex: 0}} showLayoutSplitter={false} leftContent={
9090
<Flex p={0.7} pt={1} align={"center"} style={{flexDirection: "column", gap: "0.7rem"}}>
9191
<div style={{
9292
position: "absolute",
@@ -114,13 +114,13 @@ export default function Layout({bar, tab, children}: {
114114
{tab}
115115
</Flex>
116116
}>
117-
<DLayout px={0.7} layoutGap={"0"} topContent={<>{bar}</>}>
118-
<DLayout>
117+
<Layout px={0.7} layoutGap={"0"} topContent={<>{bar}</>}>
118+
<Layout>
119119
<>
120120
{children}
121121
</>
122-
</DLayout>
123-
</DLayout>
124-
</DLayout>
122+
</Layout>
123+
</Layout>
124+
</Layout>
125125
</ContextStoreProvider>
126126
}

0 commit comments

Comments
 (0)