mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-24 11:35:54 +08:00
fix(plugin-user-profile): CB-1399 change dependency direction
This commit is contained in:
@@ -6,24 +6,20 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import { AdministrationTopAppBarService } from '@cloudbeaver/core-administration';
|
||||
import { injectable, Bootstrap } from '@cloudbeaver/core-di';
|
||||
import { ServerConfigurationService } from '@cloudbeaver/plugin-administration';
|
||||
import { UserMenu } from '@cloudbeaver/plugin-authentication';
|
||||
|
||||
import { AuthenticationProviders } from './Administration/ServerConfiguration/AuthenticationProviders';
|
||||
|
||||
@injectable()
|
||||
export class PluginBootstrap extends Bootstrap {
|
||||
constructor(
|
||||
private administrationTopAppBarService: AdministrationTopAppBarService,
|
||||
private readonly serverConfigurationService: ServerConfigurationService,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
register(): void {
|
||||
this.administrationTopAppBarService.placeholder.add(UserMenu, 4);
|
||||
this.serverConfigurationService.configurationContainer.add(AuthenticationProviders, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,14 +6,13 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import { SettingsMenuService, TopNavService } from '@cloudbeaver/core-app';
|
||||
import { SettingsMenuService } from '@cloudbeaver/core-app';
|
||||
import { AuthInfoService } from '@cloudbeaver/core-authentication';
|
||||
import { injectable, Bootstrap } from '@cloudbeaver/core-di';
|
||||
import { ServerConfigResource } from '@cloudbeaver/core-root';
|
||||
|
||||
import { AuthenticationService } from './AuthenticationService';
|
||||
import { AuthDialogService } from './Dialog/AuthDialogService';
|
||||
import { UserMenu } from './UserMenu/UserMenu';
|
||||
|
||||
@injectable()
|
||||
export class PluginBootstrap extends Bootstrap {
|
||||
@@ -23,7 +22,6 @@ export class PluginBootstrap extends Bootstrap {
|
||||
private readonly authenticationService: AuthenticationService,
|
||||
private readonly authInfoService: AuthInfoService,
|
||||
private readonly settingsMenuService: SettingsMenuService,
|
||||
private readonly topNavService: TopNavService,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -50,7 +48,6 @@ export class PluginBootstrap extends Bootstrap {
|
||||
onClick: this.authenticationService.logout.bind(this.authenticationService),
|
||||
}
|
||||
);
|
||||
this.topNavService.placeholder.add(UserMenu, 4);
|
||||
}
|
||||
|
||||
load(): void | Promise<void> { }
|
||||
|
||||
@@ -4,5 +4,3 @@ export default manifest;
|
||||
|
||||
export * from './AuthenticationService';
|
||||
export * from './Dialog/AuthDialogService';
|
||||
export * from './UserMenu/MENU_USER_PROFILE';
|
||||
export * from './UserMenu/UserMenu';
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# dependencies
|
||||
/node_modules
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/lib
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env*
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "@cloudbeaver/plugin-user-profile-administration",
|
||||
"sideEffects": false,
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
"license": "Apache-2.0",
|
||||
"main": "lib/index.js",
|
||||
"module": "lib/index.js",
|
||||
"types": "src/index.ts",
|
||||
"scripts": {
|
||||
"prebuild": "rimraf lib/*",
|
||||
"build": "webpack --config ../../configs/webpack.plugin.config.js",
|
||||
"postbuild": "tsc",
|
||||
"lint": "eslint ./src/ --ext .ts,.tsx",
|
||||
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@cloudbeaver/core-administration": "^0.1.0",
|
||||
"@cloudbeaver/core-app": "^0.1.0",
|
||||
"@cloudbeaver/core-authentication": "^0.1.0",
|
||||
"@cloudbeaver/core-blocks": "^0.1.0",
|
||||
"@cloudbeaver/core-connections": "^0.1.0",
|
||||
"@cloudbeaver/core-di": "^0.1.0",
|
||||
"@cloudbeaver/core-dialogs": "^0.1.0",
|
||||
"@cloudbeaver/core-events": "^0.1.0",
|
||||
"@cloudbeaver/core-executor": "^0.1.0",
|
||||
"@cloudbeaver/core-extensions": "^0.1.0",
|
||||
"@cloudbeaver/core-localization": "^0.1.0",
|
||||
"@cloudbeaver/core-notifications": "^0.1.0",
|
||||
"@cloudbeaver/core-plugin": "^0.1.0",
|
||||
"@cloudbeaver/core-product": "^0.1.0",
|
||||
"@cloudbeaver/core-root": "^0.1.0",
|
||||
"@cloudbeaver/core-routing": "^0.1.0",
|
||||
"@cloudbeaver/core-sdk": "^0.1.0",
|
||||
"@cloudbeaver/core-settings": "^0.1.0",
|
||||
"@cloudbeaver/core-theming": "^0.1.0",
|
||||
"@cloudbeaver/core-ui": "^0.1.0",
|
||||
"@cloudbeaver/core-utils": "^0.1.0",
|
||||
"@cloudbeaver/core-view": "^0.1.0",
|
||||
"@cloudbeaver/plugin-user-profile": "^0.1.0",
|
||||
"react": "^16.x.x",
|
||||
"mobx": "^6.x.x",
|
||||
"mobx-react-lite": "^3.x.x",
|
||||
"reshadow": "^0.x.x"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2021 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import { AdministrationTopAppBarService } from '@cloudbeaver/core-administration';
|
||||
import { Bootstrap, injectable } from '@cloudbeaver/core-di';
|
||||
import { UserMenu } from '@cloudbeaver/plugin-user-profile';
|
||||
|
||||
@injectable()
|
||||
export class PluginBootstrap extends Bootstrap {
|
||||
constructor(
|
||||
private readonly administrationTopAppBarService: AdministrationTopAppBarService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
register(): void {
|
||||
this.administrationTopAppBarService.placeholder.add(UserMenu, 4);
|
||||
}
|
||||
|
||||
load(): void { }
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import { userProfileAdministrationPlugin } from './manifest';
|
||||
|
||||
export default userProfileAdministrationPlugin;
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2021 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import type { PluginManifest } from '@cloudbeaver/core-di';
|
||||
|
||||
import { PluginBootstrap } from './PluginBootstrap';
|
||||
|
||||
export const userProfileAdministrationPlugin: PluginManifest = {
|
||||
info: {
|
||||
name: 'User profile administration plugin',
|
||||
},
|
||||
|
||||
providers: [
|
||||
PluginBootstrap,
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib"
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["**/node_modules", "**/.*/"],
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2021 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import { TopNavService } from '@cloudbeaver/core-app';
|
||||
import { Bootstrap, injectable } from '@cloudbeaver/core-di';
|
||||
|
||||
import { UserMenu } from './UserMenu/UserMenu';
|
||||
|
||||
@injectable()
|
||||
export class PluginBootstrap extends Bootstrap {
|
||||
constructor(
|
||||
private readonly topNavService: TopNavService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
register(): void {
|
||||
this.topNavService.placeholder.add(UserMenu, 4);
|
||||
}
|
||||
|
||||
load(): void { }
|
||||
}
|
||||
+3
-2
@@ -14,7 +14,8 @@ import { useService } from '@cloudbeaver/core-di';
|
||||
import { useTranslate } from '@cloudbeaver/core-localization';
|
||||
import type { UserInfo as IUserInfo } from '@cloudbeaver/core-sdk';
|
||||
import { composes, useStyles } from '@cloudbeaver/core-theming';
|
||||
import { UserProfileService } from '@cloudbeaver/plugin-user-profile';
|
||||
|
||||
import { UserProfileService } from './UserProfileService';
|
||||
|
||||
const styles = composes(
|
||||
css`
|
||||
@@ -51,7 +52,7 @@ export const UserInfo = observer<Props>(function UserInfo({ info }) {
|
||||
const userProfileService = useService(UserProfileService);
|
||||
|
||||
return styled(style)(
|
||||
<user title={translate('plugin_user_profile_menu')} onClick={userProfileService.open}>
|
||||
<user title={translate('plugin_user_profile_menu')} onClick={() => userProfileService.open()}>
|
||||
<user-icon>
|
||||
<IconOrImage icon='user' viewBox='0 0 28 28' />
|
||||
</user-icon>
|
||||
@@ -47,7 +47,7 @@ export class UserProfileService {
|
||||
}
|
||||
}
|
||||
|
||||
open = async (): Promise<boolean> => {
|
||||
async open(): Promise<boolean> {
|
||||
const state = await this.optionsPanelService.open(formGetter);
|
||||
|
||||
if (state) {
|
||||
@@ -55,7 +55,7 @@ export class UserProfileService {
|
||||
}
|
||||
|
||||
return state;
|
||||
};
|
||||
}
|
||||
|
||||
async close(saved?: boolean): Promise<void> {
|
||||
if (saved) {
|
||||
|
||||
@@ -2,4 +2,5 @@ import { userProfilePlugin } from './manifest';
|
||||
|
||||
export default userProfilePlugin;
|
||||
|
||||
export * from './UserProfileService';
|
||||
export * from './UserMenu/MENU_USER_PROFILE';
|
||||
export * from './UserMenu/UserMenu';
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import type { PluginManifest } from '@cloudbeaver/core-di';
|
||||
|
||||
import { LocaleService } from './LocaleService';
|
||||
import { PluginBootstrap } from './PluginBootstrap';
|
||||
import { UserProfileService } from './UserProfileService';
|
||||
|
||||
export const userProfilePlugin: PluginManifest = {
|
||||
@@ -17,6 +18,7 @@ export const userProfilePlugin: PluginManifest = {
|
||||
},
|
||||
|
||||
providers: [
|
||||
PluginBootstrap,
|
||||
LocaleService,
|
||||
UserProfileService,
|
||||
],
|
||||
|
||||
@@ -20,6 +20,7 @@ import sqlEditor from '@cloudbeaver/plugin-sql-editor';
|
||||
import sqlEditorTab from '@cloudbeaver/plugin-sql-editor-navigation-tab';
|
||||
import sqlEditorScreen from '@cloudbeaver/plugin-sql-editor-screen';
|
||||
import userProfile from '@cloudbeaver/plugin-user-profile';
|
||||
import userProfileAdministration from '@cloudbeaver/plugin-user-profile-administration';
|
||||
|
||||
import { defaultProductManifest } from './manifest';
|
||||
|
||||
@@ -39,6 +40,7 @@ const PLUGINS: PluginManifest[] = [
|
||||
sqlEditorTab,
|
||||
sqlEditorScreen,
|
||||
userProfile,
|
||||
userProfileAdministration,
|
||||
defaultProductManifest,
|
||||
connectionPlugin,
|
||||
connectionAdministration,
|
||||
|
||||
Reference in New Issue
Block a user