From 5c22f5da39baf5d584a6df2969231aa8aeb4c656 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 15 Oct 2026 05:12:46 +0200 Subject: [PATCH] Filter the tool shed user select from the loaded users SelectUser copied the user list into its options when it was set up, before GET /api/users returned, and only re-copied it for an empty filter. Typing a name into the select before the users arrived filtered the empty copy and never showed the user. test_frontend_push_access failed this way in both standalone tool shed jobs. The options are now computed from the users and the filter text. --- .../webapp/frontend/src/components/SelectUser.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/tool_shed/webapp/frontend/src/components/SelectUser.vue b/lib/tool_shed/webapp/frontend/src/components/SelectUser.vue index aa7739fce5c..fd4398ce67d 100644 --- a/lib/tool_shed/webapp/frontend/src/components/SelectUser.vue +++ b/lib/tool_shed/webapp/frontend/src/components/SelectUser.vue @@ -20,8 +20,11 @@ void usersStore.getAll() const { users } = storeToRefs(usersStore) -const allOptions = computed(() => users?.value.map((u) => u.username)) -const options = ref(allOptions.value) +const needle = ref("") +// Computed rather than copied on filter, so users loaded after the menu opened still show up. +const options = computed(() => + users.value.map((u) => u.username).filter((v) => v.toLocaleLowerCase().indexOf(needle.value) > -1), +) const selected = ref(null) const emit = defineEmits(["selectedUser", "cleared"]) @@ -39,11 +42,7 @@ watch(selected, (user) => { function filterFn(val: string, update: (cbFn: () => void) => void) { update(() => { - const needle = val.toLocaleLowerCase() - if (needle == "") { - options.value = allOptions.value - } - options.value = options.value.filter((v) => v.toLocaleLowerCase().indexOf(needle) > -1) + needle.value = val.toLocaleLowerCase() }) }