diff --git a/entourage.xcodeproj/project.pbxproj b/entourage.xcodeproj/project.pbxproj index 5e504e7b2..b47c94a87 100644 --- a/entourage.xcodeproj/project.pbxproj +++ b/entourage.xcodeproj/project.pbxproj @@ -379,6 +379,7 @@ 02FCC3172812DDA500578407 /* NeighborhoodHomeGroupCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02FCC3162812DDA500578407 /* NeighborhoodHomeGroupCell.swift */; }; 02FE55B52939F6020076F57A /* OnboardingEndCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02FE55B42939F6020076F57A /* OnboardingEndCell.swift */; }; 02FE55B7293A20030076F57A /* OnboardingEndViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02FE55B6293A20030076F57A /* OnboardingEndViewController.swift */; }; + 2628A0F2298AAA9400F1BF1D /* Extension_UILabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2628A0F1298AAA9400F1BF1D /* Extension_UILabel.swift */; }; 268FCA2A2967281100159C34 /* MJAlertWithImageController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 268FCA292967281100159C34 /* MJAlertWithImageController.swift */; }; 268FCA2C2967288100159C34 /* MJAlertWithImageController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 268FCA2B2967288100159C34 /* MJAlertWithImageController.xib */; }; 7E5BAEB3A1FAD453D344F4AE /* Pods_entourage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E625F1010BF498EB31E0DB1 /* Pods_entourage.framework */; }; @@ -751,6 +752,7 @@ 02FE55B42939F6020076F57A /* OnboardingEndCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingEndCell.swift; sourceTree = ""; }; 02FE55B6293A20030076F57A /* OnboardingEndViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingEndViewController.swift; sourceTree = ""; }; 1E625F1010BF498EB31E0DB1 /* Pods_entourage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_entourage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 2628A0F1298AAA9400F1BF1D /* Extension_UILabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extension_UILabel.swift; sourceTree = ""; }; 268FCA292967281100159C34 /* MJAlertWithImageController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MJAlertWithImageController.swift; sourceTree = ""; }; 268FCA2B2967288100159C34 /* MJAlertWithImageController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MJAlertWithImageController.xib; sourceTree = ""; }; 6E0C250CECA46B36DA7AE8CC /* Pods-entourage.store.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-entourage.store.xcconfig"; path = "Target Support Files/Pods-entourage/Pods-entourage.store.xcconfig"; sourceTree = ""; }; @@ -804,6 +806,7 @@ 02C3ABF3279AB55D00817B82 /* Extensions_UIViewController.swift */, 0288A8DA27CD00FD008D7011 /* Extensions_UIImage.swift */, 0224597927FF454A00944DE4 /* Extensions_UITextField.swift */, + 2628A0F1298AAA9400F1BF1D /* Extension_UILabel.swift */, ); path = Extensions; sourceTree = ""; @@ -1903,6 +1906,7 @@ 028444CA282015A000AFC072 /* NeighborhoodParamsGroupViewController.swift in Sources */, 0220580727FB003700531720 /* BasePopViewController.swift in Sources */, 0224597A27FF454A00944DE4 /* Extensions_UITextField.swift in Sources */, + 2628A0F2298AAA9400F1BF1D /* Extension_UILabel.swift in Sources */, 02B94C4528521F82006059EF /* PedagogicResource.swift in Sources */, 02B57D9A27FC433F005A567B /* ReportUserSendViewController.swift in Sources */, 022744712795BEC0005600A1 /* AuthService.swift in Sources */, @@ -2201,8 +2205,8 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = buildNumberNotSet; - DEVELOPMENT_TEAM = RT7X9LLTN6; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = RT7X9LLTN6; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; GENERATE_INFOPLIST_FILE = NO; INFOPLIST_FILE = "entourage/entourage-Info.plist"; diff --git a/entourage/Assets/Localizable.strings b/entourage/Assets/Localizable.strings index e6bbc8ab5..807bc493c 100644 --- a/entourage/Assets/Localizable.strings +++ b/entourage/Assets/Localizable.strings @@ -812,7 +812,7 @@ "event_create_phase_1_name_error" = "Le nom de l'événement doit contenir au minimum 2 caractères."; "event_create_phase_1_desc" = "Description - obligatoire"; "event_create_phase_1_desc_placeholder" = "Présentez rapidement ce qu’il va se passer"; -"event_create_phase_1_desc_subtitle" = "(400 caractères max)"; +"event_create_phase_1_desc_subtitle" = "(900 caractères max)"; "event_create_phase_1_photo" = "Photo - obligatoire"; "event_create_phase_1_photo_desc" = " Vous pourrez la changer plus tard"; diff --git a/entourage/Managers/DeeplinkManager.swift b/entourage/Managers/DeeplinkManager.swift index 2565f7d35..bbdb4708c 100644 --- a/entourage/Managers/DeeplinkManager.swift +++ b/entourage/Managers/DeeplinkManager.swift @@ -47,6 +47,37 @@ struct DeepLinkManager { } } + static func setImage(notificationInstanceType:InstanceType) -> String { + switch notificationInstanceType { + case .users: + return "placeholder_user" + case .pois: + return "ic_notif_placeholder" + case .conversations: + return "placeholder_user" + case .neighborhoods: + return "placeholder_user" + case .outings: + return "placeholder_user" + case .partners: + return "ic_notif_placeholder" + case .resources: + return "placeholder_user" + case .contributions: + return "placeholder_user" + case .solicitations: + return "placeholder_user" + case .neighborhood_post: + return "placeholder_user" + case .outing_post: + return "placeholder_user" + case .none: + return "ic_notif_placeholder" + } + } + + + //MARK: - Navigation Actions - static func showUser(userId:Int) { diff --git a/entourage/Scenes/Conversations/ConversationListMainCell.swift b/entourage/Scenes/Conversations/ConversationListMainCell.swift index d37096f36..4d425b607 100644 --- a/entourage/Scenes/Conversations/ConversationListMainCell.swift +++ b/entourage/Scenes/Conversations/ConversationListMainCell.swift @@ -45,6 +45,11 @@ class ConversationListMainCell: UITableViewCell { func populateCell(message:Conversation, delegate:ConversationListMainCellDelegate, position:Int) { ui_username.text = message.title ui_role.text = message.getRolesWithPartnerFormated() + if let _message = message.getLastMessage { + ui_detail_message.setTextWithLinksDetected(_message) { url in + delegate.showWebUrl(url:url) + } + } ui_detail_message.text = message.getLastMessage ui_date.text = message.createdDateFormatted @@ -99,5 +104,6 @@ class ConversationListMainCell: UITableViewCell { //MARK: - Protocol - protocol ConversationListMainCellDelegate:AnyObject { func showUserDetail(_ position:Int) + func showWebUrl(url:URL) } diff --git a/entourage/Scenes/Conversations/ConversationsMainHomeViewController.swift b/entourage/Scenes/Conversations/ConversationsMainHomeViewController.swift index e9680bfee..343b396bc 100644 --- a/entourage/Scenes/Conversations/ConversationsMainHomeViewController.swift +++ b/entourage/Scenes/Conversations/ConversationsMainHomeViewController.swift @@ -249,6 +249,10 @@ extension ConversationsMainHomeViewController: UITableViewDataSource, UITableVie //MARK: - ConversationListMainCellDelegate - extension ConversationsMainHomeViewController: ConversationListMainCellDelegate { + func showWebUrl(url: URL) { + WebLinkManager.openUrl(url: url, openInApp: true, presenterViewController: self) + } + func showUserDetail(_ position: Int) { //TODO: not use actually ;) diff --git a/entourage/Scenes/Events/Cells/Feed/EventDetailFullCell.swift b/entourage/Scenes/Events/Cells/Feed/EventDetailFullCell.swift index 0b07e0893..063484ac4 100644 --- a/entourage/Scenes/Events/Cells/Feed/EventDetailFullCell.swift +++ b/entourage/Scenes/Events/Cells/Feed/EventDetailFullCell.swift @@ -232,8 +232,11 @@ class EventDetailFullCell: UITableViewCell { ui_lbl_nb_members.text = membersCount - - ui_lbl_about_desc?.text = event.descriptionEvent + if let _desc = event.descriptionEvent { + ui_lbl_about_desc.setTextWithLinksDetected(_desc) { url in + delegate.showWebviewUrl(url:url) + } + } if let placeLimit = event.metadata?.place_limit, placeLimit > 0 { ui_view_place_limit.isHidden = false @@ -367,4 +370,5 @@ protocol EventDetailFullDelegate:AnyObject { func showLocation() func leaveEvent() func addToCalendar() + func showWebviewUrl(url:URL) } diff --git a/entourage/Scenes/Events/Cells/Feed/EventDetailTopFullCell.swift b/entourage/Scenes/Events/Cells/Feed/EventDetailTopFullCell.swift index 839fa1303..15bd6a93c 100644 --- a/entourage/Scenes/Events/Cells/Feed/EventDetailTopFullCell.swift +++ b/entourage/Scenes/Events/Cells/Feed/EventDetailTopFullCell.swift @@ -139,7 +139,12 @@ class EventDetailTopFullCell: UITableViewCell { ui_lbl_nb_members.text = membersCount ui_title.text = event.title - ui_lbl_about_desc?.text = event.descriptionEvent + if let _desc = event.descriptionEvent { + ui_lbl_about_desc?.setTextWithLinksDetected(_desc, andLinkHandler: { url in + delegate.showWebUrl(url: url) + }) + } + if let placeLimit = event.metadata?.place_limit, placeLimit > 0 { ui_view_place_limit.isHidden = false @@ -256,4 +261,5 @@ protocol EventDetailTopCellDelegate : AnyObject { func joinLeave() func showDetailFull() func showPlace() + func showWebUrl(url:URL) } diff --git a/entourage/Scenes/Events/EventDetailFeedViewController.swift b/entourage/Scenes/Events/EventDetailFeedViewController.swift index 08214c3ff..3f3585b1f 100644 --- a/entourage/Scenes/Events/EventDetailFeedViewController.swift +++ b/entourage/Scenes/Events/EventDetailFeedViewController.swift @@ -655,6 +655,10 @@ extension EventDetailFeedViewController: MJNavBackViewDelegate { //MARK: - EventDetailTopCellDelegate - extension EventDetailFeedViewController:EventDetailTopCellDelegate { + func showWebUrl(url: URL) { + WebLinkManager.openUrl(url: url, openInApp: true, presenterViewController: self) + } + func showMembers() { if let navVC = UIStoryboard.init(name: StoryboardName.neighborhood, bundle: nil).instantiateViewController(withIdentifier: "users_groupNav") as? UINavigationController, let vc = navVC.topViewController as? NeighBorhoodEventListUsersViewController { vc.event = event @@ -690,6 +694,10 @@ extension EventDetailFeedViewController:EventDetailTopCellDelegate { //MARK: - NeighborhoodPostCellDelegate - extension EventDetailFeedViewController:NeighborhoodPostCellDelegate { + func showWebviewUrl(url: URL) { + WebLinkManager.openUrl(url: url, openInApp: true, presenterViewController: self) + } + func showImage(imageUrl: URL?, postId: Int) { self.getDetailPost(eventId: self.eventId, parentPostId: postId) } diff --git a/entourage/Scenes/Events/EventDetailFullFeedViewController.swift b/entourage/Scenes/Events/EventDetailFullFeedViewController.swift index 3bda36c7b..2f5339dd3 100644 --- a/entourage/Scenes/Events/EventDetailFullFeedViewController.swift +++ b/entourage/Scenes/Events/EventDetailFullFeedViewController.swift @@ -136,6 +136,10 @@ extension EventDetailFullFeedViewController: UITableViewDataSource, UITableViewD //MARK: - EventDetailFullDelegate - extension EventDetailFullFeedViewController: EventDetailFullDelegate { + func showWebviewUrl(url: URL) { + WebLinkManager.openUrl(url: url, openInApp: true, presenterViewController: self) + } + func showMembers() { if let navVC = UIStoryboard.init(name: StoryboardName.neighborhood, bundle: nil).instantiateViewController(withIdentifier: "users_groupNav") as? UINavigationController, let vc = navVC.topViewController as? NeighBorhoodEventListUsersViewController { vc.event = event diff --git a/entourage/Scenes/Events/EventMainHomeViewController.swift b/entourage/Scenes/Events/EventMainHomeViewController.swift index bc8199438..6b6b7a257 100644 --- a/entourage/Scenes/Events/EventMainHomeViewController.swift +++ b/entourage/Scenes/Events/EventMainHomeViewController.swift @@ -363,8 +363,6 @@ class EventMainHomeViewController: UIViewController { @IBAction func action_discover(_ sender: Any?) { isEventSelected = false - - if isEventSelected != currentSelectedIsEvent && self.eventsDiscoveredExtracted.events.count == 0 { currentPageDiscover = 1 self.eventsDiscoveredExtracted.events.removeAll() @@ -602,14 +600,11 @@ extension EventMainHomeViewController: UITableViewDataSource, UITableViewDelegat let cell = tableView.dequeueReusableCell(withIdentifier: cellName, for: indexPath) as! EventListCell cell.populateCell(event: event, hideSeparator: true) - if isEventSelected { - if event.checkIsEventPassed(){ - cell.setPassed() - }else{ - cell.setIncoming() - } + if event.checkIsEventPassed(){ + cell.setPassed() + }else{ + cell.setIncoming() } - return cell } diff --git a/entourage/Scenes/Groups - Neighborhoods/Cells/Detail/NeighborhoodDetailTopCell.swift b/entourage/Scenes/Groups - Neighborhoods/Cells/Detail/NeighborhoodDetailTopCell.swift index e9b5dcc7e..86cbc750a 100644 --- a/entourage/Scenes/Groups - Neighborhoods/Cells/Detail/NeighborhoodDetailTopCell.swift +++ b/entourage/Scenes/Groups - Neighborhoods/Cells/Detail/NeighborhoodDetailTopCell.swift @@ -6,6 +6,7 @@ // import UIKit +import ActiveLabel class NeighborhoodDetailTopCell: UITableViewCell { @@ -26,7 +27,7 @@ class NeighborhoodDetailTopCell: UITableViewCell { @IBOutlet weak var ui_lbl_bt_join: UILabel! @IBOutlet weak var ui_lbl_about_title: UILabel! - @IBOutlet weak var ui_lbl_about_desc: UILabel! + @IBOutlet weak var ui_lbl_about_desc: ActiveLabel! @IBOutlet weak var ui_taglist_view: TagListView! @@ -121,8 +122,14 @@ class NeighborhoodDetailTopCell: UITableViewCell { ui_lbl_nb_members.text = membersCount ui_title.text = neighborhood.name - ui_lbl_about_desc?.text = neighborhood.aboutGroup - + //ui_lbl_about_desc?.text = neighborhood.aboutGroup + if let _desc = neighborhood.aboutGroup{ + ui_lbl_about_desc?.setTextWithLinksDetected(_desc, andLinkHandler: { url in + delegate.showWebUrl(url: url) + }) + + } + let currentUserId = UserDefaults.currentUser?.sid if isFollowingGroup { ui_lbl_bt_join.setupFontAndColor(style: ApplicationTheme.getFontBoutonOrange()) @@ -195,6 +202,7 @@ protocol NeighborhoodDetailTopCellDelegate : AnyObject { func showMembers() func joinLeave() func showDetailFull() + func showWebUrl(url:URL) } diff --git a/entourage/Scenes/Groups - Neighborhoods/Cells/Detail/NeighborhoodDetailTopCell.xib b/entourage/Scenes/Groups - Neighborhoods/Cells/Detail/NeighborhoodDetailTopCell.xib index 1899174f3..cf5115b6d 100644 --- a/entourage/Scenes/Groups - Neighborhoods/Cells/Detail/NeighborhoodDetailTopCell.xib +++ b/entourage/Scenes/Groups - Neighborhoods/Cells/Detail/NeighborhoodDetailTopCell.xib @@ -1,9 +1,9 @@ - + - + @@ -29,13 +29,13 @@ -