Skip to content

Conversation

@tobiasKaminsky
Copy link
Member

@tobiasKaminsky tobiasKaminsky commented Jun 5, 2018

Resolves #1200

  • adds support for versions
  • only visible for NC14 user
  • they are shown in activity stream
    • you can click on "revert" icon
  • currently this is not MVP, but I will open up a new PR after the other file detail PRs by @AndyScherzinger are merged

TODO

  • going back from detail view, reload of file list needs to be done, @AndyScherzinger do you have an idea for this?
  • after successful restore: current downloaded file needs to be removed
  • @rullzer what about old thumbnails? E.g. you have an image you change?

@codecov
Copy link

codecov bot commented Jun 5, 2018

Codecov Report

Merging #2685 into master will decrease coverage by 0.02%.
The diff coverage is 3.37%.

@@            Coverage Diff            @@
##           master   #2685      +/-   ##
=========================================
- Coverage    6.52%   6.49%   -0.03%     
=========================================
  Files         285     287       +2     
  Lines       28896   29039     +143     
  Branches     4214    4231      +17     
=========================================
+ Hits         1886    1887       +1     
- Misses      26726   26868     +142     
  Partials      284     284
Impacted Files Coverage Δ
...d/android/ui/dialog/RemoveFilesDialogFragment.java 0% <0%> (ø) ⬆️
...cloud/android/ui/helpers/FileOperationsHelper.java 0% <0%> (ø) ⬆️
...cloud/android/ui/activity/FileDisplayActivity.java 0% <0%> (ø) ⬆️
...ndroid/operations/RestoreFileVersionOperation.java 0% <0%> (ø)
...ud/android/ui/dialog/RemoveFileDialogFragment.java 0% <0%> (ø) ⬆️
.../java/com/owncloud/android/utils/DisplayUtils.java 5.83% <0%> (-0.05%) ⬇️
...roid/ui/fragment/FileDetailActivitiesFragment.java 0% <0%> (ø) ⬆️
...m/owncloud/android/services/OperationsService.java 0% <0%> (ø) ⬆️
...cloud/android/ui/adapter/FileDetailTabAdapter.java 0% <0%> (ø) ⬆️
...ncloud/android/ui/adapter/ActivityListAdapter.java 0% <0%> (ø) ⬆️
... and 5 more

@tobiasKaminsky tobiasKaminsky changed the title Add suppot for versions Add support for file versions Jun 5, 2018
@AndyScherzinger
Copy link
Member

going back from detail view, reload of file list needs to be done, @AndyScherzinger do you have an idea for this?

There is no going back ;) On a tablet it would be a split pane between file list and file details :) I also did this for the file details already by introducing a listener interface (implemented by the activity) so you could just extend that one and ping the activity that it needs to refresh the other fragment/list :)

@rullzer
Copy link
Member

rullzer commented Jun 5, 2018

@tobiasKaminsky how do you currently evaluate if the preview is still valid? Because you could use the same logic here. Either check the etag of the preview against the endpoint. Or check the etag of the actual file that should also change.

@nextcloud nextcloud deleted a comment Jun 6, 2018
@nextcloud nextcloud deleted a comment Jun 6, 2018
@nextcloud nextcloud deleted a comment Jun 6, 2018
@tobiasKaminsky
Copy link
Member Author

Thanks @rullzer, currently we are checking during sync if the modification date has changed and if so, we simply fetch a new thumbnail.
As we currently do not check eTags for thumbnails, I will create this in a different branch, so that this one will not blown up.

@tobiasKaminsky
Copy link
Member Author

As comment PR is based on this, I did not rebase, but merge.
As soon as this is then ready, prior merging this PR we need to rebase, to get rid of the merge commit.

@nextcloud nextcloud deleted a comment Jun 7, 2018
@nextcloud nextcloud deleted a comment Jun 7, 2018
@nextcloud nextcloud deleted a comment Jun 7, 2018
@nextcloud nextcloud deleted a comment Jun 7, 2018
@tobiasKaminsky
Copy link
Member Author

This is now ready for code review & testing.

* return the reference to the file detail activity fragment to communicate with it.
*
* @return reference to the {@link FileDetailSharingFragment}
*/
Copy link
Member

Choose a reason for hiding this comment

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

--> FileDetailActivitiesFragment ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy&paste error ;-)

@nextcloud nextcloud deleted a comment Jun 8, 2018
@nextcloud nextcloud deleted a comment Jun 8, 2018
@nextcloud nextcloud deleted a comment Jun 8, 2018
@AndyScherzinger
Copy link
Member

@tobiasKaminsky I only get an error screen (with the icon and so on) when opening a file that has versions on your testing Nc14 server instance :/

@tobiasKaminsky
Copy link
Member Author

@AndyScherzinger can you write me on irc or per mail the exact file alongside with the credentials? Then I can have a look at exact the same file.

@tobiasKaminsky
Copy link
Member Author

@AndyScherzinger this was because I cloned server manually and forgot activity app.
Please re-test it.

! I rebased it!

@nextcloud nextcloud deleted a comment Jun 14, 2018
@nextcloud nextcloud deleted a comment Jun 14, 2018
@nextcloud nextcloud deleted a comment Jun 14, 2018
tobiasKaminsky and others added 14 commits June 14, 2018 23:44
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
refresh file list / activity list on succesfull restore

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
- in background for file deletion
- download new file version if file was previously downloaded
- show snackbar on success
- cleanup

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@tobiasKaminsky tobiasKaminsky merged commit 9a5a6f5 into master Jun 15, 2018
@AndyScherzinger
Copy link
Member

@tobiasKaminsky shouldn't you have merged nextcloud/android-library#150 first and moved back to referencing master-SNAPSHOT???

@tobiasKaminsky tobiasKaminsky deleted the versions branch June 15, 2018 10:01
@tobiasKaminsky
Copy link
Member Author

Ups.
As I did not wrote this in the first comment, I just forgot about it :/

@mario can you quickly have a look at nextcloud/android-library#150? :-D

tobiasKaminsky added a commit that referenced this pull request Jun 15, 2018
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@AndyScherzinger
Copy link
Member

@tobiasKaminsky nextcloud/android-library#150 has been merged and master has been build via jitpack

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.

6 participants