diff --git a/Modules/Sources/UITestsFoundation/Screens/Editor/PrepublishingSheetScreen.swift b/Modules/Sources/UITestsFoundation/Screens/Editor/PrepublishingSheetScreen.swift index 7ffda018af7e..892da2328faa 100644 --- a/Modules/Sources/UITestsFoundation/Screens/Editor/PrepublishingSheetScreen.swift +++ b/Modules/Sources/UITestsFoundation/Screens/Editor/PrepublishingSheetScreen.swift @@ -12,7 +12,7 @@ public class PrepublishingSheetScreen: ScreenObject { } private let publishDateButtonGetter: (XCUIApplication) -> XCUIElement = { - $0.staticTexts["Publish Date"] + $0.staticTexts["Date"] } private let closeButtonGetter: (XCUIApplication) -> XCUIElement = { diff --git a/Tests/KeystoneTests/Tests/Services/AccountSettingsServiceTests.swift b/Tests/KeystoneTests/Tests/Services/AccountSettingsServiceTests.swift index f87b2e4b3924..0d79cfce4a28 100644 --- a/Tests/KeystoneTests/Tests/Services/AccountSettingsServiceTests.swift +++ b/Tests/KeystoneTests/Tests/Services/AccountSettingsServiceTests.swift @@ -62,7 +62,7 @@ class AccountSettingsServiceTests: CoreDataTestCase { } func testCancelGettingSettings() throws { - XCTSkip("Flaky") + throw XCTSkip("Flaky") // This test performs steps described in the link below to reproduce a crash. // https://github.com/wordpress-mobile/WordPress-iOS/issues/20379#issuecomment-1481995663 diff --git a/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift b/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift index 7f74a65a53f3..9d3187d84312 100644 --- a/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift +++ b/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift @@ -86,11 +86,12 @@ public enum FeatureFlag: Int, CaseIterable { case .newStats: return false case .newPublishingSheet: - return false + return true case .mediaQuotaView: return false case .intelligence: - return BuildConfiguration.current == .debug + let languageCode = Locale.current.languageCode + return (languageCode ?? "en").hasPrefix("en") } } diff --git a/WordPress/Classes/ViewRelated/Me/App Settings/ExperimentalFeaturesDataProvider.swift b/WordPress/Classes/ViewRelated/Me/App Settings/ExperimentalFeaturesDataProvider.swift index 1d8bfaaa573d..f59c122b2dd9 100644 --- a/WordPress/Classes/ViewRelated/Me/App Settings/ExperimentalFeaturesDataProvider.swift +++ b/WordPress/Classes/ViewRelated/Me/App Settings/ExperimentalFeaturesDataProvider.swift @@ -6,10 +6,11 @@ import SwiftUI class ExperimentalFeaturesDataProvider: ExperimentalFeaturesViewModel.DataProvider { let flags: [OverridableFlag] = [ + FeatureFlag.intelligence, + FeatureFlag.newStats, FeatureFlag.allowApplicationPasswords, RemoteFeatureFlag.newGutenberg, - FeatureFlag.newGutenbergThemeStyles, - FeatureFlag.newStats, + FeatureFlag.newGutenbergThemeStyles ] private let flagStore = FeatureFlagOverrideStore() diff --git a/WordPress/Classes/ViewRelated/Post/PostSettings/PostSettingsView.swift b/WordPress/Classes/ViewRelated/Post/PostSettings/PostSettingsView.swift index 963f46e3afc8..9aa8e245e2d1 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettings/PostSettingsView.swift +++ b/WordPress/Classes/ViewRelated/Post/PostSettings/PostSettingsView.swift @@ -134,6 +134,9 @@ struct PostSettingsFormContentView: View { @ObservedObject var viewModel: PostSettingsViewModel var body: some View { + if viewModel.context == .publishing { + publishingOptionsSection + } featuredImageSection if viewModel.isPost { organizationSection @@ -149,12 +152,11 @@ struct PostSettingsFormContentView: View { @ViewBuilder private var publishingOptionsSection: some View { Section { + BlogListSiteView(site: .init(blog: viewModel.post.blog)) publishDateRow visibilityRow } header: { - BlogListSiteView(site: .init(blog: viewModel.post.blog)) - .padding(.bottom, 8) - .foregroundStyle(.primary) + SectionHeader(Strings.readyToPublish) } } @@ -626,4 +628,10 @@ private enum Strings { value: "Social Sharing", comment: "Label for the preview button in Post Settings" ) + + static let readyToPublish = NSLocalizedString( + "prepublishing.publishingSectionTitle", + value: "Ready to Publish?", + comment: "The title of the top section that shows the site your are publishing to. Default is 'Ready to Publish?'" + ) } diff --git a/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController+Helpers.swift b/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController+Helpers.swift index 8c3904508865..cd2aa67d4cba 100644 --- a/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController+Helpers.swift +++ b/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController+Helpers.swift @@ -17,7 +17,7 @@ extension PrepublishingViewController { // - warning: Has to be UIKit because some of the `PostSettingsView` rows rely on it. let navigationVC = UINavigationController(rootViewController: publishVC) navigationVC.sheetPresentationController?.detents = [ - .custom(identifier: .medium, resolver: { context in 460 }), + .custom(identifier: .medium, resolver: { context in 526 }), .large() ] presentingViewController.present(navigationVC, animated: true) diff --git a/WordPress/Classes/ViewRelated/Post/Publishing/PublishPostViewController.swift b/WordPress/Classes/ViewRelated/Post/Publishing/PublishPostViewController.swift index 875a73e869ce..5b4f8937177d 100644 --- a/WordPress/Classes/ViewRelated/Post/Publishing/PublishPostViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/Publishing/PublishPostViewController.swift @@ -58,22 +58,20 @@ struct PublishPostView: View { var body: some View { Form { - Section { - if let state = uploadsViewModel.uploadingSnackbarState { - NavigationLink { - PostMediaUploadsView(viewModel: uploadsViewModel) - } label: { - PostMediaUploadsSnackbarView(state: state) - } + if let state = uploadsViewModel.uploadingSnackbarState { + NavigationLink { + PostMediaUploadsView(viewModel: uploadsViewModel) + } label: { + PostMediaUploadsSnackbarView(state: state) } - BlogListSiteView(site: .init(blog: viewModel.post.blog)) - } header: { - SectionHeader(Strings.readyToPublish) } PostSettingsFormContentView(viewModel: viewModel) } .environment(\.defaultMinListHeaderHeight, 0) // Reduces top inset a bit .navigationBarTitleDisplayMode(.inline) + .onAppear { + viewModel.onAppear() + } .toolbar { ToolbarItem(placement: .topBarLeading) { buttonCancel @@ -91,7 +89,6 @@ struct PublishPostView: View { } } ToolbarItemGroup(placement: .topBarTrailing) { - buttonSchedule buttonPublish } } @@ -126,15 +123,6 @@ struct PublishPostView: View { } } - @ViewBuilder - private var buttonSchedule: some View { - NavigationLink { - PostSettingsPublishDatePicker(viewModel: viewModel) - } label: { - Image(systemName: "calendar") - } - } - @ViewBuilder private var buttonPublish: some View { if viewModel.isSaving { @@ -150,6 +138,7 @@ struct PublishPostView: View { .buttonBorderShape(.capsule) .tint(isDisabled ? Color(.opaqueSeparator) : AppColor.primary) .disabled(isDisabled) + .accessibilityIdentifier("publish") } } } @@ -206,10 +195,4 @@ enum PrepublishingSheetStrings { value: "Save Changes", comment: "Button to confirm discarding changes" ) - - static let readyToPublish = NSLocalizedString( - "prepublishing.publishingSectionTitle", - value: "Ready to Publish?", - comment: "The title of the top section that shows the site your are publishing to. Default is 'Ready to Publish?'" - ) }