Skip to content
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

Gh 3293/update safe settings #3304

Merged
merged 5 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 64 additions & 20 deletions Multisig.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "ico-checkmark.pdf",
"filename" : "Check.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.941",
"green" : "0.937",
"red" : "0.933"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.200",
"green" : "0.188",
"red" : "0.188"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "ill-lock.pdf",
"filename" : "ill-security.pdf",
"idiom" : "universal"
},
{
Expand All @@ -11,7 +11,7 @@
"value" : "dark"
}
],
"filename" : "ill-lock (1).pdf",
"filename" : "Image.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Binary file not shown.
21 changes: 21 additions & 0 deletions Multisig/Assets.xcassets/ico-account-secure.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "Image (1).pdf",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Binary file not shown.
15 changes: 15 additions & 0 deletions Multisig/Assets.xcassets/ico-emptymark-off.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Check (1).pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
22 changes: 22 additions & 0 deletions Multisig/Assets.xcassets/ico-shield.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "Shield.pdf",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "Shield 1.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "ill-multis-lock.pdf",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "ill-multis-lock-dark.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "ill-recovery-shield.pdf",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "ill-recovery-shield-dark.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Binary file not shown.
21 changes: 20 additions & 1 deletion Multisig/Logic/Models/Safe.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ extension Safe {
}
}

// TODO: Imporve conditions
var security: SafeSecurityStatus {
return .medium
}

var walletConnectSessiontopics: [String] {
guard let topics = sessionTopics else { return [] }
return topics.components(separatedBy: " ")
Expand Down Expand Up @@ -203,7 +208,7 @@ extension Safe {

static func removeSession(topic: String) {
Safe.all.forEach{
var topics = $0.walletConnectSessiontopics
let topics = $0.walletConnectSessiontopics
if topics.contains(topic) {
$0.sessionTopics = topics.filter { $0 != topic }.joined(separator: " ")
}
Expand Down Expand Up @@ -323,3 +328,17 @@ enum SafeStatus: Int16 {
case deploymentFailed = 2
case indexing = 3
}

enum SafeSecurityStatus: Int16 {
case medium = 0
case high = 1

var color: UIColor {
switch self {
case .medium:
return .warning
case .high:
return .success
}
}
}
99 changes: 0 additions & 99 deletions Multisig/UI/Settings/MFA/CreatePasswordFlow.swift

This file was deleted.

4 changes: 3 additions & 1 deletion Multisig/UI/Settings/MFA/CreatePasswordViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class CreatePasswordViewController: UIViewController {
@IBOutlet private weak var passwordInputField: PasswordInputField!
@IBOutlet private weak var confirmPasswordField: PasswordInputField!

@IBOutlet weak var titleLabel: UILabel!
private var keyboardBehavior: KeyboardAvoidingBehavior!
var onDone: (String) -> Void = { _ in }

Expand All @@ -29,7 +30,8 @@ class CreatePasswordViewController: UIViewController {
super.viewDidLoad()

title = "Create password"


titleLabel.setStyle(.body)
keyboardBehavior = KeyboardAvoidingBehavior(scrollView: scrollView)
createButton.setText("Set password", .filled)

Expand Down
16 changes: 13 additions & 3 deletions Multisig/UI/Settings/MFA/CreatePasswordViewController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<outlet property="createButton" destination="d2j-Ll-pLv" id="eKt-4l-a5S"/>
<outlet property="passwordInputField" destination="ACE-Px-qwv" id="vz0-ir-0MQ"/>
<outlet property="scrollView" destination="HpT-nx-Gir" id="JdR-ZH-nDo"/>
<outlet property="titleLabel" destination="BoR-1C-g0Z" id="MPz-VS-HdX"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
Expand All @@ -29,6 +30,12 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ML5-g0-Qy6">
<rect key="frame" x="0.0" y="0.0" width="393" height="759"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="This password will be used to access your social key and serve as a recovery factor." textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BoR-1C-g0Z">
<rect key="frame" x="16" y="15.999999999999996" width="361" height="40.666666666666657"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="d2j-Ll-pLv">
<rect key="frame" x="16" y="687" width="361" height="56"/>
<constraints>
Expand All @@ -44,7 +51,7 @@
</connections>
</button>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="HCL-KO-Acg">
<rect key="frame" x="16" y="16" width="361" height="256"/>
<rect key="frame" x="16" y="72.666666666666657" width="361" height="255.99999999999997"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ACE-Px-qwv" customClass="PasswordInputField" customModule="Multisig" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="361" height="120"/>
Expand All @@ -54,7 +61,7 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="r6o-n9-k7f" customClass="PasswordInputField" customModule="Multisig" customModuleProvider="target">
<rect key="frame" x="0.0" y="136" width="361" height="120"/>
<rect key="frame" x="0.0" y="136.00000000000003" width="361" height="119.99999999999997"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</subviews>
Expand All @@ -63,11 +70,14 @@
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="d2j-Ll-pLv" secondAttribute="bottom" constant="16" id="EjS-rK-DOd"/>
<constraint firstItem="BoR-1C-g0Z" firstAttribute="leading" secondItem="ML5-g0-Qy6" secondAttribute="leading" constant="16" id="GkV-1B-Ggp"/>
<constraint firstItem="HCL-KO-Acg" firstAttribute="top" secondItem="BoR-1C-g0Z" secondAttribute="bottom" constant="16" id="Ilp-6r-02G"/>
<constraint firstItem="BoR-1C-g0Z" firstAttribute="top" secondItem="ML5-g0-Qy6" secondAttribute="top" constant="16" id="RqX-PQ-bek"/>
<constraint firstItem="d2j-Ll-pLv" firstAttribute="leading" secondItem="ML5-g0-Qy6" secondAttribute="leading" constant="16" id="Ygs-5g-BD2"/>
<constraint firstItem="HCL-KO-Acg" firstAttribute="leading" secondItem="ML5-g0-Qy6" secondAttribute="leading" constant="16" id="bSc-Pi-TgO"/>
<constraint firstAttribute="trailing" secondItem="d2j-Ll-pLv" secondAttribute="trailing" constant="16" id="hUm-Jd-xqR"/>
<constraint firstItem="HCL-KO-Acg" firstAttribute="top" secondItem="ML5-g0-Qy6" secondAttribute="top" constant="16" id="kCS-2V-8wb"/>
<constraint firstAttribute="trailing" secondItem="HCL-KO-Acg" secondAttribute="trailing" constant="16" id="npH-sq-BtC"/>
<constraint firstAttribute="trailing" secondItem="BoR-1C-g0Z" secondAttribute="trailing" constant="16" id="xfw-Lj-Ffc"/>
</constraints>
</view>
</subviews>
Expand Down
Loading