Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new repo list/detail routes behind flag #18918

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions components/dashboard/src/app/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import PersonalAccessTokenCreateView from "../user-settings/PersonalAccessTokens
import { CreateWorkspacePage } from "../workspaces/CreateWorkspacePage";
import { WebsocketClients } from "./WebsocketClients";
import { BlockedEmailDomains } from "../admin/BlockedEmailDomains";
import { useFeatureFlag } from "../data/featureflag-query";

const Workspaces = React.lazy(() => import(/* webpackPrefetch: true */ "../workspaces/Workspaces"));
const Account = React.lazy(() => import(/* webpackPrefetch: true */ "../user-settings/Account"));
Expand Down Expand Up @@ -75,12 +76,17 @@ const WorkspacesSearch = React.lazy(() => import(/* webpackPrefetch: true */ "..
const ProjectsSearch = React.lazy(() => import(/* webpackPrefetch: true */ "../admin/ProjectsSearch"));
const TeamsSearch = React.lazy(() => import(/* webpackPrefetch: true */ "../admin/TeamsSearch"));
const Usage = React.lazy(() => import(/* webpackPrefetch: true */ "../Usage"));
const RepositoryListPage = React.lazy(() => import(/* webpackPrefetch: true */ "../repositories/list/RepositoryList"));
const RepositoryDetailPage = React.lazy(
() => import(/* webpackPrefetch: true */ "../repositories/detail/RepositoryDetail"),
);

export const AppRoutes = () => {
const hash = getURLHash();
const user = useCurrentUser();
const [isWhatsNewShown, setWhatsNewShown] = useState(user && shouldSeeWhatsNew(user));
const location = useLocation();
const repoConfigListAndDetail = useFeatureFlag("repoConfigListAndDetail");

// TODO: Add a Route for this instead of inspecting location manually
if (location.pathname.startsWith("/blocked")) {
Expand Down Expand Up @@ -207,6 +213,13 @@ export const AppRoutes = () => {
<Route exact path={`/projects/:projectSlug/settings`} component={ProjectSettings} />
<Route exact path={`/projects/:projectSlug/variables`} component={ProjectVariables} />
<Route exact path={`/projects/:projectSlug/:prebuildId`} component={Prebuild} />

{repoConfigListAndDetail && (
<>
<Route exact path="/repositories" component={RepositoryListPage} />
<Route exact path="/repositories/:id" component={RepositoryDetailPage} />
</>
)}
{/* basic redirect for old team slugs */}
<Route path={["/t/"]} exact>
<Redirect to="/projects" />
Expand Down
1 change: 1 addition & 0 deletions components/dashboard/src/data/featureflag-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const featureFlags = {
newProjectIncrementalRepoSearchBBS: false,
includeProjectsOnCreateWorkspace: false,
repositoryFinderSearch: false,
repoConfigListAndDetail: false,
};

type FeatureFlags = typeof featureFlags;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright (c) 2023 Gitpod GmbH. All rights reserved.
* Licensed under the GNU Affero General Public License (AGPL).
* See License.AGPL.txt in the project root for license information.
*/

import { FC } from "react";
import Header from "../../components/Header";
import { useParams } from "react-router";

type PageRouteParams = {
id: string;
};
const RepositoryDetailPage: FC = () => {
const { id } = useParams<PageRouteParams>();

return (
<>
<Header title="Repository Detail" subtitle="" />
<div className="app-container">
<span>id: {id}</span>
</div>
</>
);
};

export default RepositoryDetailPage;
18 changes: 18 additions & 0 deletions components/dashboard/src/repositories/list/RepositoryList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright (c) 2023 Gitpod GmbH. All rights reserved.
* Licensed under the GNU Affero General Public License (AGPL).
* See License.AGPL.txt in the project root for license information.
*/

import { FC } from "react";
import Header from "../../components/Header";

const RepositoryListPage: FC = () => {
return (
<>
<Header title="Repositories" subtitle="" />
</>
);
};

export default RepositoryListPage;
Loading