diff --git a/src/app/core/data/access-status-data.service.ts b/src/app/core/data/access-status-data.service.ts index 6d8acb1c8b4..d6361dd3516 100644 --- a/src/app/core/data/access-status-data.service.ts +++ b/src/app/core/data/access-status-data.service.ts @@ -5,13 +5,14 @@ import { AccessStatusObject } from 'src/app/shared/object-collection/shared/badg import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../cache/object-cache.service'; import { HALEndpointService } from '../shared/hal-endpoint.service'; +import { Bitstream } from '../shared/bitstream.model'; import { Item } from '../shared/item.model'; import { BaseDataService } from './base/base-data.service'; import { RemoteData } from './remote-data'; import { RequestService } from './request.service'; /** - * Data service responsible for retrieving the access status of Items + * Data service responsible for retrieving the access status of Items and Bitstreams */ @Injectable({ providedIn: 'root' }) export class AccessStatusDataService extends BaseDataService { @@ -32,4 +33,12 @@ export class AccessStatusDataService extends BaseDataService findAccessStatusFor(item: Item): Observable> { return this.findByHref(item._links.accessStatus.href); } + + /** + * Returns {@link RemoteData} of {@link AccessStatusObject} that is the access status of the given bitstream + * @param bitstream Bitstream we want the access status of + */ + findAccessStatusForBitstream(bitstream: Bitstream): Observable> { + return this.findByHref(bitstream._links.accessStatus.href); + } } diff --git a/src/app/core/shared/bitstream.model.ts b/src/app/core/shared/bitstream.model.ts index 73e5e04b364..506212b0f97 100644 --- a/src/app/core/shared/bitstream.model.ts +++ b/src/app/core/shared/bitstream.model.ts @@ -10,6 +10,8 @@ import { typedObject, } from '../cache/builders/build-decorators'; import { RemoteData } from '../data/remote-data'; +import { AccessStatusObject } from '../../shared/object-collection/shared/badges/access-status-badge/access-status.model'; +import { ACCESS_STATUS } from '../../shared/object-collection/shared/badges/access-status-badge/access-status.resource-type'; import { BITSTREAM } from './bitstream.resource-type'; import { BitstreamFormat } from './bitstream-format.model'; import { BITSTREAM_FORMAT } from './bitstream-format.resource-type'; @@ -52,6 +54,7 @@ export class Bitstream extends DSpaceObject implements ChildHALResource { format: HALLink; content: HALLink; thumbnail: HALLink; + accessStatus: HALLink; }; /** @@ -75,6 +78,13 @@ export class Bitstream extends DSpaceObject implements ChildHALResource { @link(BUNDLE) bundle?: Observable>; + /** + * The access status for this Bitstream + * Will be undefined unless the accessStatus {@link HALLink} has been resolved. + */ + @link(ACCESS_STATUS, false, 'accessStatus') + accessStatus?: Observable>; + getParentLinkKey(): keyof this['_links'] { return 'format'; } diff --git a/src/app/item-page/full/field-components/file-section/full-file-section.component.html b/src/app/item-page/full/field-components/file-section/full-file-section.component.html index 8c534e66309..918993cf8ba 100644 --- a/src/app/item-page/full/field-components/file-section/full-file-section.component.html +++ b/src/app/item-page/full/field-components/file-section/full-file-section.component.html @@ -33,7 +33,7 @@

