Skip to content

dbeaver/pro#9526 adds profile form#4390

Open
sergeyteleshev wants to merge 17 commits into
develfrom
9526-cb-add-profiles-to-project-form
Open

dbeaver/pro#9526 adds profile form#4390
sergeyteleshev wants to merge 17 commits into
develfrom
9526-cb-add-profiles-to-project-form

Conversation

@sergeyteleshev

@sergeyteleshev sergeyteleshev commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@sergeyteleshev sergeyteleshev self-assigned this Jun 9, 2026
@codacy-production

codacy-production Bot commented Jun 9, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 67 complexity

Metric Results
Complexity 67

View in Codacy

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.

@sergeyteleshev sergeyteleshev marked this pull request as ready for review June 12, 2026 22:40
import { Bootstrap, injectable } from '@cloudbeaver/core-di';

@injectable()
export class PluginConnectionNetworkHandlersBootstrap extends Bootstrap {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's empty

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-handlers package (SSH form, helpers, validation, localization, module bootstrap).
  • Refactored existing SSH UI/logic in plugin-connections to reuse the new package and moved SSH-related i18n strings out of core-connections.
  • Enhanced Project Info form to accept a default selected tab; added xxs gap support in core-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.

Comment on lines +52 to 54
this.formState?.dispose();
this.formState = new FormState<IProjectInfoFormState>(this.serviceProvider, this, { projectId }).setMode(FormMode.Edit);

Comment on lines +13 to +15
if (!state.properties?.['host']?.length) {
errors.push("Field SSH 'Host' can't be empty");
}
Comment on lines +17 to +20
const port = Number(state.properties?.['port']);
if (Number.isNaN(port) || port < 1) {
errors.push("Field SSH 'Port' can't be empty");
}
Comment thread webapp/packages/plugin-connection-network-handlers/src/SSH/validateSSHConfig.ts Outdated
SychevAndrey
SychevAndrey previously approved these changes Jun 16, 2026

@SychevAndrey SychevAndrey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to change it through the whole app?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think we should, just apply speciifc style on the GroupBack level, no need to declare new style on the whole app level

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets not be afraid of changes here, please.I simply removed 4 pixels all over the forms for navigation arrow

we should not be paranoid about every change. just look at the screenshots, it became a bit prettier, isn't it great? previously spacing is kinda gigantic

Screenshot 2026-06-17 at 13 16 15 image

@devnaumov devnaumov Jun 17, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please dont move method's logic to separate functions unless you have several places where you will reuse them

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have 2 places where we use it. Thats why I moved some common logic between connection crete/edit SSH part and profile SSH part so I can reuse it

Screenshot 2026-06-17 at 13 21 44


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)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same, why did you create a separate function for this? seems like its only used here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is also reused. we need to validate config in 2 forms the same way

Screenshot 2026-06-17 at 13 24 08

active: selected,
});

const SSHPart = getConnectionFormSSHPart(formState);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sshPart

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no biggie but alright

@injectable(() => [LocalizationService, NotificationService, OptionsPanelService, IServiceProvider])
export class ProjectInfoFormService extends FormBaseService<IProjectInfoFormState> {
formState: FormState<IProjectInfoFormState> | null;
defaultSelectedId: string | undefined;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sergeyteleshev sergeyteleshev Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is pretty much similar mechanism but more incapsulated and reuses existing code. look prettier now, thanks

2ec2be5

import { NetworkHandlerAuthType, type NetworkHandlerConfigInput } from '@cloudbeaver/core-sdk';
import { toJS } from 'mobx';

export const SSH_DEFAULT_HANDLER_CONFIG: () => NetworkHandlerConfigInput = () => ({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont think we need this new file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can like maybe restructure it, it seems a bit messy after refactoring I agree. but shared logic is wether good than not

@sergeyteleshev sergeyteleshev requested a review from devnaumov June 17, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants