From 771b7a72e262e8382d7f081d02692fb16454fa5a Mon Sep 17 00:00:00 2001 From: darrickw Date: Wed, 7 Aug 2024 10:15:22 -0600 Subject: [PATCH 1/2] add sort filter for dropdown items and fix default limit of 10 --- app/javascript/components/components/AddComponentModal.vue | 1 + app/javascript/components/project/Project.vue | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/javascript/components/components/AddComponentModal.vue b/app/javascript/components/components/AddComponentModal.vue index f9417af2..f915a26b 100644 --- a/app/javascript/components/components/AddComponentModal.vue +++ b/app/javascript/components/components/AddComponentModal.vue @@ -35,6 +35,7 @@ v-model="search" :list="addDisplayNameToComponents(available_components)" :filter-by-query="true" + :max-suggestions="0" value-attribute="id" display-attribute="displayed" placeholder="Search for a component by name..." diff --git a/app/javascript/components/project/Project.vue b/app/javascript/components/project/Project.vue index 5b6390bb..b688358c 100644 --- a/app/javascript/components/project/Project.vue +++ b/app/javascript/components/project/Project.vue @@ -389,7 +389,7 @@ export default { }); }, sortedAvailableComponents: function () { - return _.sortBy(this.project.available_components, ["child_project_name"], ["asc"]); + return _.sortBy(this.project.available_components, [(component) => component.name.toLowerCase(), "version", "release"], ["asc"]); }, uniqueComponentNames: function () { return _.uniq(this.sortedComponents().map((c) => c["name"])); From dab66699c5411ff14804ff66a8a59fed0fa94367 Mon Sep 17 00:00:00 2001 From: darrickw Date: Wed, 7 Aug 2024 11:11:16 -0600 Subject: [PATCH 2/2] fix linting issue --- app/javascript/components/project/Project.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/javascript/components/project/Project.vue b/app/javascript/components/project/Project.vue index b688358c..586c0f50 100644 --- a/app/javascript/components/project/Project.vue +++ b/app/javascript/components/project/Project.vue @@ -389,7 +389,11 @@ export default { }); }, sortedAvailableComponents: function () { - return _.sortBy(this.project.available_components, [(component) => component.name.toLowerCase(), "version", "release"], ["asc"]); + return _.sortBy( + this.project.available_components, + [(component) => component.name.toLowerCase(), "version", "release"], + ["asc"] + ); }, uniqueComponentNames: function () { return _.uniq(this.sortedComponents().map((c) => c["name"]));