Skip to content

Commit 7628557

Browse files
Copilothotlong
andcommitted
Address code review: improve variable naming and error messages
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 003aca6 commit 7628557

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

apps/console/src/App.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { BrowserRouter, Routes, Route, Navigate, useNavigate, useLocation, useSearchParams } from 'react-router-dom';
22
import { useState, useEffect, lazy, Suspense, useMemo, type ReactNode } from 'react';
33
import { ObjectForm } from '@object-ui/plugin-form';
4-
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Empty, EmptyTitle } from '@object-ui/components';
4+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Empty, EmptyTitle, EmptyDescription } from '@object-ui/components';
55
import { toast } from 'sonner';
66
import { SchemaRendererProvider } from '@object-ui/react';
77
import type { ConnectionState } from './dataSource';
@@ -380,6 +380,9 @@ function RootRedirect() {
380380
<div className="h-screen flex items-center justify-center">
381381
<Empty>
382382
<EmptyTitle>{error ? 'Failed to Load Configuration' : 'No Apps Configured'}</EmptyTitle>
383+
<EmptyDescription>
384+
{error ? error.message : 'No applications have been registered. Check your ObjectStack configuration.'}
385+
</EmptyDescription>
383386
</Empty>
384387
</div>
385388
);

apps/console/src/mocks/handlers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ export function createHandlers(baseUrl: string, kernel: ObjectKernel, driver: In
5454
// routes (/meta/apps, /meta/objects, …) for backward compatibility.
5555
// A single dynamic handler covers both forms.
5656
http.get(`${prefix}${baseUrl}/meta/:type`, async ({ params }) => {
57-
const raw = params.type as string;
58-
const response = await protocol.getMetaItems({ type: raw });
57+
const metadataType = params.type as string;
58+
const response = await protocol.getMetaItems({ type: metadataType });
5959
return HttpResponse.json(response, { status: 200 });
6060
}),
6161
http.get(`${prefix}${baseUrl}/metadata/:type`, async ({ params }) => {
62-
const raw = params.type as string;
63-
const response = await protocol.getMetaItems({ type: raw });
62+
const metadataType = params.type as string;
63+
const response = await protocol.getMetaItems({ type: metadataType });
6464
return HttpResponse.json(response, { status: 200 });
6565
}),
6666

0 commit comments

Comments
 (0)