Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<h2>{{ 'forbiddenPage.title' | translate }}</h2>
<p class="mt-4">
<span>{{ 'forbiddenPage.message' | translate }}</span>
<a class="ml-1 font-bold" href="mailto:support@osf.io">support&#64;osf.io</a>
<a class="ml-1 font-bold" href="mailto:support@osf.io">support&#64;osf.io</a>.
</p>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<h2>{{ 'pageNotFound.title' | translate }}</h2>
<p class="mt-4">
<span>{{ 'pageNotFound.message' | translate }}</span>
<a class="ml-1 font-bold" href="mailto:support@osf.io">support&#64;osf.io</a>
<a class="ml-1 font-bold" href="mailto:support@osf.io">support&#64;osf.io</a>.
</p>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ <h2>{{ 'requestAccess.title' | translate }}</h2>

<p class="mt-4">
<span>{{ 'requestAccess.helpMessage' | translate }}</span>
<a class="ml-1 font-bold" href="mailto:support@osf.io">support&#64;osf.io</a>
<a class="ml-1 font-bold" href="mailto:support@osf.io">support&#64;osf.io</a>.
</p>
</section>
16 changes: 12 additions & 4 deletions src/app/core/components/request-access/request-access.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Textarea } from 'primeng/textarea';

import { map, of } from 'rxjs';

import { HttpErrorResponse } from '@angular/common/http';
import { ChangeDetectionStrategy, Component, inject, model } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { FormsModule } from '@angular/forms';
Expand Down Expand Up @@ -35,10 +36,17 @@ export class RequestAccessComponent {

requestAccess() {
this.loaderService.show();
this.requestAccessService.requestAccessToProject(this.projectId(), this.comment()).subscribe(() => {
this.loaderService.hide();
this.router.navigate(['/']);
this.toastService.showSuccess('requestAccess.requestedSuccessMessage');
this.requestAccessService.requestAccessToProject(this.projectId(), this.comment()).subscribe({
next: () => {
this.loaderService.hide();
this.router.navigate(['/']);
this.toastService.showSuccess('requestAccess.requestedSuccessMessage');
},
error: (error: HttpErrorResponse) => {
if (error.status === 409) {
this.toastService.showError('requestAccess.alreadyRequestedMessage');
}
},
});
}

Expand Down
4 changes: 1 addition & 3 deletions src/app/core/interceptors/auth.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ export const authInterceptor: HttpInterceptorFn = (
const authReq = req.clone({
setHeaders: {
Authorization: `Bearer ${authToken}`,
Accept: req.responseType === 'text' ? '*/*' : 'application/vnd.api+json',
'Content-Type': 'application/vnd.api+json',
},
});
if (req.responseType !== 'text') {
authReq.headers.set('Accept', 'application/vnd.api+json');
}

return next(authReq);
}
Expand Down
5 changes: 5 additions & 0 deletions src/app/core/interceptors/error.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ export const errorInterceptor: HttpInterceptorFn = (req, next) => {
}

loaderService.hide();

if (error.status === 409) {
return throwError(() => error);
}

toastService.showError(errorMessage);

return throwError(() => error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<h2 class="mr-2">{{ 'project.wiki.view' | translate }}</h2>
</ng-template>
<div class="flex align-items-center mb-4">
<span class="mr-2">{{ 'project.wiki.version.title' | translate }}</span>
<span class="mr-2">{{ 'project.wiki.version.title' | translate }}:</span>
<p-select
[options]="mappedVersions()"
[ngModel]="selectedVersion()"
Expand Down
5 changes: 3 additions & 2 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@
"description": "To merge an existing account with this one or to log in with multiple email addresses, add an alternate email address below. All projects and components will be displayed under the email address listed as primary.",
"primaryEmail": "Primary Email:",
"alternateEmails": "Alternate Emails:",
"unconfirmedEmails": "Unconfirmed emails:",
"unconfirmedEmails": "Unconfirmed Emails:",
"buttons": {
"makePrimary": "Make Primary",
"resend": "Resend",
Expand Down Expand Up @@ -1336,7 +1336,8 @@
"requestAccess": "Request Access",
"switchAccount": "Switch Account",
"commentLabel": "Comment (Optional)",
"requestedSuccessMessage": "Your request for access has been sent."
"requestedSuccessMessage": "Your request for access has been sent.",
"alreadyRequestedMessage": "You already requested access."
},
"validation": {
"required": "The field is required.",
Expand Down