From ef2d21c062e4485d8e31cbb7c57f18a186a73926 Mon Sep 17 00:00:00 2001 From: konolak Date: Wed, 8 Jan 2025 11:26:47 +0200 Subject: [PATCH] show jufo code 0 in single publication info --- .../single-publication.component.ts | 90 ++++++++++--------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/src/app/portal/components/single/single-publication/single-publication.component.ts b/src/app/portal/components/single/single-publication/single-publication.component.ts index 0b2636f03..cdfaa7203 100644 --- a/src/app/portal/components/single/single-publication/single-publication.component.ts +++ b/src/app/portal/components/single/single-publication/single-publication.component.ts @@ -31,51 +31,51 @@ import { Search } from 'src/app/portal/models/search.model'; import { MatSnackBar } from '@angular/material/snack-bar'; import MetaTags from 'src/assets/static-data/meta-tags.json'; import { AppSettingsService } from '@shared/services/app-settings.service'; -import { ModelUtilsService } from '@shared/services/model-util.service'; -import { CleanCitationPipe } from '../../../pipes/clean-citation'; -import { MatProgressSpinner } from '@angular/material/progress-spinner'; -import { CdkCopyToClipboard } from '@angular/cdk/clipboard'; -import { DialogComponent } from '../../../../shared/components/dialog/dialog.component'; -import { ShareComponent } from '../share/share.component'; -import { SecondaryButtonComponent } from '../../../../shared/components/buttons/secondary-button/secondary-button.component'; -import { RelatedLinksComponent } from '../related-links/related-links.component'; -import { MatCard, MatCardTitle } from '@angular/material/card'; -import { PublicationLinksComponent } from './publication-links/publication-links.component'; -import { OrcidComponent } from '../../../../shared/components/orcid/orcid.component'; -import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { TooltipModule } from 'ngx-bootstrap/tooltip'; -import { BreadcrumbComponent } from '../../breadcrumb/breadcrumb.component'; +import { ModelUtilsService } from '@shared/services/model-util.service'; +import { CleanCitationPipe } from '../../../pipes/clean-citation'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { CdkCopyToClipboard } from '@angular/cdk/clipboard'; +import { DialogComponent } from '../../../../shared/components/dialog/dialog.component'; +import { ShareComponent } from '../share/share.component'; +import { SecondaryButtonComponent } from '../../../../shared/components/buttons/secondary-button/secondary-button.component'; +import { RelatedLinksComponent } from '../related-links/related-links.component'; +import { MatCard, MatCardTitle } from '@angular/material/card'; +import { PublicationLinksComponent } from './publication-links/publication-links.component'; +import { OrcidComponent } from '../../../../shared/components/orcid/orcid.component'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { TooltipModule } from 'ngx-bootstrap/tooltip'; +import { BreadcrumbComponent } from '../../breadcrumb/breadcrumb.component'; import { SearchBarComponent } from '../../search-bar/search-bar.component'; -@Component({ - selector: 'app-single-publication', - templateUrl: './single-publication.component.html', - styleUrls: ['./single-publication.component.scss'], - standalone: true, - imports: [ - SearchBarComponent, - NgIf, - RouterLink, - BreadcrumbComponent, - NgFor, - TooltipModule, - FontAwesomeModule, - NgClass, - OrcidComponent, - NgSwitch, - NgSwitchCase, - NgSwitchDefault, - PublicationLinksComponent, - MatCard, - MatCardTitle, - RelatedLinksComponent, - SecondaryButtonComponent, - ShareComponent, - DialogComponent, - CdkCopyToClipboard, - MatProgressSpinner, - CleanCitationPipe, - ], +@Component({ + selector: 'app-single-publication', + templateUrl: './single-publication.component.html', + styleUrls: ['./single-publication.component.scss'], + standalone: true, + imports: [ + SearchBarComponent, + NgIf, + RouterLink, + BreadcrumbComponent, + NgFor, + TooltipModule, + FontAwesomeModule, + NgClass, + OrcidComponent, + NgSwitch, + NgSwitchCase, + NgSwitchDefault, + PublicationLinksComponent, + MatCard, + MatCardTitle, + RelatedLinksComponent, + SecondaryButtonComponent, + ShareComponent, + DialogComponent, + CdkCopyToClipboard, + MatProgressSpinner, + CleanCitationPipe + ] }) export class SinglePublicationComponent implements OnInit, AfterViewInit, OnDestroy @@ -644,7 +644,9 @@ export class SinglePublicationComponent checkEmpty(item) ); this.typeFields = this.typeFields.filter((item) => checkEmpty(item)); - this.mediumFields = this.mediumFields.filter((item) => checkEmpty(item)); + + // Jufo code 0 must be shown, so exception added + this.mediumFields = this.mediumFields.filter((item) => item.field !== 'jufoClassCode' ? checkEmpty(item) : true); this.linksFields = this.linksFields.filter((item) => checkEmpty(item)); this.otherFields = this.otherFields.filter((item) => checkEmpty(item)); this.open_accessFields = this.open_accessFields.filter((item) =>