Skip to content
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

copy code button added in Ballerina Action sample #8081

Merged

Conversation

s-vamshi
Copy link
Contributor

@s-vamshi s-vamshi commented Oct 23, 2023

Fixes #8001

This is how it looks
image

Checklist

  • Page addition

    • Add permalink to pages.
  • Page removal

    • Remove entry from corresponding left nav YAML file.
    • Add redirect_from on the alternative page.
    • If no alternative page, add redirection on the redirections.js file.
  • Page rename

    • Add front-matter redirect_from.
    • Add front-matter redirect_to: (if applicable).
  • Page restrcuture

    • Add permalink to pages.
    • Add front-matter redirect_from.
    • Add front-matter redirect_to: (if applicable).

@s-vamshi
Copy link
Contributor Author

@sm1990 can you please review pr?

@sm1990
Copy link
Contributor

sm1990 commented Oct 24, 2023

@s-vamshi please add a copy button to the proto file in the grpc sample.
image

@s-vamshi
Copy link
Contributor Author

@sm1990 can you please review now?
image

@sm1990
Copy link
Contributor

sm1990 commented Oct 25, 2023

@s-vamshi when copying the grpc sample, the both the Ballerina code and the proto code is shown as copied eventhough only one gets copied.
image

Also, in the copied text double quotes (") are shown as &quote;
image
Try sending the raw code as a prop to BalAction component. That way you can get rid of the htmlToCode funtion as well.
Let me know if it works.

@s-vamshi
Copy link
Contributor Author

@s-vamshi when copying the grpc sample, the both the Ballerina code and the proto code is shown as copied eventhough only one gets copied.

Ya, It is because I am using same setCopied state for both code block.
Can I create a new state for proto code?

@s-vamshi
Copy link
Contributor Author

@sm1990 can you please review now?
1.Removed htmltocode fun and used code props
2. Used another state for props copy

@sm1990 sm1990 merged commit 7ac297e into ballerina-platform:master Oct 25, 2023
1 check passed
@s-vamshi
Copy link
Contributor Author

@sm1990 I have submitted the form for previous PR as part of Hacktoberfest, should I submit the form another response with this PR link?

@sm1990
Copy link
Contributor

sm1990 commented Oct 26, 2023

@sm1990 I have submitted the form for previous PR as part of Hacktoberfest, should I submit the form another response with this PR link?

Yes please. Thank you again for your your contribution 😄

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.

Add a copy code button to Ballerina in Action samples
2 participants