Skip to content

Commit

Permalink
refactor(troubleshooting): Add app router page under feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dhmacs committed Feb 8, 2024
1 parent b03bb50 commit 2b0fd1b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ NEXT_PUBLIC_ALGOLIA_PRODUCT_INDEX_NAME=dev_product_group_en
NEXT_PUBLIC_DEFAULT_STORE_CODE=test

# Flags
# NEXT_PUBLIC_FLAG__STORE_PAGES_APP_ROUTER_ENABLED=true
NEXT_PUBLIC_FLAG__APP_ROUTER_TROUBLESHOOTING_PAGE_ENABLED=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { flags } from '@config/flags';
import { notFound } from 'next/navigation';

interface WikiPageProps {
params: {
device: string;
problem: string;
wikiid: string;
};
searchParams: {
disableCacheGets?: string | string[] | undefined;
variant?: string;
};
}

export default async function WikiPage({ params }: WikiPageProps) {
if (!flags.APP_ROUTER_TROUBLESHOOTING_PAGE_ENABLED) notFound();

return (
<div>
WikiPage: <code>{JSON.stringify(params, null, 2)}</code>
</div>
);
}
5 changes: 3 additions & 2 deletions frontend/config/flags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const flags = {
// STORE_PAGES_APP_ROUTER_ENABLED:
// process.env.NEXT_PUBLIC_FLAG__STORE_PAGES_APP_ROUTER_ENABLED === 'true',
APP_ROUTER_TROUBLESHOOTING_PAGE_ENABLED:
process.env.NEXT_PUBLIC_FLAG__APP_ROUTER_TROUBLESHOOTING_PAGE_ENABLED ===
'true',
};

0 comments on commit 2b0fd1b

Please sign in to comment.