Skip to content

Commit

Permalink
PM-17008: Send updates (#1305)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-livefront authored Jan 28, 2025
1 parent b158e94 commit 9981c9b
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,11 @@
"MaximumAccessCountReached" = "Max access count reached";
"CurrentAccessCount" = "Current access count";
"NewPassword" = "New password";
"PasswordInfo" = "Optionally require a password for users to access this Send.";
"PasswordInfo" = "Require this password to view the Send.";
"RemovePassword" = "Remove password";
"AreYouSureRemoveSendPassword" = "Are you sure you want to remove the password?";
"RemovingSendPassword" = "Removing password";
"SendPasswordRemoved" = "Password has been removed.";
"NotesInfo" = "Private notes about this Send.";
"DisableSend" = "Deactivate this Send so that no one can access it";
"NoSends" = "There are no Sends in your account.";
"CopyLink" = "Copy link";
"ShareLink" = "Share link";
Expand Down Expand Up @@ -1100,3 +1098,4 @@
"SendDetails" = "Send details";
"SendNameRequired" = "Send name (required)";
"CheckPasswordForDataBreaches" = "Check password for data breaches";
"PrivateNote" = "Private note";
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ enum AddEditSendItemAction: Equatable {
/// The choose file button was pressed.
case chooseFilePressed

/// The deactivate this send toggle was changed.
case deactivateThisSendChanged(Bool)

/// The deletion date was changed.
case deletionDateChanged(SendDeletionDateType)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ class AddEditSendItemProcessor:
switch action {
case .chooseFilePressed:
presentFileSelectionAlert()
case let .deactivateThisSendChanged(newValue):
state.isDeactivateThisSendOn = newValue
case let .deletionDateChanged(newValue):
state.deletionDate = newValue
case .dismissPressed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,15 +502,6 @@ class AddEditSendItemProcessorTests: BitwardenTestCase { // swiftlint:disable:th
XCTAssertIdentical(coordinator.contexts.last as? FileSelectionDelegate, subject)
}

/// `receive(_:)` with `.deactivateThisSendChanged` updates the deactivate this send toggle.
@MainActor
func test_receive_deactivateThisSendChanged() {
subject.state.isDeactivateThisSendOn = false
subject.receive(.deactivateThisSendChanged(true))

XCTAssertTrue(subject.state.isDeactivateThisSendOn)
}

/// `receive(_:)` with `.deletionDateChanged` updates the deletion date.
@MainActor
func test_receive_deletionDateChanged() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,16 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length
)
.textFieldConfiguration(.password)

BitwardenField(
title: Localizations.notes,
footer: Localizations.notesInfo
) {
ContentBlock(dividerLeadingPadding: 16) {
BitwardenToggle(Localizations.hideEmail, isOn: store.binding(
get: \.isHideMyEmailOn,
send: AddEditSendItemAction.hideMyEmailChanged
))
.accessibilityIdentifier("SendHideEmailSwitch")
.disabled(!store.state.isHideMyEmailOn && store.state.isSendHideEmailDisabled)
}

BitwardenField(title: Localizations.privateNote) {
BitwardenUITextView(
text: store.binding(
get: \.notes,
Expand All @@ -321,21 +327,6 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length
.frame(minHeight: notesDynamicHeight)
.accessibilityLabel(Localizations.notes)
}

ContentBlock(dividerLeadingPadding: 16) {
BitwardenToggle(Localizations.hideEmail, isOn: store.binding(
get: \.isHideMyEmailOn,
send: AddEditSendItemAction.hideMyEmailChanged
))
.accessibilityIdentifier("SendHideEmailSwitch")
.disabled(!store.state.isHideMyEmailOn && store.state.isSendHideEmailDisabled)

BitwardenToggle(Localizations.disableSend, isOn: store.binding(
get: \.isDeactivateThisSendOn,
send: AddEditSendItemAction.deactivateThisSendChanged
))
.accessibilityIdentifier("SendDeactivateSwitch")
}
}

/// The options button.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9981c9b

Please sign in to comment.