Commit 18b0de4a authored by Thodoris Nestoridis's avatar Thodoris Nestoridis

tool v0.9

parent 32b8bb89
......@@ -14,7 +14,7 @@ export class AppComponent {
title = 'ReqmanAngular11';
LoggedIn() {
console.log(this.authService.isLoggedIn())
//console.log(this.authService.isLoggedIn())
return this.authService.isLoggedIn();
}
......
......@@ -30,6 +30,13 @@
<input name="title" id="title" type="text" class="form-control" required
[(ngModel)]="currentboilerplate.title" (change)="this.updateBoilerplate()" style="width: 63%;" />
</div>
<div class="form-group" style="display:flex; flex-direction: row; align-items: center">
<label for="title" style="margin-right: 35px;"><b>Extracted property</b></label>
<textarea id="clipboard-example-textarea" class="form-control" style="width: 63%;">{{this.property_text}}</textarea>
<button [cdkCopyToClipboard]="this.property_text" mat-mini-fab color="gray" style="margin-left: 8px;" ><mat-icon>content_copy</mat-icon></button>
</div>
<div style="display: flex; flex-grow: grow; margin-top: 50px; ">
<form class="form-group form-inline ">
<mat-checkbox class="example-full-width" [(ngModel)]="currentboilerplate.has_prefix"
......@@ -158,6 +165,9 @@
<button mat-button [matMenuTriggerFor]="menu"
[matMenuTriggerData]="{section: section.Name ,class: item.Class}" #menuTrigger>
<h4><b>Instances</b></h4>
<div *ngIf="this.instaspiner">
<mat-spinner [diameter]='15' style="position: absolute; z-index: 1;top: 10%;left: 125%;"></mat-spinner>
</div>
</button>
<div *ngFor="let instan of item.Instance_of_Class| filter:searchText">
<li>
......@@ -238,7 +248,10 @@
<ul> <button mat-button [matMenuTriggerFor]="menu"
[matMenuTriggerData]="{section: section.Name ,class: item.Class, subclass: sub.SubClass_name, subsubclass:subsub.SubSubClass_name , subsubsubclass: subsubsub.SubSubClass_name, subsubsubsubclass: subsubsubsub.SubSubClass_name}"
#menuTrigger>
<h5>AAA-Instances</h5>
<h5>Instances</h5>
<div *ngIf="this.instaspiner">
<mat-spinner [diameter]='15' style="position: absolute; z-index: 1;top: 10%;left: 125%;"></mat-spinner>
</div>
</button>
<div
*ngFor="let subsubsubsubinstansub of subsubsubsub.SubInstanceOfSubclass| filter:searchText">
......@@ -277,6 +290,9 @@
[matMenuTriggerData]="{section: section.Name ,class: item.Class, subclass: sub.SubClass_name, subsubclass:subsub.SubSubClass_name , subsubsubclass: subsubsub.SubSubClass_name}"
#menuTrigger>
<h5>Instances</h5>
<div *ngIf="this.instaspiner">
<mat-spinner [diameter]='15' style="position: absolute; z-index: 1;top: 10%;left: 125%;"></mat-spinner>
</div>
</button>
<div *ngFor="let subsubsubinstansub of subsubsub.SubInstanceOfSubclass| filter:searchText">
<li>
......@@ -313,6 +329,9 @@
[matMenuTriggerData]="{section: section.Name ,class: item.Class, subclass: sub.SubClass_name, subsubclass:subsub.SubSubClass_name }"
#menuTrigger>
<h5>Instances</h5>
<div *ngIf="this.instaspiner">
<mat-spinner [diameter]='15' style="position: absolute; z-index: 1;top: 10%;left: 125%;"></mat-spinner>
</div>
</button>
<div *ngFor="let subsubinstansub of subsub.SubInstanceOfSubclass| filter:searchText">
<li>
......@@ -349,6 +368,9 @@
[matMenuTriggerData]="{section: section.Name ,class: item.Class, subclass: sub.SubClass_name}"
#menuTrigger>
<h5>Instances</h5>
<div *ngIf="this.instaspiner">
<mat-spinner [diameter]='15' style="position: absolute; z-index: 1;top: 10%;left: 125%;"></mat-spinner>
</div>
</button>
<div *ngFor="let instansub of sub.InstanceOfSubclass| filter:searchText">
<li>
......@@ -408,6 +430,9 @@
<ul>
<button mat-button [matMenuTriggerFor]="menu" [matMenuTriggerData]="{section: section.Name}" #menuTrigger>
<h4>Instances</h4>
<div *ngIf="this.instaspiner">
<mat-spinner [diameter]='15' style="position: absolute; z-index: 1;top: 10%;left: 125%;"></mat-spinner>
</div>
</button>
<div *ngFor="let genin of section.GeneralInstances| filter:searchText">
<li>
......
......@@ -46,6 +46,8 @@ export class BoilerplateDetailsComponent implements OnInit {
mes_list = [] as any;
searchInstance_list = [] as any;
private readonly notifier: NotifierService;
instaspiner=false;
property_text ='';
......@@ -66,6 +68,7 @@ export class BoilerplateDetailsComponent implements OnInit {
this.getchoices(this.route.snapshot.params.gb);
this.getBoilerplate(this.route.snapshot.params.gb, this.route.snapshot.params.id);
this.getInfer();
this.getProperty();
}
searchInstance(): void {
......@@ -133,6 +136,7 @@ export class BoilerplateDetailsComponent implements OnInit {
if (this.currentboilerplate.has_main) { this.mainchild.updateMain(); };
if (this.currentboilerplate.has_suffix) { this.sufchild.updateSuffix(); };
this.notifier.notify("success", (JSON.stringify("Requirement " + this.currentboilerplate.title + " updated")));
//setTimeout(() => this.getProperty(),1500);
}
deleteBoilerplate(): void {
......@@ -209,6 +213,7 @@ export class BoilerplateDetailsComponent implements OnInit {
deleteInstance(section: any, classes: any, subclass: any, subsubclass: any, subsubsubclass: any, subsubsubsubclass: any, instance: any, comment: any): void {
if (confirm("Αre you sure you want to delete this Instance?")) {
this.instaspiner=true;
const removeinstance = section + (classes ? ' : ' + classes : '') + (subclass ? ' : ' + subclass : '') + (subsubclass ? ' : ' + subsubclass : '') + (subsubsubclass ? ' : ' + subsubsubclass : '') + (subsubsubsubclass ? ' : ' + subsubsubsubclass : '') + ' : ' + instance;
this.mainService.deleteinstances(this.route.snapshot.params.gb, removeinstance, (comment ? comment : ' '))
.subscribe(
......@@ -220,6 +225,7 @@ export class BoilerplateDetailsComponent implements OnInit {
error => {
if (error.error.text == 'Instance deleted') {
this.notifier.notify("success", (JSON.stringify(error.error.text)));
this.instaspiner=false;
if (this.systems) {
this.systems.forEach(function (value) {
if (section == value.Name) {
......@@ -353,8 +359,9 @@ export class BoilerplateDetailsComponent implements OnInit {
result.instance = result.instance?.replace(/ /g, "_")
}
if (result.instance) {
this.instaspiner=true;
this.addinstance = section + (classes ? ' : ' + classes : '') + (subclass ? ' : ' + subclass : '') + (subsubclass ? ' : ' + subsubclass : '') + (subsubsubclass ? ' : ' + subsubsubclass : '') + (subsubsubsubclass ? ' : ' + subsubsubsubclass : '') + ' : ' + result.instance;
//console.log(this.addinstance);
console.log(this.addinstance);
this.mainService.setinstances(this.route.snapshot.params.gb, this.addinstance, (result.comment ? result.comment : " "))
.subscribe(
data => {
......@@ -366,6 +373,7 @@ export class BoilerplateDetailsComponent implements OnInit {
error => {
if (error.error.text == 'Update Instance') {
this.notifier.notify("success", (JSON.stringify(error.error.text)));
this.instaspiner=false;
if (this.systems) {
this.systems.forEach(function (value) {
if (section == value.Name) {
......@@ -561,6 +569,16 @@ export class BoilerplateDetailsComponent implements OnInit {
});
}
getProperty(): void {
this.boilerplateService.getProperties(this.route.snapshot.params.gb, this.route.snapshot.params.id).subscribe(
data => {
this.property_text=data;
},
error => {
this.property_text=((JSON.stringify(error.error.text)));
});
}
prefixs = [
......
......@@ -28,10 +28,16 @@
</div>
<div fxFlex fxLayout fxHide.xs fxLayoutAlign="end">
<div>
<input class="btn btn-info" [disabled]="exporting" type="button" value="Download"
<input class="btn btn-info" [disabled]="exporting" type="button" value="Ontology"
(click)="getCurrentOntology()" />
</div>
</div>
<div fxFlex fxLayout fxHide.xs fxLayoutAlign="end">
<div>
<input class="btn btn-info" [disabled]="exporting" type="button" value="Properties"
(click)="getCurrentProperties()" />
</div>
</div>
<div fxFlex fxLayout fxHide.xs fxLayoutAlign="end" *ngIf="this.selection.selected.length >= 1">
<div>
<button mat-mini-fab color="warn" (click)="deleteBoilerplateList()">
......@@ -39,8 +45,6 @@
</button>
</div>
</div>
</div>
</div>
<div [hidden]="!showSpinner">
......@@ -62,11 +66,11 @@
</mat-checkbox>
</td>
</ng-container>
<!-- Position Column -->
<!-- Position Column
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef> No. </th>
<td mat-cell *matCellDef="let element"> {{element.id}} </td>
</ng-container>
</ng-container> -->
<!-- Name Column -->
<ng-container matColumnDef="prefix_data" >
......
......@@ -26,6 +26,20 @@ table {
border-color: currentColor;
}
.form-control {
border: none;
border-radius: 5px;
padding: 10px;
font-size: 16px;
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.1);
outline: none;
transition: box-shadow 0.3s ease-in-out;
}
.form-control:focus {
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}
::ng-deep .custom-tooltip {
background-color: #333;
color: #fff;
......
......@@ -57,7 +57,7 @@ export class BoilerplateListComponent implements OnInit {
currentIndex = -1;
title = '';
displayedColumns: string[] = ['id', 'title', 'has_prefix', 'has_main', 'has_suffix'];
newdisplayedColumns: string[] = ['select', 'id', 'title_data', 'prefix_data', 'main_data', 'suffix_data'];
newdisplayedColumns: string[] = ['select', 'title_data', 'prefix_data', 'main_data', 'suffix_data'];
dataSource: Boilerplate[] = [{}];
thenewdataSource: BoilerplateData[] = [{}];
newdataSource = new MatTableDataSource(this.thenewdataSource);
......@@ -104,6 +104,26 @@ export class BoilerplateListComponent implements OnInit {
}
getCurrentProperties(): void {
this.boilerplateService.getFileProperties(this.route.snapshot.params.gb)
.subscribe(res => {
let blob = new Blob([res], { type: 'text/plain' });
var url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'properties.txt';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
window.URL.revokeObjectURL(url);
},
error => {
this.notifier.notify("warning", 'Fail to download properties file');
});
}
retrieveBoilerplates(): void {
this.boilerplateService.getAll(this.route.snapshot.params.gb)
.subscribe(
......
......@@ -41,15 +41,15 @@
</mat-grid-tile>
<mat-grid-tile>
<div class="col" *ngIf="data.currentSection == 'Function'">
<p>The current instance will add the above requirement in the ontology :</p>
<p>The current instance will add the bellow information in the ontology :</p>
<h1><u>{{data.currentInstance}} shall invoke {{data.instance}}</u></h1>
</div>
<div class="col" *ngIf="data.currentSection == 'System'">
<p>The current instance will add the above requirement in the ontology :</p>
<p>The current instance will add the bellow information in the ontology :</p>
<h1><u>{{data.currentInstance}} shall contain {{data.instance}}</u></h1>
</div>
<div class="col" *ngIf="data.currentSection == 'Item'">
<p>The current instance will add the above requirement in the ontology :</p>
<p>The current instance will add the bellow information in the ontology :</p>
<mat-form-field style="width: 100%;" appearance="fill">
<mat-label>Select System</mat-label>
<mat-select required [(ngModel)]="data.selectedValue" name="system">
......@@ -87,7 +87,7 @@
</mat-grid-tile>
<mat-grid-tile>
<div class="col">
<p>The current instance will add the above requirement in the ontology :</p>
<p>The current instance will add the bellow information in the ontology :</p>
<h1><u>{{data.instance}} belongs to </u></h1>
<mat-form-field style="width: 100%;" appearance="fill">
<mat-label>Select StateSet</mat-label>
......@@ -130,7 +130,7 @@
</mat-grid-tile>
<mat-grid-tile>
<div class="col">
<p>The current instance will add the above requirement in the ontology :</p>
<p>The current instance will add the bellow information in the ontology :</p>
<mat-form-field style="width: 100%;" appearance="fill">
<mat-label>Select System</mat-label>
<mat-select required [(ngModel)]="data.selectedValue" name="system1">
......@@ -187,7 +187,7 @@
</mat-checkbox>
</section>
<div *ngIf="checked">
<p>The current instance will add the above requirement in the ontology :</p>
<p>The current instance will add the bellow information in the ontology :</p>
<mat-form-field style="width: 100%;" appearance="fill">
<mat-label>Select System</mat-label>
<mat-select required [(ngModel)]="data.selectedValue" name="system">
......
......@@ -15,3 +15,17 @@
max-width: 750px;
margin: auto;
}
.form-control {
border: none;
border-radius: 5px;
padding: 10px;
font-size: 16px;
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.1);
outline: none;
transition: box-shadow 0.3s ease-in-out;
}
.form-control:focus {
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}
\ No newline at end of file
......@@ -10,7 +10,7 @@
<form class="form-group form-inline" ngNativeValidate>
<mat-form-field class="example-full-width">
<mat-label *ngIf="this.subjectsControl.value !=null">Subject :
{{this.subjectsControl.value.split(':')[0]}}:{{this.subjectsControl.value.split(':')[1]}}</mat-label>
{{this.subjectsControl.value.split(':')[0]}}:{{this.subjectsControl.value.split(':')[this.subjectsControl.value.split(':').length -2]}}</mat-label>
<input type="text" placeholder="Pick one" aria-label="Subject" matInput [formControl]="subjectsControl"
required [matAutocomplete]="automainsub" style="width: 100%;" (blur)="closed($event, this.subjectsControl)">
<mat-autocomplete autoActiveFirstOption #automainsub="matAutocomplete" showPanel="true"
......@@ -27,7 +27,7 @@
[ngStyle]="(stateitemControlisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<mat-form-field class="example-full-width">
<mat-label *ngIf="this.stateitemControl.value !=null">State or Item :
{{this.stateitemControl.value.split(':')[0]}}:{{this.stateitemControl.value.split(':')[1]}} </mat-label>
{{this.stateitemControl.value.split(':')[0]}}:{{this.stateitemControl.value.split(':')[this.stateitemControl.value.split(':').length -2]}} </mat-label>
<input type="text" placeholder="Pick one" aria-label="Number" matInput [formControl]="stateitemControl"
[matAutocomplete]="autostateitem" (blur)="closed($event, this.stateitemControl)">
<mat-autocomplete autoActiveFirstOption #autostateitem="matAutocomplete" showPanel="true"
......@@ -44,7 +44,7 @@
[ngStyle]="(statevalueControlisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<mat-form-field class="example-full-width">
<mat-label *ngIf="statevalueControl.value !=null">State Value :
{{this.statevalueControl.value.split(':')[0]}}:{{this.statevalueControl.value.split(':')[1]}}</mat-label>
{{this.statevalueControl.value.split(':')[0]}}:{{this.statevalueControl.value.split(':')[this.statevalueControl.value.split(':').length -2]}}</mat-label>
<input type="text" placeholder="Pick one" aria-label="StateValue" matInput [formControl]="statevalueControl"
[matAutocomplete]="autostatevalue" (blur)="closed($event, this.statevalueControl)">
<mat-autocomplete autoActiveFirstOption #autostatevalue="matAutocomplete" showPanel="true"
......@@ -58,7 +58,7 @@
</div>
</div>
<div class="form-row">
<div class="col" style="width: 100px;">
<div class="col" >
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label>Shall/shall not</mat-label>
......@@ -73,8 +73,7 @@
</form>
</div>
<div class="col">
<form class="form-group form-inline"
[ngStyle]="(verbControlisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label *ngIf="verbControl.value !=null">Verb :
{{this.verbControl.value.split(':')[0]}}:{{this.verbControl.value.split(':')[1]}}</mat-label>
......@@ -89,9 +88,8 @@
</mat-form-field>
</form>
</div>
<div class="col">
<form class="form-group form-inline"
[ngStyle]="(quantifierControlisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<div class="col" [ngStyle]="(quantifierControlisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}" >
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label *ngIf="quantifierControl.value !=null">Quantifier :
{{this.quantifierControl.value.split(':')[1]}}</mat-label>
......@@ -106,20 +104,16 @@
</mat-form-field>
</form>
</div>
<!--NUmber Value-->
<div class="form-row">
<div class="col">
<form class="form-group form-inline"
[ngStyle]="(numericalisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<div class="col" [ngStyle]="(numericalisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label>Numerical Value</mat-label>
<input type="text" matInput [(ngModel)]="currentmain.numerical" name="numerical">
</mat-form-field>
</form>
</div>
<div class="col">
<form class="form-group form-inline"
[ngStyle]="(numunitControlisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<div class="col" [ngStyle]="(numunitControlisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label>Number Unit</mat-label>
<input type="text" placeholder="Pick one" aria-label="Number" matInput [formControl]="numunitControl"
......@@ -134,14 +128,13 @@
</form>
</div>
</div>
</div>
<!-- <mat-label *ngIf=".value !=null">State or Item : {{.value.slice(0, .value.indexOf(':'))}}</mat-label> -->
<div class="form-row">
<div class="col">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label *ngIf="fifuintsysstatsetControl.value !=null">Object :
{{this.fifuintsysstatsetControl.value.split(':')[0]}}:{{this.fifuintsysstatsetControl.value.split(':')[1]}}
{{this.fifuintsysstatsetControl.value.split(':')[0]}}:{{this.fifuintsysstatsetControl.value.split(':')[this.fifuintsysstatsetControl.value.split(':').length -2]}}
</mat-label>
<input type="text" placeholder="Pick one" aria-label="Item" matInput
[formControl]="fifuintsysstatsetControl" required [matAutocomplete]="autofifuintsysstatset"
......@@ -155,12 +148,11 @@
</mat-form-field>
</form>
</div>
<div class="col">
<form class="form-group form-inline"
[ngStyle]="(stsysconsetControlisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<div class="col" [ngStyle]="(stsysconsetControlisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label *ngIf="stsysconsetControl.value !=null">StateSet or StateValue or System or Connection :
{{this.stsysconsetControl.value.split(':')[0]}}:{{this.stsysconsetControl.value.split(':')[1]}}
{{this.stsysconsetControl.value.split(':')[0]}}:{{this.stsysconsetControl.value.split(':')[this.stsysconsetControl.value.split(':').length -2]}}
</mat-label>
<input placeholder="Pick one" aria-label="stsysconset" type="text" matInput [formControl]="stsysconsetControl"
[matAutocomplete]="autostsysconset" (blur)="closed($event, this.stsysconsetControl)">
......
......@@ -106,39 +106,39 @@ export class MainDetailsComponent implements OnInit {
this.notifier = notifierService;
this.subjectsfilteredOptions = this.subjectsControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.subjects, value))
map(value => this._filter(this.subjects, value ? value : ''))
);
this.stateitemfilteredOptions = this.stateitemControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.stateitem, value))
map(value => this._filter(this.stateitem, value ? value : ''))
);
this.statevaluefilteredOptions = this.statevalueControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.statevalue, value))
map(value => this._filter(this.statevalue, value ? value : ''))
);
this.shallfilteredOptions = this.shallControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.shall, value))
map(value => this._filter(this.shall, value ? value : ''))
);
this.verbfilteredOptions = this.verbControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.verb, value))
map(value => this._filter(this.verb, value ? value : ''))
);
this.quantifierfilteredOptions = this.quantifierControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.quantifier, value))
map(value => this._filter(this.quantifier, value ? value : ''))
);
this.numunitfilteredOptions = this.numunitControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.numunit, value))
map(value => this._filter(this.numunit, value ? value : ''))
);
this.fifuintsysstatsetfilteredOptions = this.fifuintsysstatsetControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.fifuintsysstatset, value))
map(value => this._filter(this.fifuintsysstatset, value ? value : ''))
);
this.stsysconsetfilteredOptions = this.stsysconsetControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.stsysconset, value))
map(value => this._filter(this.stsysconset, value ? value : ''))
);
}
......@@ -266,8 +266,8 @@ export class MainDetailsComponent implements OnInit {
this.currentmain.shall = this.shallControl.value;
this.currentmain.verb = this.verbControl.value;
if (this.quantifierControlisDivVisible) { this.currentmain.quantifier = this.quantifierControl.value; } else { this.currentmain.quantifier = '' }
//num
if (this.numericalisDivVisible) { this.currentmain.mumerical_units = this.numunitControl.value; } else { this.currentmain.mumerical_units = '' }
if (!this.numericalisDivVisible) { this.currentmain.numerical = null }
if (this.numunitControlisDivVisible) { this.currentmain.mumerical_units = this.numunitControl.value; } else { this.currentmain.mumerical_units = '' }
this.currentmain.flow_function_interface_item_system_state_stateset = this.fifuintsysstatsetControl.value;
if (this.stsysconsetControlisDivVisible) { this.currentmain.statevalue_system_connection_stateset = this.stsysconsetControl.value; } else { this.currentmain.statevalue_system_connection_stateset = '' }
......
<div class="form-row">
<div class="form-row">
<div class="col">
<form class="form-group form-inline" ngNativeValidate>
<mat-form-field class="example-full-width">
......@@ -18,7 +18,7 @@
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label *ngIf="subjectsControl.value !=null">Subject :
{{this.subjectsControl.value.split(':')[0]}}:{{this.subjectsControl.value.split(':')[1]}}</mat-label>
{{this.subjectsControl.value.split(':')[0]}}:{{this.subjectsControl.value.split(':')[this.subjectsControl.value.split(':').length -2]}}</mat-label>
<input type="text" placeholder="Pick one" aria-label="SubC" matInput [formControl]="subjectsControl" required
[matAutocomplete]="autosub" (blur)="closed($event, this.subjectsControl)">
<mat-autocomplete autoActiveFirstOption #autosub="matAutocomplete" showPanel="true" [displayWith]="displayFn" panelWidth="string" panelWidth="string">
......@@ -29,8 +29,8 @@
</mat-form-field>
</form>
</div>
</div>
<div class="form-row">
</div>
<div class="form-row">
<div class="col">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
......@@ -62,18 +62,17 @@
</mat-form-field>
</form>
</div>
<div class="col">
<div class="col" [ngStyle]="(numericalisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<form class="form-group form-inline"
[ngStyle]="(numericalisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
>
<mat-form-field class="example-full-width">
<mat-label>Numerical Value</mat-label>
<input type="text" matInput [(ngModel)]="currentprefix.prefix_numerical" name="numerical">
</mat-form-field>
</form>
</div>
<div class="col">
<form class="form-group form-inline"
[ngStyle]="(numericalisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<div class="col" [ngStyle]="(numericalisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label>Number Unit</mat-label>
<input type="text" placeholder="Pick one" aria-label="PNumUnit" matInput
......@@ -87,14 +86,13 @@
</mat-form-field>
</form>
</div>
</div>
<div class="form-row">
</div>
<div class="form-row">
<div class="col">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label *ngIf="objectsControl.value !=null">Object :
{{this.objectsControl.value.split(':')[0]}}:{{this.objectsControl.value.split(':')[1]}}</mat-label>
{{this.objectsControl.value.split(':')[0]}}:{{this.objectsControl.value.split(':')[this.objectsControl.value.split(':').length -2]}}</mat-label>
<input type="text" placeholder="Pick one" aria-label="PreObj" matInput required [formControl]="objectsControl"
[matAutocomplete]="autobjects" (blur)="closed($event, this.objectsControl)">
<mat-autocomplete autoActiveFirstOption #autobjects="matAutocomplete" showPanel="true"
......@@ -107,12 +105,12 @@
</form>
</div>
<div class="col">
<form matTooltip="Under development" matTooltipPosition="right" class="form-group form-inline">
<fieldset disabled>
<form class="form-group form-inline">
<fieldset>
<mat-form-field class="example-full-width">
<mat-label>Logic connectivity</mat-label>
<input type="text" placeholder="Pick one" aria-label="PreLogic_c" matInput [formControl]="logic_conControl"
[matAutocomplete]="autolog_con" (blur)="closed($event, this.logic_conControl)">
[matAutocomplete]="autolog_con" >
<mat-autocomplete autoActiveFirstOption #autolog_con="matAutocomplete">
<mat-option *ngFor="let option of logic_confilteredOptions | async" [value]="option">
{{option}}
......@@ -122,12 +120,100 @@
</fieldset>
</form>
</div>
</div>
</div>
<!--EXTRA PREFIX-->
<div *ngIf="secondprefix">
<div class="form-row">
<div class="col">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label *ngIf="subjects2Control.value !=null">Subject :
{{this.subjects2Control.value.split(':')[0]}}:{{this.subjects2Control.value.split(':')[this.subjects2Control.value.split(':').length -2]}}</mat-label>
<input type="text" placeholder="Pick one" aria-label="SubC2" matInput [formControl]="subjects2Control" required
[matAutocomplete]="autosub2" (blur)="closed($event, this.subjects2Control)">
<mat-autocomplete autoActiveFirstOption #autosub2="matAutocomplete" showPanel="true" [displayWith]="displayFn" panelWidth="string" panelWidth="string">
<mat-option *ngFor="let option of subjects2filteredOptions | async" [value]="option">
{{option.split(" : ").pop()}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<div class="col">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label>Verb or State</mat-label>
<mat-label *ngIf="verbs2Control.value !=null">Subject : {{this.verbs2Control.value.split(':')[0]}}</mat-label>
<input type="text" placeholder="Pick one" aria-label="Verb" matInput required [formControl]="verbs2Control"
[matAutocomplete]="autoverb2" (blur)="closed($event, this.verbs2Control)">
<mat-autocomplete autoActiveFirstOption #autoverb2="matAutocomplete" showPanel="true" [displayWith]="displayFn" panelWidth="string">
<mat-option *ngFor="let option of verbs2filteredOptions | async" [value]="option">
{{option.split(" : ").pop()}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<div class="col" [ngStyle]="(numericalis2DivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label>Quantifier</mat-label>
<input placeholder="Pick one" aria-label="PrefixQ" matInput [formControl]="prefix_quantifier2Control" type="text"
[matAutocomplete]="autoprefix_quantifier2" (blur)="closed($event, this.prefix_quantifier2Control)">
<mat-autocomplete autoActiveFirstOption #autoprefix_quantifier2="matAutocomplete" showPanel="true"
[displayWith]="displayFn" panelWidth="string">
<mat-option *ngFor="let option of prefix_quantifier2filteredOptions | async" [value]="option">
{{option.split(" : ").pop()}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<div class="col" [ngStyle]="(numericalis2DivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label>Numerical Value</mat-label>
<!--ERROR-->
<input type="text" matInput [(ngModel)]="secondcurrentprefix.prefix_numerical" name="numerical2">
</mat-form-field>
</form>
</div>
<div class="col" [ngStyle]="(numericalis2DivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden', 'width':'0%'}">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label>Number Unit</mat-label>
<input type="text" placeholder="Pick one" aria-label="PNumUnit" matInput
[formControl]="prefix_mumerical2_unitsControl" [matAutocomplete]="autoprefix_mumerical_units2">
<mat-autocomplete autoActiveFirstOption #autoprefix_mumerical_units2="matAutocomplete" showPanel="true"
[displayWith]="displayFn" panelWidth="string" (blur)="closed($event, this.prefix_mumerical2_unitsControl)">
<mat-option *ngFor="let option of prefix_mumerical2_unitsfilteredOptions | async" [value]="option">
{{option.split(" : ").pop()}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
</div>
<div class="form-row">
<div class="col">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label *ngIf="objects2Control.value !=null">Object :
{{this.objects2Control.value.split(':')[0]}}:{{this.objects2Control.value.split(':')[this.objects2Control.value.split(':').length -2]}}</mat-label>
<input type="text" placeholder="Pick one" aria-label="PreObj2" matInput required [formControl]="objects2Control"
[matAutocomplete]="autobjects2" (blur)="closed($event, this.objects2Control)">
<mat-autocomplete autoActiveFirstOption #autobjects2="matAutocomplete" showPanel="true"
[displayWith]="displayFn" panelWidth="string">
<mat-option *ngFor="let option of objects2filteredOptions | async" [value]="option">
{{option.split(" : ").pop()}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
</div>
</div>
\ No newline at end of file
<!--
<ng-container *ngFor= "let prefix of simpleprefix">
<ul>
<li>{{prefix[1]}}</li>
</ul>
-->
\ No newline at end of file
......@@ -2,7 +2,7 @@
<div class="col">
<form class="form-group form-inline" ngNativeValidate>
<mat-form-field class="example-full-width">
<mat-label *ngIf="this.suffixControl.value !=null">Suffix : {{this.suffixControl.value.split(':')[0]}}:{{this.suffixControl.value.split(':')[1]}}</mat-label>
<mat-label *ngIf="this.suffixControl.value !=null">Suffix : {{this.suffixControl.value.split(':')[0]}}:{{this.suffixControl.value.split(':')[this.suffixControl.value.split(':').length -2]}}</mat-label>
<input type="text" placeholder="Pick one" aria-label="Suf" matInput [formControl]="suffixControl" required
[matAutocomplete]="autosuffix" (blur)="closed($event, this.suffixControl)">
<mat-autocomplete autoActiveFirstOption #autosuffix="matAutocomplete" showPanel="true"
......@@ -42,7 +42,7 @@
<form class="form-group form-inline"
[ngStyle]=" showflow(this.suffixControl.value) ? {'visibility': 'visible'} : {'visibility': 'hidden'}">
<mat-form-field class="example-full-width">
<mat-label *ngIf="flowControl.value !=null">Flow or Function : {{this.flowControl.value.split(':')[0]}}:{{this.flowControl.value.split(':')[1]}}</mat-label>
<mat-label *ngIf="flowControl.value !=null">Flow or Function : {{this.flowControl.value.split(':')[0]}}:{{this.flowControl.value.split(':')[this.flowControl.value.split(':').length -2]}}</mat-label>
<input type="text" placeholder="Pick one" aria-label="SufFlow" matInput [formControl]="flowControl" required
[matAutocomplete]="autoflow" (blur)="closed($event, this.flowControl)" >
<mat-autocomplete autoActiveFirstOption #autoflow="matAutocomplete" showPanel="true" [displayWith]="displayFn" panelWidth="string" panelWidth="string">
......
......@@ -49,15 +49,15 @@ export class SuffixDetailsComponent implements OnInit {
this.notifier = notifierService;
this.suffixfilteredOptions = this.suffixControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.suffix, value))
map(value => this._filter(this.suffix, value ? value : ''))
);
this.mumerical_unitsfilteredOptions = this.mumerical_unitsControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.mumerical_units, value))
map(value => this._filter(this.mumerical_units, value ? value : ''))
);
this.flowfilteredOptions = this.flowControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.flow, value))
map(value => this._filter(this.flow, value ? value : ''))
);
}
......
......@@ -38,6 +38,10 @@ export class BoilerplateService {
return this.http.put(`${baseUrlgb}${gb}${inferUrl}${id}/`, data);
}
getFileProperties (gb: any): Observable<any> {
return this.http.get(`${genericbaseUrl}`+`/propertydata/${gb}`, { responseType: "blob" });
}
getAll(gb: any): Observable<Boilerplate[]> {
//console.log(baseUrlgb + gb + baseUrl)
return this.http.get<Boilerplate[]>(baseUrlgb + gb + baseUrl);
......@@ -79,4 +83,8 @@ export class BoilerplateService {
return this.http.get(`${genericbaseUrl}`+`/getontology/${gb}`, { responseType: "blob" });
}
getProperties(gb: any, id: any): Observable<any> {
return this.http.get(`${baseUrlgb}${gb}`+`/boilerplates/${id}`+`/property/`);
}
}
......@@ -30,7 +30,6 @@ SIMPLE_PREFIX_CHOICES = ( ("",""),
LOGIC_CONNECTIVE = ( ("or","OR"),
("and", "AND"),
("xor", "XOR")
)
LOGICAL_EXPRESSION = ( ("",""),
......@@ -68,6 +67,7 @@ def create_prefixgroup(instance):
def create_prefix(instance):
prefix = Prefix(prefix_boilerplate = instance.boilerplate, prefixgroup = instance)
prefix.save()
create_extra_prefix(prefix, 'AND')
def create_data(instance):
......@@ -261,8 +261,9 @@ class Prefix(models.Model):
orig = '__original_%s' % field
previous_simple_prefix = getattr(self, orig)
prev_prefix_list.append(previous_simple_prefix)
if previous_simple_prefix == "" and not self.logic_connective == "" :
create_extra_prefix ( self, self.logic_connective)
print("DEBUG-------->",previous_simple_prefix)
#if previous_simple_prefix == "" and not self.logic_connective == "" :
# create_extra_prefix ( self, self.logic_connective)
class Meta:
......
......@@ -10,6 +10,7 @@ urlpatterns = [
path('users/<uuid:pk>/', user_views.UserDetail.as_view(), name='api-post-details'),
path('ontologies/', requirements_views.OntologiesChoicesViewSet.as_view(), name='api-get-ontologies'),
path('getontology/<int:groupboil>/', requirements_views.GetOntology.as_view(), name='get-current-ontology'),
path('propertydata/<int:groupboil>/', requirements_views.PropertyListAPIView.as_view(), name='api-property-list-data'),
path('groupboilerplates/', requirements_views.BoilerplateGroupCreateAPIView.as_view(), name='api-groupboilerplates-create'),
path('groupboilerplates/<int:pk>/', requirements_views.BoilerplateGroupDetailsAPIView.as_view(), name='api-groupboilerplates-list'),
......@@ -54,5 +55,8 @@ urlpatterns = [
#Search In Ontology
path('groupboilerplates/<int:groupboil>/search/<str:instance>/', main_req_views.SearchinOntologyAPIView.as_view(), name='setmainchoices'),
#Properties
path('groupboilerplates/<int:groupboil>/boilerplates/<int:boilerplate>/property/', requirements_views.ExtractedPropertyAPIView.as_view(), name='api-property-list'),
]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment