diff --git a/app/components/DoxaMapSlot.vue b/app/components/DoxaMapSlot.vue index 356c05e6..5acd7c25 100644 --- a/app/components/DoxaMapSlot.vue +++ b/app/components/DoxaMapSlot.vue @@ -6,7 +6,7 @@ interface Props { /** Which IIFE bundle to load. Defaults to 'simple-map' to preserve * existing call-sites (home, pray, adopt). Pass 'research-map' on the * research page to load the 5-tab research-mfe bundle instead. */ - bundle?: 'simple-map' | 'research-map' | 'country-map' + bundle?: 'simple-map' | 'research-map' } const props = withDefaults(defineProps(), { bundle: 'simple-map' }) @@ -19,7 +19,7 @@ useDoxaMap(props.bundle) * overwritten by the next one. Using a distinct tag per bundle eliminates * the "Profile not found" error that occurred when /research had loaded * its IIFE first and then the user navigated to /, /pray, or /adopt. */ -const TAGS = { 'simple-map': 'doxa-map', 'research-map': 'doxa-research-map', 'country-map': 'doxa-country-map' } as const +const TAGS = { 'simple-map': 'doxa-map', 'research-map': 'doxa-research-map' } as const const tagName = TAGS[props.bundle] const isSimple = props.bundle === 'simple-map' @@ -142,8 +142,7 @@ const effectiveConfig = computed(() => { } .doxa-map-slot :deep(doxa-map), -.doxa-map-slot :deep(doxa-research-map), -.doxa-map-slot :deep(doxa-country-map) { +.doxa-map-slot :deep(doxa-research-map) { display: block; position: absolute; /* inset inside the rounded frame; the map keeps its stacking to itself so its legend and search diff --git a/app/components/public/CountryDetail.vue b/app/components/public/CountryDetail.vue index 67d3e82a..24c56831 100644 --- a/app/components/public/CountryDetail.vue +++ b/app/components/public/CountryDetail.vue @@ -9,10 +9,6 @@ import { regionSlug, type CountrySummary } from '~~/config/countries-meta' const props = defineProps<{ country: CountrySummary }>() -// The country map is dx-maps' (MapLibre by default, Mapbox by NUXT_PUBLIC_MAP_PROVIDER). -// DX-life's own CountryMap (Mapbox-only, blank without a token) is kept, switched off: set true to bring it back. -const USE_LEGACY_COUNTRY_MAP = false - const { t, locale } = useI18n() const localePath = useLocalePath() @@ -20,17 +16,6 @@ const translations = computed(() => buildUupgListTranslations(t)) const regionLink = computed(() => localePath(`/regions/${regionSlug(props.country.region.value)}`)) const regionLabel = computed(() => props.country.region.label || t('Other')) -// The element fetches its own people groups (pins) from DX-life's campaign server; its locale comes from -// DoxaMapSlot, like every map. -const mapPrayBaseUrl = (useRuntimeConfig().public.prayBaseUrl as string) || 'https://pray.doxa.life' -const countryMapConfig = computed(() => JSON.stringify({ - profile: 'country-map', - prayBaseUrl: mapPrayBaseUrl, - countryCodes: [props.country.code], - center: props.country.center, - zoom: props.country.zoom, - researchUrl: localePath('/research') + '/' -})) // Map note. Placeholders are substituted manually with %count%/%country% // tokens rather than vue-i18n's {0}/{1} slots: vue-i18n empties brace slots @@ -62,15 +47,7 @@ const mapNote = computed(() => {{ mapNote }}

- ${rows.join('')}` : ''} ${p.description ? `

${escapeHtml(p.description)}

` : ''} ` diff --git a/app/components/public/RegionDetail.vue b/app/components/public/RegionDetail.vue index 06bdedc0..4f23b78e 100644 --- a/app/components/public/RegionDetail.vue +++ b/app/components/public/RegionDetail.vue @@ -18,23 +18,6 @@ const formatNumber = (n: number) => n.toLocaleString(`${locale.value}-u-nu-latn` const label = computed(() => props.region.label || t('Other')) const countryCodes = computed(() => props.region.countries.map(c => c.code)) -// The region map is dx-maps' (MapLibre by default, Mapbox by NUXT_PUBLIC_MAP_PROVIDER). -// DX-life's own CountryMap (Mapbox-only, blank without a token) is kept, switched off: set true to bring it back. -const USE_LEGACY_COUNTRY_MAP = false -// The element fetches its own people groups (pins) from DX-life's campaign server; its locale comes from -// DoxaMapSlot, like every map. -const mapPrayBaseUrl = (useRuntimeConfig().public.prayBaseUrl as string) || 'https://pray.doxa.life' -const regionMapConfig = computed(() => JSON.stringify({ - profile: 'country-map', - prayBaseUrl: mapPrayBaseUrl, - countryCodes: countryCodes.value, - center: props.region.center, - zoom: props.region.zoom, - bounds: props.region.bounds, - colorByPrayer: true, - researchUrl: localePath('/research') + '/' -})) - // Prayer coverage split, mirroring the pray page: fully covered (100+ // committed), partially covered (1+), and no one committed yet. const partialPrayerCount = computed(() => Math.max(0, props.region.withPrayer - props.region.withFullPrayer)) @@ -89,15 +72,7 @@ const mapNote = computed(() =>

{{ mapNote }}

- , +// Map of bundle keys → bundles in the dx-maps tree: this site's own /dx-maps/ (the default), or the tree +// NUXT_PUBLIC_DX_MAPS_BASE points at. Each bundle registers its own custom element (, // ). const BUNDLES = { 'simple-map': 'doxa-simple-map/doxa-simple-map.js', - 'research-map': 'doxa-research-map/doxa-research-map.js', - // The country/region detail pages' map (): dx-maps' RegionCountryMap, both engines. - 'country-map': 'country-map/country-map.js' + 'research-map': 'doxa-research-map/doxa-research-map.js' } as const type BundleKey = keyof typeof BUNDLES diff --git a/app/pages/regions/index.vue b/app/pages/regions/index.vue index 4e90a327..0dcf7ef4 100644 --- a/app/pages/regions/index.vue +++ b/app/pages/regions/index.vue @@ -6,19 +6,6 @@ import type { RegionSummary } from '~~/config/countries-meta' -// Where the Research Gallery is the Research page, /regions (in every language) REDIRECTS there with -// ?tab=regions-dashboard. On this branch the gallery is the hidden Deep Research page, so this index is -// DX Life's own again: USE_LEGACY_REGIONS_PAGE is true. Set it false to bring the redirect back. -definePageMeta({ - middleware: [(to) => { - const USE_LEGACY_REGIONS_PAGE = true - if (!USE_LEGACY_REGIONS_PAGE) { - // The locale is already in the path (/ar/regions -> /ar/research). - return navigateTo({ path: to.path.replace(/\/regions\/?$/, '/research'), query: { tab: 'regions-dashboard' } }, { redirectCode: 301 }) - } - }] -}) - const { t, locale } = useI18n() const localePath = useLocalePath() diff --git a/modules/region-routes.ts b/modules/region-routes.ts index 0f08df96..d24b799f 100644 --- a/modules/region-routes.ts +++ b/modules/region-routes.ts @@ -36,9 +36,7 @@ export default defineNuxtModule({ const prefixes = ['', ...ENABLED_LANGUAGE_CODES.filter(code => code !== 'en').map(code => `/${code}`)] const routes: string[] = [] for (const prefix of prefixes) { - // The /regions index is not prerendered when a route rule redirects it (LEGACY_REGIONS_PAGE in nuxt.config.ts). - const indexRule = (nuxt.options.routeRules as Record | undefined)?.[`${prefix}/regions`] - if (!indexRule?.redirect) routes.push(`${prefix}/regions`) + routes.push(`${prefix}/regions`) for (const slug of slugs) routes.push(`${prefix}/regions/${slug}`) } diff --git a/nuxt.config.ts b/nuxt.config.ts index 8cfe9dff..a900ea49 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -44,21 +44,11 @@ const marketingRouteRules = Object.fromEntries( // be a static glob); these rules just apply the marketing HTML cache policy // across all enabled locales. The former /countries URLs redirect permanently // to their /regions equivalents (same slugs) so old links keep working. -// REGIONS IS A VIEW OF THE RESEARCH GALLERY: the /regions INDEX 301s to the gallery's Regions tab in every -// language (the region/country detail pages stay). LEGACY_REGIONS_PAGE = true brings the index back: it -// restores these rules and its prerender entry (modules/region-routes.ts). The page's own middleware covers -// in-app navigation. On this branch it is true: the gallery is the hidden Deep Research page, so /regions is -// DX Life's own index again and /countries goes to it. -const LEGACY_REGIONS_PAGE = true const regionRouteRules = Object.fromEntries( MARKETING_LOCALE_PREFIXES.flatMap(prefix => [ - LEGACY_REGIONS_PAGE - ? [`${prefix}/regions`, { headers: { 'cache-control': MARKETING_HTML_CACHE } }] - : [`${prefix}/regions`, { redirect: { to: `${prefix}/research?tab=regions-dashboard`, statusCode: 301 } }], + [`${prefix}/regions`, { headers: { 'cache-control': MARKETING_HTML_CACHE } }], [`${prefix}/regions/**`, { headers: { 'cache-control': MARKETING_HTML_CACHE } }], - LEGACY_REGIONS_PAGE - ? [`${prefix}/countries`, { redirect: { to: `${prefix}/regions`, statusCode: 301 } }] - : [`${prefix}/countries`, { redirect: { to: `${prefix}/research?tab=regions-dashboard`, statusCode: 301 } }], + [`${prefix}/countries`, { redirect: { to: `${prefix}/regions`, statusCode: 301 } }], [`${prefix}/countries/**`, { redirect: { to: `${prefix}/regions/**`, statusCode: 301 } }] ]) )