Skip to content

Commit

Permalink
Merge pull request #1113 from tchapgouv/1105-faciliter-lacces-a-laide…
Browse files Browse the repository at this point in the history
…-sur-la-verification-dappareil

Faciliter l'accès à l'aide sur la vérification d'appareil
  • Loading branch information
NicolasBuquet authored Nov 6, 2024
2 parents 13eddad + e1aca27 commit 92e9a73
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="79A-qb-tmk">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="79A-qb-tmk">
<device id="retina5_9" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -21,10 +21,10 @@
<rect key="frame" x="0.0" y="50" width="375" height="728"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tIM-sl-gwE">
<rect key="frame" x="0.0" y="0.0" width="375" height="750.33333333333337"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="780.33333333333337"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IlB-Ch-LEo">
<rect key="frame" x="0.0" y="0.0" width="375" height="750.33333333333337"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="780.33333333333337"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Open Element on your other device" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="aOD-RJ-1qU">
<rect key="frame" x="20" y="20" width="335" height="67"/>
Expand Down Expand Up @@ -77,7 +77,7 @@ Open Element on one of your other devices and follow the instructions.</string>
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="8oJ-o6-DLK">
<rect key="frame" x="20" y="373" width="335" height="377.33333333333326"/>
<rect key="frame" x="20" y="373" width="335" height="407.33333333333326"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dXT-cL-ukJ">
<rect key="frame" x="0.0" y="0.0" width="335" height="114.66666666666667"/>
Expand Down Expand Up @@ -174,6 +174,12 @@ Try to activate crss-signing in Parameters.</string>
<constraint firstAttribute="trailing" secondItem="27d-sP-XVc" secondAttribute="trailing" constant="20" id="v94-eP-kiY"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6pg-ut-LHk">
<rect key="frame" x="0.0" y="377.33333333333337" width="335" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Quick Help Access"/>
</button>
</subviews>
<constraints>
<constraint firstItem="nf8-Ye-b9r" firstAttribute="width" secondItem="8oJ-o6-DLK" secondAttribute="width" id="ZNi-0G-uDR"/>
Expand Down Expand Up @@ -241,6 +247,7 @@ Try to activate crss-signing in Parameters.</string>
<outlet property="tchapNoRecoverSecretsMethodAvailableButton" destination="Zfz-WA-gr6" id="mEa-8G-uh7"/>
<outlet property="tchapNoRecoverSecretsMethodAvailableContainerView" destination="ASw-ZP-05G" id="sc4-0O-9Up"/>
<outlet property="tchapNoRecoverSecretsMethodAvailableInformationLabel" destination="27d-sP-XVc" id="lKw-4U-MPi"/>
<outlet property="tchapQuickHelpButton" destination="6pg-ut-LHk" id="gYN-0x-a7Q"/>
<outlet property="titleLabel" destination="aOD-RJ-1qU" id="qvC-fk-TiU"/>
</connections>
</viewController>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ final class KeyVerificationSelfVerifyWaitViewController: UIViewController {
@IBOutlet weak var tchapNoRecoverSecretsMethodAvailableInformationLabel: UILabel!
@IBOutlet weak var tchapNoRecoverSecretsMethodAvailableButton: RoundedButton!

// Tchap: Quick access to Help FAQ specific article
@IBOutlet weak var tchapQuickHelpButton: UIButton!

// MARK: Private

private var viewModel: KeyVerificationSelfVerifyWaitViewModelType!
Expand Down Expand Up @@ -142,10 +145,24 @@ final class KeyVerificationSelfVerifyWaitViewController: UIViewController {

self.desktopClientImageView.image = Asset.Images.monitor.image.withRenderingMode(.alwaysTemplate)
self.mobileClientImageView.image = Asset.Images.smartphone.image.withRenderingMode(.alwaysTemplate)

self.recoverSecretsAdditionalInformationLabel.text = VectorL10n.deviceVerificationSelfVerifyWaitRecoverSecretsAdditionalHelp(AppInfo.current.displayName)

// Tchap: configure Help button
self.tchapSetupHelpButton()
}

// Tchap: configure Help button
private func tchapSetupHelpButton() {
let helpAttributedString = NSMutableAttributedString(string: TchapL10n.deviceVerificationHelpLabel, attributes: [.foregroundColor: self.theme.warningColor])

self.tchapQuickHelpButton.setAttributedTitle(helpAttributedString, for: .normal)

self.tchapQuickHelpButton.vc_addAction {
self.tchapHelpButtonAction()
}
}

private func render(viewState: KeyVerificationSelfVerifyWaitViewState) {
switch viewState {
case .loading:
Expand Down Expand Up @@ -251,6 +268,11 @@ final class KeyVerificationSelfVerifyWaitViewController: UIViewController {
@IBAction private func recoverSecretsButtonAction(_ sender: Any) {
self.viewModel.process(viewAction: .recoverSecrets)
}

// Tchap: Help button action
private func tchapHelpButtonAction() {
self.present(WebSheetViewController(targetUrl: URL(string: "https://aide.tchap.beta.gouv.fr/fr/article/comment-verifier-un-nouvel-appareil-sur-tchap-xm0b0y/")!), animated: true)
}
}


Expand Down
1 change: 1 addition & 0 deletions Tchap/Assets/Localizations/fr.lproj/Tchap.strings
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@
// MARK: Device Verification
"device_verification_title" = "Vérifier l’appareil";
"device_verification_verified_description" = "Vous avez bien vérifié cet appareil.\n\nLe partage des clés va s'effectuer progressivement. Les messages se déchiffreront au fur à mesure. Cela peut prendre quelques minutes.";
"device_verification_help_label" = "Obtenir de l'aide";

////////////////////////////////////////////////////////////////////////////////
// MARK: Favourite messages screen
Expand Down
1 change: 1 addition & 0 deletions changelog.d/1105.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Faciliter l'accès à l'aide sur la vérification d'appareil

0 comments on commit 92e9a73

Please sign in to comment.