-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Feature: Post Settings #24623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Feature: Post Settings #24623
Changes from all commits
Commits
Show all changes
84 commits
Select commit
Hold shift + click to select a range
f27f258
Add PostAuthorPicker
kean 5f2c102
Remvoe preview
kean 93cf0b4
Add .postSettingsV2 FF
kean e5bf352
Add empty PostSettingsView
kean 76dda6a
Add PostSettings
kean b4bf362
Remove localizable strings
kean 79e7587
Make status type-safe
kean d21ee92
Remove publicize options for now
kean a34e288
Fix compilation
kean 90b32e4
Fix cancel flow
kean 0b54a06
Fix presenation from editor
kean 41e4c0d
Show Done button when shown from the editor
kean f82adf4
Cleanup PostSettings
kean 004b136
Cleanup
kean c2f845e
Fix compilation with AnyView
kean 87b03f6
Add PostFormatPicker
kean bc4990a
Remove unused blogervice
kean 093342a
Add the General section
kean 80068bf
Finish author row changes
kean 00311cf
Add pending review row
kean 8c691ff
Move analytics to ViewModel
kean f5fb7b6
Display time zone at the bottom of date picker making it clear that i…
kean b7c365b
Implement Publish Row
kean 54194cb
Add visibility picker
kean 78435de
Add visibility section
kean 2ef31f6
Cleanup
kean f9d6173
Add Featured Image section
kean 274ee32
Add animations
kean 6bcf73e
Add Taxonomy section
kean a4417b9
Update unit tests
kean 10794a1
Add Excerpt
kean 416437a
Add Slug field
kean 14e222c
Move Pending Review also to More options
kean 926bafb
Add post format field
kean df56330
Add Parent Page
kean 2d10f21
Cleanup
kean 3aca647
Post Settings: Other (#24640)
kean 172d21e
Minor fixes
kean 1667fba
Fix CMM-548: an issue with social sharing options in the prepublishin…
kean 3a55ed1
Post Setting: Social Sharing (#24642)
kean 738fecd
Remove Social Sharing
kean 74ad7a6
Make enablePublicizeConnectionWithKeyringID non-objc
kean 9740ad6
Remove isMultiAuthorBlog
kean b63ddc6
Remove PublishSettingsViewModel
kean 86267ca
Remove titleForVisibility
kean a775015
Remove FeaturedImageDelegate
kean 8324cc0
Remove ategoriesText
kean 3213f35
Remove PostSettingsViewController
kean 2c8323c
Remove PageSettingsViewController
kean f53157d
Rename NewPostSettingsVC
kean 63ea280
Remove postSettingsV2 FF
kean 41730d0
Fix build
kean 97520e4
Post Settings: Core Removal (#24643)
kean 15963d7
Add Sticky
kean a44155b
Post Settings: Sticky (#24644)
kean 196d2f7
Move analytics to save
kean 448693d
Refresh only what changed
kean 9c7521f
Post Settings: Optimizations (#24645)
kean 665322f
Add organization improvements
kean 6e4789b
Add excerpt counter outside
kean 80e1693
Improve excerpt editing experience
kean 5be201d
Add Info section
kean 88ce006
Cleanup the Info section
kean d69502d
Remove unused Slugfordisplay
kean a9ae056
Use switch for Post/Page
kean 48f7b9c
Add new section headers with WordPress fonst
kean 925ed9b
Nicer PostSettingsFeaturedImageRow
kean a18e42b
Add improved excerpt editor
kean 2cdf88a
Increase featured image row
kean 126fd13
Simplify excerpt header
kean c10a4a1
Add new design for categories and tags
kean a71302d
Add a better way to display categories and tags
kean 6e82511
Revert drag-n-drop code
kean 605ea0a
Cleanup
kean 17395af
Move sections in code according to design
kean d823c08
Upadte last edited to show relative date
kean 85eb88a
Move slug to the General section
kean f33b801
Update UI tests
kean 40007dc
Cleanup
kean de8171d
Update UI tests
kean 8cd6db0
Post Settings: Refinement (#24646)
kean aa03dc6
Cleanur Me menu
kean d588e5f
Merge branch 'trunk' into feature/post-settings
kean 55b729a
Simplify ParentPagePicker
kean File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,16 @@ | ||
| import SwiftUI | ||
| import DesignSystem | ||
|
|
||
| public struct SectionHeader: View { | ||
| let title: String | ||
|
|
||
| public init(_ title: String) { | ||
| self.title = title | ||
| } | ||
|
|
||
| public var body: some View { | ||
| Text(title.uppercased()) | ||
| .font(.caption2).fontWeight(.medium) | ||
| .foregroundStyle(Color.secondary) | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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,75 @@ | ||
| import Foundation | ||
| import CoreData | ||
| import WordPressShared | ||
|
|
||
| extension Blog { | ||
|
|
||
| // MARK: - Post Formats | ||
|
|
||
| /// Returns an array of post format keys sorted with "standard" first, then alphabetically | ||
| @objc public var sortedPostFormats: [String] { | ||
| guard let postFormats = postFormats as? [String: String], !postFormats.isEmpty else { | ||
| return [] | ||
| } | ||
|
|
||
| var sortedFormats: [String] = [] | ||
|
|
||
| // Add standard format first if it exists | ||
| if postFormats[PostFormatStandard] != nil { | ||
| sortedFormats.append(PostFormatStandard) | ||
| } | ||
|
|
||
| // Add remaining formats sorted by their display names | ||
| let nonStandardFormats = postFormats | ||
| .filter { $0.key != PostFormatStandard } | ||
| .sorted { $0.value.localizedCaseInsensitiveCompare($1.value) == .orderedAscending } | ||
| .map { $0.key } | ||
|
|
||
| sortedFormats.append(contentsOf: nonStandardFormats) | ||
|
|
||
| return sortedFormats | ||
| } | ||
|
|
||
| /// Returns an array of post format display names sorted with "Standard" first, then alphabetically | ||
| @objc public var sortedPostFormatNames: [String] { | ||
| guard let postFormats = postFormats as? [String: String] else { | ||
| return [] | ||
| } | ||
| return sortedPostFormats.compactMap { postFormats[$0] } | ||
| } | ||
|
|
||
| /// Returns the default post format display text | ||
| @objc public var defaultPostFormatText: String? { | ||
| postFormatText(fromSlug: settings?.defaultPostFormat) | ||
| } | ||
|
|
||
| // MARK: - Connections | ||
|
|
||
| /// Returns an array of PublicizeConnection objects sorted by service name, then by external name | ||
| @objc public var sortedConnections: [PublicizeConnection] { | ||
| guard let connections = Array(connections ?? []) as? [PublicizeConnection] else { | ||
| return [] | ||
| } | ||
| return connections.sorted { lhs, rhs in | ||
| // First sort by service name (case insensitive, localized) | ||
| let serviceComparison = lhs.service.localizedCaseInsensitiveCompare(rhs.service) | ||
| if serviceComparison != .orderedSame { | ||
| return serviceComparison == .orderedAscending | ||
| } | ||
| // Then sort by external name (case insensitive) | ||
| return lhs.externalName.caseInsensitiveCompare(rhs.externalName) == .orderedAscending | ||
| } | ||
| } | ||
|
|
||
| // MARK: - Roles | ||
|
|
||
| /// Returns an array of roles sorted by order. | ||
| public var sortedRoles: [Role] { | ||
| guard let roles = Array(roles ?? []) as? [Role] else { | ||
| return [] | ||
| } | ||
| return roles.sorted { lhs, rhs in | ||
| (lhs.order?.intValue ?? 0) < (rhs.order?.intValue ?? 0) | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to use the default header style in
Section("Header text") {}?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes it a bit easier to read, which we want in a form, and it's more consistent with the WordPress design. I plan to keep using these for forms.