- {showTagsSection && (
-
- {Boolean(indexPattern.timeFieldName) && (
-
- {timeFilterHeader}
-
- )}
- {tags.map((tag: any) => (
-
- {tag.name}
-
- ))}
-
- )}
+ {showTagsSection && renderBadges()}
-
-
- {indexPattern.title} }}
- />{' '}
-
- {mappingAPILink}
-
-
-
+ {renderDescription()}
{conflictedFields.length > 0 && (
<>
diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx
index 386e0d840e1d..156a22f720f5 100644
--- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx
+++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx
@@ -30,8 +30,18 @@
import React from 'react';
import { i18n } from '@osd/i18n';
-import { EuiFlexGroup, EuiToolTip, EuiFlexItem, EuiSmallButtonIcon, EuiText } from '@elastic/eui';
+import {
+ EuiFlexGroup,
+ EuiToolTip,
+ EuiFlexItem,
+ EuiSmallButtonIcon,
+ EuiText,
+ EuiButtonIcon,
+ EuiButton,
+} from '@elastic/eui';
import { IIndexPattern } from 'src/plugins/data/public';
+import { useOpenSearchDashboards } from '../../../../../opensearch_dashboards_react/public';
+import { IndexPatternManagmentContext } from '../../../types';
interface IndexHeaderProps {
indexPattern: IIndexPattern;
@@ -78,7 +88,85 @@ export function IndexHeader({
refreshFields,
deleteIndexPatternClick,
}: IndexHeaderProps) {
- return (
+ const {
+ uiSettings,
+ navigationUI: { HeaderControl },
+ application,
+ } = useOpenSearchDashboards
().services;
+
+ const useUpdatedUX = uiSettings.get('home:useNewHomePage');
+
+ return useUpdatedUX ? (
+
+
+
+ ),
+ },
+ ]
+ : []),
+ ...(defaultIndex !== indexPattern.id && setDefault
+ ? [
+ {
+ renderComponent: (
+
+ {i18n.translate(
+ 'indexPatternManagement.editIndexPattern.setDefaultButton.text',
+ {
+ defaultMessage: 'Set as default index',
+ }
+ )}
+
+ ),
+ },
+ ]
+ : []),
+ ...(refreshFields
+ ? [
+ {
+ renderComponent: (
+
+ {i18n.translate(
+ 'indexPatternManagement.editIndexPattern.refreshFieldsButton.text',
+ {
+ defaultMessage: 'Refresh field list',
+ }
+ )}
+
+ ),
+ },
+ ]
+ : []),
+ ]}
+ setMountPoint={application.setAppRightControls}
+ />
+ ) : (
diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx
index 613958bd2a3c..fdceab0f5e59 100644
--- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx
+++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx
@@ -39,6 +39,7 @@ import {
EuiCompressedFieldSearch,
EuiCompressedSelect,
EuiSelectOption,
+ EuiPageContent,
} from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { fieldWildcardMatcher } from '../../../../../opensearch_dashboards_utils/public';
@@ -125,6 +126,8 @@ export function Tabs({ indexPattern, saveIndexPattern, fields, history, location
[uiSettings]
);
+ const useUpdatedUX = uiSettings.get('home:useNewHomePage');
+
const getFilterSection = useCallback(
(type: string) => {
return (
@@ -174,63 +177,73 @@ export function Tabs({ indexPattern, saveIndexPattern, fields, history, location
const getContent = useCallback(
(type: string) => {
+ const Wrapper = useUpdatedUX ? EuiPageContent : Fragment;
switch (type) {
case TAB_INDEXED_FIELDS:
return (
-
-
- {getFilterSection(type)}
-
- {
- history.push(getPath(field, indexPattern));
- },
- getFieldInfo: indexPatternManagementStart.list.getFieldInfo,
- }}
- />
-
+ <>
+ {useUpdatedUX && }
+
+
+ {getFilterSection(type)}
+
+ {
+ history.push(getPath(field, indexPattern));
+ },
+ getFieldInfo: indexPatternManagementStart.list.getFieldInfo,
+ }}
+ />
+
+ >
);
case TAB_SCRIPTED_FIELDS:
return (
-
-
- {getFilterSection(type)}
-
- {
- history.push(getPath(field, indexPattern));
- },
- }}
- onRemoveField={refreshFilters}
- painlessDocLink={docLinks.links.noDocumentation.scriptedFields.painless}
- />
-
+ <>
+ {useUpdatedUX && }
+
+
+ {getFilterSection(type)}
+
+ {
+ history.push(getPath(field, indexPattern));
+ },
+ }}
+ onRemoveField={refreshFilters}
+ painlessDocLink={docLinks.links.noDocumentation.scriptedFields.painless}
+ />
+
+ >
);
case TAB_SOURCE_FILTERS:
return (
-
-
- {getFilterSection(type)}
-
-
-
+ <>
+ {useUpdatedUX && }
+
+
+ {getFilterSection(type)}
+
+
+
+ >
);
}
},
@@ -247,6 +260,7 @@ export function Tabs({ indexPattern, saveIndexPattern, fields, history, location
refreshFilters,
scriptedFieldLanguageFilter,
saveIndexPattern,
+ useUpdatedUX,
]
);
diff --git a/src/plugins/index_pattern_management/public/mocks.ts b/src/plugins/index_pattern_management/public/mocks.ts
index dacf876c2f6c..39731abf733b 100644
--- a/src/plugins/index_pattern_management/public/mocks.ts
+++ b/src/plugins/index_pattern_management/public/mocks.ts
@@ -126,6 +126,9 @@ const createIndexPatternManagmentContext = () => {
data,
indexPatternManagementStart: createStartContract(),
setBreadcrumbs: () => {},
+ navigationUI: {
+ HeaderControl: () => null,
+ },
};
};
diff --git a/src/plugins/management/public/components/management_app/management_app.tsx b/src/plugins/management/public/components/management_app/management_app.tsx
index c30243563b01..1241bb571326 100644
--- a/src/plugins/management/public/components/management_app/management_app.tsx
+++ b/src/plugins/management/public/components/management_app/management_app.tsx
@@ -38,6 +38,7 @@ import { ManagementRouter } from './management_router';
import { ManagementSidebarNav } from '../management_sidebar_nav';
import { reactRouterNavigate } from '../../../../opensearch_dashboards_react/public';
import { SectionsServiceStart } from '../../types';
+import { CoreStart } from '../../../../../core/public';
import './management_app.scss';
@@ -52,6 +53,7 @@ export interface ManagementAppDependencies {
opensearchDashboardsVersion: string;
setBreadcrumbs: (newBreadcrumbs: ChromeBreadcrumb[]) => void;
hideInAppNavigation?: boolean;
+ uiSettings: CoreStart['uiSettings'];
}
export const ManagementApp = ({ dependencies, history }: ManagementAppProps) => {
diff --git a/src/plugins/management/public/components/management_app/management_router.tsx b/src/plugins/management/public/components/management_app/management_router.tsx
index 06c39570c7da..0e7ca593f69f 100644
--- a/src/plugins/management/public/components/management_app/management_router.tsx
+++ b/src/plugins/management/public/components/management_app/management_router.tsx
@@ -46,38 +46,46 @@ interface ManagementRouterProps {
}
export const ManagementRouter = memo(
- ({ dependencies, history, setBreadcrumbs, onAppMounted, sections }: ManagementRouterProps) => (
-
-
-
- {sections.map((section) =>
- section
- .getAppsEnabled()
- .map((app) => (
- (
-
- )}
- />
- ))
- )}
- (
-
+ ({ dependencies, history, setBreadcrumbs, onAppMounted, sections }: ManagementRouterProps) => {
+ const useUpdatedUX = dependencies.uiSettings.get('home:useNewHomePage');
+ return (
+
+
+
+ {sections.map((section) =>
+ section
+ .getAppsEnabled()
+ .map((app) => (
+ (
+
+ )}
+ />
+ ))
)}
- />
-
-
-
- )
+ (
+
+ )}
+ />
+
+
+
+ );
+ }
);
diff --git a/src/plugins/management/public/plugin.ts b/src/plugins/management/public/plugin.ts
index 7b219bffad9e..00fd767b27fb 100644
--- a/src/plugins/management/public/plugin.ts
+++ b/src/plugins/management/public/plugin.ts
@@ -110,6 +110,7 @@ export class ManagementPlugin
opensearchDashboardsVersion,
setBreadcrumbs: coreStart.chrome.setBreadcrumbs,
hideInAppNavigation,
+ uiSettings: coreStart.uiSettings,
});
},
});
diff --git a/src/plugins/saved_objects_management/opensearch_dashboards.json b/src/plugins/saved_objects_management/opensearch_dashboards.json
index 2802eb04b3dc..9a985345b030 100644
--- a/src/plugins/saved_objects_management/opensearch_dashboards.json
+++ b/src/plugins/saved_objects_management/opensearch_dashboards.json
@@ -3,7 +3,7 @@
"version": "opensearchDashboards",
"server": true,
"ui": true,
- "requiredPlugins": ["management", "data", "uiActions"],
+ "requiredPlugins": ["management", "data", "uiActions","navigation"],
"optionalPlugins": [
"dashboard",
"visualizations",
diff --git a/src/plugins/saved_objects_management/public/management_section/mount_section.tsx b/src/plugins/saved_objects_management/public/management_section/mount_section.tsx
index 0c98f365b39d..e26956900627 100644
--- a/src/plugins/saved_objects_management/public/management_section/mount_section.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/mount_section.tsx
@@ -64,7 +64,7 @@ export const mountManagementSection = async ({
dataSourceEnabled,
dataSourceManagement,
}: MountParams) => {
- const [coreStart, { data, uiActions }, pluginStart] = await core.getStartServices();
+ const [coreStart, { data, uiActions, navigation }, pluginStart] = await core.getStartServices();
const { element, history, setBreadcrumbs } = mountParams;
if (allowedObjectTypes === undefined) {
allowedObjectTypes = await getAllowedTypes(coreStart.http);
@@ -89,6 +89,8 @@ export const mountManagementSection = async ({
return children! as React.ReactElement;
};
+ const useUpdatedUX = coreStart.uiSettings.get('home:useNewHomePage');
+
const content = (
@@ -119,6 +121,8 @@ export const mountManagementSection = async ({
setBreadcrumbs={setBreadcrumbs}
dataSourceEnabled={dataSourceEnabled}
dataSourceManagement={dataSourceManagement}
+ navigation={navigation}
+ useUpdatedUX={useUpdatedUX}
/>
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap
index 765a84bb0803..769444715a90 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap
@@ -992,6 +992,51 @@ exports[`SavedObjectsTable should render normally 1`] = `
horizontalPosition="center"
>
`;
+
+exports[`Header should render normally when useUpdatedUX is true 1`] = `
+
+
+
+
+ ,
+ },
+ Object {
+ "renderComponent":
+
+ ,
+ },
+ Object {
+ "renderComponent":
+
+ ,
+ },
+ ]
+ }
+ setMountPoint={[MockFunction]}
+ />
+
+
+
+
+
+`;
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap
index 6c14a3084527..c0537471afa3 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/table.test.tsx.snap
@@ -26,6 +26,7 @@ exports[`Table prevents saved objects from being deleted 1`] = `
onChange={[Function]}
toolsRight={
Array [
+ ,
,
,
,
+ ,
+
+
+ ,
+
+
+
+ }
+ closePopover={[Function]}
+ display="inlineBlock"
+ hasArrow={true}
+ isOpen={false}
+ ownFocus={true}
+ panelPaddingSize="s"
+ >
+
+ }
+ labelType="label"
+ >
+
+ }
+ name="includeReferencesDeep"
+ onChange={[Function]}
+ />
+
+
+
+
+
+
+ ,
+ ]
+ }
+ />
+
+
+
+
+
+`;
+
+exports[`Table should render normally when use updated UX 1`] = `
+
+
+
+ ,
,
{},
+ onImport: () => {},
+ onRefresh: () => {},
+ onDuplicate: () => {},
+ objectCount: 4,
+ filteredCount: 2,
+ useUpdatedUX: false,
+ navigationUI: { HeaderControl: () => null, TopNavMenu: () => null },
+ applications: applicationServiceMock.createStartContract(),
+};
describe('Header', () => {
it('should render normally', () => {
const props = {
- onExportAll: () => {},
- onImport: () => {},
- onRefresh: () => {},
- onDuplicate: () => {},
- objectCount: 4,
- filteredCount: 2,
+ ...defaultProps,
showDuplicateAll: false,
};
@@ -51,12 +59,7 @@ describe('Header', () => {
it('should render normally when showDuplicateAll is undefined', () => {
const props = {
- onExportAll: () => {},
- onImport: () => {},
- onRefresh: () => {},
- onDuplicate: () => {},
- objectCount: 4,
- filteredCount: 2,
+ ...defaultProps,
showDuplicateAll: undefined,
};
@@ -64,17 +67,24 @@ describe('Header', () => {
expect(component).toMatchSnapshot();
});
+
+ it('should render normally when useUpdatedUX is true', () => {
+ const props = {
+ ...defaultProps,
+ showDuplicateAll: true,
+ useUpdatedUX: true,
+ };
+
+ const component = shallow();
+
+ expect(component).toMatchSnapshot();
+ });
});
describe('Header - workspace enabled', () => {
it('should render `Duplicate All` button when workspace enabled', () => {
const props = {
- onExportAll: () => {},
- onImport: () => {},
- onRefresh: () => {},
- onDuplicate: () => {},
- objectCount: 4,
- filteredCount: 2,
+ ...defaultProps,
showDuplicateAll: true,
};
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx
index f83cdfaf69f2..80f37d53ceec 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx
@@ -36,8 +36,12 @@ import {
EuiText,
EuiTextColor,
EuiButtonEmpty,
+ EuiButton,
} from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
+import { ApplicationStart } from 'src/core/public';
+import { i18n } from '@osd/i18n';
+import { NavigationPublicPluginStart } from '../../../../../navigation/public';
export const Header = ({
onExportAll,
@@ -46,6 +50,9 @@ export const Header = ({
onRefresh,
objectCount,
showDuplicateAll = false,
+ useUpdatedUX,
+ navigationUI: { HeaderControl },
+ applications,
}: {
onExportAll: () => void;
onImport: () => void;
@@ -53,40 +60,72 @@ export const Header = ({
onRefresh: () => void;
objectCount: number;
showDuplicateAll: boolean;
-}) => (
-
-
-
-
-
-
-
-
-
+ useUpdatedUX: boolean;
+ navigationUI: NavigationPublicPluginStart['ui'];
+ applications: ApplicationStart;
+}) => {
+ const title = useUpdatedUX ? null : (
+
+
+
+
+
+
+
+ );
+ const description = useUpdatedUX ? (
+
+ ) : (
+
+
+
+
+
+
+
+ );
-
-
- {showDuplicateAll && (
-
-
-
-
-
- )}
-
-
+
+
+ ),
+ },
+ ]
+ : []),
+ {
+ renderComponent: (
+
-
-
-
-
+ ),
+ },
+ {
+ renderComponent: (
+
-
-
+
+ ),
+ },
+ ]}
+ setMountPoint={applications.setAppRightControls}
+ />
+ ) : (
+
+
+ {showDuplicateAll && (
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-);
+ )}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+
+ return (
+
+
+ {title}
+ {rightControls}
+
+
+ {description}
+
+
+ );
+};
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx
index e9b5595dd45d..ddf50e68c25a 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx
@@ -110,6 +110,7 @@ const defaultProps: TableProps = {
onDuplicate: () => {},
onDuplicateSingle: () => {},
showDuplicate: false,
+ useUpdatedUX: false,
};
describe('Table', () => {
@@ -119,6 +120,16 @@ describe('Table', () => {
expect(component).toMatchSnapshot();
});
+ it('should render normally when use updated UX', () => {
+ const props = {
+ ...defaultProps,
+ useUpdatedUX: true,
+ };
+ const component = shallowWithI18nProvider();
+
+ expect(component).toMatchSnapshot();
+ });
+
it('should render gotoApp link correctly for workspace', () => {
const item = {
id: 'dashboard-1',
diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx
index 1341461a800e..fdfd2cea2c28 100644
--- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx
@@ -47,6 +47,7 @@ import {
EuiTableFieldDataColumnType,
EuiTableActionsColumnType,
EuiSearchBarProps,
+ EuiButtonIcon,
} from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
@@ -90,6 +91,8 @@ export interface TableProps {
availableWorkspaces?: WorkspaceAttribute[];
currentWorkspaceId?: string;
showDuplicate: boolean;
+ useUpdatedUX: boolean;
+ onRefresh: () => void;
}
interface TableState {
@@ -189,6 +192,8 @@ export class Table extends PureComponent {
availableWorkspaces,
currentWorkspaceId,
showDuplicate,
+ useUpdatedUX,
+ onRefresh,
} = this.props;
const visibleWsIds = availableWorkspaces?.map((ws) => ws.id) || [];
@@ -417,6 +422,17 @@ export class Table extends PureComponent {
filters={filters}
onChange={this.onChange}
toolsRight={[
+ <>
+ {useUpdatedUX && (
+
+ )}
+ >,
<>{showDuplicate && duplicateButton}>,
@@ -1191,6 +1204,8 @@ export class SavedObjectsTable extends Component
diff --git a/src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx b/src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx
index 425baca096d2..f526f7f6c751 100644
--- a/src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx
+++ b/src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx
@@ -41,6 +41,7 @@ import {
SavedObjectsManagementNamespaceServiceStart,
} from '../services';
import { SavedObjectsTable } from './objects_table';
+import { NavigationPublicPluginStart } from '../../../navigation/public';
const SavedObjectsTablePage = ({
coreStart,
@@ -53,6 +54,8 @@ const SavedObjectsTablePage = ({
setBreadcrumbs,
dataSourceEnabled,
dataSourceManagement,
+ navigation,
+ useUpdatedUX,
}: {
coreStart: CoreStart;
dataStart: DataPublicPluginStart;
@@ -64,6 +67,8 @@ const SavedObjectsTablePage = ({
setBreadcrumbs: (crumbs: ChromeBreadcrumb[]) => void;
dataSourceEnabled: boolean;
dataSourceManagement?: DataSourceManagementPluginSetup;
+ navigation: NavigationPublicPluginStart;
+ useUpdatedUX: boolean;
}) => {
const capabilities = coreStart.application.capabilities;
const itemsPerPage = coreStart.uiSettings.get('savedObjects:perPage', 50);
@@ -71,14 +76,20 @@ const SavedObjectsTablePage = ({
useEffect(() => {
setBreadcrumbs([
- {
- text: i18n.translate('savedObjectsManagement.breadcrumb.index', {
- defaultMessage: 'Saved objects',
- }),
- href: '/',
- },
+ useUpdatedUX
+ ? {
+ text: i18n.translate('savedObjectsManagement.updatedUX.title', {
+ defaultMessage: 'Assets',
+ }),
+ }
+ : {
+ text: i18n.translate('savedObjectsManagement.breadcrumb.index', {
+ defaultMessage: 'Saved objects',
+ }),
+ href: '/',
+ },
]);
- }, [setBreadcrumbs]);
+ }, [setBreadcrumbs, useUpdatedUX]);
return (
);
};
diff --git a/src/plugins/saved_objects_management/public/plugin.ts b/src/plugins/saved_objects_management/public/plugin.ts
index 65c91d6ff14c..2f69c1587c65 100644
--- a/src/plugins/saved_objects_management/public/plugin.ts
+++ b/src/plugins/saved_objects_management/public/plugin.ts
@@ -67,6 +67,7 @@ import { DEFAULT_NAV_GROUPS } from '../../../core/public';
import { RecentWork } from './management_section/recent_work';
import { HOME_CONTENT_AREAS } from '../../../plugins/home/public';
import { getScopedBreadcrumbs } from '../../opensearch_dashboards_react/public';
+import { NavigationPublicPluginStart } from '../../../plugins/navigation/public';
/**
* The id is used in src/plugins/workspace/public/plugin.ts and please change that accordingly if you change the id here.
@@ -104,6 +105,7 @@ export interface StartDependencies {
visBuilder?: VisBuilderStart;
uiActions: UiActionsStart;
contentManagement?: ContentManagementPluginStart;
+ navigation: NavigationPublicPluginStart;
}
export class SavedObjectsManagementPlugin