Skip to content

Add a transfer ownership background job - #17736

Merged
rullzer merged 2 commits into
masterfrom
enh/transfer_ownership
Dec 2, 2019
Merged

Add a transfer ownership background job#17736
rullzer merged 2 commits into
masterfrom
enh/transfer_ownership

Conversation

@rullzer

@rullzerrullzer commented Oct 29, 2019

Copy link
Copy Markdown
Member

Allow users to initiate transfer ownership

We need to find some way to initiate this.

  • Once it is initiated the recipieint should get a notification to accept or decline the transfer
  • Initiator is noticed about accept/decline
  • If accepted transfer is scheduled
  • Transfer happens
  • Both parties are notified when transfer completes

TODO:

  • Requires Extract transfer ownership logic into a reusable service #18025
  • The actual background job
    • Triggers notification on completion
  • Find some UI that works to send a file/folder to another user
    • For now it will just be in the settings somewhere
  • Notification ping pong
    • Send notification on initiating transfer
    • Accepting notifications
      • Rights check
      • Clears notification
      • Inserts background job
    • Rejecting notification
      • Display rejection
      • Clear notification
      • Send notification
    • Send notifications on completion

@nickvergessennickvergessen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Blocking merge as per private chat

Comment threadapps/files/lib/AppInfo/Application.php
Comment threadapps/files/lib/BackgroundJob/TransferOwnership.php Outdated
Comment threadapps/files/lib/Controller/TransferOwnershipController.php Outdated
Comment threadapps/files/lib/Notification/Notifier.php

const url = generateOcsUrl('/apps/files/api/v1/', 2) + 'transferownership'

axios.post(url, data)

@skjnldsvskjnldsvNov 26, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use async await and try...catch please :)
Not then...else

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No time

@rullzerrullzer added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Nov 26, 2019
@rullzer

Copy link
Copy Markdown
MemberAuthor

Ah mmm let me actually finish my todos...

@rullzer
rullzerforce-pushed the enh/transfer_ownership branch from 962e241 to 07501faCompareNovember 27, 2019 07:57
@rullzer

Copy link
Copy Markdown
MemberAuthor

Maybe instead of the path store the file id + name of the node? That makes it less error prone.

@rullzer

Copy link
Copy Markdown
MemberAuthor

We should probably have autocomplete on the user search?

Comment threadapps/files/lib/Controller/TransferOwnershipController.php Outdated

@ChristophWurstChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Otherwise good to go

Comment threadapps/files/lib/Migration/Version11301Date20191113195931.php Outdated
Comment threadapps/files/lib/Migration/Version11301Date20191113195931.php Outdated
@rullzer

Copy link
Copy Markdown
MemberAuthor

Good to go now form my PoV

@rullzerrullzer added the 3. to review Waiting for reviews label Nov 27, 2019
Comment threadapps/files/lib/BackgroundJob/TransferOwnership.php
Comment threadapps/files/lib/Controller/TransferOwnershipController.php Outdated
Comment threadapps/files/lib/Migration/Version11301Date20191113195931.php
Comment threadapps/files/lib/Migration/Version11301Date20191113195931.php Outdated
Comment threadapps/files/lib/Notification/Notifier.php Outdated
Comment threadapps/files/lib/Controller/TransferOwnershipController.php Outdated
Comment threadapps/files/lib/Notification/Notifier.php Outdated
Comment threadapps/files/lib/Notification/Notifier.php Outdated
Comment threadapps/files/lib/Notification/Notifier.php Outdated
Comment threadapps/files/lib/Notification/Notifier.php Outdated
Comment threadapps/files/lib/Settings/PersonalSettings.php Outdated
@juliusknorr

juliusknorr commented Nov 27, 2019

Copy link
Copy Markdown
Member

ToDo for later polishing:

  • The UI should have some visual feedback

Comment threadapps/files/lib/BackgroundJob/TransferOwnership.php Outdated
Comment threadapps/files/lib/Controller/TransferOwnershipController.php
@ChristophWurst

Copy link
Copy Markdown
Member

The UI should have some visual feedback

Partly done with 24178cf but not pretty.

@rullzer

Copy link
Copy Markdown
MemberAuthor

All resolved.


const picker = getFilePickerBuilder(t('files', 'Select directory to transfer'))
.setMultiSelect(false)
.addMimeTypeFilter('httpd/unix-directory')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Intended? Now directories cannot be selected anymore.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Yes it is the great joy of the selector. We want to be able tos elect

  • files
  • folders
  • root folder

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah ok, just was thinking that it would only transfer directories accoring to the UI. Anyway transfering files always fails for me. Let me check where that goes wrong.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There was something in the transer ownership service that checked if the path is a directory. I changed it to also allow files.

Comment threadapps/files/lib/BackgroundJob/TransferOwnership.php
Comment threadapps/files/lib/BackgroundJob/TransferOwnership.php
@rullzer

Copy link
Copy Markdown
MemberAuthor

Ok review time. lets get this in

@juliusknorrjuliusknorr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested and works 👍

@rullzer
rullzerforce-pushed the enh/transfer_ownership branch 2 times, most recently from cf09f19 to a676b7fCompareDecember 2, 2019 09:22

@ChristophWurstChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested and works 👍

@ChristophWurstChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Dec 2, 2019
rullzerand others added 2 commits December 2, 2019 15:28
This job can be initiated by a user to transfer a file/folder to a
target user.
The target user will have to accept the job.
Once that is done the transfers is initiated in the background.
Both parties get notified when the job is done.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@rullzer
rullzerforce-pushed the enh/transfer_ownership branch from a6c5e58 to 08a1b92CompareDecember 2, 2019 15:25
@rullzer
rullzer merged commit 60c0596 into masterDec 2, 2019
@rullzer
rullzer deleted the enh/transfer_ownership branch December 2, 2019 18:06
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishenhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@rullzer@juliusknorr@ChristophWurst@nickvergessen@skjnldsv@icewind1991