michael-s-molina commented on code in PR #24847:
URL: https://github.com/apache/superset/pull/24847#discussion_r1280705258
##########
superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.ts:
##########
@@ -50,6 +50,11 @@ const EMPTY_LIST = [] as typeof sqlKeywords;
const { useQueryState: useSchemasQueryState } = schemaEndpoints.schemas;
const { useQueryState: useTablesQueryState } = tableEndpoints.tables;
+const getHelperText = (value: string) =>
+ value.length > 30 && {
+ docText: value,
Review Comment:
Should you add this property to the [Typescript
definition](https://github.com/apache/superset/blob/ea17dd637c9259236292d7d81887e59f0f14eacc/superset-frontend/src/components/AsyncAceEditor/index.tsx#L54)?
##########
superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.ts:
##########
@@ -50,6 +50,11 @@ const EMPTY_LIST = [] as typeof sqlKeywords;
const { useQueryState: useSchemasQueryState } = schemaEndpoints.schemas;
const { useQueryState: useTablesQueryState } = tableEndpoints.tables;
+const getHelperText = (value: string) =>
+ value.length > 30 && {
Review Comment:
Is it possible to make this dynamic and controlled by the UI instead of a
fixed 30 length? Does the component offer something the possibility of
overriding the popup options so you can render them with a custom component
that displays a tooltip when truncated? If this is possible, it would also
resolve the different theming issue.
##########
superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.test.ts:
##########
@@ -267,3 +267,49 @@ test('returns column keywords among selected tables',
async () => {
),
);
});
+
+test('returns long keywords with docText', async () => {
Review Comment:
Is it possible to add a test to `AsyncEditorWrapper` and test the user
interaction such as hovering an item and check that the tooltip will appear?
RTL recommends [avoiding tests for implementation
details](https://testing-library.com/docs/#what-you-should-avoid-with-testing-library)
as they can change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]