-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[pat] Token UI polish #15015
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
[pat] Token UI polish #15015
Conversation
started the job as gitpod-build-jp-pat-validation.1 because the annotations in the pull request description changed |
/werft run recreate-preview=true 👍 started the job as gitpod-build-jp-pat-validation.3 |
ed24884
to
a4bb5af
Compare
/werft run 👍 started the job as gitpod-build-jp-pat-validation.6 |
/werft run recreate-preview=true 👍 started the job as gitpod-build-jp-pat-validation.8 |
5f034ce
to
8d3a833
Compare
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.
Thanks for tackling most of the issues in #15002, @jeanp413 & @mustard-mh!
I was in the neighborhood and left some UX comments below. 🏀
const PillClsMap: Record<PillType, string> = { | ||
info: "bg-blue-50 text-blue-500 dark:bg-blue-500 dark:text-blue-100", | ||
warn: "bg-orange-100 text-orange-700 dark:bg-orange-600 dark:text-orange-100", | ||
success: "bg-green-100 text-green-700 dark:bg-green-600 dark:text-green-100", | ||
}; |
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.
praise: Thank you for extending this component, @jeanp413 & @mustard-mh!
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.
Actually this is @mustard-mh change 😄
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.
I realized this a few hours after posting the comment above.
Thanks for giving credit where credit is due, @jeanp413! 🧡
token={t} | ||
menuEntries={[ | ||
{ | ||
title: "Edit", |
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.
issue: Not the best line to comment this, but when you Edit a token and add or remove permissions, the expiration date changes back to today. ❗
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 can be reproduced.
But it's weird that from the code, we don't send expirationTime
, but devTools shows we have send it (maybe a default value of protobuf
Timestamp
)
And server should not update expirationDate too.
cc @easyCZ
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.
For the fine grained update, there's a second field which you can supply - updateMask
. It's a list of of the token
fields which should be updated.
It may make sense to link the update form "changes" to those fields and send them to ensure its updated. I'll investigate and can look into fixing the backend, it should never send back internal
error code anyway.
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.
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.
I've added a couple of fixes to API validation and Not Found handling in the following:
- [pat] Fix NotFound error handling #15075
- [pat] Harden retrieval of PATs and check for nil UUIDs #15072
That should at least give us more info about the error.
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.
Looks like the original migration put the on update
on the wrong column. The on-update should be on set on _lastModified
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.
Great find! I'll add a migration tomorrow.
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.
Migration PR: #15093
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.
The update issue, where the expiration would be reset is now fixed in staging.
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.
The remaining issue is that a no-update returns a Not Found from the API. Tracked here #15105
d6f77f0
to
7ffe8cc
Compare
Co-authored-by: Huiwen <[email protected]>
7ffe8cc
to
d660036
Compare
Preview is broken for me, rerunning. /werft run with-clean-slate-deployment=true 👍 started the job as gitpod-build-jp-pat-validation.18 |
Looking good. There's a couple of minor aspects which we can follow-up on. Here we should drop the `Personal` keywords, to be consistent with other places.here also The expiration icon should have a tooltip to explain why it's there
|
Scopes updating also works as expected |
I'm going to approve the PR, and I'll track/put up PRs for the small bits from this PR. Thanks a lot for the improvements, this is awesome to see materialize. |
The follow-up to improve the expiration time UX (tooltip) is tracked here #15103 |
Hi @jeanp413, sorry for the late question, but was there a reason why |
@laushinka I had a similar thought back in #15015 (comment). |
@laushinka sorry, I had it in my mind to ask you about it here in the review but then forgot about it 🤦, I moved because I created another small component only for tokens in If it's preferred to have split components, I can do a follow up PR today 👍 , and if that's the case would it makes sense to group multiple files related to PAT inside a subfolder or is it Ok to add them all in settings folder? |
@jeanp413 All good! I just did this PR. Hope that looks reasonable to you too :)
I thought about it too, and I think it would make sense to group them all inside a subfolder as you suggest 👍🏼 I didn't do that in the PR above, but I can do a follow-up. |
Description
Validate PAT token name
Related Issue(s)
How to test
Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh