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
web-et-numerique
web-et-numerique-internet
data.grandlyon.com
web-portal
components
custom-apps
web-app
Commits
c296d483
Commit
c296d483
authored
Jan 04, 2021
by
Dimitri DI GUSTO
Browse files
Merge branch 'DOS0075412' into 'master'
DOS0075412 See merge request
!111
parents
f6f7627b
a9f1c73a
Pipeline
#9856
passed with stage
in 8 minutes and 47 seconds
Changes
6
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
package.json
View file @
c296d483
{
"name"
:
"webapp"
,
"version"
:
"2.6.1
2
"
,
"version"
:
"2.6.1
3
"
,
"license"
:
"GNU Affero General Public License v3.0"
,
"scripts"
:
{
"ng"
:
"ng"
,
...
...
src/app/dataset-detail/components/dataset-table/dataset-table.component.html
View file @
c296d483
...
...
@@ -6,10 +6,10 @@
(keydown.enter)=
"sortBy(key)"
[tabindex]=
"isDisplayed ? 0 : -1"
[attr.role]=
"'columnheader'"
>
<span
class=
"sort-icons"
>
<span
class=
"icon"
>
<i
class=
"fas fa-sort-up"
[ngClass]=
"{'icon-red': sortValue
===
key && sortOrder === 'desc'}"
></i>
<i
class=
"fas fa-sort-up"
[ngClass]=
"{'icon-red': sortValue
.includes(
key
)
&& sortOrder === 'desc'}"
></i>
</span>
<span
class=
"icon"
>
<i
class=
"fas fa-sort-down"
[ngClass]=
"{'icon-red': sortValue
===
key && sortOrder === 'asc'}"
></i>
<i
class=
"fas fa-sort-down"
[ngClass]=
"{'icon-red': sortValue
.includes(
key
)
&& sortOrder === 'asc'}"
></i>
</span>
</span>
<span
class=
"column-title"
[ngClass]=
"{'active': sortValue === key}"
>
{{ key }}
</span>
...
...
src/app/dataset-detail/components/dataset-table/dataset-table.component.ts
View file @
c296d483
...
...
@@ -96,8 +96,9 @@ export class DatasetTableComponent implements OnInit, OnDestroy {
}
sortBy
(
key
:
string
)
{
const
keyType
=
this
.
_datasetDetailService
.
getKeyType
(
key
);
// Set the new sort value in the service
this
.
_datasetDetailService
.
sortBy
(
key
);
this
.
_datasetDetailService
.
sortBy
(
key
Type
);
// Retrieve date sorted with the new value
this
.
_datasetDetailService
.
retrieveDatasetData
().
subscribe
(()
=>
{
this
.
tableWidthModified
.
emit
(
true
);
...
...
@@ -124,8 +125,9 @@ export class DatasetTableComponent implements OnInit, OnDestroy {
return
this
.
_datasetDetailService
.
datasetData
;
}
get
sortValue
()
{
return
this
.
_datasetDetailService
.
sortValue
;
get
sortValue
():
String
{
var
sortValue
:
String
=
this
.
_datasetDetailService
.
sortValue
;
return
sortValue
?
sortValue
:
''
;
}
get
sortOrder
()
{
...
...
src/app/dataset-detail/services/dataset-detail.service.ts
View file @
c296d483
...
...
@@ -272,11 +272,22 @@ export class DatasetDetailService {
}
}
getKeyType
(
key
:
string
)
{
return
key
+
'
_
'
+
eval
(
`this._dataset.fields.types.
${
key
}
`
);
}
orderProperties
(
data
:
any
,
orderedProperties
:
string
[])
{
const
newDataPropertiesOrder
=
{};
orderedProperties
.
forEach
((
field
)
=>
{
newDataPropertiesOrder
[
field
]
=
data
.
properties
[
field
]
?
data
.
properties
[
field
]
:
''
;
// Adds type to field. First time, the field with type is used, and attributed to field without type
// force _json detection since the fieldtype is not listed. (used for complex data)
var
fieldtype
=
field
+
'
_
'
+
eval
(
`this._dataset.fields.types.
${
field
}
`
);
newDataPropertiesOrder
[
field
]
=
data
.
properties
[
fieldtype
]
?
data
.
properties
[
fieldtype
]
:
data
.
properties
[
field
]
?
data
.
properties
[
field
]
:
data
.
properties
[
`
${
field
}
_json`
]
?
data
.
properties
[
`
${
field
}
_json`
]
:
''
;
});
data
.
properties
=
newDataPropertiesOrder
;
}
...
...
src/app/elasticsearch/services/elasticsearch.service.ts
View file @
c296d483
...
...
@@ -135,7 +135,10 @@ export class ElasticsearchService {
if
(
options
.
sortOptions
.
value
!==
null
)
{
const
sort
=
{};
const
key
=
`data-fr.properties.
${
options
.
sortOptions
.
value
}
.sort`
;
sort
[
key
]
=
options
.
sortOptions
.
order
;
sort
[
key
]
=
{
order
:
options
.
sortOptions
.
order
,
unmapped_type
:
'
string
'
};
body
[
'
sort
'
]
=
[
sort
];
}
...
...
src/app/shared/models/data.model.ts
View file @
c296d483
...
...
@@ -20,7 +20,7 @@ export class Data implements IData {
this
.
geometry
=
data
.
geometry
;
this
.
type
=
data
.
type
;
this
.
properties
=
data
.
properties
;
this
.
id
=
data
.
properties
.
gid
;
this
.
id
=
data
.
properties
.
gid
?
data
.
properties
.
gid
:
data
.
properties
.
gid_int
;
}
}
}
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