Skip to content

Commit 3e6460d

Browse files
committed
Merge branch 'develop' into issue/731-swift-linting
2 parents 6cc5dc9 + 9642823 commit 3e6460d

File tree

4 files changed

+31
-6
lines changed

4 files changed

+31
-6
lines changed

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
1.4
22
-----
3+
- bugfix: correctly flips chevron on Dashboard > New Orders, to support RTL languages.
34

45
1.3
56
-----

WooCommerce/Classes/Authentication/Epilogue/StorePickerViewController.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,27 @@ extension StorePickerViewController {
358358
WooAnalytics.shared.track(.sitePickerContinueTapped,
359359
withProperties: ["selected_store_id": StoresManager.shared.sessionManager.defaultStoreID ?? String()])
360360

361+
presentStoreSwitchedNotice()
362+
361363
dismiss(animated: true) {
362364
AppDelegate.shared.authenticatorWasDismissed()
363365
MainTabBarController.switchToMyStoreTab(animated: true)
364366
}
365367
}
366368
}
369+
370+
private func presentStoreSwitchedNotice() {
371+
guard let newStoreName = StoresManager.shared.sessionManager.defaultSite?.name else {
372+
return
373+
}
374+
375+
let message = NSLocalizedString("Switched to \(newStoreName). You will only receive notifications from this store.",
376+
comment: "Message presented after users switch to a new store. "
377+
+ "Reads like: Switched to {store name}. You will only receive notifications from this store.")
378+
let notice = Notice(title: message, feedbackType: .success)
379+
380+
AppDelegate.shared.noticePresenter.enqueue(notice: notice)
381+
}
367382
}
368383

369384

WooCommerce/Classes/ViewRelated/Dashboard/MyStore/NewOrdersViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private extension NewOrdersViewController {
7979
"Review, prepare, and ship these pending orders",
8080
comment: "Description text used on the UI element displayed when a user has pending orders to process."
8181
)
82-
chevronImageView.image = UIImage.chevronImage
82+
chevronImageView.image = UIImage.chevronImage.imageFlippedForRightToLeftLayoutDirection()
8383
}
8484
}
8585

WooCommerce/Classes/ViewRelated/Orders/NewNoteViewController.swift

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class NewNoteViewController: UIViewController {
3737

3838
override func viewDidAppear(_ animated: Bool) {
3939
super.viewDidAppear(animated)
40-
tableView.firstSubview(ofType: UITextView.self)?.becomeFirstResponder()
40+
showKeyboard()
4141
}
4242

4343
override func viewWillDisappear(_ animated: Bool) {
@@ -50,7 +50,7 @@ class NewNoteViewController: UIViewController {
5050
}
5151

5252
@objc func addButtonTapped() {
53-
switchRightButtonToProgressIndicator()
53+
configureForCommittingNote()
5454

5555
WooAnalytics.shared.track(.orderNoteAddButtonTapped)
5656
WooAnalytics.shared.track(.orderNoteAdd, withProperties: ["parent_id": viewModel.order.orderID,
@@ -66,7 +66,7 @@ class NewNoteViewController: UIViewController {
6666
WooAnalytics.shared.track(.orderNoteAddFailed, withError: error)
6767

6868
self?.displayErrorNotice()
69-
self?.switchRightButtonToAddButton()
69+
self?.configureForEditingNote()
7070
return
7171
}
7272
WooAnalytics.shared.track(.orderNoteAddSuccess)
@@ -281,7 +281,8 @@ private extension NewNoteViewController {
281281
navigationItem.rightBarButtonItem?.isEnabled = false
282282
}
283283

284-
func switchRightButtonToProgressIndicator() {
284+
func configureForCommittingNote() {
285+
hideKeyboard()
285286
configureRightButtonItemAsSpinner()
286287
navigationItem.rightBarButtonItem?.isEnabled = false
287288
}
@@ -296,10 +297,18 @@ private extension NewNoteViewController {
296297
navigationItem.setRightBarButton(rightBarButton, animated: true)
297298
}
298299

299-
func switchRightButtonToAddButton() {
300+
func configureForEditingNote() {
300301
configureRightButtonItemAsAdd()
301302
navigationItem.rightBarButtonItem?.isEnabled = true
302303
}
304+
305+
func showKeyboard() {
306+
tableView.firstSubview(ofType: UITextView.self)?.becomeFirstResponder()
307+
}
308+
309+
func hideKeyboard() {
310+
tableView.firstSubview(ofType: UITextView.self)?.resignFirstResponder()
311+
}
303312
}
304313

305314
// MARK: - Constants

0 commit comments

Comments
 (0)