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-8128: Missing H1 #643

Merged
merged 1 commit into from
Apr 27, 2023
Merged

UHF-8128: Missing H1 #643

merged 1 commit into from
Apr 27, 2023

Conversation

khalima
Copy link
Contributor

@khalima khalima commented Apr 26, 2023

UHF-8128

What was done

  • Added constraint for missing hero block entities in entity forms and enhanced the checks for the hero block to prevent missing H1 elements.

How to install

  • Make sure your instance is up and running on latest dev branch.
    • git pull origin dev
    • make fresh
  • Update the Helfi Platform config and the HDBT theme
    • composer require drupal/helfi_platform_config:dev-UHF-8128_missing_h1 drupal/hdbt:dev-UHF-8128_missing_h1
  • Import translations by running drush locale:check; drush locale:update in shell
  • Run make drush-cr

How to test

  • Go to create or edit a landing page

    • Check the Hero checkbox and remove hero paragraph from the three dots
      image
    • Try to save the landing page and check that there's a warning message: Hero paragraph is mandatory if the Hero checkbox has been selected. Either unselect the checkbox or create the hero paragraph by clicking the Add Hero button.
    • Uncheck the Hero checkbox or add the hero paragraph and retry to save the landing page. It should now work.
  • Open public/modules/contrib/helfi_platform_config/modules/hdbt_admin_tools/src/Plugin/Validation/Constraint/HeroConstraintValidator.php in your IDE and comment the line 29 $this->context->addViolation($constraint->heroRequired);

  • Clear the caches and go to edit the landing page. Check the Hero checkbox and remove the paragraph. Save the landing page.

    • Check that the landing page title is displayed on the page even if the Hero checkbox is checked and hero paragraph is missing.
    • Go to edit the page again, re-add the hero paragraph, save the node and check that the hero is displayed on the page again
  • Check that code follows our standards

Other PRs

Copy link
Contributor

@teroelonen teroelonen left a comment

Choose a reason for hiding this comment

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

Worked perfectly 🦖

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