Skip to content

Commit

Permalink
110889: Don't retrieve the accessStatus when item.showAccessStatuses …
Browse files Browse the repository at this point in the history
…is false
  • Loading branch information
alexandrevryghem committed Feb 18, 2024
1 parent 877c2d4 commit 9cea2c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/app/search-page/configuration-search-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { SearchConfigurationService } from '../core/shared/search/search-configu
import { RouteService } from '../core/services/route.service';
import { SearchService } from '../core/shared/search/search.service';
import { Router } from '@angular/router';
import { APP_CONFIG, AppConfig } from '../../config/app-config.interface';

/**
* This component renders a search page using a configuration as input.
Expand All @@ -32,7 +33,9 @@ export class ConfigurationSearchPageComponent extends SearchComponent {
protected windowService: HostWindowService,
@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
protected routeService: RouteService,
protected router: Router) {
super(service, sidebarService, windowService, searchConfigService, routeService, router);
protected router: Router,
@Inject(APP_CONFIG) protected appConfig: AppConfig,
) {
super(service, sidebarService, windowService, searchConfigService, routeService, router, appConfig);
}
}
10 changes: 7 additions & 3 deletions src/app/shared/search/search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ import { ViewMode } from '../../core/shared/view-mode.model';
import { SelectionConfig } from './search-results/search-results.component';
import { ListableObject } from '../object-collection/shared/listable-object.model';
import { CollectionElementLinkType } from '../object-collection/collection-element-link.type';
import { environment } from 'src/environments/environment';
import { SubmissionObject } from '../../core/submission/models/submission-object.model';
import { SearchFilterConfig } from './models/search-filter-config.model';
import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model';
import { ITEM_MODULE_PATH } from '../../item-page/item-page-routing-paths';
import { COLLECTION_MODULE_PATH } from '../../collection-page/collection-page-routing-paths';
import { COMMUNITY_MODULE_PATH } from '../../community-page/community-page-routing-paths';
import { AppConfig, APP_CONFIG } from '../../../config/app-config.interface';

@Component({
selector: 'ds-search',
Expand Down Expand Up @@ -283,7 +283,9 @@ export class SearchComponent implements OnDestroy, OnInit {
protected windowService: HostWindowService,
@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
protected routeService: RouteService,
protected router: Router) {
protected router: Router,
@Inject(APP_CONFIG) protected appConfig: AppConfig,
) {
this.isXsOrSm$ = this.windowService.isXsOrSm();
}

Expand Down Expand Up @@ -450,8 +452,10 @@ export class SearchComponent implements OnDestroy, OnInit {
let followLinks = [
followLink<Item>('thumbnail', { isOptional: true }),
followLink<SubmissionObject>('item', { isOptional: true }, followLink<Item>('thumbnail', { isOptional: true })) as any,
followLink<Item>('accessStatus', { isOptional: true, shouldEmbed: environment.item.showAccessStatuses }),
];
if (this.appConfig.item.showAccessStatuses) {
followLinks.push(followLink<Item>('accessStatus', { isOptional: true }));
}
if (this.configuration === 'supervision') {
followLinks.push(followLink<WorkspaceItem>('supervisionOrders', { isOptional: true }) as any);
}
Expand Down

0 comments on commit 9cea2c8

Please sign in to comment.