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

Fix format inconsistencies #830

Merged
merged 6 commits into from
Jun 27, 2018
Merged

Fix format inconsistencies #830

merged 6 commits into from
Jun 27, 2018

Conversation

alex-ju
Copy link
Contributor

@alex-ju alex-ju commented Jun 25, 2018

This:

Trello card

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-830 June 25, 2018 14:22 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-830 June 25, 2018 14:24 Inactive
@alex-ju alex-ju force-pushed the fix-format-inconsistencies branch from 751fdee to 074bfa0 Compare June 25, 2018 14:24
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-830 June 25, 2018 14:24 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend June 25, 2018 14:57 Inactive
CHANGELOG.md Outdated
([PR 824](https://github.com/alphagov/govuk-frontend/pull/824))
([PR #824](https://github.com/alphagov/govuk-frontend/pull/824))

- Fix YAML and Nunjucks format inconsistencies
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a fix? It doesnt look like any of the api has changed? I'm not sure

Copy link
Contributor Author

@alex-ju alex-ju Jun 25, 2018

Choose a reason for hiding this comment

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

Mmm.. no API changes, indeed. More of an internal, isn't it?

@alex-ju alex-ju force-pushed the fix-format-inconsistencies branch from 074bfa0 to 7be5f0f Compare June 25, 2018 16:34
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-830 June 25, 2018 16:38 Inactive
Copy link
Member

@hannalaakso hannalaakso left a comment

Choose a reason for hiding this comment

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

Looks really good. Just left a couple of small comments.

})
}}
html: 'It can take up to 8 weeks <a href="#">to register</a> a lasting power of attorney if there are no mistakes in the application.'
}) }}
Copy link
Member

Choose a reason for hiding this comment

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

This should have double quotes as well

Copy link
Contributor

Choose a reason for hiding this comment

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

That'd then require escaping the double quoted href attribute – personally I'd prefer to use single quotes rather than escaping in those scenarios, but that's a loosely held preference 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

I think in this specific circumstance single quotes is reasonable given we want to keep the HTML the same as elsewhere.

Copy link
Member

@hannalaakso hannalaakso Jun 26, 2018

Choose a reason for hiding this comment

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

Okay that makes sense 👍

},
"html": 'This is a new service – your <a href="#" class="govuk-link">feedback</a> will help us to improve it.'
html: 'This is a new service – your <a href="#" class="govuk-link">feedback</a> will help us to improve it.'
Copy link
Member

Choose a reason for hiding this comment

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

This should have double quotes

Copy link

Choose a reason for hiding this comment

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

see comment above

@@ -13,13 +13,13 @@
{% set previewLink = '/components/' + componentName + "/preview" %}
{% set previewText = 'Preview the ' + componentName + ' component' %}
{% else %}
{% set itemName = componentName + '--' + item.name %}
{% set itemName = (componentName + ' ' + item.name) | replace("-", " ") %}
Copy link
Member

Choose a reason for hiding this comment

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

Slightly outside the bounds of this PR but it would be really good to have a comment here to say why item.name has dashes which are then taken out here

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we go through and remove the dashes from the example names instead?

Copy link
Contributor

@36degrees 36degrees Jun 26, 2018

Choose a reason for hiding this comment

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

This would also then allow for dashes to still be used where appropriate – e.g. 'Label with govuk-label--xl modifier' which would otherwise become 'Label with govuk label xl modifier' with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The dashes from the example names are used to map the express routes.

  app.get('/components/:component/:example*?/preview', function (req, res, next) {

But if we're fine with having urls with %20 we can get rid of the dashes and use spaces instead.

Copy link
Contributor Author

@alex-ju alex-ju Jun 26, 2018

Choose a reason for hiding this comment

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

Updated so the example names are defined in YAML without dashes and are not affected by formatting (we can have dashes - Input with width-10 class, uppercases - Footer GOV.UK or any characters) while preserving nice urls.

@alex-ju alex-ju force-pushed the fix-format-inconsistencies branch from 7be5f0f to 69eceb0 Compare June 26, 2018 14:25
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-830 June 26, 2018 14:33 Inactive
Copy link

@kr8n3r kr8n3r left a comment

Choose a reason for hiding this comment

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

ace

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.

6 participants