Skip to content

Commit

Permalink
fix(catalogue): fix sorting of sources in variable harmonization deta…
Browse files Browse the repository at this point in the history
…ils view

Closes #4792
  • Loading branch information
connoratrug authored Mar 7, 2025
1 parent 1982287 commit 88dce94
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ const relevantMappings = computed(() =>
)
);
const sourceIds = computed(() => [
...new Set(relevantMappings.value?.map((mapping) => mapping.source.id)),
...new Set(
relevantMappings.value
?.map((mapping) => mapping.source.id)
.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()))
),
]);
const repeats = computed(() => {
const min = props.variable.repeatMin | 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ let activeVariablePath = computed(() =>
<HarmonisationLegendMatrix size="small" />
<div class="overflow-x-auto xl:max-w-table border-t">
<TableSticky
:columns="resources"
:columns="
resources.sort((a, b) =>
a.id.toLowerCase().localeCompare(b.id.toLowerCase())
)
"
:rows="variables"
class="h-screen overflow-auto"
>
Expand Down
8 changes: 6 additions & 2 deletions apps/catalogue/components/harmonisation/VariableDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ const relevantMappings = computed(() =>
)
);
const sourceIds = computed(() => [
...new Set(relevantMappings.value?.map((m) => m.source.id)),
...new Set(
relevantMappings.value
?.map((m) => m.source.id)
.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()))
),
]);
const activeSource = computed(() => sourceIds.value[activeTabIndex.value]);
const activeMappings = computed(() =>
relevantMappings.value
?.filter((m) => m.source.id === activeSource.value)
.sort((a, b) => a.repeats - b.repeats)
.sort((a, b) => Number(a.repeats) - Number(b.repeats))
);
let activeVariableUsedKey = ref();
let showSidePanel = computed(() => activeVariableUsedKey.value?.name);
Expand Down

0 comments on commit 88dce94

Please sign in to comment.