diff --git a/src/app/data-explorer/query-builder-wrapper.service.ts b/src/app/data-explorer/query-builder-wrapper.service.ts index a5251f79..d2273c94 100644 --- a/src/app/data-explorer/query-builder-wrapper.service.ts +++ b/src/app/data-explorer/query-builder-wrapper.service.ts @@ -180,7 +180,7 @@ export class QueryBuilderWrapperService { name: enumValue.key, value: enumValue.value, }; - }); + }).sort((a, b) => a.value.localeCompare(b.value)); } return []; diff --git a/src/app/data-explorer/query-builder/query-builder.component.ts b/src/app/data-explorer/query-builder/query-builder.component.ts index 3510903f..372fa115 100644 --- a/src/app/data-explorer/query-builder/query-builder.component.ts +++ b/src/app/data-explorer/query-builder/query-builder.component.ts @@ -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)); } }