dbeaver/pro#9526 adds profile form#4390
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 67 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
…e it for admin settings in future without extra deps
| import { Bootstrap, injectable } from '@cloudbeaver/core-di'; | ||
|
|
||
| @injectable() | ||
| export class PluginConnectionNetworkHandlersBootstrap extends Bootstrap { |
…rofiles form as well
There was a problem hiding this comment.
Pull request overview
This PR introduces a new @cloudbeaver/plugin-connection-network-handlers package to centralize SSH network handler UI/logic and wires it into the common plugin set and connection forms. It also adds support for opening the Project Info form with a preselected tab and extends the Flex component with an extra-small gap option.
Changes:
- Added new
plugin-connection-network-handlerspackage (SSH form, helpers, validation, localization, module bootstrap). - Refactored existing SSH UI/logic in
plugin-connectionsto reuse the new package and moved SSH-related i18n strings out ofcore-connections. - Enhanced Project Info form to accept a default selected tab; added
xxsgap support incore-blocks/Flex.
Reviewed changes
Copilot reviewed 42 out of 43 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| webapp/yarn.lock | Adds workspace resolution and dependencies for the new plugin package. |
| webapp/packages/plugin-set-common/tsconfig.json | Adds TS project reference for the new plugin. |
| webapp/packages/plugin-set-common/src/index.ts | Registers the new plugin module in the common plugin set. |
| webapp/packages/plugin-set-common/package.json | Adds dependency on @cloudbeaver/plugin-connection-network-handlers. |
| webapp/packages/plugin-project-info/tsconfig.json | Adjusts TS include patterns (drops scss). |
| webapp/packages/plugin-project-info/src/ProjectInfoForm/ProjectInfoFormService.ts | Adds default tab selection support when opening Project Info form. |
| webapp/packages/plugin-project-info/src/ProjectInfoForm/ProjectInfoFormPanel.tsx | Passes selected tab id into TabsState. |
| webapp/packages/plugin-project-info/package.json | Removes scss from sideEffects list. |
| webapp/packages/plugin-connections/tsconfig.json | Adds TS project reference for the new plugin. |
| webapp/packages/plugin-connections/src/index.ts | Exposes additional exports including network handler config types. |
| webapp/packages/plugin-connections/src/ConnectionForm/SSH/SSH.tsx | Replaces inline SSH UI with SSHForm from the new plugin. |
| webapp/packages/plugin-connections/src/ConnectionForm/SSH/ConnectionFormSSHPart.ts | Moves SSH defaults/config/validation to the new plugin helpers. |
| webapp/packages/plugin-connections/src/ConnectionAuthentication/NetworkHandlerAuthForm.tsx | Reuses SSHKeyUploader from the new plugin. |
| webapp/packages/plugin-connections/package.json | Adds dependency on @cloudbeaver/plugin-connection-network-handlers. |
| webapp/packages/plugin-connection-network-handlers/tsconfig.json | New package TS build configuration. |
| webapp/packages/plugin-connection-network-handlers/src/SSH/validateSSHConfig.ts | New shared SSH validation helper. |
| webapp/packages/plugin-connection-network-handlers/src/SSH/SSHKeyUploader.tsx | Updates SSH key uploader to use plugin-scoped i18n keys. |
| webapp/packages/plugin-connection-network-handlers/src/SSH/sshHelpers.ts | New shared SSH defaults/config building + trimming. |
| webapp/packages/plugin-connection-network-handlers/src/SSH/SSHForm.tsx | New shared SSH form UI component. |
| webapp/packages/plugin-connection-network-handlers/src/SSH/sshAuthTypes.ts | Renames/exports SSH auth type list for reuse. |
| webapp/packages/plugin-connection-network-handlers/src/SSH/getNetworkHandlerDefaultProperties.ts | New helper for non-secured default properties. |
| webapp/packages/plugin-connection-network-handlers/src/module.ts | Registers plugin module. |
| webapp/packages/plugin-connection-network-handlers/src/LocaleService.ts | Adds plugin localization provider. |
| webapp/packages/plugin-connection-network-handlers/src/locales/zh.ts | Adds plugin SSH localization strings (ZH). |
| webapp/packages/plugin-connection-network-handlers/src/locales/vi.ts | Adds plugin SSH localization strings (VI). |
| webapp/packages/plugin-connection-network-handlers/src/locales/ru.ts | Adds plugin SSH localization strings (RU). |
| webapp/packages/plugin-connection-network-handlers/src/locales/it.ts | Adds plugin SSH localization strings (IT). |
| webapp/packages/plugin-connection-network-handlers/src/locales/fr.ts | Adds plugin SSH localization strings (FR). |
| webapp/packages/plugin-connection-network-handlers/src/locales/en.ts | Adds plugin SSH localization strings (EN). |
| webapp/packages/plugin-connection-network-handlers/src/locales/de.ts | Adds plugin SSH localization strings (DE). |
| webapp/packages/plugin-connection-network-handlers/src/index.ts | Exports plugin public API and ensures module bootstrap is loaded. |
| webapp/packages/plugin-connection-network-handlers/package.json | New package manifest, scripts, deps/exports. |
| webapp/packages/core-connections/src/locales/zh.ts | Removes SSH UI strings moved into the plugin (ZH). |
| webapp/packages/core-connections/src/locales/vi.ts | Removes SSH UI strings moved into the plugin (VI). |
| webapp/packages/core-connections/src/locales/ru.ts | Removes SSH UI strings moved into the plugin (RU). |
| webapp/packages/core-connections/src/locales/it.ts | Removes SSH UI strings moved into the plugin (IT). |
| webapp/packages/core-connections/src/locales/fr.ts | Removes SSH UI strings moved into the plugin (FR). |
| webapp/packages/core-connections/src/locales/en.ts | Removes SSH UI strings moved into the plugin (EN). |
| webapp/packages/core-connections/src/locales/de.ts | Removes SSH UI strings moved into the plugin (DE). |
| webapp/packages/core-connections/src/index.ts | Updates header year. |
| webapp/packages/core-blocks/src/Flex/Flex.tsx | Extends gap prop union to include xxs. |
| webapp/packages/core-blocks/src/Flex/Flex.module.css | Adds CSS styling for data-s-gap='xxs'. |
| webapp/packages/core-blocks/src/Containers/GroupBack.tsx | Uses the new xxs gap. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| this.formState?.dispose(); | ||
| this.formState = new FormState<IProjectInfoFormState>(this.serviceProvider, this, { projectId }).setMode(FormMode.Edit); | ||
|
|
| if (!state.properties?.['host']?.length) { | ||
| errors.push("Field SSH 'Host' can't be empty"); | ||
| } |
| const port = Number(state.properties?.['port']); | ||
| if (Number.isNaN(port) || port < 1) { | ||
| errors.push("Field SSH 'Port' can't be empty"); | ||
| } |
SychevAndrey
left a comment
There was a problem hiding this comment.
Great job! 👍🏻
Maybe we could add a gap parameter to GroupBack to not touch other parts of the app?
|
|
||
| return ( | ||
| <Flex gap="xs" align="center"> | ||
| <Flex gap="xxs" align="center"> |
There was a problem hiding this comment.
why do we need to change it through the whole app?
There was a problem hiding this comment.
I dont think we should, just apply speciifc style on the GroupBack level, no need to declare new style on the whole app level
There was a problem hiding this comment.
There was a problem hiding this comment.
I think its not about changing gap pixels, its about adding xxs variant, like we already have xs. We only need the xss here, in group back, so its better to adjust gap only here. Also all visual tests will fail and we need to update them because of that, this also a reason. If you insist, we can keep it
|
|
||
| return ( | ||
| <Flex gap="xs" align="center"> | ||
| <Flex gap="xxs" align="center"> |
There was a problem hiding this comment.
I dont think we should, just apply speciifc style on the GroupBack level, no need to declare new style on the whole app level
| delete handlerConfig.secureProperties; | ||
|
|
||
| return handlerConfig; | ||
| return getSSHHandlerConfig(this.state, this.initialState, this.optionsPart.state.sharedCredentials); |
There was a problem hiding this comment.
please dont move method's logic to separate functions unless you have several places where you will reuse them
|
|
||
| if (!keyAuth && this.state.savePassword && !passwordSaved && !this.state.password?.length) { | ||
| validation.error("Field SSH 'Password' can't be empty"); | ||
| for (const error of validateSSHConfig(this.state, this.initialState)) { |
There was a problem hiding this comment.
the same, why did you create a separate function for this? seems like its only used here
| active: selected, | ||
| }); | ||
|
|
||
| const SSHPart = getConnectionFormSSHPart(formState); |
There was a problem hiding this comment.
no biggie but alright
| @injectable(() => [LocalizationService, NotificationService, OptionsPanelService, IServiceProvider]) | ||
| export class ProjectInfoFormService extends FormBaseService<IProjectInfoFormState> { | ||
| formState: FormState<IProjectInfoFormState> | null; | ||
| defaultSelectedId: string | undefined; |
There was a problem hiding this comment.
This seems strange, please refer to the UserProfileOptionsPanelService where we open panel with predefined tabId like this, UserProfileOptionsPanelService.open(SETTINGS_TAB_ID), in general defaultSelectedId should not be stored here, only to be passed when opening.
There was a problem hiding this comment.
this is pretty much similar mechanism but more incapsulated and reuses existing code. look prettier now, thanks
| import { NetworkHandlerAuthType, type NetworkHandlerConfigInput } from '@cloudbeaver/core-sdk'; | ||
| import { toJS } from 'mobx'; | ||
|
|
||
| export const SSH_DEFAULT_HANDLER_CONFIG: () => NetworkHandlerConfigInput = () => ({ |
There was a problem hiding this comment.
i dont think we need this new file
There was a problem hiding this comment.
we definitely need this new file to reuse shared logic between 2 very similar parts which works with the same entity - SSH CONFIG
it allows to reuse common code between 2 parts of the app without repeating it again and again
There was a problem hiding this comment.
i can like maybe restructure it, it seems a bit messy after refactoring I agree. but shared logic is wether good than not




closes https://github.com/dbeaver/pro/issues/9526