Skip to content

Commit a695784

Browse files
108588: Removed the community & collection parts from the browse sections
1 parent 12478cf commit a695784

9 files changed

Lines changed: 18 additions & 97 deletions

File tree

src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent imp
4040
*/
4141
defaultMetadataKeys = ['dc.date.issued'];
4242

43-
public constructor(protected route: ActivatedRoute,
44-
protected browseService: BrowseService,
45-
protected dsoService: DSpaceObjectDataService,
46-
protected router: Router,
47-
protected paginationService: PaginationService,
48-
protected cdRef: ChangeDetectorRef,
49-
@Inject(APP_CONFIG) public appConfig: AppConfig,
50-
public dsoNameService: DSONameService,
43+
public constructor(
44+
protected route: ActivatedRoute,
45+
protected browseService: BrowseService,
46+
protected dsoService: DSpaceObjectDataService,
47+
protected paginationService: PaginationService,
48+
protected router: Router,
49+
@Inject(APP_CONFIG) public appConfig: AppConfig,
50+
public dsoNameService: DSONameService,
51+
protected cdRef: ChangeDetectorRef,
5152
) {
5253
super(route, browseService, dsoService, paginationService, router, appConfig, dsoNameService);
5354
}
@@ -71,8 +72,6 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent imp
7172
this.startsWith = +params.startsWith || params.startsWith;
7273
const searchOptions = browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.fetchThumbnails);
7374
this.updatePageWithItems(searchOptions, this.value, undefined);
74-
this.updateParent(params.scope);
75-
this.updateLogo();
7675
this.updateStartsWithOptions(this.browseId, metadataKeys, params.scope);
7776
}));
7877
}

src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
<ds-browse-by *ngIf="startsWithOptions" class="col-xs-12 w-100"
55
title="{{'browse.title' | translate:
66
{
7-
collection: dsoNameService.getName((parent$ | async)?.payload),
87
field: 'browse.metadata.' + browseId | translate,
98
startsWith: (startsWith)? ('browse.startsWith' | translate: { startsWith: '&quot;' + startsWith + '&quot;' }) : '',
109
value: (value)? '&quot;' + value + '&quot;': ''
1110
} }}"
12-
parentname="{{dsoNameService.getName((parent$ | async)?.payload)}}"
1311
[objects$]="(items$ !== undefined)? items$ : browseEntries$"
1412
[paginationConfig]="(currentPagination$ |async)"
1513
[sortConfig]="(currentSort$ |async)"

src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ describe('BrowseByMetadataPageComponent', () => {
144144

145145
route.params = observableOf(paramsWithValue);
146146
comp.ngOnInit();
147-
comp.updateParent('fake-scope');
148-
comp.updateLogo();
149147
fixture.detectChanges();
150148
});
151149

@@ -154,10 +152,6 @@ describe('BrowseByMetadataPageComponent', () => {
154152
expect(result.payload.page).toEqual(mockItems);
155153
});
156154
});
157-
158-
it('should fetch the logo', () => {
159-
expect(comp.logo$).toBeTruthy();
160-
});
161155
});
162156

