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

Update past foreign secretaries #6243

Closed
wants to merge 2 commits into from

Conversation

chris-gds
Copy link
Contributor

@chris-gds chris-gds commented Aug 19, 2021

What

Update Past Foreign Secretaries Page to apply new Design + Design system + use Components

Why

On-going work to align architecture, have pages benefit from Accessibility improvements

Visuals

Before After
www gov uk_government_history_past-foreign-secretaries(iPhone-6_7_8-Plus) www gov uk_government_history_past-foreign-secretaries(Moto G4)
www gov uk_government_history_past-foreign-secretaries www gov uk_government_history_past-foreign-secretaries (1)

Done when

Grouped related PRs

#6236
#6243
#6241

Anything else?

Add link to image card heading - this is not dependant
alphagov/govuk_publishing_components#2277

Implementing a semantic list in this context + the Design System layout could be done various different ways. This might prompt a change during review.

@chris-gds chris-gds force-pushed the update-past-foreign-secretaries branch 2 times, most recently from 385af80 to 3dda0d6 Compare August 19, 2021 16:58
@chris-gds chris-gds force-pushed the update-past-foreign-secretaries branch from 3dda0d6 to 7aeb7ba Compare August 20, 2021 15:09
@chris-gds chris-gds marked this pull request as ready for review August 20, 2021 15:53
@chris-gds chris-gds requested a review from jon-kirwan August 20, 2021 15:53
This was referenced Aug 20, 2021
@jon-kirwan
Copy link
Contributor

All looks good to me. Just one small comment to add with relation to -

https://github.com/alphagov/whitehall/pull/6243/files#diff-4c36183021f514ff3edc854264a1c1c1d3b5a954d499f383bd9a56cd5729cfeaR21

  .govuk-heading-s--foreign-secretary-profile {
    margin-bottom: 0;
  }

I wondered if an alternative approach could be to replace this CSS with the govuk-!-margin-bottom-0 class?

@chris-gds
Copy link
Contributor Author

I wondered if an alternative approach could be to replace this CSS with the govuk-!-margin-bottom-0 class?

Good call, should work the same, i'll update and remove those extra lines.

@chris-gds chris-gds force-pushed the update-past-foreign-secretaries branch 2 times, most recently from 16b0bab to 24f871b Compare August 24, 2021 09:35
@chris-gds
Copy link
Contributor Author

@jon-kirwan updated! Tests were failing but needed a rebuild.

@chris-gds chris-gds requested a review from maxgds August 24, 2021 13:31
@chris-gds chris-gds force-pushed the update-past-foreign-secretaries branch from 24f871b to 537ee0b Compare August 24, 2021 16:50
Copy link
Contributor

@maxgds maxgds left a comment

Choose a reason for hiding this comment

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

While the output is sound, I have reservations around the div vs li markup and am concerned about the level of repetition that exists. I think the 3 pages dealt with in the one trello ticket could be sharing more code because of their similarities and would like you to explore that a bit more rather than merging as-is.

app/assets/stylesheets/frontend/views/_history-people.scss Outdated Show resolved Hide resolved
app/views/past_foreign_secretaries/index.html.erb Outdated Show resolved Hide resolved
app/views/past_foreign_secretaries/index.html.erb Outdated Show resolved Hide resolved
app/views/past_foreign_secretaries/index.html.erb Outdated Show resolved Hide resolved
@chris-gds chris-gds marked this pull request as draft September 3, 2021 14:19
@chris-gds chris-gds force-pushed the update-past-foreign-secretaries branch from fac8615 to 2ae256c Compare September 3, 2021 15:31
@chris-gds chris-gds marked this pull request as ready for review September 3, 2021 17:15
@chris-gds chris-gds requested a review from maxgds September 3, 2021 17:26
@chris-gds chris-gds force-pushed the update-past-foreign-secretaries branch from 2ae256c to 4ab99ec Compare September 3, 2021 17:39
Copy link
Contributor

@maxgds maxgds left a comment

Choose a reason for hiding this comment

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

