-
Notifications
You must be signed in to change notification settings - Fork 106
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
[#172526356] Adds Screen to explain why CIE login is not available #1769
Changes from 13 commits
d6ae4e0
4e278b1
786a2f9
a635a86
8dd4db0
bec700c
3f4942f
c5de974
05798b8
f7deed5
d5b26f8
66da00d
4451d59
a59ef20
6533ccb
2aa5125
b9360fb
b2ea415
8ad80c1
e9d8632
7e69c33
18a18de
3c88387
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
To login you need to have a device with NFC technology or a device compatible with the current implementation (iOS devices are not yet compatible but will soon become compatible with the new update). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Specifically, the cases in which you **cannot** access with an Electronic Identity Card (CIE) on your Android device are: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Per effettuare il login è necessario avere un dispositivo con tecnologia NFC o un dispositivo compatibile con l’attuale implementazione (i dispositivi iOS non sono ancora compatibili ma a breve lo diventeranno con i prossimi aggiornamenti). | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Nello specifico, i casi in cui **non** è possibile accedere con Carta di Identità Elettronica (CIE) su dispositivo Android sono: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { Body, List, ListItem, Text, View } from "native-base"; | ||
import * as React from "react"; | ||
import { Platform } from "react-native"; | ||
import I18n from "../../i18n"; | ||
import customVariables from "../../theme/variables"; | ||
import IconFont from "../ui/IconFont"; | ||
import Markdown from "../ui/Markdown"; | ||
|
||
type Props = { | ||
hasCieApiLevelSupport: boolean; | ||
hasCieNFCFeature: boolean; | ||
}; | ||
|
||
const CieNotSupported: React.FunctionComponent<Props> = props => { | ||
return ( | ||
<React.Fragment> | ||
<Markdown> | ||
{I18n.t("authentication.landing.cie_unsupported.body")} | ||
</Markdown> | ||
{Platform.OS === "android" && ( | ||
<React.Fragment> | ||
<View spacer={true} /> | ||
<Markdown> | ||
{I18n.t("authentication.landing.cie_unsupported.android_desc")} | ||
</Markdown> | ||
<View spacer={true} extralarge={true} /> | ||
<List> | ||
<ListItem> | ||
<IconFont | ||
name="io-tick-big" | ||
size={16} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid magic number There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 6533ccb |
||
color={ | ||
props.hasCieApiLevelSupport | ||
? customVariables.brandLightGray | ||
: customVariables.contentPrimaryBackground | ||
} | ||
/> | ||
<Body> | ||
<Text> | ||
{I18n.t( | ||
"authentication.landing.cie_unsupported.os_version_unsupported" | ||
)} | ||
</Text> | ||
</Body> | ||
</ListItem> | ||
<ListItem> | ||
<IconFont | ||
name="io-tick-big" | ||
size={16} | ||
color={ | ||
props.hasCieNFCFeature | ||
? customVariables.brandLightGray | ||
: customVariables.contentPrimaryBackground | ||
} | ||
/> | ||
<Body> | ||
<Text> | ||
{I18n.t( | ||
"authentication.landing.cie_unsupported.nfc_incompatible" | ||
)} | ||
</Text> | ||
</Body> | ||
</ListItem> | ||
</List> | ||
</React.Fragment> | ||
)} | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
export default CieNotSupported; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,17 @@ import { StyleSheet } from "react-native"; | |
import { NavigationInjectedProps } from "react-navigation"; | ||
import { connect } from "react-redux"; | ||
import ButtonDefaultOpacity from "../../components/ButtonDefaultOpacity"; | ||
import CieNotSupported from "../../components/cie/CieNotSupported"; | ||
import { ContextualHelp } from "../../components/ContextualHelp"; | ||
import { DevScreenButton } from "../../components/DevScreenButton"; | ||
import { withLightModalContext } from "../../components/helpers/withLightModalContext"; | ||
import { HorizontalScroll } from "../../components/HorizontalScroll"; | ||
import { LandingCardComponent } from "../../components/LandingCardComponent"; | ||
import BaseScreenComponent, { | ||
ContextualHelpPropsMarkdown | ||
} from "../../components/screens/BaseScreenComponent"; | ||
import IconFont from "../../components/ui/IconFont"; | ||
import { LightModalContextInterface } from "../../components/ui/LightModal"; | ||
import I18n from "../../i18n"; | ||
import { IdentityProvider } from "../../models/IdentityProvider"; | ||
import ROUTES from "../../navigation/routes"; | ||
|
@@ -25,14 +29,19 @@ import { | |
} from "../../store/actions/authentication"; | ||
import { Dispatch } from "../../store/actions/types"; | ||
import { isSessionExpiredSelector } from "../../store/reducers/authentication"; | ||
import { isCieSupportedSelector } from "../../store/reducers/cie"; | ||
import { | ||
hasApiLevelSupportSelector, | ||
hasNFCFeatureSelector, | ||
isCieSupportedSelector | ||
} from "../../store/reducers/cie"; | ||
import { GlobalState } from "../../store/reducers/types"; | ||
import variables from "../../theme/variables"; | ||
import { ComponentProps } from "../../types/react"; | ||
import { isDevEnv } from "../../utils/environment"; | ||
import { showToast } from "../../utils/showToast"; | ||
|
||
type Props = NavigationInjectedProps & | ||
LightModalContextInterface & | ||
ReturnType<typeof mapStateToProps> & | ||
ReturnType<typeof mapDispatchToProps>; | ||
|
||
|
@@ -89,6 +98,12 @@ const styles = StyleSheet.create({ | |
}, | ||
flex: { | ||
flex: 1 | ||
}, | ||
noCie: { | ||
opacity: 0.35 | ||
}, | ||
checkboxBackground: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to be not used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 6533ccb |
||
backgroundColor: "#0073E6" | ||
} | ||
}); | ||
|
||
|
@@ -120,15 +135,34 @@ class LandingScreen extends React.PureComponent<Props> { | |
} | ||
} | ||
|
||
private openUnsupportedCIEModal = () => { | ||
this.props.showAnimatedModal( | ||
<ContextualHelp | ||
onClose={this.props.hideModal} | ||
title={I18n.t("authentication.landing.cie_unsupported.title")} | ||
body={() => ( | ||
<CieNotSupported | ||
hasCieApiLevelSupport={this.props.hasCieApiLevelSupport} | ||
hasCieNFCFeature={this.props.hasCieNFCFeature} | ||
/> | ||
)} | ||
/> | ||
); | ||
}; | ||
|
||
private navigateToMarkdown = () => | ||
this.props.navigation.navigate(ROUTES.MARKDOWN); | ||
|
||
private navigateToIdpSelection = () => | ||
this.props.navigation.navigate(ROUTES.AUTHENTICATION_IDP_SELECTION); | ||
|
||
private navigateToCiePinScreen = () => { | ||
this.props.dispatchIdpCieSelected(); | ||
this.props.navigation.navigate(ROUTES.CIE_PIN_SCREEN); | ||
if (this.props.isCieSupported) { | ||
this.props.dispatchIdpCieSelected(); | ||
this.props.navigation.navigate(ROUTES.CIE_PIN_SCREEN); | ||
} else { | ||
this.openUnsupportedCIEModal(); | ||
} | ||
}; | ||
|
||
private navigateToSpidCieInformationRequest = () => | ||
|
@@ -162,19 +196,6 @@ class LandingScreen extends React.PureComponent<Props> { | |
</Content> | ||
|
||
<View footer={true}> | ||
{this.props.isCieSupported && ( | ||
<ButtonDefaultOpacity | ||
block={true} | ||
primary={true} | ||
iconLeft={true} | ||
onPress={this.navigateToCiePinScreen} | ||
testID={"landing-button-login-cie"} | ||
> | ||
<IconFont name={"io-cie"} color={variables.colorWhite} /> | ||
<Text>{I18n.t("authentication.landing.loginCie")}</Text> | ||
</ButtonDefaultOpacity> | ||
)} | ||
<View spacer={true} /> | ||
<ButtonDefaultOpacity | ||
block={true} | ||
primary={true} | ||
|
@@ -186,6 +207,18 @@ class LandingScreen extends React.PureComponent<Props> { | |
<Text>{I18n.t("authentication.landing.loginSpid")}</Text> | ||
</ButtonDefaultOpacity> | ||
<View spacer={true} /> | ||
<ButtonDefaultOpacity | ||
style={!this.props.isCieSupported ? styles.noCie : undefined} | ||
block={true} | ||
primary={true} | ||
iconLeft={true} | ||
onPress={this.navigateToCiePinScreen} | ||
testID={"landing-button-login-cie"} | ||
> | ||
<IconFont name={"io-cie"} color={variables.colorWhite} /> | ||
<Text>{I18n.t("authentication.landing.loginCie")}</Text> | ||
</ButtonDefaultOpacity> | ||
<View spacer={true} /> | ||
<ButtonDefaultOpacity | ||
block={true} | ||
small={true} | ||
|
@@ -206,9 +239,13 @@ class LandingScreen extends React.PureComponent<Props> { | |
|
||
const mapStateToProps = (state: GlobalState) => { | ||
const isCIEAuthenticationSupported = isCieSupportedSelector(state); | ||
const hasApiLevelSupport = hasApiLevelSupportSelector(state); | ||
const hasNFCFeature = hasNFCFeatureSelector(state); | ||
return { | ||
isSessionExpired: isSessionExpiredSelector(state), | ||
isCieSupported: pot.getOrElse(isCIEAuthenticationSupported, false) | ||
isCieSupported: pot.getOrElse(isCIEAuthenticationSupported, false), | ||
hasCieApiLevelSupport: pot.getOrElse(hasApiLevelSupport, false), | ||
hasCieNFCFeature: pot.getOrElse(hasNFCFeature, false) | ||
}; | ||
}; | ||
|
||
|
@@ -220,4 +257,4 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({ | |
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps | ||
)(LandingScreen); | ||
)(withLightModalContext(LandingScreen)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description, in the way we proposed, doesn't make sense