Skip to content

Commit 2f85df8

Browse files
fix: Corrected option ID assignment
1 parent 4949f86 commit 2f85df8

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ export class ComcolPageBrowseByComponent implements OnDestroy, OnInit {
9696

9797
ngOnInit(): void {
9898
this.allOptions$ = this.calculateBrowseProperty().pipe(
99-
switchMap ( (browseProperty) => this.configurationService.findByPropertyName( browseProperty) ),
99+
switchMap((browseProperty) => this.configurationService.findByPropertyName(browseProperty)),
100100
getFinishedRemoteData(),
101-
switchMap( (remoteData) => this.searchForBaseBrowseCollectionPropertyIfDataNotFound(remoteData)),
101+
switchMap((remoteData) => this.searchForBaseBrowseCollectionPropertyIfDataNotFound(remoteData)),
102102
getFinishedRemoteData(),
103103
getRemoteDataPayload(),
104-
map ( (configProperty) => {
104+
map((configProperty) => {
105105
const comColRoute = (this.contentType === 'collection') ? getCollectionPageRoute(this.id) : getCommunityPageRoute(this.id);
106106
let options = this.initOptionsByContentType(comColRoute);
107107
if (configProperty) {
@@ -132,14 +132,14 @@ export class ComcolPageBrowseByComponent implements OnDestroy, OnInit {
132132
this.allOptions$,
133133
this.router.events.pipe(
134134
startWith(this.router),
135-
filter((next: Router|Scroll) => (isNotEmpty((next as Router)?.url) || (next as Scroll)?.type === EventType.Scroll)),
136-
map((next: Router|Scroll) => (next as Router)?.url || ((next as Scroll).routerEvent as NavigationEnd).urlAfterRedirects),
135+
filter((next: Router | Scroll) => (isNotEmpty((next as Router)?.url) || (next as Scroll)?.type === EventType.Scroll)),
136+
map((next: Router | Scroll) => (next as Router)?.url || ((next as Scroll).routerEvent as NavigationEnd).urlAfterRedirects),
137137
distinctUntilChanged(),
138138
),
139139
]).subscribe(([navOptions, url]: [ComColPageNavOption[], string]) => {
140140
for (const option of navOptions) {
141141
if (url?.split('?')[0] === comColRoute && option.id === this.appConfig[this.contentType].defaultBrowseTab) {
142-
void this.router.navigate([option.routerLink], { queryParams: option.params, replaceUrl: true });
142+
void this.router.navigate([option.routerLink], { queryParams: option.params, replaceUrl: true });
143143
break;
144144
} else if (option.routerLink === url?.split('?')[0]) {
145145
this.currentOptionId$.next(option.id);
@@ -154,7 +154,7 @@ export class ComcolPageBrowseByComponent implements OnDestroy, OnInit {
154154
).subscribe((allOptions: ComColPageNavOption[]) => {
155155
for (const option of allOptions) {
156156
if (option.id === this.appConfig[this.contentType].defaultBrowseTab) {
157-
this.currentOptionId$.next(option[0].id);
157+
this.currentOptionId$.next(option.id);
158158
void this.router.navigate([option.routerLink], { queryParams: option.params });
159159
break;
160160
}
@@ -181,8 +181,8 @@ export class ComcolPageBrowseByComponent implements OnDestroy, OnInit {
181181
if (this.contentType === 'collection') {
182182
return this.collectionService.findById(this.id).pipe(
183183
getFirstSucceededRemoteDataPayload(),
184-
map( (collection) => collection.firstMetadataValue('dspace.entity.type') ),
185-
map ( (entityType) => entityType ? 'browse.collection.' + entityType : 'browse.collection' ),
184+
map((collection) => collection.firstMetadataValue('dspace.entity.type')),
185+
map((entityType) => entityType ? 'browse.collection.' + entityType : 'browse.collection'),
186186
);
187187
}
188188
return of('browse.' + this.contentType);

0 commit comments

Comments
 (0)