diff --git a/NOICommunity/AuthFeature/AccessNotGrantedCoordinator/AccessNotGrantedViewController.swift b/NOICommunity/AuthFeature/AccessNotGrantedCoordinator/AccessNotGrantedViewController.swift index 57ae446..30b9dfa 100644 --- a/NOICommunity/AuthFeature/AccessNotGrantedCoordinator/AccessNotGrantedViewController.swift +++ b/NOICommunity/AuthFeature/AccessNotGrantedCoordinator/AccessNotGrantedViewController.swift @@ -23,31 +23,6 @@ final class AccessNotGrantedViewController: ContainerViewController { 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 @@ -84,16 +59,15 @@ private extension AccessNotGrantedViewController { .sink { [weak self] isLoading in if isLoading { self?.showLoader() - } else { - self?.showAccessNotGranted() } } .store(in: &subscriptions) viewModel.$userInfoResult + .compactMap { $0 } .receive(on: DispatchQueue.main) .sink { [weak self] userInfo in - self?.showAccessNotGranted() + self?.showAccessNotGranted(with: userInfo) } .store(in: &subscriptions) @@ -119,9 +93,36 @@ private extension AccessNotGrantedViewController { content = loadingViewController } - private func showAccessNotGranted() { + private func showAccessNotGranted(with userInfo: UserInfo) { navigationController?.navigationBar.isHidden = false + let accessNotGrantedViewController: BlockAccessViewController = { + let contentVC = BlockAccessViewController(nibName: nil, bundle: nil) + contentVC.text = .localized("outsider_user_title") + let detailedAttributedText: NSAttributedString = { + let text = String.localizedStringWithFormat( + .localized("outsider_user_body_format"), + userInfo.email ?? "N/D" + ) + 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 + }() accessNotGrantedViewController.primaryAction = { [weak self] in self?.viewModel.logout() } diff --git a/NOICommunity/de.lproj/InfoPlist.strings b/NOICommunity/de.lproj/InfoPlist.strings index 9e8b4f0..9b15483 100755 --- a/NOICommunity/de.lproj/InfoPlist.strings +++ b/NOICommunity/de.lproj/InfoPlist.strings @@ -6,7 +6,7 @@ * InfoPlist.strings (de) * Copyright © 2021 Dimension S.r.l. All rights reserved. * - * Generated from "https://docs.google.com/spreadsheets/d/1Yiol3UqS-0I9q4R5HLifVMdGbTSe3ZwuYBAMPyZJthc/edit#gid=0" on 2024-11-07T11:58:16+0100 + * Generated from "https://docs.google.com/spreadsheets/d/1Yiol3UqS-0I9q4R5HLifVMdGbTSe3ZwuYBAMPyZJthc/edit#gid=0" on 2024-11-28T14:57:14+0100 * Please do not edit this file by hand, use the export function from Google Sheet. */ diff --git a/NOICommunity/de.lproj/Localizable.strings b/NOICommunity/de.lproj/Localizable.strings index f3d0e9a..38c38ff 100755 --- a/NOICommunity/de.lproj/Localizable.strings +++ b/NOICommunity/de.lproj/Localizable.strings @@ -6,7 +6,7 @@ * Localizable.strings (de) * Copyright © 2021 Dimension S.r.l. All rights reserved. * - * Generated from "https://docs.google.com/spreadsheets/d/1Yiol3UqS-0I9q4R5HLifVMdGbTSe3ZwuYBAMPyZJthc/edit#gid=0" on 2024-11-07T11:58:16+0100 + * Generated from "https://docs.google.com/spreadsheets/d/1Yiol3UqS-0I9q4R5HLifVMdGbTSe3ZwuYBAMPyZJthc/edit#gid=0" on 2024-11-28T14:57:14+0100 * Please do not edit this file by hand, use the export function from Google Sheet. */ @@ -303,7 +303,7 @@ Tab Orientate: button label */ "outsider_user_title" = "Hoppla, das hat leider nicht geklappt!"; /* Body of user outsider of NOI community */ -"outsider_user_body" = "Die angegebene E-Mail-Adresse scheint in unserer Datenbank nicht auf. \n \nDiese App ist den Mitgliedern der NOI-Community vorbehalten. Wenn du Teil davon bist, prüfe bitte die angegebene E-Mail-Adresse und versuch es noch einmal. Klappt es dann immer noch nicht, schreib uns bitte eine E-Mail an community@noi.bz.it. \n \nDu möchtest auch zur NOI-Community gehören? Hier geht’s zu unseren Job-Angeboten."; +"outsider_user_body_format" = "Die angegebene E-Mail-Adresse (%@) scheint in unserer Datenbank nicht auf. \n \nDiese App ist den Mitgliedern der NOI-Community vorbehalten. Wenn du Teil davon bist, prüfe bitte die angegebene E-Mail-Adresse und versuch es noch einmal. Klappt es dann immer noch nicht, schreib uns bitte eine E-Mail an community@noi.bz.it. \n \nDu möchtest auch zur NOI-Community gehören? Hier geht’s zu unseren Job-Angeboten."; /* Text to match for adding the first link inside outsider_user_body */ "outsider_user_body_link_1_part" = "Job-Angeboten"; diff --git a/NOICommunity/en.lproj/InfoPlist.strings b/NOICommunity/en.lproj/InfoPlist.strings index 42888c5..5a06a1d 100755 --- a/NOICommunity/en.lproj/InfoPlist.strings +++ b/NOICommunity/en.lproj/InfoPlist.strings @@ -6,7 +6,7 @@ * InfoPlist.strings (en) * Copyright © 2021 Dimension S.r.l. All rights reserved. * - * Generated from "https://docs.google.com/spreadsheets/d/1Yiol3UqS-0I9q4R5HLifVMdGbTSe3ZwuYBAMPyZJthc/edit#gid=0" on 2024-11-07T11:58:16+0100 + * Generated from "https://docs.google.com/spreadsheets/d/1Yiol3UqS-0I9q4R5HLifVMdGbTSe3ZwuYBAMPyZJthc/edit#gid=0" on 2024-11-28T14:57:14+0100 * Please do not edit this file by hand, use the export function from Google Sheet. */ diff --git a/NOICommunity/en.lproj/Localizable.strings b/NOICommunity/en.lproj/Localizable.strings index 6096903..0a3a80f 100755 --- a/NOICommunity/en.lproj/Localizable.strings +++ b/NOICommunity/en.lproj/Localizable.strings @@ -6,7 +6,7 @@ * Localizable.strings (en) * Copyright © 2021 Dimension S.r.l. All rights reserved. * - * Generated from "https://docs.google.com/spreadsheets/d/1Yiol3UqS-0I9q4R5HLifVMdGbTSe3ZwuYBAMPyZJthc/edit#gid=0" on 2024-11-07T11:58:16+0100 + * Generated from "https://docs.google.com/spreadsheets/d/1Yiol3UqS-0I9q4R5HLifVMdGbTSe3ZwuYBAMPyZJthc/edit#gid=0" on 2024-11-28T14:57:14+0100 * Please do not edit this file by hand, use the export function from Google Sheet. */ @@ -303,7 +303,7 @@ Tab Orientate: button label */ "outsider_user_title" = "Oops, that didn't work!"; /* Body of user outsider of NOI community */ -"outsider_user_body" = "The e-mail address you provided does not exist in our database. \n \nThis app is reserved for members of the NOI-Community. If you are one of them, please check the e-mail address you entered and try again. It it still doesn’t work, please email us at community@noi.bz.it. \n \nWant to join the NOI-Community? Click here for our job offers!"; +"outsider_user_body_format" = "The e-mail address (%@) you provided does not exist in our database. \n \nThis app is reserved for members of the NOI-Community. If you are one of them, please check the e-mail address you entered and try again. It it still doesn’t work, please email us at community@noi.bz.it. \n \nWant to join the NOI-Community? Click here for our job offers!"; /* Text to match for adding the first link inside outsider_user_body */ "outsider_user_body_link_1_part" = "here"; diff --git a/NOICommunity/it.lproj/InfoPlist.strings b/NOICommunity/it.lproj/InfoPlist.strings index 7e0986d..2dccd6a 100755 --- a/NOICommunity/it.lproj/InfoPlist.strings +++ b/NOICommunity/it.lproj/InfoPlist.strings @@ -6,7 +6,7 @@ * InfoPlist.strings (it) * Copyright © 2021 Dimension S.r.l. All rights reserved. * - * Generated from "https://docs.google.com/spreadsheets/d/1Yiol3UqS-0I9q4R5HLifVMdGbTSe3ZwuYBAMPyZJthc/edit#gid=0" on 2024-11-07T11:58:16+0100 + * Generated from "https://docs.google.com/spreadsheets/d/1Yiol3UqS-0I9q4R5HLifVMdGbTSe3ZwuYBAMPyZJthc/edit#gid=0" on 2024-11-28T14:57:14+0100 * Please do not edit this file by hand, use the export function from Google Sheet. */ diff --git a/NOICommunity/it.lproj/Localizable.strings b/NOICommunity/it.lproj/Localizable.strings index 0159ab7..410b49b 100755 --- a/NOICommunity/it.lproj/Localizable.strings +++ b/NOICommunity/it.lproj/Localizable.strings @@ -6,7 +6,7 @@ * Localizable.strings (it) * Copyright © 2021 Dimension S.r.l. All rights reserved. * - * Generated from "https://docs.google.com/spreadsheets/d/1Yiol3UqS-0I9q4R5HLifVMdGbTSe3ZwuYBAMPyZJthc/edit#gid=0" on 2024-11-07T11:58:16+0100 + * Generated from "https://docs.google.com/spreadsheets/d/1Yiol3UqS-0I9q4R5HLifVMdGbTSe3ZwuYBAMPyZJthc/edit#gid=0" on 2024-11-28T14:57:14+0100 * Please do not edit this file by hand, use the export function from Google Sheet. */ @@ -303,7 +303,7 @@ Tab Orientate: button label */ "outsider_user_title" = "Ops, qualcosa è andato storto!"; /* Body of user outsider of NOI community */ -"outsider_user_body" = "L'indirizzo e-mail inserito non è presente nel nostro database. \n \nQuesta app è riservata ai membri della NOI-Community. Se ne fai parte, controlla l'indirizzo e-mail inserito e riprova. Se il problema persiste, invia un'e-mail a community@noi.bz.it. \n \nVorresti entrare a far parte della NOI-Community? Clicca qui per le nostre offerte di lavoro."; +"outsider_user_body_format" = "L'indirizzo e-mail inserito (%@) non è presente nel nostro database. \n \nQuesta app è riservata ai membri della NOI-Community. Se ne fai parte, controlla l'indirizzo e-mail inserito e riprova. Se il problema persiste, invia un'e-mail a community@noi.bz.it. \n \nVorresti entrare a far parte della NOI-Community? Clicca qui per le nostre offerte di lavoro."; /* Text to match for adding the first link inside outsider_user_body */ "outsider_user_body_link_1_part" = "offerte di lavoro";