From a40599c4b11e551d5f7d00cf451a8373664b2974 Mon Sep 17 00:00:00 2001 From: Futa Ikeda Date: Tue, 17 Nov 2026 15:42:11 -0500 Subject: [PATCH 1/3] feat(guids): Add new redirect link and automatic redirect properties --- src/app/shared/models/common/json-api/links.model.ts | 1 + src/app/shared/models/current-resource.model.ts | 2 ++ src/app/shared/models/files/file-json-api.model.ts | 2 ++ src/app/shared/models/guid-response-json-api.model.ts | 3 +++ .../shared/models/nodes/base-node-attributes-json-api.model.ts | 1 + src/app/shared/models/preprints/preprint-json-api.model.ts | 2 ++ .../shared/models/registration/registration-json-api.model.ts | 3 +++ src/app/shared/services/resource.service.ts | 2 ++ 8 files changed, 16 insertions(+) diff --git a/src/app/shared/models/common/json-api/links.model.ts b/src/app/shared/models/common/json-api/links.model.ts index 9ff520626..b58ea880c 100644 --- a/src/app/shared/models/common/json-api/links.model.ts +++ b/src/app/shared/models/common/json-api/links.model.ts @@ -2,6 +2,7 @@ export interface ResourceLinksJsonApi { html: string; self: string; iri: string; + redirect_url?: string; } export interface PaginationLinks { diff --git a/src/app/shared/models/current-resource.model.ts b/src/app/shared/models/current-resource.model.ts index 775a03258..8630654a1 100644 --- a/src/app/shared/models/current-resource.model.ts +++ b/src/app/shared/models/current-resource.model.ts @@ -9,4 +9,6 @@ export interface CurrentResource { wikiEnabled?: boolean; permissions: UserPermissions[]; title?: string; + redirectUrl?: string; + redirectAutomatically: boolean; } diff --git a/src/app/shared/models/files/file-json-api.model.ts b/src/app/shared/models/files/file-json-api.model.ts index c85598e8a..48e4a008c 100644 --- a/src/app/shared/models/files/file-json-api.model.ts +++ b/src/app/shared/models/files/file-json-api.model.ts @@ -31,6 +31,7 @@ export interface BaseFileAttributesJsonApi { name: string; path: string; provider: string; + redirect_automatically: boolean; size: number; } @@ -68,6 +69,7 @@ export interface FileLinksJsonApi { render: string; self: string; upload: string; + redirect_url: string; } interface FileEmbedsJsonApi { diff --git a/src/app/shared/models/guid-response-json-api.model.ts b/src/app/shared/models/guid-response-json-api.model.ts index b9b376d96..3e9567f58 100644 --- a/src/app/shared/models/guid-response-json-api.model.ts +++ b/src/app/shared/models/guid-response-json-api.model.ts @@ -1,5 +1,6 @@ import { UserPermissions } from '../enums/user-permissions.enum'; +import { ResourceLinksJsonApi } from './common/json-api/links.model'; import { ToOneRel } from './common/json-api/relationships.model'; import { JsonApiResource } from './common/json-api/resource.model'; import { ItemResponse } from './common/json-api/responses.model'; @@ -8,11 +9,13 @@ export type GuidedResponseJsonApi = ItemResponse; export interface GuidDataJsonApi extends JsonApiResource { relationships: GuidRelationshipsJsonApi; + links: ResourceLinksJsonApi; } interface GuidAttributesJsonApi { current_user_permissions: UserPermissions[]; guid: string; + redirect_automatically: boolean; title?: string; wiki_enabled: boolean; } diff --git a/src/app/shared/models/nodes/base-node-attributes-json-api.model.ts b/src/app/shared/models/nodes/base-node-attributes-json-api.model.ts index 8a3665ab4..ca1ee6e0a 100644 --- a/src/app/shared/models/nodes/base-node-attributes-json-api.model.ts +++ b/src/app/shared/models/nodes/base-node-attributes-json-api.model.ts @@ -19,6 +19,7 @@ export interface BaseNodeAttributesJsonApi { node_license: LicenseRecordJsonApi | null; preprint: boolean; public: boolean; + redirect_automatically: boolean; registration: boolean; tags: string[]; title: string; diff --git a/src/app/shared/models/preprints/preprint-json-api.model.ts b/src/app/shared/models/preprints/preprint-json-api.model.ts index 84e760499..2f701c68d 100644 --- a/src/app/shared/models/preprints/preprint-json-api.model.ts +++ b/src/app/shared/models/preprints/preprint-json-api.model.ts @@ -48,6 +48,7 @@ export interface PreprintAttributesJsonApi { prereg_links: string[]; preprint_doi_created: Date | null; public: boolean; + redirect_automatically: boolean; reviews_state: ReviewsState; tags: string[]; title: string; @@ -80,4 +81,5 @@ interface PreprintMetaJsonApi { interface PreprintLinksJsonApi { doi: string; preprint_doi: string; + redirect_url?: string; } diff --git a/src/app/shared/models/registration/registration-json-api.model.ts b/src/app/shared/models/registration/registration-json-api.model.ts index 6b6c4f299..c1663ccd1 100644 --- a/src/app/shared/models/registration/registration-json-api.model.ts +++ b/src/app/shared/models/registration/registration-json-api.model.ts @@ -3,6 +3,7 @@ import { RevisionReviewStates } from '@osf/shared/enums/revision-review-states.e import { UserPermissions } from '@osf/shared/enums/user-permissions.enum'; import { EmbedList } from '../common/json-api/embeds.model'; +import { ResourceLinksJsonApi } from '../common/json-api/links.model'; import { RelatedCountRel, ToOneRel, ToOneRelData } from '../common/json-api/relationships.model'; import { JsonApiResource, JsonApiResourceRef } from '../common/json-api/resource.model'; import { ItemResponse, ListResponse } from '../common/json-api/responses.model'; @@ -28,6 +29,7 @@ export interface DraftRegistrationDataJsonApi extends JsonApiResource< export interface RegistrationDataJsonApi extends JsonApiResource<'registrations', RegistrationNodeAttributesJsonApi> { relationships: RegistrationRelationshipsJsonApi; embeds?: RegistrationEmbedsJsonApi; + links: ResourceLinksJsonApi; } export interface CreateRegistrationPayloadJsonApi { @@ -88,6 +90,7 @@ export interface RegistrationAttributesJsonApi { pending_embargo_termination_approval: boolean; pending_registration_approval: boolean; public: boolean; + redirect_automatically: boolean; revision_state: RevisionReviewStates; reviews_state: RegistrationReviewStates; title: string; diff --git a/src/app/shared/services/resource.service.ts b/src/app/shared/services/resource.service.ts index c2cf91099..3beedfca4 100644 --- a/src/app/shared/services/resource.service.ts +++ b/src/app/shared/services/resource.service.ts @@ -55,6 +55,8 @@ export class ResourceGuidService { : res.data.relationships.target?.data?.type, wikiEnabled: res.data.attributes.wiki_enabled, permissions: res.data.attributes.current_user_permissions, + redirectAutomatically: res.data.attributes.redirect_automatically, + redirectUrl: res.data.links.redirect_url, rootResourceId: res.data.relationships.root?.data?.id, title: res.data.attributes?.title, }) as CurrentResource From c3d56969eb4eec95ff911bdfedbbb5ecaa219fb4 Mon Sep 17 00:00:00 2001 From: Futa Ikeda Date: Tue, 17 Nov 2026 16:39:02 -0500 Subject: [PATCH 2/3] feat(providers): Add new redirect link and automatic redirect properties --- src/app/features/preprints/mappers/preprint-providers.mapper.ts | 2 ++ .../preprints/models/preprint-provider-json-api.model.ts | 1 + src/app/features/preprints/models/preprint-provider.model.ts | 2 ++ src/app/shared/mappers/collections/collections.mapper.ts | 2 ++ src/app/shared/mappers/registration-provider.mapper.ts | 2 ++ .../models/collections/collection-provider-json-api.model.ts | 2 +- src/app/shared/models/provider/base-provider-json-api.model.ts | 1 + src/app/shared/models/provider/provider.model.ts | 2 ++ src/app/shared/models/provider/registry-provider.model.ts | 2 ++ src/testing/mocks/preprint-provider-details.ts | 2 ++ 10 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/app/features/preprints/mappers/preprint-providers.mapper.ts b/src/app/features/preprints/mappers/preprint-providers.mapper.ts index bbb1eb94d..ce6b25612 100644 --- a/src/app/features/preprints/mappers/preprint-providers.mapper.ts +++ b/src/app/features/preprints/mappers/preprint-providers.mapper.ts @@ -25,6 +25,8 @@ export class PreprintProvidersMapper { iri: response.links.iri, faviconUrl: response.attributes.assets?.favicon, squareColorNoTransparentImageUrl: response.attributes.assets?.square_color_no_transparent, + redirectAutomatically: response.attributes.redirect_automatically, + redirectUrl: response.links.redirect_url, reviewsWorkflow: response.attributes.reviews_workflow, facebookAppId: response.attributes.facebook_app_id, reviewsCommentsPrivate: response.attributes.reviews_comments_private, diff --git a/src/app/features/preprints/models/preprint-provider-json-api.model.ts b/src/app/features/preprints/models/preprint-provider-json-api.model.ts index 0ed0cb67f..1b7a4c262 100644 --- a/src/app/features/preprints/models/preprint-provider-json-api.model.ts +++ b/src/app/features/preprints/models/preprint-provider-json-api.model.ts @@ -34,6 +34,7 @@ interface PreprintProviderAttributesJsonApi { name: string; permissions: ReviewPermissions[]; preprint_word: PreprintWord; + redirect_automatically: boolean; reviews_comments_anonymous: StringOrNull; reviews_comments_private: StringOrNull; reviews_workflow: ProviderReviewsWorkflow | null; diff --git a/src/app/features/preprints/models/preprint-provider.model.ts b/src/app/features/preprints/models/preprint-provider.model.ts index 362917430..d72b75823 100644 --- a/src/app/features/preprints/models/preprint-provider.model.ts +++ b/src/app/features/preprints/models/preprint-provider.model.ts @@ -26,6 +26,8 @@ export interface PreprintProviderDetails { faviconUrl: string; squareColorNoTransparentImageUrl: string; facebookAppId: StringOrNull; + redirectAutomatically: boolean; + redirectUrl?: string; reviewsCommentsPrivate: StringOrNull; reviewsCommentsAnonymous: StringOrNull; } diff --git a/src/app/shared/mappers/collections/collections.mapper.ts b/src/app/shared/mappers/collections/collections.mapper.ts index 3b79793ca..88ab0adfb 100644 --- a/src/app/shared/mappers/collections/collections.mapper.ts +++ b/src/app/shared/mappers/collections/collections.mapper.ts @@ -55,6 +55,8 @@ export class CollectionsMapper { shareSource: response.attributes.share_source, sharePublishType: response.attributes.share_publish_type, permissions: response.attributes.permissions, + redirectAutomatically: response.attributes.redirect_automatically, + redirectUrl: response.links?.redirect_url, reviewsWorkflow: response.attributes.reviews_workflow, primaryCollection: { id: response.relationships.primary_collection.data!.id, diff --git a/src/app/shared/mappers/registration-provider.mapper.ts b/src/app/shared/mappers/registration-provider.mapper.ts index 8feb41303..7ef9ee2d0 100644 --- a/src/app/shared/mappers/registration-provider.mapper.ts +++ b/src/app/shared/mappers/registration-provider.mapper.ts @@ -36,6 +36,8 @@ export class RegistrationProviderMapper { reviewsWorkflow: response.attributes.reviews_workflow, allowSubmissions: response.attributes.allow_submissions, allowUpdates: response.attributes.allow_updates, + redirectAutomatically: response.attributes.redirect_automatically, + redirectUrl: response.links.redirect_url, }; } } diff --git a/src/app/shared/models/collections/collection-provider-json-api.model.ts b/src/app/shared/models/collections/collection-provider-json-api.model.ts index 797df8dbe..5156377c5 100644 --- a/src/app/shared/models/collections/collection-provider-json-api.model.ts +++ b/src/app/shared/models/collections/collection-provider-json-api.model.ts @@ -16,7 +16,7 @@ export interface CollectionProviderDataJsonApi extends JsonApiResource< > { embeds: CollectionProviderEmbedsJsonApi; relationships: CollectionProviderRelationshipsJsonApi; - links?: Pick; + links?: Pick; } interface CollectionProviderEmbedsJsonApi { diff --git a/src/app/shared/models/provider/base-provider-json-api.model.ts b/src/app/shared/models/provider/base-provider-json-api.model.ts index 27bce5d3d..650811957 100644 --- a/src/app/shared/models/provider/base-provider-json-api.model.ts +++ b/src/app/shared/models/provider/base-provider-json-api.model.ts @@ -13,6 +13,7 @@ export interface BaseProviderAttributesJsonApi { footer_links: string; name: string; permissions: ReviewPermissions[]; + redirect_automatically: boolean; reviews_workflow: string; share_publish_type: string; share_source: string; diff --git a/src/app/shared/models/provider/provider.model.ts b/src/app/shared/models/provider/provider.model.ts index 4ee7774f6..2ec45017f 100644 --- a/src/app/shared/models/provider/provider.model.ts +++ b/src/app/shared/models/provider/provider.model.ts @@ -24,6 +24,8 @@ export interface BaseProviderModel { footerLinks: string; name: string; permissions: ReviewPermissions[]; + redirectAutomatically: boolean; + redirectUrl?: string; reviewsWorkflow: string; sharePublishType: string; shareSource: string; diff --git a/src/app/shared/models/provider/registry-provider.model.ts b/src/app/shared/models/provider/registry-provider.model.ts index 9ccec98f6..fe3affb31 100644 --- a/src/app/shared/models/provider/registry-provider.model.ts +++ b/src/app/shared/models/provider/registry-provider.model.ts @@ -12,4 +12,6 @@ export interface RegistryProviderDetails { reviewsWorkflow: string; allowSubmissions: boolean; allowUpdates: boolean; + redirectAutomatically: boolean; + redirectUrl?: string; } diff --git a/src/testing/mocks/preprint-provider-details.ts b/src/testing/mocks/preprint-provider-details.ts index e70e4c090..b2d48adf1 100644 --- a/src/testing/mocks/preprint-provider-details.ts +++ b/src/testing/mocks/preprint-provider-details.ts @@ -29,6 +29,8 @@ export const PREPRINT_PROVIDER_DETAILS_MOCK: PreprintProviderDetails = { faviconUrl: 'https://osf.io/favicon.ico', squareColorNoTransparentImageUrl: 'https://osf.io/image.png', facebookAppId: '1234567890', + redirectAutomatically: false, + redirectUrl: 'https://osf.io/redirect', reviewsCommentsPrivate: null, reviewsCommentsAnonymous: null, lastFetched: Date.now(), From af143879b19e5e0205957d0c3cbca9b153f13c5c Mon Sep 17 00:00:00 2001 From: Futa Ikeda Date: Tue, 17 Nov 2026 17:21:56 -0500 Subject: [PATCH 3/3] feat(redirect): Update test mocks --- src/app/core/guards/is-file.guard.spec.ts | 1 + src/app/core/guards/is-project.guard.spec.ts | 1 + src/app/core/guards/is-registry.guard.spec.ts | 1 + .../metadata-registry-info.component.spec.ts | 1 + .../registry-provider-hero.component.spec.ts | 1 + .../registries-provider-search.component.spec.ts | 1 + 6 files changed, 6 insertions(+) diff --git a/src/app/core/guards/is-file.guard.spec.ts b/src/app/core/guards/is-file.guard.spec.ts index 2eda4a84a..05f2bb99e 100644 --- a/src/app/core/guards/is-file.guard.spec.ts +++ b/src/app/core/guards/is-file.guard.spec.ts @@ -28,6 +28,7 @@ describe('isFileGuard', () => { id: 'file-id', type: CurrentResourceType.Files, permissions: [], + redirectAutomatically: false, ...overrides, }); diff --git a/src/app/core/guards/is-project.guard.spec.ts b/src/app/core/guards/is-project.guard.spec.ts index 3f089fe41..c17587e17 100644 --- a/src/app/core/guards/is-project.guard.spec.ts +++ b/src/app/core/guards/is-project.guard.spec.ts @@ -30,6 +30,7 @@ describe('isProjectGuard', () => { id: 'resource-id', type: CurrentResourceType.Projects, permissions: [], + redirectAutomatically: false, ...overrides, }); diff --git a/src/app/core/guards/is-registry.guard.spec.ts b/src/app/core/guards/is-registry.guard.spec.ts index b4f880fa4..43872a911 100644 --- a/src/app/core/guards/is-registry.guard.spec.ts +++ b/src/app/core/guards/is-registry.guard.spec.ts @@ -30,6 +30,7 @@ describe('isRegistryGuard', () => { id: 'resource-id', type: CurrentResourceType.Registrations, permissions: [], + redirectAutomatically: false, ...overrides, }); diff --git a/src/app/features/metadata/components/metadata-registry-info/metadata-registry-info.component.spec.ts b/src/app/features/metadata/components/metadata-registry-info/metadata-registry-info.component.spec.ts index 34f80a903..34486913d 100644 --- a/src/app/features/metadata/components/metadata-registry-info/metadata-registry-info.component.spec.ts +++ b/src/app/features/metadata/components/metadata-registry-info/metadata-registry-info.component.spec.ts @@ -20,6 +20,7 @@ describe('MetadataRegistryInfoComponent', () => { reviewsWorkflow: 'standard', allowSubmissions: true, allowUpdates: true, + redirectAutomatically: false, }; beforeEach(() => { diff --git a/src/app/features/registries/components/registry-provider-hero/registry-provider-hero.component.spec.ts b/src/app/features/registries/components/registry-provider-hero/registry-provider-hero.component.spec.ts index 8fdba2575..b84c6aaa2 100644 --- a/src/app/features/registries/components/registry-provider-hero/registry-provider-hero.component.spec.ts +++ b/src/app/features/registries/components/registry-provider-hero/registry-provider-hero.component.spec.ts @@ -38,6 +38,7 @@ describe('RegistryProviderHeroComponent', () => { reviewsWorkflow: '', allowSubmissions: false, allowUpdates: true, + redirectAutomatically: false, }; beforeEach(() => { diff --git a/src/app/features/registries/pages/registries-provider-search/registries-provider-search.component.spec.ts b/src/app/features/registries/pages/registries-provider-search/registries-provider-search.component.spec.ts index 2e2fe0908..6abe244ba 100644 --- a/src/app/features/registries/pages/registries-provider-search/registries-provider-search.component.spec.ts +++ b/src/app/features/registries/pages/registries-provider-search/registries-provider-search.component.spec.ts @@ -37,6 +37,7 @@ const MOCK_PROVIDER: RegistryProviderDetails = { reviewsWorkflow: 'pre-moderation', allowSubmissions: true, allowUpdates: true, + redirectAutomatically: false, }; describe('RegistriesProviderSearchComponent', () => {