diff --git a/src/app/features/admin-institutions/mappers/creators.mapper.ts b/src/app/features/admin-institutions/mappers/creators.mapper.ts index 48a14125d..c1e54968d 100644 --- a/src/app/features/admin-institutions/mappers/creators.mapper.ts +++ b/src/app/features/admin-institutions/mappers/creators.mapper.ts @@ -26,5 +26,6 @@ export function mapCreators(project: ResourceModel, currentInstitutionId: string text: `${name} (${role})`, url: creator.absoluteUrl, }; - }); + }) + ?.slice(0, 2); } diff --git a/src/app/features/moderation/enums/preprint-submissions-sort.enum.ts b/src/app/features/moderation/enums/preprint-submissions-sort.enum.ts index dbf6c5633..ca1f886f1 100644 --- a/src/app/features/moderation/enums/preprint-submissions-sort.enum.ts +++ b/src/app/features/moderation/enums/preprint-submissions-sort.enum.ts @@ -1,6 +1,6 @@ export enum PreprintSubmissionsSort { TitleAZ = 'title', TitleZA = '-title', - Oldest = '-date_last_transitioned', - Newest = 'date_last_transitioned', + Oldest = 'date_last_transitioned', + Newest = '-date_last_transitioned', } diff --git a/src/app/features/preprints/components/stepper/supplements-step/supplements-step.component.html b/src/app/features/preprints/components/stepper/supplements-step/supplements-step.component.html index 13b28e730..6e6f978ed 100644 --- a/src/app/features/preprints/components/stepper/supplements-step/supplements-step.component.html +++ b/src/app/features/preprints/components/stepper/supplements-step/supplements-step.component.html @@ -13,7 +13,7 @@

{{ 'preprints.preprintStepper.supplements.title' | translate }}

}" class="supplement-option-button w-full" styleClass="w-full" - [label]="'preprints.preprintStepper.supplements.options.connectExisting' | translate | titlecase" + [label]="'preprints.preprintStepper.supplements.options.connectExisting' | translate" severity="secondary" (click)="selectSupplementOption(SupplementOptions.ConnectExistingProject)" /> @@ -23,7 +23,7 @@

