Skip to content

Commit

Permalink
feat: retire management section
Browse files Browse the repository at this point in the history
Signed-off-by: tygao <tygao@amazon.com>
  • Loading branch information
raintygao committed Sep 8, 2023
1 parent 56c8971 commit 2a596b0
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 62 deletions.
2 changes: 1 addition & 1 deletion src/core/public/core_app/errors/url_overflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const setupUrlOverflowDetection = ({ basePath, history, toasts, uiSetting
values={{
storeInSessionStorageParam: <code>state:storeInSessionStorage</code>,
advancedSettingsLink: (
<a href={basePath.prepend('/app/management/opensearch-dashboards/settings')}>
<a href={basePath.prepend('/app/settings')}>
<FormattedMessage
id="core.ui.errorUrlOverflow.bigUrlWarningNotificationMessage.advancedSettingsLinkText"
defaultMessage="advanced settings"
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/core_app/errors/url_overflow_ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const UrlOverflowUi: React.FC<{ basePath: IBasePath }> = ({ basePath }) =
values={{
storeInSessionStorageConfig: <code>state:storeInSessionStorage</code>,
opensearchDashboardsSettingsLink: (
<a href={basePath.prepend('/app/management/opensearch-dashboards/settings')}>
<a href={basePath.prepend('/app/settings')}>
<FormattedMessage
id="core.ui.errorUrlOverflow.optionsToFixError.enableOptionText.advancedSettingsLinkText"
defaultMessage="Advanced Settings"
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/ui_settings/saved_objects/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const uiSettingsType: SavedObjectsType = {
importableAndExportable: true,
getInAppUrl() {
return {
path: `/app/management/opensearch-dashboards/settings`,
path: `/app/settings`,
uiCapabilitiesPath: 'advancedSettings.show',
};
},
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/advanced_settings/opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"ui": true,
"requiredPlugins": ["management"],
"optionalPlugins": ["home"],
"requiredBundles": ["opensearchDashboardsReact", "home"]
"requiredBundles": ["opensearchDashboardsReact"]
}
16 changes: 0 additions & 16 deletions src/plugins/advanced_settings/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

import { i18n } from '@osd/i18n';
import { AppMountParameters, CoreSetup, Plugin } from 'opensearch-dashboards/public';
import { FeatureCatalogueCategory } from '../../home/public';
import { ComponentRegistry } from './component_registry';
import { AdvancedSettingsSetup, AdvancedSettingsStart, AdvancedSettingsPluginSetup } from './types';
import { DEFAULT_APP_CATEGORIES } from '../../../core/public';
Expand Down Expand Up @@ -61,21 +60,6 @@ export class AdvancedSettingsPlugin
},
});

if (home) {
home.featureCatalogue.register({
id: 'advanced_settings',
title,
description: i18n.translate('advancedSettings.featureCatalogueTitle', {
defaultMessage:
'Customize your OpenSearch Dashboards experience — change the date format, turn on dark mode, and more.',
}),
icon: 'gear',
path: '/app/management/opensearch-dashboards/settings',
showOnHomePage: false,
category: FeatureCatalogueCategory.ADMIN,
});
}

return {
component: component.setup,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function OpenSearchPanel(props) {
fill
onClick={props.onClose}
href={addBasePath(
`/app/management/opensearch-dashboards/objects?_a=${rison.encode({
`/app/settings/objects?_a=${rison.encode({
tab: SEARCH_OBJECT_TYPE,
})}`
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const OverviewPageFooter: FC<Props> = ({ addBasePath, path }) => {
<EuiButtonEmpty
className="osdOverviewPageFooter__button"
flush="both"
href={addBasePath('/app/management/opensearch-dashboards/settings#defaultRoute')}
href={addBasePath('/app/settings#defaultRoute')}
iconType="home"
size="xs"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export const OverviewPageHeader: FC<Props> = ({
className="osdOverviewPageHeader__actionButton"
flush="both"
iconType="gear"
href={addBasePath('/app/management')}
href={addBasePath('/app/settings')}
>
{i18n.translate(
'opensearch-dashboards-react.osdOverviewPageHeader.stackManagementButtonLabel',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"visAugmenter"
],
"extraPublicDirs": ["public/lib"],
"requiredBundles": ["opensearchDashboardsReact", "home"]
"requiredBundles": ["opensearchDashboardsReact"]
}
39 changes: 1 addition & 38 deletions src/plugins/saved_objects_management/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* under the License.
*/

import { i18n } from '@osd/i18n';
import { AppMountParameters, CoreSetup, CoreStart, Plugin } from 'src/core/public';

import { VisBuilderStart } from '../../vis_builder/public';
Expand All @@ -37,7 +36,7 @@ import { UiActionsSetup, UiActionsStart } from '../../ui_actions/public';
import { DataPublicPluginStart } from '../../data/public';
import { DashboardStart } from '../../dashboard/public';
import { DiscoverStart } from '../../discover/public';
import { HomePublicPluginSetup, FeatureCatalogueCategory } from '../../home/public';
import { HomePublicPluginSetup } from '../../home/public';
import { VisualizationsStart } from '../../visualizations/public';
import { VisAugmenterStart } from '../../vis_augmenter/public';
import {
Expand All @@ -59,7 +58,6 @@ import { DEFAULT_APP_CATEGORIES } from '../../../core/public';
import {
ALL_LIBRARY_OBJECTS_TITLE_WORDINGS,
ALL_LIBRARY_OBJECTS_WORDINGS,
SAVED_OBJECT_MANAGEMENT_TITLE_WORDINGS,
SAVED_QUERIES_WORDINGS,
SAVED_SEARCHES_WORDINGS,
} from './constants';
Expand Down Expand Up @@ -177,41 +175,6 @@ export class SavedObjectsManagementPlugin
const columnSetup = this.columnService.setup();
const namespaceSetup = this.namespaceService.setup();

if (home) {
home.featureCatalogue.register({
id: 'saved_objects',
title: i18n.translate('savedObjectsManagement.objects.savedObjectsTitle', {
defaultMessage: 'Saved Objects',
}),
description: i18n.translate('savedObjectsManagement.objects.savedObjectsDescription', {
defaultMessage:
'Import, export, and manage your saved searches, visualizations, and dashboards.',
}),
icon: 'savedObjectsApp',
path: '/app/management/opensearch-dashboards/objects',
showOnHomePage: false,
category: FeatureCatalogueCategory.ADMIN,
});
}

const opensearchDashboardsSection = management.sections.section.opensearchDashboards;
opensearchDashboardsSection.registerApp({
id: 'objects',
title: i18n.translate('savedObjectsManagement.managementSectionLabel', {
defaultMessage: 'Saved objects',
}),
order: 1,
mount: async (mountParams) => {
const { mountManagementSection } = await import('./management_section');
return mountManagementSection({
core,
serviceRegistry: this.serviceRegistry,
mountParams,
title: SAVED_OBJECT_MANAGEMENT_TITLE_WORDINGS,
});
},
});

// sets up the context mappings and registers any triggers/actions for the plugin
bootstrap(uiActions);

Expand Down

0 comments on commit 2a596b0

Please sign in to comment.