Commit a1aee450 authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Update instance config for documentation => DONE

parent caaf2c19
......@@ -22,6 +22,10 @@
<input class="form-check-input" type="checkbox" id="search_multiple" name="search_multiple" [ngModel]="getConfigSearchMultipleEnabled()">
<label class="form-check-label" for="search_multiple">Search multiple allowed</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="documentation" name="documentation" [ngModel]="getConfigDocumentationEnabled()">
<label class="form-check-label" for="documentation">Documentation allowed</label>
</div>
<div class="form-group pt-4">
<ng-content></ng-content>
......
......@@ -26,12 +26,20 @@ export class FormInstanceComponent {
return false;
}
getConfigDocumentationEnabled(): boolean {
if (this.model.config && this.model.config.documentation) {
return this.model.config.documentation;
}
return false;
}
emit(instance: Instance) {
let instanceEmitted: Instance;
(this.model.name) ? instanceEmitted = {name: this.model.name, ...instance} : instanceEmitted = instance;
instanceEmitted.config = {
search: this.ngForm.form.value.search,
search_multiple: this.ngForm.value.search_multiple
search_multiple: this.ngForm.value.search_multiple,
documentation: this.ngForm.value.documentation
};
this.submitted.emit(instanceEmitted);
}
......
......@@ -5,5 +5,6 @@ export class Instance {
config: {
search: boolean;
search_multiple: boolean;
documentation: boolean;
};
}
Supports Markdown
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