Skip to content

CB-4348 fix: parse sql script#2212

Merged
Wroud merged 2 commits intodevelfrom
fix/cb-4348/parse-script
Dec 14, 2023
Merged

CB-4348 fix: parse sql script#2212
Wroud merged 2 commits intodevelfrom
fix/cb-4348/parse-script

Conversation

@Wroud
Copy link
Copy Markdown
Member

@Wroud Wroud commented Dec 8, 2023

No description provided.

import { useStyles } from './useStyles';

interface Props {
tag?: 'button' | 'a' | 'div';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this? I believe it is better to divide functionality. For example if we want a button to behave like a link it should be something like this:

<Link>
    <Button>Button Text></Button>
</Link>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to HTML, it's a really bad idea to place tags like this: <a><button></button></a>
the main idea here is that sometimes we want to display button looking component as a link or div so we can place it in another component like a button or input label

(it's really rare cases usually)


this.onFormat.execute([script, formatted]);
this.setQuery(query.substring(0, script.begin) + formatted + query.substring(script.end));
this.setScript(query.substring(0, script.begin) + formatted + query.substring(script.end));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes JS behaves crazy in this cases of concatenation if data is not as it expected to be. I would recommend to use .concat method to avoid bugs in future

@sergeyteleshev sergeyteleshev removed their assignment Dec 11, 2023
@Wroud Wroud merged commit 5779100 into devel Dec 14, 2023
@Wroud Wroud deleted the fix/cb-4348/parse-script branch December 14, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants