Skip to content

Commit f7150a9

Browse files
committed
fix(log-out): updated translations and log out
1 parent 47bc1ec commit f7150a9

File tree

10 files changed

+14
-11
lines changed

10 files changed

+14
-11
lines changed

src/app/core/components/header/header.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export class HeaderComponent {
4242
command: () => {
4343
this.loaderService.show();
4444
this.actions.logout();
45-
this.router.navigate(['/']).then(() => window.location.reload());
4645
},
4746
},
4847
];

src/app/core/components/request-access/request-access.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { createDispatchMap } from '@ngxs/store';
2+
13
import { TranslatePipe } from '@ngx-translate/core';
24

35
import { Button } from 'primeng/button';
@@ -12,6 +14,7 @@ import { FormsModule } from '@angular/forms';
1214
import { ActivatedRoute, Router } from '@angular/router';
1315

1416
import { RequestAccessService } from '@osf/core/services';
17+
import { Logout } from '@osf/features/auth/store';
1518
import { InputLimits } from '@osf/shared/constants';
1619
import { LoaderService, ToastService } from '@osf/shared/services';
1720

@@ -29,10 +32,11 @@ export class RequestAccessComponent {
2932
private readonly route = inject(ActivatedRoute);
3033
private readonly id = toSignal(this.route?.params.pipe(map((params) => params['id'])) ?? of(undefined));
3134

32-
private readonly requestAccessService = inject(RequestAccessService);
3335
private readonly router = inject(Router);
36+
private readonly requestAccessService = inject(RequestAccessService);
3437
private readonly loaderService = inject(LoaderService);
3538
private readonly toastService = inject(ToastService);
39+
private readonly actions = createDispatchMap({ logout: Logout });
3640

3741
requestAccess() {
3842
this.loaderService.show();
@@ -51,6 +55,6 @@ export class RequestAccessComponent {
5155
}
5256

5357
switchAccount() {
54-
// [NS] TODO: add logout logic when the user is logged in
58+
this.actions.logout();
5559
}
5660
}

src/app/features/auth/services/auth.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class AuthService {
2929

3030
logout(): void {
3131
this.cookieService.deleteAll();
32-
this.actions.setAuthenticated(false);
32+
window.location.href = `${environment.webUrl}/logout/?next=${encodeURIComponent('/')}`;
3333
}
3434

3535
register(payload: SignUpModel) {

src/app/features/project/analytics/analytics.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<osf-sub-header [title]="'navigation.project.analytics' | translate"></osf-sub-header>
1+
<osf-sub-header [title]="'navigation.analytics' | translate"></osf-sub-header>
22

33
<section class="flex flex-column bg-white flex-1 h-full p-5 gap-4">
44
<div class="flex align-items-center justify-content-end">

src/app/features/project/contributors/contributors.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1 class="py-5 px-3 md:px-5 xl:px-4">{{ 'navigation.project.contributors' | translate }}</h1>
1+
<h1 class="py-5 px-3 md:px-5 xl:px-4">{{ 'navigation.contributors' | translate }}</h1>
22

33
<section class="contributors flex flex-column align-items-baseline w-full p-3 pt-4 md:px-5 xl:px-4">
44
<p-button

src/app/features/project/registrations/registrations.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<osf-sub-header
22
[showButton]="true"
33
[buttonLabel]="'project.registrations.addRegistration' | translate"
4-
[title]="'navigation.project.registrations' | translate"
4+
[title]="'navigation.registrations' | translate"
55
(buttonClick)="addRegistration()"
66
/>
77
@if (isRegistrationsLoading()) {

src/app/features/project/settings/settings.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<section class="flex flex-column flex-1">
2-
<osf-sub-header [title]="'navigation.project.settings' | translate" />
2+
<osf-sub-header [title]="'navigation.settings' | translate" />
33

44
<div class="flex flex-column flex-1 gap-4 w-full bg-white py-4 px-3 md:px-5 xl:px-4">
55
<osf-settings-project-form-card

src/app/features/project/wiki/wiki.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<osf-sub-header [title]="'navigation.project.wiki' | translate" [tooltip]="'project.wiki.tooltip' | translate">
1+
<osf-sub-header [title]="'navigation.wiki' | translate" [tooltip]="'project.wiki.tooltip' | translate">
22
<p-buttongroup class="ml-auto">
33
<p-button
44
[label]="'project.wiki.view' | translate"

src/app/features/registries/constants/default-steps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { StepOption } from '@osf/shared/models';
33
export const DEFAULT_STEPS: StepOption[] = [
44
{
55
index: 0,
6-
label: 'navigation.project.metadata',
6+
label: 'navigation.metadata',
77
value: '',
88
routeLink: 'metadata',
99
},

src/app/features/registry/pages/registry-wiki/registry-wiki.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<osf-sub-header [title]="'navigation.project.wiki' | translate" [tooltip]="'project.wiki.tooltip' | translate">
1+
<osf-sub-header [title]="'navigation.wiki' | translate" [tooltip]="'project.wiki.tooltip' | translate">
22
<p-buttongroup class="ml-auto">
33
<p-button
44
[label]="'project.wiki.view' | translate"

0 commit comments

Comments
 (0)