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

SDSS-840: Add unsectioned News paragraphs to layout_paragraph sections #205

Merged
merged 14 commits into from
Aug 17, 2023

Conversation

joegl
Copy link
Collaborator

@joegl joegl commented Aug 9, 2023

READY FOR REVIEW

Summary

  • We changed the components field from Classic Paragraphs to Layout Paragraphs, but none of the paragraphs were added to sections.
  • This adds an updatedb hook that moves any "un-sectioned" components into a 1 column layout section.
  • This is affecting the site visually (the one column section keeps the paragraphs "centered") -- this is visible

Review By (Date)

  • ASAP

Review Tasks

Setup tasks and/or behavior to test

  1. Check out this branch
  2. Sync the Sustainability site blt drupal:sync --site=sustainability
  3. Run the updatedb hooks (if they haven't run already) drush updatedb
  4. Ensure all News components are in a section now.

Front End Validation

  • Is the markup using the appropriate semantic tags and passes HTML validation?
  • Cross-browser testing has been performed?
  • Automated accessibility scans performed?
  • Manual accessibility tests performed?
  • Design is approved by @ user?

Backend / Functional Validation

Code

  • Are the naming conventions following our standards?
  • Does the code have sufficient inline comments?
  • Is there anything in this code that would be hidden or hard to discover through the UI?
  • Are there any code smells?
  • Are tests provided? eg (unit, behat, or codeception)

Code security

General

  • Is there anything included in this PR that is not related to the problem it is trying to solve?
  • Is the approach to the problem appropriate?

Affected Projects or Products

  • Does this PR impact any particular projects, products, or modules?

Associated Issues and/or People

https://stanfordits.atlassian.net/browse/SDSS-840

Resources

@joegl joegl requested a review from pookmish August 9, 2023 17:43
@joegl joegl requested a review from pookmish August 14, 2023 21:26
@joegl
Copy link
Collaborator Author

joegl commented Aug 15, 2023

@pookmish I know I was pushing fixups after I re-requested review -- this is ready now.

Copy link
Contributor

@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.

This still doesn't address one possible scenario:

one column
  - text area
text area 2
two column
  - card
  - text area 3
card 2

In this instance text area 2 and card 2 would end up belonging to the same one column layout and result in the order of the items changing. It would result in this outcome:

one column
  - text area
two column
  - card
  - text area 3
one column
  - text area 2
  - card 2

The chance of this happening is probably slim to none but it is a possibility. The only way to truely solve such a scenario is to create one column rows for ever "unsectioned" paragraph.

@joegl joegl requested a review from pookmish August 16, 2023 22:05
@joegl
Copy link
Collaborator Author

joegl commented Aug 17, 2023

This still doesn't address one possible scenario:

one column
  - text area
text area 2
two column
  - card
  - text area 3
card 2

In this instance text area 2 and card 2 would end up belonging to the same one column layout and result in the order of the items changing. It would result in this outcome:

one column
  - text area
two column
  - card
  - text area 3
one column
  - text area 2
  - card 2

The chance of this happening is probably slim to none but it is a possibility. The only way to truely solve such a scenario is to create one column rows for ever "unsectioned" paragraph.

I re-wrote the code to add every "unsectioned" paragraph to its own section paragraph, and then spliced the section paragraph into the component list at the same delta as the original paragraph + however many new paragraphs have been added for that node.

Copy link
Contributor

@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.

Thanks for addressing my concerns.

@joegl
Copy link
Collaborator Author

joegl commented Aug 17, 2023

Thanks for addressing my concerns.

Thanks for all your feedback. It was really constructive and I learned a lot.

@joegl joegl merged commit 7a59cd5 into 2.x Aug 17, 2023
@joegl joegl deleted the SDSS-840--migrate-news-layout-paragraphs branch August 17, 2023 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants