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-client
Commits
dbb36812
Commit
dbb36812
authored
Oct 15, 2020
by
Tifenn Guillas
Browse files
Attribute Lists sorted by id => DONE
parent
518d4232
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/app/documentation/containers/documentation.component.spec.ts
View file @
dbb36812
...
...
@@ -50,10 +50,13 @@ describe('[Documentation] Component: DocumentationComponent', () => {
expect
(
component
.
getHost
()).
toEqual
(
environment
.
apiUrl
);
});
it
(
'
#getAttributeList() should return attributes for selected dataset
'
,
()
=>
{
it
(
'
#getAttributeList() should return attributes for selected dataset
, sorted by id
'
,
()
=>
{
const
attributeLists
:
Dictionary
<
AttributesByDataset
>
=
{
'
toto
'
:
{
datasetName
:
'
toto
'
,
isLoading
:
false
,
isLoaded
:
true
,
attributeList
:
ATTRIBUTE_LIST
}
};
expect
(
component
.
getAttributeList
(
'
toto
'
,
attributeLists
)).
toEqual
(
ATTRIBUTE_LIST
);
const
attributeList
=
component
.
getAttributeList
(
'
toto
'
,
attributeLists
);
expect
(
attributeList
.
length
).
toEqual
(
2
);
expect
(
attributeList
[
0
].
id
).
toEqual
(
1
);
expect
(
attributeList
[
1
].
id
).
toEqual
(
2
);
});
});
src/app/documentation/containers/documentation.component.ts
View file @
dbb36812
...
...
@@ -44,6 +44,6 @@ export class DocumentationComponent implements OnInit {
}
getAttributeList
(
dname
:
string
,
attributesLists
:
Dictionary
<
AttributesByDataset
>
):
Attribute
[]
{
return
attributesLists
[
dname
].
attributeList
;
return
[...
attributesLists
[
dname
].
attributeList
].
sort
((
a
,
b
)
=>
a
.
id
-
b
.
id
)
;
}
}
src/settings/test-data/attribute-list.ts
View file @
dbb36812
import
{
Attribute
,
Option
}
from
'
../../app/metamodel/model
'
;
export
const
ATTRIBUTE_LIST
:
Attribute
[]
=
[
{
id
:
2
,
name
:
'
name_two
'
,
table_name
:
'
table_2
'
,
label
:
'
label_two
'
,
form_label
:
'
form_label_two
'
,
description
:
'
description_two
'
,
output_display
:
1
,
criteria_display
:
1
,
search_flag
:
'
SPECTRUM_1D
'
,
search_type
:
'
field
'
,
operator
:
'
=
'
,
type
:
''
,
min
:
null
,
max
:
null
,
placeholder_min
:
''
,
placeholder_max
:
''
,
renderer
:
''
,
renderer_config
:
null
,
display_detail
:
1
,
selected
:
true
,
order_by
:
true
,
order_display
:
1
,
detail
:
true
,
renderer_detail
:
'
spectra_graph
'
,
options
:
null
,
vo_utype
:
''
,
vo_ucd
:
''
,
vo_unit
:
''
,
vo_description
:
''
,
vo_datatype
:
''
,
vo_size
:
1
,
id_criteria_family
:
2
,
id_output_category
:
2
},
{
id
:
1
,
name
:
'
name_one
'
,
...
...
@@ -39,40 +74,5 @@ export const ATTRIBUTE_LIST: Attribute[] = [
vo_size
:
1
,
id_criteria_family
:
1
,
id_output_category
:
1
},
{
id
:
2
,
name
:
'
name_two
'
,
table_name
:
'
table_2
'
,
label
:
'
label_two
'
,
form_label
:
'
form_label_two
'
,
description
:
'
description_two
'
,
output_display
:
1
,
criteria_display
:
1
,
search_flag
:
'
SPECTRUM_1D
'
,
search_type
:
'
field
'
,
operator
:
'
=
'
,
type
:
''
,
min
:
null
,
max
:
null
,
placeholder_min
:
''
,
placeholder_max
:
''
,
renderer
:
''
,
renderer_config
:
null
,
display_detail
:
1
,
selected
:
true
,
order_by
:
true
,
order_display
:
1
,
detail
:
true
,
renderer_detail
:
'
spectra_graph
'
,
options
:
null
,
vo_utype
:
''
,
vo_ucd
:
''
,
vo_unit
:
''
,
vo_description
:
''
,
vo_datatype
:
''
,
vo_size
:
1
,
id_criteria_family
:
2
,
id_output_category
:
2
}
];
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