forked from wordpress-mobile/WordPress-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor ordering of steps and update tests.
- Loading branch information
Showing
11 changed files
with
247 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
WordPress/Classes/ViewRelated/Site Creation/Wizard/SiteCreationWizardStepInvoker.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Foundation | ||
|
||
/// Responsible for initialization and invocation of WizardSteps | ||
protocol SiteCreationWizardStepInvoker { | ||
var segmentsStep: WizardStep { get } | ||
var intentStep: WizardStep { get } | ||
var nameStep: WizardStep { get } | ||
var designStep: WizardStep { get } | ||
var addressStep: WizardStep { get } | ||
var siteAssemblyStep: WizardStep { get } | ||
} |
42 changes: 42 additions & 0 deletions
42
WordPress/Classes/ViewRelated/Site Creation/Wizard/SiteCreationWizardStepOrderer.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import Foundation | ||
import AutomatticTracks | ||
|
||
struct SiteCreationWizardStepOrderer { | ||
let stepInvoker: SiteCreationWizardStepInvoker | ||
let siteIntentVariant: SiteIntentAB.Variant | ||
let siteNameVariant: Variation | ||
|
||
private var shouldShowSiteIntent: Bool { | ||
return siteIntentVariant == .treatment && FeatureFlag.siteIntentQuestion.enabled | ||
} | ||
|
||
private var shouldShowSiteName: Bool { | ||
return siteNameVariant == .treatment(nil) && FeatureFlag.siteName.enabled | ||
} | ||
|
||
lazy var steps: [WizardStep] = { | ||
guard shouldShowSiteIntent else { | ||
return [ | ||
stepInvoker.designStep, | ||
stepInvoker.addressStep, | ||
stepInvoker.siteAssemblyStep | ||
] | ||
} | ||
|
||
guard shouldShowSiteName else { | ||
return [ | ||
stepInvoker.intentStep, | ||
stepInvoker.designStep, | ||
stepInvoker.addressStep, | ||
stepInvoker.siteAssemblyStep | ||
] | ||
} | ||
|
||
return [ | ||
stepInvoker.intentStep, | ||
stepInvoker.nameStep, | ||
stepInvoker.designStep, | ||
stepInvoker.siteAssemblyStep | ||
] | ||
}() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 0 additions & 53 deletions
53
WordPress/WordPressTest/SiteCreation/SiteCreationIntentTests.swift
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.