-
-
Notifications
You must be signed in to change notification settings - Fork 431
Show user fields dialog again if upload fails #1415
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
Conversation
Is there a chance to move the entire user-fields logic to another module and let |
Yes, it would make sense. I'll work on it later. |
@kittaakos please have a look at the last commit, I've created a separate contribution for the user fields. |
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 is working perfectly for me.
Thanks Alberto!
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's looking great. Thank you for the refactoring. I left a few remarks.
@injectable() | ||
export class UserFields extends Contribution { | ||
private boardRequiresUserFields = false; | ||
private userFieldsSet = false; |
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.
Can we not simplify this and if there are user fields for an fqbn
in the map, it means true
. Otherwise, false
.
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.
In that we would lose the value of the user field. As far as I know, we don't want that, we want to preserve the value, but give the user the possibility to change it.
@@ -258,7 +163,7 @@ export class UploadSketch extends CoreServiceContribution { | |||
if (!CurrentSketch.isValid(sketch)) { | |||
return undefined; | |||
} | |||
const userFields = this.userFields(); | |||
const userFields = this.userFields.getUserFields(); |
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.
Why not pass the fqbn
from here?
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 don't see any reason since I can easily get them from the boardsServiceProvider
. Passing it here would just add a parameter, with no benefit.
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.
Exactly this; why do you want to calculate it twice? verify
, and upload
will require the fqbn
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.
IMO how the user fields are stored is not related to the upload. I may want to open that dialog even if I'm not uploading.
b00d70d
to
94ca5f3
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.
Verified. Thank you!
Motivation
When uploading a sketch with user fields, if the user made a mistake while filling in the dialog, or made a change that requires updating the fields, it might not be clear to them how to do that 🙁
Change description
As requested in #1386, I've made a change to show again the user field dialog when pressing the Upload button if the previous upload failed.
Other information
Closes #1386
Reviewer checklist