From a9457e0129d9e00d515f42c65802821eb3de1793 Mon Sep 17 00:00:00 2001 From: Takeshi Kimata <117462761+kimatata@users.noreply.github.com> Date: Sun, 12 May 2024 01:19:04 +0900 Subject: [PATCH] Create Guide page --- frontend/messages/en.json | 17 +++++- frontend/messages/ja.json | 17 +++++- frontend/src/app/[locale]/Header.tsx | 9 ++++ frontend/src/app/[locale]/PaneMainTitle.tsx | 2 +- .../app/[locale]/PaneSelfHostProcedure.tsx | 44 --------------- frontend/src/app/[locale]/about/layout.tsx | 13 ----- frontend/src/app/[locale]/about/page.tsx | 9 ---- frontend/src/app/[locale]/guide/GuideBar.tsx | 39 ++++++++++++++ frontend/src/app/[locale]/guide/layout.tsx | 18 +++++++ .../[locale]/guide/selfhost/docker/page.tsx | 13 +++++ .../[locale]/guide/selfhost/manual/page.tsx | 53 +++++++++++++++++++ .../src/app/[locale]/guide/selfhost/page.tsx | 12 +++++ frontend/src/app/[locale]/page.tsx | 12 ----- 13 files changed, 175 insertions(+), 83 deletions(-) delete mode 100644 frontend/src/app/[locale]/PaneSelfHostProcedure.tsx delete mode 100644 frontend/src/app/[locale]/about/layout.tsx delete mode 100644 frontend/src/app/[locale]/about/page.tsx create mode 100644 frontend/src/app/[locale]/guide/GuideBar.tsx create mode 100644 frontend/src/app/[locale]/guide/layout.tsx create mode 100644 frontend/src/app/[locale]/guide/selfhost/docker/page.tsx create mode 100644 frontend/src/app/[locale]/guide/selfhost/manual/page.tsx create mode 100644 frontend/src/app/[locale]/guide/selfhost/page.tsx diff --git a/frontend/messages/en.json b/frontend/messages/en.json index a793460..622f286 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -16,14 +16,27 @@ "case_edit": "Test Cases", "case_home": "Dashboard", "case_run": "Test Runs", - "self_host": "Self host the application", + "roadmap": "Roadmap" + }, + "Guide": { + "self_host": "Self Host", + "docker": "Docker", + "manual": "Manual", + "self_host_app": "Self host the application", "run_as_docker": "Running TestPlat as a Docker container", "run_by_manually": "Running TestPlat manually", - "roadmap": "Roadmap" + "move_to_back": "Moves to backend directory", + "backend_install": "Install dependencies", + "init_db": "Initialize Database", + "backend_start": "Start backend server", + "move_to_front": "Moves to frontend directory", + "front_install": "Install dependencies", + "front_start": "Start frontend server" }, "Header": { "title": "Open Source Test Case Management Tool", "description": "Integrate and manage all your software testing", + "guide": "Guide", "projects": "Projects" }, "Projects": { diff --git a/frontend/messages/ja.json b/frontend/messages/ja.json index 02431dd..e29d9c8 100644 --- a/frontend/messages/ja.json +++ b/frontend/messages/ja.json @@ -16,14 +16,27 @@ "case_edit": "テストケース", "case_home": "ダッシュボード", "case_run": "テスト実行", - "self_host": "アプリのセルフホスト", + "roadmap": "ロードマップ" + }, + "Guide": { + "self_host": "セルフホスト", + "docker": "Docker", + "manual": "マニュアル", + "self_host_app": "アプリのセルフホスト", "run_as_docker": "Docker containerによる実行", "run_by_manually": "手動での実行", - "roadmap": "ロードマップ" + "move_to_back": "backendディレクトリに遷移", + "backend_install": "依存関係をインストール", + "init_db": "データベースの初期化", + "backend_start": "バックエンドサーバーの起動", + "move_to_front": "frontendディレクトリに遷移", + "front_install": "依存関係をインストール", + "front_start": "フロントエンドサーバーの起動" }, "Header": { "title": "オープンソーステストケース管理ツール", "description": "ソフトウェア開発にかかわるすべてのテストを統合管理", + "guide": "ガイド", "projects": "プロジェクト" }, "Projects": { diff --git a/frontend/src/app/[locale]/Header.tsx b/frontend/src/app/[locale]/Header.tsx index 5e28aad..f215fdf 100644 --- a/frontend/src/app/[locale]/Header.tsx +++ b/frontend/src/app/[locale]/Header.tsx @@ -46,6 +46,15 @@ export default function Header(params: { locale: string }) { + + + {t("guide")} + + - + {t("get_started")} diff --git a/frontend/src/app/[locale]/PaneSelfHostProcedure.tsx b/frontend/src/app/[locale]/PaneSelfHostProcedure.tsx deleted file mode 100644 index aca59e6..0000000 --- a/frontend/src/app/[locale]/PaneSelfHostProcedure.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { Code, Card, CardBody } from "@nextui-org/react"; -import { useTranslations } from "next-intl"; - -export default function SelfHostProcedure() { - const t = useTranslations("Index"); - const manualProcedures = [ - { - uid: "clone", - detail: "", - code: "git clone git@github.com:kimatata/TestCaseManager.git", - }, - { uid: "go-to-backend", detail: "", code: "cd backend" }, - { uid: "backend-install", detail: "", code: "npm install" }, - { uid: "backend-start", detail: "", code: "node index" }, - { uid: "go-to-frontend", detail: "", code: "cd frontend" }, - { uid: "front-install", detail: "", code: "npm install" }, - { uid: "front-start", detail: "", code: "npm run start" }, - ]; - - return ( - <> - - {t("run_as_docker")} - - To be implemented - - - - - {t("run_by_manually")} - - {manualProcedures.map((procedure, index) => ( - - {procedure.detail} - - {procedure.code} - - - ))} - - - > - ); -} diff --git a/frontend/src/app/[locale]/about/layout.tsx b/frontend/src/app/[locale]/about/layout.tsx deleted file mode 100644 index 98956a5..0000000 --- a/frontend/src/app/[locale]/about/layout.tsx +++ /dev/null @@ -1,13 +0,0 @@ -export default function AboutLayout({ - children, -}: { - children: React.ReactNode; -}) { - return ( - - - {children} - - - ); -} diff --git a/frontend/src/app/[locale]/about/page.tsx b/frontend/src/app/[locale]/about/page.tsx deleted file mode 100644 index c79c1e6..0000000 --- a/frontend/src/app/[locale]/about/page.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { title } from "@/components/primitives"; - -export default function AboutPage() { - return ( - - About - - ); -} diff --git a/frontend/src/app/[locale]/guide/GuideBar.tsx b/frontend/src/app/[locale]/guide/GuideBar.tsx new file mode 100644 index 0000000..52ba589 --- /dev/null +++ b/frontend/src/app/[locale]/guide/GuideBar.tsx @@ -0,0 +1,39 @@ +import { useTranslations } from "next-intl"; +import { Link, NextUiLinkClasses } from "@/src/navigation"; + +export type Props = { + locale: string; +}; + +export default function Guidebar({ locale }: Props) { + const t = useTranslations("Guide"); + const links = [ + { + name: t("self_host"), + href: "/guide/selfhost", + indent: false, + }, + { + name: t("docker"), + href: "/guide/selfhost/docker", + indent: true, + }, + { + name: t("manual"), + href: "/guide/selfhost/manual", + indent: true, + }, + ]; + + return ( + + {links.map((link) => ( + + + {link.name} + + + ))} + + ); +} diff --git a/frontend/src/app/[locale]/guide/layout.tsx b/frontend/src/app/[locale]/guide/layout.tsx new file mode 100644 index 0000000..d24d3d4 --- /dev/null +++ b/frontend/src/app/[locale]/guide/layout.tsx @@ -0,0 +1,18 @@ +import Guidebar from "./GuideBar"; + +export default function GuideLayout({ + children, + params: { locale }, +}: { + children: React.ReactNode; + params: { locale: string }; +}) { + return ( + + + + {children} + + + ); +} diff --git a/frontend/src/app/[locale]/guide/selfhost/docker/page.tsx b/frontend/src/app/[locale]/guide/selfhost/docker/page.tsx new file mode 100644 index 0000000..c69b320 --- /dev/null +++ b/frontend/src/app/[locale]/guide/selfhost/docker/page.tsx @@ -0,0 +1,13 @@ +import { useTranslations } from "next-intl"; +import { title } from "@/components/primitives"; +import { Snippet, Card, CardBody } from "@nextui-org/react"; + +export default function Page() { + const t = useTranslations("Guide"); + + return ( + + {t("run_as_docker")} + + ); +} diff --git a/frontend/src/app/[locale]/guide/selfhost/manual/page.tsx b/frontend/src/app/[locale]/guide/selfhost/manual/page.tsx new file mode 100644 index 0000000..12064bd --- /dev/null +++ b/frontend/src/app/[locale]/guide/selfhost/manual/page.tsx @@ -0,0 +1,53 @@ +import { useTranslations } from "next-intl"; +import { title } from "@/components/primitives"; +import { Snippet } from "@nextui-org/react"; + +export default function Page() { + const t = useTranslations("Guide"); + const manualProcedures = [ + { + uid: "clone", + detail: "", + code: "git clone git@github.com:kimatata/TestCaseManager.git", + }, + { + uid: "move-to-backend", + detail: t("move_to_back"), + code: "cd backend", + }, + { + uid: "backend-install", + detail: t("backend_install"), + code: "npm install", + }, + { uid: "init-db", detail: t("init_db"), code: "npm run migrate" }, + { uid: "backend_start", detail: t("front_start"), code: "node index" }, + { + uid: "move-to-frontend", + detail: t("move_to_front"), + code: "cd frontend", + }, + { + uid: "front-install", + detail: t("frontend_install"), + code: "npm install", + }, + { uid: "front-start", detail: t("front_start"), code: "npm run start" }, + ]; + + return ( + + {t("run_by_manually")} + + {manualProcedures.map((procedure, index) => ( + + {procedure.detail} + + {procedure.code} + + + ))} + + + ); +} diff --git a/frontend/src/app/[locale]/guide/selfhost/page.tsx b/frontend/src/app/[locale]/guide/selfhost/page.tsx new file mode 100644 index 0000000..81ab3e9 --- /dev/null +++ b/frontend/src/app/[locale]/guide/selfhost/page.tsx @@ -0,0 +1,12 @@ +import { useTranslations } from "next-intl"; +import { title } from "@/components/primitives"; + +export default function Page() { + const t = useTranslations("Guide"); + + return ( + + {t("self_host")} + + ); +} diff --git a/frontend/src/app/[locale]/page.tsx b/frontend/src/app/[locale]/page.tsx index 70c27b3..a05acc6 100644 --- a/frontend/src/app/[locale]/page.tsx +++ b/frontend/src/app/[locale]/page.tsx @@ -4,7 +4,6 @@ import { Divider } from "@nextui-org/react"; import PaneMainTitle from "./PaneMainTitle"; import PaneMainFeatures from "./PaneMainFeatures"; import PaneDemoImages from "./PaneDemoImages"; -import PaneSelfHostProcedure from "./PaneSelfHostProcedure"; export default function Home(params: { locale: string }) { const t = useTranslations("Index"); @@ -68,17 +67,6 @@ export default function Home(params: { locale: string }) { - - - - {t("self_host")} - - - - - - -
{procedure.detail}
- {procedure.code} -