no message

This commit is contained in:
Diamantis Tziotzios 2018-01-17 17:17:16 +02:00
parent 730db6655d
commit 05cbadb17b
7 changed files with 37 additions and 28 deletions

View File

@ -31,6 +31,7 @@ const appRoutes: Routes = [
{ path: 'dataset/new/:dmpId', component: DatasetWizardComponent, canActivate: [AuthGuard] },
{ path: 'dataset/:id', component: DatasetWizardComponent, canActivate: [AuthGuard] },
{ path: 'datasets/new', component: DatasetWizardComponent, canActivate: [AuthGuard] },
{ path: 'datasets/:dmpId', component: DatasetListingComponent, canActivate: [AuthGuard] },
{ path: 'invitation/:id', component: InvitationAcceptedComponent},
{ path: 'login', loadChildren: './user-management/login.module#LoginModule' },
{ path: "unauthorized", loadChildren: './unauthorized/unauthorized.module#UnauthorizedModule' },

View File

@ -108,7 +108,7 @@ export class DatasetWizardComponent implements AfterViewInit {
//this.datasetProfileAutoCompleteConfiguration = new AutoCompleteConfiguration(this.datasetWizardService.getAvailableProfiles.bind(this.datasetWizardService), datasetProfileRequestItem);
// this.formGroup.get("dmp").valueChanges.subscribe(change => {
// this.formGroup.get('profile').setValue(null, { emitEvent: false });
// //this.datasetProfileAutoCompleteConfiguration.requestItem.criteria.id = change.id
// });
});

View File

@ -1,6 +1,6 @@
import { Component, ViewChild, OnInit, AfterViewInit } from "@angular/core";
import { MatPaginator, MatSort, MatSnackBar } from "@angular/material";
import { Router } from "@angular/router";
import { Router, Params, ActivatedRoute } from "@angular/router";
import { TranslateService } from "@ngx-translate/core";
import { DataSource } from "@angular/cdk/table";
@ -11,7 +11,7 @@ import { DataTableRequest } from "../models/data-table/DataTableRequest";
import { SnackBarNotificationComponent } from "../shared/components/notificaiton/snack-bar-notification.component";
import { DatasetService } from "../services/dataset/dataset.service";
import { DatasetListingModel } from "../models/datasets/DatasetListingModel";
import {PageEvent} from '@angular/material';
import { PageEvent } from '@angular/material';
@Component({
@ -27,29 +27,33 @@ export class DatasetListingComponent implements OnInit {
@ViewChild(DatasetCriteriaComponent) criteria: DatasetCriteriaComponent;
dataSource: DatasetDataSource | null;
displayedColumns: String[] = ['label','dmp' ,'profile' , 'dataRepositories', 'registries','services', 'status', 'description', 'created', 'actions'];
displayedColumns: String[] = ['label', 'dmp', 'profile', 'dataRepositories', 'registries', 'services', 'status', 'description', 'created', 'actions'];
pageEvent: PageEvent;
statuses = [
{value: '0', viewValue: 'Active'},
{value: '1', viewValue: 'Inactive'}
];
{ value: '0', viewValue: 'Active' },
{ value: '1', viewValue: 'Inactive' }
];
constructor(
private datasetService: DatasetService,
private router: Router,
private languageService: TranslateService,
public snackBar: MatSnackBar,
public route: ActivatedRoute
) {
}
}
ngOnInit() {
this.criteria.setCriteria(this.getDefaultCriteria());
this.refresh();
this.criteria.setRefreshCallback(() => this.refresh());
}
this.route.params.subscribe((params: Params) => {
const dmpId = params['dmpId'];
this.criteria.setCriteria(this.getDefaultCriteria(dmpId));
this.refresh();
this.criteria.setRefreshCallback(() => this.refresh());
});
}
refresh() {
this.dataSource = new DatasetDataSource(this.datasetService, this._paginator, this.sort, this.languageService, this.snackBar, this.criteria);
@ -59,11 +63,14 @@ export class DatasetListingComponent implements OnInit {
this.router.navigate(['/dataset/' + rowId]);
}
getDefaultCriteria(): DatasetCriteria {
getDefaultCriteria(dmpId: string): DatasetCriteria {
const defaultCriteria = new DatasetCriteria();
if (dmpId != null) {
defaultCriteria.dmpIds.push(dmpId);
}
return defaultCriteria;
}
}
export class DatasetDataSource extends DataSource<DatasetListingModel> {
@ -89,7 +96,7 @@ export class DatasetDataSource extends DataSource<DatasetListingModel> {
//this._sort.matSortChange
];
return Observable.merge(...displayDataChanges)
.startWith(null)
.switchMap(() => {

View File

@ -58,7 +58,7 @@ export class DataManagementPlanListingComponent implements OnInit {
}
showDatasets(rowId: String) {
this.router.navigate(['/dataset/new/' + rowId]);
this.router.navigate(['/datasets/' + rowId]);
}
getDefaultCriteria(): DataManagementPlanCriteria {

View File

@ -2,4 +2,5 @@ import { BaseCriteria } from "../BaseCriteria";
export class DatasetCriteria extends BaseCriteria {
public status: Number;
public dmpIds: string[] = [];
}

View File

@ -24,13 +24,13 @@
<!-- Column Definition: Start -->
<ng-container cdkColumnDef="start">
<mat-header-cell *matHeaderCellDef>{{'PROJECT-LISTING.COLUMNS.START' | translate}}</mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.startDate}} </mat-cell>
<mat-cell *matCellDef="let row"> {{row.startDate | date:'shortDate'}} </mat-cell>
</ng-container>
<!-- Column Definition: End -->
<ng-container cdkColumnDef="end">
<mat-header-cell *matHeaderCellDef>{{'PROJECT-LISTING.COLUMNS.END' | translate}}</mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.endDate}} </mat-cell>
<mat-cell *matCellDef="let row"> {{row.endDate | date:'shortDate'}} </mat-cell>
</ng-container>
<!-- Column Definition: Submission Time -->

View File

@ -42,13 +42,13 @@
"RESEARCHERS": "Researchers",
"ORGANISATIONS": "Organisations",
"VERSION": "Version",
"ACTIONS":"Actions"
"ACTIONS": "Actions"
},
"ACTIONS":{
"EDIT":"Edit",
"INVITE":"Invite",
"ADD-DATASET":"Add Dataset",
"DATASETS":"Datasets"
"ACTIONS": {
"EDIT": "Edit",
"INVITE": "Invite",
"ADD-DATASET": "Add Dataset",
"DATASETS": "Datasets"
}
},
"DATASET-WIZARD": {
@ -93,7 +93,7 @@
"FIELDS": {
"NAME": "Name",
"ABBREVIATION": "Abbreviation",
"URI": "URI",
"URI": "URL",
"START": "Start",
"END": "End",
"DESCRIPTION": "Description"