no message
This commit is contained in:
parent
92ddb33eb8
commit
8eb3632fd2
|
@ -12,8 +12,7 @@ const appRoutes: Routes = [
|
|||
path: 'datasets',
|
||||
loadChildren: './datasets/dataset.module#DatasetModule',
|
||||
data: {
|
||||
// Interpolates values resolved by the router
|
||||
breadcrumbs: 'Folder'
|
||||
breadcrumb: true
|
||||
},
|
||||
canActivate: [AuthGuard]
|
||||
},
|
||||
|
@ -21,8 +20,7 @@ const appRoutes: Routes = [
|
|||
path: 'about',
|
||||
loadChildren: './about/about.module#AboutModule',
|
||||
data: {
|
||||
// Interpolates values resolved by the router
|
||||
breadcrumbs: 'About'
|
||||
breadcrumb: true
|
||||
},
|
||||
canActivate: [AuthGuard]
|
||||
},
|
||||
|
@ -30,8 +28,7 @@ const appRoutes: Routes = [
|
|||
path: 'projects',
|
||||
loadChildren: './projects/projects.module#ProjectsModule',
|
||||
data: {
|
||||
// Interpolates values resolved by the router
|
||||
breadcrumbs: 'Projects'
|
||||
breadcrumb: true
|
||||
},
|
||||
canActivate: [AuthGuard]
|
||||
},
|
||||
|
@ -39,8 +36,7 @@ const appRoutes: Routes = [
|
|||
path: "dmps",
|
||||
loadChildren: './dmps/dmps.module#DataManagementPlanModule',
|
||||
data: {
|
||||
// Interpolates values resolved by the router
|
||||
breadcrumbs: 'DMPs'
|
||||
breadcrumb: true
|
||||
},
|
||||
canActivate: [AuthGuard]
|
||||
},
|
||||
|
@ -48,8 +44,7 @@ const appRoutes: Routes = [
|
|||
path: "dmp-profiles",
|
||||
loadChildren: './dmp-profiles/dmp-profile.module#DataManagamentPlanProfileModule',
|
||||
data: {
|
||||
// Interpolates values resolved by the router
|
||||
breadcrumbs: 'DMP Profiles'
|
||||
breadcrumb: true
|
||||
},
|
||||
canActivate: [AuthGuard]
|
||||
},
|
||||
|
@ -57,8 +52,7 @@ const appRoutes: Routes = [
|
|||
path: 'form',
|
||||
loadChildren: './dataset-profile-form/dataset-profile.module#DatasetProfileModule',
|
||||
data: {
|
||||
// Interpolates values resolved by the router
|
||||
breadcrumbs: 'Dataset Profile'
|
||||
breadcrumb: true
|
||||
},
|
||||
canActivate: [AuthGuard]
|
||||
},
|
||||
|
@ -66,8 +60,7 @@ const appRoutes: Routes = [
|
|||
path: 'home',
|
||||
component: HomepageComponent,
|
||||
data: {
|
||||
// Interpolates values resolved by the router
|
||||
breadcrumbs: 'Home'
|
||||
breadcrumb: false
|
||||
},
|
||||
canActivate: [AuthGuard]
|
||||
},
|
||||
|
@ -75,8 +68,7 @@ const appRoutes: Routes = [
|
|||
path: '',
|
||||
redirectTo: '/welcome',
|
||||
data: {
|
||||
// Interpolates values resolved by the router
|
||||
breadcrumbs: 'Home'
|
||||
breadcrumbs: true
|
||||
},
|
||||
pathMatch: 'full'
|
||||
},
|
||||
|
@ -84,7 +76,7 @@ const appRoutes: Routes = [
|
|||
path: "unauthorized",
|
||||
loadChildren: './unauthorized/unauthorized.module#UnauthorizedModule',
|
||||
data: {
|
||||
// Interpolates values resolved by the router
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -95,23 +87,20 @@ const appRoutes: Routes = [
|
|||
path: "datasetsProfiles",
|
||||
loadChildren: './datasets-admin-listing/dataset-admin.module#DatasetAdminModule',
|
||||
data: {
|
||||
// Interpolates values resolved by the router
|
||||
breadcrumbs: 'Datasets Profiles'
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "welcome",
|
||||
component: WelcomepageComponent,
|
||||
data: {
|
||||
// Interpolates values resolved by the router
|
||||
breadcrumbs: 'Home'
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "api/oauth/authorized/b2access",
|
||||
component: B2AccessLoginComponent,
|
||||
data: {
|
||||
// Interpolates values resolved by the router
|
||||
},
|
||||
}
|
||||
];
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<help-content position="left"></help-content>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<app-breadcrumb></app-breadcrumb>
|
||||
<app-breadcrumb *ngIf="hasBreadCrumb | async"></app-breadcrumb>
|
||||
<router-outlet (activate)='onActivate($event)' (deactivate)='onDeactivate($event)'></router-outlet>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, ActivatedRoute, NavigationExtras } from '@angular/router';
|
||||
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, ActivatedRoute, NavigationExtras, NavigationEnd } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { LanguageResolverService } from './services/language-resolver/language-resolver.service';
|
||||
import { BreadCrumbResolverService } from './services/breadcrumb/breadcrumb-resolver.service';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare const gapi: any;
|
||||
|
@ -17,6 +18,7 @@ declare var $: any;
|
|||
})
|
||||
export class AppComponent implements OnInit {
|
||||
|
||||
hasBreadCrumb = Observable.of(false);
|
||||
constructor(
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
|
@ -40,6 +42,12 @@ export class AppComponent implements OnInit {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.hasBreadCrumb = this.router.events
|
||||
.filter(event => event instanceof NavigationEnd)
|
||||
.map(() => this.route)
|
||||
.map(route => route.firstChild)
|
||||
.switchMap(route => route.data)
|
||||
.map(data => data['breadcrumb'])
|
||||
}
|
||||
|
||||
login() {
|
||||
|
|
|
@ -30,6 +30,9 @@ import { ServiceModel } from '../../models/services/ServiceModel';
|
|||
import { DataRepositoryModel } from '../../models/dataRepositories/DataRepositoryModel';
|
||||
import { ExternalSourcesConfigurationService } from '../../services/external-sources/external-sources-configuration.service';
|
||||
import { ExternalSourcesConfiguration } from '../../models/external-sources/ExternalSourcesConfiguration';
|
||||
import { IBreadCrumbComponent } from '../../shared/components/breadcrumb/definition/IBreadCrumbComponent';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { BreadcrumbItem } from '../../shared/components/breadcrumb/definition/breadcrumb-item';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dataset-wizard-component',
|
||||
|
@ -37,7 +40,8 @@ import { ExternalSourcesConfiguration } from '../../models/external-sources/Exte
|
|||
styleUrls: ['./dataset-wizard.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class DatasetWizardComponent {
|
||||
export class DatasetWizardComponent implements OnInit, IBreadCrumbComponent {
|
||||
breadCrumbs: Observable<BreadcrumbItem[]>;
|
||||
@ViewChild('stepper') stepper: MatStepper;
|
||||
|
||||
//autocomplete Display Functions;
|
||||
|
@ -111,6 +115,30 @@ export class DatasetWizardComponent {
|
|||
this.datasetWizardService.getSingle(this.itemId).map(data => data as DatasetWizardModel)
|
||||
.subscribe(data => {
|
||||
this.datasetWizardModel = JsonSerializer.fromJSONObject(data, DatasetWizardModel);
|
||||
this.breadCrumbs = Observable.of([
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: "Datasets",
|
||||
url: "/datasets",
|
||||
notFoundResolver: [
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.dmp.project.label,
|
||||
url: "/projects/edit/" + this.datasetWizardModel.dmp.project.id
|
||||
},
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.dmp.label,
|
||||
url: "/dmps/edit/" + this.datasetWizardModel.dmp.id,
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.label,
|
||||
url: "/datasets/" + this.datasetWizardModel.id
|
||||
}
|
||||
])
|
||||
this.formGroup = this.datasetWizardModel.buildForm();
|
||||
this.loadDatasetProfiles();
|
||||
});
|
||||
|
|
|
@ -4,9 +4,44 @@ import { RouterModule, Routes } from '@angular/router';
|
|||
import { AuthGuard } from '../shared/guards/auth.guard';
|
||||
|
||||
export const DatasetRoutes: Routes = [
|
||||
{ path: "new/:dmpId", component: DatasetWizardComponent, canActivate: [AuthGuard] },
|
||||
{ path: "edit/:id", component: DatasetWizardComponent, canActivate: [AuthGuard] },
|
||||
{ path: "new", component: DatasetWizardComponent, canActivate: [AuthGuard] },
|
||||
{ path: '', component: DatasetListingComponent, canActivate: [AuthGuard] },
|
||||
{ path: "dmp/:dmpId", component: DatasetListingComponent, canActivate: [AuthGuard] }
|
||||
{
|
||||
path: "new/:dmpId",
|
||||
component: DatasetWizardComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "edit/:id",
|
||||
component: DatasetWizardComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "new",
|
||||
component: DatasetWizardComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: DatasetListingComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "dmp/:dmpId",
|
||||
component: DatasetListingComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
breadcrumb: true
|
||||
},
|
||||
}
|
||||
];
|
||||
|
|
|
@ -56,13 +56,14 @@ export class DatasetListingComponent implements OnInit, IBreadCrumbComponent {
|
|||
|
||||
ngOnInit() {
|
||||
|
||||
this.route.params.subscribe((params: Params) => {
|
||||
this.route.params.subscribe(async (params: Params) => {
|
||||
this.dmpId = params['dmpId'];
|
||||
this.criteria.setCriteria(this.getDefaultCriteria(this.dmpId));
|
||||
this.refresh();
|
||||
this.criteria.setRefreshCallback(() => this.refresh());
|
||||
if (this.dmpId != null) {
|
||||
this.breadCrumbs = Observable.of([{ parentComponentName: "DataManagementPlanEditorComponent", label: params['dmpLabel'], url: "dmps/edit/" + this.dmpId }, { parentComponentName: null, label: 'Datasets', url: "dmps" }])
|
||||
let dmp = await this.dataManagementPlanService.getSingle(this.dmpId).toPromise()
|
||||
this.breadCrumbs = Observable.of([{ parentComponentName: "DataManagementPlanEditorComponent", label: dmp.label, url: "dmps/edit/" + this.dmpId }, { parentComponentName: null, label: 'Datasets', url: "dmps" }])
|
||||
if (params['dmpLabel'] != undefined)
|
||||
this.titlePrefix = "for " + params['dmpLabel'];
|
||||
} else {
|
||||
|
|
|
@ -10,29 +10,29 @@ export const DataManagementPlanRoutes: Routes = [
|
|||
path: '',
|
||||
component: DataManagementPlanListingComponent,
|
||||
data: {
|
||||
breadcrumbs: ''
|
||||
}
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'viewversions/:groupId',
|
||||
component: DataManagementPlanListingComponent,
|
||||
data: {
|
||||
breadcrumbs: 'group'
|
||||
}
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'project/:projectId',
|
||||
component: DataManagementPlanListingComponent,
|
||||
data: {
|
||||
breadcrumbs: 'project'
|
||||
}
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'edit/:id',
|
||||
component: DataManagementPlanEditorComponent,
|
||||
data: {
|
||||
breadcrumbs: 'edit'
|
||||
}
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
|
@ -46,22 +46,22 @@ export const DataManagementPlanRoutes: Routes = [
|
|||
component: DataManagementPlanWizardComponent,
|
||||
data: {
|
||||
clone: false,
|
||||
breadcrumbs: 'new version'
|
||||
}
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'clone/:id',
|
||||
component: DataManagementPlanWizardComponent,
|
||||
data: {
|
||||
clone: true,
|
||||
breadcrumbs: 'clone'
|
||||
}
|
||||
clone: false,
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "invitation/:id",
|
||||
component: InvitationAcceptedComponent,
|
||||
data: {
|
||||
breadcrumbs: 'ivitation'
|
||||
}
|
||||
breadcrumb: true
|
||||
},
|
||||
}
|
||||
];
|
||||
|
|
|
@ -78,7 +78,6 @@ export class DataManagementPlanEditorComponent implements AfterViewInit, IBreadC
|
|||
private languageResolverService: LanguageResolverService
|
||||
) {
|
||||
this.filteredOptions = dmpProfileService.getAll({ criteria: new DataManagementPlanProfileCriteria() });
|
||||
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<mat-icon>add</mat-icon>{{'DMP-LISTING.ACTIONS.ADD-DATASET' | translate}}</button>
|
||||
<button mat-menu-item (click)="showDatasets(row.id, row.label)">
|
||||
<mat-icon>list</mat-icon>{{'DMP-LISTING.ACTIONS.DATASETS' | translate}}</button>
|
||||
<button mat-menu-item (click)="viewVersions(row.groupId)">
|
||||
<button mat-menu-item (click)="viewVersions(row.groupId, row.label)">
|
||||
<mat-icon>library_books</mat-icon>{{'DMP-LISTING.ACTIONS.VIEW-VERSION' | translate}}</button>
|
||||
</mat-menu>
|
||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
||||
|
|
|
@ -68,7 +68,11 @@ export class DataManagementPlanListingComponent implements OnInit, IBreadCrumbCo
|
|||
this.itemId = params['groupId'];
|
||||
this.showProject = true;
|
||||
let breadCrumbs = [];
|
||||
if (this.itemId) breadCrumbs.push({ parentComponentName: null, label: 'DMPs For ' + this.itemId, url: "/dmps/viewversions/" + this.itemId })
|
||||
|
||||
if (this.itemId) {
|
||||
let dmplabel = this.route.snapshot.queryParams.groupLabel
|
||||
breadCrumbs.push({ parentComponentName: null, label: 'DMPs', url: "/dmps" }, { parentComponentName: null, label: 'DMPs Versions Of ' + dmplabel, url: "/dmps/viewversions/" + this.itemId })
|
||||
}
|
||||
else breadCrumbs.push({ parentComponentName: null, label: 'DMPs', url: "/dmps" })
|
||||
this.breadCrumbs = Observable.of(breadCrumbs)
|
||||
|
||||
|
@ -100,8 +104,8 @@ export class DataManagementPlanListingComponent implements OnInit, IBreadCrumbCo
|
|||
this.router.navigate(['/datasets/dmp/' + rowId, { dmpLabel: rowLabel }]);
|
||||
}
|
||||
|
||||
viewVersions(rowId: String) {
|
||||
this.router.navigate(['/dmps/viewversions/' + rowId]);
|
||||
viewVersions(rowId: String, rowLabel: String) {
|
||||
this.router.navigate(['/dmps/viewversions/' + rowId], { queryParams: { groupLabel: rowLabel } });
|
||||
}
|
||||
|
||||
getDefaultCriteria(): DataManagementPlanCriteria {
|
||||
|
|
|
@ -14,8 +14,8 @@ import { DataRepositoryModel } from "../dataRepositories/DataRepositoryModel";
|
|||
import { ExternalDatasetModel } from '../../models/external-dataset/ExternalDatasetModel';
|
||||
|
||||
export class DatasetWizardModel implements Serializable<DatasetWizardModel> {
|
||||
public id: String;
|
||||
public label: String;
|
||||
public id: string;
|
||||
public label: string;
|
||||
public profile: DatasetProfileModel = new DatasetProfileModel();
|
||||
public uri: String;
|
||||
public status: String;
|
||||
|
|
|
@ -7,15 +7,14 @@ export const ProjectRoutes: Routes = [
|
|||
path: '',
|
||||
component: ProjectListingComponent,
|
||||
data: {
|
||||
breadcrumbs: ''
|
||||
}
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'edit/:id',
|
||||
component: ProjectEditorComponent,
|
||||
data: {
|
||||
// Interpolates values resolved by the router
|
||||
breadcrumbs: '{{ project.text }}'
|
||||
breadcrumb: true
|
||||
},
|
||||
/* resolve: {
|
||||
project: ProjectResolver
|
||||
|
@ -25,8 +24,8 @@ export const ProjectRoutes: Routes = [
|
|||
path: 'new',
|
||||
component: ProjectEditorComponent,
|
||||
data: {
|
||||
breadcrumbs: 'new'
|
||||
}
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ export class BreadCrumbResolverService {
|
|||
private getComponentsFromRoute(activatedRoute: ActivatedRoute, routeComponents: any[]): any[] {
|
||||
activatedRoute.children.forEach(x => {
|
||||
if (x.children.length > 0) this.getComponentsFromRoute(x.children[0], routeComponents);
|
||||
if (x.component) routeComponents.push(x.component['name'])
|
||||
})
|
||||
if (activatedRoute.component) routeComponents.push(activatedRoute.component['name'])
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ import { Observable } from 'rxjs/Observable';
|
|||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class BreadcrumbComponent implements OnInit {
|
||||
|
||||
breadcrumbs$ = this.router.events
|
||||
.filter(event => event instanceof NavigationEnd)
|
||||
.distinctUntilChanged()
|
||||
|
@ -23,12 +22,15 @@ export class BreadcrumbComponent implements OnInit {
|
|||
private router: Router,
|
||||
private breadCrumbService: BreadCrumbResolverService
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
}
|
||||
|
||||
buildBreadCrumb(route: ActivatedRoute): Observable<BreadcrumbItem[]> {
|
||||
|
||||
return this.breadCrumbService.resolve(route);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,23 +4,28 @@ import { DashboardService } from '../../app/services/dashboard/dashboard.service
|
|||
import { DashboardStatisticsModel } from '../models/dashboard/DashboardStatisticsModel';
|
||||
import { JsonSerializer } from '../utilities/JsonSerializer';
|
||||
import { HomepageComponent } from '../homepage/homepage.component'
|
||||
import { IBreadcrumb } from 'ngx-breadcrumbs';
|
||||
import { IBreadCrumbComponent } from '../shared/components/breadcrumb/definition/IBreadCrumbComponent';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { BreadcrumbItem } from '../shared/components/breadcrumb/definition/breadcrumb-item';
|
||||
|
||||
@Component({
|
||||
selector: 'welcomepage',
|
||||
templateUrl: './welcomepage.component.html',
|
||||
// styleUrls: ['./homepage.component.css'],
|
||||
// styleUrls: ['./homepage.component.css'],
|
||||
providers: [DashboardService]
|
||||
})
|
||||
export class WelcomepageComponent implements OnInit {
|
||||
export class WelcomepageComponent implements OnInit, IBreadCrumbComponent {
|
||||
|
||||
breadCrumbs: Observable<BreadcrumbItem[]> = Observable.of([]);
|
||||
private userInfo: any;
|
||||
private dashboardStatisticsData: DashboardStatisticsModel = new DashboardStatisticsModel();
|
||||
|
||||
constructor( ) {
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.breadCrumbs = Observable.of([{ parentComponentName: null, label: 'Home', url: "/welcome" }])
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue