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

GOV.UK Framework | Workplace | Confirm Vacancies #696

Merged
merged 7 commits into from
Jun 13, 2019

Conversation

ChazUK
Copy link
Contributor

@ChazUK ChazUK commented Jun 12, 2019

Extended the Panel SCSS to include an interruption card alphagov/govuk-design-system-backlog#27
Added Definition List SCSS to display block of 3 list items, using CSS Grids, making sure it's prefixed for IE.

Updating Confirm Vacancies to use the GOV.UK Design Framework

@ChazUK ChazUK self-assigned this Jun 12, 2019
@ChazUK
Copy link
Contributor Author

ChazUK commented Jun 12, 2019

<p class="govuk-heading-m">You told us you have:</p>
<dl class="govuk-list--definition govuk-list--definition-xl govuk-!-margin-bottom-8">
<dt>Current staff vacancies</dt>
<dd>{{ establishment.TotalVacencies }}</dd>
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume TotalVacencies property is coming back from the BE like this? weird casing and spelling...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep :(

background-color: govuk-colour('blue');
text-align: left;

* {
Copy link
Contributor

Choose a reason for hiding this comment

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

is the wildcard selector needed here? if so do we need the color's applied to the anchor states?

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, if the wildcard isn't there we'd have to set the colour for every element as it's usually the default black.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is going to be a temporary fix until they bring in the Interruption Card properly in GDS alphagov/govuk-design-system-backlog#27

color: #fff;
}

a {
Copy link
Contributor

Choose a reason for hiding this comment

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

could probs combine like

a, a:link, a:visited { color: #fff; )

also would be good to use variables for colors src/assets/scss/partials/_colors.scss

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should probably extend the govuk-colour map to contain these new colours and then use that instead of just the colour variable, will update though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Colours updated and rules grouped

.pipe(map(jobs => jobs.TotalVacencies))
.subscribe(total => (this.total = total))
this.subscriptions.add(
this.establishmentService.establishment$.pipe(take(1)).subscribe(establishment => {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to subscribe to to this observable? the workplace module has the Auth guard set so to be able to access this route the user has to be logged in and therefore the establishment would be already set on the EstablishmentService anyway? we could probs just do something like this.establishment = this.establishmentService.establishment;....?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After taking another look at this we should leave it in. Comes down to the state management RXJS Pattern and best practices, you should access the state directly, and instead subscribe to the observable. This would definitely be clearer with NGXS/NGRX as there's a set way to pull data from the state. I do the same thing on the Question pages, which this is a part of.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Btw, there isn't any extra HTTP request that is being made for this page.

);
}

ngOnDestroy() {
this.subscriptions.forEach(s => s.unsubscribe());
this.subscriptions.unsubscribe();
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont think you need to unsubscribe if you do a take(1)

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 reason I've put the unsubscribe here is if the person navigates away from the page we want to cancel that request, very unlikely, but just good practice I think. And per your previous comment I think this can probably be removed too.

Copy link
Contributor

@omarCreativeDev omarCreativeDev left a comment

Choose a reason for hiding this comment

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

pr looks good, i made some minor comments. p.s im not css grid savvy enough to comment on the grid stuff but will make some time asap to educate myself

@ChazUK ChazUK merged commit 2d7ed40 into develop Jun 13, 2019
@ChazUK ChazUK deleted the feature/accessibility-confirm-vacancies branch June 20, 2019 15:10
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.

None yet

3 participants