Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

"Edit" entry mode with Delete functionality #1060

Merged
merged 30 commits into from
Dec 9, 2019
Merged

Conversation

joeyg
Copy link
Contributor

@joeyg joeyg commented Jun 16, 2019

This was original PR #981 but has been updated with edit and delete functionality.

Fixes #937

@joeyg joeyg requested a review from a team June 16, 2019 23:16
@joeyg joeyg changed the title 937 edit layout jg layout for entry editor Jun 16, 2019
@sashei
Copy link
Contributor

sashei commented Jun 18, 2019

This might be a good candidate for @jhugman given that I wrote most of it :p

@sashei sashei requested a review from jhugman June 18, 2019 18:19
@joeyg joeyg requested review from a team June 28, 2019 01:24
@devinreams devinreams changed the title layout for entry editor "Edit" entry mode with Delete functionality Jul 3, 2019
Copy link
Contributor

@jhugman jhugman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fairly long PR. Sorry it took so long to get to it.

It looks good. I have only a couple of comments.

class ItemDetailView: UIViewController {
internal var presenter: ItemDetailPresenter?
private var disposeBag = DisposeBag()
private var swipeBag = DisposeBag()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

cell.valueLabel.textColor = cellConfiguration.valueFontColor
cellConfiguration.value
.drive(cell.textValue.rx.text)
.disposed(by: cell.disposeBag)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

} else {
self.navigationItem.leftBarButtonItem = nil
self.navigationController?.interactivePopGestureRecognizer?.delegate = nil
self.swipeBag = DisposeBag()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be clearing the existing one, before simply discarding it?

Copy link
Contributor

@jhugman jhugman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have a few questions about the various disposeBags you're using, but otherwise this is looking really nice.

}
}

typealias ItemDetailSectionModelObserver = ((Observable<[ItemDetailSectionModel]>) -> Disposable)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

joeyg and others added 6 commits October 23, 2019 09:22
* start of updating logins

* add hostname editing

* fix broken tests

* add test for DataStoreAction.update

* ItemEditAction tests

* add edit action tests

* ItemDetailPresenter tests

* add ItemDetailView tests
Copy link
Contributor

@jhugman jhugman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking fine.

There are some followup issues to be filed here:

  • disable edit hostname.
  • errors: currently implemented in android — duplicate usernames, empty passwords.

I'm hopeful that the strategy of combining view controllers for display, edit and create is going to pay off.

Well done keeping this from bit rotting, and a tricky merge process.

Let's get this landed!

@@ -60,16 +60,16 @@ class LockwiseXCUITests: BaseTestCase {
XCTAssertTrue(app.cells["passwordItemDetail"].exists)
XCTAssertTrue(app.cells["webAddressItemDetail"].exists)
// The value in each field is correct
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: file an issue to convert these XCUITests to MappaMundi.

enum ItemEditAction: Action {
case editUsername(value: String)
case editPassword(value: String)
case editWebAddress(value: String)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to be able to edit the hostname, but keep this in because it'll be useful when we implement Manual Create Entry.

@@ -91,7 +91,7 @@ extension Constant.string {
static let settingsGetSupport = NSLocalizedString("settings.getSupport", value: "Ask a Question", comment: "Support link to Discourse discussion forum")
static let websiteCellAccessibilityLabel = NSLocalizedString("website_accessibility_instructions", value: "Web address: double tap to open in browser %@", comment: "Accessibility label and instructions for web address section of login details")
static let usernameCellAccessibilityLabel = NSLocalizedString("username_accessibility_instructions", value: "Username: double tap to copy %@", comment: "Accessibility label and instructions for username section of login details. %@ will be replaced with the username value")
static let passwordCellAccessibilityLabel = NSLocalizedString("password_accessibility_instructions", value: "Password: double tap to copy %@", comment: "Accessibility label and instructions for password section of login details. %@ will be replaced with the password value")
static let passwordCellAccessibilityLabel = NSLocalizedString("password_accessibility_instructions", value: "Password: double tap to copy", comment: "Accessibility label and instructions for password section of login details. %@ will be replaced with the password value")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: copy pasta: %@ will be replaced with the password value.

}
}
return actions
.map { id -> [Action] in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can replace the .map and then a for loop with .mapIterable. Will check.

}
.asDriver(onErrorJustReturn: "")

let editing = itemDetailStore.isEditing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: naming. isEditing to show it's Bool like.

@kaylagalway kaylagalway merged commit 8a7bd63 into master Dec 9, 2019
@kaylagalway kaylagalway deleted the 937-edit-layout-jg branch December 9, 2019 21:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Layout for edit entry view (including delete button) + routing
5 participants