Skip to content

Render WMS previews for geoserver connected resources#30

Merged
mpolidori merged 1 commit intostagingfrom
feat/wms-wfs-previews
Apr 13, 2026
Merged

Render WMS previews for geoserver connected resources#30
mpolidori merged 1 commit intostagingfrom
feat/wms-wfs-previews

Conversation

@willy1989cv
Copy link
Copy Markdown
Member

@willy1989cv willy1989cv commented Apr 11, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced search results with clearer guidance for no-result scenarios and dataset browsing options.
    • Added map preview support for geospatial data with style customization.
  • Bug Fixes & Improvements

    • Improved accessibility across the platform with better semantic structure and screen reader support.
    • Enhanced multi-language support with proper language attribution.
    • Refined search filtering interface and navigation controls.
  • Documentation

    • Added accessibility improvements documentation.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
malmo-data-portal Ready Ready Preview, Comment Apr 11, 2026 4:47pm

Request Review

@willy1989cv willy1989cv changed the base branch from main to staging April 11, 2026 16:47
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 11, 2026

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

This PR implements comprehensive accessibility improvements, localization enhancements, and OGC map preview support. Changes include semantic HTML restructuring, lang attribute support for multilingual content, expanded i18n keys, new OGC service handling utilities, and ARIA attributes. Dark mode CSS was removed.

Changes

Cohort / File(s) Summary
Localization & i18n Keys
messages/da.json, messages/en.json, messages/sv.json, src/lib/ckan-translations.ts
Added new translation keys for navigation (toggleNavigationMenu, switchLanguage), search (activeFilters, clearSearch, noResultsHelp, browseAllDatasets), and map previews (mapPreviewLabel, styleUrlLabel). Introduced getLocalizedTextWithLang() utility that returns both localized text and resolved language code.
Header & Navigation Localization
src/components/layout/Header.tsx, src/components/layout/LanguageSwitcher.tsx
Updated mobile navigation toggle and language switcher buttons to use localized aria-label attributes via new translation keys.
Page-Level Lang Attributes
src/components/layout/Page.tsx, src/components/layout/PageHero.tsx, src/components/ui/heading.tsx, src/components/ui/markdown.tsx
Added optional titleLang and descriptionLang props to propagate language codes through page hierarchy, enabling lang attributes on headings and markdown content wrappers.
Dataset & Resource Pages Lang Support
src/app/[locale]/[org]/[dataset]/page.tsx, src/app/[locale]/[org]/[dataset]/[resource]/page.tsx
Updated to use getLocalizedTextWithLang() for dataset/resource titles and descriptions, precomputing lang values and passing them through page props for semantic language tagging.
OGC Preview System
src/lib/ogc.ts, src/schemas/ckan/dataset.interface.d.ts, src/lib/resource.ts
Introduced new OGC utilities: normalizeOgcServiceUrl() for URL parameter normalization, getOgcPreviewConfig() for preview detection, and types OgcType and OgcPreviewConfig. Extended Resource interface with wms_url and wfs_url fields.
Map Preview & SLD Handling
src/components/package/resource/OgcServiceMapPreview.tsx, src/components/package/resource/ResourcePreview.tsx
Implemented SLD (Styled Layer Descriptor) loading for WFS previews with dynamic feature styling. Added support for style URL and mobile legend display. Refactored ResourcePreview to derive OGC config once and conditionally apply SLD per service type. Map previews now wrapped in <figure> with accessible <figcaption>.
Semantic HTML: Dataset Cards & Resources
src/components/package/dataset/DatasetSimpleCard.tsx, src/components/package/dataset/DatasetResource.tsx, src/components/package/dataset/DatasetInfo.tsx
Replaced text spans with <h3> headings, converted divs to semantic <dl>/<dt>/<dd> for metadata, and used getLocalizedTextWithLang() to attach lang attributes. Updated resources container from div to <ul>/<li> structure.
Semantic HTML: Search Results
src/components/package/search/SearchResultItem.tsx, src/components/package/search/SearchResultHeader.tsx
Converted result container to <article> within <li>, replaced tag and metadata divs with <ul>/<li> for tags and <dl>/<dt>/<dd> for metadata. Added ARIA live-region attributes to result count header for dynamic announcements.
Semantic HTML: Filter UI
src/components/package/search/FacetCard.tsx, src/components/package/search/FacetOptions.tsx, src/components/package/search/FilterBadge.tsx, src/components/package/search/ActiveFilters.tsx
Converted facet options and filter badge containers from divs to <ul>/<li>. Changed filter title from div to <h2>. Added keyboard handling (space/Enter) and role="button" to facet selection span. Added aria-hidden to chevron icons.
Search Layout & Empty State
src/components/package/search/SearchLayout.tsx, src/components/package/search/Facets.tsx, src/components/package/search/NoDataFound.tsx
Enhanced filter visibility logic to show filters when results exist OR facets are available. Changed filter heading to <h2>. Replaced hardcoded "Active Filters" title with translation key. Implemented synthetic facet items for selected-but-unavailable filters. Enhanced no-results messaging with help text and link to browse all datasets.
Semantic HTML: Layout Components
src/app/[locale]/page.tsx, src/app/[locale]/themes/page.tsx, src/components/groups/GroupCard.tsx, src/components/layout/Footer.tsx
Converted group and dataset grid sections from divs to semantic <ul>/<li>. Changed group titles from <p> to <h3>. Updated image alt attributes and added aria-hidden to decorative images. Simplified footer markup and removed PortalJS emoji. Changed theme search placeholder to use translation key.
Styling & Type Declarations
src/app/globals.css, src/types/styles.d.ts, docs/accessibility-fixes.md
Removed .dark CSS rule containing theme variable overrides (dark mode deferred). Added CSS module declaration for TypeScript. Added comprehensive accessibility fixes documentation detailing implemented changes and deferred work.
Configuration
.gitignore
Added /_temp directory to ignore list.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Browser
    participant ResourcePreview
    participant OgcService as OGC Service<br/>(WMS/WFS)
    participant SldLoader as SLD Loader
    participant LeafletMap

    User->>Browser: Request map preview
    Browser->>ResourcePreview: Render component
    ResourcePreview->>ResourcePreview: getOgcPreviewConfig(resource)
    alt Has OGC Preview
        ResourcePreview->>ResourcePreview: Extract styleUrl for WFS
        ResourcePreview->>OgcService: Fetch normalized OGC URL
        OgcService-->>ResourcePreview: Return service response
        alt styleUrl provided
            ResourcePreview->>SldLoader: Load SLD from styleUrl
            SldLoader->>SldLoader: Fetch & parse XML
            SldLoader-->>ResourcePreview: SLD styling rules
            ResourcePreview->>LeafletMap: Apply SLD styling to features
        else No SLD
            ResourcePreview->>LeafletMap: Render with default styling
        end
    else No OGC Preview
        ResourcePreview->>Browser: Render static preview
    end
    LeafletMap-->>Browser: Display interactive map
    Browser-->>User: Show map with applied styles
