Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
AlbyIanna merged 3 commits into main from show-user-fields-dialog
Sep 20, 2022
Merged

Conversation

@AlbyIanna
Copy link
Contributor

@AlbyIanna AlbyIanna commented Sep 8, 2022

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

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

Copy link
Contributor

Is there a chance to move the entire user-fields logic to another module and let upload-sketch do the uploading only? Of course, this new thing should communicate with the upload contribution before upload. All user-field dialogs, prompts, etc. could go into their own service, class, or contribution. What do you think?

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Sep 8, 2022
Copy link
Contributor Author

Is there a chance to move the entire user-fields logic to another module and let upload-sketch do the uploading only? Of course, this new thing should communicate with the upload contribution before upload. All user-field dialogs, prompts, etc. could go into their own service, class, or contribution. What do you think?

Yes, it would make sense. I'll work on it later.

kittaakos reacted with thumbs up emoji

Copy link
Contributor Author

@kittaakos please have a look at the last commit, I've created a separate contribution for the user fields.

Copy link
Contributor

@per1234 per1234 left a 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!

@AlbyIanna AlbyIanna marked this pull request as ready for review September 15, 2022 07:38
Copy link
Contributor

@kittaakos kittaakos left a 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;
Copy link
Contributor

@kittaakos kittaakos Sep 15, 2022

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.

Copy link
Contributor Author

@AlbyIanna AlbyIanna Sep 15, 2022

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.

return undefined;
}
const userFields = this.userFields();
const userFields = this.userFields.getUserFields();
Copy link
Contributor

@kittaakos kittaakos Sep 15, 2022

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?

Copy link
Contributor Author

@AlbyIanna AlbyIanna Sep 15, 2022

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.

Copy link
Contributor

@kittaakos kittaakos Sep 15, 2022

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.

Copy link
Contributor Author

@AlbyIanna AlbyIanna Sep 15, 2022

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.

Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

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

Verified. Thank you!

user_fields_prompt.mp4

@AlbyIanna AlbyIanna merged commit 671d2ea into main Sep 20, 2022
@AlbyIanna AlbyIanna deleted the show-user-fields-dialog branch September 20, 2022 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@per1234 per1234 per1234 approved these changes

@ubidefeo ubidefeo Awaiting requested review from ubidefeo

@davegarthsimpson davegarthsimpson Awaiting requested review from davegarthsimpson

@francescospissu francescospissu Awaiting requested review from francescospissu

+1 more reviewer

@kittaakos kittaakos kittaakos approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

topic: code Related to content of the project itself type: enhancement Proposed improvement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Show "Configure And Upload" dialog again on next attempt after failed upload

AltStyle によって変換されたページ (->オリジナル) /