{{ 'preprints.preprintStepper.supplements.title' | translate }}

}" class="supplement-option-button w-full" styleClass="w-full" - [label]="'preprints.preprintStepper.supplements.options.createNew' | translate | titlecase" + [label]="'preprints.preprintStepper.supplements.options.createNew' | translate" severity="secondary" (click)="selectSupplementOption(SupplementOptions.CreateNewProject)" /> diff --git a/src/app/features/preprints/components/stepper/supplements-step/supplements-step.component.ts b/src/app/features/preprints/components/stepper/supplements-step/supplements-step.component.ts index 428890a4e..46e94e77e 100644 --- a/src/app/features/preprints/components/stepper/supplements-step/supplements-step.component.ts +++ b/src/app/features/preprints/components/stepper/supplements-step/supplements-step.component.ts @@ -9,7 +9,7 @@ import { Skeleton } from 'primeng/skeleton'; import { debounceTime, distinctUntilChanged, map } from 'rxjs'; -import { NgClass, TitleCasePipe } from '@angular/common'; +import { NgClass } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -43,17 +43,7 @@ import { CustomConfirmationService, ToastService } from '@shared/services'; @Component({ selector: 'osf-supplements-step', - imports: [ - Button, - TitleCasePipe, - NgClass, - Card, - Select, - AddProjectFormComponent, - ReactiveFormsModule, - Skeleton, - TranslatePipe, - ], + imports: [Button, NgClass, Card, Select, AddProjectFormComponent, ReactiveFormsModule, Skeleton, TranslatePipe], templateUrl: './supplements-step.component.html', styleUrl: './supplements-step.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/src/app/features/preprints/mappers/preprint-providers.mapper.ts b/src/app/features/preprints/mappers/preprint-providers.mapper.ts index 8237ec52c..a7f43a4e9 100644 --- a/src/app/features/preprints/mappers/preprint-providers.mapper.ts +++ b/src/app/features/preprints/mappers/preprint-providers.mapper.ts @@ -3,11 +3,11 @@ import { PreprintProviderDetailsJsonApi, PreprintProviderShortInfo, } from '@osf/features/preprints/models'; -import { SubjectDataJsonApi, SubjectModel } from '@shared/models'; +import { Brand, BrandDataJsonApi, SubjectDataJsonApi, SubjectModel } from '@shared/models'; export class PreprintProvidersMapper { static fromPreprintProviderDetailsGetResponse(response: PreprintProviderDetailsJsonApi): PreprintProviderDetails { - const brandRaw = response.embeds!.brand.data; + const brandRaw = response.embeds!.brand?.data; return { id: response.id, name: response.attributes.name, @@ -20,16 +20,7 @@ export class PreprintProvidersMapper { allowSubmissions: response.attributes.allow_submissions, assertionsEnabled: response.attributes.assertions_enabled, permissions: response.attributes.permissions, - brand: { - id: brandRaw.id, - name: brandRaw.attributes.name, - heroLogoImageUrl: brandRaw.attributes.hero_logo_image, - heroBackgroundImageUrl: brandRaw.attributes.hero_background_image, - topNavLogoImageUrl: brandRaw.attributes.topnav_logo_image, - primaryColor: brandRaw.attributes.primary_color, - secondaryColor: brandRaw.attributes.secondary_color, - backgroundColor: brandRaw.attributes.background_color, - }, + brand: PreprintProvidersMapper.parseBrand(brandRaw), iri: response.links.iri, faviconUrl: response.attributes.assets?.favicon, squareColorNoTransparentImageUrl: response.attributes.assets?.square_color_no_transparent, @@ -40,6 +31,26 @@ export class PreprintProvidersMapper { }; } + static parseBrand(brandRaw: BrandDataJsonApi): Brand { + if (!brandRaw) { + return { + primaryColor: 'var(--osf-provider-primary-color)', + secondaryColor: 'var(--osf-provider-secondary-color)', + } as Brand; + } + + return { + id: brandRaw.id, + name: brandRaw.attributes.name, + heroLogoImageUrl: brandRaw.attributes.hero_logo_image, + heroBackgroundImageUrl: brandRaw.attributes.hero_background_image, + topNavLogoImageUrl: brandRaw.attributes.topnav_logo_image, + primaryColor: brandRaw.attributes.primary_color, + secondaryColor: brandRaw.attributes.secondary_color, + backgroundColor: brandRaw.attributes.background_color, + }; + } + static toPreprintProviderShortInfoFromGetResponse( response: PreprintProviderDetailsJsonApi[] ): PreprintProviderShortInfo[] { diff --git a/src/app/shared/components/reusable-filter/reusable-filter.component.ts b/src/app/shared/components/reusable-filter/reusable-filter.component.ts index 791a0f9b8..1031b44b3 100644 --- a/src/app/shared/components/reusable-filter/reusable-filter.component.ts +++ b/src/app/shared/components/reusable-filter/reusable-filter.component.ts @@ -168,14 +168,6 @@ export class ReusableFilterComponent { return filter.isLoading || false; } - isFilterPaginationLoading(filter: DiscoverableFilter): boolean { - return filter.isPaginationLoading || false; - } - - isFilterSearchLoading(filter: DiscoverableFilter): boolean { - return filter.isSearchLoading || false; - } - getSelectedValue(filterKey: string): string | null { return this.selectedValues()[filterKey] || null; } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 64a828227..95f34a0eb 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -2038,7 +2038,7 @@ "publicationDateTitle": "Publication Date (optional)", "publicationCitationTitle": "Publication Citation (optional)", "affiliatedInstitutionsTitle": "Affiliated Institutions", - "affiliatedInstitutionsDescription": "You can affiliate your {{preprintWord}} with your institution if it is an OSF institutional member and has worked with the Center for Open Science to create a dedicated institutional OSF landing page." + "affiliatedInstitutionsDescription": "You can affiliate your {{preprintWord}} with your institution if it is an OSF institutional member and has worked with the Center for Open Science to create a dedicated institutional OSF landing page." }, "authorAssertions": { "title": "Author Assertions", @@ -2063,8 +2063,8 @@ "title": "Supplements (optional)", "description": "Connect an OSF project to share data, code, protocols, or other supplemental materials.", "options": { - "connectExisting": "Connect an existing OSF project", - "createNew": "Create a new OSF project" + "connectExisting": "Connect An Existing OSF Project", + "createNew": "Create A New OSF Project" }, "projectSelection": { "title": "Select Project", diff --git a/src/styles/_variables.scss b/src/styles/_variables.scss index c92991071..4533efa38 100644 --- a/src/styles/_variables.scss +++ b/src/styles/_variables.scss @@ -118,6 +118,9 @@ $white-60: var(--white-60); // Opacity Colors --white-60: rgba(256, 256, 256, 0.6); + --osf-provider-primary-color: #f5fafd; + --osf-provider-secondary-color: #204762; + // Gradients --gradient-1: linear-gradient( @@ -167,8 +170,8 @@ $white-60: var(--white-60); --header-background-color: none; --header-background-image-url: none; - --branding-primary-color: var(--pr-blue-1); - --branding-secondary-color: var(--white); + --branding-primary-color: var(--osf-provider-primary-color); + --branding-secondary-color: var(--osf-provider-secondary-color); --branding-background-color: var(--white); --branding-hero-logo-image-url: none; --branding-hero-background-image-url: none;