Skip to content

Commit 22cb968

Browse files
[8.x] [APM][UI] Sort environment dropdown alphabetically (elastic#217710) (elastic#217878)
# Backport This will backport the following commits from `main` to `8.x`: - [[APM][UI] Sort environment dropdown alphabetically (elastic#217710)](elastic#217710) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Milosz Marcinkowski","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-04-10T15:38:20Z","message":"[APM][UI] Sort environment dropdown alphabetically (elastic#217710)\n\nCloses elastic#217814\n\n### Summary\n\nSort environment list alphabetically.\n\n|Before|After|\n|-|-|\n|<img width=\"1724\" alt=\"Screenshot 2025-04-10 at 12 01 15\"\nsrc=\"https://github.com/user-attachments/assets/53f0b66d-146a-45d9-b4e3-25bde350a263\"\n/>|<img width=\"1722\" alt=\"Screenshot 2025-04-10 at 11 58 27\"\nsrc=\"https://github.com/user-attachments/assets/91315d23-801c-4a16-8688-c43d60c389c8\"\n/>|","sha":"23cbaa6d55de4e331ce180f6857db94ca11c209a","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-major","Team:obs-ux-infra_services","v9.1.0"],"title":"[APM][UI] Sort environment dropdown alphabetically","number":217710,"url":"https://github.com/elastic/kibana/pull/217710","mergeCommit":{"message":"[APM][UI] Sort environment dropdown alphabetically (elastic#217710)\n\nCloses elastic#217814\n\n### Summary\n\nSort environment list alphabetically.\n\n|Before|After|\n|-|-|\n|<img width=\"1724\" alt=\"Screenshot 2025-04-10 at 12 01 15\"\nsrc=\"https://github.com/user-attachments/assets/53f0b66d-146a-45d9-b4e3-25bde350a263\"\n/>|<img width=\"1722\" alt=\"Screenshot 2025-04-10 at 11 58 27\"\nsrc=\"https://github.com/user-attachments/assets/91315d23-801c-4a16-8688-c43d60c389c8\"\n/>|","sha":"23cbaa6d55de4e331ce180f6857db94ca11c209a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/217710","number":217710,"mergeCommit":{"message":"[APM][UI] Sort environment dropdown alphabetically (elastic#217710)\n\nCloses elastic#217814\n\n### Summary\n\nSort environment list alphabetically.\n\n|Before|After|\n|-|-|\n|<img width=\"1724\" alt=\"Screenshot 2025-04-10 at 12 01 15\"\nsrc=\"https://github.com/user-attachments/assets/53f0b66d-146a-45d9-b4e3-25bde350a263\"\n/>|<img width=\"1722\" alt=\"Screenshot 2025-04-10 at 11 58 27\"\nsrc=\"https://github.com/user-attachments/assets/91315d23-801c-4a16-8688-c43d60c389c8\"\n/>|","sha":"23cbaa6d55de4e331ce180f6857db94ca11c209a"}}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <[email protected]>
1 parent 6a4bc18 commit 22cb968

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

x-pack/solutions/observability/plugins/apm/server/routes/environments/get_environments.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export async function getEnvironments({
5555
terms: {
5656
field: SERVICE_ENVIRONMENT,
5757
missing: ENVIRONMENT_NOT_DEFINED.value,
58+
order: { _key: 'asc' as const },
5859
size,
5960
},
6061
},

x-pack/solutions/observability/plugins/apm/server/routes/suggestions/get_suggestions_with_terms_aggregation.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ export async function getSuggestionsWithTermsAggregation({
5252
},
5353
aggs: {
5454
items: {
55-
terms: { field: fieldName, size },
55+
terms: {
56+
field: fieldName,
57+
size,
58+
order: { _key: 'asc' as const },
59+
},
5660
},
5761
},
5862
},

x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/environment/get_environment.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ export default function environmentsAPITests({ getService }: DeploymentAgnosticF
104104
expect(body.environments.length).to.be.equal(4);
105105
expectSnapshot(body.environments).toMatchInline(`
106106
Array [
107+
"custom-go-environment",
107108
"development",
108109
"production",
109110
"staging",
110-
"custom-go-environment",
111111
]
112112
`);
113113
});

0 commit comments

Comments
 (0)