diff --git a/public/app/core/components/TagFilter/TagFilter.tsx b/public/app/core/components/TagFilter/TagFilter.tsx index f57342ff48d..e72ee56a1fb 100644 --- a/public/app/core/components/TagFilter/TagFilter.tsx +++ b/public/app/core/components/TagFilter/TagFilter.tsx @@ -15,6 +15,7 @@ export interface TermCount { export interface Props { allowCustomValue?: boolean; + formatCreateLabel?: (input: string) => string; /** Do not show selected values inside Select. Useful when the values need to be shown in some other components */ hideValues?: boolean; inputId?: string; @@ -33,6 +34,7 @@ const filterOption = (option: any, searchQuery: string) => { export const TagFilter: FC = ({ allowCustomValue = false, + formatCreateLabel, hideValues, inputId, isClearable, @@ -65,6 +67,7 @@ export const TagFilter: FC = ({ const selectOptions = { allowCustomValue, + formatCreateLabel, defaultOptions: true, filterOption, getOptionLabel: (i: any) => i.label, diff --git a/public/app/plugins/datasource/grafana/components/AnnotationQueryEditor.tsx b/public/app/plugins/datasource/grafana/components/AnnotationQueryEditor.tsx index ff1ee696762..ab71638c92e 100644 --- a/public/app/plugins/datasource/grafana/components/AnnotationQueryEditor.tsx +++ b/public/app/plugins/datasource/grafana/components/AnnotationQueryEditor.tsx @@ -65,6 +65,8 @@ export default function AnnotationQueryEditor({ query, onChange }: Props) { tags, }); + const onFormatCreateLabel = (input: string) => `Use custom value: ${input}`; + return (
@@ -92,6 +94,7 @@ export default function AnnotationQueryEditor({ query, onChange }: Props) {