mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-08 13:29:01 +08:00
feat: tag value suggestion is updated
This commit is contained in:
parent
d4d1104a53
commit
5556d1d6fc
@ -51,7 +51,7 @@ function DebounceSelect<
|
||||
filterOption={false}
|
||||
onSearch={debounceFetcher}
|
||||
notFoundContent={fetching ? <Spin size="small" /> : null}
|
||||
style={{ minWidth: '170px' }}
|
||||
style={{ width: '170px' }}
|
||||
// as all other props are from SelectProps only
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...props}
|
||||
|
@ -21,12 +21,8 @@ export async function fetchTag(
|
||||
return [];
|
||||
}
|
||||
|
||||
console.log(response.payload);
|
||||
|
||||
return [
|
||||
{
|
||||
label: 'asd',
|
||||
value: 'asd',
|
||||
},
|
||||
];
|
||||
return response.payload.map((e) => ({
|
||||
label: e.tagValues,
|
||||
value: e.tagValues,
|
||||
}));
|
||||
}
|
||||
|
@ -83,27 +83,22 @@ function SingleTags(props: AllTagsProps): JSX.Element {
|
||||
|
||||
<DebounceSelect
|
||||
fetchOptions={(): Promise<TagValue[]> =>
|
||||
fetchTag(globalReducer.minTime, globalReducer.maxTime, selectedKey[0])
|
||||
fetchTag(globalReducer.minTime, globalReducer.maxTime, selectedKey[index])
|
||||
}
|
||||
debounceTimeout={300}
|
||||
mode="tags"
|
||||
/>
|
||||
|
||||
{/* <ValueSelect
|
||||
value={selectedValues}
|
||||
onChange={(value): void => {
|
||||
onSelect={(value: Value): void => {
|
||||
setLocalSelectedTags((tags) => [
|
||||
...tags.slice(0, index),
|
||||
{
|
||||
Key: selectedKey,
|
||||
Operator: selectedOperator,
|
||||
Values: value as string[],
|
||||
Values: [...selectedValues, value.value],
|
||||
},
|
||||
...tags.slice(index + 1, tags.length),
|
||||
]);
|
||||
}}
|
||||
mode="tags"
|
||||
/> */}
|
||||
mode="multiple"
|
||||
/>
|
||||
|
||||
<IconContainer role="button" onClick={(): void => onDeleteTagHandler(index)}>
|
||||
<CloseOutlined />
|
||||
@ -121,4 +116,10 @@ interface AllTagsProps {
|
||||
>;
|
||||
}
|
||||
|
||||
interface Value {
|
||||
key: string;
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export default SingleTags;
|
||||
|
@ -6,6 +6,8 @@ export interface Props {
|
||||
tagKey: string;
|
||||
}
|
||||
|
||||
export interface PayloadProps {
|
||||
key: string;
|
||||
interface Value {
|
||||
tagValues: string;
|
||||
}
|
||||
|
||||
export type PayloadProps = Value[];
|
||||
|
Loading…
x
Reference in New Issue
Block a user