Skip to content

Commit 99b5040

Browse files
authored
Merge pull request #547 from woocommerce/issue/review-updates
Design Review updates
2 parents 3201ee9 + 73a3f7e commit 99b5040

File tree

6 files changed

+32
-10
lines changed

6 files changed

+32
-10
lines changed

WooCommerce/Classes/Model/Note+Woo.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ extension Note {
2222
return snippet
2323
}
2424

25+
/// Returns the icon tint color to be used for this note
26+
///
27+
var noticonTintColor: UIColor {
28+
guard kind == .storeOrder else {
29+
return StyleManager.wooGreyMid
30+
}
31+
return StyleManager.wooAccent
32+
}
33+
2534
/// Returns the number of stars for a review (or nil if the Note is not a review)
2635
///
2736
var starRating: Int? {

WooCommerce/Classes/ViewRelated/Dashboard/Dashboard.storyboard

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,25 +318,25 @@
318318
<rect key="frame" x="0.0" y="0.0" width="347" height="108"/>
319319
<subviews>
320320
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="750" verticalCompressionResistancePriority="1000" text="You have 10 orders to fulfill" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="XgA-ra-emd" customClass="PaddedLabel" customModule="WooCommerce" customModuleProvider="target">
321-
<rect key="frame" x="0.0" y="0.0" width="347" height="20.5"/>
321+
<rect key="frame" x="0.0" y="4" width="347" height="20.5"/>
322322
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
323323
<nil key="textColor"/>
324324
<nil key="highlightedColor"/>
325325
</label>
326326
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Review, prepare, and ship these pending orders..." lineBreakMode="wordWrap" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3ad-g9-Y4v" customClass="PaddedLabel" customModule="WooCommerce" customModuleProvider="target">
327-
<rect key="frame" x="0.0" y="20.5" width="347" height="87.5"/>
327+
<rect key="frame" x="0.0" y="32.5" width="347" height="42.5"/>
328328
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
329329
<nil key="textColor"/>
330330
<nil key="highlightedColor"/>
331331
</label>
332332
</subviews>
333333
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
334334
<constraints>
335-
<constraint firstAttribute="bottom" secondItem="3ad-g9-Y4v" secondAttribute="bottom" id="Plf-SO-Ahp"/>
336-
<constraint firstItem="XgA-ra-emd" firstAttribute="top" secondItem="4WL-4h-7Za" secondAttribute="top" id="Zzh-mG-Qzz"/>
335+
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="3ad-g9-Y4v" secondAttribute="bottom" id="Plf-SO-Ahp"/>
336+
<constraint firstItem="XgA-ra-emd" firstAttribute="top" secondItem="4WL-4h-7Za" secondAttribute="top" constant="4" id="Zzh-mG-Qzz"/>
337337
<constraint firstItem="3ad-g9-Y4v" firstAttribute="leading" secondItem="4WL-4h-7Za" secondAttribute="leading" id="huZ-G2-7YY"/>
338338
<constraint firstAttribute="trailing" secondItem="XgA-ra-emd" secondAttribute="trailing" id="rz7-pS-zpH"/>
339-
<constraint firstItem="3ad-g9-Y4v" firstAttribute="top" secondItem="XgA-ra-emd" secondAttribute="bottom" id="vaT-7D-i38"/>
339+
<constraint firstItem="3ad-g9-Y4v" firstAttribute="top" secondItem="XgA-ra-emd" secondAttribute="bottom" constant="8" id="vaT-7D-i38"/>
340340
<constraint firstAttribute="trailing" secondItem="3ad-g9-Y4v" secondAttribute="trailing" id="vji-5F-RT1"/>
341341
<constraint firstItem="XgA-ra-emd" firstAttribute="leading" secondItem="4WL-4h-7Za" secondAttribute="leading" id="xBw-l4-s7G"/>
342342
</constraints>

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ class PeriodDataViewController: UIViewController, IndicatorInfoProvider {
100100
init(granularity: StatGranularity) {
101101
self.granularity = granularity
102102
super.init(nibName: type(of: self).nibName, bundle: nil)
103+
104+
// Make sure the ResultsControllers are ready to observe changes to the data even before the view loads
105+
self.configureResultsControllers()
103106
}
104107

105108
/// NSCoder Conformance
@@ -112,9 +115,8 @@ class PeriodDataViewController: UIViewController, IndicatorInfoProvider {
112115

113116
override func viewDidLoad() {
114117
super.viewDidLoad()
115-
configureView()
116-
configureResultsControllers()
117-
configureBarChart()
118+
self.configureView()
119+
self.configureBarChart()
118120
}
119121

120122
override func viewDidAppear(_ animated: Bool) {

WooCommerce/Classes/ViewRelated/Notifications/Cells/NoteTableViewCell.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ class NoteTableViewCell: UITableViewCell {
4646
}
4747
}
4848

49+
/// Icon Color property.
50+
///
51+
var noticonColor: UIColor? {
52+
get {
53+
return noticonLabel.textColor
54+
}
55+
set {
56+
noticonLabel.textColor = newValue
57+
}
58+
}
59+
4960
/// Attributed Subject
5061
///
5162
var attributedSubject: NSAttributedString? {
@@ -113,7 +124,6 @@ private extension NoteTableViewCell {
113124
///
114125
func refreshColors() {
115126
sidebarView.backgroundColor = read ? UIColor.clear : StyleManager.wooAccent
116-
noticonLabel.textColor = read ? StyleManager.wooGreyMid : StyleManager.wooAccent
117127
}
118128

119129
func configureStarView() {

WooCommerce/Classes/ViewRelated/Notifications/NotificationsViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ private extension NotificationsViewController {
544544

545545
cell.read = note.read
546546
cell.noticon = note.noticon
547+
cell.noticonColor = note.noticonTintColor
547548
cell.attributedSubject = renderSubject(note: note)
548549
cell.attributedSnippet = renderSnippet(note: note)
549550
cell.starRating = note.starRating

WooCommerce/Classes/ViewRelated/Orders/OrderDetails/AddNote/AddANoteViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private extension AddANoteViewController {
153153
}
154154

155155
cell.title = NSLocalizedString("Email note to customer", comment: "Label for yes/no switch - emailing the note to customer.")
156-
cell.subtitle = NSLocalizedString("If disabled will add the note as private.", comment: "Detail label for yes/no switch.")
156+
cell.subtitle = NSLocalizedString("If disabled the note will be private", comment: "Detail label for yes/no switch.")
157157
cell.accessibilityTraits = .button
158158
cell.accessibilityLabel = String.localizedStringWithFormat(NSLocalizedString("Email note to customer %@", comment: ""), isCustomerNote ? NSLocalizedString("On", comment: "Spoken label to indicate switch control is turned on") : NSLocalizedString("Off", comment: "Spoken label to indicate switch control is turned off."))
159159
cell.accessibilityHint = NSLocalizedString("Double tap to toggle setting.", comment: "VoiceOver accessibility hint, informing the user that double-tapping will toggle the switch off and on.")

0 commit comments

Comments
 (0)