Skip to content

Commit

Permalink
Merge pull request #137 from DimensionSrl/feature/updates
Browse files Browse the repository at this point in the history
Improvements and updates
  • Loading branch information
dulvui authored Jan 17, 2024
2 parents 7042e1b + 28ce51c commit 69a92d2
Show file tree
Hide file tree
Showing 22 changed files with 377 additions and 182 deletions.
14 changes: 13 additions & 1 deletion NOICommunity.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -168,6 +168,7 @@
31BFAB35283FB49A00EF274D /* MeetConstant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BFAB34283FB49800EF274D /* MeetConstant.swift */; };
31BFAB39283FB8EC00EF274D /* PersonDetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BFAB38283FB8EC00EF274D /* PersonDetailsViewController.swift */; };
31BFAB3B283FC88A00EF274D /* CALayer+XibConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BFAB3A283FC88A00EF274D /* CALayer+XibConfiguration.swift */; };
31C028412B55924B00D851EE /* FeatureFlag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31C028402B55924B00D851EE /* FeatureFlag.swift */; };
31C14C2327DA3597009AF69D /* UIScrollView+ScrollToView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31C14C2227DA3597009AF69D /* UIScrollView+ScrollToView.swift */; };
31C2261C270F596E0098A70E /* EventCardContentView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 315F4BE127034C00001905AF /* EventCardContentView.xib */; };
31C2261D270F59750098A70E /* EventDetailsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3187667826FB3A9300782FA6 /* EventDetailsViewController.xib */; };
Expand Down Expand Up @@ -204,6 +205,8 @@
31D77E742733FFDD0054397C /* UIRefreshControlAdditions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31D77E732733FFDD0054397C /* UIRefreshControlAdditions.swift */; };
31DA4A762705EA110098E395 /* MoreMainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31DA4A742705EA110098E395 /* MoreMainViewController.swift */; };
31DA4A772705EA110098E395 /* MoreCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31DA4A752705EA110098E395 /* MoreCoordinator.swift */; };
31DAC7BC2B56853A00F24D79 /* URL+Params.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31DAC7BB2B56853A00F24D79 /* URL+Params.swift */; };
31DAC7BE2B568A0100F24D79 /* IndexPathAdditions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31DAC7BD2B568A0100F24D79 /* IndexPathAdditions.swift */; };
31E058F22812F18800D1F7FE /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = 31E058F12812F18800D1F7FE /* KeychainAccess */; };
31E7872027D64F2300C67188 /* EventFiltersViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 31E7871F27D64E9600C67188 /* EventFiltersViewController.xib */; };
31E7872427D7419200C67188 /* UIButton+Insets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31E7872327D7419200C67188 /* UIButton+Insets.swift */; };
Expand Down Expand Up @@ -395,6 +398,7 @@
31BFAB34283FB49800EF274D /* MeetConstant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeetConstant.swift; sourceTree = "<group>"; };
31BFAB38283FB8EC00EF274D /* PersonDetailsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonDetailsViewController.swift; sourceTree = "<group>"; };
31BFAB3A283FC88A00EF274D /* CALayer+XibConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CALayer+XibConfiguration.swift"; sourceTree = "<group>"; };
31C028402B55924B00D851EE /* FeatureFlag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureFlag.swift; sourceTree = "<group>"; };
31C14C2227DA3597009AF69D /* UIScrollView+ScrollToView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIScrollView+ScrollToView.swift"; sourceTree = "<group>"; };
31C28BF52719709B00312A62 /* NOICells.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NOICells.swift; sourceTree = "<group>"; };
31C28BF7271992F500312A62 /* FiltersBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FiltersBarView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -428,6 +432,8 @@
31D9C78926FDFCD3001F2DBB /* BaseTabCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTabCoordinator.swift; sourceTree = "<group>"; };
31DA4A742705EA110098E395 /* MoreMainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoreMainViewController.swift; sourceTree = "<group>"; };
31DA4A752705EA110098E395 /* MoreCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoreCoordinator.swift; sourceTree = "<group>"; };
31DAC7BB2B56853A00F24D79 /* URL+Params.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+Params.swift"; sourceTree = "<group>"; };
31DAC7BD2B568A0100F24D79 /* IndexPathAdditions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndexPathAdditions.swift; sourceTree = "<group>"; };
31E058F32812F29500D1F7FE /* NOICommunityDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NOICommunityDebug.entitlements; sourceTree = "<group>"; };
31E058F42812F2A700D1F7FE /* NOICommunityRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NOICommunityRelease.entitlements; sourceTree = "<group>"; };
31E7871F27D64E9600C67188 /* EventFiltersViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EventFiltersViewController.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -927,6 +933,9 @@
31178FCD26F8D7CC00BDCDAA /* Localization.swift */,
31C28BF52719709B00312A62 /* NOICells.swift */,
31C8F52A282522150009BCB7 /* NoiNewsTopic.swift */,
31C028402B55924B00D851EE /* FeatureFlag.swift */,
31DAC7BB2B56853A00F24D79 /* URL+Params.swift */,
31DAC7BD2B568A0100F24D79 /* IndexPathAdditions.swift */,
);
path = Helpers;
sourceTree = "<group>";
Expand Down Expand Up @@ -1313,10 +1322,12 @@
31A5F04F27D22ECA00FA20BC /* EventFiltersListViewController.swift in Sources */,
3153010528071D1200471153 /* AuthWelcomePageViewController.swift in Sources */,
316F5615281C166B0075B09F /* MyAccountViewController.swift in Sources */,
31C028412B55924B00D851EE /* FeatureFlag.swift in Sources */,
31C640B126FE1449004B71A2 /* TabCoordinatorType.swift in Sources */,
31A5F05527D25A9400FA20BC /* EventFiltersViewController.swift in Sources */,
317B6F9A28118950008D07C0 /* ClientFactory.swift in Sources */,
31DA4A762705EA110098E395 /* MoreMainViewController.swift in Sources */,
31DAC7BC2B56853A00F24D79 /* URL+Params.swift in Sources */,
311350E7282E4F0A00AC9BC9 /* GalleryCollectionViewController.swift in Sources */,
3126E7272B2882620013F456 /* CacheKey.swift in Sources */,
31178FDC26FA26C500BDCDAA /* EventDetailsViewController.swift in Sources */,
Expand All @@ -1326,6 +1337,7 @@
317F74FA27D8B5610084E619 /* CircleButton.swift in Sources */,
31DA4A772705EA110098E395 /* MoreCoordinator.swift in Sources */,
312F5D292808252900C84598 /* WelcomeViewModel.swift in Sources */,
31DAC7BE2B568A0100F24D79 /* IndexPathAdditions.swift in Sources */,
3101FC5B283394FA00A3416F /* TodayCoordinator.swift in Sources */,
31C28BF8271992F500312A62 /* FiltersBarView.swift in Sources */,
3145D23326B3F73F00F16787 /* SceneDelegate.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,25 @@ private extension AccessNotGrantedCoordinator {

func showAccessNotGranted(animated: Bool) {
let myAccountViewModel = dependencyContainer.makeMyAccountViewModel()
myAccountViewModel.navigateToNoiTechparkJobsHandler = { [weak self] in
self?.navigateToNoiTechparkJobsHandler()
}
let accessNotGrantedVC = dependencyContainer
.makeAccessNotGrantedViewController(viewModel: myAccountViewModel)
navigationController.setViewControllers(
[accessNotGrantedVC],
animated: animated
)
}


func navigateToNoiTechparkJobsHandler() {
guard let url = URL(string: .localized("url_jobs_noi_techpark"))
else { return }

let webVC = WebViewController()
webVC.url = url.addQueryParams(fullview: true)
webVC.navigationItem.title = .localized("noi_techpark_jobs_page_title")
navigationController.pushViewController(webVC, animated: true)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,66 +16,93 @@ import AuthClient
// MARK: - AccessNotGrantedViewController

final class AccessNotGrantedViewController: ContainerViewController {

let viewModel: MyAccountViewModel

private var subscriptions: Set<AnyCancellable> = []


private lazy var loadingViewController = LoadingViewController(style: .light)

private var accessNotGrantedViewController: BlockAccessViewController = {
let contentVC = BlockAccessViewController(nibName: nil, bundle: nil)
contentVC.text = .localized("outsider_user_title")
let detailedAttributedText: NSAttributedString = {
let text = String.localized("outsider_user_body")
let mAttributedText = NSMutableAttributedString(string: text,
attributes: [
.font: UIFont.preferredFont(forTextStyle: .body),
.foregroundColor: UIColor.noiSecondaryColor
])

if let range = text.range(of: String.localized("outsider_user_body_link_1_part")),
let url = URL(string: .localized("url_jobs_noi_techpark")) {
mAttributedText.addAttribute(.link,
value: url,
range: NSRange(range, in: text))
}

return NSAttributedString(attributedString: mAttributedText)
}()
contentVC.detailedAttributedText = detailedAttributedText
contentVC.primaryActionTitle = .localized("btn_logout")
return contentVC
}()

init(viewModel: MyAccountViewModel) {
self.viewModel = viewModel

super.init(content: nil)
}

@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("\(#function) not available")
}

@available(*, unavailable)
override init(content: UIViewController?) {
fatalError("\(#function) not available")
}

override func viewDidLoad() {
super.viewDidLoad()

title = .localized("warning_title")
title = .localized("warning_title")
configureBindings()
viewModel.fetchUserInfo()
}

}

// MARK: Private APIs

private extension AccessNotGrantedViewController {

func configureBindings() {
viewModel.$userInfoIsLoading
.receive(on: DispatchQueue.main)
.sink { [weak self] isLoading in
if isLoading {
self?.showLoader()
} else {
self?.showAccessNotGranted(userInfo: self?.viewModel.userInfoResult)
self?.showAccessNotGranted()
}
}
.store(in: &subscriptions)

viewModel.$userInfoResult
.receive(on: DispatchQueue.main)
.sink { [weak self] userInfo in
self?.showAccessNotGranted(userInfo: userInfo)
self?.showAccessNotGranted()
}
.store(in: &subscriptions)

viewModel.$error
.receive(on: DispatchQueue.main)
.sink { [weak self] error in
guard let error = error
else { return }

switch error {
case AuthError.userCanceledAuthorizationFlow:
break
Expand All @@ -89,21 +116,18 @@ private extension AccessNotGrantedViewController {
private func showLoader() {
navigationController?.navigationBar.isHidden = true

content = LoadingViewController(style: .light)
content = loadingViewController
}

private func showAccessNotGranted(userInfo userInfoOrNil: UserInfo?) {
private func showAccessNotGranted() {
navigationController?.navigationBar.isHidden = false

content = {
let contentVC = BlockAccessViewController(nibName: nil, bundle: nil)
contentVC.text = .localized("outsider_user_title")
contentVC.detailedText = .localized("outsider_user_body")
contentVC.primaryActionTitle = .localized("btn_logout")
contentVC.primaryAction = { [weak self] in
self?.viewModel.logout()
}
return contentVC
}()
accessNotGrantedViewController.primaryAction = { [weak self] in
self?.viewModel.logout()
}
accessNotGrantedViewController.didTapJobsLinkAction = { [weak self] in
self?.viewModel.navigateToNoiTechparkJobs()
}
content = accessNotGrantedViewController
}
}
15 changes: 0 additions & 15 deletions NOICommunity/AuthFeature/AuthCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,3 @@ private extension AuthCoordinator {
}

}

private extension URL {
func addQueryParams(fullview: Bool) -> URL {
var urlComponents = URLComponents(
url: self,
resolvingAgainstBaseURL: false
)!
var queryItems = urlComponents.queryItems ?? []
if fullview {
queryItems.append(URLQueryItem(name: "fullview", value: "1"))
}
urlComponents.queryItems = !queryItems.isEmpty ? queryItems : nil
return urlComponents.url!
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class AuthWelcomeViewController: UIViewController {
}
}

@IBOutlet var privacyTextView: UITextView! {
@IBOutlet var privacyTextView: LinkTextView! {
didSet {
privacyTextView.isSelectable = true
privacyTextView.isEditable = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import AppPreferencesClient

final class ComeOnBoardOnboardingViewModel {

lazy var navigateToMainAppPublisher = navigateToMainAppSubject
private(set) lazy var navigateToMainAppPublisher = navigateToMainAppSubject
.eraseToAnyPublisher()

@Published private(set) var isDontShowThisAgainToggleOn = false
Expand Down
73 changes: 1 addition & 72 deletions NOICommunity/EventShortTypes.json
Original file line number Diff line number Diff line change
@@ -1,72 +1 @@
[
{
"Id": "sport",
"Key": "Sport",
"Type": "CustomTagging",
"TypeDesc": {
"de": "Sport",
"en": "Sport",
"it": "Sport"
}
},
{
"Id": "noicommunity",
"Key": "NOI Community",
"Type": "CustomTagging",
"TypeDesc": {
"de": "NOI Community",
"en": "NOI Community",
"it": "NOI Community"
}
},
{
"Id": "alpine",
"Key": "Alpine",
"Type": "TechnologyFields",
"TypeDesc": {
"de": "Alpine",
"en": "Alpine",
"it": "Alpine"
}
},
{
"Id": "automotiveautomation",
"Key": "Automotive/Automation",
"Type": "TechnologyFields",
"TypeDesc": {
"de": "Automotive / Automation",
"en": "Automotive / Automation",
"it": "Automotive / Automation"
}
},
{
"Id": "digital",
"Key": "Digital",
"Type": "TechnologyFields",
"TypeDesc": {
"de": "Digital",
"en": "Digital",
"it": "Digital"
}
},
{
"Id": "food",
"Key": "Food",
"Type": "TechnologyFields",
"TypeDesc": {
"de": "Food",
"en": "Food",
"it": "Food"
}
},
{
"Id": "green",
"Key": "Green",
"Type": "TechnologyFields",
"TypeDesc": {
"de": "Green",
"en": "Green",
"it": "Green"
}
}
]
[{"Id":"sport","Key":"Sport","Type":"CustomTagging","TypeDesc":{"de":"Sport","en":"Sport","it":"Sport"}},{"Id":"noicommunity","Key":"NOI Community","Type":"CustomTagging","TypeDesc":{"de":"NOI Community","en":"NOI Community","it":"NOI Community"}},{"Id":"automotiveautomation","Key":"Automotive/Automation","Type":"TechnologyFields","TypeDesc":{"de":"Automotive / Automation","en":"Automotive / Automation","it":"Automotive / Automation"}},{"Id":"digital","Key":"Digital","Type":"TechnologyFields","TypeDesc":{"de":"Digital","en":"Digital","it":"Digital"}},{"Id":"green","Key":"Green","Type":"TechnologyFields","TypeDesc":{"de":"Green","en":"Green","it":"Green"}},{"Id":"publicengagement","Key":"Public Engagement","Type":"CustomTagging","TypeDesc":{"de":"Public Engagement","en":"Public Engagement","it":"Public Engagement"}},{"Id":"food","Key":"Food","Type":"TechnologyFields","TypeDesc":{"de":"Food & Health","en":"Food & Health","it":"Food & Health"}}]
16 changes: 16 additions & 0 deletions NOICommunity/Helpers/FeatureFlag.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-FileCopyrightText: NOI Techpark <[email protected]>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

//
// FeatureFlag.swift
// NOICommunity
//
// Created by Matteo Matassoni on 15/01/24.
//

import Foundation

enum FeatureFlag {

}
Loading

0 comments on commit 69a92d2

Please sign in to comment.