no message

This commit is contained in:
Diamantis Tziotzios 2018-01-17 19:30:09 +02:00
parent 18cbd7468c
commit 66952722ba
19 changed files with 63 additions and 54 deletions

View File

@ -65,7 +65,7 @@
{{option.name}} {{option.name}}
</div> </div>
</ng-template> </ng-template>
<mat-progress-bar [style.height.px]="2" *ngIf="filteringServicesAsync" mode="indeterminate"></mat-progress-bar> <mat-progress-bar [style.height.px]="2" *ngIf="filteredServicesAsync" mode="indeterminate"></mat-progress-bar>
</td-chips> </td-chips>
<td-chips color="accent" [items]="filteredExternalDatasets" formControlName="externalDatasets" placeholder="{{'DATASET-EDITOR.FIELDS.EXTERNAL-DATASETS' | translate}}" <td-chips color="accent" [items]="filteredExternalDatasets" formControlName="externalDatasets" placeholder="{{'DATASET-EDITOR.FIELDS.EXTERNAL-DATASETS' | translate}}"
@ -79,7 +79,7 @@
{{option.label}} {{option.label}}
</div> </div>
</ng-template> </ng-template>
<mat-progress-bar [style.height.px]="2" *ngIf="filteringExternalDatasetsAsync" mode="indeterminate"></mat-progress-bar> <mat-progress-bar [style.height.px]="2" mode="indeterminate"></mat-progress-bar>
</td-chips> </td-chips>
<div class="navigation-buttons-container"> <div class="navigation-buttons-container">

View File

@ -1,5 +1,6 @@
<div class="container-fluid"> <div class="container-fluid">
<h3>{{'DATASET-LISTING.TITLE' | translate}}</h3> <h3>{{titlePrefix}} {{'DATASET-LISTING.TITLE' | translate}}</h3>
<app-datasets-criteria-component></app-datasets-criteria-component> <app-datasets-criteria-component></app-datasets-criteria-component>
<mat-card class="mat-card"> <mat-card class="mat-card">
@ -45,11 +46,11 @@
</ng-container> </ng-container>
<!-- Column Definition: Status --> <!-- Column Definition: Status -->
<ng-container cdkColumnDef="status"> <!-- <ng-container cdkColumnDef="status">
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.STATUS' | translate}}</mat-header-cell> <mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.STATUS' | translate}}</mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.status}} <mat-cell *matCellDef="let row"> {{row.status}}
</mat-cell> </mat-cell>
</ng-container> </ng-container> -->
<!-- Column Definition: Description --> <!-- Column Definition: Description -->
<ng-container cdkColumnDef="description"> <ng-container cdkColumnDef="description">
@ -77,7 +78,7 @@
</mat-paginator> </mat-paginator>
</mat-card> </mat-card>
<button mat-fab class="mat-fab-bottom-right" color="primary" [routerLink]=" ['/dataset/new'] "> <button *ngIf="dmpId" mat-fab class="mat-fab-bottom-right" color="primary" [routerLink]="['/dataset/new/'+dmpId] ">
<mat-icon class="mat-24">add</mat-icon> <mat-icon class="mat-24">add</mat-icon>
</button> </button>
</div> </div>

View File

