mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
SingleTopNav: Add kiosk mode
tracking events (#95397)
This commit is contained in:
parent
fd4fc106d9
commit
bdab0bc8c0
@ -197,17 +197,29 @@ export class AppChromeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.update({ searchBarHidden: newSearchBarHidden, kioskMode: null });
|
this.update({ searchBarHidden: newSearchBarHidden, kioskMode: null });
|
||||||
|
reportInteraction('grafana_search_bar', {
|
||||||
|
visible: !newSearchBarHidden,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
public onToggleKioskMode = () => {
|
public onToggleKioskMode = () => {
|
||||||
const nextMode = this.getNextKioskMode();
|
const nextMode = this.getNextKioskMode();
|
||||||
this.update({ kioskMode: nextMode });
|
this.update({ kioskMode: nextMode });
|
||||||
locationService.partial({ kiosk: this.getKioskUrlValue(nextMode) });
|
locationService.partial({ kiosk: this.getKioskUrlValue(nextMode) });
|
||||||
|
reportInteraction('grafana_kiosk_mode', {
|
||||||
|
action: 'toggle',
|
||||||
|
singleTopNav: Boolean(config.featureToggles.singleTopNav),
|
||||||
|
mode: nextMode,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
public exitKioskMode() {
|
public exitKioskMode() {
|
||||||
this.update({ kioskMode: undefined });
|
this.update({ kioskMode: undefined });
|
||||||
locationService.partial({ kiosk: null });
|
locationService.partial({ kiosk: null });
|
||||||
|
reportInteraction('grafana_kiosk_mode', {
|
||||||
|
action: 'exit',
|
||||||
|
singleTopNav: Boolean(config.featureToggles.singleTopNav),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public setKioskModeFromUrl(kiosk: UrlQueryValue) {
|
public setKioskModeFromUrl(kiosk: UrlQueryValue) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
|
||||||
import { SelectableValue, UrlQueryMap, urlUtil } from '@grafana/data';
|
import { SelectableValue, UrlQueryMap, urlUtil } from '@grafana/data';
|
||||||
import { config } from '@grafana/runtime';
|
import { config, reportInteraction } from '@grafana/runtime';
|
||||||
import { Checkbox, ClipboardButton, Field, FieldSet, Input, Modal, RadioButtonGroup } from '@grafana/ui';
|
import { Checkbox, ClipboardButton, Field, FieldSet, Input, Modal, RadioButtonGroup } from '@grafana/ui';
|
||||||
import { t, Trans } from 'app/core/internationalization';
|
import { t, Trans } from 'app/core/internationalization';
|
||||||
import { buildBaseUrl } from 'app/features/dashboard/components/ShareModal/utils';
|
import { buildBaseUrl } from 'app/features/dashboard/components/ShareModal/utils';
|
||||||
@ -57,7 +57,18 @@ export const ShareModal = ({ playlistUid, onDismiss }: Props) => {
|
|||||||
value={shareUrl}
|
value={shareUrl}
|
||||||
readOnly
|
readOnly
|
||||||
addonAfter={
|
addonAfter={
|
||||||
<ClipboardButton icon="copy" variant="primary" getText={() => shareUrl}>
|
<ClipboardButton
|
||||||
|
icon="copy"
|
||||||
|
variant="primary"
|
||||||
|
getText={() => shareUrl}
|
||||||
|
onClipboardCopy={() => {
|
||||||
|
reportInteraction('grafana_kiosk_mode', {
|
||||||
|
action: 'share_playlist',
|
||||||
|
singleTopNav: Boolean(config.featureToggles.singleTopNav),
|
||||||
|
mode: mode,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Trans i18nKey="share-playlist.copy-link-button">Copy</Trans>
|
<Trans i18nKey="share-playlist.copy-link-button">Copy</Trans>
|
||||||
</ClipboardButton>
|
</ClipboardButton>
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
|
||||||
import { SelectableValue, UrlQueryMap, urlUtil } from '@grafana/data';
|
import { SelectableValue, UrlQueryMap, urlUtil } from '@grafana/data';
|
||||||
import { config, locationService } from '@grafana/runtime';
|
import { config, locationService, reportInteraction } from '@grafana/runtime';
|
||||||
import { Box, Button, Checkbox, Field, FieldSet, Modal, RadioButtonGroup, Stack } from '@grafana/ui';
|
import { Box, Button, Checkbox, Field, FieldSet, Modal, RadioButtonGroup, Stack } from '@grafana/ui';
|
||||||
|
|
||||||
import { Playlist, PlaylistMode } from './types';
|
import { Playlist, PlaylistMode } from './types';
|
||||||
@ -46,6 +46,11 @@ export const StartModal = ({ playlist, onDismiss }: Props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
locationService.push(urlUtil.renderUrl(`/playlists/play/${playlist.uid}`, params));
|
locationService.push(urlUtil.renderUrl(`/playlists/play/${playlist.uid}`, params));
|
||||||
|
reportInteraction('grafana_kiosk_mode', {
|
||||||
|
action: 'start_playlist',
|
||||||
|
singleTopNav: Boolean(config.featureToggles.singleTopNav),
|
||||||
|
mode: mode,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user