Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-7410: Language related accessibility fixes for job listings and job search #217

Merged
merged 3 commits into from
Mar 21, 2023

Conversation

juho-lehmonen
Copy link
Contributor

@juho-lehmonen juho-lehmonen commented Mar 20, 2023

UHF-7410

This PR adds correct wrapping elements to lang parameters on job listing pages (spans for inline elements) and separates the language wrapper from the the translated "x jobs" text in job search results.

How to install

  • Make sure your instance is up and running on correct branch.
    • git checkout UHF-7410-accessibility-language-fixes
    • make fresh
    • If you get an ERROR 1273 (HY000) at line 14784: Unknown collation: 'utf8mb4_0900_ai_ci' error with the database import, run make shell and then:
      • sed -i 's/utf8mb4_0900_ai_ci/utf8mb4_swedish_ci/g' dump.sql; drush sql-query --file=/app/dump.sql && drush helfi:oc:sanitize-database && drush cim -y;drush updb -y;drush cr;drush uli
  • Run make ps to get the correct proxy port for drupal-helfi-rekry-elastic. Should be 9200 but might change if you have multiple ES proxies running.
    • Edit the .env file and change the port in ELASTIC_PROXY_URL
    • Run make up again for the change to take effect
  • Run make drush-cr
  • Run make shell and then drush sapi-rt;drush sapi-i to make sure content is indexed properly

How to test

  • Job search result changes work as intended
    • Go to https://helfi-rekry.docker.so/en/open-jobs/find-open-jobs and find a listing that has multiple jobs
    • Inspect the heading element. The untranslated part should be wrapped with <span lang> element while the "x job" text should be wrapped with just a blank <span> element.
    • Find a listing that doesn't have multiple jobs. Inspect the heading element to make sure it doesn't have an empty <span> after the heading.
  • Job listing page changes work as intended
    • On the english search page, find a finnish language job listing and open it
    • Inspect the heading and the salary field. It should be wrapped in a span element with a language parameter instead of a div
    • Inspect the body text. The p-elements should be contained in a div that has the language parameter
  • Check that code follows our standards

Designers review

  • This PR does not need designers review

];

// Use span instead of div for inline fields.
if ($variables['field_name'] && in_array($variables['field_name'], $inlineFields)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the first if condition be isset($variables['field_name'])?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this should be fixed now

@juho-lehmonen juho-lehmonen force-pushed the UHF-7410-accessibility-language-fixes branch from 29e1a41 to 2fb98d7 Compare March 20, 2023 08:58
@sonarcloud
Copy link

sonarcloud bot commented Mar 20, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@juho-lehmonen juho-lehmonen merged commit 607b9dd into dev Mar 21, 2023
@juho-lehmonen juho-lehmonen deleted the UHF-7410-accessibility-language-fixes branch March 21, 2023 07:31
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