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

Four Kitchens Release - Sprint 40 #1415

Merged
merged 12 commits into from
Jan 22, 2024
Merged

Four Kitchens Release - Sprint 40 #1415

merged 12 commits into from
Jan 22, 2024

Conversation

cienvaras
Copy link
Collaborator

@cienvaras cienvaras commented Dec 5, 2023

READY FOR REVIEW

Summary

  • SHS-5149: A11y Empty/nested headings on views cards
  • SHS-5150: A11y Empty/nested headings in Views groupings
  • SHS-5151: A11y empty headings on view templates for LEGACY theme
  • SHS-5134: Photo Album links have unhelpful aria-label
  • SHS-4981: [EX] Dynamically change label for hs_hero_image paragraph type based on context
  • SHS-5154: Layout Builder Styling

Need Review By (Date)

12/15

Urgency

medium

Steps to Test

SHS-5149

  1. Visit the following links:
    https://chemistry.suhumsci.loc/people/lecturers
    https://jewishstudies.suhumsci.loc/academics/awards-and-opportunities
    https://mrc.suhumsci.loc/videos
    https://francestanford.suhumsci.loc/project-area-study/humanities-arts
  2. Ensure that they are no longer producing empty heading tags (compare to:
    https://chemistry.stanford.edu/people/lecturers
    https://jewishstudies.stanford.edu/academics/awards-and-opportunities
    https://mrc.stanford.edu/videos
    https://francestanford.stanford.edu/project-area-study/humanities-arts)

SHS-5150

Ensure there are no longer WAVE issues around empty heading tags printing on the following pages:

https://anthropology.suhumsci.loc/people/faculty-and-affiliates/faculty/leadership
https://dlcl.suhumsci.loc/people/faculty
https://shenlab.stanford.edu/people

Also check:
https://hs-traditional.suhumsci.loc/default-views/people

Please note that I have found one outlying issue that is noticeable in the traditional example. If the view returns "grouped" content, and it is grouped by a field that allows the user to select nothing, the field will print with comments inside the <h3>. I believe this will only happen live when logged in (I'm having trouble testing that since I can see template comments logged out locally.)

SHS-5151

  1. The issue can be seen in this site:
    https://mathematics.stanford.edu/people/department-administration
  2. Visit the same page locally https://mathematics.suhumsci.loc/people/department-administration to see the changes fix in place. If you are logged in, you will no longer see the issue in Editorially.

SHS-5134

  1. Visit an example page with a Photo Gallery like http://hs-colorful.suhumsci.loc/components/photo-album
  2. The thumbnail gallery images should be links. In the markup, the links should have an aria-title attribute. This attribute should be (in this order): "Open [ALT TEXT] image in the gallery" if the alt text isn't blank, or generic text "Open image in the gallery" if neither of those exist.

SHS-4981

  1. Login as an administrator
  2. Create a new flexible page
  3. Add an hs_carousel (Banner image(s) with text box) component
  4. Verify the component's Add button has the text Add Banner image with text box
  5. Verify the Paragraph type label for all items within the hs_carousel component have the text Banner image with text box
  6. Add an hs_hero_image (Banner image with full overlay and text) component
  7. Verify the component's Paragraph type label has the text Banner image with full overlay and text

SHS-5154

  1. Visit a page that uses layout builder (like the homepage)
  2. Edit the homepage and click layout
  3. Verify that checkboxes have been themed to be smaller and next to their label
  4. Verify that the revision information detail element is closed by default
  5. Note that the fields and labels are better distinguished (grouped together, with more margin between each pair.)

PR Checklist

* fix(SHS-5134): fixing titles on colorbox galleries

* fix(shs-5134): adjustments to aria-labels on galleries

* fix(SHS-5134): removing custom data-cbox-img-attrs value

* fix(shs-5134): simplifying alt attribute
@cienvaras cienvaras changed the base branch from develop to 10.0.5-release December 5, 2023 15:33
mndonx and others added 5 commits December 5, 2023 09:53
* fix(shs-5150): fixing empty headings on grid views

* fix(shs-5149): ensuring that empty card title tags are not printing

* fix(shs-5149): removing unused code

* fix(shs-5149): removing unused code

* feat(shs-5149): add content heading check to date-stacked-vertical-card pattern

---------

Co-authored-by: Andrés Díaz Soto <[email protected]>
…ype based on context (#1417)

* feat(shs-4981): update labels for hs_carousel form and embedded paragraph types

* feat(shs-4981): add use statement

* feat(shs-4981): fix codeclimate issues

* feat(shs-4981): check if array offsets exist before accessing them

* fix(shs-4981): typo

---------

Co-authored-by: Andrés Díaz Soto <[email protected]>
* fix(shs-5154): theming adjustments to layout builder forms

* fix(shs-5154): close revision information details by default

* fix(shs-5154): fixing code climate errors

* fix(shs-5154): refining selector for revision info js

---------

Co-authored-by: Andrés Díaz Soto <[email protected]>
@cienvaras cienvaras marked this pull request as ready for review December 14, 2023 03:42
Base automatically changed from 10.0.5-release to develop December 14, 2023 18:47
@cienvaras cienvaras changed the base branch from develop to 10.0.6-release December 14, 2023 18:53
@cienvaras cienvaras requested review from joegl and pookmish December 14, 2023 18:54
Base automatically changed from 10.0.6-release to develop December 14, 2023 18:58
@cienvaras cienvaras changed the base branch from develop to 10.0.7-release December 14, 2023 19:12
/**
* Implements hook_field_widget_single_element_WIDGET_TYPE_form_alter().
*/
function hs_paragraph_types_field_widget_single_element_paragraphs_form_alter(&$element, &$form_state, $context) {
Copy link
Member

Choose a reason for hiding this comment

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

$element and $context should be typehinted.
$form_state is a FormStateInterface. It should be typehinted and doesn't need to be passed by reference.

Copy link
Contributor

Choose a reason for hiding this comment

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

Moved to hs_paragraph_types_field_widget_complete_paragraphs_form_alter and fixed there

*/
function hs_paragraph_types_field_widget_single_element_paragraphs_form_alter(&$element, &$form_state, $context) {
// Change the paragraph type label for hs_hero_image embedded in hs_carousel.
if ($element['#paragraph_type'] === 'hs_hero_image' && $element['#bundle'] === 'hs_carousel') {
Copy link
Member

Choose a reason for hiding this comment

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

No need for the triple = here. Double is enough and is consistent with out normal code practice

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed

/**
* Implements hook_field_widget_single_element_WIDGET_TYPE_form_alter().
*/
function hs_paragraph_types_field_widget_single_element_paragraphs_form_alter(&$element, &$form_state, $context) {
Copy link
Member

Choose a reason for hiding this comment

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

Change this to a hook_field_widget_complete_form_alter. See the comment in the API documentation: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/field/field.api.php?ref_type=heads#L231

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed

// Change the add button label for field_hs_carousel_slides.
if (
isset($field_widget_form['widget']['add_more']['add_more_button_hs_hero_image'], $field_widget_form['widget']['#field_name']) &&
$field_widget_form['widget']['#field_name'] === 'field_hs_carousel_slides'
Copy link
Member

Choose a reason for hiding this comment

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

No need for the triple = here. Double is enough and is consistent with out normal code practice

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed

Comment on lines +61 to +66
<div{{ attributes.addClass(classes) }}>
{% if options.alignment == 'horizontal' %}
{% for row in items %}
<div{{ row.attributes.addClass(row_classes, options.row_class_default ? 'row-' ~ loop.index) }}>
{% for column in row.content %}
<div{{ column.attributes.addClass(col_classes, options.col_class_default ? 'col-' ~ loop.index) }}>
Copy link
Member

Choose a reason for hiding this comment

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

What are the thoughts on changing this to <ul> and <li> elements? View results are typically lists and we should present that to screen readers as such.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@pookmish Yes, this is definitely a good improvement and something we can check and implement in traditional and colorful themes. We'd prefer to keep this particular template as is, because the legacy theme is going to be phased out soon. We just added these templates to fix a specific a11y issue in mathematics, but the site will soon be migrated to one of the new themes.

@cienvaras cienvaras requested a review from pookmish January 12, 2024 22:32
@cienvaras
Copy link
Collaborator Author

@pookmish All issues fixed, ready for review. Thanks for the feedback!

Copy link
Member

@pookmish pookmish left a comment

Choose a reason for hiding this comment

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

There's only one thing I want to verify.

Comment on lines 51 to 57
foreach ($field_widget_form['widget'] as $key => $element) {
// Only alter markup in field widget elements.
if (!is_int($key)) {
continue;
}
$element['top']['type']['label']['#markup'] = $new_label;
$field_widget_form['widget'][$key] = $element;
Copy link
Member

Choose a reason for hiding this comment

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

Don't you need to loop by reference if you want to change the label? &$element

Copy link
Member

Choose a reason for hiding this comment

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

Oh now that i read it more closely, it would be alot better to loop by reference and remove line 57 entirely.
Also, a better way (and more consistent with core code) to loop on the keys is to use \Drupal\Core\Render\Element::children($field_widget_form['widget']). This will give you the keys and you can check for values in the arrays.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@pookmish Fixed. PR is ready for review again.

@cienvaras cienvaras requested a review from pookmish January 22, 2024 15:11
@pookmish pookmish merged commit 14b85e6 into 10.0.7-release Jan 22, 2024
7 of 8 checks passed
@pookmish pookmish deleted the fk-stnfd-sprint-40 branch January 22, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants