This repository has been archived by the owner on Oct 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: prepare placeholder pages (#63)
Closes #62 ## Description ## Current Tasks ### Routes to Implement - [x] #33 - [x] #37 - [x] #36 - [x] #35 ### Blocked by The Backend - [ ] #29 - [ ] #38 - [ ] #39 Co-authored-by: Resi Respati <[email protected]>
- Loading branch information
1 parent
26ba0c0
commit 27f31de
Showing
15 changed files
with
285 additions
and
12 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
__tests__/pages/dashboard/tracing.test.tsx → __tests__/pages/dashboard/index.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { render, screen } from "@testing-library/react"; | ||
import MonitoringList from "~/pages/dashboard/monitoring"; | ||
|
||
jest.mock("next/router", () => require("next-router-mock")); | ||
|
||
describe("MonitoringList", () => { | ||
it("renders the correct page header", () => { | ||
render(<MonitoringList />); | ||
|
||
const title = screen.getByText(/Anda terdaftar pada/i); | ||
expect(title).toBeVisible(); | ||
|
||
const selectButton = screen.getByRole("button", { name: /tetapkan/i }); | ||
expect(selectButton).toBeVisible(); | ||
}); | ||
}); |
22 changes: 22 additions & 0 deletions
22
__tests__/pages/dashboard/tracing/[caseId]/[contactId]/index.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { render, screen } from "@testing-library/react"; | ||
import React from "react"; | ||
import TracingCaseContactDetail from "~/pages/dashboard/tracing/[caseId]/[contactId]"; | ||
|
||
jest.mock("next/router", () => require("next-router-mock")); | ||
|
||
describe("TracingCaseContactDetail", () => { | ||
it("renders page title correctly", () => { | ||
render(<TracingCaseContactDetail />); | ||
|
||
expect(screen.getByRole("heading", { name: /detail kontak erat/i })).toBeVisible(); | ||
}); | ||
|
||
it("renders the `Kembali` button correctly", () => { | ||
render(<TracingCaseContactDetail />); | ||
|
||
expect(screen.getByRole("link", { name: /kembali/i })).toHaveAttribute( | ||
"href", | ||
"/dashboard/tracing/undefined" | ||
); | ||
}); | ||
}); |
22 changes: 22 additions & 0 deletions
22
__tests__/pages/dashboard/tracing/[caseId]/[contactId]/monitor.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { render, screen } from "@testing-library/react"; | ||
import React from "react"; | ||
import Monitor from "~/pages/dashboard/tracing/[caseId]/[contactId]/monitor"; | ||
|
||
jest.mock("next/router", () => require("next-router-mock")); | ||
|
||
describe("Monitor", () => { | ||
it("renders page title correctly", () => { | ||
render(<Monitor />); | ||
|
||
expect(screen.getByRole("heading", { name: /tambah pemantauan/i })).toBeVisible(); | ||
}); | ||
|
||
it("renders the `Kembali` button correctly", () => { | ||
render(<Monitor />); | ||
|
||
expect(screen.getByRole("link", { name: /kembali/i })).toHaveAttribute( | ||
"href", | ||
"/dashboard/tracing/undefined/undefined" | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { render, screen } from "@testing-library/react"; | ||
import React from "react"; | ||
import TracingCaseDetail from "~/pages/dashboard/tracing/[caseId]"; | ||
|
||
jest.mock("next/router", () => require("next-router-mock")); | ||
|
||
describe("TracingCaseDetail", () => { | ||
it("renders page title correctly", () => { | ||
render(<TracingCaseDetail />); | ||
|
||
expect(screen.getByRole("heading", { name: /detail kasus konfirmasi/i })).toBeVisible(); | ||
}); | ||
|
||
it("renders the `Kembali` button correctly", () => { | ||
render(<TracingCaseDetail />); | ||
|
||
expect(screen.getByRole("link", { name: /kembali/i })).toHaveAttribute( | ||
"href", | ||
"/dashboard/tracing" | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { useRouter } from "next/router"; | ||
import { DashboardPage, DashboardPageContent } from "~/components/layout/dashboard"; | ||
import { ConfirmedCasesCard } from "~/components/tracing/confirmed-cases-card"; | ||
import { ConfirmedCasesHeader } from "~/components/tracing/confirmed-cases-header"; | ||
import { PrimaryButton } from "~/components/ui/button"; | ||
import { FormLabel, InputSelect } from "~/components/ui/forms"; | ||
|
||
export default function MonitoringList() { | ||
const router = useRouter(); | ||
|
||
console.log("caseId", router.query.caseId); | ||
|
||
return ( | ||
<DashboardPage> | ||
<ConfirmedCasesHeader> | ||
<div className="flex flex-col lg:flex-row lg:justify-between"> | ||
<div className="space-y-2"> | ||
<p className="text-sm">Anda terdaftar pada:</p> | ||
<h1 className="text-lg font-semibold leading-[38px] lg:text-xl lg:leading-[38px]"> | ||
Nama Kecamatan, DKI JAKARTA | ||
</h1> | ||
</div> | ||
<div className="flex-none w-full mt-4 space-y-2 lg:max-w-xs lg:mt-0 lg:ml-4"> | ||
<FormLabel htmlFor="facility">Pilih PKM</FormLabel> | ||
<div className="flex items-end space-x-4"> | ||
<InputSelect defaultValue="" id="facility" name="facility"> | ||
<option value="">- Pilih PKM -</option> | ||
<option>A</option> | ||
<option>B</option> | ||
<option>C</option> | ||
</InputSelect> | ||
<PrimaryButton type="button">Tetapkan</PrimaryButton> | ||
</div> | ||
</div> | ||
</div> | ||
</ConfirmedCasesHeader> | ||
<DashboardPageContent> | ||
<div className="space-y-6"> | ||
<div className="space-y-1"> | ||
<p className="text-sm lg:text-md text-gray-600">Anda mengakses data</p> | ||
<h2 className="text-xl lg:text-2xl text-gray-900 font-semibold"> | ||
9911032 - PUSKESMAS SUKA MAJU | ||
</h2> | ||
</div> | ||
{/* TODO: use tabs on both mobile + desktop */} | ||
<div className="overflow-hidden rounded-md shadow bg-white"> | ||
<ul className="divide-y divide-gray-200"> | ||
<li> | ||
<ConfirmedCasesCard /> | ||
</li> | ||
<li> | ||
<ConfirmedCasesCard /> | ||
</li> | ||
<li> | ||
<ConfirmedCasesCard /> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</DashboardPageContent> | ||
</DashboardPage> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { ArrowCircleLeftIcon } from "@heroicons/react/outline"; | ||
import Link from "next/link"; | ||
import { useRouter } from "next/router"; | ||
import { | ||
DashboardPage, | ||
DashboardPageHeader, | ||
DashboardPageContent, | ||
} from "~/components/layout/dashboard"; | ||
|
||
export default function TracingCaseContactDetail() { | ||
const router = useRouter(); | ||
|
||
console.log("caseId", router.query.caseId); | ||
console.log("contactId", router.query.contactId); | ||
|
||
return ( | ||
<DashboardPage> | ||
<DashboardPageHeader> | ||
<div className="flex flex-row space-x-4"> | ||
<div className="flex w-8 h-8 items-center justify-center"> | ||
<Link | ||
as={`/dashboard/tracing/${router.query.caseId}`} | ||
href="/dashboard/tracing/[caseId]" | ||
> | ||
<a | ||
aria-label="Kembali" | ||
className="text-silacak-500 hover:text-silacak-700" | ||
title="Kembali" | ||
> | ||
<ArrowCircleLeftIcon aria-hidden className="w-8 h-8" /> | ||
</a> | ||
</Link> | ||
</div> | ||
<div> | ||
<h1 className="text-2xl font-semibold">Detail Kontak Erat</h1> | ||
</div> | ||
</div> | ||
</DashboardPageHeader> | ||
<DashboardPageContent>Content</DashboardPageContent> | ||
</DashboardPage> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { ArrowCircleLeftIcon } from "@heroicons/react/outline"; | ||
import Link from "next/link"; | ||
import { useRouter } from "next/router"; | ||
import { DashboardPage, DashboardPageContent } from "~/components/layout/dashboard"; | ||
import { ConfirmedCasesHeader } from "~/components/tracing/confirmed-cases-header"; | ||
|
||
export default function Monitor() { | ||
const router = useRouter(); | ||
|
||
return ( | ||
<DashboardPage> | ||
<ConfirmedCasesHeader> | ||
<div className="flex flex-row space-x-4"> | ||
<div className="flex w-8 h-8 items-center justify-center"> | ||
<Link | ||
as={`/dashboard/tracing/${router.query.caseId}/${router.query.contactId}`} | ||
href="/dashboard/tracing/[caseId]/[contactId]" | ||
> | ||
<a | ||
aria-label="Kembali" | ||
className="text-silacak-500 hover:text-silacak-700" | ||
title="Kembali" | ||
> | ||
<ArrowCircleLeftIcon aria-hidden className="w-8 h-8" /> | ||
</a> | ||
</Link> | ||
</div> | ||
<div> | ||
<h1 className="text-2xl font-semibold">Tambah Pemantauan</h1> | ||
</div> | ||
</div> | ||
</ConfirmedCasesHeader> | ||
<DashboardPageContent>Content</DashboardPageContent> | ||
</DashboardPage> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { ArrowCircleLeftIcon } from "@heroicons/react/outline"; | ||
import Link from "next/link"; | ||
import { useRouter } from "next/router"; | ||
import { | ||
DashboardPage, | ||
DashboardPageHeader, | ||
DashboardPageContent, | ||
} from "~/components/layout/dashboard"; | ||
|
||
export default function TracingCaseDetail() { | ||
const router = useRouter(); | ||
|
||
console.log(router.query.caseId); | ||
|
||
return ( | ||
<DashboardPage> | ||
<DashboardPageHeader> | ||
<div className="space-y-4"> | ||
<div className="flex flex-row space-x-4"> | ||
<div className="flex w-8 h-8 items-center justify-center"> | ||
<Link href="/dashboard/tracing"> | ||
<a | ||
aria-label="Kembali" | ||
className="text-silacak-500 hover:text-silacak-700" | ||
title="Kembali" | ||
> | ||
<ArrowCircleLeftIcon aria-hidden className="w-8 h-8" /> | ||
</a> | ||
</Link> | ||
</div> | ||
<div> | ||
<h1 className="text-2xl font-semibold">Detail Kasus Konfirmasi</h1> | ||
</div> | ||
</div> | ||
<div>Header Sub (Informasi Utama, etc.)</div> | ||
</div> | ||
</DashboardPageHeader> | ||
<DashboardPageContent>Content (Daftar Kontak Erat, etc.)</DashboardPageContent> | ||
</DashboardPage> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters