Skip to content

Commit

Permalink
Remove Google domains promotional card from the dashboard (#22216)
Browse files Browse the repository at this point in the history
  • Loading branch information
hassaanelgarem authored Dec 19, 2023
2 parents 570ecfd + 860bda0 commit fa1fd85
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
10 changes: 5 additions & 5 deletions WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enum FeatureFlag: Int, CaseIterable {
case personalizeHomeTab
case commentModerationUpdate
case compliancePopover
case domainFocus
case googleDomainsCard

/// Returns a boolean indicating if the feature is enabled
var enabled: Bool {
Expand All @@ -38,8 +38,8 @@ enum FeatureFlag: Int, CaseIterable {
return false
case .compliancePopover:
return true
case .domainFocus:
return true
case .googleDomainsCard:
return false
}
}

Expand Down Expand Up @@ -80,8 +80,8 @@ extension FeatureFlag {
return "Comments Moderation Update"
case .compliancePopover:
return "Compliance Popover"
case .domainFocus:
return "Domain Focus"
case .googleDomainsCard:
return "Google Domains Promotional Card"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ enum DashboardCard: String, CaseIterable {
case .jetpackSocial:
return DashboardJetpackSocialCardCell.shouldShowCard(for: blog)
case .googleDomains:
return FeatureFlag.domainFocus.enabled && isJetpack
return FeatureFlag.googleDomainsCard.enabled && isJetpack
}
}

Expand Down
9 changes: 8 additions & 1 deletion WordPress/UITestsFoundation/XCUIElement+Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ public extension XCUIElement {

let deviceScreenFrame = app.windows.element(boundBy: 0).frame
let deviceScreenWidth = deviceScreenFrame.size.width
let visibleAreaTop = topElement.frame.origin.y + topElement.frame.size.height
let visibleAreaTop: CGFloat

if topElement.exists {
visibleAreaTop = topElement.frame.origin.y + topElement.frame.size.height
} else {
visibleAreaTop = deviceScreenFrame.origin.y
}

let visibleAreaHeight = bottomElement.frame.origin.y - visibleAreaTop
let visibleAreaFrame = CGRect(x: 0, y: visibleAreaTop, width: deviceScreenWidth, height: visibleAreaHeight)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class BlogDashboardServiceTests: CoreDataTestCase {
try? featureFlags.override(FeatureFlag.personalizeHomeTab, withValue: true)
try? featureFlags.override(RemoteFeatureFlag.activityLogDashboardCard, withValue: true)
try? featureFlags.override(RemoteFeatureFlag.pagesDashboardCard, withValue: true)
try? featureFlags.override(FeatureFlag.domainFocus, withValue: false)
try? featureFlags.override(FeatureFlag.googleDomainsCard, withValue: false)
}

override func tearDown() {
Expand All @@ -65,7 +65,7 @@ class BlogDashboardServiceTests: CoreDataTestCase {
try? featureFlags.override(FeatureFlag.personalizeHomeTab, withValue: FeatureFlag.personalizeHomeTab.originalValue)
try? featureFlags.override(RemoteFeatureFlag.activityLogDashboardCard, withValue: RemoteFeatureFlag.activityLogDashboardCard.originalValue)
try? featureFlags.override(RemoteFeatureFlag.pagesDashboardCard, withValue: RemoteFeatureFlag.pagesDashboardCard.originalValue)
try? featureFlags.override(FeatureFlag.domainFocus, withValue: FeatureFlag.domainFocus.originalValue)
try? featureFlags.override(FeatureFlag.googleDomainsCard, withValue: FeatureFlag.googleDomainsCard.originalValue)
}

func testCallServiceWithCorrectIDAndCards() {
Expand Down

0 comments on commit fa1fd85

Please sign in to comment.