Copy path, open, and backup buttons for wallet on Help page #2587

Closed
ghost wants to merge 3 commits from wallet-backup-buttons-master into master
ghost commented 2019-06-29 00:18:04 +02:00 (Migrated from github.com)

((Copy of #2585 targeted at master instead of 0.33.2))

PR Checklist

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

Fixes

Issue Number: #1601 #1635

What is the current behavior?

What is the new behavior?

There are buttons to copy the path of the lbryum folder to the clipboard, open that folder in the system's file manager, and create a backup zip archive of the folder's contents. The backup zip's filename includes a timestamp, and it gets placed (in order of preference) in the user's Downloads folder, in their home folder, or right next to the lbryum folder itself. Afterwards, the backup zip is shown in the system file manager at which point the user can choose what to do with it.

Other information

The zipping functionality is provided by the adm-zip package, and it is unfortunately synchronous, locking the UI for a second or so. I initially tested the asynchronous archiver package but was unable to get it to work in Electron.

Similar to #1628 and #1638 which were closed but not merged. If desired, I could attempt to make the "copy path" functionality more in line with what was discussed in those PRs with a new CopyableInput component.

I hesitate to submit features unsolicited, so no worries if this isn't quite what you're looking for. My main goal with this work has been to learn more about Electron and freshen up on React, but I hope you find it useful.

((Copy of #2585 targeted at master instead of 0.33.2)) ## PR Checklist <!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" --> Please check all that apply to this PR using "x": - [x] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged) - [x] I have checked that this PR does not introduce a breaking change - [ ] This PR introduces breaking changes and I have provided a detailed explanation below ## PR Type What kind of change does this PR introduce? - [ ] Bugfix - [x] Feature - [ ] Code style update (formatting) - [ ] Refactoring (no functional changes) - [ ] Documentation changes - [ ] Other - Please describe: ## Fixes Issue Number: #1601 #1635 ## What is the current behavior? ## What is the new behavior? There are buttons to copy the path of the lbryum folder to the clipboard, open that folder in the system's file manager, and create a backup zip archive of the folder's contents. The backup zip's filename includes a timestamp, and it gets placed (in order of preference) in the user's Downloads folder, in their home folder, or right next to the lbryum folder itself. Afterwards, the backup zip is shown in the system file manager at which point the user can choose what to do with it. ## Other information The zipping functionality is provided by the `adm-zip` package, and it is unfortunately synchronous, locking the UI for a second or so. I initially tested the asynchronous `archiver` package but was unable to get it to work in Electron. Similar to #1628 and #1638 which were closed but not merged. If desired, I could attempt to make the "copy path" functionality more in line with what was discussed in those PRs with a new CopyableInput component. I hesitate to submit features unsolicited, so no worries if this isn't quite what you're looking for. My main goal with this work has been to learn more about Electron and freshen up on React, but I hope you find it useful. <!-- If this PR contains a breaking change, please describe the impact and solution strategy for existing applications below. -->
neb-b (Migrated from github.com) requested changes 2019-07-01 20:38:20 +02:00
neb-b (Migrated from github.com) left a comment

Just one comment. Tested and working great.

This is awesome!!

Just one comment. Tested and working great. This is awesome!!
@ -58,0 +142,4 @@
button="primary"
label={__('Create Backup')}
onClick={() => this.backupWalletDir(lbryumWalletDir)}
/>
neb-b (Migrated from github.com) commented 2019-07-01 20:37:10 +02:00

Instead of showing the success message for copy, lets use doToast({ message: "..." }), that's what we use for other places that have a copy button. It also won't remove the success message after creating a backup.

Instead of showing the success message for copy, lets use `doToast({ message: "..." })`, that's what we use for other places that have a copy button. It also won't remove the success message after creating a backup.
Madiator2011 reviewed 2019-07-01 23:08:36 +02:00
@ -58,0 +142,4 @@
button="primary"
label={__('Create Backup')}
onClick={() => this.backupWalletDir(lbryumWalletDir)}
/>

Hi @seanyesmunt , when looking through the source for other uses of doToast, I noticed some components (like the wallet address) use a CopyableText component that provides the copy button right next to the text field. I have replaced the copy button I added with the use of this CopyableText component.

Also, I thought I should mention, I haven't been able to test on the master branch due to an npm install error referencing an unknown commit in lbry-redux: b3bf3f6d53410ff1c5415b51ca425341e364959f, so I've been testing on 0.33.2 for now.

Thanks!

Hi @seanyesmunt , when looking through the source for other uses of doToast, I noticed some components (like the wallet address) use a CopyableText component that provides the copy button right next to the text field. I have replaced the copy button I added with the use of this CopyableText component. Also, I thought I should mention, I haven't been able to test on the master branch due to an `npm install` error referencing an unknown commit in lbry-redux: b3bf3f6d53410ff1c5415b51ca425341e364959f, so I've been testing on 0.33.2 for now. Thanks!
neb-b (Migrated from github.com) reviewed 2019-07-02 05:14:46 +02:00
@ -58,0 +142,4 @@
button="primary"
label={__('Create Backup')}
onClick={() => this.backupWalletDir(lbryumWalletDir)}
/>
neb-b (Migrated from github.com) commented 2019-07-02 05:14:45 +02:00

@jcamp0x2a sorry about that. I just pushed a commit that fixes that. Should be good to go now.

@jcamp0x2a sorry about that. I just pushed a commit that fixes that. Should be good to go now.
neb-b commented 2019-07-02 05:28:06 +02:00 (Migrated from github.com)

@jcamp0x2a I rebased this against master and created #2596

Closing this one. Thanks again for the contribution! Can we show you any appreciation?
https://lbry.com/faq/appreciation

@jcamp0x2a I rebased this against master and created #2596 Closing this one. Thanks again for the contribution! Can we show you any appreciation? https://lbry.com/faq/appreciation

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#2587
No description provided.