Initial commit: Plane
Some checks failed
Branch Build CE / Build Setup (push) Has been cancelled
Branch Build CE / Build-Push Admin Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Web Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Space Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Live Collaboration Docker Image (push) Has been cancelled
Branch Build CE / Build-Push API Server Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Proxy Docker Image (push) Has been cancelled
Branch Build CE / Build-Push AIO Docker Image (push) Has been cancelled
Branch Build CE / Upload Build Assets (push) Has been cancelled
Branch Build CE / Build Release (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Sync Repositories / sync_changes (push) Has been cancelled
Some checks failed
Branch Build CE / Build Setup (push) Has been cancelled
Branch Build CE / Build-Push Admin Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Web Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Space Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Live Collaboration Docker Image (push) Has been cancelled
Branch Build CE / Build-Push API Server Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Proxy Docker Image (push) Has been cancelled
Branch Build CE / Build-Push AIO Docker Image (push) Has been cancelled
Branch Build CE / Upload Build Assets (push) Has been cancelled
Branch Build CE / Build Release (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Sync Repositories / sync_changes (push) Has been cancelled
Synced from upstream: 8853637e981ed7d8a6cff32bd98e7afe20f54362
This commit is contained in:
53
apps/space/app/[workspaceSlug]/[projectId]/page.tsx
Normal file
53
apps/space/app/[workspaceSlug]/[projectId]/page.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
"use client";
|
||||
|
||||
import { redirect } from "react-router";
|
||||
// plane imports
|
||||
import { SitesProjectPublishService } from "@plane/services";
|
||||
import type { TProjectPublishSettings } from "@plane/types";
|
||||
// components
|
||||
import { LogoSpinner } from "@/components/common/logo-spinner";
|
||||
import type { Route } from "./+types/page";
|
||||
|
||||
const publishService = new SitesProjectPublishService();
|
||||
|
||||
export const clientLoader = async ({ params, request }: Route.ClientLoaderArgs) => {
|
||||
const { workspaceSlug, projectId } = params;
|
||||
|
||||
// Validate required params
|
||||
if (!workspaceSlug || !projectId) {
|
||||
throw redirect("/404");
|
||||
}
|
||||
|
||||
// Extract query params from the request URL
|
||||
const url = new URL(request.url);
|
||||
const board = url.searchParams.get("board");
|
||||
const peekId = url.searchParams.get("peekId");
|
||||
|
||||
let response: TProjectPublishSettings | undefined = undefined;
|
||||
|
||||
try {
|
||||
response = await publishService.retrieveSettingsByProjectId(workspaceSlug, projectId);
|
||||
} catch {
|
||||
throw redirect("/404");
|
||||
}
|
||||
|
||||
if (response?.entity_name === "project") {
|
||||
let redirectUrl = `/issues/${response?.anchor}`;
|
||||
const urlParams = new URLSearchParams();
|
||||
if (board) urlParams.append("board", String(board));
|
||||
if (peekId) urlParams.append("peekId", String(peekId));
|
||||
if (urlParams.toString()) redirectUrl += `?${urlParams.toString()}`;
|
||||
|
||||
throw redirect(redirectUrl);
|
||||
} else {
|
||||
throw redirect("/404");
|
||||
}
|
||||
};
|
||||
|
||||
export default function IssuesPage() {
|
||||
return (
|
||||
<div className="flex h-screen min-h-[500px] w-full justify-center items-center">
|
||||
<LogoSpinner />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user