diff --git a/examples/gccd/src/components/workspace/workspaceDetailContent.ts b/examples/gccd/src/components/workspace/workspaceDetailContent.ts index 2f1bd4db..5f7d61f3 100644 --- a/examples/gccd/src/components/workspace/workspaceDetailContent.ts +++ b/examples/gccd/src/components/workspace/workspaceDetailContent.ts @@ -20,7 +20,6 @@ export default function (context: Context) { return function WorkspaceDetailContent({ data, loading }: any) { const { org_id, project_id, workspace_id } = data.val; return section( - h2("Summary"), TableContainer( table(() => loading.val diff --git a/examples/gccd/src/pages/org/orgCreatePage.ts b/examples/gccd/src/pages/org/orgCreatePage.ts index 6dd84ac4..dc15567a 100644 --- a/examples/gccd/src/pages/org/orgCreatePage.ts +++ b/examples/gccd/src/pages/org/orgCreatePage.ts @@ -10,7 +10,7 @@ import gitConfig from "../../components/git/gitConfig"; const stepperName = "wizardOrg"; export default (context: Context) => { - const { window } = context; + const { window, config } = context; const pushState = (url: string) => window.history.pushState("", "", url); @@ -78,7 +78,7 @@ export default (context: Context) => { { name: "cloud", Header: () => "Cloud Provider", - Content: ({ nextStep, previousStep }: any) => + Content: ({ previousStep }: any) => CloudCreate({ org_id: new URLSearchParams(window.location.search).get("org_id"), project_id: new URLSearchParams(window.location.search).get( @@ -90,15 +90,10 @@ export default (context: Context) => { previousHref: nextUrl(previousStep.name), onSubmitted: ({ org_id, project_id, workspace_id }: any) => pushState( - nextUrl(nextStep.name, { org_id, project_id, workspace_id }) + `${config.base}/org/${org_id}/projects/${project_id}/workspaces/${workspace_id}/` ), }), }, - { - name: "review", - Header: () => "Review", - Content: ({}: any) => "Review", - }, ]; return Stepper({ stepperDefs, stepperName }); diff --git a/examples/gccd/src/pages/project/projectCreatePage.ts b/examples/gccd/src/pages/project/projectCreatePage.ts index 7d2d127b..00abd15c 100644 --- a/examples/gccd/src/pages/project/projectCreatePage.ts +++ b/examples/gccd/src/pages/project/projectCreatePage.ts @@ -9,7 +9,7 @@ import cloudCreate from "../../components/cloudAuthentication/cloudCreate"; const stepperName = "wizardProject"; export default (context: Context) => { - const { window } = context; + const { window, config } = context; const pushState = (url: string) => window.history.pushState("", "", url); @@ -67,7 +67,7 @@ export default (context: Context) => { { name: "cloud", Header: () => "Cloud Provider", - Content: ({ nextStep, previousStep }: any) => + Content: ({ previousStep }: any) => CloudCreate({ org_id, project_id: new URLSearchParams(window.location.search).get( @@ -79,16 +79,10 @@ export default (context: Context) => { previousHref: nextUrl(previousStep.name), onSubmitted: ({ org_id, project_id, workspace_id }: any) => pushState( - nextUrl(nextStep.name, { org_id, project_id, workspace_id }) + `${config.base}/org/${org_id}/projects/${project_id}/workspaces/${workspace_id}/` ), }), }, - - { - name: "review", - Header: () => "Review", - Content: ({}: any) => "Review", - }, ]; return Stepper({ stepperDefs, stepperName }); diff --git a/examples/gccd/src/pages/workspace/workspaceCreatePage.ts b/examples/gccd/src/pages/workspace/workspaceCreatePage.ts index 46cba929..0356d477 100644 --- a/examples/gccd/src/pages/workspace/workspaceCreatePage.ts +++ b/examples/gccd/src/pages/workspace/workspaceCreatePage.ts @@ -7,7 +7,7 @@ import cloudCreate from "../../components/cloudAuthentication/cloudCreate"; const stepperName = "wizardWorkspace"; export default (context: Context) => { - const { window } = context; + const { window, config } = context; const pushState = (url: string) => window.history.pushState("", "", url); @@ -39,7 +39,7 @@ export default (context: Context) => { { name: "cloud", Header: () => "Cloud Provider", - Content: ({ nextStep, previousStep }: any) => + Content: ({ previousStep }: any) => CloudCreate({ org_id, project_id, @@ -49,15 +49,10 @@ export default (context: Context) => { previousHref: nextUrl(previousStep.name), onSubmitted: ({ org_id, project_id, workspace_id }: any) => pushState( - nextUrl(nextStep.name, { org_id, project_id, workspace_id }) + `${config.base}/org/${org_id}/projects/${project_id}/workspaces/${workspace_id}/` ), }), }, - { - name: "review", - Header: () => "Review", - Content: ({}: any) => "Review", - }, ]; return Stepper({ stepperDefs, stepperName }); diff --git a/examples/gccd/src/pages/workspace/workspaceDetailPage.ts b/examples/gccd/src/pages/workspace/workspaceDetailPage.ts index 714ebf48..1c6171d5 100644 --- a/examples/gccd/src/pages/workspace/workspaceDetailPage.ts +++ b/examples/gccd/src/pages/workspace/workspaceDetailPage.ts @@ -4,18 +4,16 @@ import button from "@grucloud/bau-ui/button"; import dropdownMenu from "@grucloud/bau-ui/dropdownMenu"; import tabs, { Tabs } from "@grucloud/bau-ui/tabs"; -import page from "../../components/page"; import workspaceDetailContent from "../../components/workspace/workspaceDetailContent"; import runList from "../../components/run/runList"; import cloudAuthenticationList from "../../components/cloudAuthentication/cloudAuthenticationList"; export default function (context: Context) { const { bau, stores, config, css } = context; - const { div, h2, header, a, section } = bau.tags; + const { h2, p, header, a, section, strong } = bau.tags; const { getByIdQuery } = stores.workspace; const DropdownMenu = dropdownMenu(context); - const Page = page(context); const Form = form(context); const ButtonAdd = button(context, { color: "primary", @@ -38,27 +36,10 @@ export default function (context: Context) { }); const tabDefs: Tabs = [ - { - name: "summary", - Header: () => "Workspace Summary", - Content: () => - section(header(), () => WorkspaceDetailContent(getByIdQuery)), - }, { name: "runs", Header: () => "Runs", - Content: () => - section( - div( - ButtonAdd( - { - href: `${config.base}/org/${org_id}/projects/${project_id}/workspaces/${workspace_id}/runs/create`, - }, - "+ New Run" - ) - ), - RunList(stores.run.getAllByWorkspaceQuery) - ), + Content: () => section(RunList(stores.run.getAllByWorkspaceQuery)), }, { name: "cloudAuthentication", @@ -77,6 +58,12 @@ export default function (context: Context) { ) ), }, + { + name: "summary", + Header: () => "Workspace Details", + Content: () => + section(header(), () => WorkspaceDetailContent(getByIdQuery)), + }, ]; const Tabs = tabs(context, { tabDefs, variant: "plain", color: "neutral" }); @@ -108,6 +95,28 @@ export default function (context: Context) { option.text ); - return Page(Form(Tabs(props))); + return Form( + h2("Workspace"), + p( + "Workspace ", + strong(workspace_id), + " in project ", + a( + { href: `${config.base}/org/${org_id}/projects/${project_id}` }, + project_id + ), + " of organisation ", + a({ href: `${config.base}/org/${org_id}` }, org_id) + ), + p( + ButtonAdd( + { + href: `${config.base}/org/${org_id}/projects/${project_id}/workspaces/${workspace_id}/runs/create`, + }, + "+ New Run" + ) + ), + Tabs(props) + ); }; }