Loading
sequenceDiagram
    participant Page as Dataset Page
    participant CkanTranslations
    participant PageHero
    participant Browser

    Page->>CkanTranslations: getLocalizedTextWithLang(title_translated, locale)
    CkanTranslations-->>Page: {text, lang}
    Page->>Page: Compute titleLang & descriptionLang
    Page->>PageHero: Pass title, description, titleLang, descriptionLang
    PageHero->>PageHero: Render h1 with lang={titleLang}
    PageHero->>PageHero: Render description div with lang={descriptionLang}
    PageHero-->>Browser: HTML with lang attributes
    Browser->>Browser: Screen reader announces language
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • mpolidori

Poem

🐰 Whiskers twitching with semantic glee,
HTML tags now dance as they should be,
Lang attributes guide each translation's way,
Maps styled with SLD on display,
Accessibility blooms—a hopper's hooray! 🌿✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Render WMS previews for geoserver connected resources' accurately captures the primary focus of the changeset, which adds support for rendering WMS (and WFS) map previews.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/wms-wfs-previews

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@willy1989cv willy1989cv requested a review from mpolidori April 11, 2026 16:47
@mpolidori mpolidori merged commit ae31bfb into staging Apr 13, 2026
4 checks passed
@mpolidori mpolidori deleted the feat/wms-wfs-previews branch April 13, 2026 12:20
@coderabbitai coderabbitai Bot mentioned this pull request Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants