show badge for read-only (#135313)

This commit is contained in:
Joe Reuter 2022-06-29 09:28:11 +02:00 committed by GitHub
parent 4a6201785f
commit 8b078c3ad2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -139,6 +139,17 @@ export async function mountApp(
const embeddableEditorIncomingState = stateTransfer?.getIncomingEditorState(APP_ID);
addHelpMenuToAppChrome(coreStart.chrome, coreStart.docLinks);
if (!lensServices.application.capabilities.visualize.save) {
coreStart.chrome.setBadge({
text: i18n.translate('xpack.lens.badge.readOnly.text', {
defaultMessage: 'Read only',
}),
tooltip: i18n.translate('xpack.lens.badge.readOnly.tooltip', {
defaultMessage: 'Unable to save visualizations to the library',
}),
iconType: 'glasses',
});
}
coreStart.chrome.docTitle.change(
i18n.translate('xpack.lens.pageTitle', { defaultMessage: 'Lens' })
);