Skip to content

Conversation

@devnaumov
Copy link
Member

closes 7897

@devnaumov devnaumov requested review from SychevAndrey, Wroud and sergeyteleshev and removed request for sergeyteleshev January 12, 2026 18:11
@devnaumov devnaumov marked this pull request as ready for review January 12, 2026 18:11
Comment on lines 551 to +553
navigatorSettings: NavigatorSettings!
"Original navigator settings from the configuration file"
originalNavigatorSettings: NavigatorSettings! @since(version: "25.3.3")
Copy link
Member

Choose a reason for hiding this comment

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

actually you can add optional argument for the navigatorSettings field, something like:

navigatorSettings(datasourceSettings: Boolean): NavigatorSettings!

Copy link
Member

Choose a reason for hiding this comment

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

userSettings should be removed from the NavigatorSettingsInput type, instead you need to add similar argument to the setConnectionNavigatorSettings

originalNavigatorSettings better to rename to the datasourceNavigatorSettings

Comment on lines +7 to +9
originalNavigatorSettings {
...AllNavigatorSettings
}
Copy link
Member

Choose a reason for hiding this comment

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

probably you need to split it into two fragments and two resources, because originalNavigatorSettings needed only for connection editing form

Copy link
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

This PR extracts connection view functionality from plugin-connections into a new dedicated plugin plugin-connection-view. The change refactors view settings management for database connections, allowing users to configure simple/advanced views and system object visibility.

Changes:

  • Created new @cloudbeaver/plugin-connection-view plugin with dedicated services, resources, and UI components
  • Moved connection view menu actions and handlers from plugin-connections to the new plugin
  • Updated GraphQL schema to include originalNavigatorSettings field and added new queries/mutations for view settings
  • Enhanced backend logic to handle user-specific settings for shared projects

Reviewed changes

