refactor(types): rename AppType to AppId for semantic clarity
Rename `AppType` to `AppId` across the entire frontend codebase to better reflect its purpose as an application identifier rather than a type category. This aligns frontend naming with backend command parameter conventions. Changes: - Rename type `AppType` to `AppId` in src/lib/api/types.ts - Remove `AppType` export from src/lib/api/index.ts - Update all component props from `appType` to `appId` (43 files) - Update all variable names from `appType` to `appId` - Synchronize documentation (CHANGELOG, refactoring plans) - Update test files and MSW mocks BREAKING CHANGE: `AppType` type is no longer exported. Use `AppId` instead. All component props have been renamed from `appType` to `appId`.
This commit is contained in:
@@ -41,13 +41,13 @@ vi.mock("@/components/providers/ProviderList", () => ({
|
||||
}));
|
||||
|
||||
vi.mock("@/components/providers/AddProviderDialog", () => ({
|
||||
AddProviderDialog: ({ open, onOpenChange, onSubmit, appType }: any) =>
|
||||
AddProviderDialog: ({ open, onOpenChange, onSubmit, appId }: any) =>
|
||||
open ? (
|
||||
<div data-testid="add-provider-dialog">
|
||||
<button
|
||||
onClick={() =>
|
||||
onSubmit({
|
||||
name: `New ${appType} Provider`,
|
||||
name: `New ${appId} Provider`,
|
||||
settingsConfig: {},
|
||||
category: "custom",
|
||||
sortIndex: 99,
|
||||
|
||||
@@ -139,7 +139,7 @@ const renderPanel = (props?: Partial<React.ComponentProps<typeof McpPanel>>) =>
|
||||
const client = createTestQueryClient();
|
||||
return render(
|
||||
<QueryClientProvider client={client}>
|
||||
<McpPanel open onOpenChange={() => {}} appType="claude" {...props} />
|
||||
<McpPanel open onOpenChange={() => {}} appId="claude" {...props} />
|
||||
</QueryClientProvider>,
|
||||
);
|
||||
};
|
||||
@@ -229,4 +229,3 @@ describe("McpPanel integration", () => {
|
||||
await waitFor(() => expect(deleteServerMock).toHaveBeenCalledWith("sample"));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user