mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-25 09:34:18 +08:00
chore: linting improvements
This commit is contained in:
@@ -100,7 +100,7 @@ export class QueryDataSource extends DatabaseDataSource<IDataContainerOptions, I
|
||||
constraints: this.options.constraints,
|
||||
where: this.options.whereFilter || undefined,
|
||||
},
|
||||
this.dataFormat,
|
||||
this.dataFormat
|
||||
);
|
||||
|
||||
this.sqlProcess = this.metadata.resultDataProcess;
|
||||
|
||||
@@ -14,7 +14,6 @@ import { GraphQLService, SqlDialectInfo } from '@cloudbeaver/core-sdk';
|
||||
|
||||
@injectable()
|
||||
export class SqlDialectInfoService {
|
||||
|
||||
@observable private dialectInfo = new Map<string, SqlDialectInfo>();
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -24,7 +24,6 @@ const COMMON_EDITOR_CONFIGURATION: EditorConfiguration = {
|
||||
|
||||
@injectable()
|
||||
export class CodeEditorController {
|
||||
|
||||
private dialect?: SqlDialectInfo;
|
||||
private editor?: Editor;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import CodeMirror, {
|
||||
EditorConfiguration, Editor, EditorChange, Position, AsyncHintFunction,
|
||||
EditorConfiguration, Editor, EditorChange, Position, AsyncHintFunction
|
||||
} from 'codemirror';
|
||||
import { computed } from 'mobx';
|
||||
import { IControlledCodeMirror } from 'react-codemirror2';
|
||||
@@ -26,7 +26,6 @@ const showHint = CodeMirror.showHint;
|
||||
|
||||
@injectable()
|
||||
export class SqlEditorController implements IInitializableController {
|
||||
|
||||
@computed get dialect(): SqlDialectInfo | undefined {
|
||||
return this.sqlDialectInfoService.getDialectInfo(this.tab.handlerState.connectionId);
|
||||
}
|
||||
@@ -87,7 +86,7 @@ export class SqlEditorController implements IInitializableController {
|
||||
constructor(
|
||||
private sqlResultTabsService: SqlResultTabsService,
|
||||
private sqlDialectInfoService: SqlDialectInfoService,
|
||||
private sqlEditorService: SqlEditorService,
|
||||
private sqlEditorService: SqlEditorService
|
||||
) { }
|
||||
|
||||
init(tab: ITab<ISqlEditorTabState>) {
|
||||
@@ -137,7 +136,7 @@ export class SqlEditorController implements IInitializableController {
|
||||
this.tab.handlerState.query,
|
||||
cursorPosition
|
||||
)
|
||||
.then((proposals) => {
|
||||
.then(proposals => {
|
||||
if (!proposals) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import { GraphQLService, QuerySqlCompletionProposalsQuery } from '@cloudbeaver/c
|
||||
|
||||
@injectable()
|
||||
export class SqlEditorService {
|
||||
|
||||
constructor(private gql: GraphQLService) {
|
||||
}
|
||||
|
||||
@@ -21,7 +20,6 @@ export class SqlEditorService {
|
||||
query: string,
|
||||
cursor: number
|
||||
): Promise<QuerySqlCompletionProposalsQuery['sqlCompletionProposals'] | null> {
|
||||
|
||||
const result = await this.gql.sdk.querySqlCompletionProposals({
|
||||
connectionId,
|
||||
contextId,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import { ThemeSelector } from '@cloudbeaver/core-theming';
|
||||
|
||||
export const SqlEditorStyles: ThemeSelector = async (theme) => {
|
||||
export const SqlEditorStyles: ThemeSelector = async theme => {
|
||||
let styles: any;
|
||||
|
||||
switch (theme) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
EObjectFeature,
|
||||
NodeManagerUtils,
|
||||
NavNode, ConnectionSchemaManagerService,
|
||||
isObjectCatalogProvider, isObjectSchemaProvider,
|
||||
isObjectCatalogProvider, isObjectSchemaProvider
|
||||
} from '@cloudbeaver/core-app';
|
||||
import { ConnectionsManagerService, isConnectionProvider } from '@cloudbeaver/core-connections';
|
||||
import { injectable } from '@cloudbeaver/core-di';
|
||||
@@ -31,7 +31,7 @@ export class SqlEditorBootstrap {
|
||||
private sqlEditorTabService: SqlEditorTabService,
|
||||
private sqlEditorNavigatorService: SqlEditorNavigatorService,
|
||||
private connectionSchemaManagerService: ConnectionSchemaManagerService,
|
||||
private activeViewService: ActiveViewService,
|
||||
private activeViewService: ActiveViewService
|
||||
) {}
|
||||
|
||||
async bootstrap() {
|
||||
@@ -86,7 +86,7 @@ export class SqlEditorBootstrap {
|
||||
this.sqlEditorNavigatorService.openNewEditor(
|
||||
connectionId,
|
||||
catalogId,
|
||||
schemaId,
|
||||
schemaId
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ export class SqlEditorBootstrap {
|
||||
this.sqlEditorNavigatorService.openNewEditor(
|
||||
this.connectionSchemaManagerService.currentConnectionId,
|
||||
this.connectionSchemaManagerService.currentObjectCatalogId,
|
||||
this.connectionSchemaManagerService.currentObjectSchemaId,
|
||||
this.connectionSchemaManagerService.currentObjectSchemaId
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ export class SqlEditorNavigatorService {
|
||||
private connectionInfoResource: ConnectionInfoResource,
|
||||
private sqlEditorTabService: SqlEditorTabService
|
||||
) {
|
||||
|
||||
this.navigator = new Executor<SQLCreateAction | SQLEditorAction>()
|
||||
.addHandler(this.navigateHandler.bind(this));
|
||||
this.connectionsManagerService.onCloseConnection.subscribe(this.handleConnectionClose.bind(this));
|
||||
|
||||
@@ -10,7 +10,7 @@ import styled, { css } from 'reshadow';
|
||||
|
||||
import { TabHandlerPanelProps } from '@cloudbeaver/core-app';
|
||||
import {
|
||||
splitStyles, Split, ResizerControls, Pane, splitHorizontalStyles,
|
||||
splitStyles, Split, ResizerControls, Pane, splitHorizontalStyles
|
||||
} from '@cloudbeaver/core-blocks';
|
||||
import { useStyles } from '@cloudbeaver/core-theming';
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
objectCatalogProvider,
|
||||
objectCatalogSetter,
|
||||
objectSchemaSetter,
|
||||
ITabOptions,
|
||||
ITabOptions
|
||||
} from '@cloudbeaver/core-app';
|
||||
import {
|
||||
ConnectionInfoResource,
|
||||
@@ -108,7 +108,6 @@ export class SqlEditorTabService {
|
||||
}
|
||||
|
||||
private async handleTabRestore(tab: ITab<ISqlEditorTabState>): Promise<boolean> {
|
||||
|
||||
if (typeof tab.handlerState.query !== 'string'
|
||||
|| typeof tab.handlerState.connectionId !== 'string'
|
||||
|| typeof tab.handlerState.contextId !== 'string'
|
||||
@@ -233,7 +232,6 @@ export class SqlEditorTabService {
|
||||
defaultCatalog?: string,
|
||||
defaultSchema?: string
|
||||
): Promise<IExecutionContext> {
|
||||
|
||||
const response = await this.gql.sdk.sqlContextCreate({
|
||||
connectionId,
|
||||
defaultCatalog,
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
AsyncTaskInfo, GraphQLService, ServerInternalError, SqlExecuteInfo, SqlDataFilter, ResultDataFormat
|
||||
} from '@cloudbeaver/core-sdk';
|
||||
import {
|
||||
CancellablePromise, cancellableTimeout, Deferred, EDeferredState,
|
||||
CancellablePromise, cancellableTimeout, Deferred, EDeferredState
|
||||
} from '@cloudbeaver/core-utils';
|
||||
|
||||
import { ISqlQueryParams } from '../ISqlEditorTabState';
|
||||
@@ -19,7 +19,6 @@ import { ISqlQueryParams } from '../ISqlEditorTabState';
|
||||
const DELAY_BETWEEN_TRIES = 1000;
|
||||
|
||||
export class SQLQueryExecutionProcess extends Deferred<SqlExecuteInfo> {
|
||||
|
||||
private taskId?: string;
|
||||
private timeout?: CancellablePromise<void>;
|
||||
private isCancelConfirmed = false; // true when server successfully executed cancelQueryAsync
|
||||
@@ -109,7 +108,7 @@ export class SQLQueryExecutionProcess extends Deferred<SqlExecuteInfo> {
|
||||
private async executeQueryAsync(
|
||||
sqlQueryParams: ISqlQueryParams,
|
||||
filter: SqlDataFilter,
|
||||
dataFormat: ResultDataFormat,
|
||||
dataFormat: ResultDataFormat
|
||||
): Promise<AsyncTaskInfo> {
|
||||
const { taskInfo } = await this.graphQLService.sdk.asyncSqlExecuteQuery({
|
||||
connectionId: sqlQueryParams.connectionId,
|
||||
|
||||
+1
-4
@@ -23,7 +23,7 @@ import {
|
||||
RowDiff,
|
||||
TableViewerStorageService,
|
||||
TableViewerModel,
|
||||
DatabaseDataAccessMode,
|
||||
DatabaseDataAccessMode
|
||||
} from '@cloudbeaver/plugin-data-viewer';
|
||||
|
||||
import { IResultDataTab, IQueryTabGroup } from '../../ISqlEditorTabState';
|
||||
@@ -43,7 +43,6 @@ export enum EPanelState {
|
||||
@injectable()
|
||||
export class SqlResultPanelController
|
||||
implements IInitializableController, IDestructibleController {
|
||||
|
||||
@observable state: EPanelState = EPanelState.PENDING;
|
||||
@observable executionResult = '';
|
||||
@observable errorMessage?: string;
|
||||
@@ -138,7 +137,6 @@ implements IInitializableController, IDestructibleController {
|
||||
tableModel.setColumns(initialState.columns);
|
||||
tableModel.updateInfo(initialState.statusMessage, initialState.duration);
|
||||
}
|
||||
|
||||
} catch (exception) {
|
||||
if (exception instanceof PromiseCancelledError) {
|
||||
this.state = EPanelState.MESSAGE_RESULT;
|
||||
@@ -240,5 +238,4 @@ implements IInitializableController, IDestructibleController {
|
||||
|
||||
return this.sqlResultService.sqlExecuteInfoToData(response, this.panelInit.indexInResultSet);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import { ISqlQueryParams } from '../ISqlEditorTabState';
|
||||
|
||||
@injectable()
|
||||
export class SqlResultService {
|
||||
|
||||
constructor(private graphQLService: GraphQLService) { }
|
||||
|
||||
async saveChanges(
|
||||
@@ -22,7 +21,6 @@ export class SqlResultService {
|
||||
resultId: string,
|
||||
diff: RowDiff[]
|
||||
): Promise<SqlExecuteInfo> {
|
||||
|
||||
const response = await this.graphQLService.sdk.updateResultsDataBatch({
|
||||
connectionId: sqlQueryParams.connectionId,
|
||||
contextId: sqlQueryParams.contextId,
|
||||
@@ -50,5 +48,4 @@ export class SqlResultService {
|
||||
};
|
||||
return dataResults;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export class SqlResultTabsService {
|
||||
private tabExecutionContext: MetadataMap<string, SqlExecutionState>;
|
||||
|
||||
constructor(
|
||||
private sqlEditorGroupMetadataService: SqlEditorGroupMetadataService,
|
||||
private sqlEditorGroupMetadataService: SqlEditorGroupMetadataService
|
||||
) {
|
||||
this.tabExecutionContext = new MetadataMap(() => new SqlExecutionState());
|
||||
}
|
||||
@@ -148,7 +148,6 @@ export class SqlResultTabsService {
|
||||
private getTabNameForOrder(order: number, groupOrder: number) {
|
||||
return `Result - ${groupOrder} (${order})`;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function findMinimalFree(array: number[], base: number): number {
|
||||
|
||||
Reference in New Issue
Block a user