Skip to content

Commit

Permalink
no more Review
Browse files Browse the repository at this point in the history
  • Loading branch information
FredericHeem committed Dec 6, 2023
1 parent 32b1401 commit 219340c
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 3 additions & 8 deletions examples/gccd/src/pages/org/orgCreatePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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(
Expand All @@ -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 });
Expand Down
12 changes: 3 additions & 9 deletions examples/gccd/src/pages/project/projectCreatePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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(
Expand All @@ -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 });
Expand Down
11 changes: 3 additions & 8 deletions examples/gccd/src/pages/workspace/workspaceCreatePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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,
Expand All @@ -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 });
Expand Down
53 changes: 31 additions & 22 deletions examples/gccd/src/pages/workspace/workspaceDetailPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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" });
Expand Down Expand Up @@ -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)
);
};
}

0 comments on commit 219340c

Please sign in to comment.