Use nextcloud-vue-collection 0.1.2

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2019-02-22 13:37:40 +01:00
parent 55cd9eab03
commit 37e6488206
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
4 changed files with 24 additions and 11 deletions

View File

@ -21,26 +21,19 @@
*/
import Vue from 'vue';
import Vuex from 'vuex';
import { PopoverMenu } from 'nextcloud-vue';
import ClickOutside from 'vue-click-outside';
import { VTooltip } from 'v-tooltip';
import { CollectionStoreModule } from 'nextcloud-vue-collections';
const Store = () => new Vuex.Store(CollectionStoreModule);
Vue.prototype.t = t;
Vue.component('PopoverMenu', PopoverMenu);
Vue.directive('ClickOutside', ClickOutside);
Vue.directive('Tooltip', VTooltip);
Vue.use(Vuex);
import View from './views/CollaborationView';
export {
Vue,
View,
Store
View
};

View File

@ -87,7 +87,6 @@
var vm = new Resources.Vue({
el: '#collaborationResources',
render: h => h(Resources.View),
store: Resources.Store(),
data: {
model: this.model.toJSON()
},

View File

@ -21,14 +21,35 @@
-->
<template>
<collection-list type="files"></collection-list>
<collection-list v-if="fileId" type="files" :id="fileId" :name="filename"></collection-list>
</template>
<script>
import { CollectionList } from 'nextcloud-vue-collections'
/**
* Those translations will be used by the vue component but they should be shipped with the server
* t('files_sharing', 'Add to a collection')
* t('files_sharing', 'Details')
* t('files_sharing', 'Rename collection')
*/
export default {
name: 'CollaborationView',
computed: {
fileId() {
if (this.$root.model && this.$root.model.id) {
return '' + this.$root.model.id;
}
return null;
},
filename() {
if (this.$root.model && this.$root.model.name) {
return '' + this.$root.model.name;
}
return '';
}
},
components: {
CollectionList
}

View File

@ -44,7 +44,7 @@
"nextcloud-axios": "^0.1.3",
"nextcloud-password-confirmation": "^0.4.1",
"nextcloud-vue": "^0.8.0",
"nextcloud-vue-collections": "^0.1.0",
"nextcloud-vue-collections": "^0.1.2",
"snap.js": "^2.0.9",
"strengthify": "git+https://github.com/MorrisJobke/strengthify.git",
"underscore": "^1.9.1",