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 3 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.

18 changes: 15 additions & 3 deletions Multisig/UI/Settings/MFA/FlowStepViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class FlowStepViewController: UIViewController {
@IBOutlet private weak var titleLabel: UILabel!
@IBOutlet private weak var imageView: UIImageView!
@IBOutlet private weak var actionButton: UIButton!
@IBOutlet weak var learnMoreView: HyperlinkButtonView!
@IBOutlet weak var animationView: LottieAnimationView!
@IBOutlet private weak var descriptionLabel: UILabel!

Expand All @@ -21,17 +22,21 @@ class FlowStepViewController: UIViewController {
private var actionText: String?
private var image: String?
private var animation: String?
private var learnMoreURL: URL?
private var trackingEvent: TrackingEvent?
private var learnMoreTrackingEvent: TrackingEvent?

var onDone: () -> Void = { }
var onAction: () -> Void = { }

convenience init(
titleText: String?,
descriptionText: String?,
actionText: String?,
image: String?,
animation: String?,
learnMoreURL: URL? = nil,
trackingEvent: TrackingEvent? = nil,
learnMoreTrackingEvent: TrackingEvent? = nil,
onDone: @escaping () -> Void
) {
self.init(nibName: nil, bundle: nil)
Expand All @@ -41,7 +46,9 @@ class FlowStepViewController: UIViewController {
self.image = image
self.animation = animation
self.trackingEvent = trackingEvent
self.onDone = onDone
self.learnMoreTrackingEvent = learnMoreTrackingEvent
self.onAction = onDone
self.learnMoreURL = learnMoreURL
}

override func viewDidLoad() {
Expand All @@ -64,6 +71,11 @@ class FlowStepViewController: UIViewController {
}

self.actionButton.setText(actionText, .filled)

learnMoreView.isHidden = learnMoreURL == nil
learnMoreView.setText("Learn more")
learnMoreView.trackingEvent = learnMoreTrackingEvent
learnMoreView.url = learnMoreURL
}

override func viewDidAppear(_ animated: Bool) {
Expand All @@ -74,6 +86,6 @@ class FlowStepViewController: UIViewController {
}

@IBAction private func actionButtonTouched(_ sender: Any) {
onDone()
onAction()
}
}
Loading