(
@@ -143,15 +143,16 @@ export const EditIndexPattern = withRouter(
const showTagsSection = Boolean(indexPattern.timeFieldName || (tags && tags.length > 0));
const kibana = useKibana();
const docsUrl = kibana.services.docLinks!.links.elasticsearch.mapping;
- const userEditPermission = !!application?.capabilities?.indexPatterns?.save;
+ const userEditPermission = dataViews.getCanSaveSync();
return (
{showTagsSection && (
diff --git a/src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx
index b64aed5c0811c..e40ef6a7ddf2f 100644
--- a/src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx
+++ b/src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx
@@ -16,6 +16,7 @@ interface IndexHeaderProps {
defaultIndex?: string;
setDefault?: () => void;
deleteIndexPatternClick?: () => void;
+ canSave: boolean;
}
const setDefaultAriaLabel = i18n.translate('indexPatternManagement.editDataView.setDefaultAria', {
@@ -40,12 +41,13 @@ export const IndexHeader: React.FC = ({
setDefault,
deleteIndexPatternClick,
children,
+ canSave,
}) => {
return (
{indexPattern.title}}
rightSideItems={[
- defaultIndex !== indexPattern.id && setDefault && (
+ defaultIndex !== indexPattern.id && setDefault && canSave && (
= ({
/>
),
- deleteIndexPatternClick && (
+ canSave && (
`;
@@ -178,6 +198,47 @@ exports[`IndexedFieldsTable should filter based on the query bar 1`] = `
},
]
}
+ openModal={[Function]}
+ theme={Object {}}
+ />
+