Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
urgi-is
data-discovery
Commits
4729a703
Commit
4729a703
authored
Aug 07, 2018
by
Exbrayat Cédric
Browse files
fix: do not deactivate aggregations with a single option
Fixes
#5
parent
5bd63bb5
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/src/app/aggregation/small-aggregation.component.spec.ts
View file @
4729a703
...
...
@@ -111,21 +111,6 @@ describe('SmallAggregationComponent', () => {
expect
(
component
.
aggregationForm
.
get
(
'
France
'
).
value
).
toBeTruthy
();
});
it
(
'
should build a form and disable the unique criteria
'
,
()
=>
{
// given an aggregation with a bucket and a unique value
const
component
=
new
SmallAggregationComponent
();
component
.
aggregation
=
toAggregation
(
'
coo
'
,
[
'
France
'
]);
// when initializing the component
component
.
ngOnInit
();
// then it should have a form with one disabled field
const
controls
=
component
.
aggregationForm
.
controls
;
expect
(
Object
.
keys
(
controls
)).
toEqual
([
'
France
'
]);
// and France should be disabled
expect
(
component
.
aggregationForm
.
get
(
'
France
'
).
disable
).
toBeTruthy
();
});
it
(
'
should emit an event when a checkbox is toggled
'
,
fakeAsync
(()
=>
{
const
tester
=
new
SmallAggregationComponentTester
();
...
...
frontend/src/app/aggregation/small-aggregation.component.ts
View file @
4729a703
...
...
@@ -43,10 +43,6 @@ export class SmallAggregationComponent implements OnInit {
}
this
.
aggregationForm
.
addControl
(
bucket
.
key
,
control
);
});
// disable if only one bucket
if
(
buckets
.
length
===
1
)
{
this
.
aggregationForm
.
disable
();
}
// subscribe to form changes
// to emit a new event every time a value changes
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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