Skip to content

Commit

Permalink
Revert "Move index management from plugin section to management secti…
Browse files Browse the repository at this point in the history
…on (opensearch-project#741) (opensearch-project#818)"

This reverts commit 72441f5.
  • Loading branch information
Hailong-am committed Jul 19, 2023
1 parent 72441f5 commit 282d5cb
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 83 deletions.
33 changes: 0 additions & 33 deletions .eslintrc.js

This file was deleted.

5 changes: 1 addition & 4 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"navigation",
"opensearchDashboardsReact"
],
"optionalPlugins": [
"managementOverview"
],
"server": true,
"ui": true
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"cypress:open": "cypress open",
"osd": "node ../../scripts/osd",
"opensearch": "node ../../scripts/opensearch",
"lint": "node ../../scripts/eslint . && node ../../scripts/stylelint",
"lint": "node ../../scripts/eslint .",
"plugin-helpers": "node ../../scripts/plugin_helpers",
"test:jest": "../../node_modules/.bin/jest --config ./test/jest.config.js",
"build": "yarn plugin-helpers build",
Expand Down
6 changes: 3 additions & 3 deletions public/pages/Main/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ enum Navigation {
IndexPolicies = "State management policies",
ManagedIndices = "Policy managed indices",
Indices = "Indices",
Rollups = "Rollup jobs",
Transforms = "Transform jobs",
Rollups = "Rollup Jobs",
Transforms = "Transform Jobs",
SnapshotManagement = "Snapshot Management",
Snapshots = "Snapshots",
SnapshotPolicies = "Snapshot policies",
SnapshotPolicies = "Snapshot Policies",
Repositories = "Repositories",
Aliases = "Aliases",
Templates = "Templates",
Expand Down
59 changes: 17 additions & 42 deletions public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,29 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { i18n } from "@osd/i18n";
import { IndexManagementPluginStart, IndexManagementPluginSetup } from ".";
import {
AppMountParameters,
CoreSetup,
CoreStart,
DEFAULT_APP_CATEGORIES,
Plugin,
PluginInitializerContext,
} from "../../../src/core/public";
import { AppMountParameters, CoreSetup, CoreStart, Plugin, PluginInitializerContext } from "../../../src/core/public";
import { IndexManagementPluginSetup } from ".";
import { IndexManagementPluginStart } from ".";
import { actionRepoSingleton } from "./pages/VisualCreatePolicy/utils/helpers";
import { ROUTES } from "./utils/constants";
import { JobHandlerRegister } from "./JobHandler";
import { ManagementOverViewPluginSetup } from "../../../src/plugins/management_overview/public";

interface IndexManagementSetupDeps {
managementOverview?: ManagementOverViewPluginSetup;
}

export class IndexManagementPlugin implements Plugin<IndexManagementPluginSetup, IndexManagementPluginStart, IndexManagementSetupDeps> {
export class IndexManagementPlugin implements Plugin<IndexManagementPluginSetup, IndexManagementPluginStart> {
constructor(private readonly initializerContext: PluginInitializerContext) {
// can retrieve config from initializerContext
}

public setup(core: CoreSetup, { managementOverview }: IndexManagementSetupDeps): IndexManagementPluginSetup {
public setup(core: CoreSetup): IndexManagementPluginSetup {
JobHandlerRegister(core);

if (managementOverview) {
managementOverview.register({
id: "opensearch_index_management_dashboards",
title: "Index Management",
order: 9010,
description: i18n.translate("indexManagement.description", {
defaultMessage: "Manage your indexes with state polices, templates and aliases. You can also roll up or transform your indexes.",
}),
});
managementOverview.register({
id: "opensearch_snapshot_management_dashboards",
title: "Snapshot Management",
order: 9020,
description: i18n.translate("snapshotManagement.description", {
defaultMessage:
"Back up and restore your cluster's indexes and state. Setup a policy to automate snapshot creation and deletion.",
}),
});
}

core.application.register({
id: "opensearch_index_management_dashboards",
title: "Index Management",
order: 9010,
category: DEFAULT_APP_CATEGORIES.management,
order: 7000,
category: {
id: "opensearch",
label: "OpenSearch Plugins",
order: 2000,
},
mount: async (params: AppMountParameters) => {
const { renderApp } = await import("./index_management_app");
const [coreStart, depsStart] = await core.getStartServices();
Expand All @@ -65,8 +36,12 @@ export class IndexManagementPlugin implements Plugin<IndexManagementPluginSetup,
core.application.register({
id: "opensearch_snapshot_management_dashboards",
title: "Snapshot Management",
order: 9020,
category: DEFAULT_APP_CATEGORIES.management,
order: 7000,
category: {
id: "opensearch",
label: "OpenSearch Plugins",
order: 2000,
},
mount: async (params: AppMountParameters) => {
const { renderApp } = await import("./index_management_app");
const [coreStart, depsStart] = await core.getStartServices();
Expand Down

0 comments on commit 282d5cb

Please sign in to comment.