{{"item.page.filesection.original.bund
- + {{"item.page.filesection.download" | translate}}
diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.html b/src/app/item-page/simple/field-components/file-section/file-section.component.html index 44c83b86267..4ce6cd83261 100644 --- a/src/app/item-page/simple/field-components/file-section/file-section.component.html +++ b/src/app/item-page/simple/field-components/file-section/file-section.component.html @@ -1,7 +1,7 @@
- + {{ 'item.page.bitstreams.primary' | translate }} {{ dsoNameService.getName(file) }} diff --git a/src/app/shared/file-download-link/file-download-link.component.html b/src/app/shared/file-download-link/file-download-link.component.html index 7a9ea99e008..1d85670e395 100644 --- a/src/app/shared/file-download-link/file-download-link.component.html +++ b/src/app/shared/file-download-link/file-download-link.component.html @@ -1,3 +1,6 @@ +@if (showAccessStatusBadge) { + +} - + diff --git a/src/app/shared/file-download-link/file-download-link.component.ts b/src/app/shared/file-download-link/file-download-link.component.ts index 3080a94bd3e..741de0e6062 100644 --- a/src/app/shared/file-download-link/file-download-link.component.ts +++ b/src/app/shared/file-download-link/file-download-link.component.ts @@ -31,13 +31,14 @@ import { hasValue, isNotEmpty, } from '../empty.util'; +import { ThemedAccessStatusBadgeComponent } from '../object-collection/shared/badges/access-status-badge/themed-access-status-badge.component'; @Component({ selector: 'ds-base-file-download-link', templateUrl: './file-download-link.component.html', styleUrls: ['./file-download-link.component.scss'], standalone: true, - imports: [RouterLink, NgClass, NgIf, NgTemplateOutlet, AsyncPipe, TranslateModule], + imports: [RouterLink, NgClass, NgIf, NgTemplateOutlet, AsyncPipe, TranslateModule, ThemedAccessStatusBadgeComponent], }) /** * Component displaying a download link @@ -65,6 +66,11 @@ export class FileDownloadLinkComponent implements OnInit { @Input() enableRequestACopy = true; + /** + * A boolean indicating whether the access status badge is displayed + */ + @Input() showAccessStatusBadge = true; + bitstreamPath$: Observable<{ routerLink: string, queryParams: any, diff --git a/src/app/shared/file-download-link/themed-file-download-link.component.ts b/src/app/shared/file-download-link/themed-file-download-link.component.ts index c0fc4597f5c..bcfbee0e150 100644 --- a/src/app/shared/file-download-link/themed-file-download-link.component.ts +++ b/src/app/shared/file-download-link/themed-file-download-link.component.ts @@ -27,7 +27,9 @@ export class ThemedFileDownloadLinkComponent extends ThemedComponent - - +@if (showAccessStatus) { + @if ((accessStatus$ | async); as status) { + {{ 'listelement.badge.access-status' | translate }} - {{ accessStatus | translate }} + {{ status | translate: { date: (embargoDate$ | async) } }} , - - + } +} diff --git a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.scss b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.scss index 8b137891791..f1848ce36f5 100644 --- a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.scss +++ b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.scss @@ -1 +1,35 @@ +span { + white-space: normal; +} + +:host { + ::ng-deep .access-status-list-element-badge { + margin-right: 0.35rem; + } + + // Embargo — DataShare blue with white text + ::ng-deep .access-status-embargo-listelement-badge, + ::ng-deep .embargo-listelement-badge { + background-color: #004f71 !important; + color: #fff !important; + } + + // Open access — DataShare success green + ::ng-deep .access-status-open-access-listelement-badge { + background-color: #5cb85c !important; + color: #fff !important; + } + + // Restricted — DataShare darker blue + ::ng-deep .access-status-restricted-listelement-badge { + background-color: #002b3e !important; + color: #fff !important; + } + + // Metadata only — DataShare muted + ::ng-deep .access-status-metadata-only-listelement-badge { + background-color: #495057 !important; + color: #fff !important; + } +} diff --git a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.spec.ts b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.spec.ts index 0c650293875..4b8a5d7b34d 100644 --- a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.spec.ts +++ b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.spec.ts @@ -8,7 +8,7 @@ import { By } from '@angular/platform-browser'; import { TranslateModule } from '@ngx-translate/core'; import { environment } from 'src/environments/environment'; -import { AccessStatusDataService } from '../../../../../core/data/access-status-data.service'; +import { LinkService } from '../../../../../core/cache/builders/link.service'; import { Item } from '../../../../../core/shared/item.model'; import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils'; import { TruncatePipe } from '../../../../utils/truncate.pipe'; @@ -25,7 +25,7 @@ describe('ItemAccessStatusBadgeComponent', () => { let embargoStatus: AccessStatusObject; let restrictedStatus: AccessStatusObject; - let accessStatusDataService: AccessStatusDataService; + let linkService: LinkService; let item: Item; @@ -50,13 +50,14 @@ describe('ItemAccessStatusBadgeComponent', () => { status: 'restricted', }); - accessStatusDataService = jasmine.createSpyObj('accessStatusDataService', { - findAccessStatusFor: createSuccessfulRemoteDataObject$(unknownStatus), + linkService = jasmine.createSpyObj('linkService', { + resolveLink: {}, }); item = Object.assign(new Item(), { uuid: 'item-uuid', type: 'item', + accessStatus: createSuccessfulRemoteDataObject$(unknownStatus), }); } @@ -65,7 +66,7 @@ describe('ItemAccessStatusBadgeComponent', () => { imports: [TranslateModule.forRoot(), AccessStatusBadgeComponent, TruncatePipe], schemas: [NO_ERRORS_SCHEMA], providers: [ - { provide: AccessStatusDataService, useValue: accessStatusDataService }, + { provide: LinkService, useValue: linkService }, ], }).compileComponents(); } @@ -113,7 +114,7 @@ describe('ItemAccessStatusBadgeComponent', () => { describe('When the findAccessStatusFor method returns metadata.only', () => { beforeEach(waitForAsync(() => { init(); - (accessStatusDataService.findAccessStatusFor as jasmine.Spy).and.returnValue(createSuccessfulRemoteDataObject$(metadataOnlyStatus)); + item.accessStatus = createSuccessfulRemoteDataObject$(metadataOnlyStatus); initTestBed(); })); beforeEach(() => { @@ -127,7 +128,7 @@ describe('ItemAccessStatusBadgeComponent', () => { describe('When the findAccessStatusFor method returns open.access', () => { beforeEach(waitForAsync(() => { init(); - (accessStatusDataService.findAccessStatusFor as jasmine.Spy).and.returnValue(createSuccessfulRemoteDataObject$(openAccessStatus)); + item.accessStatus = createSuccessfulRemoteDataObject$(openAccessStatus); initTestBed(); })); beforeEach(() => { @@ -141,7 +142,7 @@ describe('ItemAccessStatusBadgeComponent', () => { describe('When the findAccessStatusFor method returns embargo', () => { beforeEach(waitForAsync(() => { init(); - (accessStatusDataService.findAccessStatusFor as jasmine.Spy).and.returnValue(createSuccessfulRemoteDataObject$(embargoStatus)); + item.accessStatus = createSuccessfulRemoteDataObject$(embargoStatus); initTestBed(); })); beforeEach(() => { @@ -155,7 +156,7 @@ describe('ItemAccessStatusBadgeComponent', () => { describe('When the findAccessStatusFor method returns restricted', () => { beforeEach(waitForAsync(() => { init(); - (accessStatusDataService.findAccessStatusFor as jasmine.Spy).and.returnValue(createSuccessfulRemoteDataObject$(restrictedStatus)); + item.accessStatus = createSuccessfulRemoteDataObject$(restrictedStatus); initTestBed(); })); beforeEach(() => { diff --git a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts index 0b86b782f6f..7ca5800a803 100644 --- a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts @@ -1,7 +1,4 @@ -import { - AsyncPipe, - NgIf, -} from '@angular/common'; +import { AsyncPipe } from '@angular/common'; import { Component, Input, @@ -18,12 +15,13 @@ import { catchError, map, } from 'rxjs/operators'; -import { AccessStatusDataService } from 'src/app/core/data/access-status-data.service'; import { environment } from 'src/environments/environment'; -import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; +import { LinkService } from '../../../../../core/cache/builders/link.service'; +import { Bitstream } from '../../../../../core/shared/bitstream.model'; import { Item } from '../../../../../core/shared/item.model'; -import { ITEM } from '../../../../../core/shared/item.resource-type'; +import { getFirstSucceededRemoteDataPayload } from '../../../../../core/shared/operators'; +import { followLink } from '../../../../utils/follow-link-config.model'; import { hasValue } from '../../../../empty.util'; import { AccessStatusObject } from './access-status.model'; @@ -32,15 +30,17 @@ import { AccessStatusObject } from './access-status.model'; templateUrl: './access-status-badge.component.html', styleUrls: ['./access-status-badge.component.scss'], standalone: true, - imports: [NgIf, AsyncPipe, TranslateModule], + imports: [AsyncPipe, TranslateModule], }) /** - * Component rendering the access status of an item as a badge + * Component rendering the access status of an item or bitstream as a badge */ export class AccessStatusBadgeComponent implements OnDestroy, OnInit { - @Input() object: DSpaceObject; + @Input() object: Item | Bitstream; + accessStatus$: Observable; + embargoDate$: Observable; /** * Whether to show the access status badge or not @@ -57,33 +57,38 @@ export class AccessStatusBadgeComponent implements OnDestroy, OnInit { */ subs: Subscription[] = []; - /** - * Initialize instance variables - * - * @param {AccessStatusDataService} accessStatusDataService - */ - constructor(private accessStatusDataService: AccessStatusDataService) { } + constructor( + private linkService: LinkService, + ) { } ngOnInit(): void { - this.showAccessStatus = environment.item.showAccessStatuses; - if (this.object.type.toString() !== ITEM.value || !this.showAccessStatus || this.object == null) { - // Do not show the badge if the feature is inactive or if the item is null. + if (!hasValue(this.object)) { return; } - - const item = this.object as Item; - if (item.accessStatus == null) { + if (!hasValue(this.object.accessStatus)) { // In case the access status has not been loaded, do it individually. - item.accessStatus = this.accessStatusDataService.findAccessStatusFor(item); + this.linkService.resolveLink(this.object, followLink('accessStatus')); } - this.accessStatus$ = item.accessStatus.pipe( - map((accessStatusRD) => { - if (accessStatusRD.statusCode !== 401 && hasValue(accessStatusRD.payload)) { - return accessStatusRD.payload; - } else { - return []; - } - }), + switch ((this.object as any).type) { + case Item.type.value: + this.handleItem(); + break; + case Bitstream.type.value: + this.handleBitstream(); + break; + } + } + + /** + * Method to handle the object type Item + */ + private handleItem() { + this.showAccessStatus = environment.item.showAccessStatuses; + if (!this.showAccessStatus) { + return; + } + this.accessStatus$ = this.object.accessStatus.pipe( + getFirstSucceededRemoteDataPayload(), map((accessStatus: AccessStatusObject) => hasValue(accessStatus.status) ? accessStatus.status : 'unknown'), map((status: string) => `access-status.${status.toLowerCase()}.listelement.badge`), catchError(() => observableOf('access-status.unknown.listelement.badge')), @@ -99,6 +104,29 @@ export class AccessStatusBadgeComponent implements OnDestroy, OnInit { ); } + /** + * Method to handle the object type Bitstream + */ + private handleBitstream() { + this.showAccessStatus = environment.item.bitstream.showAccessStatuses; + if (!this.showAccessStatus) { + return; + } + this.embargoDate$ = this.object.accessStatus.pipe( + getFirstSucceededRemoteDataPayload(), + map((accessStatus: AccessStatusObject) => hasValue(accessStatus.embargoDate) ? accessStatus.embargoDate : null), + catchError(() => observableOf(null)), + ); + this.accessStatus$ = this.embargoDate$.pipe( + map(date => hasValue(date) ? 'embargo.listelement.badge' : null), + ); + this.subs.push( + this.embargoDate$.subscribe(date => { + this.accessStatusClass = hasValue(date) ? 'embargo-listelement-badge' : ''; + }), + ); + } + ngOnDestroy(): void { this.subs.filter((sub) => hasValue(sub)).forEach((sub) => sub.unsubscribe()); } diff --git a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model.ts b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model.ts index f1b8001b210..ebb6bf6879a 100644 --- a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model.ts +++ b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model.ts @@ -27,6 +27,12 @@ export class AccessStatusObject implements CacheableObject { @autoserialize status: string; + /** + * The embargo end date (if status is 'embargo') + */ + @autoserialize + embargoDate: string; + /** * The {@link HALLink}s for this AccessStatusObject */ diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 960982f1c35..5cb8ffe5c68 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -38,6 +38,8 @@ "access-status.embargo.listelement.badge": "Embargo", + "embargo.listelement.badge": "Embargo until {{ date }}", + "access-status.metadata.only.listelement.badge": "Metadata only", "access-status.open.access.listelement.badge": "Open Access", diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts index 6e4ec45be06..fb4f5a427a1 100644 --- a/src/config/default-app-config.ts +++ b/src/config/default-app-config.ts @@ -330,6 +330,8 @@ export class DefaultAppConfig implements AppConfig { // Rounded to the nearest size in the list of selectable sizes on the // settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'. pageSize: 5, + // Show the access status badge on bitstreams + showAccessStatuses: true, }, }; diff --git a/src/config/item-config.interface.ts b/src/config/item-config.interface.ts index 35cb5260aea..189091971a3 100644 --- a/src/config/item-config.interface.ts +++ b/src/config/item-config.interface.ts @@ -12,5 +12,7 @@ export interface ItemConfig extends Config { // Rounded to the nearest size in the list of selectable sizes on the // settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'. pageSize: number; + // Show the access status badge on bitstreams + showAccessStatuses: boolean; } } diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index a067e67f377..89be0daf6ae 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -287,6 +287,7 @@ export const environment: BuildConfig = { // Rounded to the nearest size in the list of selectable sizes on the // settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'. pageSize: 5, + showAccessStatuses: true, }, }, community: { diff --git a/src/themes/custom/app/shared/file-download-link/file-download-link.component.ts b/src/themes/custom/app/shared/file-download-link/file-download-link.component.ts index 491d20e79c4..8bf76056d5e 100644 --- a/src/themes/custom/app/shared/file-download-link/file-download-link.component.ts +++ b/src/themes/custom/app/shared/file-download-link/file-download-link.component.ts @@ -8,6 +8,7 @@ import { Component } from '@angular/core'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { ThemedAccessStatusBadgeComponent } from '../../../../../app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component'; import { FileDownloadLinkComponent as BaseComponent } from '../../../../../app/shared/file-download-link/file-download-link.component'; @Component({ @@ -17,7 +18,7 @@ import { FileDownloadLinkComponent as BaseComponent } from '../../../../../app/s // styleUrls: ['./file-download-link.component.scss'], styleUrls: ['../../../../../app/shared/file-download-link/file-download-link.component.scss'], standalone: true, - imports: [RouterLink, NgClass, NgIf, NgTemplateOutlet, AsyncPipe, TranslateModule], + imports: [RouterLink, NgClass, NgIf, NgTemplateOutlet, AsyncPipe, TranslateModule, ThemedAccessStatusBadgeComponent], }) export class FileDownloadLinkComponent extends BaseComponent { } diff --git a/src/themes/datashare/app/item-page/simple/field-components/file-section/file-section.component.html b/src/themes/datashare/app/item-page/simple/field-components/file-section/file-section.component.html index cd68bdbbffe..efe3340df62 100644 --- a/src/themes/datashare/app/item-page/simple/field-components/file-section/file-section.component.html +++ b/src/themes/datashare/app/item-page/simple/field-components/file-section/file-section.component.html @@ -11,12 +11,12 @@

- + {{ 'item.page.bitstreams.primary' | translate }} diff --git a/src/themes/datashare/app/item-page/simple/field-components/file-section/file-section.component.ts b/src/themes/datashare/app/item-page/simple/field-components/file-section/file-section.component.ts index 39186aaccfe..895dfc9107c 100644 --- a/src/themes/datashare/app/item-page/simple/field-components/file-section/file-section.component.ts +++ b/src/themes/datashare/app/item-page/simple/field-components/file-section/file-section.component.ts @@ -34,6 +34,18 @@ import { import { ThemedFileDownloadLinkComponent } from '../../../../../../../app/shared/file-download-link/themed-file-download-link.component'; import { ThemedLoadingComponent } from '../../../../../../../app/shared/loading/themed-loading.component'; import { MetadataFieldWrapperComponent } from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { FileSizePipe } from '../../../../../../../app/shared/utils/file-size-pipe'; +import { VarDirective } from '../../../../../../../app/shared/utils/var.directive'; +import { getFirstCompletedRemoteData } from '../../../../../../../app/core/shared/operators'; +import { filter, map, Observable, switchMap, tap } from 'rxjs'; +import { RemoteData } from '../../../../../../../app/core/data/remote-data'; +import { PaginatedList } from '../../../../../../../app/core/data/paginated-list.model'; +import { Bitstream } from '../../../../../../../app/core/shared/bitstream.model'; +import { hasValue, isEmpty } from '../../../../../../../app/shared/empty.util'; +import { PaginationComponentOptions } from '../../../../../../../app/shared/pagination/pagination-component-options.model'; +import { followLink } from '../../../../../../../app/shared/utils/follow-link-config.model'; +import { BitstreamDataService } from '../../../../../../../app/core/data/bitstream-data.service'; +import { AccessStatusDataService } from '../../../../../../../app/core/data/access-status-data.service'; import { NotificationsService } from '../../../../../../../app/shared/notifications/notifications.service'; import { PaginationComponent } from '../../../../../../../app/shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../../../../../../../app/shared/pagination/pagination-component-options.model'; @@ -70,6 +82,7 @@ export class FileSectionComponent extends BaseComponent implements OnInit { licenses$: Observable>>; downloadLink$: Observable; downloadLinkAvailable$: Observable; + hasEmbargo$: Observable; cclicenseOptions = Object.assign(new PaginationComponentOptions(), { id: 'cclbo', @@ -92,6 +105,7 @@ export class FileSectionComponent extends BaseComponent implements OnInit { public dsoNameService: DSONameService, @Inject(APP_CONFIG) protected appConfig: AppConfig, protected downloadLinkService: DownloadLinkService, + protected accessStatusDataService: AccessStatusDataService, ) { super(bitstreamDataService, notificationsService, translateService, dsoNameService, appConfig); @@ -140,6 +154,11 @@ export class FileSectionComponent extends BaseComponent implements OnInit { map(link => link), ); + this.hasEmbargo$ = this.accessStatusDataService.findAccessStatusFor(this.item).pipe( + getFirstCompletedRemoteData(), + map(rd => rd?.hasSucceeded && rd.payload?.status === 'embargo'), + ); + } hasValuesInBundle(bundle: PaginatedList) { diff --git a/src/themes/datashare/app/shared/file-download-link/file-download-link.component.ts b/src/themes/datashare/app/shared/file-download-link/file-download-link.component.ts index 491d20e79c4..8bf76056d5e 100644 --- a/src/themes/datashare/app/shared/file-download-link/file-download-link.component.ts +++ b/src/themes/datashare/app/shared/file-download-link/file-download-link.component.ts @@ -8,6 +8,7 @@ import { Component } from '@angular/core'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { ThemedAccessStatusBadgeComponent } from '../../../../../app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component'; import { FileDownloadLinkComponent as BaseComponent } from '../../../../../app/shared/file-download-link/file-download-link.component'; @Component({ @@ -17,7 +18,7 @@ import { FileDownloadLinkComponent as BaseComponent } from '../../../../../app/s // styleUrls: ['./file-download-link.component.scss'], styleUrls: ['../../../../../app/shared/file-download-link/file-download-link.component.scss'], standalone: true, - imports: [RouterLink, NgClass, NgIf, NgTemplateOutlet, AsyncPipe, TranslateModule], + imports: [RouterLink, NgClass, NgIf, NgTemplateOutlet, AsyncPipe, TranslateModule, ThemedAccessStatusBadgeComponent], }) export class FileDownloadLinkComponent extends BaseComponent { } diff --git a/src/themes/datashare/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.scss b/src/themes/datashare/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.scss index e69de29bb2d..e56c11c307c 100644 --- a/src/themes/datashare/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.scss +++ b/src/themes/datashare/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.scss @@ -0,0 +1 @@ +@import '../../../../../../../../app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.scss'; diff --git a/src/themes/datashare/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts b/src/themes/datashare/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts index 24e0006b884..602d9dd3edf 100644 --- a/src/themes/datashare/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts +++ b/src/themes/datashare/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts @@ -8,7 +8,7 @@ import { AccessStatusBadgeComponent as BaseComponent } from 'src/app/shared/obje @Component({ selector: 'ds-themed-access-status-badge', - // styleUrls: ['./access-status-badge.component.scss'], + styleUrls: ['./access-status-badge.component.scss'], // templateUrl: './access-status-badge.component.html', templateUrl: '../../../../../../../../app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.html', standalone: true,