mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 10:56:28 +00:00
update page title metadata
This commit is contained in:
@@ -42,8 +42,6 @@ export default async function DashboardPage() {
|
||||
const alreadyCheckin = todayPresence.history.length > 0
|
||||
const alreadyCheckout = (alreadyCheckin && todayPresence.history[0].presence_checkout) || todayPresence.history.length === 0
|
||||
|
||||
console.log(session)
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="flex-1 space-y-8 p-6 sm:p-8 pt-3 sm:pt-7 pb-40 md:pb-8">
|
||||
|
||||
@@ -16,7 +16,7 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
const session = await getServerSession(authOptions)
|
||||
|
||||
return {
|
||||
title: `History - ${session?.user?.detail.fullname || 'User'}`,
|
||||
title: `${session?.user?.detail.fullname || 'User'}'s History - HIS Attendance Task System (H.A.T.s)`,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,7 @@ import { authOptions } from '@/pages/api/auth/[...nextauth]';
|
||||
const FormComponent = lazy(() => import('./components/FormComponent'))
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "I'am Here",
|
||||
description: "Employee update presence page.",
|
||||
title: "Update your current work location (I'am Here) - HIS Attendance Task System (H.A.T.s)",
|
||||
}
|
||||
|
||||
type Props = {};
|
||||
|
||||
@@ -8,7 +8,7 @@ import { fetchDataWithPost } from '@/lib/fetchData';
|
||||
const FormComponent = lazy(() => import('./components'))
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Apply for Leave",
|
||||
title: "Apply for Leave - HIS Attendance Task System (H.A.T.s)",
|
||||
}
|
||||
|
||||
const WorkLeave = async () => {
|
||||
|
||||
@@ -8,8 +8,16 @@ import fetchData from '@/lib/fetchData';
|
||||
const FormComponent = lazy(() => import('./components/FormComponent'))
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Presence",
|
||||
description: "Employee presence page.",
|
||||
title: "Presence - HIS Attendance Task System (H.A.T.s)",
|
||||
}
|
||||
|
||||
export async function generateMetadata({ searchParams }: any): Promise<Metadata> {
|
||||
const checkout = (await searchParams)?.checkout
|
||||
const title = checkout === 'true' ? 'Check-out Presence' : 'Check-in Presence'
|
||||
|
||||
return {
|
||||
title: `${title} - HIS Attendance Task System (H.A.T.s)`,
|
||||
}
|
||||
}
|
||||
|
||||
type Props = {
|
||||
|
||||
@@ -269,7 +269,7 @@ export default async function ProfilePage() {
|
||||
Privacy Policy
|
||||
</Link>
|
||||
</div>
|
||||
<p>App Version <Link href={`/release-notes#${process.env.NEXT_PUBLIC_APP_VERSION}`} className="underline hover:text-blue-500 duration-200">{process.env.NEXT_PUBLIC_APP_VERSION}</Link> </p>
|
||||
<p>App version <Link href={`/release-notes#${process.env.NEXT_PUBLIC_APP_VERSION}`} className="underline hover:text-blue-500 duration-200">{process.env.NEXT_PUBLIC_APP_VERSION}</Link> </p>
|
||||
</div>
|
||||
<Logout />
|
||||
</CardContent>
|
||||
|
||||
@@ -26,6 +26,7 @@ const releaseNotes: ReleaseNote[] = [
|
||||
{ category: "improvement", description: "Upgraded React and ReactDOM from v18.2.0 to v19.2.3" },
|
||||
{ category: "improvement", description: "Replaced native img tags with Next.js Image component and added lazy loading for avatars" },
|
||||
{ category: "bugfix", description: "Fixed spamming \"Failed to fetch geolocation\" alerts when presence using mobile devices" },
|
||||
{ category: "feature", description: "Added progress bar indicator when route change in employee routes" },
|
||||
{ category: 'feature', description: <div>Added <Link href="/hats-team" className="underline text-blue-500">hats team</Link> page</div> },
|
||||
{ category: 'feature', description: <div>Added <Link href="/release-notes" className="underline text-blue-500">release notes</Link> page</div> },
|
||||
]
|
||||
@@ -41,7 +42,7 @@ const releaseNotes: ReleaseNote[] = [
|
||||
{ category: "feature", description: "Open Google Maps to show presence location in attendance history" },
|
||||
{ category: "bugfix", description: "Fixed issues in manual attendance" },
|
||||
{ category: "improvement", description: "Improved donut chart responsiveness on the homepage for mobile view" },
|
||||
{ category: "feature", description: "Added progress bar indicator when route change in admin pane" },
|
||||
{ category: "feature", description: "Added progress bar indicator when route change in admin panel" },
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ import { fetchDataWithPost } from '@/lib/fetchData';
|
||||
const FormComponent = lazy(() => import('./components'))
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Work Permit and Sick",
|
||||
title: "Work Permit and Sick - HIS Attendance Task System (H.A.T.s)",
|
||||
}
|
||||
|
||||
const WorkPermit = async () => {
|
||||
|
||||
@@ -2,9 +2,25 @@ import { FC, Suspense, lazy } from 'react';
|
||||
import InterceptModal from '@/components/modal/InterceptModal';
|
||||
import LazyLoading from '@/components/loader/LazyLoading';
|
||||
import DateRangePicker from '@/app/performance/[id]/components/DateRangePicker';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { authOptions } from '@/pages/api/auth/[...nextauth]';
|
||||
import { Metadata } from 'next';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const PerformanceComponent = lazy(() => import('@/app/performance/[id]/components'));
|
||||
|
||||
export async function generateMetadata({ searchParams }: any): Promise<Metadata> {
|
||||
const session = await getServerSession(authOptions)
|
||||
const start_date = (await searchParams)!.start_date
|
||||
const end_date = (await searchParams)!.end_date
|
||||
|
||||
const date = start_date && end_date ? `from ${dayjs(start_date).format('MMM DD, YYYY')} to ${dayjs(end_date).format('MMM DD, YYYY')}` : 'the last 30 days'
|
||||
|
||||
return {
|
||||
title: `${session?.user?.detail.fullname || 'User'}'s Performance in ${date} - HIS Attendance Task System (H.A.T.s)`,
|
||||
}
|
||||
}
|
||||
|
||||
type Props = {
|
||||
params: Promise<{ id: string | undefined }>
|
||||
searchParams: Promise<{ [key: string]: string | string[] | undefined }>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { type Metadata } from 'next';
|
||||
import { FC, Suspense, lazy } from 'react';
|
||||
import { Suspense, lazy } from 'react';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { authOptions } from '@/pages/api/auth/[...nextauth]';
|
||||
import { type ResponseData } from '@/types/types';
|
||||
@@ -17,6 +17,7 @@ export const metadata: Metadata = {
|
||||
async function getData() {
|
||||
const { BASE_URL_API } = process.env
|
||||
const session = await getServerSession(authOptions)
|
||||
console.log("SESSION ADMIN USER PAGE :", session)
|
||||
|
||||
const res = await fetch(BASE_URL_API + '/user', {
|
||||
headers: {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { FC, Suspense, lazy } from 'react';
|
||||
import LazyLoading from '@/components/loader/LazyLoading';
|
||||
import DateRangePicker from './components/DateRangePicker';
|
||||
import { Metadata } from 'next';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { authOptions } from '@/pages/api/auth/[...nextauth]';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const Header = lazy(() => import('@/app/(dashboard)/components/Header'))
|
||||
const PerformanceComponent = lazy(() => import('./components'))
|
||||
@@ -10,6 +14,19 @@ type Props = {
|
||||
searchParams: Promise<{ [key: string]: string | string[] | undefined }>
|
||||
};
|
||||
|
||||
|
||||
export async function generateMetadata({ searchParams }: any): Promise<Metadata> {
|
||||
const session = await getServerSession(authOptions)
|
||||
const start_date = (await searchParams)!.start_date
|
||||
const end_date = (await searchParams)!.end_date
|
||||
|
||||
const date = start_date && end_date ? `from ${dayjs(start_date).format('MMM DD, YYYY')} to ${dayjs(end_date).format('MMM DD, YYYY')}` : 'the last 30 days'
|
||||
|
||||
return {
|
||||
title: `${session?.user?.detail.fullname || 'User'}'s Performance in ${date} - HIS Attendance Task System (H.A.T.s)`,
|
||||
}
|
||||
}
|
||||
|
||||
const PerformancePage: FC<Props> = async ({ params, searchParams }) => {
|
||||
const id = (await params).id
|
||||
const start_date = (await searchParams)!.start_date
|
||||
|
||||
Reference in New Issue
Block a user