Skip to content

Commit

Permalink
Merge branch 'devel' into fix/cb-5205/connection-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgeniaBzzz authored Oct 11, 2024
2 parents d978fac + c6626f4 commit 58768f9
Show file tree
Hide file tree
Showing 33 changed files with 2,900 additions and 2,871 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public Gson getGson() {
return getGsonBuilder().create();
}

@NotNull
protected abstract GsonBuilder getGsonBuilder();

public abstract T getServerConfiguration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.InstanceCreator;
import com.google.gson.Strictness;
import io.cloudbeaver.model.WebConnectionConfig;
import io.cloudbeaver.model.WebNetworkHandlerConfigInput;
import io.cloudbeaver.model.WebPropertyInfo;
Expand Down Expand Up @@ -294,7 +295,7 @@ public static void saveAuthProperties(
// Make new Gson parser with type adapters to deserialize into existing credentials
InstanceCreator<DBAAuthCredentials> credTypeAdapter = type -> credentials;
Gson credGson = new GsonBuilder()
.setLenient()
.setStrictness(Strictness.LENIENT)
.registerTypeAdapter(credentials.getClass(), credTypeAdapter)
.create();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
*/
package io.cloudbeaver.server;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.InstanceCreator;
import com.google.gson.*;
import io.cloudbeaver.model.app.BaseServerConfigurationController;
import io.cloudbeaver.model.app.BaseWebApplication;
import io.cloudbeaver.model.config.CBAppConfig;
Expand Down Expand Up @@ -326,6 +324,7 @@ public Map<String, Object> readConfigurationFile(Path path) throws DBException {
}
}

