From 1ebb04dc537d1e67d8ab0529608b15fcb7213665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Thu, 6 May 2021 15:28:01 +0200 Subject: [PATCH] fixup! VersionEntry Updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- .../src/components/VersionEntry.vue | 118 ++++++++++-------- apps/files_versions/src/files_versions_tab.js | 2 + .../src/services/FileVersion.js | 28 ++--- apps/files_versions/src/views/VersionTab.vue | 72 ++++++----- 4 files changed, 114 insertions(+), 106 deletions(-) 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 @@