-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: display view query text #1761
Conversation
Lets try to use Monaco because now we have different query colorization, and this may be confusing. |
Implemented using readonly MonacoEditor with some custom options |
const themeValue = useThemeValue(); | ||
const theme = `vs-${themeValue}`; | ||
|
||
const editorOptions = React.useMemo<editor.IStandaloneEditorConstructionOptions>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's all constant options, let's move them outside from component.
|
||
const editorOptions = React.useMemo<editor.IStandaloneEditorConstructionOptions>( | ||
() => ({ | ||
readOnly: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
); | ||
} | ||
return <React.Fragment>{value}</React.Fragment>; | ||
export const TruncatedQuery = ({value = ''}: TruncatedQueryProps) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now it's not truncated. Let's rename component
className, | ||
children, | ||
language = YQL_LANGUAGE_ID, | ||
}: SnippetProps): JSX.Element => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for now we don't specify returning type. It seems we should always do (and add linter rule for this), or always don't...
@@ -36,8 +20,11 @@ interface OneLineQueryWithPopoverProps { | |||
|
|||
export const OneLineQueryWithPopover = ({value = ''}: OneLineQueryWithPopoverProps) => { | |||
return ( | |||
<CellWithPopover contentClassName={b('popover-content')} content={value}> | |||
{value} | |||
<CellWithPopover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that popover is now redundant, because we don't truncate query any more.
@@ -38,7 +37,7 @@ const queryTextColumn: Column<KeyValueRow> = { | |||
sortAccessor: (row) => Number(row.CPUTimeUs), | |||
render: ({row}) => ( | |||
<div className={b('query')}> | |||
<TruncatedQuery value={row.QueryText?.toString()} maxQueryHeight={MAX_QUERY_HEIGHT} /> | |||
<TruncatedQuery value={row.QueryText?.toString()} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
language={language} | ||
theme={theme} | ||
value={children} | ||
height={SNIPPET_LENGTH * 20} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #1755
Closes #919
Stand
CI Results
Test Status: β FAILED
π Full Report
π No changes in tests. π
Bundle Size: β
Current: 65.89 MB | Main: 65.89 MB
Diff: +3.15 KB (0.00%)
β Bundle size unchanged.
βΉοΈ CI Information