@NotNull
protected GsonBuilder getGsonBuilder() {
// Stupid way to populate existing objects but ok google (https://github.com/google/gson/issues/431)
InstanceCreator<CBAppConfig> appConfigCreator = type -> appConfiguration;
Expand All @@ -336,7 +335,8 @@ protected GsonBuilder getGsonBuilder() {
InstanceCreator<PasswordPolicyConfiguration> smPasswordPoliceConfigCreator =
type -> securityManagerConfiguration.getPasswordPolicyConfiguration();
return new GsonBuilder()
.setLenient()
.setStrictness(Strictness.LENIENT)
.setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE)
.registerTypeAdapter(getServerConfiguration().getClass(), serverConfigCreator)
.registerTypeAdapter(CBAppConfig.class, appConfigCreator)
.registerTypeAdapter(DataSourceNavigatorSettings.class, navSettingsCreator)
Expand Down Expand Up @@ -372,7 +372,7 @@ private synchronized void writeRuntimeConfig(Path runtimeConfigPath, Map<String,

try (Writer out = new OutputStreamWriter(Files.newOutputStream(runtimeConfigPath), StandardCharsets.UTF_8)) {
Gson gson = new GsonBuilder()
.setLenient()
.setStrictness(Strictness.LENIENT)
.setPrettyPrinting()
.create();
gson.toJson(configurationProperties, out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private void savePasswordPolicyConfig(Map<String, Object> originServerConfig, Ma
}
}

@NotNull
@Override
protected GsonBuilder getGsonBuilder() {
GsonBuilder gsonBuilder = super.getGsonBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.Strictness;
import io.cloudbeaver.auth.provider.local.LocalAuthProviderConstants;
import io.cloudbeaver.model.app.WebApplication;
import io.cloudbeaver.model.config.WebDatabaseConfig;
Expand Down Expand Up @@ -301,7 +302,9 @@ CBDatabaseInitialData getInitialData() throws DBException {
initialDataPath = WebAppUtils.getRelativePath(
databaseConfiguration.getInitialDataConfiguration(), application.getHomeDirectory());
try (Reader reader = new InputStreamReader(new FileInputStream(initialDataPath), StandardCharsets.UTF_8)) {
Gson gson = new GsonBuilder().setLenient().create();
Gson gson = new GsonBuilder()
.setStrictness(Strictness.LENIENT)
.create();
return gson.fromJson(reader, CBDatabaseInitialData.class);
} catch (Exception e) {
throw new DBException("Error loading initial data configuration", e);
Expand Down
2 changes: 1 addition & 1 deletion server/drivers/db2-jt400/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<dependency>
<groupId>net.sf.jt400</groupId>
<artifactId>jt400</artifactId>
<version>10.5</version>
<version>20.0.7</version>
</dependency>
</dependencies>

Expand Down
4 changes: 4 additions & 0 deletions server/drivers/mysql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<artifactId>mysql-connector-j</artifactId>
<version>8.2.0</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
</dependencies>

</project>
7 changes: 6 additions & 1 deletion server/drivers/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.cloudbeaver</groupId>
<parent>
<groupId>io.cloudbeaver</groupId>
<artifactId>cloudbeaver</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>drivers</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
<id>full-build</id>
<activation><property><name>!plain-api-server</name></property></activation>
<modules>
<module>test</module>
<module>drivers</module>
<!-- Products -->
<module>product</module>
<module>test</module>
</modules>
</profile>
</profiles>
Expand Down
2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@testing-library/user-event": "^14",
"@types/react": "^18",
"@types/react-dom": "^18",
"concurrently": "^8",
"concurrently": "^9",
"husky": "^9",
"lerna": "^5",
"mobx": "^6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
}

.dialogBodyContent {
composes: theme-typography--body1 from global;
flex: 1;
letter-spacing: normal;
position: relative;
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
}

.headerTitle {
composes: theme-typography--headline6 from global;
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ import { ErrorModel, type IErrorInfo } from './ErrorModel.js';

function DisplayErrorInfo({ error }: { error: IErrorInfo }) {
const styles = useS(style);
const translate = useTranslate();

return (
<>
<div className={s(styles, { property: true })}>
{error.isHtml ? <Iframe srcDoc={error.message} /> : <div className={s(styles, { message: true })}>{error.message}</div>}
{error.isHtml ? <Iframe srcDoc={error.message} /> : <div className={s(styles, { message: true })}>{translate(error.message)}</div>}
</div>
{error.stackTrace && (
<div className={s(styles, { property: true })}>
Expand Down
5 changes: 4 additions & 1 deletion webapp/packages/core-blocks/src/StatusMessage.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
.statusMessage {
overflow: hidden;
composes: theme-typography--caption from global;
height: 24px;
display: flex;
align-items: center;
gap: 8px;
}

.statusMessageExtended {
height: 24px;
}
.iconOrImage {
height: 24px;
width: 24px;
Expand Down
16 changes: 12 additions & 4 deletions webapp/packages/core-blocks/src/StatusMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@ interface Props {
type?: ENotificationType | null;
exception?: Error | null;
className?: string;
multipleRows?: boolean;
onShowDetails?: () => void;
}

export const StatusMessage = observer<Props>(function StatusMessage({ type, message, exception = null, className, onShowDetails }) {
export const StatusMessage = observer<Props>(function StatusMessage({
type,
multipleRows = false,
message,
exception = null,
className,
onShowDetails,
}) {
const styles = useS(style);
const translate = useTranslate();
const errorDetails = useErrorDetails(exception);
Expand All @@ -51,13 +59,13 @@ export const StatusMessage = observer<Props>(function StatusMessage({ type, mess
}

return (
<div className={s(styles, { statusMessage: true }, className)}>
<div className={s(styles, { statusMessage: true, statusMessageExtended: !multipleRows }, className)}>
{message && (
<>
<IconOrImage className={s(styles, { iconOrImage: true })} icon={icon} />
<div className={s(styles, { message: true })} title={message}>
<div className={s(styles, { message: !multipleRows })} title={message}>
{onShowDetails ? (
<Link className={s(styles, { link: true })} onClick={onShowDetails}>
<Link className={s(styles, { link: !multipleRows })} onClick={onShowDetails}>
{message}
</Link>
) : (
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-blocks/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export * from './CommonDialog/CommonDialog/CommonDialogFooter.js';
export * from './CommonDialog/CommonDialog/CommonDialogHeader.js';
export * from './CommonDialog/CommonDialog/CommonDialogWrapper.js';
export * from './CommonDialog/ConfirmationDialog.js';
export { default as ConfirmationDialogStyles } from './CommonDialog/ConfirmationDialog.module.css';
export * from './CommonDialog/ConfirmationDialogDelete.js';
export * from './CommonDialog/RenameDialog.js';
export * from './CommonDialog/DialogsPortal.js';
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-localization/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default [
['ui_errors_details', 'Details'],
['ui_search', 'Search...'],
['ui_delete', 'Delete'],
['ui_deleting', 'Deleting...'],
['ui_add', 'Add'],
['ui_revert', 'Revert'],
['ui_undo', 'Undo'],
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-localization/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default [
['ui_errors_details', 'Détails'],
['ui_search', 'Rechercher...'],
['ui_delete', 'Supprimer'],
['ui_deleting', 'Deleting...'],
['ui_add', 'Ajouter'],
['ui_refresh', 'Actualiser'],
['ui_data_saving_error', 'Erreur de sauvegarde'],
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-localization/src/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default [
['ui_errors_details', 'Dettagli'],
['ui_search', 'Cerca...'],
['ui_delete', 'Elimina'],
['ui_deleting', 'Deleting...'],
['ui_add', 'Aggiungi'],
['ui_revert', 'Revert'],
['ui_undo', 'Undo'],
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-localization/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default [
['ui_errors_details', 'Информация'],
['ui_search', 'Поиск...'],
['ui_delete', 'Удалить'],
['ui_deleting', 'Удаляется...'],
['ui_add', 'Добавить'],
['ui_revert', 'Отменить изменения'],
['ui_undo', 'Отменить'],
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-localization/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default [
['ui_errors_details', '详情'],
['ui_search', '搜索...'],
['ui_delete', '删除'],
['ui_deleting', 'Deleting...'],
['ui_add', '添加'],
['ui_revert', '恢复'],
['ui_undo', '撤销'],
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-website/src/WebsiteLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* you may not use this file except in compliance with the License.
*/
export class WebsiteLinks {
static ROOT_PAGE = 'https://dbeaver.com/';
static DATA_EDITOR_DOCUMENTATION_PAGE = 'https://dbeaver.com/docs/cloudbeaver/Data-editor/';
static SQL_EDITOR_DOCUMENTATION_PAGE = 'https://dbeaver.com/docs/cloudbeaver/SQL-Editor/';
static SERVER_CONFIGURATION_RESOURCE_QUOTAS_PAGE = 'https://dbeaver.com/docs/cloudbeaver/Server-configuration/#resource-quotas';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
*/

.wrapper {
height: 100%;
display: flex;
overflow: hidden;
box-sizing: border-box;
position: relative;
}

.container {
Expand All @@ -28,3 +28,8 @@
display: none;
}
}

.cellMenu {
width: 25px;
height: 100%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const CellFormatter = observer<Props>(function CellFormatter({ className,
spreadsheetActions={spreadsheetActions}
resultIndex={context.resultIndex}
simple={context.simple}
className={s(styles, { cellMenu: true })}
onStateSwitch={setMenuVisible}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface Props {
spreadsheetActions: IDataPresentationActions<IResultSetElementKey>;
resultIndex: number;
cellKey: IResultSetElementKey;
className?: string;
simple: boolean;
onClick?: () => void;
onStateSwitch?: (state: boolean) => void;
Expand All @@ -41,6 +42,7 @@ export const CellMenu = observer<Props>(function CellMenu({
actions,
spreadsheetActions,
resultIndex,
className,
cellKey,
simple,
onClick,
Expand Down Expand Up @@ -70,7 +72,7 @@ export const CellMenu = observer<Props>(function CellMenu({

return (
<SContext registry={registry}>
<div className={s(style, { cellMenu: true })} onMouseUp={markStopPropagation} onDoubleClick={stopPropagation}>
<div className={s(style, { cellMenu: true }, className)} onMouseUp={markStopPropagation} onDoubleClick={stopPropagation}>
<MenuTrigger panel={panel} className={s(style, { menuTrigger: true })} modal onClick={handleClick} onVisibleSwitch={onStateSwitch}>
<Icon className={s(style, { icon: true })} name="snack" viewBox="0 0 16 10" />
</MenuTrigger>
Expand Down
Loading

0 comments on commit 58768f9

Please sign in to comment.