Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
anis
anis-admin
Commits
caaf2c19
Commit
caaf2c19
authored
Oct 06, 2020
by
Tifenn Guillas
Browse files
Update instance config => DONE
parent
8a067f9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/app/metamodel/components/instance/form-instance.component.html
View file @
caaf2c19
...
...
@@ -12,18 +12,18 @@
<input
id=
"client_url"
type=
"text"
class=
"form-control"
name=
"client_url"
[ngModel]=
"model.client_url"
#clientUrl
="
ngModel
"
>
</div>
<hr>
<hr
class=
"mt-4"
>
<h4>
Search:
</h4>
<div
class=
"form-check"
>
<input
class=
"form-check-input"
type=
"checkbox"
id=
"search
_enabled
"
name=
"search
_enabled
"
[ngModel]=
"getConfigSearchEnabled()"
>
<label
class=
"form-check-label"
for=
"search
_enabled
"
>
Classic search allowed
</label>
<input
class=
"form-check-input"
type=
"checkbox"
id=
"search"
name=
"search"
[ngModel]=
"getConfigSearchEnabled()"
>
<label
class=
"form-check-label"
for=
"search"
>
Classic search allowed
</label>
</div>
<div
class=
"form-check"
>
<input
class=
"form-check-input"
type=
"checkbox"
id=
"search_multiple
_enabled
"
name=
"search_multiple
_enabled
"
[ngModel]=
"getConfigSearchMultipleEnabled()"
>
<label
class=
"form-check-label"
for=
"search_multiple
_enabled
"
>
Search multiple allowed
</label>
<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-group"
>
<div
class=
"form-group
pt-4
"
>
<ng-content></ng-content>
</div>
</form>
src/app/metamodel/components/instance/form-instance.component.ts
View file @
caaf2c19
...
...
@@ -13,37 +13,26 @@ export class FormInstanceComponent {
@
Output
()
submitted
:
EventEmitter
<
Instance
>
=
new
EventEmitter
();
getConfigSearchEnabled
():
boolean
{
//
if (this.model.config && this.model.config.search) {
//
return this.model.config.search
.enabled
;
//
}
if
(
this
.
model
.
config
&&
this
.
model
.
config
.
search
)
{
return
this
.
model
.
config
.
search
;
}
return
false
;
}
getConfigSearchMultipleEnabled
():
boolean
{
//
if (this.model.config && this.model.config.search_multiple) {
//
return this.model.config.search_multiple
.enabled
;
//
}
if
(
this
.
model
.
config
&&
this
.
model
.
config
.
search_multiple
)
{
return
this
.
model
.
config
.
search_multiple
;
}
return
false
;
}
emit
(
instance
:
Instance
)
{
// datasetEmitted.config = {
// search: {
// enabled: this.ngForm.form.value.search_enabled,
// display_results_server_link: this.ngForm.form.value.results_server_link,
// opened_datatable: this.ngForm.form.value.opened_datatable
// },
// search_multiple: {
// enabled: this.ngForm.value.search_multiple_enabled
// },
// cone_search: {
// enabled: this.ngForm.form.value.cone_search,
// column_ra: this.ngForm.form.value.column_ra,
// column_dec: this.ngForm.form.value.column_dec
// }
// };
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
};
this
.
submitted
.
emit
(
instanceEmitted
);
}
}
src/app/metamodel/store/model/instance.model.ts
View file @
caaf2c19
...
...
@@ -2,4 +2,8 @@ export class Instance {
name
:
string
;
label
:
string
;
client_url
:
string
;
config
:
{
search
:
boolean
;
search_multiple
:
boolean
;
};
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment