From b40f4d57da7ce804ff95a9c54b0b6f7ce9c50874 Mon Sep 17 00:00:00 2001 From: nsemets Date: Fri, 26 Sep 2025 14:53:38 +0300 Subject: [PATCH 1/5] fix(citation-format): fixed citation --- src/app/shared/pipes/citation-format.pipe.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/pipes/citation-format.pipe.ts b/src/app/shared/pipes/citation-format.pipe.ts index 2be2ecfa7..5f385fdaf 100644 --- a/src/app/shared/pipes/citation-format.pipe.ts +++ b/src/app/shared/pipes/citation-format.pipe.ts @@ -32,7 +32,7 @@ export class CitationFormatPipe implements PipeTransform { return (names || '') .trim() .split(/\s+/) - .map((n) => (/^[a-z]/i.test(n) ? `${n[0].toUpperCase()}.` : '')) + .map((n) => (/^\p{L}/u.test(n) ? `${n[0].toUpperCase()}.` : '')) .filter(Boolean) .join(' '); } From 24a2dcc4f8d9f4c40ecbddfaee2951768a551ee7 Mon Sep 17 00:00:00 2001 From: nsemets Date: Fri, 26 Sep 2025 16:33:13 +0300 Subject: [PATCH 2/5] fix(contributors): fixed deactivated contributor bug --- .../view-duplicates.component.html | 2 +- .../mappers/my-resources.mapper.ts | 9 ++------- .../my-projects-table.component.spec.ts | 5 ++--- .../registration-card.component.html | 2 +- .../contributors/contributors.mapper.ts | 12 +++++++++--- src/app/shared/mappers/duplicates.mapper.ts | 13 ++++--------- .../registration/registration.mapper.ts | 14 ++++---------- .../contributor-response-json-api.model.ts | 5 +++-- .../duplicates/duplicate-json-api.model.ts | 19 +++---------------- .../models/duplicates/duplicate.model.ts | 11 +++-------- .../my-resources/my-resources.models.ts | 19 +++---------------- .../registration-json-api.model.ts | 16 ++-------------- .../shared/models/user/user-json-api.model.ts | 15 +++++++++++++++ 13 files changed, 52 insertions(+), 90 deletions(-) diff --git a/src/app/features/analytics/components/view-duplicates/view-duplicates.component.html b/src/app/features/analytics/components/view-duplicates/view-duplicates.component.html index 515a58a39..18386fbb6 100644 --- a/src/app/features/analytics/components/view-duplicates/view-duplicates.component.html +++ b/src/app/features/analytics/components/view-duplicates/view-duplicates.component.html @@ -56,7 +56,7 @@

