Skip to content

Commit 6bcad7c

Browse files
committed
chore(edit): alphabetized group list in edit modal
1 parent 6ce8133 commit 6bcad7c

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/app/components/body/variables/data/table/modal/edit/edit.component.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,15 @@ export class EditComponent {
5151
}>();
5252
allGroups = input.required<{ [groupID: string]: VariableGroup }>();
5353
allGroupsArray = computed(() => {
54-
return Object.keys(this.allGroups());
54+
const groups = Object.keys(this.allGroups());
55+
const alphabetizedGroups = groups.sort((a, b) => {
56+
const labelA = this.allGroups()[a].labl;
57+
const labelB = this.allGroups()[b].labl;
58+
return labelA.localeCompare(labelB);
59+
});
60+
return alphabetizedGroups;
5561
});
5662
decodedVariableGroups = computed(() => {
57-
// console.log(this.variableGroups());
5863
const varGroups: string[] = [];
5964
Object.values(this.allGroups()).map((group) => {
6065
varGroups.push(group.labl);

0 commit comments

Comments
 (0)