reforming datasetprofile editor

This commit is contained in:
Nikolaos Laskaris 2017-10-27 20:09:04 +03:00
parent d6da77b75a
commit 48b99d614e
7 changed files with 144 additions and 5 deletions

View File

@ -59,6 +59,7 @@ import { ServiceEditorComponent } from './managers/service-editor/service-editor
import { ResearcherEditorComponent } from './managers/researcher-editor/researcher-editor.component';
import { DatareposEditorComponent } from './managers/datarepos-editor/datarepos-editor.component';
import { DatasetprofileEditorComponent } from './managers/datasetprofile-editor/datasetprofile-editor.component';
import { DatasetProfileGUIEditorComponent } from './dataset-profile-gui-editor/dataset-profile-gui-editor.component';
@ -92,7 +93,8 @@ import { DatasetprofileEditorComponent } from './managers/datasetprofile-editor/
MainSignInComponent,
ResearcherEditorComponent,
DatareposEditorComponent,
DatasetprofileEditorComponent
DatasetprofileEditorComponent,
DatasetProfileGUIEditorComponent
],
imports: [
BrowserModule,

View File

@ -0,0 +1,68 @@
<div class="panel panel-default margin10">
<div class="panel-heading">
<div class="row">
<div class="col col-xs-6">
<h3 class="panel-title">Editing profile: {{profile?.label}}</h3>
</div>
<div class="col col-xs-6 text-right">
<button type="button" class="btn btn-sm btn-primary btn-create" (click)="goToMain()" > <span class="glyphicon glyphicon-arrow-left"></span> Go back</button>
</div>
</div>
</div>
<div class="panel-body">
<ul class="nav nav-tabs content-tabs" id="maincontent" role="tablist">
<li class="active"><a href="#profile" role="tab" data-toggle="tab">Profile</a></li>
<li class=""><a href="#viewstyle" role="tab" data-toggle="tab">Profile's viewstyle</a></li>
<li class=""><a href="#ruleset" role="tab" data-toggle="tab">Profile's ruleset</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="profile">
<br />
<div class="custom-table">
<input name="profile-label" type="text" placeholder="Enter profile label" [ngModel]="profile?.label" (ngModelChange)="profile.label=$event" (focusin)="onFocusIn($event)" (ngModelChange)="onValueChanged($event)" (focusout)="onFocusOutProfileWin($event)" (keydown)="preventDefaults($event)">
<label for="profile-label">Label</label>
</div>
<br />
<div class="custom-table">
<textarea class="form-control custom" rows="10" cols="65" name="profile-definition" [ngModel]="profile?.definition" (ngModelChange)="profile.definition=$event" (focusin)="onFocusIn($event)" (ngModelChange)="onValueChanged($event)" (focusout)="onFocusOutProfileWin($event)" (keydown)="preventDefaults($event)" placeholder="Enter profile definition"></textarea>
<label for="profile-definition">Definition</label>
</div>
</div>
<div class="tab-pane fade" id="viewstyle">
<br />
<div class="custom-table">
<input name="viewstyle-label" type="text" placeholder="Enter viewstyle label" [ngModel]="profile?.viewstyle?.label" (ngModelChange)="profile.viewstyle.label=$event" (focusin)="onFocusIn($event)" (ngModelChange)="onValueChanged($event)" (focusout)="onFocusOutProfileWin($event)" (keydown)="preventDefaults($event)">
<label for="viewstyle-label">Label</label>
</div>
<br />
<div class="custom-table">
<textarea class="form-control custom" rows="10" cols="65" name="viewstyle-definition" [ngModel]="profile?.viewstyle?.definition" (ngModelChange)="profile.viewstyle.definition=$event" (focusin)="onFocusIn($event)" (ngModelChange)="onValueChanged($event)" (focusout)="onFocusOutProfileWin($event)" (keydown)="preventDefaults($event)"></textarea>
<label for="viewstyle-definition">Definition</label>
</div>
</div>
<div class="tab-pane fade" id="ruleset">
<br />
<div class="custom-table">
<input name="ruleset-label" type="text" placeholder="Enter ruleset label" [ngModel]="profile?.ruleset?.label" (ngModelChange)="profile.ruleset.label=$event" (focusin)="onFocusIn($event)" (ngModelChange)="onValueChanged($event)" (focusout)="onFocusOutProfileWin($event)" (keydown)="preventDefaults($event)">
<label for="ruleset-label">Label</label>
</div>
<br />
<div class="custom-table">
<textarea class="form-control custom" rows="10" cols="65" name="ruleset-definition" [ngModel]="profile?.ruleset?.definition" (ngModelChange)="profile.ruleset.definition=$event" (focusin)="onFocusIn($event)" (ngModelChange)="onValueChanged($event)" (focusout)="onFocusOutProfileWin($event)" (keydown)="preventDefaults($event)"></textarea>
<label for="ruleset-definition">Definition</label>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DatasetProfileGUIEditorComponent } from './dataset-profile-gui-editor.component';
describe('DatasetProfileEditorComponent', () => {
let component: DatasetProfileGUIEditorComponent;
let fixture: ComponentFixture<DatasetProfileGUIEditorComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DatasetProfileGUIEditorComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DatasetProfileGUIEditorComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,24 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'dataset-profile-gui-editor',
templateUrl: './dataset-profile-gui-editor.component.html',
styleUrls: ['./dataset-profile-gui-editor.component.css']
})
export class DatasetProfileGUIEditorComponent implements OnInit {
constructor() { }
@Input() profile: any;
@Output() notifyClick: EventEmitter<any> = new EventEmitter<any>();
ngOnInit() {
}
goToMain(){
this.notifyClick.emit(1);
}
}

View File

@ -97,9 +97,28 @@
</div>
</div>
<!-- END oF DatasetViewer -->
<!-- END of DatasetViewer -->
<!-- Profile Editor -->
<!-- new profile editor -->
<div [ngClass]="{true:'visible', false:'invisible'}[viewingComponent==2]">
<dataset-profile-gui-editor [profile]=profile (notifyClick)="goToMain()" ></dataset-profile-gui-editor>
</div>
<!-- end of new profile editor -->
<!-- OLD Profile Editor -->
<!--
<div [ngClass]="{true:'visible', false:'invisible'}[viewingComponent==2]">
<div class="panel panel-default margin10">
<div class="panel-heading">
@ -170,6 +189,6 @@
</div>
</div>
</div>
<!-- End of Profile Editor -->
-->
<!-- End of OLD Profile Editor -->

View File

@ -4,6 +4,7 @@ import { Router } from '@angular/router';
import { DatasetsServiceService } from '../services/datasets-service.service';
import { DatasetProfileService } from '../services/dataset-profile.service';
import { DmpsServiceService } from '../services/dmps-service.service';
import { DatasetProfileGUIEditorComponent } from '../dataset-profile-gui-editor/dataset-profile-gui-editor.component';
import '../../assets/custom.js';
declare function simple_notifier(type: string, title: string, message:string): any;