Skip to content

Commit 0f0c729

Browse files
committed
progress
1 parent b4a4dc6 commit 0f0c729

17 files changed

Lines changed: 91 additions & 152 deletions

File tree

e2e/dogfooding.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ test('DOG FOODING TIME - Create a service that uses the StackCraft GitHub reposi
1010
const stackName = `e2e-dog-fooding-time-${uuid}`
1111
const displayName = `E2E DOG FOODING Stack - ${browserName} - ${uuid}`
1212
const description = `
13-
### 🐶🦴 E2E - IT'S DOG FOODING TIME 🐶🦴
14-
This stack is used to test the dogfooding of the StackCraft application.
15-
It is used to test the following features:
13+
### 🐶🦴 E2E - IT'S DOG FOODING TIME 🐶🦴
14+
15+
This stack is used to test the dogfooding of the StackCraft application.
16+
It is used to test the following features:
1617
- Creating a stack
1718
- Creating a service that uses the StackCraft GitHub repository
1819
- Cloning, installing, building and running the service
1920
20-
### Test Steps
21+
### Test Steps
22+
2123
1. Create a stack
2224
2. Create a service that uses the StackCraft GitHub repository
2325
3. Clone, install, build and run the service

frontend/src/components/entity-forms/github-repo-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createComponent, Shade } from '@furystack/shades'
2-
import { Button, Form, Icon, icons, Input, MarkdownInput } from '@furystack/shades-common-components'
2+
import { Button, Form, Icon, icons, Input, MarkdownEditor } from '@furystack/shades-common-components'
33
import type { GitHubRepository } from 'common'
44

55
import { StackCraftNestedRouteLink } from '../app-routes.js'
@@ -57,7 +57,7 @@ export const GitHubRepoForm = Shade<GitHubRepoFormProps>({
5757
required
5858
value={props.initial?.displayName ?? ''}
5959
/>
60-
<MarkdownInput name="description" labelTitle="Description" value={props.initial?.description ?? ''} rows={4} />
60+
<MarkdownEditor name="description" labelTitle="Description" value={props.initial?.description ?? ''} rows={4} />
6161
<div style={{ display: 'flex', gap: '8px', justifyContent: 'flex-end' }}>
6262
{props.cancelHref ? (
6363
<StackCraftNestedRouteLink href={props.cancelHref as '/'}>

frontend/src/components/entity-forms/prerequisite-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createComponent, Shade } from '@furystack/shades'
2-
import { Button, Form, Icon, icons, Input, MarkdownInput, Select } from '@furystack/shades-common-components'
2+
import { Button, Form, Icon, icons, Input, MarkdownEditor, Select } from '@furystack/shades-common-components'
33
import type { Prerequisite, PrerequisiteConfig, PrerequisiteType } from 'common'
44

55
type PrerequisiteFormPayload = {
@@ -186,7 +186,7 @@ export const PrerequisiteForm = Shade<PrerequisiteFormProps>({
186186
/>
187187
)}
188188

189-
<MarkdownInput
189+
<MarkdownEditor
190190
name="installationHelp"
191191
labelTitle="Installation Help"
192192
value={props.initial?.installationHelp ?? ''}

frontend/src/components/entity-forms/service-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
Icon,
88
icons,
99
Input,
10-
MarkdownInput,
10+
MarkdownEditor,
1111
Paper,
1212
Select,
1313
} from '@furystack/shades-common-components'
@@ -119,7 +119,7 @@ export const ServiceForm = Shade<ServiceFormProps>({
119119
required
120120
value={props.initial?.displayName ?? ''}
121121
/>
122-
<MarkdownInput
122+
<MarkdownEditor
123123
name="description"
124124
labelTitle="Description"
125125
value={props.initial?.description ?? ''}

frontend/src/components/entity-forms/stack-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createComponent, Shade } from '@furystack/shades'
2-
import { Button, Form, Icon, icons, Input, MarkdownInput } from '@furystack/shades-common-components'
2+
import { Button, Form, Icon, icons, Input, MarkdownEditor } from '@furystack/shades-common-components'
33
import type { StackView } from 'common'
44

55
import { StackCraftNestedRouteLink } from '../app-routes.js'
@@ -60,7 +60,7 @@ export const StackForm = Shade<StackFormProps>({
6060
required
6161
value={props.initial?.displayName ?? ''}
6262
/>
63-
<MarkdownInput name="description" labelTitle="Description" value={props.initial?.description ?? ''} rows={4} />
63+
<MarkdownEditor name="description" labelTitle="Description" value={props.initial?.description ?? ''} rows={4} />
6464

6565
<h4 style={{ margin: '0', opacity: '0.7' }}>Configuration</h4>
6666
<Input

frontend/src/components/layout.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,28 +80,28 @@ const AuthenticatedLayout = Shade({
8080
const syncProtocol = serviceUrl.protocol === 'https:' ? 'wss:' : 'ws:'
8181
const syncWsUrl = `${syncProtocol}//${serviceUrl.host}/api/ws`
8282

83-
const authenticatedInjector = useDisposable('authenticatedInjector', () => {
84-
const child = injector.createChild()
85-
child.setExplicitInstance(new EntitySyncService({ wsUrl: syncWsUrl }), EntitySyncService)
86-
return child
83+
useDisposable('entitySyncService', () => {
84+
const service = new EntitySyncService({ wsUrl: syncWsUrl })
85+
injector.setExplicitInstance(service, EntitySyncService)
86+
return service
8787
})
8888

8989
return (
9090
<PageLayout
9191
appBar={{
9292
variant: 'permanent',
93-
component: <Header title="StackCraft" injector={authenticatedInjector} />,
93+
component: <Header title="StackCraft" />,
9494
}}
9595
drawer={{
9696
left: {
9797
variant: 'collapsible',
9898
width: '220px',
99-
component: <Sidebar injector={authenticatedInjector} />,
99+
component: <Sidebar />,
100100
collapseOnBreakpoint: 'md',
101101
},
102102
}}
103103
>
104-
<Body injector={authenticatedInjector} style={{ width: '100%', height: '100%', overflow: 'auto' }} />
104+
<Body style={{ width: '100%', height: '100%', overflow: 'auto' }} />
105105
</PageLayout>
106106
)
107107
},

frontend/src/components/service-table.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
DataGrid,
1212
Icon,
1313
icons,
14+
MarkdownDisplay,
1415
SelectionCell,
1516
} from '@furystack/shades-common-components'
1617
import type { PrerequisiteCheckStatus, ServiceView } from 'common'
@@ -105,7 +106,7 @@ export const ServiceTable = Shade<ServiceTableProps>({
105106
<strong>{entry.displayName}</strong>
106107
{entry.description ? (
107108
<div style={{ fontSize: cssVariableTheme.typography.fontSize.sm, opacity: '0.6', marginTop: '2px' }}>
108-
{entry.description}
109+
<MarkdownDisplay content={entry.description} />
109110
</div>
110111
) : null}
111112
{summary ? (

frontend/src/pages/dashboard/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ export const Dashboard = Shade<DashboardProps>({
9292
<Icon icon={icons.chevronRight} size="small" />
9393
</div>
9494
{stack.description ? (
95-
<p
95+
<div
9696
style={{
97-
margin: '8px 0 0',
97+
marginTop: '8px',
9898
fontSize: cssVariableTheme.typography.fontSize.md,
9999
color: cssVariableTheme.text.secondary,
100100
}}
101101
>
102-
{stack.description}
103-
</p>
102+
<MarkdownDisplay content={stack.description} />
103+
</div>
104104
) : null}
105105
</Paper>
106106
</StackCraftNestedRouteLink>

frontend/src/pages/import-export/export-stack.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ export const ExportStack = Shade<ExportStackProps>({
4343
icon="📤"
4444
title="Export Stack"
4545
description="Copy the JSON below and share it with other developers to quickly set up the same stack."
46-
actions={
47-
<Button
48-
variant="outlined"
49-
onclick={() => history.back()}
50-
startIcon={<Icon icon={icons.chevronLeft} size="small" />}
51-
>
52-
Back
53-
</Button>
54-
}
5546
/>
5647
<Paper>
5748
{isLoading ? (

frontend/src/pages/repositories/edit-repository.tsx

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
} from '@furystack/shades-common-components'
1515
import type { GitHubRepository } from 'common'
1616
import { GitHubRepository as GitHubRepositoryModel } from 'common'
17-
import { StackCraftNestedRouteLink, stackCraftNavigate } from '../../components/app-routes.js'
17+
import { stackCraftNavigate } from '../../components/app-routes.js'
1818
import { GitHubRepoForm } from '../../components/entity-forms/github-repo-form.js'
1919
import { GitHubReposApiClient } from '../../services/api-clients/github-repos-api-client.js'
2020

@@ -44,17 +44,7 @@ export const EditRepository = Shade<EditRepositoryProps>({
4444
if (repoState.status === 'error') {
4545
return (
4646
<PageContainer>
47-
<PageHeader
48-
title="Error loading repository"
49-
description={repoState.error}
50-
actions={
51-
<StackCraftNestedRouteLink href="/stacks/:stackName/repositories" params={{ stackName: props.stackName }}>
52-
<Button variant="outlined" startIcon={<Icon icon={icons.chevronLeft} size="small" />}>
53-
Back
54-
</Button>
55-
</StackCraftNestedRouteLink>
56-
}
57-
/>
47+
<PageHeader title="Error loading repository" description={repoState.error} />
5848
</PageContainer>
5949
)
6050
}
@@ -63,16 +53,7 @@ export const EditRepository = Shade<EditRepositoryProps>({
6353
if (!repo) {
6454
return (
6555
<PageContainer>
66-
<PageHeader
67-
title="Repository not found"
68-
actions={
69-
<StackCraftNestedRouteLink href="/stacks/:stackName/repositories" params={{ stackName: props.stackName }}>
70-
<Button variant="outlined" startIcon={<Icon icon={icons.chevronLeft} size="small" />}>
71-
Back
72-
</Button>
73-
</StackCraftNestedRouteLink>
74-
}
75-
/>
56+
<PageHeader title="Repository not found" />
7657
</PageContainer>
7758
)
7859
}
@@ -136,22 +117,16 @@ export const EditRepository = Shade<EditRepositoryProps>({
136117
<PageHeader
137118
title={`Edit: ${repo.displayName}`}
138119
actions={
139-
<div style={{ display: 'flex', gap: '8px' }}>
140-
<StackCraftNestedRouteLink href="/stacks/:stackName/repositories" params={{ stackName: repo.stackName }}>
141-
<Button variant="outlined" startIcon={<Icon icon={icons.chevronLeft} size="small" />}>
142-
Back
143-
</Button>
144-
</StackCraftNestedRouteLink>
145-
<Button
146-
variant="outlined"
147-
color="error"
148-
loading={isDeleting}
149-
onclick={() => setIsConfirmingDelete(true)}
150-
startIcon={<Icon icon={icons.trash} size="small" />}
151-
>
152-
Delete
153-
</Button>
154-
</div>
120+
<Button
121+
variant="outlined"
122+
size="small"
123+
color="error"
124+
loading={isDeleting}
125+
onclick={() => setIsConfirmingDelete(true)}
126+
startIcon={<Icon icon={icons.trash} size="small" />}
127+
>
128+
Delete
129+
</Button>
155130
}
156131
/>
157132
<Paper>

0 commit comments

Comments
 (0)