New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WorksForYou QA Items #2169

Merged
merged 6 commits into from Feb 17, 2017
@@ -36,7 +36,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.1.1</string>
<string>3.2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@@ -81,6 +81,7 @@ + (NSInteger)rankForlayout:(ARArtworkMasonryLayout)layout
+ (CGFloat)dimensionForlayout:(ARArtworkMasonryLayout)layout useLandscapeValues:(BOOL)useLandscapeValues
{
/// Returns the width of each column or height for each row, depending on the layout
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat shortestDimension = MIN(CGRectGetWidth(screenRect), CGRectGetHeight(screenRect));
@@ -96,9 +97,9 @@ + (CGFloat)dimensionForlayout:(ARArtworkMasonryLayout)layout useLandscapeValues:
// The 3-column layout is only used on iPad.
NSAssert([UIDevice isPad], @"ARARtworkMasonryLayout3Column is intended for use with iPad");
if (useLandscapeValues) {
return 280;
return 300;
} else {
return 200;
return 215;
}
case ARArtworkMasonryLayout4Column:
@@ -251,15 +252,15 @@ + (CGSize)itemMarginsforLayout:(ARArtworkMasonryLayout)layout
case ARArtworkMasonryLayout1Column:
case ARArtworkMasonryLayout2Column:
if ([UIDevice isPad]) {
return (CGSize){38, 38};
return (CGSize){50, 38};
}
case ARArtworkMasonryLayout3Column:
if ([UIDevice isPad]) {
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
if (UIInterfaceOrientationIsLandscape(orientation)) {
return (CGSize){42, 42};
return (CGSize){20, 20};
} else {
return (CGSize){34, 34};
return (CGSize){20, 20};
}
}
case ARArtworkMasonryLayout4Column:
@@ -68,17 +68,17 @@ - (void)viewDidLoad
[self addArtistTapRecognizerToView:numberOfWorksAddedLabel];
UIView *wrapper = [[UIView alloc] init];
NSString *labelSideMargin = (self.regularHorizontalSizeClass) ? @"75" : @"30";
[self.view addSubview:wrapper withTopMargin:self.regularHorizontalSizeClass ? @"25" : @"15" sideMargin:labelSideMargin];
NSString *labelSideMargin = (self.regularHorizontalSizeClass) ? @"65" : @"30";
[self.view addSubview:wrapper withTopMargin:self.regularHorizontalSizeClass ? @"15" : @"15" sideMargin:labelSideMargin];
[wrapper addSubview:artistNameLabel];
[wrapper addSubview:dateLabel];
[artistNameLabel alignLeadingEdgeWithView:wrapper predicate:@"0"];
[artistNameLabel constrainTrailingSpaceToView:dateLabel predicate:@"-20"];
[artistNameLabel setContentCompressionResistancePriority:UILayoutPriorityDefaultLow forAxis:UILayoutConstraintAxisHorizontal];
[artistNameLabel alignCenterYWithView:wrapper predicate:@"0"];
[dateLabel alignTrailingEdgeWithView:wrapper predicate:@"0"];
[dateLabel alignCenterYWithView:wrapper predicate:@"0"];
[dateLabel setContentCompressionResistancePriority:UILayoutPriorityDefaultHigh forAxis:UILayoutConstraintAxisHorizontal];
@@ -87,17 +87,7 @@ - (void)viewDidLoad
[wrapper constrainHeightToView:artistNameLabel predicate:@"0"];
[self.view addSubview:numberOfWorksAddedLabel withTopMargin:@"7" sideMargin:labelSideMargin];
if (self.notificationItem.artworks.count == 1) {
self.singleArtworkView = self.singleArtworkView ?: [[ARArtworkWithMetadataThumbnailCell alloc] init];
self.singleArtworkView.imageSize = ARFeedItemImageSizeLarge;
self.singleArtworkView.imageViewContentMode = UIViewContentModeScaleAspectFit;
[self.singleArtworkView setupWithRepresentedObject:self.notificationItem.artworks.firstObject];
[self.singleArtworkView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleArtworkTapped:)]];
[self.view addSubview:self.singleArtworkView withTopMargin:@"10" sideMargin:(self.regularHorizontalSizeClass) ? @"75" : @"30"];
} else {
if (self.regularHorizontalSizeClass || self.notificationItem.artworks.count > 1) {
self.artworksVC = self.artworksVC ?: [[AREmbeddedModelsViewController alloc] init];
self.artworksVC.delegate = self;
@@ -108,6 +98,15 @@ - (void)viewDidLoad
self.artworksVC.activeModule = module;
[self.artworksVC appendItems:self.notificationItem.artworks];
[self.view addViewController:self.artworksVC toParent:self withTopMargin:@"0" sideMargin:@"0"];
} else {
self.singleArtworkView = self.singleArtworkView ?: [[ARArtworkWithMetadataThumbnailCell alloc] init];
self.singleArtworkView.imageSize = ARFeedItemImageSizeLarge;
self.singleArtworkView.imageViewContentMode = UIViewContentModeScaleAspectFit;
[self.singleArtworkView setupWithRepresentedObject:self.notificationItem.artworks.firstObject];
[self.singleArtworkView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleArtworkTapped:)]];
[self.view addSubview:self.singleArtworkView withTopMargin:@"10" sideMargin:@"30"];
}
}
@@ -121,7 +120,7 @@ - (void)viewWillAppear:(BOOL)animated
- (void)didMoveToParentViewController:(UIViewController *)parent
{
[super didMoveToParentViewController:parent];
if (self.artworksVC) {
// this tells the embedded artworks view controller that it should update for the correct size because self.view.frame.size at this point is (0, 0)
[self.artworksVC didMoveToParentViewController:parent];
@@ -197,17 +196,6 @@ - (void)didSelectArtwork:(Artwork *)artwork animated:(BOOL)animated
[self.navigationController pushViewController:viewController animated:YES];
}
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator

This comment has been minimized.

@sarahscott

sarahscott Feb 17, 2017

Contributor

No longer necessary because the single-artwork view is only on iPhone now and does not rotate.

@sarahscott

sarahscott Feb 17, 2017

Contributor

No longer necessary because the single-artwork view is only on iPhone now and does not rotate.

{
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
if (self.singleArtworkView) {
[self updateSingleArtistViewSizeForParent:self.parentViewController];
}
} completion:nil];
}
- (BOOL)regularHorizontalSizeClass
{
return self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular;
@@ -217,7 +205,7 @@ - (BOOL)regularHorizontalSizeClass
- (ARArtworkMasonryLayout)masonryLayoutForSize:(CGSize)size
{
if (self.regularHorizontalSizeClass && self.artworksVC.items.count >= 3) {
if (self.regularHorizontalSizeClass) {
return ARArtworkMasonryLayout3Column;
} else {
return ARArtworkMasonryLayout2Column;
@@ -59,7 +59,7 @@ - (void)viewDidLoad
titleLabel.textColor = [UIColor blackColor];
titleLabel.font = [UIFont serifFontWithSize:20];
[self.view.stackView addSubview:titleLabel withTopMargin:@"30" sideMargin:(self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular) ? @"90" : @"45"];
[self.view.stackView addSubview:titleLabel withTopMargin:@"30" sideMargin:(self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular) ? @"85" : @"45"];
[self updateView];
}
@@ -73,7 +73,7 @@ - (void)addSeparatorLine
[lineView constrainHeight:@"0.5"];
if (self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular) {
[self.view.stackView addSubview:lineView withTopMargin:@"10" sideMargin:@"40"];
[self.view.stackView addSubview:lineView withTopMargin:@"5" sideMargin:@"75"];
} else {
[self.view.stackView addSubview:lineView withTopMargin:@"10" sideMargin:@"0"];
}
@@ -36,7 +36,7 @@ + (CGFloat)heightIncludingPriceLabel:(BOOL)includePriceLabel
+ (BOOL)showPriceLabelWithArtwork:(Artwork *)artwork
{
return artwork.price.length && !artwork.isPriceHidden.boolValue && !artwork.sold.boolValue;
return artwork.saleMessage.length;
}
- (void)prepareForReuse
@@ -94,7 +94,7 @@ - (void)configureWithArtwork:(Artwork *)artwork showPriceLabel:(BOOL)showPrice
self.secondaryLabel.lineBreakMode = NSLineBreakByTruncatingTail;
if (showPrice) {
self.priceLabel.text = artwork.price;
self.priceLabel.text = artwork.saleMessage;
}
self.showPrice = showPrice;
}
@@ -50,10 +50,10 @@
[OHHTTPStubs stubJSONResponseAtPath:@"/api/v1/related/layer/synthetic/main/artworks"
withParams:@{@"artwork[]": @"some-artwork"}
withResponse:@[
@{ @"id": @"one", @"title": @"One", @"price_hidden": @YES, @"price": @"$10" },
@{ @"id": @"two", @"title": @"Two", @"price": @"$1,200" },
@{ @"id": @"three", @"title": @"Three", @"price": @"$10", @"sold": @YES },
@{ @"id": @"four", @"title": @"Four", @"price": @"$300" }
@{ @"id": @"one", @"title": @"One", @"sale_message": @"$10" },
@{ @"id": @"two", @"title": @"Two", @"sale_message": @"Sold" },
@{ @"id": @"three", @"title": @"Three", @"sale_message": @"Not For Sale" },
@{ @"id": @"four", @"title": @"Four" }
]];
View
@@ -6,6 +6,7 @@ upcoming:
- Report user’s anonymous ID to Adjust for campaign to install tracking - alloy
- Font Pod changes which should allow OSS contributors to run our Apps again - orta
user_facing:
- Artwork metadata in collection views use sale_message instead of price - sarah
- Gene artworks filtering is enabled - orta
- Fixes a problem where auction users were being directed to general inquiries email address instead of specialists - ash
- Fixes issue where fairs were not shown in search results - maxim
ProTip! Use n and p to navigate between commits in a pull request.