autocomplete: fix labels for static metatags.

When completing a static metatag, such as rating: or order:,
don't include the metatag name in the autocomplete menu.

For example, when completing `rating:g`, show `general` in the
autocomplete menu, not `rating:general`.

This makes static metatags consistent with other metatags.
This commit is contained in:
evazion
2022-09-02 00:28:28 -05:00
parent 6b6c452ea2
commit 6235965da0

View File

@@ -270,7 +270,7 @@ class AutocompleteService
results = values.select { |v| v.starts_with?(value.downcase) }.sort.take(limit)
results.map do |v|
{ label: metatag + ":" + v, value: v }
{ type: "static", label: v, value: v }
end
end