Skip to content

Commit

Permalink
Merge branch 'devel' into CB-4696-truncate-string-value-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
devnaumov committed Mar 8, 2024
2 parents 0792dbc + e13368d commit a101a92
Show file tree
Hide file tree
Showing 131 changed files with 3,257 additions and 2,835 deletions.
2 changes: 1 addition & 1 deletion deploy/build-frontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ echo "Copy static content"

cp -rp ../webapp/packages/product-default/lib/* cloudbeaver/web

echo "Cloudbeaver is ready. Run run-server.bat in cloudbeaver folder to start the server."
echo "Cloudbeaver is ready. Run run-server.sh in cloudbeaver folder to start the server."
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ public String[] getApplicableAuthModels() {

@Property
public String[] getApplicableNetworkHandlers() {
if (driver.isEmbedded()) {
return new String[0];
if (!driver.isEmbedded() || CommonUtils.toBoolean(driver.getDriverParameter(DBConstants.DRIVER_PARAM_ENABLE_NETWORK_PARAMETERS))) {
return NetworkHandlerRegistry.getInstance().getDescriptors(driver).stream()
.filter(h -> !h.isDesktopHandler())
.map(NetworkHandlerDescriptor::getId).toArray(String[]::new);
}
return NetworkHandlerRegistry.getInstance().getDescriptors(driver).stream()
.filter(h -> !h.isDesktopHandler())
.map(NetworkHandlerDescriptor::getId).toArray(String[]::new);
return new String[0];
}

@Property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.jkiss.dbeaver.model.app.DBPPlatform;
import org.jkiss.dbeaver.model.auth.AuthInfo;
import org.jkiss.dbeaver.model.auth.SMCredentialsProvider;
import org.jkiss.dbeaver.model.connection.DBPDriver;
import org.jkiss.dbeaver.model.data.json.JSONUtils;
import org.jkiss.dbeaver.model.navigator.DBNBrowseSettings;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
Expand Down Expand Up @@ -260,6 +261,7 @@ protected void startServer() {
log.error(e);
return;
}
refreshDisabledDriversConfig();

configurationMode = CommonUtils.isEmpty(serverName);

Expand Down Expand Up @@ -541,7 +543,6 @@ protected Path loadServerConfiguration() throws DBException {
log.debug("Runtime configuration [" + runtimeConfigFile.getAbsolutePath() + "]");
parseConfiguration(runtimeConfigFile);
}

return path;
}

Expand Down Expand Up @@ -1338,4 +1339,16 @@ protected void sendConfigChangedEvent(SMCredentialsProvider credentialsProvider)
}
eventController.addEvent(new WSServerConfigurationChangedEvent(sessionId, null));
}

private void refreshDisabledDriversConfig() {
CBAppConfig config = getAppConfiguration();
Set<String> disabledDrivers = new LinkedHashSet<>(Arrays.asList(config.getDisabledDrivers()));
for (DBPDriver driver : CBPlatform.getInstance().getApplicableDrivers()) {
if (!driver.isEmbedded() || config.isDriverForceEnabled(driver.getFullId())) {
continue;
}
disabledDrivers.add(driver.getFullId());
}
config.setDisabledDrivers(disabledDrivers.toArray(new String[0]));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ protected synchronized void initialize() {

refreshApplicableDrivers();

refreshDisabledDriversConfig();

new WebSessionMonitorJob(this)
.scheduleMonitor();

Expand Down Expand Up @@ -293,18 +291,6 @@ public void refreshApplicableDrivers() {
log.info("Available drivers: " + applicableDrivers.stream().map(DBPDriver::getFullName).collect(Collectors.joining(",")));
}

private void refreshDisabledDriversConfig() {
CBAppConfig config = application.getAppConfiguration();
Set<String> disabledDrivers = new LinkedHashSet<>(Arrays.asList(config.getDisabledDrivers()));
for (DBPDriver driver : applicableDrivers) {
if (!driver.isEmbedded() || config.isDriverForceEnabled(driver.getFullId())) {
continue;
}
disabledDrivers.add(driver.getFullId());
}
config.setDisabledDrivers(disabledDrivers.toArray(new String[0]));
}

@NotNull
@Override
public DBFileController createFileController() {
Expand Down
32 changes: 20 additions & 12 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,41 @@
"**/core-cli/**"
]
},
"resolutions": {
"@types/react": "^18.2.63",
"@types/react-dom": "^18.2.19",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"mobx": "^6.12.0",
"mobx-react-lite": "^4.0.5"
},
"scripts": {
"prebuild": "lerna run gql:gen --stream --parallel",
"pretest": "lerna run gql:gen --stream --parallel && yarn lerna run test --scope @cloudbeaver/tests-runner"
},
"devDependencies": {
"@testing-library/dom": "^9.3.3",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.1",
"@types/jest": "^29.5.10",
"@types/react": "^18.2.42",
"@types/react-dom": "^18.2.17",
"@testing-library/dom": "^9.3.4",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.12",
"@types/react": "^18.2.63",
"@types/react-dom": "^18.2.19",
"concurrently": "^8.2.2",
"lerna": "5.5.4",
"mobx": "^6.12.0",
"mobx-react-lite": "^4.0.5",
"msw": "^2.0.10",
"msw": "^2.2.2",
"path-browserify": "~1.0.1",
"prettier": "^2.8.8",
"prettier": "^3.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"reakit": "~1.3.11",
"reflect-metadata": "~0.1.13",
"reflect-metadata": "^0.2.1",
"reshadow": "^0.0.1",
"rimraf": "~5.0.5",
"typescript": "^5.3.2",
"typescript-plugin-css-modules": "^5.0.2"
"typescript": "^5.3.3",
"typescript-plugin-css-modules": "^5.1.0"
},
"dependencies": {},
"prettier": "@cloudbeaver/prettier-config"
Expand Down
6 changes: 3 additions & 3 deletions webapp/packages/core-administration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"@cloudbeaver/core-sdk": "~0.1.0",
"@cloudbeaver/core-settings": "~0.1.0",
"@cloudbeaver/tests-runner": "~0.1.0",
"@testing-library/jest-dom": "^6.1.5",
"@types/jest": "^29.5.10",
"typescript": "^5.3.2"
"@testing-library/jest-dom": "^6.4.2",
"@types/jest": "^29.5.12",
"typescript": "^5.3.3"
}
}
6 changes: 3 additions & 3 deletions webapp/packages/core-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
},
"peerDependencies": {},
"devDependencies": {
"@types/react": "^18.2.42",
"typescript": "^5.3.2",
"typescript-plugin-css-modules": "^5.0.2"
"@types/react": "^18.2.63",
"typescript": "^5.3.3",
"typescript-plugin-css-modules": "^5.1.0"
}
}
8 changes: 4 additions & 4 deletions webapp/packages/core-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
"@cloudbeaver/core-settings": "~0.1.0",
"@cloudbeaver/core-theming": "~0.1.0",
"@cloudbeaver/tests-runner": "~0.1.0",
"@testing-library/jest-dom": "^6.1.5",
"@types/jest": "^29.5.10",
"msw": "~2.x.x",
"typescript": "^5.3.2"
"@testing-library/jest-dom": "^6.4.2",
"@types/jest": "^29.5.12",
"msw": "^2.2.2",
"typescript": "^5.3.3"
}
}
12 changes: 6 additions & 6 deletions webapp/packages/core-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
"@cloudbeaver/core-settings": "~0.1.0",
"@cloudbeaver/core-theming": "~0.1.0",
"@cloudbeaver/tests-runner": "~0.1.0",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
"@types/jest": "^29.5.10",
"@types/react": "^18.2.42",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@types/jest": "^29.5.12",
"@types/react": "^18.2.63",
"react": "^18.2.0",
"typescript": "^5.3.2",
"typescript-plugin-css-modules": "^5.0.2"
"typescript": "^5.3.3",
"typescript-plugin-css-modules": "^5.1.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ import { InputFieldBase, type InputFieldBaseProps } from './InputFieldBase';
import { InputFieldState, type InputFieldStateProps } from './InputFieldState';

interface InputFieldType {
(props: InputFieldBaseProps): React.ReactElement<any, any> | null;
<TState extends Record<string, any>, TKey extends keyof TState>(props: InputFieldStateProps<TState, TKey>): React.ReactElement<any, any> | null;
(props: InputFieldBaseProps & React.RefAttributes<HTMLInputElement>): React.ReactElement<any, any> | null;
<TState extends Record<string, any>, TKey extends keyof TState>(
props: InputFieldStateProps<TState, TKey> & React.RefAttributes<HTMLInputElement>,
): React.ReactElement<any, any> | null;
}

export const InputField: InputFieldType = observer<InputFieldBaseProps | InputFieldStateProps<any, any>, HTMLInputElement>(
Expand All @@ -27,9 +29,9 @@ export const InputField: InputFieldType = observer<InputFieldBaseProps | InputFi
const handleKeyDown = useCombinedHandler(onKeyDown, context?.keyDown);

if (isFormStateControl(rest)) {
return <InputFieldState ref={ref} {...rest} onChange={handleChange} onKeyDown={handleKeyDown} />;
return <InputFieldState {...rest} ref={ref} onChange={handleChange} onKeyDown={handleKeyDown} />;
}

return <InputFieldBase ref={ref} {...rest} onChange={handleChange} onKeyDown={handleKeyDown} />;
return <InputFieldBase {...rest} ref={ref} onChange={handleChange} onKeyDown={handleKeyDown} />;
}),
) as InputFieldType;
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ import { FieldLabel } from '../FieldLabel';
import { useCapsLockTracker } from '../useCapsLockTracker';
import inputFieldStyle from './InputField.m.css';

export type InputFieldBaseProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'style'> &
export type InputFieldBaseProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'style' | 'ref'> &
ILayoutSizeProps & {
value?: string;
error?: boolean;
loading?: boolean;
description?: string;
labelTooltip?: string;
ref?: React.ForwardedRef<HTMLInputElement>;
canShowPassword?: boolean;
icon?: React.ReactElement;
onCustomCopy?: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export type InputFieldStateProps<TState extends Record<string, any>, TKey extend
IFormStateControl<TState, TKey>;

interface InputFieldType {
<TState extends Record<string, any>, TKey extends keyof TState>(props: InputFieldStateProps<TState, TKey>): React.ReactElement<any, any> | null;
<TState extends Record<string, any>, TKey extends keyof TState>(
props: InputFieldStateProps<TState, TKey> & React.RefAttributes<HTMLInputElement>,
): React.ReactElement<any, any> | null;
}

export const InputFieldState: InputFieldType = observer<InputFieldStateProps<any, any>, HTMLInputElement>(
Expand All @@ -29,11 +31,11 @@ export const InputFieldState: InputFieldType = observer<InputFieldStateProps<any

return (
<InputFieldBase
{...rest}
ref={ref}
name={name}
value={(controlState.stringValue || controlState.defaultValue) ?? ''}
onChange={controlState.onChange}
{...rest}
/>
);
}),
Expand Down
6 changes: 3 additions & 3 deletions webapp/packages/core-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
},
"peerDependencies": {},
"devDependencies": {
"@types/react": "^18.2.42",
"typescript": "^5.3.2",
"typescript-plugin-css-modules": "^5.0.2"
"@types/react": "^18.2.63",
"typescript": "^5.3.3",
"typescript-plugin-css-modules": "^5.1.0"
}
}
2 changes: 1 addition & 1 deletion webapp/packages/core-browser-cookies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
},
"peerDependencies": {},
"devDependencies": {
"typescript": "^5.3.2"
"typescript": "^5.3.3"
}
}
6 changes: 3 additions & 3 deletions webapp/packages/core-browser-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"@cloudbeaver/core-sdk": "~0.1.0",
"@cloudbeaver/core-settings": "~0.1.0",
"@cloudbeaver/tests-runner": "~0.1.0",
"@testing-library/jest-dom": "^6.1.3",
"@types/jest": "^29.5.10",
"typescript": "^5.3.2"
"@testing-library/jest-dom": "^6.4.2",
"@types/jest": "^29.5.12",
"typescript": "^5.3.3"
}
}
11 changes: 6 additions & 5 deletions webapp/packages/core-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
"@cloudbeaver/core-di": "~0.1.0",
"@cloudbeaver/core-executor": "~0.1.0",
"@cloudbeaver/core-utils": "~0.1.0",
"dexie": "^3.2.4",
"dexie": "^3.2.6",
"karma": "^6.4.3",
"mobx": "^6.12.0",
"workbox-core": "~7.x.x",
"workbox-precaching": "~7.x.x",
"workbox-window": "~7.x.x"
"workbox-core": "^7.0.0",
"workbox-precaching": "^7.0.0",
"workbox-window": "^7.0.0"
},
"peerDependencies": {},
"devDependencies": {
"typescript": "^5.3.2"
"typescript": "^5.3.3"
}
}
2 changes: 1 addition & 1 deletion webapp/packages/core-cli/configs/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
transformIgnorePatterns: [
'\\.pnp\\.[^\\/]+$',
'node_modules/(?!@ngrx|(?!deck.gl)|ng-dynamic)',
'/node_modules/(?!(uuid|go-split|@react-dnd|react-dnd-html5-backend|react-dnd|dnd-core|@cloudbeaver))(.*)',
'/node_modules/(?!(uuid|go-split|@react-dnd|react-dnd-html5-backend|@timohausmann|react-dnd|dnd-core|@cloudbeaver))(.*)',
],
testPathIgnorePatterns: ['/node_modules/'],
moduleNameMapper: {
Expand Down
10 changes: 6 additions & 4 deletions webapp/packages/core-cli/configs/webpack.product.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,19 @@ module.exports = (env, argv) => {
overlay: false,
},
server,
proxy: {
'/api': {
proxy: [
{
context: ['/api'],
target: envServer,
secure: false,
},
'/api/ws': {
{
context: ['/api/ws'],
target: `${urlObject.protocol === 'https:' ? 'wss:' : 'ws:'}//${urlObject.hostname}:${urlObject.port}/api/ws`,
ws: true,
secure: false,
},
},
],
// onListening: function (devServer, ...args) {
// if (!devServer) {
// throw new Error('webpack-dev-server is not defined');
Expand Down
Loading

0 comments on commit a101a92

Please sign in to comment.