Skip to content

Conversation

@AhyoungRyu
Copy link
Contributor

@AhyoungRyu AhyoungRyu commented Dec 13, 2016

What is this PR for?

There are lots of use cases that need to know each Paragraph Id in Zeppelin.
e.g. run paragraph using rest api / z.angularBind / export paragraphs using iframe ...

So I added Copy to clipboard btn next the each Paragraph Id under paragraph setting menu using angular-zeroclipboard.
It'll be useful even if it's small feature :)

What type of PR is it?

Improvement | Feature

What is the Jira issue?

ZEPPELIN-1796

How should this be tested?

  1. npm run build under zeppelin-web/
  2. npm run start to start dev mode and browse http://localhost:9000
  3. click gear icon placed top of the each paragraph -> hover the mouse on the paragraph id
  4. click it and paste the paragraph id to anywhere to check it's copied well or not

Screenshots (if appropriate)

copy_pid

Questions:

  • Does the licenses files need update? no
  • Is there breaking changes for older versions? no
  • Does this needs documentation? no

});

uiZeroclipConfigProvider.setZcConf({
swfPath: '../bower_components/zeroclipboard/dist/ZeroClipboard.swf'
Copy link
Member

Choose a reason for hiding this comment

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

i thought we had a PR with this long time back. is this loading Flash?

@AhyoungRyu
Copy link
Contributor Author

AhyoungRyu commented Dec 13, 2016

@felixcheung
I just tested this patch only in dev mode. But after I checked at localhost:8080 and found

404 http://localhost:8080/bower_components/zeroclipboard/dist/ZeroClipboard.swf

So I fixed it in here: 616b743. There won't be ZeroClipboard.swf loading issue anymore.

@felixcheung
Copy link
Member

felixcheung commented Dec 13, 2016 via email

@AhyoungRyu
Copy link
Contributor Author

@felixcheung Yeah you're right. So I changed the library from angular-zeroclipboard to ngclipboard which is not using flash. It says

Angularjs directive for clipboard.js. A modern approach to copy text to clipboard without using flash.

And I checked it works well in Chrome / Firefox / Safari.
Thanks for letting me know :)

@AhyoungRyu
Copy link
Contributor Author

For the consistency with other menus in the dropdown menu, I removed the clippy icon and make paragraph id text itself as a button.
screen shot 2016-12-15 at 2 56 43 pmscreen shot 2016-12-15 at 2 56 51 pm

@AhyoungRyu
Copy link
Contributor Author

CI has passed now. Ready to review again :)

@felixcheung
Copy link
Member

LGTM!
Maybe we can leverage this for more copy to clipboard features?

@AhyoungRyu
Copy link
Contributor Author

@felixcheung Yeah that's my plan :D

@AhyoungRyu
Copy link
Contributor Author

Will merge into master if there are no more comments then

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.

2 participants