@shipfox/client-config 17.0.0 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +13 -0
- package/dist/config-error-screen.d.ts.map +1 -1
- package/dist/config-error-screen.js +29 -22
- package/dist/config-error-screen.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/config-error-screen.test.tsx +7 -1
- package/src/config-error-screen.tsx +20 -18
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipfox/client-config",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "21.0.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/ShipfoxHQ/shipfox.git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@swc/helpers": "^0.5.17",
|
|
21
|
-
"@shipfox/react-ui": "
|
|
21
|
+
"@shipfox/react-ui": "2.0.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^19.0.0",
|
|
@@ -20,12 +20,18 @@ describe('ConfigErrorScreen', () => {
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
it('renders the docs link only when a url is given', () => {
|
|
23
|
-
const {rerender} = render(<ConfigErrorScreen errors={[apiUrlError]} />);
|
|
23
|
+
const {container, rerender} = render(<ConfigErrorScreen errors={[apiUrlError]} />);
|
|
24
24
|
|
|
25
25
|
expect(screen.queryByRole('link')).toBeNull();
|
|
26
26
|
|
|
27
27
|
rerender(<ConfigErrorScreen errors={[apiUrlError]} docsUrl="https://docs.shipfox.io/config" />);
|
|
28
28
|
|
|
29
29
|
expect(screen.getByRole('link')).toHaveAttribute('href', 'https://docs.shipfox.io/config');
|
|
30
|
+
expect(container.querySelector('[data-slot="panel"]')).toHaveClass('gap-group');
|
|
31
|
+
expect(container.querySelector('[data-slot="panel-body"]')).toHaveClass('flex', 'flex-col');
|
|
32
|
+
expect(container.querySelector('[data-slot="panel-body"] > div')).toHaveClass(
|
|
33
|
+
'px-row',
|
|
34
|
+
'py-row',
|
|
35
|
+
);
|
|
30
36
|
});
|
|
31
37
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {ButtonLink} from '@shipfox/react-ui/button';
|
|
2
|
-
import {Card, CardContent, CardDescription, CardHeader, CardTitle} from '@shipfox/react-ui/card';
|
|
3
2
|
import {Icon} from '@shipfox/react-ui/icon';
|
|
3
|
+
import {Panel, PanelBody, PanelHeader, PanelTitle} from '@shipfox/react-ui/panel';
|
|
4
4
|
import {Code, Text} from '@shipfox/react-ui/typography';
|
|
5
5
|
import type {ConfigKeyError} from './load-config.js';
|
|
6
6
|
|
|
@@ -22,23 +22,23 @@ export interface ConfigErrorScreenProps {
|
|
|
22
22
|
export function ConfigErrorScreen({errors, docsUrl}: ConfigErrorScreenProps) {
|
|
23
23
|
return (
|
|
24
24
|
<main className="flex min-h-screen items-center justify-center bg-background-subtle-base px-frame py-frame">
|
|
25
|
-
<
|
|
26
|
-
<
|
|
25
|
+
<Panel className="w-full max-w-[512px] gap-group">
|
|
26
|
+
<PanelHeader variant="plain" className="flex-col items-start gap-inline">
|
|
27
27
|
<div className="flex items-center gap-inline">
|
|
28
28
|
<Icon name="errorWarningLine" className="size-20 text-tag-error-icon" />
|
|
29
|
-
<
|
|
29
|
+
<PanelTitle variant="h2">Configuration error</PanelTitle>
|
|
30
30
|
</div>
|
|
31
|
-
<
|
|
31
|
+
<Text size="sm" className="text-foreground-neutral-muted">
|
|
32
32
|
The Shipfox client could not start because its configuration is missing or invalid. Set
|
|
33
33
|
the environment variables below and restart the container.
|
|
34
|
-
</
|
|
35
|
-
</
|
|
34
|
+
</Text>
|
|
35
|
+
</PanelHeader>
|
|
36
36
|
|
|
37
|
-
<
|
|
37
|
+
<PanelBody className="flex flex-col">
|
|
38
38
|
{errors.map((error) => (
|
|
39
39
|
<div
|
|
40
40
|
key={error.key}
|
|
41
|
-
className="flex flex-col gap-tight border-t border-border-neutral-base py-row first:border-t-0 first:pt-0"
|
|
41
|
+
className="flex flex-col gap-tight border-t border-border-neutral-base px-row py-row first:border-t-0 first:pt-0"
|
|
42
42
|
>
|
|
43
43
|
<Code variant="label" bold className="text-foreground-neutral-base">
|
|
44
44
|
{error.key}
|
|
@@ -64,18 +64,20 @@ export function ConfigErrorScreen({errors, docsUrl}: ConfigErrorScreenProps) {
|
|
|
64
64
|
</Text>
|
|
65
65
|
</div>
|
|
66
66
|
))}
|
|
67
|
-
</
|
|
67
|
+
</PanelBody>
|
|
68
68
|
|
|
69
69
|
{docsUrl ? (
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
<div className="p-panel pt-0">
|
|
71
|
+
<Text size="sm" className="text-foreground-neutral-muted">
|
|
72
|
+
See the{' '}
|
|
73
|
+
<ButtonLink href={docsUrl} variant="interactive" underline>
|
|
74
|
+
self-hosting configuration guide
|
|
75
|
+
</ButtonLink>
|
|
76
|
+
.
|
|
77
|
+
</Text>
|
|
78
|
+
</div>
|
|
77
79
|
) : null}
|
|
78
|
-
</
|
|
80
|
+
</Panel>
|
|
79
81
|
</main>
|
|
80
82
|
);
|
|
81
83
|
}
|