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
6 changes: 3 additions & 3 deletions src/app/core/constants/nav-items.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,14 @@ export const MENU_ITEMS: MenuItem[] = [
routerLink: '/registries/discover',
label: 'navigation.discover',
visible: true,
routerLinkActiveOptions: { exact: true },
routerLinkActiveOptions: { exact: false },
},
{
id: 'registries-moderation',
routerLink: '/registries/osf/moderation',
routerLink: '/registries',
label: 'navigation.moderation',
visible: false,
routerLinkActiveOptions: { exact: true },
routerLinkActiveOptions: { exact: false },
},
{
id: 'registry-details',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
import { TABLE_PARAMS } from '@osf/shared/constants';
import { parseQueryFilterParams } from '@osf/shared/helpers';
import { QueryParams } from '@osf/shared/models';
import { FetchInstitutions, InstitutionsSelectors } from '@osf/shared/stores/institutions';
import { FetchInstitutions, InstitutionsSelectors } from '@osf/shared/stores';

@Component({
selector: 'osf-institutions-list',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/cor
import { FormsModule } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';

import { LoadingSpinnerComponent } from '@osf/shared/components';
import { GlobalSearchComponent, LoadingSpinnerComponent } from '@osf/shared/components';
import { SEARCH_TAB_OPTIONS } from '@osf/shared/constants';
import { SetDefaultFilterValue } from '@osf/shared/stores/global-search';
import { FetchInstitutionById, InstitutionsSearchSelectors } from '@osf/shared/stores/institutions-search';
import { GlobalSearchComponent } from '@shared/components';
import { SetDefaultFilterValue } from '@shared/stores/global-search';

@Component({
selector: 'osf-institutions-search',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class="link-btn-no-padding"
link
[label]="submission().title"
[routerLink]="[submission().id, 'overview']"
[routerLink]="['/', submission().id, 'overview']"
[queryParams]="{
mode: 'moderator',
revisionId: isPendingModeration && !isPending ? submission().revisionId : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export interface PreprintProviderModerationInfo {
submissionCount?: number;
reviewsCommentsAnonymous: boolean;
reviewsCommentsPrivate: boolean;
reviewsWorkflow: boolean;
supportEmail?: string;
reviewsWorkflow: string;
supportEmail: string | null;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { PreprintProviderAttributesJsonApi } from '@osf/shared/models';

export interface PreprintRelatedCountJsonApi {
id: string;
attributes: {
name: string;
reviews_comments_anonymous: boolean;
reviews_comments_private: boolean;
reviews_workflow: boolean;
email_support?: string;
};
attributes: PreprintProviderAttributesJsonApi;
relationships: {
preprints: {
links: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
@use "styles/mixins" as mix;

.registries-hero-container {
background-image: var(--branding-hero-background-image-url);
color: var(--white);

.provider-description {
line-height: mix.rem(24px);
line-height: 1.5rem;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h2 class="text-2xl text-white">{{ 'registries.services.title' | translate }}</h
<section class="flex flex-wrap justify-content-center md:justify-content-between align-items-center gap-3">
@for (registryService of registryServices; track $index) {
<a
class="registry-service-item"
class="registry-service-item custom-light-hover"
[routerLink]="['/registries', registryService.id]"
[style.background-image]="'url(' + registryService.src + ')'"
[title]="registryService.id"
Expand All @@ -19,7 +19,7 @@ <h2 class="text-2xl text-white">{{ 'registries.services.title' | translate }}</h
<p-button
class="contact-us-button w-full sm:w-auto"
styleClass="w-full sm:w-auto"
(click)="openEmail()"
(onClick)="openEmail()"
[label]="'registries.services.contactUs' | translate"
></p-button>
</div>
Expand Down
5 changes: 2 additions & 3 deletions src/app/features/registries/mappers/providers.mapper.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { RegistryProviderDetails } from '@osf/features/registries/models/registry-provider.model';
import { RegistryProviderDetailsJsonApi } from '@osf/features/registries/models/registry-provider-json-api.model';
import { ProvidersResponseJsonApi } from '@osf/shared/models';

import { ProviderSchema } from '../models';
import { ProviderSchema, RegistryProviderDetails, RegistryProviderDetailsJsonApi } from '../models';

export class ProvidersMapper {
static fromProvidersResponse(response: ProvidersResponseJsonApi): ProviderSchema[] {
Expand All @@ -18,6 +16,7 @@ export class ProvidersMapper {
id: response.id,
name: response.attributes.name,
descriptionHtml: response.attributes.description,
permissions: response.attributes.permissions,
brand: {
id: brandRaw.id,
name: brandRaw.attributes.name,
Expand Down
1 change: 0 additions & 1 deletion src/app/features/registries/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './project';
export * from './projects-json-api.model';
export * from './provider-schema.model';
export * from './registry-provider.model';
export * from './registry-provider-json-api.model';
13 changes: 0 additions & 13 deletions src/app/features/registries/models/projects-json-api.model.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { BrandDataJsonApi } from '@shared/models';
import { BrandDataJsonApi, RegistrationProviderAttributesJsonApi } from '@shared/models';

export interface RegistryProviderDetailsJsonApi {
id: string;
type: 'registration-providers';
attributes: {
name: string;
description: string;
};
attributes: RegistrationProviderAttributesJsonApi;
embeds?: {
brand: {
data: BrandDataJsonApi;
Expand Down
2 changes: 2 additions & 0 deletions src/app/features/registries/models/registry-provider.model.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { ReviewPermissions } from '@osf/shared/enums';
import { Brand } from '@shared/models';

export interface RegistryProviderDetails {
id: string;
name: string;
descriptionHtml: string;
permissions: ReviewPermissions[];
brand: Brand;
iri: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h1>{{ 'registries.browse' | translate }}</h1>
styleClass="hidden sm:block sm:w-auto"
[label]="'registries.seeMore' | translate"
severity="secondary"
(click)="redirectToSearchPageRegistrations()"
(onClick)="redirectToSearchPageRegistrations()"
/>
</div>

Expand All @@ -44,7 +44,7 @@ <h1>{{ 'registries.browse' | translate }}</h1>
styleClass="block w-full sm:hidden"
[label]="'registries.seeMore' | translate"
severity="secondary"
(click)="redirectToSearchPageRegistrations()"
(onClick)="redirectToSearchPageRegistrations()"
/>
</div>
</section>
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@use "styles/variables" as var;

.subheader {
color: var.$dark-blue-1;
}

.registries {
background: var.$white;
background: var(--white);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/cor
import { FormControl } from '@angular/forms';
import { Router } from '@angular/router';

import { RegistryServicesComponent } from '@osf/features/registries/components';
import { GetRegistries, RegistriesSelectors } from '@osf/features/registries/store';
import {
LoadingSpinnerComponent,
ResourceCardComponent,
SearchInputComponent,
SubHeaderComponent,
} from '@shared/components';
import { ResourceType } from '@shared/enums';
} from '@osf/shared/components';
import { ResourceType } from '@osf/shared/enums';

import { RegistryServicesComponent } from '../../components';
import { GetRegistries, RegistriesSelectors } from '../../store';

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

Expand All @@ -40,9 +41,7 @@ export class RegistriesLandingComponent implements OnInit {

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

private readonly actions = createDispatchMap({
getRegistries: GetRegistries,
});
private readonly actions = createDispatchMap({ getRegistries: GetRegistries });

registries = select(RegistriesSelectors.getRegistries);
isRegistriesLoading = select(RegistriesSelectors.isRegistriesLoading);
Expand All @@ -54,15 +53,11 @@ export class RegistriesLandingComponent implements OnInit {
redirectToSearchPageWithValue(): void {
const searchValue = this.searchControl.value;

this.router.navigate(['/search'], {
queryParams: { search: searchValue, tab: ResourceType.Registration },
});
this.router.navigate(['/search'], { queryParams: { search: searchValue, tab: ResourceType.Registration } });
}

redirectToSearchPageRegistrations(): void {
this.router.navigate(['/search'], {
queryParams: { tab: ResourceType.Registration },
});
this.router.navigate(['/search'], { queryParams: { tab: ResourceType.Registration } });
}

goToCreateRegistration(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/cor
import { FormControl } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';

import { RegistryProviderHeroComponent } from '@osf/features/registries/components/registry-provider-hero/registry-provider-hero.component';
import {
GetRegistryProviderBrand,
RegistriesProviderSearchSelectors,
} from '@osf/features/registries/store/registries-provider-search';
import { GlobalSearchComponent } from '@shared/components';
import { ResourceType } from '@shared/enums';
import { SetDefaultFilterValue, SetResourceType } from '@shared/stores/global-search';
import { SetCurrentProvider } from '@core/store/provider';
import { GlobalSearchComponent } from '@osf/shared/components';
import { ResourceType } from '@osf/shared/enums';
import { SetDefaultFilterValue, SetResourceType } from '@osf/shared/stores/global-search';

import { RegistryProviderHeroComponent } from '../../components/registry-provider-hero/registry-provider-hero.component';
import { GetRegistryProviderBrand, RegistriesProviderSearchSelectors } from '../../store/registries-provider-search';

@Component({
selector: 'osf-registries-provider-search',
Expand All @@ -30,6 +29,7 @@ export class RegistriesProviderSearchComponent implements OnInit {
getProvider: GetRegistryProviderBrand,
setDefaultFilterValue: SetDefaultFilterValue,
setResourceType: SetResourceType,
setCurrentProvider: SetCurrentProvider,
});

provider = select(RegistriesProviderSearchSelectors.getBrandedProvider);
Expand All @@ -44,6 +44,7 @@ export class RegistriesProviderSearchComponent implements OnInit {
next: () => {
this.actions.setDefaultFilterValue('publisher', this.provider()!.iri!);
this.actions.setResourceType(ResourceType.Registration);
this.actions.setCurrentProvider(this.provider()!);
},
});
}
Expand Down
1 change: 0 additions & 1 deletion src/app/features/registries/services/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './licenses.service';
export * from './providers.service';
export * from './registration-files.service';
export * from './registries.service';
28 changes: 0 additions & 28 deletions src/app/features/registries/services/projects.service.ts

This file was deleted.

12 changes: 0 additions & 12 deletions src/app/features/registries/services/registration-files.service.ts

This file was deleted.

5 changes: 3 additions & 2 deletions src/app/features/registries/services/registries.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
DraftRegistrationRelationshipsJsonApi,
DraftRegistrationResponseJsonApi,
PageSchema,
PaginatedData,
RegistrationAttributesJsonApi,
RegistrationCard,
RegistrationDataJsonApi,
Expand Down Expand Up @@ -90,7 +91,7 @@ export class RegistriesService {
id,
attributes,
relationships,
type: 'draft_registrations', // force the correct type
type: 'draft_registrations',
},
};
const params = {
Expand Down Expand Up @@ -125,7 +126,7 @@ export class RegistriesService {
.pipe(map((response) => PageSchemaMapper.fromSchemaBlocksResponse(response)));
}

getDraftRegistrations(page: number, pageSize: number): Observable<{ data: RegistrationCard[]; totalCount: number }> {
getDraftRegistrations(page: number, pageSize: number): Observable<PaginatedData<RegistrationCard[]>> {
const params = {
page,
'page[size]': pageSize,
Expand Down
Loading
Loading