{{ description() }}
+ } diff --git a/src/app/shared/components/sub-header/sub-header.component.ts b/src/app/shared/components/sub-header/sub-header.component.ts index 449290e4b..3e2fb91b0 100644 --- a/src/app/shared/components/sub-header/sub-header.component.ts +++ b/src/app/shared/components/sub-header/sub-header.component.ts @@ -1,4 +1,5 @@ import { Button } from 'primeng/button'; +import { SafeHtmlPipe } from 'primeng/menu'; import { Skeleton } from 'primeng/skeleton'; import { Tooltip } from 'primeng/tooltip'; @@ -6,7 +7,7 @@ import { ChangeDetectionStrategy, Component, input, output } from '@angular/core @Component({ selector: 'osf-sub-header', - imports: [Button, Tooltip, Skeleton], + imports: [Button, Tooltip, Skeleton, SafeHtmlPipe], templateUrl: './sub-header.component.html', styleUrl: './sub-header.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/src/app/shared/constants/index.ts b/src/app/shared/constants/index.ts index 503a11b31..fd9e0a180 100644 --- a/src/app/shared/constants/index.ts +++ b/src/app/shared/constants/index.ts @@ -3,6 +3,7 @@ export * from './addons-category-options.const'; export * from './addons-tab-options.const'; export * from './input-limits.const'; export * from './input-validation-messages.const'; +export * from './meetings-table.constants'; export * from './remove-nullable.const'; export * from './resource-filters-defaults'; export * from './resource-languages.const'; diff --git a/src/app/features/meetings/constants/meetings-table.constants.ts b/src/app/shared/constants/meetings-table.constants.ts similarity index 62% rename from src/app/features/meetings/constants/meetings-table.constants.ts rename to src/app/shared/constants/meetings-table.constants.ts index 962cb9372..769587a07 100644 --- a/src/app/features/meetings/constants/meetings-table.constants.ts +++ b/src/app/shared/constants/meetings-table.constants.ts @@ -1,6 +1,6 @@ -import { TableParameters } from '@osf/shared/models'; +import { TableParameters } from '@shared/models'; -export const MEETINGS_TABLE_PARAMS: TableParameters = { +export const TABLE_PARAMS: TableParameters = { rows: 10, paginator: true, scrollable: false, diff --git a/src/app/shared/mappers/index.ts b/src/app/shared/mappers/index.ts index 82df7cbb1..3aa68b980 100644 --- a/src/app/shared/mappers/index.ts +++ b/src/app/shared/mappers/index.ts @@ -1,3 +1,4 @@ export * from './addon.mapper'; export * from './filters'; +export * from './institutions'; export * from './resource-card'; diff --git a/src/app/shared/mappers/institutions/general-institution.mapper.ts b/src/app/shared/mappers/institutions/general-institution.mapper.ts new file mode 100644 index 000000000..15dc684b6 --- /dev/null +++ b/src/app/shared/mappers/institutions/general-institution.mapper.ts @@ -0,0 +1,25 @@ +import { FetchInstitutionsJsonApi, GetGeneralInstitutionsResponse, Institution, InstitutionData } from '@shared/models'; + +export class GeneralInstitutionMapper { + static adaptInstitution(data: InstitutionData): Institution { + return { + id: data.id, + type: data.type, + name: data.attributes.name, + description: data.attributes.description, + iri: data.attributes.iri, + rorIri: data.attributes.ror_iri, + iris: data.attributes.iris, + assets: data.attributes.assets, + institutionalRequestAccessEnabled: data.attributes.institutional_request_access_enabled, + logoPath: data.attributes.logo_path, + }; + } + + static adaptInstitutions(response: FetchInstitutionsJsonApi): GetGeneralInstitutionsResponse { + return { + data: response.data.map((institution) => this.adaptInstitution(institution)), + total: response.links.meta.total, + }; + } +} diff --git a/src/app/shared/mappers/institutions/index.ts b/src/app/shared/mappers/institutions/index.ts new file mode 100644 index 000000000..7931a9fad --- /dev/null +++ b/src/app/shared/mappers/institutions/index.ts @@ -0,0 +1,2 @@ +export * from './general-institution.mapper'; +export * from './user-institutions.mapper'; diff --git a/src/app/features/institutions/mappers/institutions.mapper.ts b/src/app/shared/mappers/institutions/user-institutions.mapper.ts similarity index 83% rename from src/app/features/institutions/mappers/institutions.mapper.ts rename to src/app/shared/mappers/institutions/user-institutions.mapper.ts index 4b7751846..c9d12cb8f 100644 --- a/src/app/features/institutions/mappers/institutions.mapper.ts +++ b/src/app/shared/mappers/institutions/user-institutions.mapper.ts @@ -1,6 +1,6 @@ -import { Institution, UserInstitutionGetResponse } from '../models'; +import { Institution, UserInstitutionGetResponse } from '@shared/models'; -export class InstitutionsMapper { +export class UserInstitutionsMapper { static fromResponse(response: UserInstitutionGetResponse): Institution { return { id: response.id, diff --git a/src/app/shared/models/index.ts b/src/app/shared/models/index.ts index aab430c28..c25c4edec 100644 --- a/src/app/shared/models/index.ts +++ b/src/app/shared/models/index.ts @@ -10,6 +10,7 @@ export * from './filter-labels.model'; export * from './filters'; export * from './google-drive-folder.model'; export * from './id-name.model'; +export * from './institutions'; export * from './metadata-field.model'; export * from './nav-item.model'; export * from './node-response.model'; diff --git a/src/app/shared/models/institutions/index.ts b/src/app/shared/models/institutions/index.ts new file mode 100644 index 000000000..64a2ea307 --- /dev/null +++ b/src/app/shared/models/institutions/index.ts @@ -0,0 +1,2 @@ +export * from './institutions.models'; +export * from './institutions-json-api.model'; diff --git a/src/app/shared/models/institutions/institutions-json-api.model.ts b/src/app/shared/models/institutions/institutions-json-api.model.ts new file mode 100644 index 000000000..49017a50c --- /dev/null +++ b/src/app/shared/models/institutions/institutions-json-api.model.ts @@ -0,0 +1,66 @@ +import { Institution, InstitutionAttributes } from '@shared/models'; + +export interface InstitutionRelationships { + nodes: { + links: { + related: { + href: string; + meta: Record