Commit e6c217cf authored by Thodoris Nestoridis's avatar Thodoris Nestoridis

ui fixes

parent 61c047f4
......@@ -4,7 +4,7 @@
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a routerLink="../../../../">Projects</a></li>
<li class="breadcrumb-item"><a routerLink="../../">Boilerplate List</a></li>
<li class="breadcrumb-item"><a routerLink="../../">Requirement List</a></li>
<li class="breadcrumb-item" aria-current="page">Edit Requirement</li>
</ol>
</nav>
......@@ -27,6 +27,7 @@
<form class="form-group form-inline ">
<mat-checkbox class="example-full-width"
[(ngModel)]="currentboilerplate.has_prefix"
(change)="this.updateBoilerplate()"
name="has_prefix"
>Prefix
</mat-checkbox>
......@@ -41,6 +42,7 @@
<mat-checkbox class="example-full-width"
[(ngModel)]="currentboilerplate.has_main"
name="has_prefix"
[disabled]="true"
>Main
</mat-checkbox>
</form>
......@@ -53,6 +55,7 @@
<form class="form-group form-inline ">
<mat-checkbox class="example-full-width"
[(ngModel)]="this.currentboilerplate.has_suffix"
(change)="this.updateBoilerplate()"
name="has_suffix"
>Suffix
</mat-checkbox>
......@@ -67,7 +70,7 @@
<input class="btn btn-success"
type="button"
value=" Update Boilerplate"
(click)="updateBoilerplate()"/>
(click)="updateDetailsOfBoilerplate()"/>
</div>
<div fxFlex fxLayout fxHide.xs fxLayoutAlign="end">
<input class="btn btn-warning"
......
......@@ -67,19 +67,24 @@ export class BoilerplateDetailsComponent implements OnInit {
}
updateBoilerplate(): any {
if (this.currentboilerplate.has_prefix){this.prefchild.updatePrefix()};
if (this.currentboilerplate.has_main){this.mainchild.updateMain();};
if (this.currentboilerplate.has_suffix){this.sufchild.updateSuffix();};
this.boilerplateService.update(this.route.snapshot.params.gb, this.currentboilerplate.id, this.currentboilerplate)
.subscribe(
response => {
this.notifier.notify("success",(JSON.stringify("Requirement " + this.currentboilerplate.title + " updated")));
//this.notifier.notify("success",(JSON.stringify("Requirement " + this.currentboilerplate.title + " updated")));
//this.router.navigate(['/groupboilerplates/'+this.route.snapshot.params.gb+'/boilerplates']);
if (this.currentboilerplate.has_prefix){this.prefchild.getAllPrefix(this.currentboilerplate.id)};
if (this.currentboilerplate.has_suffix){this.sufchild.getAllSuffix(this.currentboilerplate.id);};
},
error => {
this.notifier.notify("warning",(JSON.stringify(error)));
});
});}
updateDetailsOfBoilerplate(): any {
if (this.currentboilerplate.has_prefix){this.prefchild.updatePrefix()};
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")));
}
deleteBoilerplate(): void {
......
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a routerLink="../../">Projects</a></li>
<li class="breadcrumb-item" aria-current="page">Boilerplate List</li>
<li class="breadcrumb-item" aria-current="page">Requirement List</li>
</ol>
</nav>
<div class="list row">
......
......@@ -265,7 +265,7 @@ export class MainDetailsComponent implements OnInit {
this.message = response.message;
},
error => {
this.notifier.notify("warning",(JSON.stringify(error["error"])));
this.notifier.notify("warning",("MAIN " + JSON.stringify(error["error"])));
});}
......
......@@ -53,9 +53,9 @@
[formControl]="verbsControl"
[matAutocomplete]="autoverb"
>
<mat-autocomplete autoActiveFirstOption #autoverb="matAutocomplete">
<mat-autocomplete autoActiveFirstOption #autoverb="matAutocomplete" showPanel="true" [displayWith]="displayFn">
<mat-option *ngFor="let option of verbsfilteredOptions | async" [value]="option">
{{option}}
{{option.split(" : ").pop()}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
......
......@@ -146,7 +146,7 @@ export class PrefixDetailsComponent implements OnInit {
this.message = response.message;
},
error => {
this.notifier.notify("warning",(JSON.stringify(error["error"])));
this.notifier.notify("warning",("PREFIX "+JSON.stringify(error["error"])));
});}
}
......
......@@ -65,6 +65,7 @@ export class SuffixDetailsComponent implements OnInit {
this.getAllSuffix(this.route.snapshot.params.id);
}
displayFn(option:string): string {
if (option != null) {
let x = option.split(" : ");
......@@ -90,6 +91,7 @@ export class SuffixDetailsComponent implements OnInit {
for (var val of data) {
this.getSuffix(id, val.id);
SuffixDetailsComponent.id.push(val.id);
console.log(val.id)
}
},
error => {
......@@ -125,7 +127,7 @@ export class SuffixDetailsComponent implements OnInit {
this.message = response.message;
},
error => {
this.notifier.notify("warning",(JSON.stringify(error["error"])));
this.notifier.notify("warning",("SUFFIX "+JSON.stringify(error["error"])));
});}
}
......
......@@ -27,8 +27,7 @@ LOGICAL_EXPRESSION = ( ("",""),
("occuring functionality", "occuring functionality")
)
VERB_CHOICES = (("is","is"),("send","send"),("receive","receive"),
("ingest","ingest"),("emit","emit"),("perform","perform"))
VERB_CHOICES = get_verb_instances("LO#Verb")
PREFIX_CHOICES = ( ("If/Unless", "If/Unless"),
......
......@@ -170,9 +170,11 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView):
def perform_update(self, serializer):
instance = serializer.validated_data
#add data in thn Model BoilerplateData
print(instance)
es_instance = instance['system_fun_item'].rsplit(':', 1)
eo_instance = instance['item_function_flow_statevalue'].rsplit(':', 1)
pr = (instance['prefix'] + ' ' + es_instance[len(es_instance)-1] + ' ' + instance['state_or_verb'] + ' ' + eo_instance[len(eo_instance)-1])
ev_instance =instance['state_or_verb'].rsplit(':', 1)
ei_instance = instance['item_function_flow_statevalue'].rsplit(':', 1)
pr = (instance['prefix'] + ' ' + es_instance[len(es_instance)-1] + ' ' + ev_instance[len(ev_instance)-1] + ' ' + ei_instance[len(ei_instance)-1])
BoilerplateData.objects.filter(owner_data=instance['prefix_boilerplate'].owner, boilerplate_data_id = instance['prefix_boilerplate']).update(prefix_data = pr )
sprefix = self.simple_prefix(instance["prefix"])
serializer.save(simple_prefix = sprefix)
......
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