This is looking much better from a DRY perspective, but I think I haven't communicated very well what I was aiming for. The three pages on this one trello card are using the same patterns throughout, there seems to be value in sharing not just the css, but the partial here. I think this is a good first step towards uniting them like that, but if that's the end game the person and image partial names and locations should be more generic. I know the underlying code that builds each page differs but do you think this is achievable?

.featured-profiles {
margin-bottom: $gutter;
// unique image card styles for "past-foreign-secretaries" & "past-past-chancellor"
.gem-c-image-card__list-item-link {
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't feel great, overriding component styles. Willing to let it pass if we absolutely have to but I'd suggest considering either/or 1) Checking with design that the default isn't good enough, 2) making this style the default for the "unlinked links".

Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't be overriding component styles in applications - it breaks component isolation - e.g. if we were to change the name of this class in the component, this override would suddenly stop working and we wouldn't know about it.

If the link styles definitely need to be different in this one situation, please add it as an option to the component. Do they definitely need to be different?

Copy link
Contributor Author

@chris-gds chris-gds Sep 6, 2021

Choose a reason for hiding this comment

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

This doesn't feel great, overriding component styles. 1) Checking with design that the default isn't good enough, 2) making this style the default for the "unlinked links".

Agreed, I've removed. 🤔
I think I was looking at the page "as a whole" and noticed this mismatch - I'm not sure why I decided to knowingly break convention with a tweak.

If the link styles definitely need to be different in this one situation, please add it as an option to the component. Do they definitely need to be different?

Yeah they don't - not really. It's a slight visual variation but yeah it might be a good case to up-the-font for this across the whole image_card to match govuk-body but not essential

Chris Yoong added 2 commits September 6, 2021 09:41
- Group via century 
- Apply Design System
- Use Components 
- Add lazy loading to images
- Separate data and add to partials
- Remove redundant CSS

- Update a selection of headings link to the particular profile of that person. 
As headings are not typically link-able (and not within the heading component) this "custom" to this page and maintains previous functionality

- Adjusting CSS style naming to be more generic to apply wider.

- Due to additional work on this PR[1] lazy loading has been added to the image_cards to improve the performance.

- "extra_links" that is text only is also in use on the image_card 

- Add aria to ensure the markup reads as grouped lists to AT yet maintain the Design System layout and styling without adding additional code. (This also potentially allows for more fine grain control of what is within grouped lists)

- No alt on image as decorative

---
Explored using ol > li markup however decided against it due to the nested grouping that was needed to apply the Design System's rows and columns. 

This page is somewhat un-usual, in that this is list of images.  For example to convert to a list and use the grid system -  markup similar to this is needed which is invalid:

ol (21st century) > div (rows wrapper) > li (column)
---

[1]alphagov/govuk_publishing_components#2270
Remove alt text from image
@chris-gds chris-gds force-pushed the update-past-foreign-secretaries branch from 4ab99ec to 1fdec4e Compare September 6, 2021 08:41
@chris-gds chris-gds requested a review from maxgds September 6, 2021 08:48
@chris-gds
Copy link
Contributor Author

chris-gds commented Sep 6, 2021

This is looking much better from a DRY perspective, but I think I haven't communicated very well what I was aiming for. The three pages on this one trello card are using the same patterns throughout, there seems to be value in sharing not just the css, but the partial here. I think this is a good first step towards uniting them like that, but if that's the end game the person and image partial names and locations should be more generic. I know the underlying code that builds each page differs but do you think this is achievable?

@maxgds I know what you mean - I've combined these 3 PRs into one as I think it makes it easier to review addressing this point - https://github.com/alphagov/whitehall/pull/6264/files

There might be a case to combine these but the data is different 🤔 let me know your thoughts.
app/views/historic_appointments/_role_appointment.html.erb
app/views/past_foreign_secretaries/_past_foreign_secretaries_image.html.erb

@chris-gds chris-gds mentioned this pull request Sep 6, 2021
@chris-gds
Copy link
Contributor Author

Moving into Draft (aim to close) as combined PR raised: #6264

@chris-gds chris-gds marked this pull request as draft September 6, 2021 15:22
@chris-gds chris-gds closed this Sep 7, 2021
@barrucadu barrucadu deleted the update-past-foreign-secretaries branch November 24, 2021 10:25
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.

4 participants