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

[NEW] WebDAV Integration (User file provider) #11679

Merged
merged 17 commits into from
Sep 27, 2018
Merged

[NEW] WebDAV Integration (User file provider) #11679

merged 17 commits into from
Sep 27, 2018

Conversation

karakayasemi
Copy link
Contributor

@karakayasemi karakayasemi commented Aug 5, 2018

This PR implements the following features;

  • Allow a user to browse ownCloud/NextCloud files in Rocket.Chat and add files directly from there to Rocket conversation
  • Allow a user to upload an attachment from Rocket conversation to WebDAV account.

Closes #7791 , #9745

Things to do:

  • write documentation

I used ownCloud and Nextcloud as test webdav servers. For testing you can use https://demo.owncloud.org with following account informations:
server url: https://demo.owncloud.org/remote.php/webdav
username: demo
password:demo

To easy test the features, add new server from here with given credentials:
image

File picker screen:
image

To remove webdav accounts, Integrations section is added to my account page.
image

Save an attachment to webdav
savewebdav

@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Aug 5, 2018
@RocketChat RocketChat deleted a comment Sep 13, 2018
@RocketChat RocketChat deleted a comment Sep 13, 2018
@RocketChat RocketChat deleted a comment Sep 13, 2018
@RocketChat RocketChat deleted a comment Sep 13, 2018
@RocketChat RocketChat deleted a comment Sep 13, 2018
@engelgabriel engelgabriel modified the milestones: 0.69.0, 0.70.0 Sep 21, 2018
import toastr from 'toastr';

Template.accountIntegrations.onCreated(function() {
this.subscribe('webdavAccounts');
Copy link
Member

Choose a reason for hiding this comment

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

since the other subscribe will always happen, there is no need to subscribe here.

@@ -653,6 +653,7 @@ Template.messageBox.onCreated(function() {
this.dataReply = new ReactiveVar(''); // if user is replying to a mssg, this will contain data of the mssg being replied to
this.isMessageFieldEmpty = new ReactiveVar(true);
this.sendIcon = new ReactiveVar(false);
RocketChat.messageBox.emit('created', this);
Copy link
Member

Choose a reason for hiding this comment

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

should we keep this? It is not being used anywhere but still there is some value.

@@ -0,0 +1 @@
RocketChat.models.WebdavAccounts = this.WebdavAccounts = new Mongo.Collection('rocketchat_webdav_accounts');
Copy link
Member

Choose a reason for hiding this comment

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

this.WebdavAccounts seems to not be used anywhere else.

// converting to file object
blob.lastModified = file.lastmod;
blob.name = file.basename;
const text = `\
Copy link
Member

Choose a reason for hiding this comment

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

this slash can be removed

import Webdav from 'webdav';

Meteor.methods({
async addWebdavAccount(formData) {
Copy link
Member

Choose a reason for hiding this comment

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

a further addition would be adding a new permission to grant webdav account creations

@@ -0,0 +1,60 @@
/* globals modal, RocketChat */
import { Tracker } from 'meteor/tracker';
Tracker.autorun(() => {
Copy link
Member

Choose a reason for hiding this comment

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

what about moving this to a "better" file? it seems hidden here on a file called messageBoxActions.js

sampaiodiego
sampaiodiego previously approved these changes Sep 27, 2018
@OtherSystems
Copy link

There seems to be a problem removing the webdav account from the user side. When the user removes the account in their preferences. The account does not seem go away, also not from the file-add-menu, but when trying to use it, it gives an account error.

rocketchat version 1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NextCloud integration
5 participants