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
opensearch-project#8263)

* 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>
(cherry picked from commit 5ea00ad)
  • Loading branch information
Hailong-am authored and yubonluo committed Sep 25, 2024
1 parent 4cae56a commit 0f0bf99
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 @@ -45,7 +45,12 @@ import {
AdvancedSettingsPluginSetup,
AdvancedSettingsPluginStart,
} from './types';
import { DEFAULT_NAV_GROUPS, AppNavLinkStatus, WorkspaceAvailability } from '../../../core/public';
import {
DEFAULT_NAV_GROUPS,
AppStatus,
AppNavLinkStatus,
WorkspaceAvailability,
} from '../../../core/public';
import { getScopedBreadcrumbs } from '../../opensearch_dashboards_react/public';
import { setupUserSettingsPage } from './management_app/user_settings';

Expand Down Expand Up @@ -187,6 +192,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 0f0bf99

Please sign in to comment.