@ -12,13 +12,15 @@ import { SnackBarNotificationComponent } from "../shared/components/notificaiton
import { DatasetService } from "../services/dataset/dataset.service"; import { DatasetService } from "../services/dataset/dataset.service";
import { DatasetListingModel } from "../models/datasets/DatasetListingModel"; import { DatasetListingModel } from "../models/datasets/DatasetListingModel";
import { PageEvent } from '@angular/material'; import { PageEvent } from '@angular/material';
import { DataManagementPlanService } from "@app/services/data-management-plan/data-management-plan.service";
import { DataManagementPlanModel } from "@app/models/data-managemnt-plans/DataManagementPlanModel";
@Component({ @Component({
selector: 'app-dataset-listing-component', selector: 'app-dataset-listing-component',
templateUrl: 'dataset-listing.component.html', templateUrl: 'dataset-listing.component.html',
styleUrls: ['./dataset-listing.component.scss'], styleUrls: ['./dataset-listing.component.scss'],
providers: [DatasetService] providers: [DatasetService, DataManagementPlanService]
}) })
export class DatasetListingComponent implements OnInit { export class DatasetListingComponent implements OnInit {
@ -26,9 +28,12 @@ export class DatasetListingComponent implements OnInit {
@ViewChild(MatSort) sort: MatSort; @ViewChild(MatSort) sort: MatSort;
@ViewChild(DatasetCriteriaComponent) criteria: DatasetCriteriaComponent; @ViewChild(DatasetCriteriaComponent) criteria: DatasetCriteriaComponent;
dataSource: DatasetDataSource | null; dataSource: DatasetDataSource | null;
displayedColumns: String[] = ['label', 'dmp', 'profile', 'dataRepositories', 'registries', 'services', 'status', 'description', 'created', 'actions']; displayedColumns: String[] = ['label', 'dmp', 'profile', 'dataRepositories', 'registries', 'services', 'description', 'created', 'actions'];
pageEvent: PageEvent; pageEvent: PageEvent;
titlePrefix: String;
dmpId: String;
statuses = [ statuses = [
{ value: '0', viewValue: 'Active' }, { value: '0', viewValue: 'Active' },
@ -40,7 +45,8 @@ export class DatasetListingComponent implements OnInit {
private router: Router, private router: Router,
private languageService: TranslateService, private languageService: TranslateService,
public snackBar: MatSnackBar, public snackBar: MatSnackBar,
public route: ActivatedRoute public route: ActivatedRoute,
public dataManagementPlanService: DataManagementPlanService
) { ) {
} }
@ -48,12 +54,20 @@ export class DatasetListingComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.route.params.subscribe((params: Params) => { this.route.params.subscribe((params: Params) => {
const dmpId = params['dmpId']; this.dmpId = params['dmpId'];
this.criteria.setCriteria(this.getDefaultCriteria(dmpId)); if(this.dmpId != null) this.setDmpTitle(this.dmpId);
this.criteria.setCriteria(this.getDefaultCriteria(this.dmpId));
this.refresh(); this.refresh();
this.criteria.setRefreshCallback(() => this.refresh()); this.criteria.setRefreshCallback(() => this.refresh());
}); });
} }
setDmpTitle(dmpId: String) {
this.dataManagementPlanService.getSingle(dmpId).map(data => data as DataManagementPlanModel)
.subscribe(data => {
this.titlePrefix = data.label;
});
}
refresh() { refresh() {
this.dataSource = new DatasetDataSource(this.datasetService, this._paginator, this.sort, this.languageService, this.snackBar, this.criteria); this.dataSource = new DatasetDataSource(this.datasetService, this._paginator, this.sort, this.languageService, this.snackBar, this.criteria);
@ -63,7 +77,7 @@ export class DatasetListingComponent implements OnInit {
this.router.navigate(['/dataset/' + rowId]); this.router.navigate(['/dataset/' + rowId]);
} }
getDefaultCriteria(dmpId: string): DatasetCriteria { getDefaultCriteria(dmpId: String): DatasetCriteria {
const defaultCriteria = new DatasetCriteria(); const defaultCriteria = new DatasetCriteria();
if (dmpId != null) { if (dmpId != null) {
defaultCriteria.dmpIds.push(dmpId); defaultCriteria.dmpIds.push(dmpId);

View File

@ -22,10 +22,10 @@
</ng-container> </ng-container>
<!-- Column Definition: Profile --> <!-- Column Definition: Profile -->
<ng-container cdkColumnDef="profile"> <!-- <ng-container cdkColumnDef="profile">
<mat-header-cell *matHeaderCellDef>{{'DMP-LISTING.COLUMNS.PROFILE' | translate}}</mat-header-cell> <mat-header-cell *matHeaderCellDef>{{'DMP-LISTING.COLUMNS.PROFILE' | translate}}</mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.profile}} </mat-cell> <mat-cell *matCellDef="let row"> {{row.profile}} </mat-cell>
</ng-container> </ng-container> -->
<!-- Column Definition: Researchers --> <!-- Column Definition: Researchers -->
<ng-container cdkColumnDef="researchers"> <ng-container cdkColumnDef="researchers">
@ -50,9 +50,9 @@
<mat-cell *matCellDef="let row"> <mat-cell *matCellDef="let row">
<mat-menu #actionsMenu="matMenu"> <mat-menu #actionsMenu="matMenu">
<button mat-menu-item (click)="rowClick(row.id)"><mat-icon>mode_edit</mat-icon>{{'DMP-LISTING.ACTIONS.EDIT' | translate}}</button> <button mat-menu-item (click)="rowClick(row.id)"><mat-icon>mode_edit</mat-icon>{{'DMP-LISTING.ACTIONS.EDIT' | translate}}</button>
<button mat-menu-item (click)="openShareDialog(row.id,row.label)"><mat-icon>insert_invitation</mat-icon>{{'DMP-LISTING.ACTIONS.INVITE' | translate}}</button> <button mat-menu-item (click)="openShareDialog(row.id,row.label)"><mat-icon>share</mat-icon>{{'DMP-LISTING.ACTIONS.INVITE' | translate}}</button>
<button mat-menu-item (click)="addDataset(row.id)"><mat-icon>insert_invitation</mat-icon>{{'DMP-LISTING.ACTIONS.ADD-DATASET' | translate}}</button> <button mat-menu-item (click)="addDataset(row.id)"><mat-icon>add</mat-icon>{{'DMP-LISTING.ACTIONS.ADD-DATASET' | translate}}</button>
<button mat-menu-item (click)="showDatasets(row.id)"><mat-icon>insert_invitation</mat-icon>{{'DMP-LISTING.ACTIONS.DATASETS' | translate}}</button> <button mat-menu-item (click)="showDatasets(row.id)"><mat-icon>list</mat-icon>{{'DMP-LISTING.ACTIONS.DATASETS' | translate}}</button>
</mat-menu> </mat-menu>
<button mat-icon-button [matMenuTriggerFor]="actionsMenu"> <button mat-icon-button [matMenuTriggerFor]="actionsMenu">
<mat-icon>more_vert</mat-icon> <mat-icon>more_vert</mat-icon>

View File

@ -27,7 +27,7 @@ export class DataManagementPlanListingComponent implements OnInit {
@ViewChild(DataManagementPlanCriteriaComponent) criteria: DataManagementPlanCriteriaComponent; @ViewChild(DataManagementPlanCriteriaComponent) criteria: DataManagementPlanCriteriaComponent;
dataSource: DataManagementPlanDataSource | null; dataSource: DataManagementPlanDataSource | null;
displayedColumns: String[] = ['name', 'project', 'profile', 'researchers', 'organisations', 'version', 'actions']; displayedColumns: String[] = ['name', 'project', 'researchers', 'organisations', 'version', 'actions'];
constructor( constructor(
private dataManagementPlanService: DataManagementPlanService, private dataManagementPlanService: DataManagementPlanService,

View File

@ -69,7 +69,7 @@
<div layout="row" class="full-width text-right" align="end"> <div layout="row" class="full-width text-right" align="end">
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'DMP-EDITOR.ACTIONS.CANCEL' | translate}}</button> <button mat-raised-button color="primary" (click)="cancel()" type="button">{{'DMP-EDITOR.ACTIONS.CANCEL' | translate}}</button>
<button *ngIf="!isNew" mat-raised-button color="primary" (click)="invite()" type="button">{{'DMP-EDITOR.ACTIONS.INVITE' | translate}}</button> <!-- <button *ngIf="!isNew" mat-raised-button color="primary" (click)="invite()" type="button">{{'DMP-EDITOR.ACTIONS.INVITE' | translate}}</button> -->
<button mat-raised-button color="primary" type="submit">{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}</button> <button mat-raised-button color="primary" type="submit">{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}</button>
<button *ngIf="!isNew" mat-raised-button color="primary" type="submit" (click)="delete()">{{'DMP-EDITOR.ACTIONS.DELETE' | translate}}</button> <button *ngIf="!isNew" mat-raised-button color="primary" type="submit" (click)="delete()">{{'DMP-EDITOR.ACTIONS.DELETE' | translate}}</button>
</div> </div>

View File

@ -64,7 +64,6 @@ export class AutocompleteRemoteComponent implements OnInit/* , ControlValueAcces
// }); */ // }); */
// }, // },
// error => { // error => {
// console.log(error);
// } // }
// ); // );
} }

View File

@ -33,7 +33,6 @@ export class DynamicFormFieldComponent {
} }
clearInput(){ clearInput(){
debugger;
} }
get isValid() { get isValid() {

View File

@ -22,7 +22,6 @@ export class DynamicFormCompositeFieldComponent implements OnInit {
constructor(private visibilityRulesService: VisibilityRulesService) { } constructor(private visibilityRulesService: VisibilityRulesService) { }
ngOnInit() { ngOnInit() {
console.log(this.form);
} }
addMultipleField(fieldIndex: number) { addMultipleField(fieldIndex: number) {

View File

@ -26,7 +26,6 @@ export class DynamicFormGroupComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
console.log(this.group);
//let st = this.group.style == "any" ? "" : this.group.style; //let st = this.group.style == "any" ? "" : this.group.style;
//this.classFromJson = this.group.class == "" ? "" : this.group.class; //this.classFromJson = this.group.class == "" ? "" : this.group.class;

View File

@ -22,7 +22,6 @@ export class DynamicFormSectionComponent implements OnInit {
constructor(private visibilityRulesService: VisibilityRulesService) { } constructor(private visibilityRulesService: VisibilityRulesService) { }
ngOnInit() { ngOnInit() {
console.log(this.section);
} }
addMultipleField(fieldsetIndex: number) { addMultipleField(fieldsetIndex: number) {

View File

@ -39,7 +39,7 @@
} }
.mat-progress-bar { .form-progress-bar {
margin: 20px 0; margin: 20px 0;

View File

@ -6,31 +6,31 @@
<mat-sidenav-content> <mat-sidenav-content>
<!-- <button mat-raised-button color="primary" style="margin: 15px;" (click)="toggleSidebar()" icon="fa-arrow-left">Table Of Contents</button> --> <!-- <button mat-raised-button color="primary" style="margin: 15px;" (click)="toggleSidebar()" icon="fa-arrow-left">Table Of Contents</button> -->
<button mat-raised-button color="primary" *ngIf="datasetProfileDefinitionModel&&datasetProfileDefinitionModel.status != 1" <form *ngIf="form" novalidate [formGroup]="form" (ngSubmit)="onSubmit()">
style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" type="submit">Save</button> <button mat-raised-button color="primary" *ngIf="datasetProfileDefinitionModel&&datasetProfileDefinitionModel.status != 1"
<button mat-raised-button color="primary" *ngIf="datasetProfileDefinitionModel&&datasetProfileDefinitionModel?.status != 1" style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" type="submit">Save</button>
style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" (click)="submit();">Save and Finalize</button> <!-- <button mat-raised-button color="primary" *ngIf="datasetProfileDefinitionModel&&datasetProfileDefinitionModel?.status != 1"
<div> style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" (click)="submit();">Save and Finalize</button> -->
<div class="alignment-center"> <div>
<!-- <ngb-pagination *ngIf="pages" [collectionSize]="pages.length*10" [page]="currentPageIndex" (pageChange)="changePageIndex($event)" aria-label="Default pagination"></ngb-pagination> --> <div class="alignment-center">
<progress-bar *ngIf="form" [formGroup]="form"></progress-bar> <!-- <ngb-pagination *ngIf="pages" [collectionSize]="pages.length*10" [page]="currentPageIndex" (pageChange)="changePageIndex($event)" aria-label="Default pagination"></ngb-pagination> -->
<progress-bar *ngIf="form" [formGroup]="form"></progress-bar>
</div>
</div> </div>
</div>
<div>
<!-- <progress-bar *ngIf="form" [formGroup]="form"></progress-bar> -->
</div>
<div class="col-md-12" id="form-container"> <div class="col-md-12" id="form-container">
<form *ngIf="form" novalidate [formGroup]="form" (ngSubmit)="onSubmit()"> <!-- <form *ngIf="form" novalidate [formGroup]="form" (ngSubmit)="onSubmit()"> -->
<mat-vertical-stepper [linear]="false"> <mat-vertical-stepper #stepper [linear]="false">
<div *ngFor="let page of pages let z=index;"> <div *ngFor="let page of pages let z=index;">
<div *ngFor="let section of datasetProfileDefinitionModel.sections; let i = index;"> <div *ngFor="let section of datasetProfileDefinitionModel.sections; let i = index;">
<div *ngIf="section.page == z"> <div *ngIf="section.page == z">
<mat-step [stepControl]="section"> <mat-step [stepControl]="section">
<df-section [section]="section" [form]="form.get('sections').get(''+i)" [path]="i+1" [pathName]="'sections.'+i"></df-section>
<ng-template matStepLabel>{{section.title}}</ng-template> <ng-template matStepLabel>{{section.title}}</ng-template>
<div> <div *ngIf="stepper.selectedIndex == z">
<df-section [section]="section" [form]="form.get('sections').get(''+i)" [path]="i+1" [pathName]="'sections.'+i"></df-section>
<!-- <div>
<button mat-button matStepperNext>Next</button> <button mat-button matStepperNext>Next</button>
</div> -->
</div> </div>
</mat-step> </mat-step>
</div> </div>
@ -41,8 +41,9 @@
<df-section *ngIf='this.shouldDisplaySection(section)' [section]="section" [form]="form.get('sections').get(''+i)" [path]="i+1" <df-section *ngIf='this.shouldDisplaySection(section)' [section]="section" [form]="form.get('sections').get(''+i)" [path]="i+1"
[pathName]="'sections.'+i"></df-section> [pathName]="'sections.'+i"></df-section>
</div> --> </div> -->
</form>
</div> </div>
</form>
</mat-sidenav-content> </mat-sidenav-content>
</mat-sidenav-container> </mat-sidenav-container>
</div> </div>

View File

@ -34,7 +34,7 @@ export class DynamicFormComponent implements OnInit {
@Input() path: string; @Input() path: string;
form: FormGroup; form: FormGroup;
id: string; id: string;
datasetId: string; // @Input() datasetId: string;
pathName: string; pathName: string;
pages: Array<number>; pages: Array<number>;
activeStepperIndex: number = 1; activeStepperIndex: number = 1;
@ -51,7 +51,7 @@ export class DynamicFormComponent implements OnInit {
private http: BaseHttpService, private http: BaseHttpService,
private datasetWizardService: DatasetWizardService, private datasetWizardService: DatasetWizardService,
) { ) {
this.datasetId = route.snapshot.params['id']; //this.datasetId = route.snapshot.params['id'];
} }
getSubForm(subformName) { getSubForm(subformName) {
@ -94,8 +94,8 @@ export class DynamicFormComponent implements OnInit {
} }
onSubmit(){ onSubmit(){
this.datasetWizardService.saveDataset(this.datasetId, this.form.value).subscribe(data => { this.datasetWizardService.saveDataset(this.dataModel.id, this.form.value).subscribe(data => {
this.router.navigateByUrl("/datasets"); this.router.navigateByUrl("/datasets/" + this.dataModel.dmp.id);
}); });
} }

View File

@ -1,5 +1,5 @@
<!-- <p-progressBar [value]="value" [style]="{'height': '30px'}" [styleClass]="'alwaysVisible'"></p-progressBar> --> <!-- <p-progressBar [value]="value" [style]="{'height': '30px'}" [styleClass]="'alwaysVisible'"></p-progressBar> -->
<div class="demo-progress-bar-container"> <div class="demo-progress-bar-container">
<mat-progress-bar mode="determinate" [value]="value" [color]="color"></mat-progress-bar> <mat-progress-bar class="form-progress-bar" mode="determinate" [value]="value" [color]="color"></mat-progress-bar>
</div> </div>

View File

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

View File

@ -124,7 +124,6 @@ export class AuthService {
} }
public onLogOutError(errorMessage: string) { public onLogOutError(errorMessage: string) {
console.log(errorMessage);
this.snackBar.openFromComponent(SnackBarNotificationComponent, { this.snackBar.openFromComponent(SnackBarNotificationComponent, {
data: { message: 'GENERAL.SNACK-BAR.UNSUCCESSFUL-LOGOUT', language: this.language }, data: { message: 'GENERAL.SNACK-BAR.UNSUCCESSFUL-LOGOUT', language: this.language },
duration: 3000, duration: 3000,

View File

@ -33,7 +33,7 @@ export class DataManagementPlanService {
return this.http.post<DataTableData<DataManagementPlanListingModel>>(this.actionUrl + 'getPaged', dataTableRequest, { headers: this.headers }); return this.http.post<DataTableData<DataManagementPlanListingModel>>(this.actionUrl + 'getPaged', dataTableRequest, { headers: this.headers });
} }
getSingle(id: string): Observable<DataManagementPlanModel> { getSingle(id: String): Observable<DataManagementPlanModel> {
return this.http.get<DataManagementPlanModel>(this.actionUrl + 'getSingle/' + id, { headers: this.headers }); return this.http.get<DataManagementPlanModel>(this.actionUrl + 'getSingle/' + id, { headers: this.headers });
} }

View File

@ -186,7 +186,6 @@ export class LoginService {
} }
public onLogInError(errorMessage: string) { public onLogInError(errorMessage: string) {
console.log(errorMessage);
this.snackBar.openFromComponent(SnackBarNotificationComponent, { this.snackBar.openFromComponent(SnackBarNotificationComponent, {
data: { message: 'GENERAL.SNACK-BAR.UNSUCCESSFUL-LOGIN', language: this.language }, data: { message: 'GENERAL.SNACK-BAR.UNSUCCESSFUL-LOGIN', language: this.language },
duration: 3000, duration: 3000,