diff --git a/app/api/report/trend/route.ts b/app/api/report/trend/route.ts index 1bda6a4..ea367aa 100644 --- a/app/api/report/trend/route.ts +++ b/app/api/report/trend/route.ts @@ -7,9 +7,7 @@ export const dynamic = 'force-dynamic'; // defaults to auto export async function GET(request: NextRequest) { const { searchParams } = new URL(request.url); const project = searchParams.get('project') ?? ''; - const { reports } = await service.getReports({ project }); - - const latestReports = reports.slice(0, 20); + const { reports: latestReports } = await service.getReports({ project, pagination: { offset: 0, limit: 20 } }); return Response.json(latestReports); } diff --git a/app/components/header-links.tsx b/app/components/header-links.tsx index 382a1cd..3386e63 100644 --- a/app/components/header-links.tsx +++ b/app/components/header-links.tsx @@ -1,6 +1,14 @@ import { Link } from '@heroui/link'; -import { GithubIcon, DiscordIcon, TelegramIcon, LinkIcon, BitbucketIcon, CyborgTestIcon } from '@/app/components/icons'; +import { + GithubIcon, + DiscordIcon, + TelegramIcon, + LinkIcon, + BitbucketIcon, + CyborgTestIcon, + SlackIcon, +} from '@/app/components/icons'; import { SiteWhiteLabelConfig } from '@/app/types'; interface HeaderLinksProps { @@ -17,6 +25,7 @@ export const HeaderLinks: React.FC = ({ config, withTitle = fa { name: 'github', Icon: GithubIcon, title: 'GitHub' }, { name: 'cyborgTest', Icon: CyborgTestIcon, title: 'Cyborg Test' }, { name: 'bitbucket', Icon: BitbucketIcon, title: 'Bitbucket' }, + { name: 'slack', Icon: SlackIcon, title: 'Slack' }, ]; const socialLinks = Object.entries(links).map(([name, href]) => { diff --git a/app/components/icons.tsx b/app/components/icons.tsx index fe8af02..825768f 100644 --- a/app/components/icons.tsx +++ b/app/components/icons.tsx @@ -26,6 +26,23 @@ export const GithubIcon: FC = ({ size = 40, width, height, ...prop ); }; +export const SlackIcon: FC = ({ size = 40, width, height, ...props }) => ( + + + + + + +); + export const BitbucketIcon: FC = ({ size = 40, width, height, ...props }) => { return ( = ({ size = 40, width, height, ...prop export const TrendIcon: FC = ({ size = 40, width, height, ...props }) => { return ( = ({ size = 24, width, height, ...pr return ( ) { flaky: getPercentage(r.stats.flaky, r.stats.total), flakyCount: r.stats.flaky, total: r.stats.total, - reportUrl: r.reportUrl, + reportUrl: `/report/${r.reportID}`, })); return ( {reportHistory.length <= 1 ? ( - Not enough data for trend chart +
+
+ +
+
) : (