Skip to content
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

Add #137: cover image and logo image from organisation detail api #138

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import Foundation
import SwiftyJSON

class Organization: OrganizationWrapper {
var coverImageURL: String?
var logoImageURL: String?
var descriptionField : String?
var iD : String?
var imageURL : URL?
var location : String?
var name : String?
var type : OrgTypeWrapper?
var logoImageURL : URL?
var coverImageURL : URL?
var privacyPolicy: String?

/**
Expand All @@ -26,8 +26,8 @@ class Organization: OrganizationWrapper {
descriptionField = json["organisation"]["description"].stringValue
iD = json["organisation"]["id"].stringValue
imageURL = json["organisation"]["ImageURL"].url
logoImageURL = json["organisation"]["logoImageUrl"].url
coverImageURL = json["organisation"]["coverImageUrl"].url
logoImageURL = json["organisation"]["logoImageUrl"].stringValue
coverImageURL = json["organisation"]["coverImageUrl"].stringValue
privacyPolicy = json["organisation"]["policyUrl"].stringValue
location = json["organisation"]["location"].stringValue
name = json["organisation"]["name"].stringValue
Expand All @@ -41,7 +41,7 @@ protocol OrganizationWrapper {
var location : String? { get }
var name : String? { get }
var type : OrgTypeWrapper? { get }
var logoImageURL : URL? { get }
var coverImageURL : URL? { get }
var logoImageURL : String? { get }
var coverImageURL : String? { get }
var privacyPolicy: String? { get }
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ class BBConsentDashboardHeaderCell: UITableViewCell {
}

self.orgImageView.image = UIImage(named: Constant.Images.defaultCoverImage)
let coverImageUrl = URL(string: baseUrl + "/service/organisation/coverimage")
let coverImageUrl = URL(string: (orgData?.coverImageURL ?? ""))
let placeholder = UIImage(named: Constant.Images.defaultCoverImage, in: Constant.getResourcesBundle(vc: BBConsentBaseViewController().classForCoder), compatibleWith: nil)
self.orgImageView.kf.setImage(with: coverImageUrl, placeholder: placeholder, options: [.requestModifier(modifier)])

self.logoImageView.image = UIImage(named: Constant.Images.iGrantTick)
let logoImageUrl = URL(string: baseUrl + "/service/organisation/logoimage")
let logoImageUrl = URL(string: (orgData?.logoImageURL ?? ""))
let coverImagePlaceholder = UIImage(named: Constant.Images.iGrantTick, in: Constant.getResourcesBundle(vc: BBConsentBaseViewController().classForCoder), compatibleWith: nil)
self.logoImageView.kf.setImage(with: logoImageUrl, placeholder: coverImagePlaceholder, options: [.requestModifier(modifier)])
}
Expand Down
Loading