Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private extension FilesView {
}
}

if showMoreActionsButton {
if !viewModel.isRecycleBin, !viewModel.isOffline {
ToolbarItem(placement: .navigationBarTrailing) {
moreActionsButton
}
Expand All @@ -120,10 +120,6 @@ private extension FilesView {
}
}

var showMoreActionsButton: Bool {
!viewModel.isRecycleBin && !viewModel.isOffline && viewModel.selfUserRole == .editor
}

var closeButton: some View {
Button(
action: { onDismissContainer() },
Expand All @@ -138,6 +134,34 @@ private extension FilesView {

var moreActionsButton: some View {
Menu {
switch viewModel.selfUserRole {
case .editor:
editorActions
case .viewer:
viewerActions
}
} label: {
Image(systemName: "ellipsis.circle")
}
.tint(ColorTheme.Base.primary(accentColor).color)
}

private var viewerActions: some View {
Button {
onOpenRecycleBin()
} label: {
Label {
Text(Strings.Files.openRecycleBin)
} icon: {
Image(systemName: "trash")
.tint(ColorTheme.Backgrounds.onBackground.color)
}
}
.accessibilityIdentifier(Locators.WireDrive.FilesPage.recycleBin.rawValue)
}

private var editorActions: some View {
Group {
Button {
viewModel.onCreate(target: .folder)
} label: {
Expand Down Expand Up @@ -185,10 +209,7 @@ private extension FilesView {
}
}
.accessibilityIdentifier(Locators.WireDrive.FilesPage.recycleBin.rawValue)
} label: {
Image(systemName: "ellipsis.circle")
}
.tint(ColorTheme.Base.primary(accentColor).color)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,10 @@ final class FilesItemViewModel: ObservableObject {
private var viewerMenuActions: Set<ItemAction> {
var actions: Set<ItemAction> = []

if !isInRecycleBin {
actions.insert(.primaryAction)
actions.insert(.primaryAction)

if !isOffline, isBrowsing {
actions.insert(.shareLink) // action visible to the user but disabled
}
if !isInRecycleBin, !isOffline, isBrowsing {
actions.insert(.shareLink) // action visible to the user but disabled
}

if !isEditable, !isInRecycleBin, isBrowsing, item.kind == .file {
Expand All @@ -308,12 +306,10 @@ final class FilesItemViewModel: ObservableObject {
private var editorMenuActions: Set<ItemAction> {
var actions: Set<ItemAction> = []

if !isInRecycleBin {
actions.insert(.primaryAction)
actions.insert(.primaryAction)

if !isOffline {
actions.insert(.shareLink)
}
if !isInRecycleBin, !isOffline {
actions.insert(.shareLink)
}

if !isEditable, !isInRecycleBin, item.kind == .file {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions wire-ios/Wire-iOS/Generated/Strings+Generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2399,8 +2399,8 @@ internal enum L10n {
return L10n.tr("Localizable", "content.system.file_collaboration.sharedDriveState", String(describing: p1), fallback: "Shared Drive is %@")
}
internal enum DriveViewerAccess {
/// Guests have view-only access to files in this conversation.
internal static let title = L10n.tr("Localizable", "content.system.file_collaboration.drive_viewer_access.title", fallback: "Guests have view-only access to files in this conversation.")
/// People outside your team can join this conversation as viewers.
internal static let title = L10n.tr("Localizable", "content.system.file_collaboration.drive_viewer_access.title", fallback: "People outside your team can join this conversation as viewers.")
}
internal enum Enabled {
/// You have editor access. People outside your team only have viewer access.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "Learn more";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "معرفة المزيد";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "Lær mere";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "Sie haben Bearbeitungsrechte. Personen außerhalb Ihres Teams haben lediglich Leserechte.";
"content.system.file_collaboration.enabled.viewer_access" = "Sie können Dateien lesen, aber nicht hochladen, bearbeiten oder verwalten.";
"content.system.file_collaboration.enabled.learn_more" = "Mehr erfahren";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "Más información";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "Loe lähemalt";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "Lue lisää";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "En savoir plus";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "Ulteriori informazioni";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "もっと知る";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "Sužinoti daugiau";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "Leer meer";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "Więcej informacji";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "Mais informação";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "Nauči se več";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "Daha fazla bilgi";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "Дізнатися більше";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "更多信息";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"content.system.file_collaboration.enabled.editor_access" = "You have editor access. People outside your team only have viewer access.";
"content.system.file_collaboration.enabled.viewer_access" = "You can view, but you can’t upload, edit, or manage files.";
"content.system.file_collaboration.enabled.learn_more" = "瞭解詳情";
"content.system.file_collaboration.drive_viewer_access.title" = "Guests have view-only access to files in this conversation.";
"content.system.file_collaboration.drive_viewer_access.title" = "People outside your team can join this conversation as viewers.";

// read receipt

Expand Down
Loading