Skip to content

Commit 54f2a1b

Browse files
authored
Enable FFs for 26.4 (#24906)
* Enable FFs * Fix onAppear not called in PublishPostView * Add intelligence to experimental features * Fix incorrect XCTSkip usage and update testTextPostPublish * Update testCreateScheduledPost and bring back date and visibility fields
1 parent d543ee6 commit 54f2a1b

File tree

7 files changed

+29
-36
lines changed

7 files changed

+29
-36
lines changed

Modules/Sources/UITestsFoundation/Screens/Editor/PrepublishingSheetScreen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class PrepublishingSheetScreen: ScreenObject {
1212
}
1313

1414
private let publishDateButtonGetter: (XCUIApplication) -> XCUIElement = {
15-
$0.staticTexts["Publish Date"]
15+
$0.staticTexts["Date"]
1616
}
1717

1818
private let closeButtonGetter: (XCUIApplication) -> XCUIElement = {

Tests/KeystoneTests/Tests/Services/AccountSettingsServiceTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class AccountSettingsServiceTests: CoreDataTestCase {
6262
}
6363

6464
func testCancelGettingSettings() throws {
65-
XCTSkip("Flaky")
65+
throw XCTSkip("Flaky")
6666

6767
// This test performs steps described in the link below to reproduce a crash.
6868
// https://github.com/wordpress-mobile/WordPress-iOS/issues/20379#issuecomment-1481995663

WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ public enum FeatureFlag: Int, CaseIterable {
8686
case .newStats:
8787
return false
8888
case .newPublishingSheet:
89-
return false
89+
return true
9090
case .mediaQuotaView:
9191
return false
9292
case .intelligence:
93-
return BuildConfiguration.current == .debug
93+
let languageCode = Locale.current.languageCode
94+
return (languageCode ?? "en").hasPrefix("en")
9495
}
9596
}
9697

WordPress/Classes/ViewRelated/Me/App Settings/ExperimentalFeaturesDataProvider.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import SwiftUI
66
class ExperimentalFeaturesDataProvider: ExperimentalFeaturesViewModel.DataProvider {
77

88
let flags: [OverridableFlag] = [
9+
FeatureFlag.intelligence,
10+
FeatureFlag.newStats,
911
FeatureFlag.allowApplicationPasswords,
1012
RemoteFeatureFlag.newGutenberg,
11-
FeatureFlag.newGutenbergThemeStyles,
12-
FeatureFlag.newStats,
13+
FeatureFlag.newGutenbergThemeStyles
1314
]
1415

1516
private let flagStore = FeatureFlagOverrideStore()

WordPress/Classes/ViewRelated/Post/PostSettings/PostSettingsView.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ struct PostSettingsFormContentView: View {
134134
@ObservedObject var viewModel: PostSettingsViewModel
135135

136136
var body: some View {
137+
if viewModel.context == .publishing {
138+
publishingOptionsSection
139+
}
137140
featuredImageSection
138141
if viewModel.isPost {
139142
organizationSection
@@ -149,12 +152,11 @@ struct PostSettingsFormContentView: View {
149152
@ViewBuilder
150153
private var publishingOptionsSection: some View {
151154
Section {
155+
BlogListSiteView(site: .init(blog: viewModel.post.blog))
152156
publishDateRow
153157
visibilityRow
154158
} header: {
155-
BlogListSiteView(site: .init(blog: viewModel.post.blog))
156-
.padding(.bottom, 8)
157-
.foregroundStyle(.primary)
159+
SectionHeader(Strings.readyToPublish)
158160
}
159161
}
160162

@@ -626,4 +628,10 @@ private enum Strings {
626628
value: "Social Sharing",
627629
comment: "Label for the preview button in Post Settings"
628630
)
631+
632+
static let readyToPublish = NSLocalizedString(
633+
"prepublishing.publishingSectionTitle",
634+
value: "Ready to Publish?",
635+
comment: "The title of the top section that shows the site your are publishing to. Default is 'Ready to Publish?'"
636+
)
629637
}

WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController+Helpers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extension PrepublishingViewController {
1717
// - warning: Has to be UIKit because some of the `PostSettingsView` rows rely on it.
1818
let navigationVC = UINavigationController(rootViewController: publishVC)
1919
navigationVC.sheetPresentationController?.detents = [
20-
.custom(identifier: .medium, resolver: { context in 460 }),
20+
.custom(identifier: .medium, resolver: { context in 526 }),
2121
.large()
2222
]
2323
presentingViewController.present(navigationVC, animated: true)

WordPress/Classes/ViewRelated/Post/Publishing/PublishPostViewController.swift

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,20 @@ struct PublishPostView: View {
5858

5959
var body: some View {
6060
Form {
61-
Section {
62-
if let state = uploadsViewModel.uploadingSnackbarState {
63-
NavigationLink {
64-
PostMediaUploadsView(viewModel: uploadsViewModel)
65-
} label: {
66-
PostMediaUploadsSnackbarView(state: state)
67-
}
61+
if let state = uploadsViewModel.uploadingSnackbarState {
62+
NavigationLink {
63+
PostMediaUploadsView(viewModel: uploadsViewModel)
64+
} label: {
65+
PostMediaUploadsSnackbarView(state: state)
6866
}
69-
BlogListSiteView(site: .init(blog: viewModel.post.blog))
70-
} header: {
71-
SectionHeader(Strings.readyToPublish)
7267
}
7368
PostSettingsFormContentView(viewModel: viewModel)
7469
}
7570
.environment(\.defaultMinListHeaderHeight, 0) // Reduces top inset a bit
7671
.navigationBarTitleDisplayMode(.inline)
72+
.onAppear {
73+
viewModel.onAppear()
74+
}
7775
.toolbar {
7876
ToolbarItem(placement: .topBarLeading) {
7977
buttonCancel
@@ -91,7 +89,6 @@ struct PublishPostView: View {
9189
}
9290
}
9391
ToolbarItemGroup(placement: .topBarTrailing) {
94-
buttonSchedule
9592
buttonPublish
9693
}
9794
}
@@ -126,15 +123,6 @@ struct PublishPostView: View {
126123
}
127124
}
128125

129-
@ViewBuilder
130-
private var buttonSchedule: some View {
131-
NavigationLink {
132-
PostSettingsPublishDatePicker(viewModel: viewModel)
133-
} label: {
134-
Image(systemName: "calendar")
135-
}
136-
}
137-
138126
@ViewBuilder
139127
private var buttonPublish: some View {
140128
if viewModel.isSaving {
@@ -150,6 +138,7 @@ struct PublishPostView: View {
150138
.buttonBorderShape(.capsule)
151139
.tint(isDisabled ? Color(.opaqueSeparator) : AppColor.primary)
152140
.disabled(isDisabled)
141+
.accessibilityIdentifier("publish")
153142
}
154143
}
155144
}
@@ -206,10 +195,4 @@ enum PrepublishingSheetStrings {
206195
value: "Save Changes",
207196
comment: "Button to confirm discarding changes"
208197
)
209-
210-
static let readyToPublish = NSLocalizedString(
211-
"prepublishing.publishingSectionTitle",
212-
value: "Ready to Publish?",
213-
comment: "The title of the top section that shows the site your are publishing to. Default is 'Ready to Publish?'"
214-
)
215198
}

0 commit comments

Comments
 (0)