Skip to content

Commit

Permalink
Merge pull request #1815 from thebiggive/add-titles
Browse files Browse the repository at this point in the history
Page title tidying: Add for Login & Register; append ' – Big Give' consistently
  • Loading branch information
NoelLH authored Jan 8, 2025
2 parents 57605df + e655111 commit 2f09c5f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/app/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {MatInputModule} from "@angular/material/input";
import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
import {IdentityService} from "../identity.service";
import {PageMetaService} from '../page-meta.service';
import {environment} from "../../environments/environment";
import {EMAIL_REGEXP} from "../validators/patterns";
import {ActivatedRoute, Router} from "@angular/router";
Expand Down Expand Up @@ -60,6 +61,7 @@ export class LoginComponent implements OnInit, AfterViewInit, OnDestroy{
constructor(
private readonly formBuilder: FormBuilder,
private readonly identityService: IdentityService,
private readonly pageMeta: PageMetaService,
private readonly activatedRoute: ActivatedRoute,
private readonly router: Router,
@Inject(PLATFORM_ID) private platformId: Object,
Expand All @@ -75,6 +77,8 @@ export class LoginComponent implements OnInit, AfterViewInit, OnDestroy{
}

ngOnInit() {
this.pageMeta.setCommon('Login', 'Login to your Big Give account', null);

if (isPlatformBrowser(this.platformId)) {
document.body.classList.add('primary-colour');
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/my-account/my-account.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export class MyAccountComponent implements OnInit {

ngOnInit() {
this.pageMeta.setCommon(
'Big Give - My account',
'Big Give – discover campaigns and donate',
'My account',
'Manage your Big Give account',
'https://images-production.thebiggive.org.uk/0011r00002IMRknAAH/CCampaign%20Banner/db3faeb1-d20d-4747-bb80-1ae9286336a3.jpg',
);

Expand Down
2 changes: 1 addition & 1 deletion src/app/my-donations/my-donations.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class MyDonationsComponent implements OnInit{

ngOnInit() {
this.pageMeta.setCommon(
'Big Give - Your Donation History', '', null
'Your Donation History', 'Your Big Give donations', null
);

this.donations = this.route.snapshot.data.donations.map(withComputedProperties);
Expand Down
2 changes: 1 addition & 1 deletion src/app/my-regular-giving/my-regular-giving.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class MyRegularGivingComponent implements OnInit{

ngOnInit() {
this.pageMeta.setCommon(
'Big Give - Your Regular Giving Mandates', '', null
'Your Regular Giving Mandates', 'Donations you make to support charities each month', null
);

this.mandates = this.route.snapshot.data.mandates;
Expand Down
4 changes: 4 additions & 0 deletions src/app/page-meta.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export class PageMetaService {
const link = links[0];
link.setAttribute('href', canonicalUri);

if (!title.includes('Big Give')) {
title = `${title} – Big Give`;
}

this.title.setTitle(title);
this.meta.updateTag( { property: 'og:title', content: title } );
this.meta.updateTag( { property: 'twitter:title', content: title } );
Expand Down
4 changes: 4 additions & 0 deletions src/app/register/register.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {transferFundsPath} from "../app-routing";
import {WidgetInstance} from "friendly-challenge";
import {flags} from "../featureFlags";
import {isAllowableRedirectPath, LoginNavigationState} from "../login/login.component";
import {PageMetaService} from '../page-meta.service';

@Component({
selector: 'app-register',
Expand Down Expand Up @@ -46,6 +47,7 @@ export class RegisterComponent implements OnInit, OnDestroy, AfterViewInit {
constructor(
private readonly formBuilder: FormBuilder,
private readonly identityService: IdentityService,
private readonly pageMeta: PageMetaService,
private readonly router: Router,
private sanitizer: DomSanitizer,
private readonly activatedRoute: ActivatedRoute,
Expand All @@ -60,6 +62,8 @@ export class RegisterComponent implements OnInit, OnDestroy, AfterViewInit {
}

ngOnInit() {
this.pageMeta.setCommon('Register', 'Register for a Big Give account', null);

if (isPlatformBrowser(this.platformId)) {
document.body.classList.add('primary-colour');
}
Expand Down

0 comments on commit 2f09c5f

Please sign in to comment.