From 6a3886f17ff348fd11ce30c32fca75d4b61ac30f Mon Sep 17 00:00:00 2001 From: fenn-cs Date: Mon, 22 Jul 2024 17:54:39 +0100 Subject: [PATCH] Wip : Show owner information in sidebar Resolves: https://github.com/nextcloud/server/issues/46178 Signed-off-by: fenn-cs --- apps/files/src/services/WebdavClient.ts | 13 ++++++++- apps/files/src/views/Sidebar.vue | 35 +++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/apps/files/src/services/WebdavClient.ts b/apps/files/src/services/WebdavClient.ts index 5563508e2c7bc..cd33147b03f09 100644 --- a/apps/files/src/services/WebdavClient.ts +++ b/apps/files/src/services/WebdavClient.ts @@ -2,6 +2,17 @@ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { davGetClient } from '@nextcloud/files' +import { davGetClient, davGetDefaultPropfind, davResultToNode, davRootPath } from '@nextcloud/files' +import type { FileStat, ResponseDataDetailed } from 'webdav' +import type { Node } from '@nextcloud/files' export const client = davGetClient() + +export const fetchNode = async (node: Node): Promise => { + const propfindPayload = davGetDefaultPropfind() + const result = await client.stat(`${davRootPath}${node.path}`, { + details: true, + data: propfindPayload, + }) as ResponseDataDetailed + return davResultToNode(result.data) +} diff --git a/apps/files/src/views/Sidebar.vue b/apps/files/src/views/Sidebar.vue index 8c4af5fd80fb4..6c759b1bbff65 100644 --- a/apps/files/src/views/Sidebar.vue +++ b/apps/files/src/views/Sidebar.vue @@ -23,8 +23,10 @@ inline /> {{ size }} + -