Skip to content

Commit

Permalink
CB-5454 add deprecated message (#2976)
Browse files Browse the repository at this point in the history
* CB-5454 add deprecated message

* CB-5454 add info icon to connection dialog message

* CB-5454 remove add button

* CB-5454 remove template

---------

Co-authored-by: Evgenia Bezborodova <[email protected]>
  • Loading branch information
devnaumov and EvgeniaBzzz authored Oct 10, 2024
1 parent 5c92d43 commit 2e5b092
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 62 deletions.
24 changes: 2 additions & 22 deletions config/GlobalConfiguration/.dbeaver/data-sources.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
{
"folders": {},
"connections": {
"postgresql-template-1": {
"provider": "postgresql",
"driver": "postgres-jdbc",
"name": "PostgreSQL (Template)",
"save-password": false,
"show-system-objects": false,
"read-only": true,
"template": true,
"configuration": {
"host": "localhost",
"port": "5432",
"database": "postgres",
"url": "jdbc:postgresql://localhost:5432/postgres",
"type": "dev",
"provider-properties": {
"@dbeaver-show-non-default-db@": "false"
}
}
}
}
"folders": {},
"connections": {}
}
7 changes: 7 additions & 0 deletions webapp/packages/core-blocks/src/InfoItem.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@
align-items: center;
flex: 0 0 auto;
}

.iconOrImage {
width: 24px;
height: 24px;
margin-right: 16px;

&.compact {
width: 18px;
height: 18px;
margin-right: 8px;
}
}
5 changes: 3 additions & 2 deletions webapp/packages/core-blocks/src/InfoItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,20 @@ import { useS } from './useS.js';
export interface IInfoItem {
info: TLocalizationToken;
icon?: string;
compact?: boolean;
}

interface Props extends IInfoItem {
className?: string;
}

