Skip to content

Commit

Permalink
fix(export): Sort attribute columns by ID and not name
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsvante committed Oct 31, 2024
1 parent 9d51fbc commit 9bf965d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/exports/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,22 +322,23 @@ impl ExportField {
.into(),
)],
Self::Attribute => {
let map = row
.style
.attributes
.iter()
.into_group_map_by(|&attr| attr.r#type.name.get_or_default(language));
let map = row.style.attributes.iter().into_group_map_by(|&attr| {
(attr.r#type.id, attr.r#type.name.get(Language::En))
});
map.into_iter()
.map(|(type_name, type_attrs)| {
.map(|((type_id, type_name), type_attrs)| {
(
type_name.into(),
type_id,
type_name,
type_attrs
.into_iter()
.map(|attr| attr.title.get_or_default(language).to_owned())
.collect_vec()
.into(),
)
})
.sorted()
.map(|(_type_id, type_name, attrs)| (type_name.into(), attrs))
.collect_vec()
}
}
Expand Down

0 comments on commit 9bf965d

Please sign in to comment.