Skip to content

Commit 920b943

Browse files
committed
renaming for clarity
1 parent be946b1 commit 920b943

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

components/dashboard/src/data/projects/create-project-mutation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
import { useMutation } from "@tanstack/react-query";
88
import { getGitpodService } from "../../service/service";
99
import { useCurrentOrg } from "../organizations/orgs-query";
10-
import { useRefreshProjects } from "./list-projects-query";
10+
import { useRefreshAllProjects } from "./list-all-projects-query";
1111
import { CreateProjectParams, Project } from "@gitpod/gitpod-protocol";
1212

1313
export type CreateProjectArgs = Omit<CreateProjectParams, "teamId">;
1414

1515
export const useCreateProject = () => {
16-
const refreshProjects = useRefreshProjects();
16+
const refreshProjects = useRefreshAllProjects();
1717
const { data: org } = useCurrentOrg();
1818

1919
return useMutation<Project, Error, CreateProjectArgs>(async ({ name, slug, cloneUrl, appInstallationId }) => {

components/dashboard/src/data/projects/list-projects-query.ts renamed to components/dashboard/src/data/projects/list-all-projects-query.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ import { useCallback } from "react";
1010
import { listAllProjects } from "../../service/public-api";
1111
import { useCurrentOrg } from "../organizations/orgs-query";
1212

13-
export type ListProjectsQueryResults = {
13+
export type ListAllProjectsQueryResults = {
1414
projects: Project[];
1515
};
1616

1717
export const useListAllProjectsQuery = () => {
1818
const org = useCurrentOrg().data;
1919
const orgId = org?.id;
20-
return useQuery<ListProjectsQueryResults>({
20+
return useQuery<ListAllProjectsQueryResults>({
2121
enabled: !!orgId,
22-
queryKey: getListProjectsQueryKey(orgId || ""),
22+
queryKey: getListAllProjectsQueryKey(orgId || ""),
2323
cacheTime: 1000 * 60 * 60 * 1, // 1 hour
2424
queryFn: async () => {
2525
if (!orgId) {
@@ -38,7 +38,7 @@ export const useListAllProjectsQuery = () => {
3838
};
3939

4040
// helper to force a refresh of the list projects query
41-
export const useRefreshProjects = () => {
41+
export const useRefreshAllProjects = () => {
4242
const queryClient = useQueryClient();
4343

4444
return useCallback(
@@ -49,13 +49,13 @@ export const useRefreshProjects = () => {
4949
}
5050

5151
return await queryClient.refetchQueries({
52-
queryKey: getListProjectsQueryKey(orgId),
52+
queryKey: getListAllProjectsQueryKey(orgId),
5353
});
5454
},
5555
[queryClient],
5656
);
5757
};
5858

59-
export const getListProjectsQueryKey = (orgId: string) => {
60-
return ["projects", "list", { orgId }];
59+
export const getListAllProjectsQueryKey = (orgId: string) => {
60+
return ["projects", "list-all", { orgId }];
6161
};

components/dashboard/src/projects/ProjectSettings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { RemoveProjectModal } from "./RemoveProjectModal";
1717
import SelectWorkspaceClassComponent from "../components/SelectWorkspaceClassComponent";
1818
import { TextInputField } from "../components/forms/TextInputField";
1919
import { Button } from "../components/Button";
20-
import { useRefreshProjects } from "../data/projects/list-projects-query";
20+
import { useRefreshAllProjects } from "../data/projects/list-all-projects-query";
2121
import { useToast } from "../components/toasts/Toasts";
2222
import classNames from "classnames";
2323
import { InputField } from "../components/forms/InputField";
@@ -54,7 +54,7 @@ export default function ProjectSettingsView() {
5454
}
5555
}
5656
const history = useHistory();
57-
const refreshProjects = useRefreshProjects();
57+
const refreshProjects = useRefreshAllProjects();
5858
const { toast } = useToast();
5959
const [prebuildBranchPattern, setPrebuildBranchPattern] = useState("");
6060

components/dashboard/src/projects/Projects.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Alert from "../components/Alert";
1212
import Header from "../components/Header";
1313
import { SpinnerLoader } from "../components/Loader";
1414
import { useCurrentOrg } from "../data/organizations/orgs-query";
15-
import { useListAllProjectsQuery } from "../data/projects/list-projects-query";
15+
import { useListAllProjectsQuery } from "../data/projects/list-all-projects-query";
1616
import search from "../icons/search.svg";
1717
import { Heading2 } from "../components/typography/headings";
1818
import projectsEmptyDark from "../images/projects-empty-dark.svg";

components/dashboard/src/projects/project-context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { useHistory, useLocation, useRouteMatch } from "react-router";
1010
import { useCurrentOrg, useOrganizations } from "../data/organizations/orgs-query";
1111
import { listAllProjects } from "../service/public-api";
1212
import { useCurrentUser } from "../user-context";
13-
import { useListAllProjectsQuery } from "../data/projects/list-projects-query";
13+
import { useListAllProjectsQuery } from "../data/projects/list-all-projects-query";
1414

1515
export const ProjectContext = createContext<{
1616
project?: Project;

components/dashboard/src/workspaces/CreateWorkspacePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { InputField } from "../components/forms/InputField";
2929
import { Heading1 } from "../components/typography/headings";
3030
import { useAuthProviders } from "../data/auth-providers/auth-provider-query";
3131
import { useCurrentOrg } from "../data/organizations/orgs-query";
32-
import { useListAllProjectsQuery } from "../data/projects/list-projects-query";
32+
import { useListAllProjectsQuery } from "../data/projects/list-all-projects-query";
3333
import { useCreateWorkspaceMutation } from "../data/workspaces/create-workspace-mutation";
3434
import { useListWorkspacesQuery } from "../data/workspaces/list-workspaces-query";
3535
import { useWorkspaceContext } from "../data/workspaces/resolve-context-query";

0 commit comments

Comments
 (0)