Skip to content

Commit 879f084

Browse files
committed
Refactor shouldShowMigrationSuccessCard logic
1 parent c288061 commit 879f084

File tree

4 files changed

+38
-12
lines changed

4 files changed

+38
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Foundation
2+
3+
extension MigrationSuccessCardView {
4+
5+
// TODO: Perhaps this logic should move to another location
6+
@objc static var shouldShowMigrationSuccessCard: Bool {
7+
let migrationCompleted = false // Refactor to UserDefaults.standard.bool("migration-ready")
8+
let wordPressAppExists = MigrationHelper.isWordPressInstalled()
9+
return migrationCompleted && wordPressAppExists
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Foundation
2+
3+
extension MigrationSuccessCardView {
4+
5+
@objc static var shouldShowMigrationSuccessCard: Bool {
6+
// Adding an empty implementation of this variable so Xcode doesn't complain.
7+
// The whole `shouldShowMigrationSuccessCard` shouldn't exist in WordPress. It's only needed for Jetpack.
8+
return false
9+
}
10+
}
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,3 @@ class MigrationSuccessCardView: UIView {
7272
static let descriptionFont = WPStyleGuide.fontForTextStyle(.subheadline, fontWeight: .regular)
7373
}
7474
}
75-
76-
// TODO: This extension is temporary, and should be replaced by the actual condition to check, and placed in the proper location
77-
extension MigrationSuccessCardView {
78-
@objc
79-
static var shouldShowMigrationSuccessCard: Bool {
80-
81-
AppConfiguration.isJetpack && showCard
82-
}
83-
84-
private static let showCard = false
85-
}

WordPress/WordPress.xcodeproj/project.pbxproj

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3396,6 +3396,8 @@
33963396
F465980B28E66A5B00D5F49A /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = F465980628E66A5A00D5F49A /* [email protected] */; };
33973397
F465980C28E66A5B00D5F49A /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = F465980728E66A5B00D5F49A /* [email protected] */; };
33983398
F478B152292FC1BC00AA8645 /* MigrationAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = F478B151292FC1BC00AA8645 /* MigrationAppearance.swift */; };
3399+
F48216CD2931341700EDDD3F /* MigrationSuccessCardView+Jetpack.swift in Sources */ = {isa = PBXBuildFile; fileRef = F48216CC2931341700EDDD3F /* MigrationSuccessCardView+Jetpack.swift */; };
3400+
F48216D02931346900EDDD3F /* MigrationSuccessCardView+WordPress.swift in Sources */ = {isa = PBXBuildFile; fileRef = F48216CF2931346900EDDD3F /* MigrationSuccessCardView+WordPress.swift */; };
33993401
F4BECD1B288EE5220078391A /* SuggestionsViewModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4BECD1A288EE5220078391A /* SuggestionsViewModelType.swift */; };
34003402
F4BECD1C288EE5220078391A /* SuggestionsViewModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4BECD1A288EE5220078391A /* SuggestionsViewModelType.swift */; };
34013403
F4CBE3D429258AE1004FFBB6 /* MeHeaderViewConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FB0ACC292587D500F651F9 /* MeHeaderViewConfiguration.swift */; };
@@ -8547,6 +8549,8 @@
85478549
F465980628E66A5A00D5F49A /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
85488550
F465980728E66A5B00D5F49A /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
85498551
F478B151292FC1BC00AA8645 /* MigrationAppearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MigrationAppearance.swift; sourceTree = "<group>"; };
8552+
F48216CC2931341700EDDD3F /* MigrationSuccessCardView+Jetpack.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MigrationSuccessCardView+Jetpack.swift"; sourceTree = "<group>"; };
8553+
F48216CF2931346900EDDD3F /* MigrationSuccessCardView+WordPress.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MigrationSuccessCardView+WordPress.swift"; sourceTree = "<group>"; };
85508554
F4BECD1A288EE5220078391A /* SuggestionsViewModelType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SuggestionsViewModelType.swift; sourceTree = "<group>"; };
85518555
F4CBE3D329258AD6004FFBB6 /* MeHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MeHeaderView.h; sourceTree = "<group>"; };
85528556
F4CBE3D5292597E3004FFBB6 /* SupportTableViewControllerConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportTableViewControllerConfiguration.swift; sourceTree = "<group>"; };
@@ -10798,9 +10802,9 @@
1079810802
3F8B459E29283D3800730FA4 /* Success card */ = {
1079910803
isa = PBXGroup;
1080010804
children = (
10805+
F48216CE2931342D00EDDD3F /* Migration Success Card */,
1080110806
F4D8296E2931092800038726 /* Collection View */,
1080210807
F4D8296D2931091B00038726 /* Table View */,
10803-
3F8B45A6292C1A2300730FA4 /* MigrationSuccessCardView.swift */,
1080410808
F4D829672931059000038726 /* MigrationSuccessActionHandler.swift */,
1080510809
);
1080610810
path = "Success card";
@@ -16551,6 +16555,16 @@
1655116555
path = "white-on-pink";
1655216556
sourceTree = "<group>";
1655316557
};
16558+
F48216CE2931342D00EDDD3F /* Migration Success Card */ = {
16559+
isa = PBXGroup;
16560+
children = (
16561+
3F8B45A6292C1A2300730FA4 /* MigrationSuccessCardView.swift */,
16562+
F48216CC2931341700EDDD3F /* MigrationSuccessCardView+Jetpack.swift */,
16563+
F48216CF2931346900EDDD3F /* MigrationSuccessCardView+WordPress.swift */,
16564+
);
16565+
path = "Migration Success Card";
16566+
sourceTree = "<group>";
16567+
};
1655416568
F4D829602930E9DD00038726 /* Delete WordPress */ = {
1655516569
isa = PBXGroup;
1655616570
children = (
@@ -20470,6 +20484,7 @@
2047020484
FA73D7E927987BA500DF24B3 /* SitePickerViewController+SiteIcon.swift in Sources */,
2047120485
E125445612BF5B3900D87A0A /* PostCategory.m in Sources */,
2047220486
08C388661ED7705E0057BE49 /* MediaAssetExporter.swift in Sources */,
20487+
F48216D02931346900EDDD3F /* MigrationSuccessCardView+WordPress.swift in Sources */,
2047320488
E6C892D61C601D55007AD612 /* SharingButtonsViewController.swift in Sources */,
2047420489
F115308121B17E66002F1D65 /* EditorFactory.swift in Sources */,
2047520490
982DDF92263238A6002B3904 /* LikeUser+CoreDataProperties.swift in Sources */,
@@ -23237,6 +23252,7 @@
2323723252
FABB23382602FC2C00C8785C /* WordPress-22-23.xcmappingmodel in Sources */,
2323823253
FABB23392602FC2C00C8785C /* CountriesMap.swift in Sources */,
2323923254
98BC522527F6245700D6E8C2 /* BloggingPromptsFeatureIntroduction.swift in Sources */,
23255+
F48216CD2931341700EDDD3F /* MigrationSuccessCardView+Jetpack.swift in Sources */,
2324023256
FABB233A2602FC2C00C8785C /* RevisionsNavigationController.swift in Sources */,
2324123257
FE3D058426C419C7002A51B0 /* ShareAppContentPresenter+TableView.swift in Sources */,
2324223258
FABB233B2602FC2C00C8785C /* AnnualAndMostPopularTimeStatsRecordValue+CoreDataClass.swift in Sources */,

0 commit comments

Comments
 (0)