Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Belouosv <aleksey@maps.me>2018-10-05 16:30:59 +0300
committerVlad Mihaylenko <vxmihaylenko@gmail.com>2018-10-05 17:39:52 +0300
commit3c10b4c7013b7ce92ea1270b6a9fe01b664bfdea (patch)
treec65942a36f5814247e6ba90f0b57597a5339eec5
parent59604ccbfd2d658482324be21110afe29b8746fd (diff)
[iOS] fix review info on place pageios-release-844
-rw-r--r--iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm2
-rw-r--r--iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm4
-rw-r--r--iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/PPPReview.swift12
-rw-r--r--iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.h2
-rw-r--r--iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.mm2
5 files changed, 10 insertions, 12 deletions
diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm
index 3a7996b7f8..4ff2d74550 100644
--- a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm
+++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm
@@ -533,7 +533,7 @@ map<MetainfoRows, Class> const kMetaInfoCells = {
auto c = static_cast<MWMUGCSummaryRatingCell *>(
[tableView dequeueReusableCellWithCellClass:cls indexPath:indexPath]);
auto ugc = data.ugc;
- [c configWithReviewsCount:[ugc totalReviewsCount]
+ [c configWithReviewsCount:[ugc numberOfRatings]
summaryRating:[ugc summaryRating]
ratings:[ugc ratings]];
return c;
diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm
index 0f76d88e6e..52149aa21b 100644
--- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm
+++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm
@@ -239,6 +239,7 @@ std::array<Class, 9> const kPreviewCells = {{[_MWMPPPTitle class],
canAddReview:NO
isReviewedByUser:NO
reviewsCount:0
+ ratingsCount:0
price:data.bookingPricing
discount:data.bookingDiscount
smartDeal:data.isSmartDeal
@@ -253,7 +254,8 @@ std::array<Class, 9> const kPreviewCells = {{[_MWMPPPTitle class],
[reviewCell configWithRating:data.ugc.summaryRating
canAddReview:YES
isReviewedByUser:!data.ugc.isUGCUpdateEmpty
- reviewsCount:data.ugc.totalReviewsCount
+ reviewsCount:data.ugc.numberOfReviews
+ ratingsCount:data.ugc.numberOfRatings
price:@""
discount:0
smartDeal:NO
diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/PPPReview.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/PPPReview.swift
index 78c593a243..a03dd881f7 100644
--- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/PPPReview.swift
+++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/PPPReview.swift
@@ -34,6 +34,7 @@ final class PPPReview: MWMTableViewCell {
canAddReview: Bool,
isReviewedByUser: Bool,
reviewsCount: UInt,
+ ratingsCount: UInt,
price: String,
discount: Int,
smartDeal: Bool,
@@ -74,18 +75,13 @@ final class PPPReview: MWMTableViewCell {
} else {
ratingSummaryView.noValueImage = #imageLiteral(resourceName: "ic_12px_rating_normal")
ratingSummaryView.noValueColor = UIColor.blackSecondaryText()
- reviewsLabel.text = L("placepage_no_reviews")
+ reviewsLabel.text = reviewsCount == 0 ? L("placepage_no_reviews") : ""
}
} else {
ratingSummaryView.defaultConfig()
- if reviewsCount > 0 {
- reviewsLabel.text = String(format:L("placepage_summary_rating_description"), reviewsCount)
- reviewsLabel.isHidden = false
- } else {
- reviewsLabel.text = ""
- reviewsLabel.isHidden = true
- }
+ reviewsLabel.text = ratingsCount > 0
+ ? String(format:L("placepage_summary_rating_description"), ratingsCount) : ""
pricingLabel.isHidden = false
}
}
diff --git a/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.h b/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.h
index 7bb78616b3..f70dc1b212 100644
--- a/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.h
+++ b/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.h
@@ -42,7 +42,7 @@ enum class ReviewRow
- (NSUInteger)addReviewCellsCount;
- (std::vector<ugc::view_model::ReviewRow> const &)reviewRows;
-- (NSUInteger)totalReviewsCount;
+- (NSUInteger)numberOfRatings;
- (MWMUGCRatingValueType *)summaryRating;
- (NSArray<MWMUGCRatingStars *> *)ratings;
diff --git a/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.mm b/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.mm
index b521f387e9..05f405bd94 100644
--- a/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.mm
+++ b/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.mm
@@ -79,7 +79,7 @@ MWMUGCRatingValueType * ratingValueType(float rating)
- (BOOL)isAggregatedRatingEmpty { return m_ugc.m_totalRating == kIncorrectRating; }
- (NSUInteger)ratingCellsCount { return 1; }
- (NSUInteger)addReviewCellsCount { return 1; }
-- (NSUInteger)totalReviewsCount { return static_cast<NSUInteger>(m_ugc.m_basedOn); }
+- (NSUInteger)numberOfRatings { return static_cast<NSUInteger>(m_ugc.m_basedOn); }
- (MWMUGCRatingValueType *)summaryRating { return ratingValueType(m_ugc.m_totalRating); }
- (NSArray<MWMUGCRatingStars *> *)ratings { return starsRatings(m_ugc.m_ratings); }
- (std::vector<ugc::view_model::ReviewRow> const &)reviewRows { return m_reviewRows; }