Skip to content

Commit 0b924da

Browse files
CB-6171 show alert instead of icon (#3263)
* CB-6171 show alert instead of icon * CB-6171 change locales * CB-6171 add missing dep * CB-6171 add flag check --------- Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
1 parent 24117db commit 0b924da

File tree

21 files changed

+180
-95
lines changed

21 files changed

+180
-95
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* CloudBeaver - Cloud Database Manager
3+
* Copyright (C) 2019-2024 DBeaver Corp
4+
*
5+
* All Rights Reserved
6+
*
7+
* NOTICE: All information contained herein is, and remains
8+
* the property of DBeaver Corp and its suppliers, if any.
9+
* The intellectual and technical concepts contained
10+
* herein are proprietary to DBeaver Corp and its suppliers
11+
* and may be covered by U.S. and Foreign Patents,
12+
* patents in process, and are protected by trade secret or copyright law.
13+
* Dissemination of this information or reproduction of this material
14+
* is strictly forbidden unless prior written permission is obtained
15+
* from DBeaver Corp.
16+
*/
17+
18+
.alert {
19+
display: flex;
20+
align-items: flex-start;
21+
gap: 14px;
22+
background-color: rgba(34, 139, 230, 0.15);
23+
padding: 16px;
24+
border-radius: 4px;
25+
}
26+
27+
.body {
28+
display: flex;
29+
gap: 8px;
30+
flex-direction: column;
31+
}
32+
33+
.title {
34+
color: var(--theme-primary);
35+
font-weight: 500;
36+
margin: 0;
37+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* CloudBeaver - Cloud Database Manager
3+
* Copyright (C) 2019-2024 DBeaver Corp
4+
*
5+
* All Rights Reserved
6+
*
7+
* NOTICE: All information contained herein is, and remains
8+
* the property of DBeaver Corp and its suppliers, if any.
9+
* The intellectual and technical concepts contained
10+
* herein are proprietary to DBeaver Corp and its suppliers
11+
* and may be covered by U.S. and Foreign Patents,
12+
* patents in process, and are protected by trade secret or copyright law.
13+
* Dissemination of this information or reproduction of this material
14+
* is strictly forbidden unless prior written permission is obtained
15+
* from DBeaver Corp.
16+
*/
17+
import { observer } from 'mobx-react-lite';
18+
19+
import { useTranslate } from './localization/useTranslate.js';
20+
import { useS } from './useS.js';
21+
import { s } from './s.js';
22+
import { IconOrImage } from './IconOrImage.js';
23+
import { Text } from './Text.js';
24+
import classes from './Alert.module.css';
25+
26+
interface Props {
27+
message: string;
28+
title?: string;
29+
}
30+
31+
export const Alert = observer<Props>(function Alert({ title, message }) {
32+
const translate = useTranslate();
33+
const styles = useS(classes);
34+
35+
return (
36+
<div className={s(styles, { alert: true })} role="alert">
37+
<IconOrImage icon="/icons/info_icon_sm.svg" />
38+
<div className={s(styles, { body: true })}>
39+
<h3 className={s(styles, { title: true })}>{title ?? translate('ui_information')}</h3>
40+
<Text>{message}</Text>
41+
</div>
42+
</div>
43+
);
44+
});

webapp/packages/core-blocks/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,4 @@ export * from './FormControls/useInputAutocomplete.js';
258258
export * from './FormControls/InputAutocompletionMenu.js';
259259
export * from './useSearch.js';
260260
export * from './useObjectInfoTooltip.js';
261+
export * from './Alert.js';

webapp/packages/core-connections/src/locales/de.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* CloudBeaver - Cloud Database Manager
3-
* Copyright (C) 2020-2024 DBeaver Corp and others
3+
* Copyright (C) 2020-2025 DBeaver Corp and others
44
*
55
* Licensed under the Apache License, Version 2.0.
66
* you may not use this file except in compliance with the License.
@@ -60,4 +60,5 @@ export default [
6060
['core_connections_settings_disable', 'Disable'],
6161
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
6262
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
63+
['core_connections_connection_driver_not_installed', 'Driver is not installed'],
6364
];

webapp/packages/core-connections/src/locales/en.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* CloudBeaver - Cloud Database Manager
3-
* Copyright (C) 2020-2024 DBeaver Corp and others
3+
* Copyright (C) 2020-2025 DBeaver Corp and others
44
*
55
* Licensed under the Apache License, Version 2.0.
66
* you may not use this file except in compliance with the License.
@@ -104,4 +104,5 @@ export default [
104104
['core_connections_settings_disable', 'Disable'],
105105
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
106106
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
107+
['core_connections_connection_driver_not_installed', 'Driver is not installed'],
107108
];

webapp/packages/core-connections/src/locales/fr.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* CloudBeaver - Cloud Database Manager
3-
* Copyright (C) 2020-2024 DBeaver Corp and others
3+
* Copyright (C) 2020-2025 DBeaver Corp and others
44
*
55
* Licensed under the Apache License, Version 2.0.
66
* you may not use this file except in compliance with the License.
@@ -113,4 +113,5 @@ export default [
113113
['core_connections_settings_disable', 'Disable'],
114114
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
115115
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
116+
['core_connections_connection_driver_not_installed', 'Driver is not installed'],
116117
];

webapp/packages/core-connections/src/locales/it.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* CloudBeaver - Cloud Database Manager
3-
* Copyright (C) 2020-2024 DBeaver Corp and others
3+
* Copyright (C) 2020-2025 DBeaver Corp and others
44
*
55
* Licensed under the Apache License, Version 2.0.
66
* you may not use this file except in compliance with the License.
@@ -102,4 +102,5 @@ export default [
102102
['core_connections_settings_disable', 'Disable'],
103103
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
104104
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
105+
['core_connections_connection_driver_not_installed', 'Driver is not installed'],
105106
];

webapp/packages/core-connections/src/locales/ru.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* CloudBeaver - Cloud Database Manager
3-
* Copyright (C) 2020-2024 DBeaver Corp and others
3+
* Copyright (C) 2020-2025 DBeaver Corp and others
44
*
55
* Licensed under the Apache License, Version 2.0.
66
* you may not use this file except in compliance with the License.
@@ -105,4 +105,5 @@ export default [
105105
['core_connections_settings_disable', 'Отключить'],
106106
['core_connections_settings_disable_description', 'Отключить возможность создания новых подключений'],
107107
['connections_templates_deprecated_message', 'Шаблоны подключений больше не поддерживаются и будут удалены в будущих релизах'],
108+
['core_connections_connection_driver_not_installed', 'Драйвер не установлен'],
108109
];

webapp/packages/core-connections/src/locales/zh.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* CloudBeaver - Cloud Database Manager
3-
* Copyright (C) 2020-2024 DBeaver Corp and others
3+
* Copyright (C) 2020-2025 DBeaver Corp and others
44
*
55
* Licensed under the Apache License, Version 2.0.
66
* you may not use this file except in compliance with the License.
@@ -94,4 +94,5 @@ export default [
9494
['core_connections_settings_disable', 'Disable'],
9595
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
9696
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
97+
['core_connections_connection_driver_not_installed', 'Driver is not installed'],
9798
];

webapp/packages/plugin-connection-custom/src/DriverSelector/Driver.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* CloudBeaver - Cloud Database Manager
3-
* Copyright (C) 2020-2024 DBeaver Corp and others
3+
* Copyright (C) 2020-2025 DBeaver Corp and others
44
*
55
* Licensed under the Apache License, Version 2.0.
66
* you may not use this file except in compliance with the License.
@@ -27,15 +27,15 @@ interface Props {
2727

2828
export const Driver = observer<Props>(function Driver({ driver, onSelect }) {
2929
const translate = useTranslate();
30-
const select = useCallback(() => onSelect(driver.id), [driver]);
30+
const select = useCallback(() => onSelect(driver.id), [driver.id, onSelect]);
3131
const styles = useS(style);
3232

3333
return (
3434
<ListItem onClick={select}>
3535
<ListItemIcon className={s(styles, { icon: true })}>
3636
<StaticImage icon={driver.icon} className={s(styles, { staticImage: true })} />
3737
{!driver.driverInstalled && (
38-
<div className={s(styles, { indicator: true })} title={translate('plugin_connection_custom_drivers_driver_not_installed')}>
38+
<div className={s(styles, { indicator: true })} title={translate('core_connections_connection_driver_not_installed')}>
3939
<IconOrImage icon="/icons/info_icon_sm.svg" />
4040
</div>
4141
)}

0 commit comments

Comments
 (0)