Copilot reviewed 53 out of 54 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
webapp/packages/plugin-connection-view/* New plugin package with connection view functionality including services, resources, UI components, and localization
webapp/packages/plugin-connections/src/ContextMenu/ConnectionMenuBootstrap.ts Removed connection view menu logic (moved to new plugin)
webapp/packages/plugin-connections/src/ConnectionForm/* Added connection container placeholder for view settings in connection form
webapp/packages/core-sdk/src/queries/* Updated GraphQL fragments and queries to support separate navigator view settings
webapp/packages/core-connections/src/ConnectionInfoResource.ts Removed changeConnectionView method (moved to new resource)
webapp/packages/plugin-navigation-tree/src/locales/* Removed old connection view locale keys (moved to new plugin)
server/bundles/io.cloudbeaver.server/* Enhanced backend to properly handle user settings for shared projects

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

['plugin_connection_view_option_advanced', 'Nâng cao'],
['plugin_connection_view_option_custom', 'Tùy chỉnh'],
['plugin_connection_view_option_show_system_objects', 'Hiển thị đối tượng hệ thống'],
['plugin_connection_view_option_reset_description', 'This will reset the connection view settings to default values'],
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The reset description is not translated to Vietnamese. All other languages have English text for this key, but this should be translated consistently with the rest of the file.

Copilot uses AI. Check for mistakes.
['plugin_connection_view_option_simple', 'Simple'],
['plugin_connection_view_option_advanced', 'Avancée'],
['plugin_connection_view_option_custom', 'Personnalisée'],
['plugin_connection_view_option_reset_description', 'This will reset the connection view settings to default values'],
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The reset description is not translated to French. All other languages have English text for this key, but this should be translated consistently with the rest of the file.

Copilot uses AI. Check for mistakes.
protected validateKey(key: IConnectionInfoParams): boolean {
const parse = CONNECTION_INFO_PARAM_SCHEMA.safeParse(toJS(key));
if (!parse.success) {
this.logger.warn(`Invalid resource key ${(schemaValidationError(parse.error).toString(), { prefix: null })}`);
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

There's a syntax error in the logger.warn call. The expression has unbalanced parentheses - the schemaValidationError call result is being passed to toString() but then there's an extra comma and object literal that doesn't fit the function signature correctly.

Suggested change
this.logger.warn(`Invalid resource key ${(schemaValidationError(parse.error).toString(), { prefix: null })}`);
this.logger.warn(`Invalid resource key ${schemaValidationError(parse.error, { prefix: null }).toString()}`);

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +7
export default [
['plugin_connection_view_option_simple', '简单'],
['plugin_connection_view_option_advanced', '完善'],
['plugin_connection_view_option_custom', '自定义'],
['plugin_connection_view_option_show_system_objects', '展示系统对象'],
['plugin_connection_view_option_reset_description', 'This will reset the connection view settings to default values'],
];
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The 'plugin_connection_view' key is missing from this locale file, while it exists in other locale files (vi.ts, ru.ts, it.ts, fr.ts, en.ts). This will cause the connection view menu to display an untranslated key.

Copilot uses AI. Check for mistakes.
}

const node = context.get(DATA_CONTEXT_NAV_NODE)!;
return node.objectFeatures.includes(EObjectFeature.dataSource);
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The menu is only shown for nodes with the 'dataSource' feature, but the old implementation also checked for 'dataSourceConnected'. This change means the menu will now appear for disconnected data sources as well. This could lead to user confusion or errors when trying to change view settings on disconnected connections. Consider whether this behavior change is intentional.

Suggested change
return node.objectFeatures.includes(EObjectFeature.dataSource);
return (
node.objectFeatures.includes(EObjectFeature.dataSource)
&& node.objectFeatures.includes(EObjectFeature.dataSourceConnected)
);

Copilot uses AI. Check for mistakes.
['plugin_connection_view_option_advanced', 'Avanzata'],
['plugin_connection_view_option_custom', 'Personalizzata'],
['plugin_connection_view_option_show_system_objects', 'Mostra oggetti di sistema'],
['plugin_connection_view_option_reset_description', 'This will reset the connection view settings to default values'],
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The reset description is not translated to Italian. All other languages have English text for this key, but this should be translated consistently with the rest of the file.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +7
export default [
['plugin_connection_view', 'Отображение'],
['plugin_connection_view_option_simple', 'Упрощенное'],
['plugin_connection_view_option_advanced', 'Продвинутое'],
['plugin_connection_view_option_show_system_objects', 'Показывать системные объекты'],
['plugin_connection_view_option_reset_description', 'Это сбросит настройки отображения подключения к значениям по умолчанию'],
];
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The 'plugin_connection_view_option_custom' key is missing from this locale file, while it exists in other locale files (zh.ts, vi.ts, it.ts, fr.ts). This will cause inconsistent display when the custom option is needed.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +7
export default [
['plugin_connection_view', 'Connection view'],
['plugin_connection_view_option_simple', 'Simple'],
['plugin_connection_view_option_advanced', 'Advanced'],
['plugin_connection_view_option_show_system_objects', 'Show system objects'],
['plugin_connection_view_option_reset_description', 'This will reset the connection view settings to default values'],
];
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The 'plugin_connection_view_option_custom' key is missing from this locale file, while it exists in other locale files (zh.ts, vi.ts, it.ts, fr.ts). This will cause inconsistent display when the custom option is needed.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +7
export default [
['plugin_connection_view', 'Vue de connexion'],
['plugin_connection_view_option_simple', 'Simple'],
['plugin_connection_view_option_advanced', 'Avancée'],
['plugin_connection_view_option_custom', 'Personnalisée'],
['plugin_connection_view_option_reset_description', 'This will reset the connection view settings to default values'],
];
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The 'plugin_connection_view_option_show_system_objects' key is missing from this locale file, while it exists in other locale files. This will cause the "Show system objects" option to display an untranslated key in French.

Copilot uses AI. Check for mistakes.

protected async loader(
originalKey: ResourceKey<IConnectionInfoParams>,
_: any,
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The second parameter is named with just an underscore ('_'), which is acceptable but the name could be more descriptive. Consider using a more meaningful name like 'includes' or at minimum '_includes' to indicate what this parameter represents in the loader signature.

Suggested change
_: any,
_includes: any,

Copilot uses AI. Check for mistakes.
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.

3 participants