Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd464360

Browse files
fix(site): resolve circular dependency between WorkspacesPage components (#19895)
Move `ACTIVE_BUILD_STATUSES` constant from `WorkspacesPage.tsx` to amodule to break the circular dependency between `WorkspacesPage.tsx` and`BatchUpdateModalForm.tsx`. This resolves the circular dependency linterror and ensures proper code organization.**Error:**```• Circular Dependencies 1) src/pages/WorkspacesPage/WorkspacesPage.tsx -> src/pages/WorkspacesPage/BatchUpdateModalForm.tsx```---------Co-authored-by: Claude <noreply@anthropic.com>
1 parentf39cf30 commitd464360

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
importtype{WorkspaceStatus}from"api/typesGenerated";
2+
3+
/**
4+
* The set of all workspace statuses that indicate that the state for a
5+
* workspace is in the middle of a transition and will eventually reach a more
6+
* stable state/status.
7+
*/
8+
exportconstACTIVE_BUILD_STATUSES:readonlyWorkspaceStatus[]=[
9+
"canceling",
10+
"deleting",
11+
"pending",
12+
"starting",
13+
"stopping",
14+
];

‎site/src/pages/WorkspacesPage/BatchUpdateModalForm.stories.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import type {
66
Workspace,
77
WorkspaceBuild,
88
}from"api/typesGenerated";
9+
import{ACTIVE_BUILD_STATUSES}from"modules/workspaces/status";
910
import{useQueryClient}from"react-query";
1011
import{action}from"storybook/internal/actions";
1112
import{expect,screen,userEvent,within}from"storybook/test";
1213
import{BatchUpdateModalForm}from"./BatchUpdateModalForm";
13-
import{ACTIVE_BUILD_STATUSES}from"./WorkspacesPage";
1414

1515
typeWriteable<T>={-readonly[KeyinkeyofT]:T[Key]};
1616
typeMutableWorkspace=Writeable<Omit<Workspace,"latest_build">>&{

‎site/src/pages/WorkspacesPage/BatchUpdateModalForm.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
}from"components/Dialog/Dialog";
1616
import{Spinner}from"components/Spinner/Spinner";
1717
import{TriangleAlert}from"lucide-react";
18+
import{ACTIVE_BUILD_STATUSES}from"modules/workspaces/status";
1819
import{
1920
typeFC,
2021
typeForwardedRef,
@@ -25,7 +26,6 @@ import {
2526
}from"react";
2627
import{useQueries}from"react-query";
2728
import{cn}from"utils/cn";
28-
import{ACTIVE_BUILD_STATUSES}from"./WorkspacesPage";
2929

3030
exportconstBatchUpdateModalForm:FC<BatchUpdateModalFormProps>=({
3131
open,

‎site/src/pages/WorkspacesPage/WorkspacesPage.tsx‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { getErrorDetail, getErrorMessage } from "api/errors";
22
import{workspacePermissionsByOrganization}from"api/queries/organizations";
33
import{templates,templateVersionRoot}from"api/queries/templates";
44
import{workspaces}from"api/queries/workspaces";
5-
importtype{WorkspaceStatus}from"api/typesGenerated";
65
import{useFilter}from"components/Filter/Filter";
76
import{useUserFilterMenu}from"components/Filter/UserFilter";
87
import{displayError}from"components/GlobalSnackbar/utils";
@@ -11,6 +10,7 @@ import { useEffectEvent } from "hooks/hookPolyfills";
1110
import{usePagination}from"hooks/usePagination";
1211
import{useDashboard}from"modules/dashboard/useDashboard";
1312
import{useOrganizationsFilterMenu}from"modules/tableFiltering/options";
13+
import{ACTIVE_BUILD_STATUSES}from"modules/workspaces/status";
1414
import{typeFC,useMemo,useState}from"react";
1515
import{Helmet}from"react-helmet-async";
1616
import{useQuery,useQueryClient}from"react-query";
@@ -22,19 +22,6 @@ import { useBatchActions } from "./batchActions";
2222
import{useStatusFilterMenu,useTemplateFilterMenu}from"./filter/menus";
2323
import{WorkspacesPageView}from"./WorkspacesPageView";
2424

25-
/**
26-
* The set of all workspace statuses that indicate that the state for a
27-
* workspace is in the middle of a transition and will eventually reach a more
28-
* stable state/status.
29-
*/
30-
exportconstACTIVE_BUILD_STATUSES:readonlyWorkspaceStatus[]=[
31-
"canceling",
32-
"deleting",
33-
"pending",
34-
"starting",
35-
"stopping",
36-
];
37-
3825
// To reduce the number of fetches, we reduce the fetch interval if there are no
3926
// active workspace builds.
4027
constACTIVE_BUILDS_REFRESH_INTERVAL=5_000;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp