Skip to content

Commit

Permalink
Adaptation de AgentConnect à ProConnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Buquet committed Sep 25, 2024
1 parent 241c9a1 commit f9e52b6
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Btchap/Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ final class BuildSettings: NSObject {
static let applicationHelpUrlString = "https://www.beta.tchap.gouv.fr/faq"
static let applicationServicesStatusUrlString = "https://status.tchap.numerique.gouv.fr/"
static let applicationAcceptableUsePolicyUrlString = ""
static let agentConnectInfoUrlString = "https://franceconnect.gouv.fr/"
static let proConnectInfoUrlString = "https://proconnect.gouv.fr/"

// MARK: - Matrix permalinks
// Hosts/Paths for URLs that will considered as valid permalinks. Those permalinks are opened within the app.
Expand Down
2 changes: 1 addition & 1 deletion DevTchap/Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ final class BuildSettings: NSObject {
static let applicationHelpUrlString = "https://www.tchap.incubateur.net/faq"
static let applicationServicesStatusUrlString = "https://status.tchap.numerique.gouv.fr/"
static let applicationAcceptableUsePolicyUrlString = ""
static let agentConnectInfoUrlString = "https://franceconnect.gouv.fr/"
static let proConnectInfoUrlString = "https://proconnect.gouv.fr/"

// MARK: - Matrix permalinks
// Hosts/Paths for URLs that will considered as valid permalinks. Those permalinks are opened within the app.
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scale" : "2x"
},
{
"filename" : "agent_connect_icon@3x.png",
"filename" : "pro_connect_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions Tchap/Assets/Localizations/fr.lproj/Tchap.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@
"welcome_subtitle" = "La messagerie instantanée du secteur public";
"welcome_login_action" = "J'ai un compte";
"welcome_register_action" = "Je n'ai pas de compte";
"welcome_agent_connect_title" = "S'identifier avec\n**AgentConnect**"; // Markdown string for SwiftUI Text()
"welcome_agent_connect_info" = "→ Qu'est-ce que AgentConnect ?";
"welcome_pro_connect_title" = "Se connecter avec\n**ProConnect**"; // Markdown string for SwiftUI Text()
"welcome_pro_connect_info" = "→ Qu'est-ce que ProConnect ?";
"welcome_password_title" = "Se connecter par mot de passe";

////////////////////////////////////////////////////////////////////////////////
// MARK: Authentication
"authentication_password_title" = "Se connecter à Tchap";
"authentication_sso_title" = "Se connecter avec AgentConnect";
"authentication_mail_placeholder" = "Adresse email";
"authentication_sso_title" = "Se connecter avec ProConnect";
"authentication_sso_connect_title" = "**Continuer avec ProConnect**"; // Markdown string for SwiftUI Text()
"authentication_mail_placeholder" = "Adresse mail professionnelle";
"authentication_password_placeholder" = "Mot de passe Tchap";
"authentication_forgot_password" = "Mot de passe oublié ?";

Expand Down
2 changes: 1 addition & 1 deletion Tchap/Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ final class BuildSettings: NSObject {
static let applicationHelpUrlString = "https://www.tchap.gouv.fr/faq"
static let applicationServicesStatusUrlString = "https://status.tchap.numerique.gouv.fr/"
static let applicationAcceptableUsePolicyUrlString = ""
static let agentConnectInfoUrlString = "https://franceconnect.gouv.fr/"
static let proConnectInfoUrlString = "https://proconnect.gouv.fr/"

// MARK: - Matrix permalinks
// Hosts/Paths for URLs that will considered as valid permalinks. Those permalinks are opened within the app.
Expand Down
4 changes: 2 additions & 2 deletions Tchap/Extensions/WebLinks+Tchap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import Foundation
// becasue UIApplication.shared is not available for extension.
@available(iOSApplicationExtension, unavailable)
struct TchapWebLinks {
static func openAgentConnectInfo() {
self.openWebsite(urlString: BuildSettings.agentConnectInfoUrlString)
static func openProConnectInfo() {
self.openWebsite(urlString: BuildSettings.proConnectInfoUrlString)
}

static private func openWebsite(urlString: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct TchapAuthenticationLoginScreen: View {
var loginForm: some View {
VStack(spacing: 14) {
// Tchap: Update placeholder and set keyboard type to email address
RoundedBorderTextField(placeHolder: VectorL10n.authenticationVerifyEmailTextFieldPlaceholder,
RoundedBorderTextField(placeHolder: TchapL10n.authenticationMailPlaceholder,
text: $viewModel.username,
isFirstResponder: false,
configuration: UIKitTextInputConfiguration(keyboardType: .emailAddress,
Expand Down Expand Up @@ -124,26 +124,26 @@ struct TchapAuthenticationLoginScreen: View {

var ssoLoginSection: some View {
Group {
// Button AgentConnect
// Button ProConnect
Button(action: submit, label: {
HStack {
Spacer()
Image(uiImage: Asset_tchap.Images.agentConnectIcon.image)
Text(LocalizedStringKey(TchapL10n.authenticationSsoTitle)) // LocalizedStringKey is needed for markdown interpretation.
Image(uiImage: Asset_tchap.Images.proConnectIcon.image)
Text(LocalizedStringKey(TchapL10n.authenticationSsoConnectTitle)) // LocalizedStringKey is needed for markdown interpretation.
.fixedSize(horizontal: false, vertical: true) // .lineLimit(Int.max) doesn't work here.
.foregroundColor(.white)
Spacer()
}
.padding(EdgeInsets(top: 10.0, leading: 16.0, bottom: 10.0, trailing: 16.0))
})
.buttonStyle(AgentConnectButtonStyle(customColor: Color(UIColor(rgb: 0x000091))))
.buttonStyle(ProConnectButtonStyle(customColor: Color(UIColor(rgb: 0x000091))))
.disabled(!viewModel.viewState.canSubmit)
.accessibilityIdentifier("ssoButton")
.padding(.bottom, 8.0)

// Button "What is AgentConnect?"
Button(action: { openAgentConnectWebsite() }, label: {
Text(TchapL10n.welcomeAgentConnectInfo)
// Button "What is ProConnect?"
Button(action: { openProConnectWebsite() }, label: {
Text(TchapL10n.welcomeProConnectInfo)
})
}
}
Expand Down Expand Up @@ -172,8 +172,8 @@ struct TchapAuthenticationLoginScreen: View {

// Then, now that homeServer is known, start authentication flow.
if case .sso = viewModel.viewState.tchapAuthenticationMode,
let agentConnectProvider = userHomeServerViewData.ssoIdentityProviders.first {
viewModel.send(viewAction: .continueWithSSO(agentConnectProvider))
let proConnectProvider = userHomeServerViewData.ssoIdentityProviders.first {
viewModel.send(viewAction: .continueWithSSO(proConnectProvider))
} else {
guard viewModel.viewState.canSubmit else { return }
viewModel.send(viewAction: .next)
Expand Down Expand Up @@ -230,12 +230,12 @@ struct TchapAuthenticationLoginScreen: View {
}
}

func openAgentConnectWebsite() {
TchapWebLinks.openAgentConnectInfo()
func openProConnectWebsite() {
TchapWebLinks.openProConnectInfo()
}
}

struct AgentConnectButtonStyle: ButtonStyle {
struct ProConnectButtonStyle: ButtonStyle {
@Environment(\.theme) private var theme
@Environment(\.isEnabled) private var isEnabled

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ struct TchapOnboardingSplashScreen: View {
HStack { // HStack to center horizontally
Spacer()
VStack {
// Button AgentConnect
// Button ProConnect
Button(action: { viewModel.send(viewAction: .login(.sso(ssoIdentityProviders: []))) }, label: {
HStack {
Image(uiImage: Asset_tchap.Images.agentConnectIcon.image)
Text(LocalizedStringKey(TchapL10n.welcomeAgentConnectTitle)) // LocalizedStringKey is needed for markdown interpretation.
Image(uiImage: Asset_tchap.Images.proConnectIcon.image)
Text(LocalizedStringKey(TchapL10n.welcomeProConnectTitle)) // LocalizedStringKey is needed for markdown interpretation.
.fixedSize(horizontal: false, vertical: true) // .lineLimit(Int.max) doesn't work here.
.foregroundColor(.white)
}
Expand All @@ -108,9 +108,9 @@ struct TchapOnboardingSplashScreen: View {
)
.padding(.bottom, 8.0)

// Button "What is AgentConnect?"
Button(action: { openAgentConnectWebsite() }, label: {
Text(TchapL10n.welcomeAgentConnectInfo)
// Button "What is ProConnect?"
Button(action: { openProConnectWebsite() }, label: {
Text(TchapL10n.welcomeProConnectInfo)
})
.padding(.bottom, 32.0)

Expand Down Expand Up @@ -162,8 +162,8 @@ struct TchapOnboardingSplashScreen: View {
// .readableFrame()
}

func openAgentConnectWebsite() {
TchapWebLinks.openAgentConnectInfo()
func openProConnectWebsite() {
TchapWebLinks.openProConnectInfo()
}
}

Expand Down

0 comments on commit f9e52b6

Please sign in to comment.