fix(plugin-resource-manager): CB-1926 revert loader

This commit is contained in:
Naumov Alexey
2022-05-18 18:20:26 +02:00
parent c8c9149837
commit e6964e2dd4
4 changed files with 9 additions and 31 deletions
@@ -205,8 +205,6 @@ export class SqlEditorTabResourceService {
}
try {
this.sqlEditorService.setProcess({ processing: true, label: 'ui_processing_synchronization' }, tab.handlerState);
const found = await this.navTreeResource.preloadNodeParents(state.parents, state.nodeId);
if (!found) {
@@ -218,8 +216,6 @@ export class SqlEditorTabResourceService {
this.sqlEditorService.setQuery(query, tab.handlerState);
} catch (exception) {
this.notificationService.logException(exception as any, 'plugin_resource_manager_sync_script_error');
} finally {
this.sqlEditorService.setProcess(null, tab.handlerState);
}
}
}
@@ -7,12 +7,6 @@
*/
import type { IConnectionExecutionContextInfo } from '@cloudbeaver/core-connections';
import type { TLocalizationToken } from '@cloudbeaver/core-localization';
export interface ISqlEditorProcess {
processing: boolean;
label?: TLocalizationToken;
}
export interface IResultTab {
tabId: string;
@@ -55,7 +49,6 @@ export interface ISqlEditorTabState {
order: number;
query: string;
executionContext?: IConnectionExecutionContextInfo;
process: ISqlEditorProcess | null;
currentTabId?: string;
tabs: ISqlEditorResultTab[];
resultGroups: IResultGroup[];
@@ -11,7 +11,6 @@ import { useEffect, useState } from 'react';
import styled, { css } from 'reshadow';
import { DATA_CONTEXT_NAV_NODE, DATA_CONTEXT_NAV_NODES, NavNode, NavNodeManagerService } from '@cloudbeaver/core-app';
import { Loader } from '@cloudbeaver/core-blocks';
import { useService } from '@cloudbeaver/core-di';
import { NotificationService } from '@cloudbeaver/core-events';
import { TabContainerPanelComponent, useDNDBox } from '@cloudbeaver/core-ui';
@@ -36,7 +35,6 @@ const styles = css`
`;
export const SQLCodeEditorPanel: TabContainerPanelComponent<ISqlEditorModeProps> = observer(function SQLCodeEditorPanel({
state,
data,
}) {
const notificationService = useService(NotificationService);
@@ -99,16 +97,14 @@ export const SQLCodeEditorPanel: TabContainerPanelComponent<ISqlEditorModeProps>
}, [sqlCodeEditorController]);
return styled(styles)(
<Loader loading={!!state.process?.processing} message={state.process?.label}>
<box ref={dndBox.setRef}>
<SQLCodeEditorLoader
ref={setEditor}
readonly={data.readonly}
bindings={panelData.bindings}
dialect={data.dialect}
value={data.value}
/>
</box>
</Loader>
<box ref={dndBox.setRef}>
<SQLCodeEditorLoader
ref={setEditor}
readonly={data.readonly}
bindings={panelData.bindings}
dialect={data.dialect}
value={data.value}
/>
</box>
);
});
@@ -13,8 +13,6 @@ import { Executor } from '@cloudbeaver/core-executor';
import { GraphQLService, SqlCompletionProposal, SqlScriptInfoFragment } from '@cloudbeaver/core-sdk';
import type { ISqlEditorTabState } from '@cloudbeaver/plugin-sql-editor';
import type { ISqlEditorProcess } from './ISqlEditorTabState';
export type SQLProposal = SqlCompletionProposal;
export interface IQueryChangeData {
@@ -55,7 +53,6 @@ export class SqlEditorService {
resultTabs: [],
executionPlanTabs: [],
statisticsTabs: [],
process: null,
currentModeId: '',
modeState: [],
};
@@ -111,10 +108,6 @@ export class SqlEditorService {
state.name = name;
}
setProcess(process: ISqlEditorProcess | null, state: ISqlEditorTabState) {
state.process = process;
}
setQuery(query: string, state: ISqlEditorTabState) {
const prevQuery = state.query;