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

Standardising null and empty arrays #77

Closed

Conversation

nataliecarey
Copy link
Contributor

This is the HMRC equivalent of alphagov/govuk-frontend#1638 which is best explained in this issue alphagov/govuk-frontend#1618.

This PR includes an update of the header component which had fallen out of sync with govuk-frontend. No other changes were required in the production code but I've added a test to make sure the output remains the same in these cases where itemList is used in add-to-a-list.

{{ params.serviceName }}
</a>
{% endif %}
{% if params.navigation %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the idea of this change to not show the navigation if an empty list is provided?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I would have thought the same. So should be:

Suggested change
{% if params.navigation %}
{% if params.navigation | length %}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I got this from GDS. It's a decision between consistency and correctness I guess. I'm happy to add it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this not what the PR is for though? Just asking because I might be misinterpreting the reason for the PR. Should this be upstreamed if this is accepted? I think the navigation might have been changed slightly recently so may not be applicable anymore.

config/paths.json Outdated Show resolved Hide resolved
@@ -56,38 +55,29 @@
{% endif %}
</a>
</div>

{% if params.serviceName or params.navigation or params.signOutHref or params.languageToggle %}
{% if params.serviceName or params.navigation %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't the params.signOutHref and params.languageToggle on of the reasons this was forked initially? Should we keep these in?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 What's the reason for taking these out?

{{ params.serviceName }}
</a>
{% endif %}
{% if params.navigation %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I would have thought the same. So should be:

Suggested change
{% if params.navigation %}
{% if params.navigation | length %}

src/components/add-to-a-list/template.test.js Show resolved Hide resolved
@@ -56,38 +55,29 @@
{% endif %}
</a>
</div>

{% if params.serviceName or params.navigation or params.signOutHref or params.languageToggle %}
{% if params.serviceName or params.navigation | length %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we still need the params.signOutHref here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we do, I'll add that back in. Sorry.

</nav>
{% endif %}
{% if params.serviceName %}
<a href="{{ params.serviceUrl }}" class="govuk-header__link govuk-header__link--service-name">
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's a discussion going on at the moment about if the service name is displayed but serviceUrl isn't supplied. Not a change for this PR necessarily but wanted to mention.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's a good conversation to have but I'd see it as separate to this PR.

@nataliecarey
Copy link
Contributor Author

Updated :)

@matthewmascord
Copy link
Contributor

Closing as superceded by #81

@matthewmascord matthewmascord deleted the PLATUI-345_standardising-null-and-empty-arrays branch June 19, 2020 15:40
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.

3 participants