OTWO-7630 Implement BDSA Page Design and SEO#1892
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates the BDSA (Black Duck Security Advisories) vulnerability UI to introduce a redesigned landing/show experience with improved SEO metadata, structured data (JSON-LD) markup, updated cookie/terms gating behavior, and substantial styling/UX updates.
Changes:
- Adds a BDSA landing page experience in the vulnerability layout, plus theme toggle and updated search UX (header/landing/mobile).
- Introduces SEO metadata (title/description/canonical/keywords) and JSON-LD schema generation via a new service and helper methods.
- Updates cookie disclaimer flow to gate show-page content behind acceptance, including AJAX-based content loading after acceptance.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/controllers/api/vulnerabilities_controller_test.rb | Updates expectations for the new disclaimer-gated placeholder behavior and adds an index route check. |
| config/locales/vulnerabilities.en.yml | Adds BDSA-specific landing/show/shared copy used for SEO and UI text. |
| app/views/layouts/vulnerability.html.haml | Major layout redesign: SEO/meta tags, JSON-LD injection, new header/search UI, landing page markup, and disclaimer-gated yielding. |
| app/views/cookies/_bdsa_disclaimer.html.haml | Redesigns the terms/disclaimer modal content and CTA markup. |
| app/views/api/vulnerabilities/show.html.haml | Adjusts show-page header and responsive grid sizing. |
| app/views/api/vulnerabilities/no_data.html.haml | Updates no-data messaging and styling hooks. |
| app/views/api/vulnerabilities/_cve.html.haml | Updates responsive column sizing for CVE panel. |
| app/views/api/vulnerabilities/_bdsa.html.haml | Updates responsive column sizing for BDSA panel. |
| app/services/bdsa_schema_service.rb | Adds a dedicated service to build JSON-LD schema for landing and vulnerability pages. |
| app/helpers/api/vulnerabilities_helper.rb | Adds helper methods to render the JSON-LD schema generated by the new service. |
| app/controllers/api/vulnerabilities_controller.rb | Adds an index action and refactors show to support SEO metadata and shared fetch logic. |
| app/assets/stylesheets/api/custom.sass | Large styling update for the new landing/header/modal/theme/no-data UI. |
| app/assets/javascripts/api/vulnerability.js.coffee | Adds theme toggle, new search handlers, mobile search toggle, and AJAX content loading after disclaimer acceptance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| %header.modern-header | ||
| .modern-header-gradient | ||
| .modern-header-content | ||
| %a.logo-link{ href: "#{root_path}", target: '_blank' } |
| %meta{ property: 'og:title', content: page_title } | ||
| %meta{ property: 'og:description', content: @meta_description } | ||
| %meta{ property: 'og:type', content: 'website' } | ||
| %meta{ property: 'og:url', content: @canonical_url } |
| - if action_name == 'index' | ||
| %meta{ name: 'keywords', content: t('vulnerabilities.bdsa.index.keywords') } | ||
| - elsif action_name == 'show' && @response | ||
| - keywords = "#{params[:id].upcase}, security advisory, vulnerability, BDSA" | ||
| - keywords += ", #{@cve_id}" if @cve_id | ||
| - keywords += ", #{@response['title']}" | ||
| %meta{ name: 'keywords', content: keywords } | ||
| %script{ src: 'https://cdnjs.cloudflare.com/ajax/libs/highcharts/11.4.1/highstock.min.js' } | ||
| %script{ src: 'https://cdnjs.cloudflare.com/ajax/libs/highcharts/11.4.1/modules/accessibility.min.js' } | ||
| = stylesheet_link_tag 'api/vulnerability', media: 'all' | ||
| = javascript_include_tag 'api/vulnerability' | ||
| %link{ href: '//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic' } | ||
| - if action_name == 'index' | ||
| %script{ type: 'application/ld+json' } | ||
| != json_escape(render_landing_page_schema_markup) | ||
| - elsif action_name == 'show' && @response | ||
| %script{ type: 'application/ld+json' } | ||
| != json_escape(render_vulnerability_schema_markup) |
| %i.fa.fa-sun-o.theme-icon-light | ||
| %i.fa.fa-moon-o.theme-icon-dark | ||
| .header-search-bar | ||
| %i.fa.fa-search.header-search-icon |
| %span.checkmark | ||
| %span.checkbox-label | ||
| I have read and accept the | ||
| = link_to "API & Data License Agreement", asset_url("docs/API_License_Agreement.pdf"), download: 'API_License_Agreement.pdf', class: 'agreement-link', target: '_blank' |
| set: () -> | ||
| Cookies.set 'bdsa_cookie_disclaimer', 0 | ||
| location.reload() | ||
| Cookies.set 'bdsa_cookie_disclaimer', 0, { path: '/' } | ||
| if $('#bdsa-content-placeholder').length > 0 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
app/assets/javascripts/api/vulnerability.js.coffee:207
- In
BdsaCookieConsent.init, whenbdsaVisitedCount >= 35you delete the cookie but the click handler still checks the originalbdsaCookiesAllowedvalue captured at init time, so users won’t be able to accept/continue. Consider checkingCookies.get(...)at click-time (or resettingbdsaCookiesAllowedafter deletion) and use a consistent deletion API (e.g.,Cookies.remove('bdsa_cookie_disclaimer', { path: '/' })) instead ofcookieStore.delete, which may be undefined/unsupported.
init: () ->
bdsaCookiesAllowed = Cookies.get('bdsa_cookie_disclaimer')
if bdsaCookiesAllowed
bdsaVisitedCount = parseInt(bdsaCookiesAllowed)
if bdsaVisitedCount < 35
Cookies.set 'bdsa_cookie_disclaimer', bdsaVisitedCount + 1, { path: '/' }
else
cookieStore.delete('bdsa_cookie_disclaimer')
$('#bdsa_disclaimer_cookies').show()
$('.bdsa_disclaimer_accept').on 'click', (e) ->
BdsaCookieConsent.set() unless bdsaCookiesAllowed
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| = Time.current.year | ||
| %span{ itemscope: '', itemtype: 'http://schema.org/CreativeWork' } | ||
| %span{ itemprop: 'publisher' } | ||
| %a{ href: 'http://www.blackduck.com', target: '_blank', rel: 'noopener' }= "Black Duck Software, Inc." |
No description provided.