export const InfoItem = observer<Props>(function InfoItem({ info, icon = '/icons/info_icon.svg', className }) {
export const InfoItem = observer<Props>(function InfoItem({ info, compact, icon = '/icons/info_icon.svg', className }) {
const styles = useS(style);

const translate = useTranslate();
return (
<div className={s(styles, { infoItem: true }, className)}>
<IconOrImage className={s(styles, { iconOrImage: true })} icon={icon} />
<IconOrImage className={s(styles, { iconOrImage: true, compact })} icon={icon} />
{translate(info)}
</div>
);
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,5 @@ export default [

['core_connections_settings_disable', 'Отключить'],
['core_connections_settings_disable_description', 'Отключить возможность создания новых подключений'],
['connections_templates_deprecated_message', 'Шаблоны подключений больше не поддерживаются и будут удалены в будущих релизах'],
];
8 changes: 3 additions & 5 deletions webapp/packages/core-connections/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ export default [
['connections_connection_authentication_save_credentials_for_session', '当前会话不再询问'],
['connections_connection_authentication_save_credentials_for_session_tooltip', '注销后将移除凭证'],
['connections_connection_edit_save_credentials_shared', '为所有访问用户保存凭证'],
[
'connections_connection_edit_save_credentials_shared_tooltip',
'凭证将用于为所有访问用户自动连接数据库',
],
['connections_connection_edit_save_credentials_shared_tooltip', '凭证将用于为所有访问用户自动连接数据库'],
['connections_connection_share_credentials', '分享凭证至团队'],
['connections_connection_share_credentials_tooltip', '凭证将用于为所有团队用户自动连接数据库'],
['connections_connection_credentials_provisioning', '认证凭据'],
Expand All @@ -52,7 +49,7 @@ export default [
['connections_connection_edit_search_hosts', '主机名称'],
['connections_connection_address', '地址'],
['connections_connection_folder', '文件夹'],
['connections_connection_folder_validation', "文件夹名称不得包含以下符号 / : \" \\ ' <> | ? * 且不能以点开头"],
['connections_connection_folder_validation', '文件夹名称不得包含以下符号 / : " \\ \' <> | ? * 且不能以点开头'],
['connections_connection_name', '连接名称'],
['connections_connection_access_admin_info', '管理员可以查看除其他用户的私有连接之外的所有连接。'],
['connections_connection_description', '描述'],
Expand Down Expand Up @@ -95,4 +92,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
CommonDialogWrapper,
ErrorMessage,
Form,
InfoItem,
s,
useAdministrationSettings,
useErrorDetails,
Expand All @@ -38,7 +39,12 @@ export const ConnectionDialog: DialogComponent<null, null> = observer(function C
const dialog = useConnectionDialog(rejectDialog);
const errorDetails = useErrorDetails(dialog.connectException);

const subTitle = dialog.step === ConnectionStep.Connection ? dialog.template?.name : undefined;
const subTitle =
dialog.step === ConnectionStep.Connection ? (
dialog.template?.name
) : (
<InfoItem info={translate('connections_templates_deprecated_message')} compact />
);

return (
<CommonDialogWrapper size="large" fixedSize={dialog.step === ConnectionStep.ConnectionTemplateSelect}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
ExceptionMessageStyles,
Group,
GroupItem,
GroupSubTitle,
GroupTitle,
InfoItem,
Loader,
s,
SContext,
Expand All @@ -25,13 +25,11 @@ import {
useS,
useTranslate,
} from '@cloudbeaver/core-blocks';
import { useService } from '@cloudbeaver/core-di';

import ConnectionsAdministrationStyle from './ConnectionsAdministration.module.css';
import { ConnectionsTable } from './ConnectionsTable/ConnectionsTable.js';
import { useConnectionsTable } from './ConnectionsTable/useConnectionsTable.js';
import { CreateConnection } from './CreateConnection/CreateConnection.js';
import { CreateConnectionService } from './CreateConnectionService.js';

const registry: StyleRegistry = [
[
Expand All @@ -50,26 +48,16 @@ export const ConnectionsAdministration = observer<AdministrationItemContentProps
}) {
const style = useS(ConnectionsAdministrationStyle);
const translate = useTranslate();
const service = useService(CreateConnectionService);

const state = useConnectionsTable();

return (
<ColoredContainer vertical wrap parent gap>
<Group keepSize dense>
<GroupSubTitle>{translate('templates_administration_info_message')}</GroupSubTitle>
<InfoItem info={translate('connections_templates_deprecated_message')} />
</Group>
<Group box keepSize>
<ToolsPanel rounded>
<ToolsAction
title={translate('connections_administration_tools_add_tooltip')}
icon="add"
viewBox="0 0 24 24"
disabled={!!sub || state.loading}
onClick={service.create}
>
{translate('ui_add')}
</ToolsAction>
<ToolsAction
title={translate('connections_administration_tools_refresh_tooltip')}
icon="refresh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class ConnectionsAdministrationService extends Bootstrap {
canDeActivate: this.canDeActivateCreate.bind(this),
},
],
isHidden: () => this.serverConfigResource.distributed,
isHidden: () => this.serverConfigResource.distributed || !this.connectionInfoResource.values.some(connection => connection.template),
getContentComponent: () => ConnectionsAdministration,
getDrawerComponent: () => ConnectionsDrawerItem,
onDeActivate: this.refreshUserConnections.bind(this),
Expand All @@ -78,6 +78,10 @@ export class ConnectionsAdministrationService extends Bootstrap {
this.connectionDetailsPlaceholder.add(SSH, 2);
}

override async load(): Promise<void> {
await this.connectionInfoResource.load();
}

private async refreshUserConnections(configuration: boolean, outside: boolean, outsideAdminPage: boolean): Promise<void> {
// TODO: we have to track users' leaving the page
if (outside) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,5 @@ export default [
['plugin_connections_connection_edit_reconnect_failed', 'Failed to reconnect'],

['connections_administration_deactivate_message', "Your connection's settings will be lost. Do you want to continue?"],
[
'templates_administration_info_message',
'The templates enable administrators to define various reusable connection parameters, subsequently allowing users to create multiple connections based on these templates.',
],
['connections_administration_connection_create_error', 'Failed to create connection'],
];
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,5 @@ export default [
['plugin_connections_connection_edit_reconnect_failed', 'Échec de la reconnexion'],

['connections_administration_deactivate_message', 'Les paramètres de votre connexion seront perdus. Voulez-vous continuer ?'],
[
'templates_administration_info_message',
'Les modèles permettent aux administrateurs de définir divers paramètres de connexion réutilisables, permettant ensuite aux utilisateurs de créer plusieurs connexions basées sur ces modèles.',
],
['connections_administration_connection_create_error', 'Failed to create connection'],
];
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@
export default [
['plugin_connections_connection_edit_menu_item_title', 'Modifica Connessione'],
['plugin_connections_connection_edit_cancel_title', "Conferma l'annullamento"],
[
'templates_administration_info_message',
'The templates enable administrators to define various reusable connection parameters, subsequently allowing users to create multiple connections based on these templates.',
],
['connections_administration_connection_create_error', 'Failed to create connection'],
];
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,5 @@ export default [
['plugin_connections_connection_edit_reconnect_failed', 'Не удалось переподключиться'],

['connections_administration_deactivate_message', 'Настройки вашего подключения будут потеряны. Вы хотите продолжить?'],
[
'templates_administration_info_message',
'Шаблоны позволяют администраторам определять различные параметры подключения, а затем позволяют пользователям создавать несколько подключений на основе этих шаблонов.',
],
['connections_administration_connection_create_error', 'Не удалось создать подключение'],
];
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ export default [
['plugin_connections_connection_edit_reconnect_failed', '重新连接失败'],

['connections_administration_deactivate_message', '您的连接设置将丢失。您要继续吗?'],
['templates_administration_info_message', '管理员可在数据库连接模板中定义各种可重用的连接参数,之后用户可基于这些模板创建多个数据库连接。'],
['connections_administration_connection_create_error', 'Failed to create connection'],
];

0 comments on commit 2e5b092

Please sign in to comment.