Use new sidebar api to register groupfolders section

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2019-07-09 14:57:00 +02:00
parent ee4757ea16
commit 100b1782e4
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF
2 changed files with 16 additions and 28 deletions

View file

@ -129,13 +129,13 @@
export default {
name: 'SharingSidebarView',
props: ['fileModel'],
props: ['fileInfo'],
components: {
Avatar, Multiselect, AclStateButton
},
beforeMount () {
this.loading = true;
this.model = JSON.parse(JSON.stringify(this.fileModel));
this.model = JSON.parse(JSON.stringify(this.fileInfo));
client.propFind(this.model).then((data) => {
if (data.acls) {
this.list = data.acls;

View file

@ -20,6 +20,9 @@
*
*/
__webpack_nonce__ = btoa(OC.requestToken);
__webpack_public_path__ = OC.linkTo('groupfolders', 'build/');
(function(OC, OCA) {
OC.Plugins.register('OCA.Files.App', {
attach: () => {
@ -30,30 +33,15 @@
}
}
});
__webpack_nonce__ = btoa(OC.requestToken);
__webpack_public_path__ = OC.linkTo('groupfolders', 'build/');
var ShareTabPlugin = {
attach: function (shareTabView) {
shareTabView.on('rendered', function() {
if (this.model && this.model.get('mountType') === 'group') {
const el = document.createElement('div');
const container = shareTabView.$el.find('.dialogContainer')[0];
container.parentNode.insertBefore(el, container.nextSibling);
el.id = 'groupfolder-sharing';
import(/* webpackChunkName: "sharing" */'./SharingSidebarApp').then((Module) => {
const View = Module.default;
const vm = new View({
propsData: {
fileModel: this.model
}
}).$mount(el);
});
}
});
}
};
OC.Plugins.register('OCA.Sharing.ShareTabView', ShareTabPlugin);
})(OC, OCA);
window.addEventListener('DOMContentLoaded', () => {
import(/*c webpackChunkName: "sharing" */'./SharingSidebarApp').then((Module) => {
OCA.Sharing.ShareTabSections.registerSection((el, fileInfo) => {
if (fileInfo.mountType !== 'group') {
return
}
return Module.default
})
})
})