From 33705b6f8e85ff347cbc57a167d02d54fbc377bc Mon Sep 17 00:00:00 2001 From: Saqib Date: Wed, 7 Oct 2026 12:09:00 +0530 Subject: [PATCH 1/5] fix: gate sitemaps only on FEATURE_SITEMAPS NODE_ENV is 'production' on every deployed build, so dev served sitemaps despite FEATURE_SITEMAPS=false. --- lib/utils.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/utils.ts b/lib/utils.ts index 20de8066..fe6e3ed6 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -208,10 +208,7 @@ export type ENTITY_CONFIG_TYPE = Record< // Check if sitemap is enabled export const isSitemapEnabled = () => { - return ( - process.env.FEATURE_SITEMAPS === 'true' || - process.env.NODE_ENV === 'production' - ); + return process.env.FEATURE_SITEMAPS === 'true'; }; // Entity Config From d8b9a88c7a299fa90a46ca43e23f3230e27ad38b Mon Sep 17 00:00:00 2001 From: Saqib Date: Wed, 7 Oct 2026 12:09:00 +0530 Subject: [PATCH 2/5] fix: send X-Robots-Tag noindex when sitemaps are disabled Keeps dev out of search indexes and lets crawlers drop already-indexed pages. --- next.config.mjs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/next.config.mjs b/next.config.mjs index 67599691..b82c0d26 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -23,7 +23,18 @@ const nextConfig = withNextIntl({ 'next-intl/config': './i18n.ts', }, }, - + + // Non-public environments (dev) must not be indexed by search engines. + async headers() { + if (process.env.FEATURE_SITEMAPS === 'true') return []; + return [ + { + source: '/:path*', + headers: [{ key: 'X-Robots-Tag', value: 'noindex, nofollow' }], + }, + ]; + }, + // Performance optimizations experimental: { optimizePackageImports: ['opub-ui', 'echarts', 'lucide-react', '@tabler/icons-react'], From f1a59ea107a0d696987b3e71ef5560299ce9cac4 Mon Sep 17 00:00:00 2001 From: Uday Raj Sahai Date: Wed, 7 Oct 2026 12:50:52 +0530 Subject: [PATCH 3/5] Fixed errors for justice-hub --- .../usecases/[useCaseSlug]/Dashboards.tsx | 36 ++++-- .../[useCaseSlug]/JusticeHubEmbed.tsx | 104 ++++++++++++++++++ 2 files changed, 129 insertions(+), 11 deletions(-) create mode 100644 app/[locale]/(user)/usecases/[useCaseSlug]/JusticeHubEmbed.tsx diff --git a/app/[locale]/(user)/usecases/[useCaseSlug]/Dashboards.tsx b/app/[locale]/(user)/usecases/[useCaseSlug]/Dashboards.tsx index cac3851f..9f233e37 100644 --- a/app/[locale]/(user)/usecases/[useCaseSlug]/Dashboards.tsx +++ b/app/[locale]/(user)/usecases/[useCaseSlug]/Dashboards.tsx @@ -6,6 +6,7 @@ import { Text } from 'opub-ui'; import { GraphQL } from '@/lib/api'; import { getSafeEmbedUrl } from '@/lib/dashboardEmbed'; import { Loading } from '@/components/loading'; +import JusticeHubEmbed, { isJusticeHubEmbed } from './JusticeHubEmbed'; const DashboardsList = graphql(` query usecaseDashboards($usecaseId: Int!) { @@ -41,7 +42,10 @@ const Dashboards = () => { ...dashboard, embedUrl: getSafeEmbedUrl(dashboard.link), })) - .filter((dashboard) => dashboard.embedUrl); + .filter( + (dashboard): dashboard is typeof dashboard & { embedUrl: string } => + Boolean(dashboard.embedUrl) + ); if (!isValidId || (!isLoading && dashboards.length === 0)) { return null; @@ -65,18 +69,28 @@ const Dashboards = () => { {dashboard.name} -
-