* Move graph to NP * Styles * Clean up * Fix eslint * Fix ESlint * Fix path * Fix container height * Clean up * Update index.ts * Update graph_client_workspace.js * Refactoring * Remove unused methods * Update graph_client_workspace.test.js * Rename npData to data * Move Readme * Inline parsing discover url * Remove import of legacy styles * Update README Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
23 lines
667 B
JavaScript
23 lines
667 B
JavaScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
|
|
import { i18n } from '@kbn/i18n';
|
|
|
|
export function getReadonlyBadge(uiCapabilities) {
|
|
if (uiCapabilities.graph.save) {
|
|
return null;
|
|
}
|
|
|
|
return {
|
|
text: i18n.translate('xpack.graph.badge.readOnly.text', {
|
|
defaultMessage: 'Read only',
|
|
}),
|
|
tooltip: i18n.translate('xpack.graph.badge.readOnly.tooltip', {
|
|
defaultMessage: 'Unable to save Graph workspaces',
|
|
}),
|
|
iconType: 'glasses',
|
|
};
|
|
}
|