From a9d76a4b7e6aecb2e876c41ae6044c5dd13a2bc5 Mon Sep 17 00:00:00 2001 From: nsemets Date: Mon, 18 Aug 2025 15:58:51 +0300 Subject: [PATCH 1/5] fix(support-email): added support email to env file --- .../forbidden-page/forbidden-page.component.html | 3 ++- .../forbidden-page/forbidden-page.component.ts | 6 +++++- .../page-not-found/page-not-found.component.html | 3 ++- .../page-not-found/page-not-found.component.ts | 6 +++++- .../request-access/request-access.component.html | 3 ++- .../request-access/request-access.component.ts | 6 +++++- .../preprint-moderation-settings.component.ts | 7 ++++--- .../withdraw-dialog/withdraw-dialog.component.ts | 8 +++++--- .../pages/landing/preprints-landing.component.html | 2 +- .../pages/landing/preprints-landing.component.ts | 6 +++++- .../archiving-message/archiving-message.component.html | 2 +- .../archiving-message/archiving-message.component.ts | 4 ++++ .../static/privacy-policy/privacy-policy.component.html | 7 ++++--- .../static/privacy-policy/privacy-policy.component.ts | 6 +++++- .../static/terms-of-use/terms-of-use.component.html | 9 +++++---- .../static/terms-of-use/terms-of-use.component.ts | 6 +++++- src/app/shared/constants/constants.ts | 1 - src/app/shared/constants/index.ts | 1 - src/environments/environment.development.ts | 1 + src/environments/environment.ts | 1 + 20 files changed, 62 insertions(+), 26 deletions(-) delete mode 100644 src/app/shared/constants/constants.ts diff --git a/src/app/core/components/forbidden-page/forbidden-page.component.html b/src/app/core/components/forbidden-page/forbidden-page.component.html index 2eb73a0f9..05c92df7e 100644 --- a/src/app/core/components/forbidden-page/forbidden-page.component.html +++ b/src/app/core/components/forbidden-page/forbidden-page.component.html @@ -2,6 +2,7 @@

{{ 'forbiddenPage.title' | translate }}

{{ 'forbiddenPage.message' | translate }} - support@osf.io. + {{ supportEmail }}.

diff --git a/src/app/core/components/forbidden-page/forbidden-page.component.ts b/src/app/core/components/forbidden-page/forbidden-page.component.ts index 51d0733c0..0ed9a686d 100644 --- a/src/app/core/components/forbidden-page/forbidden-page.component.ts +++ b/src/app/core/components/forbidden-page/forbidden-page.component.ts @@ -2,6 +2,8 @@ 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], @@ -9,4 +11,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; styleUrl: './forbidden-page.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ForbiddenPageComponent {} +export class ForbiddenPageComponent { + readonly supportEmail = environment.supportEmail; +} diff --git a/src/app/core/components/page-not-found/page-not-found.component.html b/src/app/core/components/page-not-found/page-not-found.component.html index bf7889c25..47db29983 100644 --- a/src/app/core/components/page-not-found/page-not-found.component.html +++ b/src/app/core/components/page-not-found/page-not-found.component.html @@ -2,6 +2,7 @@

{{ 'pageNotFound.title' | translate }}

{{ 'pageNotFound.message' | translate }} - support@osf.io. + {{ supportEmail }}.

diff --git a/src/app/core/components/page-not-found/page-not-found.component.ts b/src/app/core/components/page-not-found/page-not-found.component.ts index f41d98dff..dae4c41cf 100644 --- a/src/app/core/components/page-not-found/page-not-found.component.ts +++ b/src/app/core/components/page-not-found/page-not-found.component.ts @@ -2,6 +2,8 @@ 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], @@ -9,4 +11,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; styleUrl: './page-not-found.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class PageNotFoundComponent {} +export class PageNotFoundComponent { + readonly supportEmail = environment.supportEmail; +} diff --git a/src/app/core/components/request-access/request-access.component.html b/src/app/core/components/request-access/request-access.component.html index edc8780f5..137a1c8a3 100644 --- a/src/app/core/components/request-access/request-access.component.html +++ b/src/app/core/components/request-access/request-access.component.html @@ -37,6 +37,7 @@