{{ 'common.labels.contributors' | translate }}: @for (contributor of duplicate.contributors; track contributor.id) {
- {{ contributor.fullName }} + {{ contributor.fullName }} {{ $last ? '' : ',' }}
} diff --git a/src/app/features/my-projects/mappers/my-resources.mapper.ts b/src/app/features/my-projects/mappers/my-resources.mapper.ts index 767338291..7b89a4af5 100644 --- a/src/app/features/my-projects/mappers/my-resources.mapper.ts +++ b/src/app/features/my-projects/mappers/my-resources.mapper.ts @@ -1,3 +1,4 @@ +import { ContributorsMapper } from '@osf/shared/mappers'; import { MyResourcesItem, MyResourcesItemGetResponseJsonApi } from '@osf/shared/models'; export class MyResourcesMapper { @@ -9,13 +10,7 @@ export class MyResourcesMapper { dateCreated: response.attributes.date_created, dateModified: response.attributes.date_modified, isPublic: response.attributes.public, - contributors: - response.embeds?.bibliographic_contributors?.data?.map((contributor) => ({ - familyName: contributor.embeds.users.data?.attributes.family_name, - fullName: contributor.embeds.users.data?.attributes.full_name, - givenName: contributor.embeds.users.data?.attributes.given_name, - middleName: contributor.embeds.users.data?.attributes.middle_name, - })) ?? [], + contributors: ContributorsMapper.getContributorShortInfo(response.embeds?.bibliographic_contributors?.data), }; } } diff --git a/src/app/shared/components/my-projects-table/my-projects-table.component.spec.ts b/src/app/shared/components/my-projects-table/my-projects-table.component.spec.ts index 991da20f9..fa3ac94a1 100644 --- a/src/app/shared/components/my-projects-table/my-projects-table.component.spec.ts +++ b/src/app/shared/components/my-projects-table/my-projects-table.component.spec.ts @@ -34,10 +34,9 @@ describe('MyProjectsTableComponent', () => { dateModified: '2024-01-01T10:00:00Z', contributors: [ { - familyName: 'John Doe', + id: '1', + userId: 'user1', fullName: 'Jane Smith', - middleName: 'Jane Smith', - givenName: 'Jane Smith', }, ], type: '', diff --git a/src/app/shared/components/registration-card/registration-card.component.html b/src/app/shared/components/registration-card/registration-card.component.html index 11c0c6e64..d74aac4c3 100644 --- a/src/app/shared/components/registration-card/registration-card.component.html +++ b/src/app/shared/components/registration-card/registration-card.component.html @@ -39,7 +39,7 @@

{{ 'project.overview.metadata.contributors' | translate }}: @for (contributor of registrationData().contributors; track contributor) { - {{ contributor.fullName }} + {{ contributor.fullName }} @if (!$last) { , } diff --git a/src/app/shared/mappers/contributors/contributors.mapper.ts b/src/app/shared/mappers/contributors/contributors.mapper.ts index e91715396..22cd79f88 100644 --- a/src/app/shared/mappers/contributors/contributors.mapper.ts +++ b/src/app/shared/mappers/contributors/contributors.mapper.ts @@ -11,8 +11,14 @@ import { } from '@osf/shared/models'; export class ContributorsMapper { - static fromResponse(response: ContributorDataJsonApi[]): ContributorModel[] { - return response.map((contributor) => this.fromContributorResponse(contributor)); + static fromResponse(response: ContributorDataJsonApi[] | undefined): ContributorModel[] { + if (!response) { + return []; + } + + return response + .filter((contributor) => !contributor?.embeds?.users?.errors) + .map((contributor) => this.fromContributorResponse(contributor)); } static fromContributorResponse(response: ContributorDataJsonApi): ContributorModel { @@ -33,7 +39,7 @@ export class ContributorsMapper { }; } - static getContributorShortInfo(response: ContributorDataJsonApi[]): ContributorShortInfoModel[] { + static getContributorShortInfo(response: ContributorDataJsonApi[] | undefined): ContributorShortInfoModel[] { const contributors = this.fromResponse(response); return contributors.map((contributor) => ({ diff --git a/src/app/shared/mappers/duplicates.mapper.ts b/src/app/shared/mappers/duplicates.mapper.ts index a082823a9..9ce728059 100644 --- a/src/app/shared/mappers/duplicates.mapper.ts +++ b/src/app/shared/mappers/duplicates.mapper.ts @@ -1,6 +1,8 @@ import { ResponseJsonApi } from '@shared/models'; -import { DuplicateJsonApi, DuplicatesWithTotal } from 'src/app/shared/models/duplicates'; +import { DuplicateJsonApi, DuplicatesWithTotal } from '../models/duplicates'; + +import { ContributorsMapper } from './contributors'; export class DuplicatesMapper { static fromDuplicatesJsonApiResponse(response: ResponseJsonApi): DuplicatesWithTotal { @@ -14,14 +16,7 @@ export class DuplicatesMapper { dateModified: duplicate.attributes.date_modified, public: duplicate.attributes.public, currentUserPermissions: duplicate.attributes.current_user_permissions, - contributors: duplicate.embeds.bibliographic_contributors.data.map((contributor) => ({ - familyName: contributor.embeds.users.data.attributes.family_name, - fullName: contributor.embeds.users.data.attributes.full_name, - givenName: contributor.embeds.users.data.attributes.given_name, - middleName: contributor.embeds.users.data.attributes.middle_name, - id: contributor.embeds.users.data.id, - type: contributor.embeds.users.data.type, - })), + contributors: ContributorsMapper.getContributorShortInfo(duplicate.embeds.bibliographic_contributors.data), })), totalCount: response.meta.total, }; diff --git a/src/app/shared/mappers/registration/registration.mapper.ts b/src/app/shared/mappers/registration/registration.mapper.ts index 916022d8c..71ac07cf5 100644 --- a/src/app/shared/mappers/registration/registration.mapper.ts +++ b/src/app/shared/mappers/registration/registration.mapper.ts @@ -9,6 +9,8 @@ import { SchemaResponseDataJsonApi, } from '@osf/shared/models'; +import { ContributorsMapper } from '../contributors'; + import { MapRegistryStatus } from './map-registry-status.mapper'; export class RegistrationMapper { @@ -66,11 +68,7 @@ export class RegistrationMapper { registrationTemplate: registration.embeds?.registration_schema?.data?.attributes?.name || '', registry: registration.embeds?.provider?.data?.attributes?.name || '', public: registration.attributes.public, - contributors: - registration.embeds?.bibliographic_contributors?.data.map((contributor) => ({ - id: contributor.id, - fullName: contributor.embeds?.users?.data.attributes.full_name, - })) || [], + contributors: ContributorsMapper.getContributorShortInfo(registration.embeds?.bibliographic_contributors?.data), currentUserPermissions: registration.attributes.current_user_permissions, }; } @@ -93,11 +91,7 @@ export class RegistrationMapper { hasMaterials: registration.attributes.has_materials, hasPapers: registration.attributes.has_papers, hasSupplements: registration.attributes.has_supplements, - contributors: - registration.embeds?.bibliographic_contributors?.data.map((contributor) => ({ - id: contributor.embeds.users.data.id, - fullName: contributor.embeds.users.data.attributes.full_name, - })) || [], + contributors: ContributorsMapper.getContributorShortInfo(registration.embeds?.bibliographic_contributors?.data), rootParentId: registration.relationships.root?.data?.id, currentUserPermissions: registration.attributes.current_user_permissions, }; diff --git a/src/app/shared/models/contributors/contributor-response-json-api.model.ts b/src/app/shared/models/contributors/contributor-response-json-api.model.ts index 275d1b1e5..c5d71471a 100644 --- a/src/app/shared/models/contributors/contributor-response-json-api.model.ts +++ b/src/app/shared/models/contributors/contributor-response-json-api.model.ts @@ -1,5 +1,5 @@ import { ContributorPermission } from '@osf/shared/enums'; -import { ResponseJsonApi, UserDataJsonApi } from '@osf/shared/models'; +import { ResponseJsonApi, UserDataJsonApi, UserErrorResponseJsonApi } from '@osf/shared/models'; export type ContributorResponseJsonApi = ResponseJsonApi; export type ContributorsResponseJsonApi = ResponseJsonApi; @@ -50,8 +50,9 @@ interface RelationshipUsersDataJsonApi { type?: 'users'; } -interface EmbeddedUsersJsonApi { +export interface EmbeddedUsersJsonApi { data: UserDataJsonApi; + errors?: UserErrorResponseJsonApi[]; } interface RelationshipJsonApi { diff --git a/src/app/shared/models/duplicates/duplicate-json-api.model.ts b/src/app/shared/models/duplicates/duplicate-json-api.model.ts index 80a92af54..b81280c9c 100644 --- a/src/app/shared/models/duplicates/duplicate-json-api.model.ts +++ b/src/app/shared/models/duplicates/duplicate-json-api.model.ts @@ -1,3 +1,5 @@ +import { ContributorDataJsonApi } from '../contributors'; + export interface DuplicateJsonApi { id: string; type: string; @@ -11,22 +13,7 @@ export interface DuplicateJsonApi { }; embeds: { bibliographic_contributors: { - data: { - embeds: { - users: { - data: { - id: string; - type: string; - attributes: { - family_name: string; - full_name: string; - given_name: string; - middle_name: string; - }; - }; - }; - }; - }[]; + data: ContributorDataJsonApi[]; }; }; } diff --git a/src/app/shared/models/duplicates/duplicate.model.ts b/src/app/shared/models/duplicates/duplicate.model.ts index ebf28e551..d940c9558 100644 --- a/src/app/shared/models/duplicates/duplicate.model.ts +++ b/src/app/shared/models/duplicates/duplicate.model.ts @@ -1,3 +1,5 @@ +import { ContributorShortInfoModel } from '../contributors'; + export interface Duplicate { id: string; type: string; @@ -7,14 +9,7 @@ export interface Duplicate { dateModified: string; public: boolean; currentUserPermissions: string[]; - contributors: { - familyName: string; - fullName: string; - givenName: string; - middleName: string; - id: string; - type: string; - }[]; + contributors: ContributorShortInfoModel[]; } export interface DuplicatesWithTotal { diff --git a/src/app/shared/models/my-resources/my-resources.models.ts b/src/app/shared/models/my-resources/my-resources.models.ts index 05539b6c9..201a4d117 100644 --- a/src/app/shared/models/my-resources/my-resources.models.ts +++ b/src/app/shared/models/my-resources/my-resources.models.ts @@ -1,4 +1,4 @@ -import { ResponseJsonApi } from '@shared/models'; +import { ContributorDataJsonApi, ContributorShortInfoModel, ResponseJsonApi } from '@shared/models'; export type MyResourcesItemResponseJsonApi = ResponseJsonApi; @@ -15,20 +15,7 @@ export interface MyResourcesItemGetResponseJsonApi { }; embeds: { bibliographic_contributors: { - data: { - embeds: { - users: { - data: { - attributes: { - family_name: string; - full_name: string; - given_name: string; - middle_name: string; - }; - }; - }; - }; - }[]; + data: ContributorDataJsonApi[]; }; }; } @@ -47,5 +34,5 @@ export interface MyResourcesItem { dateCreated: string; dateModified: string; isPublic: boolean; - contributors: MyResourcesContributor[]; + contributors: ContributorShortInfoModel[]; } 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 a02d6f8e8..3b710fffb 100644 --- a/src/app/shared/models/registration/registration-json-api.model.ts +++ b/src/app/shared/models/registration/registration-json-api.model.ts @@ -1,6 +1,7 @@ import { RegistrationReviewStates, RevisionReviewStates, UserPermissions } from '@osf/shared/enums'; import { ApiData, MetaJsonApi, PaginationLinksJsonApi } from '../common'; +import { ContributorDataJsonApi } from '../contributors'; import { LicenseRecordJsonApi } from '../licenses-json-api.model'; export interface DraftRegistrationResponseJsonApi { @@ -130,20 +131,7 @@ export interface RegistrationEmbedsJsonApi { }; }; bibliographic_contributors?: { - data: { - id: string; - type: 'users'; - embeds: { - users: { - data: { - attributes: { - full_name: string; - }; - id: string; - }; - }; - }; - }[]; + data: ContributorDataJsonApi[]; }; provider?: { data: { diff --git a/src/app/shared/models/user/user-json-api.model.ts b/src/app/shared/models/user/user-json-api.model.ts index 54bf2d329..1db6d2da2 100644 --- a/src/app/shared/models/user/user-json-api.model.ts +++ b/src/app/shared/models/user/user-json-api.model.ts @@ -45,6 +45,21 @@ export interface UserAttributesJsonApi { timezone: string; } +export interface UserErrorResponseJsonApi { + source: Record; + detail: string; + meta: UserErrorMetaJsonApi; + status: string; +} + +export interface UserErrorMetaJsonApi { + full_name: string; + family_name: string; + given_name: string; + middle_names: string; + profile_image: string; +} + interface UserLinksJsonApi { html: string; iri: string; From ceb0f73ada250b09491e81cdef346cc1592cb8ca Mon Sep 17 00:00:00 2001 From: nsemets Date: Fri, 26 Sep 2025 16:37:45 +0300 Subject: [PATCH 3/5] fix(status): fixed registry status --- .../registry-statuses/registry-statuses.component.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/features/registry/components/registry-statuses/registry-statuses.component.html b/src/app/features/registry/components/registry-statuses/registry-statuses.component.html index f3a044be6..eee19584f 100644 --- a/src/app/features/registry/components/registry-statuses/registry-statuses.component.html +++ b/src/app/features/registry/components/registry-statuses/registry-statuses.component.html @@ -7,20 +7,20 @@

{{ 'registry.overview.statuses.' + registry()?.status + '.short' | translate }}

-
-

+

+ {{ 'registry.overview.statuses.' + registry()?.status + '.long' | translate: { embargoEndDate: embargoEndDate } }} -

+ @if (isAccepted()) { - + {{ 'registry.overview.statuses.accepted.project' | translate }}. } -
+

@if (canEdit()) { @if (canWithdraw()) { From e99299d6c89fb35f4f02100a7e38763b68ba6434 Mon Sep 17 00:00:00 2001 From: nsemets Date: Fri, 26 Sep 2025 16:52:37 +0300 Subject: [PATCH 4/5] fix(toast): fixed toast message for mobile --- src/app/shared/components/toast/toast.component.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/shared/components/toast/toast.component.html b/src/app/shared/components/toast/toast.component.html index 41fa03355..61e339e2e 100644 --- a/src/app/shared/components/toast/toast.component.html +++ b/src/app/shared/components/toast/toast.component.html @@ -1,4 +1,10 @@ - +
{{ message.summary | translate: message.data?.translationParams }}
From 6b9d04d41ffd4fab92fc9346a2f31bbc02d08ce5 Mon Sep 17 00:00:00 2001 From: nsemets Date: Fri, 26 Sep 2025 17:02:56 +0300 Subject: [PATCH 5/5] fix(dashboard): fixed responsive --- .../features/home/pages/dashboard/dashboard.component.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/features/home/pages/dashboard/dashboard.component.html b/src/app/features/home/pages/dashboard/dashboard.component.html index 4ba12e2f2..afd81f0a4 100644 --- a/src/app/features/home/pages/dashboard/dashboard.component.html +++ b/src/app/features/home/pages/dashboard/dashboard.component.html @@ -111,6 +111,7 @@

{{ 'home.loggedIn.hosting.title' | translate }}

data-test-products-collections > @@ -118,6 +119,7 @@

{{ 'home.loggedIn.hosting.title' | translate }}

@@ -125,6 +127,7 @@

{{ 'home.loggedIn.hosting.title' | translate }}

@@ -132,6 +135,7 @@

{{ 'home.loggedIn.hosting.title' | translate }}