
* sse init * sse refactoring * checkstyle fix * checkstyle fix * refactor * refactor * api spec changes * ReactiveAdminClient toMono fix * moved to ksql/v2 request * Updates Result renderer and Query SSE bugs * Result renderer works * Corretcly renders table and errors * Changes the way getFormattedError formats message for error alert * Adds common comp Header, Adds new component TableTitle, Changes PageHeading, LatestVersionItem and TableTitle to use Header comp, Adds error handling for KSQL SSE * Changes functions to useCallbacks * WIP: Fixes linter issue * fixes * WIP: Disables controls on request * fixes * WIP: Disabled editors look disabled, Updates snapshot * WIP: Removes codesmell * fixes * fixes * WIP: Adds eslint rules for react hooks, Fixes bug in ksqlDb query * WIP: Fixes error with early return * WIP: run to test if it builds * WIP: Fixes error formating * WIP: Fixes error message * WIP: better error * WIP: Fixes validation issues and now we can submit form with CMD + ENTER * WIP: Initial tests * WIP: More test for query * WIP: rewrite to make things simpler * WIP: Tests done * WIP: More tests * small improvement * Test if sonar works * Adds cases for TableRenderer * Fixes test fro table renderer * Changes sonar properties * Adds cases for QueryForm.spec.tsx * Adds cases to QueryForm.spec.tsx * Updates Query.spec.tsx * Adds small eventsource mock * Adds test to QueryForm.spec.tsx * Updates Query.spec.tsx * Better error with empty response Co-authored-by: Ekaterina Petrova <epetrova@provectus.com> Co-authored-by: iliax <ikuramshin@provectus.com> Co-authored-by: Ilya Kuramshin <ilia-2k@rambler.ru> Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com> Co-authored-by: Mgrdich <mgotm13@gmail.com> Co-authored-by: Mgrdich <46796009+Mgrdich@users.noreply.github.com>
36 lines
886 B
TypeScript
36 lines
886 B
TypeScript
/* eslint-disable react/jsx-props-no-spreading */
|
|
import AceEditor, { IAceEditorProps } from 'react-ace';
|
|
import 'ace-builds/src-noconflict/mode-sql';
|
|
import 'ace-builds/src-noconflict/theme-textmate';
|
|
import React from 'react';
|
|
import ReactAce from 'react-ace/lib/ace';
|
|
|
|
interface SQLEditorProps extends IAceEditorProps {
|
|
isFixedHeight?: boolean;
|
|
}
|
|
|
|
const SQLEditor = React.forwardRef<ReactAce | null, SQLEditorProps>(
|
|
(props, ref) => {
|
|
const { isFixedHeight, ...rest } = props;
|
|
return (
|
|
<AceEditor
|
|
ref={ref}
|
|
mode="sql"
|
|
theme="textmate"
|
|
tabSize={2}
|
|
width="100%"
|
|
height={
|
|
isFixedHeight
|
|
? `${(props.value?.split('\n').length || 32) * 16}px`
|
|
: '372px'
|
|
}
|
|
wrapEnabled
|
|
{...rest}
|
|
/>
|
|
);
|
|
}
|
|
);
|
|
|
|
SQLEditor.displayName = 'SQLEditor';
|
|
|
|
export default SQLEditor;
|