diff --git a/apps/files_versions/src/components/VersionEntry.vue b/apps/files_versions/src/components/VersionEntry.vue index baa061bd1b..96e66b8942 100644 --- a/apps/files_versions/src/components/VersionEntry.vue +++ b/apps/files_versions/src/components/VersionEntry.vue @@ -1,5 +1,5 @@ - +} + diff --git a/apps/files_versions/src/files_versions_tab.js b/apps/files_versions/src/files_versions_tab.js index b593e56fea..648e24feb7 100644 --- a/apps/files_versions/src/files_versions_tab.js +++ b/apps/files_versions/src/files_versions_tab.js @@ -40,6 +40,7 @@ window.addEventListener('DOMContentLoaded', function() { id: 'version_new', name: t('files_versions', 'VueVersions'), icon: 'icon-version', + async mount(el, fileInfo, context) { if (TabInstance) { TabInstance.$destroy() @@ -52,6 +53,7 @@ window.addEventListener('DOMContentLoaded', function() { await TabInstance.update(fileInfo) TabInstance.$mount(el) }, + update(fileInfo) { TabInstance.update(fileInfo) }, diff --git a/apps/files_versions/src/services/FileVersion.js b/apps/files_versions/src/services/FileVersion.js index 167aef5cf9..7b2cf46b9b 100644 --- a/apps/files_versions/src/services/FileVersion.js +++ b/apps/files_versions/src/services/FileVersion.js @@ -1,7 +1,9 @@ /** * @copyright Copyright (c) 2019 John Molakvoæ + * * @author Enoch * @author John Molakvoæ + * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify @@ -22,32 +24,22 @@ import client from './DavClient' import { genFileInfo } from '../utils/fileUtils' -const FileVersion = async function(fileId) { +export const fetchFileVersions = async function(fileId) { // init params const VersionsUrl = '/versions/' + fileId const response = await client.getDirectoryContents(VersionsUrl, { data: ` - - - - - - -`, + + + + + + + `, details: true, }) /** return response.data.map(FileVersion); */ - return response.data.map(genFileInfo) - } -/** - * Retrieve the files list - * - * @param {String} path the path relative to the user root - * @param {Object} [options] optional options for axios - * @returns {Array} the file list - */ -export default FileVersion diff --git a/apps/files_versions/src/views/VersionTab.vue b/apps/files_versions/src/views/VersionTab.vue index b6836de2c7..9820014ea6 100644 --- a/apps/files_versions/src/views/VersionTab.vue +++ b/apps/files_versions/src/views/VersionTab.vue @@ -23,26 +23,35 @@