From 7735550544708a4a5ee6860c488e69c21b86003e Mon Sep 17 00:00:00 2001 From: alex <48489896+devnaumov@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:59:31 +0100 Subject: [PATCH 1/2] CB-5743 add autoGenerated field to api (#3043) Co-authored-by: Evgenia <139753579+EvgeniaBzzz@users.noreply.github.com> --- .../io.cloudbeaver.server/schema/service.sql.graphqls | 1 + .../service/sql/WebSQLQueryResultColumn.java | 5 +++++ .../src/queries/grid/getSqlExecuteTaskResults.gql | 1 + webapp/packages/core-utils/src/index.ts | 1 + webapp/packages/core-utils/src/isNumber.ts | 10 ++++++++++ 5 files changed, 18 insertions(+) create mode 100644 webapp/packages/core-utils/src/isNumber.ts diff --git a/server/bundles/io.cloudbeaver.server/schema/service.sql.graphqls b/server/bundles/io.cloudbeaver.server/schema/service.sql.graphqls index db942decd4..a1d12c3dd5 100644 --- a/server/bundles/io.cloudbeaver.server/schema/service.sql.graphqls +++ b/server/bundles/io.cloudbeaver.server/schema/service.sql.graphqls @@ -86,6 +86,7 @@ type SQLResultColumn { precision: Int required: Boolean! + autoGenerated: Boolean! readOnly: Boolean! readOnlyStatus: String diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLQueryResultColumn.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLQueryResultColumn.java index 9dfdc218c8..1f03d70e0b 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLQueryResultColumn.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLQueryResultColumn.java @@ -105,6 +105,11 @@ public boolean isRequired() { return attrMeta.isRequired(); } + @Property + public boolean isAutoGenerated() { + return attrMeta.isAutoGenerated(); + } + @Property public boolean isReadOnly() { return DBExecUtils.isAttributeReadOnly(attrMeta); diff --git a/webapp/packages/core-sdk/src/queries/grid/getSqlExecuteTaskResults.gql b/webapp/packages/core-sdk/src/queries/grid/getSqlExecuteTaskResults.gql index 9b1ef04431..d0838d2eee 100644 --- a/webapp/packages/core-sdk/src/queries/grid/getSqlExecuteTaskResults.gql +++ b/webapp/packages/core-sdk/src/queries/grid/getSqlExecuteTaskResults.gql @@ -22,6 +22,7 @@ mutation getSqlExecuteTaskResults($taskId: ID!) { position precision required + autoGenerated readOnly readOnlyStatus scale diff --git a/webapp/packages/core-utils/src/index.ts b/webapp/packages/core-utils/src/index.ts index 9344e0c195..e6da19c3d7 100644 --- a/webapp/packages/core-utils/src/index.ts +++ b/webapp/packages/core-utils/src/index.ts @@ -88,3 +88,4 @@ export * from './getProgressPercent.js'; export * from './types/UndefinedToNull.js'; export * from './bindFunctions.js'; export * from './getDomainFromUrl.js'; +export * from './isNumber.js'; diff --git a/webapp/packages/core-utils/src/isNumber.ts b/webapp/packages/core-utils/src/isNumber.ts new file mode 100644 index 0000000000..df54dd65df --- /dev/null +++ b/webapp/packages/core-utils/src/isNumber.ts @@ -0,0 +1,10 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2024 DBeaver Corp and others + * + * Licensed under the Apache License, Version 2.0. + * you may not use this file except in compliance with the License. + */ +export function isNumber(value: any): boolean { + return !isNaN(parseFloat(value)) && isFinite(value); +} From addeeb0c28b79b3050063c2c19e1942720923b26 Mon Sep 17 00:00:00 2001 From: Sychev Andrey <44414066+SychevAndrey@users.noreply.github.com> Date: Fri, 8 Nov 2024 16:01:12 +0100 Subject: [PATCH 2/2] CB-5765 refactor: remove word local from the phrase (#3063) Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com> --- webapp/packages/plugin-connection-search/src/locales/en.ts | 2 +- webapp/packages/plugin-connection-search/src/locales/fr.ts | 2 +- webapp/packages/plugin-connection-search/src/locales/it.ts | 2 +- webapp/packages/plugin-connection-search/src/locales/ru.ts | 2 +- webapp/packages/plugin-connection-search/src/locales/zh.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/webapp/packages/plugin-connection-search/src/locales/en.ts b/webapp/packages/plugin-connection-search/src/locales/en.ts index d99b5104c5..47382d9b47 100644 --- a/webapp/packages/plugin-connection-search/src/locales/en.ts +++ b/webapp/packages/plugin-connection-search/src/locales/en.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ export default [ - ['plugin_connection_search_action_search_label', 'Find Local Database'], + ['plugin_connection_search_action_search_label', 'Find Database'], ['plugin_connection_search_settings_disable', 'Disable "{alias:plugin_connection_search_action_search_label}"'], ['plugin_connection_search_settings_disable_description', 'Disable the ability to search connections on a specific address'], ]; diff --git a/webapp/packages/plugin-connection-search/src/locales/fr.ts b/webapp/packages/plugin-connection-search/src/locales/fr.ts index a371fbcb02..47382d9b47 100644 --- a/webapp/packages/plugin-connection-search/src/locales/fr.ts +++ b/webapp/packages/plugin-connection-search/src/locales/fr.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ export default [ - ['plugin_connection_search_action_search_label', 'Trouver une base de données locale'], + ['plugin_connection_search_action_search_label', 'Find Database'], ['plugin_connection_search_settings_disable', 'Disable "{alias:plugin_connection_search_action_search_label}"'], ['plugin_connection_search_settings_disable_description', 'Disable the ability to search connections on a specific address'], ]; diff --git a/webapp/packages/plugin-connection-search/src/locales/it.ts b/webapp/packages/plugin-connection-search/src/locales/it.ts index d99b5104c5..47382d9b47 100644 --- a/webapp/packages/plugin-connection-search/src/locales/it.ts +++ b/webapp/packages/plugin-connection-search/src/locales/it.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ export default [ - ['plugin_connection_search_action_search_label', 'Find Local Database'], + ['plugin_connection_search_action_search_label', 'Find Database'], ['plugin_connection_search_settings_disable', 'Disable "{alias:plugin_connection_search_action_search_label}"'], ['plugin_connection_search_settings_disable_description', 'Disable the ability to search connections on a specific address'], ]; diff --git a/webapp/packages/plugin-connection-search/src/locales/ru.ts b/webapp/packages/plugin-connection-search/src/locales/ru.ts index 4730465083..3c2dcffd7a 100644 --- a/webapp/packages/plugin-connection-search/src/locales/ru.ts +++ b/webapp/packages/plugin-connection-search/src/locales/ru.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ export default [ - ['plugin_connection_search_action_search_label', 'Найти локальную базу данных'], + ['plugin_connection_search_action_search_label', 'Найти базу данных'], ['plugin_connection_search_settings_disable', 'Отключить "{alias:plugin_connection_search_action_search_label}"'], ['plugin_connection_search_settings_disable_description', 'Отключить возможность поиска подключений по заданному адресу'], ]; diff --git a/webapp/packages/plugin-connection-search/src/locales/zh.ts b/webapp/packages/plugin-connection-search/src/locales/zh.ts index fd82a90802..47382d9b47 100644 --- a/webapp/packages/plugin-connection-search/src/locales/zh.ts +++ b/webapp/packages/plugin-connection-search/src/locales/zh.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ export default [ - ['plugin_connection_search_action_search_label', '查找本地数据库'], + ['plugin_connection_search_action_search_label', 'Find Database'], ['plugin_connection_search_settings_disable', 'Disable "{alias:plugin_connection_search_action_search_label}"'], ['plugin_connection_search_settings_disable_description', 'Disable the ability to search connections on a specific address'], ];