Compare commits

...

2 Commits

4 changed files with 8 additions and 5 deletions

View File

@ -51,7 +51,8 @@ const publicRoutes: Routes = [
path: '', path: '',
loadChildren: () => import('./listing/description-listing.module').then(m => m.DescriptionListingModule), loadChildren: () => import('./listing/description-listing.module').then(m => m.DescriptionListingModule),
data: { data: {
breadcrumb: true breadcrumb: true,
isPublic: true
}, },
}, },
]; ];

View File

@ -31,7 +31,7 @@ import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/
import { SortDirection } from '@common/modules/hybrid-listing/hybrid-listing.component'; import { SortDirection } from '@common/modules/hybrid-listing/hybrid-listing.component';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { debounceTime, takeUntil } from 'rxjs/operators'; import { debounceTime, map, takeUntil } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof'; import { nameof } from 'ts-simple-nameof';
import { StartNewDescriptionDialogComponent } from '../start-new-description-dialog/start-new-description-dialog.component'; import { StartNewDescriptionDialogComponent } from '../start-new-description-dialog/start-new-description-dialog.component';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service'; import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@ -108,7 +108,7 @@ export class DescriptionListingComponent extends BaseComponent implements OnInit
ngOnInit() { ngOnInit() {
this.analyticsService.trackPageView(AnalyticsService.DescriptionListing); this.analyticsService.trackPageView(AnalyticsService.DescriptionListing);
this.isPublic = this.router.url === '/explore-descriptions'; this.isPublic = this.route.snapshot.data['isPublic'] ?? false;
if (this.isPublic) { if (this.isPublic) {
//TODO: refactor //TODO: refactor
// this.formGroup.get('order').setValue(this.order.DATASETPUBLISHED); // this.formGroup.get('order').setValue(this.order.DATASETPUBLISHED);
@ -118,6 +118,7 @@ export class DescriptionListingComponent extends BaseComponent implements OnInit
if (!this.isPublic && !this.authService.currentAccountIsAuthenticated()) { if (!this.isPublic && !this.authService.currentAccountIsAuthenticated()) {
this.router.navigateByUrl("/explore"); this.router.navigateByUrl("/explore");
} }
this.route.params this.route.params
.pipe(takeUntil(this._destroyed)) .pipe(takeUntil(this._destroyed))
.subscribe(async (params: Params) => { .subscribe(async (params: Params) => {

View File

@ -64,7 +64,8 @@ const publicRoutes: Routes = [
path: '', path: '',
loadChildren: () => import('./listing/dmp-listing.module').then(m => m.DmpListingModule), loadChildren: () => import('./listing/dmp-listing.module').then(m => m.DmpListingModule),
data: { data: {
breadcrumb: true breadcrumb: true,
isPublic: true
}, },
}, },
]; ];

View File

@ -97,7 +97,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.analyticsService.trackPageView(AnalyticsService.DmpListing); this.analyticsService.trackPageView(AnalyticsService.DmpListing);
this.isPublic = this.router.url.startsWith('/explore-plans'); this.isPublic = this.route.snapshot.data['isPublic'] ?? false;
if (this.isPublic) { if (this.isPublic) {
//TODO refactor //TODO refactor
// this.formGroup.get('order').setValue(this.order.PUBLISHED); // this.formGroup.get('order').setValue(this.order.PUBLISHED);