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

[Example User Provider] Fix inability to get to example login form #7728

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jvigliotta
Copy link
Contributor

@jvigliotta jvigliotta commented May 13, 2024

Closes #7727

Describe your changes:

Changed how we assign defaults for the argument object. In getPossibleRoles wait for login promise to resolve, before accessing the user object.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

…well as return possible roles after login promise has resolved
@codecov-commenter
Copy link

codecov-commenter commented May 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.57%. Comparing base (810d580) to head (b59ed09).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7728      +/-   ##
==========================================
- Coverage   56.87%   56.57%   -0.31%     
==========================================
  Files         673      673              
  Lines       27182    27183       +1     
  Branches     2635     2635              
==========================================
- Hits        15461    15380      -81     
- Misses      11390    11472      +82     
  Partials      331      331              
Flag Coverage Δ
e2e-full 23.56% <0.00%> (-18.04%) ⬇️
e2e-stable 60.47% <100.00%> (-0.01%) ⬇️
unit 49.25% <50.00%> (-0.02%) ⬇️
Files Coverage Δ
example/exampleUser/ExampleUserProvider.js 83.60% <100.00%> (ø)
example/exampleUser/plugin.js 100.00% <100.00%> (ø)

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 810d580...b59ed09. Read the comment docs.

@@ -141,7 +141,7 @@ export default class ExampleUserProvider extends EventEmitter {
}

getPossibleRoles() {
return this.user.getRoles();
return this.loginPromise.then(() => this.user.getRoles());
Copy link
Contributor

Choose a reason for hiding this comment

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

Normal practise, is to use underscore (_) as a parameter in the promise constructor. Just a nitpick

Copy link
Contributor

Choose a reason for hiding this comment

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

Given that the argument is unused

@akhenry
Copy link
Contributor

akhenry commented May 21, 2024

Tests, please. Nothing should be pushed any more without tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Example User Plugin] Unable to pass in just one argument, out of order method call
4 participants