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,7 @@
<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:' + supportEmail">{{ supportEmail }}</a
>.
</p>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ import { TranslatePipe } from '@ngx-translate/core';

import { ChangeDetectionStrategy, Component } from '@angular/core';

import { environment } from 'src/environments/environment';

@Component({
selector: 'osf-forbidden-page',
imports: [TranslatePipe],
templateUrl: './forbidden-page.component.html',
styleUrl: './forbidden-page.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ForbiddenPageComponent {}
export class ForbiddenPageComponent {
readonly supportEmail = environment.supportEmail;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<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:' + supportEmail">{{ supportEmail }}</a
>.
</p>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ import { TranslatePipe } from '@ngx-translate/core';

import { ChangeDetectionStrategy, Component } from '@angular/core';

import { environment } from 'src/environments/environment';

@Component({
selector: 'osf-page-not-found',
imports: [TranslatePipe],
templateUrl: './page-not-found.component.html',
styleUrl: './page-not-found.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class PageNotFoundComponent {}
export class PageNotFoundComponent {
readonly supportEmail = environment.supportEmail;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ <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:' + supportEmail">{{ supportEmail }}</a
>.
</p>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { AuthService, RequestAccessService } from '@osf/core/services';
import { InputLimits } from '@osf/shared/constants';
import { LoaderService, ToastService } from '@osf/shared/services';

import { environment } from 'src/environments/environment';

@Component({
selector: 'osf-request-access',
imports: [TranslatePipe, Button, Textarea, FormsModule],
Expand All @@ -23,9 +25,11 @@ import { LoaderService, ToastService } from '@osf/shared/services';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class RequestAccessComponent {
commentLimit = InputLimits.requestAccessComment.maxLength;
comment = model('');

readonly supportEmail = environment.supportEmail;
readonly commentLimit = InputLimits.requestAccessComment.maxLength;

private readonly route = inject(ActivatedRoute);
private readonly id = toSignal(this.route?.params.pipe(map((params) => params['id'])) ?? of(undefined));

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

loaderService.hide();

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

toastService.showError(errorMessage);

return throwError(() => error);
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class AuthService {
attributes: {
uid: userId,
token,
new_password: newPassword,
password: newPassword,
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h2>{{ 'auth.resetPassword.success.title' | translate }}</h2>
<p-button
class="btn-full-width block mt-6"
[label]="'auth.resetPassword.success.backToSignin' | translate"
[routerLink]="['/sign-in']"
(onClick)="backToSignIn()"
/>
</section>
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Password } from 'primeng/password';

import { Component, inject, signal } from '@angular/core';
import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
import { ActivatedRoute, RouterLink } from '@angular/router';
import { ActivatedRoute } from '@angular/router';

import { AuthService } from '@osf/core/services';
import { CustomValidators, PASSWORD_REGEX } from '@osf/shared/helpers';
Expand All @@ -16,7 +16,7 @@ import { ResetPasswordFormGroupType } from '../../models';

@Component({
selector: 'osf-reset-password',
imports: [Button, Password, ReactiveFormsModule, RouterLink, PasswordInputHintComponent, Message, TranslatePipe],
imports: [Button, Password, ReactiveFormsModule, PasswordInputHintComponent, Message, TranslatePipe],
templateUrl: './reset-password.component.html',
styleUrl: './reset-password.component.scss',
})
Expand Down Expand Up @@ -63,4 +63,8 @@ export class ResetPasswordComponent {
this.isFormSubmitted.set(true);
});
}

backToSignIn() {
this.authService.navigateToSignIn();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';

import { LoadingSpinnerComponent } from '@osf/shared/components';
import { DEFAULT_SUPPORT_EMAIL } from '@osf/shared/constants';

import { PREPRINT_SETTINGS_SECTIONS } from '../../constants';
import { SettingsSectionControl } from '../../enums';
import { GetPreprintProvider, PreprintModerationSelectors } from '../../store/preprint-moderation';

import { environment } from 'src/environments/environment';

@Component({
selector: 'osf-preprint-moderation-settings',
imports: [TranslatePipe, ReactiveFormsModule, Card, RadioButton, Message, LoadingSpinnerComponent],
Expand All @@ -40,9 +41,9 @@ export class PreprintModerationSettingsComponent implements OnInit {
settingsForm!: FormGroup;
sections = PREPRINT_SETTINGS_SECTIONS;

supportEmail = DEFAULT_SUPPORT_EMAIL;
readonly supportEmail = environment.supportEmail;

isLoading = select(PreprintModerationSelectors.arePreprintProviderLoading);
readonly isLoading = select(PreprintModerationSelectors.arePreprintProviderLoading);

settings = computed(() =>
this.store.selectSignal(PreprintModerationSelectors.getPreprintProvider)()(this.providerId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { WithdrawPreprint } from '@osf/features/preprints/store/preprint';
import { CustomValidators } from '@osf/shared/helpers';
import { INPUT_VALIDATION_MESSAGES } from '@shared/constants';

import { environment } from 'src/environments/environment';

@Component({
selector: 'osf-withdraw-dialog',
imports: [Textarea, ReactiveFormsModule, Message, TranslatePipe, Button, TitleCasePipe],
Expand All @@ -31,6 +33,8 @@ export class WithdrawDialogComponent implements OnInit {
private readonly translateService = inject(TranslateService);
readonly dialogRef = inject(DynamicDialogRef);

readonly supportEmail = environment.supportEmail;

private provider!: PreprintProviderDetails;
private preprint!: Preprint;

Expand Down Expand Up @@ -80,8 +84,6 @@ export class WithdrawDialogComponent implements OnInit {

private calculateModalExplanation() {
const providerReviewWorkflow = this.provider.reviewsWorkflow;
//[RNi] TODO: maybe extract to env, also see static pages
const supportEmail = 'support@osf.io';

switch (providerReviewWorkflow) {
case ProviderReviewsWorkflow.PreModeration: {
Expand All @@ -105,7 +107,7 @@ export class WithdrawDialogComponent implements OnInit {
return this.translateService.instant('preprints.details.withdrawDialog.noModerationNotice', {
singularPreprintWord: this.documentType.singular,
pluralCapitalizedPreprintWord: this.documentType.pluralCapitalized,
supportEmail,
supportEmail: this.supportEmail,
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ <h2 class="text-2xl">{{ 'preprints.createServer.title' | translate }}</h2>
</div>

<p-button severity="success" class="link-button">
<a href="mailto:support@osf.io">{{ 'preprints.createServer.contactUs' | translate }}</a>
<a [href]="'mailto:' + supportEmail">{{ 'preprints.createServer.contactUs' | translate }}</a>
</p-button>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import { SearchInputComponent } from '@shared/components';
import { ResourceTab } from '@shared/enums';
import { BrandService } from '@shared/services';

import { environment } from 'src/environments/environment';

@Component({
selector: 'osf-overview',
imports: [
Expand All @@ -47,8 +49,10 @@ export class PreprintsLandingComponent implements OnInit, OnDestroy {

protected searchControl = new FormControl<string>('');

readonly supportEmail = environment.supportEmail;
private readonly OSF_PROVIDER_ID = environment.defaultProvider;

private readonly router = inject(Router);
private readonly OSF_PROVIDER_ID = 'osf';
private readonly actions = createDispatchMap({
getPreprintProviderById: GetPreprintProviderById,
getPreprintProvidersToAdvertise: GetPreprintProvidersToAdvertise,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class ConfigureAddonComponent implements OnInit {
});
protected readonly resourceUri = computed(() => {
const id = this.route.parent?.parent?.snapshot.params['id'];
return `${environment.baseResourceUri}${id}`;
return `${environment.webUrl}/${id}`;
});
protected readonly addonTypeString = computed(() => {
return getAddonTypeString(this.addon());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class ConnectConfiguredAddonComponent {
protected resourceUri = computed(() => {
const id = this.route.parent?.parent?.snapshot.params['id'];

return `${environment.baseResourceUri}${id}`;
return `${environment.webUrl}/${id}`;
});

protected addonTypeString = computed(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { RegistrationCardComponent } from '@osf/shared/components/registration-c

import { GetRegistrations, RegistrationsSelectors } from './store';

import { environment } from 'src/environments/environment';

@Component({
selector: 'osf-registrations',
imports: [RegistrationCardComponent, SubHeaderComponent, FormsModule, TranslatePipe, LoadingSpinnerComponent],
Expand All @@ -31,14 +33,13 @@ export class RegistrationsComponent implements OnInit {
protected registrations = select(RegistrationsSelectors.getRegistrations);
protected isRegistrationsLoading = select(RegistrationsSelectors.isRegistrationsLoading);
protected actions = createDispatchMap({ getRegistrations: GetRegistrations });
private readonly OSF_PROVIDER_ID = 'osf';

ngOnInit(): void {
this.actions.getRegistrations(this.projectId());
}

addRegistration(): void {
this.router.navigate([`registries/${this.OSF_PROVIDER_ID}/new`], {
this.router.navigate([`registries/${environment.defaultProvider}/new`], {
queryParams: { projectId: this.projectId() },
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { INPUT_VALIDATION_MESSAGES, InputLimits } from '@osf/shared/constants';
import { CustomValidators } from '@osf/shared/helpers';
import { License, LicenseOptions } from '@osf/shared/models';

import { environment } from 'src/environments/environment';

@Component({
selector: 'osf-registries-license',
imports: [FormsModule, ReactiveFormsModule, LicenseComponent, Card, TranslatePipe, Message],
Expand All @@ -36,8 +38,6 @@ export class RegistriesLicenseComponent {
protected selectedLicense = select(RegistriesSelectors.getSelectedLicense);
protected draftRegistration = select(RegistriesSelectors.getDraftRegistration);

private readonly OSF_PROVIDER_ID = 'osf';

currentYear = new Date();
licenseYear = this.currentYear;
licenseForm = this.fb.group({
Expand All @@ -52,7 +52,7 @@ export class RegistriesLicenseComponent {
constructor() {
effect(() => {
if (this.draftRegistration() && !this.isLoaded) {
this.actions.fetchLicenses(this.draftRegistration()?.providerId ?? this.OSF_PROVIDER_ID);
this.actions.fetchLicenses(this.draftRegistration()?.providerId ?? environment.defaultProvider);
this.isLoaded = true;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import { ClearState, DeleteDraft, FetchLicenses, FetchProjectChildren, Registrie
import { ConfirmRegistrationDialogComponent } from '../confirm-registration-dialog/confirm-registration-dialog.component';
import { SelectComponentsDialogComponent } from '../select-components-dialog/select-components-dialog.component';

import { environment } from 'src/environments/environment';

@Component({
selector: 'osf-review',
imports: [
Expand Down Expand Up @@ -71,7 +73,6 @@ export class ReviewComponent {
protected readonly components = select(RegistriesSelectors.getRegistrationComponents);
protected readonly license = select(RegistriesSelectors.getRegistrationLicense);
protected readonly newRegistration = select(RegistriesSelectors.getRegistration);
private readonly OSF_PROVIDER_ID = 'osf';

protected readonly FieldType = FieldType;

Expand Down Expand Up @@ -106,7 +107,7 @@ export class ReviewComponent {

effect(() => {
if (this.draftRegistration()) {
this.actions.fetchLicenses(this.draftRegistration()?.providerId ?? this.OSF_PROVIDER_ID);
this.actions.fetchLicenses(this.draftRegistration()?.providerId ?? environment.defaultProvider);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import {
RegistriesSelectors,
} from '../../store';

import { environment } from 'src/environments/environment';

@Component({
selector: 'osf-my-registrations',
imports: [
Expand Down Expand Up @@ -80,7 +82,7 @@ export class MyRegistrationsComponent {

protected readonly RegistrationTab = RegistrationTab;

readonly provider = 'osf';
readonly provider = environment.defaultProvider;

selectedTab = signal(RegistrationTab.Submitted);
itemsPerPage = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {
} from '@shared/components';
import { ResourceTab } from '@shared/enums';

import { environment } from 'src/environments/environment';

@Component({
selector: 'osf-registries-landing',
imports: [
Expand Down Expand Up @@ -64,7 +66,6 @@ export class RegistriesLandingComponent implements OnInit {
}

goToCreateRegistration(): void {
const providerId = 'osf';
this.router.navigate([`/registries/${providerId}/new`]);
this.router.navigate([`/registries/${environment.defaultProvider}/new`]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h2 class="mb-2 flex">
<p class="text-red-500 mb-2 font-bold pl-5">{{ 'registry.archiving.pleaseNote' | translate }}</p>
<p class="pl-5">
{{ 'registry.archiving.description' | translate }}
<a href="mailto:support@osf.io">support.osf.io</a>
<a [href]="'mailto:' + supportEmail">{{ supportEmail }}</a>
{{ 'registry.archiving.descriptionEnd' | translate }}
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { IconComponent } from '@osf/shared/components';
import { RegistryOverview } from '../../models';
import { ShortRegistrationInfoComponent } from '../short-registration-info/short-registration-info.component';

import { environment } from 'src/environments/environment';

@Component({
selector: 'osf-archiving-message',
imports: [TranslatePipe, Card, IconComponent, Divider, ShortRegistrationInfoComponent],
Expand All @@ -19,4 +21,6 @@ import { ShortRegistrationInfoComponent } from '../short-registration-info/short
})
export class ArchivingMessageComponent {
registration = input.required<RegistryOverview>();

readonly supportEmail = environment.supportEmail;
}
Loading