{{ 'requestAccess.title' | translate }}

{{ 'requestAccess.helpMessage' | translate }} - support@osf.io. + {{ supportEmail }}.

diff --git a/src/app/core/components/request-access/request-access.component.ts b/src/app/core/components/request-access/request-access.component.ts index 5cefa0ff0..784e7e6a3 100644 --- a/src/app/core/components/request-access/request-access.component.ts +++ b/src/app/core/components/request-access/request-access.component.ts @@ -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], @@ -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)); diff --git a/src/app/features/moderation/components/preprint-moderation-settings/preprint-moderation-settings.component.ts b/src/app/features/moderation/components/preprint-moderation-settings/preprint-moderation-settings.component.ts index b3c0a50ba..804142e2f 100644 --- a/src/app/features/moderation/components/preprint-moderation-settings/preprint-moderation-settings.component.ts +++ b/src/app/features/moderation/components/preprint-moderation-settings/preprint-moderation-settings.component.ts @@ -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], @@ -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()) diff --git a/src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.ts b/src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.ts index f8f7c42f9..5d1a8a2bc 100644 --- a/src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.ts +++ b/src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.ts @@ -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], @@ -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; @@ -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: { @@ -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, }); } } diff --git a/src/app/features/preprints/pages/landing/preprints-landing.component.html b/src/app/features/preprints/pages/landing/preprints-landing.component.html index b8fb208ba..a3ddcf395 100644 --- a/src/app/features/preprints/pages/landing/preprints-landing.component.html +++ b/src/app/features/preprints/pages/landing/preprints-landing.component.html @@ -76,6 +76,6 @@

{{ 'preprints.createServer.title' | translate }}

