Skip to content

Commit

Permalink
Sort query builder dropdowns alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-crawford committed Oct 16, 2024
1 parent 33dc9fc commit 51d63f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/data-explorer/query-builder-wrapper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class QueryBuilderWrapperService {
// We need to store contextual information with the field to track which model refers to this field.
// Unfortunately, a Field object has no available property to hold this info, so re-use the Options[]
// array as a rudimentary way of storing additional data
return mapModelDataTypeToOptionsArray(dataElement.dataType);
return mapModelDataTypeToOptionsArray(dataElement.dataType)
}

if (dataElement.dataType?.enumerationValues) {
Expand All @@ -180,7 +180,7 @@ export class QueryBuilderWrapperService {
name: enumValue.key,
value: enumValue.value,
};
});
}).sort((a, b) => a.value.localeCompare(b.value));
}

return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,9 @@ export class QueryBuilderComponent
if (this.entities && entity) {
return this.fields?.filter((field) => {
return field && field.entity === entity;
});
}).sort((a, b) => a.name.localeCompare(b.name));
} else {
return this.fields;
return this.fields?.sort((a, b) => a.name.localeCompare(b.name));
}
}

Expand Down

0 comments on commit 51d63f6

Please sign in to comment.