Skip to content

dbeaver/pro#8197 add connection preferences plugin#4111

Merged
serge-rider merged 11 commits intodevelfrom
dbeaver/pro#8197-connection-preferences-form
Feb 10, 2026
Merged

dbeaver/pro#8197 add connection preferences plugin#4111
serge-rider merged 11 commits intodevelfrom
dbeaver/pro#8197-connection-preferences-form

Conversation

@devnaumov
Copy link
Copy Markdown
Member

closes 8197

@devnaumov devnaumov marked this pull request as ready for review February 8, 2026 16:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new @cloudbeaver/plugin-connection-preferences package and wires it into the common plugin set, exposing a “connection preferences” action that opens an options-panel form (currently with an Info tab backed by connection metadata).

Changes:

  • Added new plugin-connection-preferences package (module, bootstrap, panel, form scaffolding, locales).
  • Integrated the plugin into plugin-set-common (deps, TS references, and runtime set registration).
  • Moved/centralized connection config Zod schemas to core-connections and updated plugin-connections to consume them.

Reviewed changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
webapp/yarn.lock Adds workspace entry + dependency linkage for the new plugin package.
webapp/packages/plugin-set-common/tsconfig.json Adds TS project reference to plugin-connection-preferences.
webapp/packages/plugin-set-common/src/index.ts Imports and appends plugin-connection-preferences to commonSet.
webapp/packages/plugin-set-common/package.json Adds @cloudbeaver/plugin-connection-preferences dependency.
webapp/packages/plugin-connections/src/ConnectionForm/Options/IConnectionFormOptionsState.ts Switches options schema base to core-connections exported schema.
webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/ConnectionFormDriverPropertiesPart.ts Uses CONNECTION_PROPERTIES_SCHEMA inference from core-connections instead of local config typing.
webapp/packages/plugin-connection-preferences/tsconfig.json New plugin TS build configuration and project references.
webapp/packages/plugin-connection-preferences/src/module.ts Registers plugin services/bootstraps in DI container.
webapp/packages/plugin-connection-preferences/src/locales/en.ts Adds plugin locale stub.
webapp/packages/plugin-connection-preferences/src/locales/fr.ts Adds plugin locale stub.
webapp/packages/plugin-connection-preferences/src/locales/it.ts Adds plugin locale stub.
webapp/packages/plugin-connection-preferences/src/locales/ru.ts Adds plugin locale stub.
webapp/packages/plugin-connection-preferences/src/locales/vi.ts Adds plugin locale stub.
webapp/packages/plugin-connection-preferences/src/locales/zh.ts Adds plugin locale stub.
webapp/packages/plugin-connection-preferences/src/index.ts Plugin entrypoint (side-effect module import + exports).
webapp/packages/plugin-connection-preferences/src/actions/ACTION_CONNECTION_PREFERENCES.ts Defines new action used in menus to open preferences panel.
webapp/packages/plugin-connection-preferences/src/LocaleService.ts Adds localization provider for plugin locales.
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesPanelService.ts Manages opening/closing options-panel and form state lifecycle.
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesPanel.tsx Lazy-loaded panel container rendering the form loader.
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesForm/IConnectionPreferencesFormState.ts Defines form state schema/types (connection key).
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesForm/ConnectionPreferencesFormState.ts Implements FormState wrapper for the plugin form.
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesForm/ConnectionPreferencesFormService.ts Declares form service and registers actions placeholder container.
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesForm/ConnectionPreferencesFormLoader.ts Lazy-load wrapper for the form component.
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesForm/ConnectionPreferencesFormInfo/getConnectionPreferencesFormInfoPart.ts Creates/gets the Info form-part via data-context/DI.
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesForm/ConnectionPreferencesFormInfo/IConnectionPreferencesFormInfoState.ts Info tab state schema derived from connection config schema.
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesForm/ConnectionPreferencesFormInfo/ConnectionPreferencesInfoTabService.ts Registers the “Info” tab into the form’s parts container.
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesForm/ConnectionPreferencesFormInfo/ConnectionPreferencesFormInfoPart.ts Loads connection info into the form part (read-only).
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesForm/ConnectionPreferencesFormInfo/ConnectionPreferencesFormInfo.tsx Renders Info tab UI using loaded resources.
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesForm/ConnectionPreferencesFormBaseActions.tsx Provides Cancel/Save action buttons via placeholder.
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesForm/ConnectionPreferencesFormActionsContext.ts Context for form actions (save/cancel).
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesForm/ConnectionPreferencesForm.tsx Form wrapper, tabs layout, submit handling + notifications.
webapp/packages/plugin-connection-preferences/src/ConnectionPreferencesBootstrap.ts Adds menu creator + action handler to open the preferences panel.
webapp/packages/plugin-connection-preferences/package.json New package manifest (exports, deps, scripts).
webapp/packages/plugin-connection-preferences/.gitignore Plugin-level ignores for build/test artifacts.
webapp/packages/core-connections/src/index.ts Re-exports CONNECTION_CONFIG_SCHEMA module publicly.
webapp/packages/core-connections/src/CONNECTION_CONFIG_SCHEMA.ts Expands/centralizes connection config + network handler schemas.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +11 to +13
export const ACTION_CONNECTION_PREFERENCES = createAction('connection-preferences', {
label: 'Preferences',
});
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

