Geomap: use short name for marker selection (#40541)
This commit is contained in:
@@ -101,7 +101,7 @@ export const ResourceDimensionEditor: FC<
|
|||||||
<InlineFieldRow>
|
<InlineFieldRow>
|
||||||
<InlineField label={null} grow>
|
<InlineField label={null} grow>
|
||||||
<Input
|
<Input
|
||||||
value={value?.fixed}
|
value={niceName(value?.fixed)}
|
||||||
placeholder="Resource URL"
|
placeholder="Resource URL"
|
||||||
readOnly={true}
|
readOnly={true}
|
||||||
onClick={openModal}
|
onClick={openModal}
|
||||||
@@ -122,6 +122,17 @@ export const ResourceDimensionEditor: FC<
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export function niceName(value?: string): string | undefined {
|
||||||
|
if (!value) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const idx = value.lastIndexOf('/');
|
||||||
|
if (idx > 0) {
|
||||||
|
return value.substring(idx + 1);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
const getStyles = (theme: GrafanaTheme2) => ({
|
const getStyles = (theme: GrafanaTheme2) => ({
|
||||||
icon: css`
|
icon: css`
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|||||||
Reference in New Issue
Block a user