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

Fix setup wizard selection of network devices for sign up or import #11510

Merged
merged 6 commits into from
Nov 27, 2023

Conversation

bjester
Copy link
Member

@bjester bjester commented Nov 8, 2023

Summary

  • Reverts prior change that implemented filtering on whether a learner can signup
  • Implements, through refactoring, method for flexible filtering of facilities which is now supported through the selection form

With learner sign up disabled

Join Import
Screenshot from 2023-11-08 12-23-04 Screenshot from 2023-11-08 12-22-53

With learner signup enabled

Join Import
Screenshot from 2023-11-08 12-41-28 Screenshot from 2023-11-08 12-41-39

References

Fixes: #11496

Reviewer guidance

Tested the signup flow and channel import


Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@github-actions github-actions bot added APP: Setup Wizard Re: Setup Wizard (facility import, superuser creation, settings, etc.) SIZE: medium labels Nov 8, 2023
@github-actions github-actions bot added the APP: Learn Re: Learn App (content, quizzes, lessons, etc.) label Nov 8, 2023
@bjester bjester marked this pull request as ready for review November 17, 2023 19:11
@bjester bjester added the TODO: needs review Waiting for review label Nov 17, 2023
Copy link
Member

@nucleogenesis nucleogenesis left a comment

Choose a reason for hiding this comment

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

The only blocking change request is the use of the conditional chaining operator.

Overall, this is a massive improvement. Every place there is a change, the result is more readable and easier to follow/understand. I really love this overall and I think that useDevices and the filtering business would be a great thing to present & discuss with the team if you'd be up for it.

return () => Promise.resolve(true);
}

return useAsyncDeviceFilter(function deviceFacilityFilter(device) {
Copy link
Member

Choose a reason for hiding this comment

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

Does the parameter passed to useAsyncDeviceFilter have to be named or could it be an anonymous function?

Copy link
Member

Choose a reason for hiding this comment

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

Mostly asking because when I see something named, especially as specifically as deviceFacilityFilter I kind of expect it to be something that I need to know about elsewhere or later but it seems like this could just as well be called filterFn or nothing at all -- although I could totally be missing something elsewhere?

Copy link
Member Author

@bjester bjester Nov 20, 2023

Choose a reason for hiding this comment

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

It doesn't have to be named. Although, there is a benefit when reading error stack traces, because anonymous functions would of course be anonymous and indistinguishable from other anonymous.

Comment on lines +213 to +218
* Produces a function that resolves with a boolean if Kolibri version is at least the specified
* @param {number} major
* @param {number} minor
* @param {number} patch
* @return {function(NetworkLocation): Promise<boolean>}
Copy link
Member

Choose a reason for hiding this comment

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

This is a beautiful improvement <3

Copy link
Member

Choose a reason for hiding this comment

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

I wish it showed the full diff so it was obvious here what it looked like before lol this is really so much nicer a way to do what we need to do here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah by making the filters (filter functions) more like object entities, it disconnects the 'inheritance' structure that was in use before and makes it more flexible

Copy link
Member

@nucleogenesis nucleogenesis left a comment

Choose a reason for hiding this comment

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

Requested changes have been made. Thanks for this Blaine!

Copy link
Member

@akolson akolson left a comment

Choose a reason for hiding this comment

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

Changes look correct to me and code is understandable. Thanks @bjester

@bjester bjester merged commit b88a804 into learningequality:release-v0.16.x Nov 27, 2023
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: Setup Wizard Re: Setup Wizard (facility import, superuser creation, settings, etc.) SIZE: medium TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In the Setup Wizard Facilities are filtered by the 'learners can create account' facility setting
3 participants