- {{ 'preprints.createServer.contactUs' | translate }} + {{ 'preprints.createServer.contactUs' | translate }} diff --git a/src/app/features/preprints/pages/landing/preprints-landing.component.ts b/src/app/features/preprints/pages/landing/preprints-landing.component.ts index d8f4c060a..c2ba7085e 100644 --- a/src/app/features/preprints/pages/landing/preprints-landing.component.ts +++ b/src/app/features/preprints/pages/landing/preprints-landing.component.ts @@ -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: [ @@ -47,8 +49,10 @@ export class PreprintsLandingComponent implements OnInit, OnDestroy { protected searchControl = new FormControl(''); - private readonly router = inject(Router); + readonly supportEmail = environment.supportEmail; private readonly OSF_PROVIDER_ID = 'osf'; + + private readonly router = inject(Router); private readonly actions = createDispatchMap({ getPreprintProviderById: GetPreprintProviderById, getPreprintProvidersToAdvertise: GetPreprintProvidersToAdvertise, diff --git a/src/app/features/registry/components/archiving-message/archiving-message.component.html b/src/app/features/registry/components/archiving-message/archiving-message.component.html index e2f93956e..bc60b1b78 100644 --- a/src/app/features/registry/components/archiving-message/archiving-message.component.html +++ b/src/app/features/registry/components/archiving-message/archiving-message.component.html @@ -8,7 +8,7 @@

{{ 'registry.archiving.pleaseNote' | translate }}

{{ 'registry.archiving.description' | translate }} - support.osf.io + {{ supportEmail }} {{ 'registry.archiving.descriptionEnd' | translate }}

diff --git a/src/app/features/registry/components/archiving-message/archiving-message.component.ts b/src/app/features/registry/components/archiving-message/archiving-message.component.ts index dc6db3eeb..28be0ad0e 100644 --- a/src/app/features/registry/components/archiving-message/archiving-message.component.ts +++ b/src/app/features/registry/components/archiving-message/archiving-message.component.ts @@ -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], @@ -19,4 +21,6 @@ import { ShortRegistrationInfoComponent } from '../short-registration-info/short }) export class ArchivingMessageComponent { registration = input.required(); + + readonly supportEmail = environment.supportEmail; } diff --git a/src/app/features/static/privacy-policy/privacy-policy.component.html b/src/app/features/static/privacy-policy/privacy-policy.component.html index 4a460e02b..57e496bbd 100644 --- a/src/app/features/static/privacy-policy/privacy-policy.component.html +++ b/src/app/features/static/privacy-policy/privacy-policy.component.html @@ -693,8 +693,8 @@

19. GENERAL DATA PROTECTION REGULATION

member state of your habitual residence, your place of work or the place of the alleged infringement.

- Contact COS at support@osf.io if you have concerns regarding your personal - data, or wish to exercise any of these listed rights. + Contact COS at {{ supportEmail }} if you have concerns regarding your + personal data, or wish to exercise any of these listed rights.

Note that, if you are in the EEA, we may transfer your personal data outside of the EEA, including to the United @@ -710,7 +710,8 @@

19. GENERAL DATA PROTECTION REGULATION

20. CONTACTING US

Questions about this Privacy Policy can be directed to - support@osf.io. Support is provided in English only.
+ {{ supportEmail }}. Support is provided in English only.
This Privacy Policy was last updated on January 10, 2025.

diff --git a/src/app/features/static/privacy-policy/privacy-policy.component.ts b/src/app/features/static/privacy-policy/privacy-policy.component.ts index 987b719cf..b7fc71312 100644 --- a/src/app/features/static/privacy-policy/privacy-policy.component.ts +++ b/src/app/features/static/privacy-policy/privacy-policy.component.ts @@ -1,5 +1,7 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { environment } from 'src/environments/environment'; + @Component({ selector: 'osf-privacy-policy', imports: [], @@ -7,4 +9,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; styleUrl: './privacy-policy.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class PrivacyPolicyComponent {} +export class PrivacyPolicyComponent { + readonly supportEmail = environment.supportEmail; +} diff --git a/src/app/features/static/terms-of-use/terms-of-use.component.html b/src/app/features/static/terms-of-use/terms-of-use.component.html index b90edaf78..df74a589c 100644 --- a/src/app/features/static/terms-of-use/terms-of-use.component.html +++ b/src/app/features/static/terms-of-use/terms-of-use.component.html @@ -465,8 +465,9 @@

13. OSF SINGLE SIGN-ON AUTHENTICATION

Inquiries. For questions or issues regarding SSO access, please contact - support@osf.io. Institutional administrators that have questions or - requests should inquire at institutions@cos.io. + {{ supportEmail }}. Institutional administrators that have questions or requests should inquire at + institutions@cos.io.

@@ -654,8 +655,8 @@

22. GENERAL

here.

- Contact COS at support@osf.io, if you have concerns regarding your - Personal Data, or wish to exercise any of your rights under the GDPR. + Contact COS at {{ supportEmail }}, if you have concerns regarding your Personal Data, or wish to exercise any of your rights under the GDPR.

diff --git a/src/app/features/static/terms-of-use/terms-of-use.component.ts b/src/app/features/static/terms-of-use/terms-of-use.component.ts index 7e9b7568e..455f4b1c0 100644 --- a/src/app/features/static/terms-of-use/terms-of-use.component.ts +++ b/src/app/features/static/terms-of-use/terms-of-use.component.ts @@ -1,5 +1,7 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { environment } from 'src/environments/environment'; + @Component({ selector: 'osf-terms-of-use', imports: [], @@ -7,4 +9,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; styleUrl: './terms-of-use.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class TermsOfUseComponent {} +export class TermsOfUseComponent { + readonly supportEmail = environment.supportEmail; +} diff --git a/src/app/shared/constants/constants.ts b/src/app/shared/constants/constants.ts deleted file mode 100644 index c5e6b7edd..000000000 --- a/src/app/shared/constants/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const DEFAULT_SUPPORT_EMAIL = 'support@osf.io'; diff --git a/src/app/shared/constants/index.ts b/src/app/shared/constants/index.ts index 229571aed..574a58778 100644 --- a/src/app/shared/constants/index.ts +++ b/src/app/shared/constants/index.ts @@ -1,7 +1,6 @@ export * from './addon-terms.const'; export * from './addons-category-options.const'; export * from './addons-tab-options.const'; -export * from './constants'; export * from './contributors.constants'; export * from './default-citation-titles.const'; export * from './filter-placeholders'; diff --git a/src/environments/environment.development.ts b/src/environments/environment.development.ts index 37de7f4ba..1b035d364 100644 --- a/src/environments/environment.development.ts +++ b/src/environments/environment.development.ts @@ -14,4 +14,5 @@ export const environment = { casUrl: 'https://accounts.staging4.osf.io', recaptchaSiteKey: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI', facebookAppId: '1022273774556662', + supportEmail: 'support@osf.io', }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 97f2dd8c7..0ea2f74b5 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -14,4 +14,5 @@ export const environment = { casUrl: 'https://accounts.staging4.osf.io', recaptchaSiteKey: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI', facebookAppId: '1022273774556662', + supportEmail: 'support@osf.io', }; From 9f82c025630e21cf54eb36ad45c9e24eea68b88c Mon Sep 17 00:00:00 2001 From: nsemets Date: Mon, 18 Aug 2025 16:12:46 +0300 Subject: [PATCH 2/5] fix(environment): removed base resource uri --- .../components/configure-addon/configure-addon.component.ts | 2 +- .../connect-configured-addon.component.ts | 2 +- src/app/shared/services/addons/addons.service.ts | 4 ++-- src/environments/environment.development.ts | 1 - src/environments/environment.ts | 1 - 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/app/features/project/addons/components/configure-addon/configure-addon.component.ts b/src/app/features/project/addons/components/configure-addon/configure-addon.component.ts index b074020f8..6a02d79ea 100644 --- a/src/app/features/project/addons/components/configure-addon/configure-addon.component.ts +++ b/src/app/features/project/addons/components/configure-addon/configure-addon.component.ts @@ -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()); diff --git a/src/app/features/project/addons/components/connect-configured-addon/connect-configured-addon.component.ts b/src/app/features/project/addons/components/connect-configured-addon/connect-configured-addon.component.ts index 1abc8e387..eb64fb5f6 100644 --- a/src/app/features/project/addons/components/connect-configured-addon/connect-configured-addon.component.ts +++ b/src/app/features/project/addons/components/connect-configured-addon/connect-configured-addon.component.ts @@ -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(() => { diff --git a/src/app/shared/services/addons/addons.service.ts b/src/app/shared/services/addons/addons.service.ts index 8d2e044ef..78824abd4 100644 --- a/src/app/shared/services/addons/addons.service.ts +++ b/src/app/shared/services/addons/addons.service.ts @@ -52,7 +52,7 @@ export class AddonsService { const currentUser = this.currentUser(); if (!currentUser) throw new Error('Current user not found'); - const userUri = `${environment.baseResourceUri}${currentUser.id}`; + const userUri = `${environment.webUrl}/${currentUser.id}`; const params = { 'filter[user_uri]': userUri, }; @@ -63,7 +63,7 @@ export class AddonsService { } getAddonsResourceReference(resourceId: string): Observable { - const resourceUri = `${environment.baseResourceUri}${resourceId}`; + const resourceUri = `${environment.webUrl}/${resourceId}`; const params = { 'filter[resource_uri]': resourceUri, }; diff --git a/src/environments/environment.development.ts b/src/environments/environment.development.ts index 1b035d364..cb0db9ccd 100644 --- a/src/environments/environment.development.ts +++ b/src/environments/environment.development.ts @@ -8,7 +8,6 @@ export const environment = { shareDomainUrl: 'https://staging-share.osf.io/trove', addonsApiUrl: 'https://addons.staging4.osf.io/v1', fileApiUrl: 'https://files.us.staging4.osf.io/v1', - baseResourceUri: 'https://staging4.osf.io/', funderApiUrl: 'https://api.crossref.org/', addonsV1Url: 'https://addons.staging4.osf.io/v1', casUrl: 'https://accounts.staging4.osf.io', diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 0ea2f74b5..100acbacb 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -8,7 +8,6 @@ export const environment = { shareDomainUrl: 'https://staging-share.osf.io/trove', addonsApiUrl: 'https://addons.staging4.osf.io/v1', fileApiUrl: 'https://files.us.staging4.osf.io/v1', - baseResourceUri: 'https://staging4.osf.io/', funderApiUrl: 'https://api.crossref.org/', addonsV1Url: 'https://addons.staging4.osf.io/v1', casUrl: 'https://accounts.staging4.osf.io', From 67b5957c7b022e1df96a4532e3e039c3ef31b1b7 Mon Sep 17 00:00:00 2001 From: nsemets Date: Mon, 18 Aug 2025 16:25:25 +0300 Subject: [PATCH 3/5] fix(default-provider): added default provider --- .../preprints/pages/landing/preprints-landing.component.ts | 2 +- .../project/registrations/registrations.component.ts | 5 +++-- .../registries-license/registries-license.component.ts | 6 +++--- .../registries/components/review/review.component.ts | 5 +++-- .../pages/my-registrations/my-registrations.component.ts | 4 +++- .../registries-landing/registries-landing.component.ts | 5 +++-- src/environments/environment.development.ts | 1 + src/environments/environment.ts | 1 + 8 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/app/features/preprints/pages/landing/preprints-landing.component.ts b/src/app/features/preprints/pages/landing/preprints-landing.component.ts index c2ba7085e..7873eb993 100644 --- a/src/app/features/preprints/pages/landing/preprints-landing.component.ts +++ b/src/app/features/preprints/pages/landing/preprints-landing.component.ts @@ -50,7 +50,7 @@ export class PreprintsLandingComponent implements OnInit, OnDestroy { protected searchControl = new FormControl(''); readonly supportEmail = environment.supportEmail; - private readonly OSF_PROVIDER_ID = 'osf'; + private readonly OSF_PROVIDER_ID = environment.defaultProvider; private readonly router = inject(Router); private readonly actions = createDispatchMap({ diff --git a/src/app/features/project/registrations/registrations.component.ts b/src/app/features/project/registrations/registrations.component.ts index 3cb69a5da..8c974d13e 100644 --- a/src/app/features/project/registrations/registrations.component.ts +++ b/src/app/features/project/registrations/registrations.component.ts @@ -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], @@ -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() }, }); } diff --git a/src/app/features/registries/components/metadata/registries-license/registries-license.component.ts b/src/app/features/registries/components/metadata/registries-license/registries-license.component.ts index f859fe1ba..dd519d9f0 100644 --- a/src/app/features/registries/components/metadata/registries-license/registries-license.component.ts +++ b/src/app/features/registries/components/metadata/registries-license/registries-license.component.ts @@ -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], @@ -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({ @@ -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; } }); diff --git a/src/app/features/registries/components/review/review.component.ts b/src/app/features/registries/components/review/review.component.ts index 1d774f383..33d5387af 100644 --- a/src/app/features/registries/components/review/review.component.ts +++ b/src/app/features/registries/components/review/review.component.ts @@ -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: [ @@ -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; @@ -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); } }); diff --git a/src/app/features/registries/pages/my-registrations/my-registrations.component.ts b/src/app/features/registries/pages/my-registrations/my-registrations.component.ts index b0e9109cf..df5120703 100644 --- a/src/app/features/registries/pages/my-registrations/my-registrations.component.ts +++ b/src/app/features/registries/pages/my-registrations/my-registrations.component.ts @@ -32,6 +32,8 @@ import { RegistriesSelectors, } from '../../store'; +import { environment } from 'src/environments/environment'; + @Component({ selector: 'osf-my-registrations', imports: [ @@ -80,7 +82,7 @@ export class MyRegistrationsComponent { protected readonly RegistrationTab = RegistrationTab; - readonly provider = 'osf'; + readonly provider = environment.defaultProvider; selectedTab = signal(RegistrationTab.Submitted); itemsPerPage = 10; diff --git a/src/app/features/registries/pages/registries-landing/registries-landing.component.ts b/src/app/features/registries/pages/registries-landing/registries-landing.component.ts index e8f5a425c..ec9091b64 100644 --- a/src/app/features/registries/pages/registries-landing/registries-landing.component.ts +++ b/src/app/features/registries/pages/registries-landing/registries-landing.component.ts @@ -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: [ @@ -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`]); } } diff --git a/src/environments/environment.development.ts b/src/environments/environment.development.ts index cb0db9ccd..61f0bdedc 100644 --- a/src/environments/environment.development.ts +++ b/src/environments/environment.development.ts @@ -14,4 +14,5 @@ export const environment = { recaptchaSiteKey: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI', facebookAppId: '1022273774556662', supportEmail: 'support@osf.io', + defaultProvider: 'osf', }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 100acbacb..95e43aa3f 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -14,4 +14,5 @@ export const environment = { recaptchaSiteKey: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI', facebookAppId: '1022273774556662', supportEmail: 'support@osf.io', + defaultProvider: 'osf', }; From c035f5630337123943cf197a723bff9ec8bc0c51 Mon Sep 17 00:00:00 2001 From: nsemets Date: Mon, 18 Aug 2025 20:08:05 +0300 Subject: [PATCH 4/5] fix(reset-password): updated reset password --- src/app/core/services/auth.service.ts | 2 +- .../pages/reset-password/reset-password.component.html | 2 +- .../auth/pages/reset-password/reset-password.component.ts | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/core/services/auth.service.ts b/src/app/core/services/auth.service.ts index aab97bf40..492bfc3f0 100644 --- a/src/app/core/services/auth.service.ts +++ b/src/app/core/services/auth.service.ts @@ -71,7 +71,7 @@ export class AuthService { attributes: { uid: userId, token, - new_password: newPassword, + password: newPassword, }, }, }; diff --git a/src/app/features/auth/pages/reset-password/reset-password.component.html b/src/app/features/auth/pages/reset-password/reset-password.component.html index 691fae8f7..088211af8 100644 --- a/src/app/features/auth/pages/reset-password/reset-password.component.html +++ b/src/app/features/auth/pages/reset-password/reset-password.component.html @@ -51,7 +51,7 @@

{{ 'auth.resetPassword.success.title' | translate }}

} diff --git a/src/app/features/auth/pages/reset-password/reset-password.component.ts b/src/app/features/auth/pages/reset-password/reset-password.component.ts index e60d9f435..8e371b70d 100644 --- a/src/app/features/auth/pages/reset-password/reset-password.component.ts +++ b/src/app/features/auth/pages/reset-password/reset-password.component.ts @@ -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'; @@ -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', }) @@ -63,4 +63,8 @@ export class ResetPasswordComponent { this.isFormSubmitted.set(true); }); } + + backToSignIn() { + this.authService.navigateToSignIn(); + } } From 2fba10a42058042ab2c32fd8c1ad28b062854cfa Mon Sep 17 00:00:00 2001 From: nsemets Date: Mon, 18 Aug 2025 20:14:34 +0300 Subject: [PATCH 5/5] fix(error): updated error interceptor --- src/app/core/interceptors/error.interceptor.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/app/core/interceptors/error.interceptor.ts b/src/app/core/interceptors/error.interceptor.ts index bdf482af6..2cebd2f9a 100644 --- a/src/app/core/interceptors/error.interceptor.ts +++ b/src/app/core/interceptors/error.interceptor.ts @@ -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);