Skip to content
Merged
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
3 changes: 2 additions & 1 deletion ui/src/tag/suggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ export const useSuggest = (
const valueResult = useQuery<SuggestTagValue, SuggestTagValueVariables>(gqlTags.SuggestTagValue, {
variables: {tag: tagKey, query: tagValue},
skip: exactMatch === undefined || skipValue,
fetchPolicy: 'no-cache',
});

const usedKeys = usedTags.map((t) => t.tag.key);
const usedValues = usedTags.map((t) => t.value);

if (exactMatch && tagValue !== undefined && !skipValue && (allowDuplicateKeys || usedKeys.indexOf(exactMatch.key) === -1)) {
const usedValues = usedTags.filter((t) => t.tag.key === tagKey).map((t) => t.value);
return suggestTagValue(exactMatch, tagValue, valueResult, usedValues, createTags);
} else {
return suggestTag(exactMatch, tagResult, tagKey, usedKeys, allowDuplicateKeys, createTags);
Expand Down
Loading