Skip to content

Commit

Permalink
[Workspace] Drop user personal settings page (opensearch-project#8236)
Browse files Browse the repository at this point in the history
* drop user personal settings page

Signed-off-by: Hailong Cui <[email protected]>

* Changeset file for PR opensearch-project#8236 created/updated

* remove unuse code

Signed-off-by: Hailong Cui <[email protected]>

---------

Signed-off-by: Hailong Cui <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and virajsanghvi committed Sep 24, 2024
1 parent 1b8b8a7 commit d1799e3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/8236.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- [Workspace] drop user personal settings page ([#8236](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8236))
8 changes: 7 additions & 1 deletion src/plugins/advanced_settings/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ import {
AdvancedSettingsPluginStart,
} from './types';
import { setupTopNavThemeButton } from './register_nav_control';
import { DEFAULT_NAV_GROUPS, AppNavLinkStatus, WorkspaceAvailability } from '../../../core/public';
import {
DEFAULT_NAV_GROUPS,
AppNavLinkStatus,
WorkspaceAvailability,
AppStatus,
} from '../../../core/public';
import { getScopedBreadcrumbs } from '../../opensearch_dashboards_react/public';
import { setupUserSettingsPage } from './management_app/user_settings';

Expand Down Expand Up @@ -193,6 +198,7 @@ export class AdvancedSettingsPlugin
const userSettingsEnabled = core.application.capabilities.userSettings?.enabled;
if (app.id === USER_SETTINGS_APPID) {
return {
status: userSettingsEnabled ? AppStatus.accessible : AppStatus.inaccessible,
navLinkStatus: userSettingsEnabled ? AppNavLinkStatus.visible : AppNavLinkStatus.hidden,
};
}
Expand Down
19 changes: 6 additions & 13 deletions src/plugins/advanced_settings/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ import { Observable } from 'rxjs';
import { first } from 'rxjs/operators';
import { capabilitiesProvider } from './capabilities_provider';
import { UserUISettingsClientWrapper } from './saved_objects/user_ui_settings_client_wrapper';
import { extractUserName } from './utils';

export class AdvancedSettingsServerPlugin implements Plugin<object, object> {
private readonly logger: Logger;
private userUiSettingsClientWrapper?: UserUISettingsClientWrapper;
private coreStart: CoreStart | undefined;
private readonly globalConfig$: Observable<SharedGlobalConfig>;

constructor(initializerContext: PluginInitializerContext) {
Expand Down Expand Up @@ -81,24 +79,19 @@ export class AdvancedSettingsServerPlugin implements Plugin<object, object> {
);

core.capabilities.registerSwitcher(async (request, capabilities) => {
const userName = extractUserName(request, this.coreStart);
if (userName) {
return {
...capabilities,
userSettings: {
enabled: true,
},
};
}
return capabilities;
return {
...capabilities,
userSettings: {
enabled: false,
},
};
});

return {};
}

public start(core: CoreStart) {
this.logger.debug('advancedSettings: Started');
this.coreStart = core;
this.userUiSettingsClientWrapper?.setCore(core);

return {};
Expand Down

0 comments on commit d1799e3

Please sign in to comment.