163157
describe('when calling browseParamsToOptions', () => {

src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@ import { Item } from '../../core/shared/item.model';
1212
import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model';
1313
import { getFirstSucceededRemoteData } from '../../core/shared/operators';
1414
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
15-
import { DSpaceObject } from '../../core/shared/dspace-object.model';
1615
import { StartsWithType } from '../../shared/starts-with/starts-with-decorator';
1716
import { PaginationService } from '../../core/pagination/pagination.service';
18-
import { filter, map, mergeMap } from 'rxjs/operators';
19-
import { followLink, FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
20-
import { Bitstream } from '../../core/shared/bitstream.model';
21-
import { Collection } from '../../core/shared/collection.model';
22-
import { Community } from '../../core/shared/community.model';
17+
import { map } from 'rxjs/operators';
2318
import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface';
2419
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
2520
import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator';
@@ -62,16 +57,6 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy {
6257
*/
6358
items$: Observable<RemoteData<PaginatedList<Item>>>;
6459

65-
/**
66-
* The current Community or Collection we're browsing metadata/items in
67-
*/
68-
parent$: Observable<RemoteData<DSpaceObject>>;
69-
70-
/**
71-
* The logo of the current Community or Collection
72-
*/
73-
logo$: Observable<RemoteData<Bitstream>>;
74-
7560
/**
7661
* The pagination config used to display the values
7762
*/
@@ -184,8 +169,6 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy {
184169
} else {
185170
this.updatePage(browseParamsToOptions(params, currentPage, currentSort, this.browseId, false));
186171
}
187-
this.updateParent(params.scope);
188-
this.updateLogo();
189172
}));
190173
this.updateStartsWithTextOptions();
191174

@@ -225,37 +208,6 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy {
225208
this.items$ = this.browseService.getBrowseItemsFor(value, authority, searchOptions);
226209
}
227210

228-
/**
229-
* Update the parent Community or Collection using their scope
230-
* @param scope The UUID of the Community or Collection to fetch
231-
*/
232-
updateParent(scope: string) {
233-
if (hasValue(scope)) {
234-
const linksToFollow = () => {
235-
return [followLink('logo')];
236-
};
237-
this.parent$ = this.dsoService.findById(scope,
238-
true,
239-
true,
240-
...linksToFollow() as FollowLinkConfig<DSpaceObject>[]).pipe(
241-
getFirstSucceededRemoteData()
242-
);
243-
}
244-
}
245-
246-
/**
247-
* Update the parent Community or Collection logo
248-
*/
249-
updateLogo() {
250-
if (hasValue(this.parent$)) {
251-
this.logo$ = this.parent$.pipe(
252-
map((rd: RemoteData<Collection | Community>) => rd.payload),
253-
filter((collectionOrCommunity: Collection | Community) => hasValue(collectionOrCommunity.logo)),
254-
mergeMap((collectionOrCommunity: Collection | Community) => collectionOrCommunity.logo)
255-
);
256-
}
257-
}
258-
259211
/**
260212
* Navigate to the previous page
261213
*/

src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
import { combineLatest as observableCombineLatest } from 'rxjs';
2-
import { Component, Inject, OnInit } from '@angular/core';
3-
import { ActivatedRoute, Params, Router } from '@angular/router';
2+
import { Component, OnInit } from '@angular/core';
3+
import { Params } from '@angular/router';
44
import {
55
BrowseByMetadataPageComponent,
66
browseParamsToOptions, getBrowseSearchOptions
77
} from '../browse-by-metadata-page/browse-by-metadata-page.component';
8-
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
9-
import { BrowseService } from '../../core/browse/browse.service';
108
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
11-
import { PaginationService } from '../../core/pagination/pagination.service';
129
import { map } from 'rxjs/operators';
1310
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
14-
import { AppConfig, APP_CONFIG } from '../../../config/app-config.interface';
15-
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
1611
import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator';
1712
import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type';
1813

@@ -27,17 +22,6 @@ import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type';
2722
@rendersBrowseBy(BrowseByDataType.Title)
2823
export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent implements OnInit {
2924

30-
public constructor(protected route: ActivatedRoute,
31-
protected browseService: BrowseService,
32-
protected dsoService: DSpaceObjectDataService,
33-
protected paginationService: PaginationService,
34-
protected router: Router,
35-
@Inject(APP_CONFIG) public appConfig: AppConfig,
36-
public dsoNameService: DSONameService,
37-
) {
38-
super(route, browseService, dsoService, paginationService, router, appConfig, dsoNameService);
39-
}
40-
4125
ngOnInit(): void {
4226
const sortConfig = new SortOptions('dc.title', SortDirection.ASC);
4327
// include the thumbnail configuration in browse search options
@@ -47,14 +31,12 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent im
4731
this.subs.push(
4832
observableCombineLatest([this.route.params, this.route.queryParams, this.currentPagination$, this.currentSort$]).pipe(
4933
map(([routeParams, queryParams, currentPage, currentSort]) => {
50-
return [Object.assign({}, routeParams, queryParams),currentPage,currentSort];
34+
return [Object.assign({}, routeParams, queryParams), currentPage, currentSort];
5135
})
5236
).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => {
5337
this.startsWith = +params.startsWith || params.startsWith;
5438
this.browseId = params.id || this.defaultBrowseId;
5539
this.updatePageWithItems(browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.fetchThumbnails), undefined, undefined);
56-
this.updateParent(params.scope);
57-
this.updateLogo();
5840
}));
5941
this.updateStartsWithTextOptions();
6042
}

src/app/browse-by/browse-by.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { BrowseByMetadataPageComponent } from './browse-by-metadata-page/browse-
55
import { BrowseByDatePageComponent } from './browse-by-date-page/browse-by-date-page.component';
66
import { BrowseBySwitcherComponent } from './browse-by-switcher/browse-by-switcher.component';
77
import { BrowseByTaxonomyPageComponent } from './browse-by-taxonomy-page/browse-by-taxonomy-page.component';
8-
import { ComcolModule } from '../shared/comcol/comcol.module';
98
import { SharedBrowseByModule } from '../shared/browse-by/shared-browse-by.module';
109
import { DsoPageModule } from '../shared/dso-page/dso-page.module';
1110
import { FormModule } from '../shared/form/form.module';
@@ -26,7 +25,6 @@ const ENTRY_COMPONENTS = [
2625
imports: [
2726
SharedBrowseByModule,
2827
CommonModule,
29-
ComcolModule,
3028
DsoPageModule,
3129
FormModule,
3230
],

src/app/shared/browse-by/browse-by.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<ng-container *ngVar="(objects$ | async) as objects">
2-
<h3 [ngClass]="{'sr-only': parentname }">{{title | translate}}</h3>
2+
<h3>{{title | translate}}</h3>
33
<ng-container *ngComponentOutlet="getStartsWithComponent(); injector: objectInjector;"></ng-container>
44
<div *ngIf="objects?.hasSucceeded && !objects?.isLoading && objects?.payload?.page.length > 0" @fadeIn>
55
<div *ngIf="shouldDisplayResetButton$ |async" class="mb-2 reset">

src/app/shared/browse-by/browse-by.component.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ export class BrowseByComponent implements OnInit, OnDestroy {
3838
*/
3939
@Input() title: string;
4040

41-
/**
42-
* The parent name
43-
*/
44-
@Input() parentname: string;
4541
/**
4642
* The list of objects to display
4743
*/

src/assets/i18n/en.json5

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,8 @@
796796

797797
"browse.metadata.title": "Title",
798798

799+
"browse.metadata.srsc": "Subject Category",
800+
799801
"browse.metadata.author.breadcrumbs": "Browse by Author",
800802

801803
"browse.metadata.dateissued.breadcrumbs": "Browse by Date",
@@ -862,9 +864,9 @@
862864

863865
"browse.taxonomy.button": "Browse",
864866

865-
"browse.title": "Browsing {{ collection }} by {{ field }}{{ startsWith }} {{ value }}",
867+
"browse.title": "Browsing by {{ field }}{{ startsWith }} {{ value }}",
866868

867-
"browse.title.page": "Browsing {{ collection }} by {{ field }} {{ value }}",
869+
"browse.title.page": "Browsing by {{ field }} {{ value }}",
868870

869871
"search.browse.item-back": "Back to Results",
870872

0 commit comments

Comments
 (0)