-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Show an card to prompt application password authentication #24561
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
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
dc43769
Update wordpress-rs
crazytonyli 63d6be4
Add dot-org REST API via WP.com to `WordPressClient`
crazytonyli 341a649
Add blog id to the `reauthentication` context
crazytonyli ccc796d
Add API to accept an auto-discovery result
crazytonyli c8c5deb
Ask users to grant the app an application password
crazytonyli 6e34f2b
Prefer to directly access site content via dot-org REST API
crazytonyli cdd07de
Fix a unit test compiling issue
crazytonyli fbf4673
Fix a swiftlint issue
crazytonyli 67e236e
Fix a swiftlint issue
crazytonyli 068ac4c
Fix a compiling issue in the Reader app
crazytonyli b23d2a4
Prefer to use REST API to manage comments
crazytonyli 88e4269
Add a comment about why choosing WP.com API instead of REST API
crazytonyli 0565abf
Revert "Prefer to use REST API to manage comments"
crazytonyli bcad039
Add a comment about use WP.com API for comments
crazytonyli 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
47 changes: 47 additions & 0 deletions
47
WordPress/Classes/ViewRelated/Blog/Blog Details/ApplicationPasswordAuthenticationCard.swift
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,47 @@ | ||
import Foundation | ||
import WordPressUI | ||
import SwiftUI | ||
|
||
public class ApplicationPasswordAuthenticationCardCell: UITableViewCell { | ||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | ||
super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
|
||
let view = UIHostingView(view: ApplicationPasswordAuthenticationCard()) | ||
self.contentView.addSubview(view) | ||
view.pinEdges() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
} | ||
|
||
struct ApplicationPasswordAuthenticationCard: View { | ||
var body: some View { | ||
VStack(alignment: .leading, spacing: 8) { | ||
HStack(spacing: 4) { | ||
Image(systemName: "lock.circle.fill") | ||
.foregroundColor(.red) | ||
|
||
Text(Strings.newTitle) | ||
.foregroundColor(.primary) | ||
} | ||
.font(.headline) | ||
|
||
Text(Strings.description) | ||
.font(.callout) | ||
.foregroundColor(.primary) | ||
|
||
Text(Strings.authorize) | ||
.font(.callout.bold()) | ||
.foregroundStyle(Color.accentColor) | ||
} | ||
.padding() | ||
} | ||
} | ||
|
||
private enum Strings { | ||
static let newTitle = NSLocalizedString("application.password.new.title", value: "New: Application Passwords", comment: "Title for the new application passwords feature") | ||
static let description = NSLocalizedString("application.password.description", value: "You can now grant the app permission to use application passwords for quick and secure access to your site content.", comment: "Description for the application passwords feature") | ||
static let authorize = NSLocalizedString("application.password.authorize", value: "Authorize", comment: "Button label to authorize application passwords") | ||
} |
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.
@jkmassel FYI, I have reverted the comment API changes, due to lack of "likes" support in the REST API.