Skip to content

Commit b328cdd

Browse files
PD-3681 rework page titles (#2687)
* PD-3681 rework page titles * PD-3681 fix page title order --------- Co-authored-by: andrej romanov <50377758+auumgn@users.noreply.github.com> Co-authored-by: Angel Montenegro <a.montenegro@orcid.org>
1 parent a519d01 commit b328cdd

3 files changed

Lines changed: 16 additions & 13 deletions

File tree

src/app/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export const ApplicationRoutes = {
101101
register: 'register',
102102
thirdPartySignIn: 'third-party-signin-completed',
103103
account: 'account',
104+
deactivate: 'account/deactivate',
104105
trustedParties: 'trusted-parties',
105106
resetPasswordEmail: 'reset-password-email',
106107
selfService: 'self-service',
@@ -125,6 +126,7 @@ export const ApplicationRoutesLabels = {
125126
[ApplicationRoutes.register]: $localize`:@@share.register:Register - ORCID`,
126127
[ApplicationRoutes.thirdPartySignIn]: $localize`:@@share.signin:Sign in - ORCID`,
127128
[ApplicationRoutes.account]: $localize`:@@share.account:Account settings - ORCID`,
129+
[ApplicationRoutes.deactivate]: $localize`:@@share.deactivateAccount:Deactivate account - ORCID`,
128130
[ApplicationRoutes.trustedParties]: $localize`:@@share.trustedParties:Trusted parties - ORCID `,
129131
[ApplicationRoutes.resetPasswordEmail]: $localize`:@@share.resetPasswordEmail:Reset password - ORCID`,
130132
[ApplicationRoutes.selfService]: $localize`:@@share.selfService:Self Service - ORCID`,

src/app/core/title-service/title.service.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ export class TitleService {
3535
`${dynamicTitle} ${ApplicationDynamicRoutesLabels.orcidPageTitle}`
3636
)
3737
} else {
38-
Object.keys(ApplicationRoutesLabels).forEach((route) => {
39-
if (event.url.startsWith('/' + route)) {
40-
// MY ORCID
41-
if (dynamicTitle) {
42-
this.setTitle(
43-
`${dynamicTitle} ${ApplicationDynamicRoutesLabels.orcidMyPageTitle}`
44-
)
45-
} else {
46-
// OTHER PAGES
47-
this.setTitle(ApplicationRoutesLabels[route])
48-
}
49-
}
50-
})
38+
const route = Object.keys(ApplicationRoutesLabels).find(
39+
(route) => event.url?.split('?')[0] == '/' + route
40+
)
41+
// MY ORCID
42+
if (dynamicTitle) {
43+
this.setTitle(
44+
`${dynamicTitle} ${ApplicationDynamicRoutesLabels.orcidMyPageTitle}`
45+
)
46+
}
47+
if (route !== null && route !== undefined) {
48+
// OTHER PAGES
49+
this.setTitle(ApplicationRoutesLabels[route])
50+
}
5151
}
5252
})
5353
}

src/locale/properties/shared/shared.en.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ share.account=Account settings - ORCID
617617
share.trustedParties=Trusted parties - ORCID
618618
share.resetPasswordEmail=Reset password - ORCID
619619
share.selfService=Self Service - ORCID
620+
share.deactivateAccount=Deactivate account - ORCID
620621
share.orcidTitle=- ORCID
621622
share.myOrcidTitle=- My ORCID
622623
share.developerTools=Developer tools - ORCID

0 commit comments

Comments
 (0)