Skip to content
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

Move Application Passwords entry to user details #23834

Merged
merged 6 commits into from
Nov 28, 2024

Conversation

crazytonyli
Copy link
Contributor

This is an alternative to #23819.

In #23819, application passwords are displayed in the user details view, like wp-admin. But I think @kean 's suggestion in #23819 (comment) makes more sense.

Regression Notes

  1. Potential unintended areas of impact

  2. What I did to test those areas of impact (or what existing automated tests I relied on)

  3. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@crazytonyli crazytonyli added this to the 25.6 milestone Nov 20, 2024
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 25.6. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 20, 2024

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr23834-10c98ee
Version25.4.2
Bundle IDorg.wordpress.alpha
Commit10c98ee
App Center BuildWPiOS - One-Offs #11131
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 20, 2024

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr23834-10c98ee
Version25.4.2
Bundle IDcom.jetpack.alpha
Commit10c98ee
App Center Buildjetpack-installable-builds #10171
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

List(viewModel.applicationTokens) { token in
ApplicationTokenListItemView(item: token)
ZStack {
Color(.systemGroupedBackground)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) this should not be needed as long as you are displaying the List at the bottom. The ProgressView could be shown as an .overlay.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't get it to work. Do you mind showing me an example?

Color(.systemGroupedBackground)
.ignoresSafeArea()

Group {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) Group seems redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 1b0daa0

List(viewModel.applicationTokens) { token in
ApplicationTokenListItemView(item: token)
}
.listStyle(.insetGrouped)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit)I'd suggest using a .plain list for plain lists. The same applies to the list of users. In the list of users, I'd display the current account and the top and add some sort of marker that it is.

@@ -3,6 +3,7 @@ import XCTest

@testable import WordPress

@MainActor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actors support in XCTest has been a bit shaky. I'd suggest writing all new tests in swift-testing. It's pretty similar to XCTest https://developer.apple.com/documentation/testing/migratingfromxctest

@@ -58,14 +66,13 @@ class ApplicationTokenListViewModel: ObservableObject {
@Published
private(set) var applicationTokens: [ApplicationTokenItem]

private let dataProvider: ApplicationTokenListDataProvider!
let dataProvider: ApplicationTokenListDataProvider!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need a force unwrap?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Addressed in db61f33

@jkmassel
Copy link
Contributor

If the site doesn't have a valid Application Token, every request just fails – there's no feedback or alerting.

We should address that before this ships.

I also noticed that User Management is still behind a feature flag – with this change, we should tie user management and application passwords together, because otherwise it's impossible to get at your application password list.

@jkmassel
Copy link
Contributor

Should admin users be able to see others' application passwords?

@crazytonyli
Copy link
Contributor Author

If the site doesn't have a valid Application Token, every request just fails – there's no feedback or alerting.

This is an existing issue with account passwords too. There is no re-authentication flow, when account password is changed.

Should admin users be able to see others' application passwords?

Not sure about if they should, but they can 😄 . On web, admin users can view, add, and revoke others application passwords.

@jkmassel jkmassel force-pushed the move-application-passwords-list-entry branch from 1b0daa0 to 10c98ee Compare November 27, 2024 20:30
Section(Strings.accountManagementSectionTitle) {
Button(Strings.setNewPasswordActionTitle) {
presentPasswordAlert = true
if isCurrentUser {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is why I couldn't see Application Passwords for other users?

Can we make that possible?

Doesn't have to be in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I didn't realize your question was about the current implementation in the app.

That's in my TODO list. It's not available now because the "Application Passwords" entry was implemented as for current user only.

@crazytonyli crazytonyli added this pull request to the merge queue Nov 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 27, 2024
@crazytonyli crazytonyli added this pull request to the merge queue Nov 27, 2024
Merged via the queue into trunk with commit 729854a Nov 28, 2024
24 checks passed
@crazytonyli crazytonyli deleted the move-application-passwords-list-entry branch November 28, 2024 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants