-
Notifications
You must be signed in to change notification settings - Fork 507
dbeaver/pro#7897 add connection view plugin #4031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
devnaumov
wants to merge
17
commits into
devel
Choose a base branch
from
dbeaver/pro#7897-user-connection-view
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
dfc2ad8
dbeaver/pro#7897 add connection view plugin
devnaumov 76616b5
Merge branch 'devel' into dbeaver/pro#7897-user-connection-view
devnaumov 69ef685
dbeaver/pro#7897 add view settings to the connection dialog
devnaumov a0b1e38
dbeaver/pro#7897 navigator settings as separate resource
devnaumov dd4ef17
Merge remote-tracking branch 'origin/devel' into dbeaver/pro#7897-use…
yagudin10 1726441
Merge remote-tracking branch 'origin/devel' into dbeaver/pro#7897-use…
yagudin10 c607664
Merge remote-tracking branch 'origin/devel' into dbeaver/pro#7897-use…
yagudin10 5be6e3b
dbeaver/pro#7897 api for original navigator settings config
yagudin10 2d8f714
dbeaver/pro#7897 use original settings for connection dialog
devnaumov 66f97e0
dbeaver/pro#7897 save connection view fixes
yagudin10 7e57881
dbeaver/pro#7897 update node on reset
devnaumov feffcbb
dbeaver/pro#7897 remove extra comments
devnaumov 918c398
dbeaver/pro#7897 do not update node if only global settings had changed
devnaumov 6bfe2eb
dbeaver/pro#7897 reuse view
devnaumov 60a3a54
dbeaver/pro#7897 fixes after review
yagudin10 b7dff29
dbeaver/pro#7897 return old api for user settings
yagudin10 5fd94cc
dbeaver/pro#7897 change field name
devnaumov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,6 +141,7 @@ export default [ | |
| ['ui_field_is_required', 'Please fill in this field'], | ||
| ['ui_delete_confirmation_message', 'You are about to delete "{arg:item}". Are you sure?'], | ||
| ['ui_not_selected', 'Not selected'], | ||
| ['ui_reset', 'Reset'], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can be translated it to languages respectively using ai suggestions |
||
|
|
||
| ['root_permission_denied', "Vous n'avez pas les permissions"], | ||
| ['root_permission_no_permission', "Vous n'avez pas la permission pour cette action"], | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
webapp/packages/core-root/src/ConnectionNavigatorViewSettings.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
webapp/packages/core-sdk/src/queries/connections/clearConnectionNavigatorSettings.gql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| mutation clearConnectionNavigatorSettings($id: ID!, $projectId: ID!) { | ||
| connection: clearConnectionNavigatorSettings(id: $id, projectId: $projectId) { | ||
| ...DatabaseConnectionNavigatorViewSettings | ||
| } | ||
| } |
5 changes: 5 additions & 0 deletions
5
webapp/packages/core-sdk/src/queries/connections/getUserConnectionsNavigatorViewSettings.gql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| query getUserConnectionsNavigatorViewSettings($projectId: ID, $connectionId: ID, $projectIds: [ID!]) { | ||
| connections: userConnections(projectId: $projectId, id: $connectionId, projectIds: $projectIds) { | ||
| ...DatabaseConnectionNavigatorViewSettings | ||
| } | ||
| } |
2 changes: 1 addition & 1 deletion
2
webapp/packages/core-sdk/src/queries/connections/setConnectionNavigatorSettings.gql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| mutation setConnectionNavigatorSettings($projectId: ID!, $connectionId: ID!, $settings: NavigatorSettingsInput!) { | ||
| connection: setConnectionNavigatorSettings(projectId: $projectId, id: $connectionId, settings: $settings) { | ||
| ...DatabaseConnection | ||
| ...DatabaseConnectionNavigatorViewSettings | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,4 +6,6 @@ fragment AllNavigatorSettings on NavigatorSettings { | |
| hideFolders | ||
| hideSchemas | ||
| hideVirtualModel | ||
| } | ||
|
|
||
| userSettings | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
webapp/packages/core-sdk/src/queries/fragments/DatabaseConnectionNavigatorViewSettings.gql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| fragment DatabaseConnectionNavigatorViewSettings on ConnectionInfo { | ||
| id | ||
| projectId | ||
| navigatorSettings { | ||
| ...AllNavigatorSettings | ||
| } | ||
| originalNavigatorSettings { | ||
| ...AllNavigatorSettings | ||
| } | ||
Wroud marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| { | ||
| "name": "@cloudbeaver/plugin-connection-view", | ||
| "type": "module", | ||
| "sideEffects": [ | ||
| "./lib/module.js", | ||
| "./lib/index.js", | ||
| "src/**/*.css", | ||
| "src/**/*.scss", | ||
| "public/**/*" | ||
| ], | ||
| "version": "0.1.0", | ||
| "description": "", | ||
| "license": "Apache-2.0", | ||
| "exports": { | ||
| ".": "./lib/index.js", | ||
| "./module": "./lib/module.js" | ||
| }, | ||
| "scripts": { | ||
| "build": "tsc -b", | ||
| "clean": "rimraf --glob lib", | ||
| "lint": "eslint ./src/ --ext .ts,.tsx", | ||
| "validate-dependencies": "core-cli-validate-dependencies" | ||
| }, | ||
| "dependencies": { | ||
| "@cloudbeaver/core-blocks": "workspace:*", | ||
| "@cloudbeaver/core-connections": "workspace:*", | ||
| "@cloudbeaver/core-data-context": "workspace:*", | ||
| "@cloudbeaver/core-di": "workspace:*", | ||
| "@cloudbeaver/core-events": "workspace:*", | ||
| "@cloudbeaver/core-localization": "workspace:*", | ||
| "@cloudbeaver/core-navigation-tree": "workspace:*", | ||
| "@cloudbeaver/core-projects": "workspace:*", | ||
| "@cloudbeaver/core-resource": "workspace:*", | ||
| "@cloudbeaver/core-root": "workspace:*", | ||
| "@cloudbeaver/core-sdk": "workspace:*", | ||
| "@cloudbeaver/core-ui": "workspace:*", | ||
| "@cloudbeaver/core-utils": "workspace:*", | ||
| "@cloudbeaver/core-view": "workspace:*", | ||
| "@cloudbeaver/plugin-connections": "workspace:*", | ||
| "@dbeaver/js-helpers": "workspace:*", | ||
| "mobx": "^6", | ||
| "mobx-react-lite": "^4", | ||
| "react": "^19", | ||
| "react-dom": "^19", | ||
| "tslib": "^2" | ||
| }, | ||
| "devDependencies": { | ||
| "@cloudbeaver/core-cli": "workspace:*", | ||
| "@cloudbeaver/tsconfig": "workspace:*", | ||
| "@types/react": "^19", | ||
| "rimraf": "^6", | ||
| "typescript": "^5", | ||
| "typescript-plugin-css-modules": "^5" | ||
| } | ||
| } |
4 changes: 2 additions & 2 deletions
4
...ctions/ACTION_CONNECTION_VIEW_ADVANCED.ts → ...ctions/ACTION_CONNECTION_VIEW_ADVANCED.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| /* | ||
| * CloudBeaver - Cloud Database Manager | ||
| * Copyright (C) 2020-2024 DBeaver Corp and others | ||
| * Copyright (C) 2020-2026 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 { createAction } from '@cloudbeaver/core-view'; | ||
|
|
||
| export const ACTION_CONNECTION_VIEW_ADVANCED = createAction('connection-view-advanced', { | ||
| label: 'app_navigationTree_connection_view_option_advanced', | ||
| label: 'plugin_connection_view_option_advanced', | ||
| type: 'select', | ||
| }); |
14 changes: 14 additions & 0 deletions
14
webapp/packages/plugin-connection-view/src/Actions/ACTION_CONNECTION_VIEW_RESET.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /* | ||
| * CloudBeaver - Cloud Database Manager | ||
| * Copyright (C) 2020-2026 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 { createAction } from '@cloudbeaver/core-view'; | ||
|
|
||
| export const ACTION_CONNECTION_VIEW_RESET = createAction('connection-view-reset', { | ||
| label: 'ui_reset', | ||
| tooltip: 'plugin_connection_view_option_reset_description', | ||
| }); |
4 changes: 2 additions & 2 deletions
4
.../Actions/ACTION_CONNECTION_VIEW_SIMPLE.ts → .../Actions/ACTION_CONNECTION_VIEW_SIMPLE.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| /* | ||
| * CloudBeaver - Cloud Database Manager | ||
| * Copyright (C) 2020-2024 DBeaver Corp and others | ||
| * Copyright (C) 2020-2026 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 { createAction } from '@cloudbeaver/core-view'; | ||
|
|
||
| export const ACTION_CONNECTION_VIEW_SIMPLE = createAction('connection-view-simple', { | ||
| label: 'app_navigationTree_connection_view_option_simple', | ||
| label: 'plugin_connection_view_option_simple', | ||
| type: 'select', | ||
| }); |
5 changes: 3 additions & 2 deletions
5
.../ACTION_CONNECTION_VIEW_SYSTEM_OBJECTS.ts → .../ACTION_CONNECTION_VIEW_SYSTEM_OBJECTS.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,14 @@ | ||
| /* | ||
| * CloudBeaver - Cloud Database Manager | ||
| * Copyright (C) 2020-2024 DBeaver Corp and others | ||
| * Copyright (C) 2020-2026 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 { createAction } from '@cloudbeaver/core-view'; | ||
|
|
||
| export const ACTION_CONNECTION_VIEW_SYSTEM_OBJECTS = createAction('connection-view-system-objects', { | ||
| label: 'app_navigationTree_connection_view_option_showSystemObjects', | ||
| label: 'plugin_connection_view_option_show_system_objects', | ||
| type: 'checkbox', | ||
| }); |
44 changes: 44 additions & 0 deletions
44
webapp/packages/plugin-connection-view/src/ConnectionViewForm.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| /* | ||
| * CloudBeaver - Cloud Database Manager | ||
| * Copyright (C) 2020-2026 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 { observer } from 'mobx-react-lite'; | ||
|
|
||
| import { Container, FieldCheckbox, Group, GroupTitle, useAutoLoad, useTranslate } from '@cloudbeaver/core-blocks'; | ||
| import { CONNECTION_NAVIGATOR_VIEW_SETTINGS, isNavigatorViewSettingsEqual } from '@cloudbeaver/core-root'; | ||
| import { getConnectionFormOptionsPart, type ConnectionFormContainerProps } from '@cloudbeaver/plugin-connections'; | ||
|
|
||
| import { getConnectionViewPart } from './getConnectionViewPart.js'; | ||
|
|
||
| export const ConnectionViewForm = observer<ConnectionFormContainerProps>(function ConnectionViewForm({ formState }) { | ||
| const translate = useTranslate(); | ||
| const optionsFormPart = getConnectionFormOptionsPart(formState); | ||
| const viewFormPart = getConnectionViewPart(formState); | ||
|
|
||
| useAutoLoad(ConnectionViewForm, [optionsFormPart, viewFormPart]); | ||
|
|
||
| const isSimple = isNavigatorViewSettingsEqual(viewFormPart.state, CONNECTION_NAVIGATOR_VIEW_SETTINGS.simple); | ||
|
|
||
| function changeView() { | ||
| const view = isSimple ? CONNECTION_NAVIGATOR_VIEW_SETTINGS.advanced : CONNECTION_NAVIGATOR_VIEW_SETTINGS.simple; | ||
| viewFormPart.state = { ...viewFormPart.state, ...view }; | ||
| } | ||
|
|
||
| return ( | ||
| <Group form gap> | ||
| <GroupTitle>{translate('plugin_connection_view')}</GroupTitle> | ||
| <Container gap dense> | ||
| <FieldCheckbox id="simple" checked={isSimple} onChange={changeView}> | ||
| {translate('plugin_connection_view_option_simple')} | ||
| </FieldCheckbox> | ||
sergeyteleshev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <FieldCheckbox name="showSystemObjects" state={viewFormPart.state}> | ||
| {translate('plugin_connection_view_option_show_system_objects')} | ||
| </FieldCheckbox> | ||
| </Container> | ||
| </Group> | ||
| ); | ||
| }); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.