Fixed Issue with BreadCrumb Service
This commit is contained in:
parent
ed46666a4f
commit
c5b6b218b5
|
@ -79,7 +79,10 @@ const appRoutes: Routes = [
|
|||
},
|
||||
{
|
||||
path: 'users',
|
||||
loadChildren: './users/users.module#UsersModule'
|
||||
loadChildren: './users/users.module#UsersModule',
|
||||
data: {
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'welcome',
|
||||
|
|
|
@ -12,6 +12,7 @@ import { DataSource } from '@angular/cdk/table';
|
|||
import { DatasetListingModel } from '../../models/datasets/DatasetListingModel';
|
||||
import { DataTableRequest } from '../../models/data-table/DataTableRequest';
|
||||
import { FacetSearchCriteriaModel } from '../../models/facet-search/FacetSearchCriteriaModel';
|
||||
import { IBreadCrumbComponent } from '../../shared/components/breadcrumb/definition/IBreadCrumbComponent';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -21,7 +22,6 @@ import { FacetSearchCriteriaModel } from '../../models/facet-search/FacetSearchC
|
|||
})
|
||||
export class DatasetPublicListingComponent implements OnInit {
|
||||
|
||||
|
||||
@ViewChild(MatPaginator) _paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
criteria: FacetSearchCriteriaModel;
|
||||
|
@ -44,6 +44,7 @@ export class DatasetPublicListingComponent implements OnInit {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.route.params.subscribe(async (params: Params) => {
|
||||
this.dmpId = params['dmpId'];
|
||||
this.refresh();
|
||||
|
|
|
@ -49,7 +49,9 @@ export const DatasetRoutes: Routes = [
|
|||
{
|
||||
path: 'public',
|
||||
component: DatasetPublicListingComponent,
|
||||
//canActivate: [AuthGuard],
|
||||
data: {
|
||||
breadcrumb: false
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'dmp/:dmpId',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="container-fluid">
|
||||
<h3>{{titlePrefix}} {{'DATASET-LISTING.TITLE' | translate}}</h3>
|
||||
<h3>{{titlePrefix}} {{'DMP-PROFILE-LISTING.TITLE' | translate}}</h3>
|
||||
|
||||
|
||||
<app-dmp-profile-criteria-component></app-dmp-profile-criteria-component>
|
||||
|
@ -11,19 +11,19 @@
|
|||
|
||||
<!-- Column Definition: Name -->
|
||||
<ng-container cdkColumnDef="label">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="label">{{'DATASET-LISTING.COLUMNS.NAME' | translate}}</mat-header-cell>
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="label">{{'DMP-PROFILE-LISTING.COLUMNS.NAME' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.label}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: status -->
|
||||
<ng-container cdkColumnDef="status">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="status">{{'DATASET-LISTING.COLUMNS.STATUS' | translate}}</mat-header-cell>
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="status">{{'DMP-PROFILE-LISTING.COLUMNS.STATUS' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.status}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Created -->
|
||||
<ng-container cdkColumnDef="created">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="created">{{'DATASET-LISTING.COLUMNS.CREATED' | translate}}</mat-header-cell>
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="created">{{'DMP-PROFILE-LISTING.COLUMNS.CREATED' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.created | date:'shortDate'}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
|
@ -41,4 +41,4 @@
|
|||
<button mat-fab class="mat-fab-bottom-right" color="primary" [routerLink]="['/dmp-profiles/new'] ">
|
||||
<mat-icon class="mat-24">add</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -29,7 +29,7 @@ export class BreadCrumbResolverService {
|
|||
}
|
||||
|
||||
public resolve(activatedRoute: ActivatedRoute): Observable<BreadcrumbItem[]> {
|
||||
this.breadCrumbs = Observable.of([]);
|
||||
this.breadCrumbs = null;
|
||||
const routeComponents = this.getComponentsFromRoute(activatedRoute, []);
|
||||
this.activeComponents.filter(x => routeComponents.indexOf(x.constructor.name) !== -1).forEach(x => {
|
||||
if (x.hasOwnProperty('breadCrumbs')) {
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
</a>
|
||||
</li>
|
||||
<mat-icon fxFlex="nogrow">chevron_right</mat-icon>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ol>
|
||||
|
|
|
@ -30,7 +30,8 @@ export class BreadcrumbComponent implements OnInit {
|
|||
}
|
||||
|
||||
buildBreadCrumb(route: ActivatedRoute): Observable<BreadcrumbItem[]> {
|
||||
return this.breadCrumbService.resolve(route).map(x => { x.unshift({ label: 'Dashboard', url: '/welcome' }); return x; });
|
||||
if (this.breadCrumbService.resolve(route)) { return this.breadCrumbService.resolve(route).map(x => { x.unshift({ label: 'Dashboard', url: '/welcome' }); return x; }); }
|
||||
return Observable.of([]);
|
||||
}
|
||||
|
||||
navigate(url, params) {
|
||||
|
|
|
@ -219,6 +219,14 @@
|
|||
"FINALISE": "Finalise"
|
||||
}
|
||||
},
|
||||
"DMP-PROFILE-LISTING": {
|
||||
"TITLE": "DMP Profiles",
|
||||
"COLUMNS": {
|
||||
"NAME": "Name",
|
||||
"STATUS": "Status",
|
||||
"CREATED": "Created"
|
||||
}
|
||||
},
|
||||
"DYNAMIC-FORM": {
|
||||
"FIELDS": {
|
||||
"LABEL": "Label"
|
||||
|
|
Loading…
Reference in New Issue