mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Geomap: use short name for marker selection (#40541)
This commit is contained in:
parent
e4297006f6
commit
e7c3e54079
@ -101,7 +101,7 @@ export const ResourceDimensionEditor: FC<
|
||||
<InlineFieldRow>
|
||||
<InlineField label={null} grow>
|
||||
<Input
|
||||
value={value?.fixed}
|
||||
value={niceName(value?.fixed)}
|
||||
placeholder="Resource URL"
|
||||
readOnly={true}
|
||||
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) => ({
|
||||
icon: css`
|
||||
vertical-align: middle;
|
||||
|
Loading…
Reference in New Issue
Block a user