Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions server/covmanager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ def tools_search_api(request):

if "name" in request.GET:
name = request.GET["name"]
results = Tool.objects.filter(name__contains=name).values_list(
results = Tool.objects.filter(name__icontains=name).values_list(
"name", flat=True
)

Expand Down Expand Up @@ -669,15 +669,15 @@ def filter_queryset(self, request, queryset, view):

filters = {}
exactFilterKeys = [
"description__contains",
"description__icontains",
"repository__name",
"repository__name__contains",
"repository__name__icontains",
"revision",
"revision__contains",
"revision__icontains",
"branch",
"branch__contains",
"branch__icontains",
"tools__name",
"tools__name__contains",
"tools__name__icontains",
]

for key in exactFilterKeys:
Expand Down
15 changes: 9 additions & 6 deletions server/frontend/src/components/Covmanager/Collections.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ export default defineComponent({
search_initialized: false,

search: {
branch: { value: "", contains: true },
description: { value: "", contains: true },
repository: { value: "", contains: true, postfix: "__name" },
revision: { value: "", contains: true },
tools: { value: "", contains: true, postfix: "__name" },
branch: { value: "", icontains: true },
description: { value: "", icontains: true },
repository: { value: "", icontains: true, postfix: "__name" },
revision: { value: "", icontains: true },
tools: { value: "", icontains: true, postfix: "__name" },
limit: { value: "10", contains: false },
},

Expand Down Expand Up @@ -281,6 +281,7 @@ export default defineComponent({
// TODO: This is a shortcut that saves us iterating through this.search
// for every key that we are trying to map to a field in our search
// object, but this won't work once we have more postfixes.
k = k.replace(/__icontains$/, "");
k = k.replace(/__contains$/, "");
k = k.replace(/__name$/, "");

Expand All @@ -304,7 +305,9 @@ export default defineComponent({
k += obj.postfix;
}

if ("contains" in obj && obj.contains) {
if ("icontains" in obj && obj.icontains) {
k += "__icontains";
} else if ("contains" in obj && obj.contains) {
k += "__contains";
}

Expand Down