label is hard-coded as "Preferences". Other actions in this codebase use localization keys (e.g., plugin-connection-custom/search), so this won’t be translatable and also doesn’t use the locale entries added in this plugin. Use a localization key for the action label (and add it to the plugin locales) instead of a raw English string.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +30
this.connectionFormService.parts.add({
key: 'preferences-info',
name: 'Info',
order: 1,
panel: () => ConnectionPreferencesFormInfo,
});
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The tab name is hard-coded as "Info". In existing form tab registrations, name is typically a localization key (e.g., plugin_connections_connection_form_part_main). Use a localization key (for example the existing ui_information) and add plugin-specific keys if needed.

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +23
const ConnectionFormBaseActionsLoader = importLazyComponent(() =>
import('./ConnectionPreferencesFormBaseActions.js').then(m => m.ConnectionPreferencesFormBaseActions),
);

export type ConnectionFormContainerProps = {
formState: IFormState<IConnectionPreferencesFormState>;
};
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

There are a couple of newly introduced identifiers that still use the generic "ConnectionForm" naming (ConnectionFormBaseActionsLoader, ConnectionFormContainerProps) even though this is the ConnectionPreferences form. Renaming them to ConnectionPreferences... variants will avoid confusion when navigating/searching the codebase.

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +32
export const ConnectionPreferencesForm = observer<ConnectionPreferencesFormProps>(function ConnectionPreferencesForm({ formState, onCancel }) {
const connectionPreferencesFormServicee = useService(ConnectionPreferencesFormService);
const notificationService = useService(NotificationService);

Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Local variable connectionPreferencesFormServicee has a typo (double "e"). This makes the code harder to read/search and is easy to fix by renaming it to connectionPreferencesFormService (and updating references below).

Copilot uses AI. Check for mistakes.
if (this.formState.mode === 'edit' && this.formState.state) {
const key = createConnectionParam(this.formState.state.projectId, this.formState.state.connectionId);

// probably should implement a separate method as we can load only public accessible connection info here (not implemeted on the backend yet)
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Typo in comment: "implemeted" should be "implemented".

Suggested change
// probably should implement a separate method as we can load only public accessible connection info here (not implemeted on the backend yet)
// probably should implement a separate method as we can load only public accessible connection info here (not implemented on the backend yet)

Copilot uses AI. Check for mistakes.
SychevAndrey
SychevAndrey previously approved these changes Feb 9, 2026
Comment thread webapp/packages/plugin-connection-preferences/src/locales/en.ts Outdated
}

protected override async loader(): Promise<void> {
if (this.formState.mode === 'edit' && this.formState.state) {
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 form should always be in the edit mode by design so you probably don't need this check

serviceCollection
.addSingleton(Bootstrap, LocaleService)
.addSingleton(Bootstrap, proxy(ConnectionPreferencesBootstrap))
.addSingleton(Bootstrap, proxy(ConnectionPreferencesInfoTabService))
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.

Since it's a bootstrap ConnectionPreferencesInfoTabService, probably you need to change the Service suffix to Bootstrap

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We dont use Bootstrap suffix for tab services across the codebase, do you think we need to change that?

sergeyteleshev
sergeyteleshev previously approved these changes Feb 9, 2026
@serge-rider serge-rider merged commit 058a341 into devel Feb 10, 2026
10 checks passed
@serge-rider serge-rider deleted the dbeaver/pro#8197-connection-preferences-form branch March 10, 2026 07: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.

8 participants