diff --git a/lib/api/marianumcloud/webdav/queries/listFiles/listFiles.dart b/lib/api/marianumcloud/webdav/queries/listFiles/listFiles.dart index f9ab4da..ca60edf 100644 --- a/lib/api/marianumcloud/webdav/queries/listFiles/listFiles.dart +++ b/lib/api/marianumcloud/webdav/queries/listFiles/listFiles.dart @@ -1,6 +1,7 @@ import 'package:nextcloud/nextcloud.dart'; +import '../../../../../model/endpointData.dart'; import '../../webdavApi.dart'; import 'cacheableFile.dart'; import 'listFilesParams.dart'; @@ -14,9 +15,19 @@ class ListFiles extends WebdavApi { @override Future run() async { List davFiles = (await (await WebdavApi.webdav).propfind(params.path)).toWebDavFiles(); - davFiles.removeWhere((element) => element.path == "/${params.path}/" || element.path == "/"); // somehow the current working folder is also listed, it is filtered here. Set files = davFiles.map((e) => CacheableFile.fromDavFile(e)).toSet(); + // webdav handles subdirectories wrong, this is a fix + if(EndpointData().getEndpointMode() == EndpointMode.stage) { + files = files.map((e) { // somehow + e.path = e.path.split("mobile/cloud/remote.php/webdav")[1]; + return e; + }).toSet(); + } + + // somehow the current working folder is also listed, it is filtered here. + files.removeWhere((element) => element.path == "/${params.path}/" || element.path == "/"); + return ListFilesResponse(files); } } \ No newline at end of file diff --git a/lib/view/pages/files/fileElement.dart b/lib/view/pages/files/fileElement.dart index 923334f..3de12f5 100644 --- a/lib/view/pages/files/fileElement.dart +++ b/lib/view/pages/files/fileElement.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:better_open_file/better_open_file.dart'; import 'package:filesize/filesize.dart'; import 'package:flowder/flowder.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:jiffy/jiffy.dart'; import 'package:path_provider/path_provider.dart'; @@ -166,14 +167,17 @@ class _FileElementState extends State { )); }, ), - ListTile( - leading: const Icon(Icons.share_outlined), - title: const Text("Teilen"), - onTap: () { - Navigator.of(context).pop(); - UnimplementedDialog.show(context); - }, - ) + Visibility( + visible: kReleaseMode, + child: ListTile( + leading: const Icon(Icons.share_outlined), + title: const Text("Teilen"), + onTap: () { + Navigator.of(context).pop(); + UnimplementedDialog.show(context); + }, + ), + ), ], ); }); diff --git a/lib/view/pages/files/fileUploadDialog.dart b/lib/view/pages/files/fileUploadDialog.dart index 5ea9464..03c1697 100644 --- a/lib/view/pages/files/fileUploadDialog.dart +++ b/lib/view/pages/files/fileUploadDialog.dart @@ -43,7 +43,7 @@ class _FileUploadDialogState extends State { setState(() { state = FileUploadState.checkConflict; }); - await (await WebdavApi.webdav).mkcol(widget.remotePath.join("/")); + //await (await WebdavApi.webdav).mkcol(widget.remotePath.join("/")); // TODO is this needed? It does not work anymore... List result = (await webdavClient.propfind(widget.remotePath.join("/"))).responses; if(result.any((element) => element.href!.endsWith("/$targetFileName"))) { setState(() { diff --git a/lib/view/pages/files/files.dart b/lib/view/pages/files/files.dart index 16b42c0..71f77c4 100644 --- a/lib/view/pages/files/files.dart +++ b/lib/view/pages/files/files.dart @@ -209,16 +209,19 @@ class _FilesState extends State { Navigator.of(context).pop(); }, ), - ListTile( - leading: const Icon(Icons.add_a_photo_outlined), - title: const Text("Aus Gallerie hochladen"), - onTap: () { - context.loaderOverlay.show(); - FilePick.galleryPick().then((value) { - mediaUpload(value?.path); - }); - Navigator.of(context).pop(); - }, + Visibility( + visible: !Platform.isIOS, + child: ListTile( + leading: const Icon(Icons.add_a_photo_outlined), + title: const Text("Aus Gallerie hochladen"), + onTap: () { + context.loaderOverlay.show(); + FilePick.galleryPick().then((value) { + mediaUpload(value?.path); + }); + Navigator.of(context).pop(); + }, + ), ), ], ); diff --git a/lib/view/pages/talk/messageReactions.dart b/lib/view/pages/talk/messageReactions.dart index e8c5082..cdfbce0 100644 --- a/lib/view/pages/talk/messageReactions.dart +++ b/lib/view/pages/talk/messageReactions.dart @@ -1,4 +1,5 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import '../../../api/marianumcloud/talk/getReactions/getReactions.dart'; @@ -54,9 +55,12 @@ class _MessageReactionsState extends State { leading: const CenteredLeading(Icon(Icons.person)), title: Text(e.actorDisplayName), subtitle: isSelf ? const Text("Du") : e.actorType == GetReactionsResponseObjectActorType.guests ? const Text("Gast") : null, - trailing: isSelf ? null : IconButton( - onPressed: () => UnimplementedDialog.show(context), - icon: const Icon(Icons.textsms_outlined), + trailing: isSelf ? null : Visibility( + visible: kReleaseMode, + child: IconButton( + onPressed: () => UnimplementedDialog.show(context), + icon: const Icon(Icons.textsms_outlined), + ), ), ); }).toList(), diff --git a/lib/view/pages/timetable/appointmentDetails.dart b/lib/view/pages/timetable/appointmentDetails.dart index 4ed87c5..445dd48 100644 --- a/lib/view/pages/timetable/appointmentDetails.dart +++ b/lib/view/pages/timetable/appointmentDetails.dart @@ -1,4 +1,5 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:jiffy/jiffy.dart'; import 'package:persistent_bottom_nav_bar/persistent_tab_view.dart'; @@ -73,11 +74,14 @@ class AppointmentDetails { ListTile( leading: const Icon(Icons.person), title: Text("Lehrkraft: (${timetableData.te[0].name}) ${timetableData.te[0].longname}"), - trailing: IconButton( - icon: const Icon(Icons.textsms_outlined), - onPressed: () { - UnimplementedDialog.show(context); - }, + trailing: Visibility( + visible: kReleaseMode, + child: IconButton( + icon: const Icon(Icons.textsms_outlined), + onPressed: () { + UnimplementedDialog.show(context); + }, + ), ), ), ListTile(