-
Notifications
You must be signed in to change notification settings - Fork 83
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
Feat aldeed account shop creation #5
Conversation
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
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.
This works mostly as expected (once pulling in the config updates from #3.
One issue I saw was when setting my shop name when creating the initial shop, I saw this error pop up in the consol and in the server logs:
stack: ReactionError: There may be only one primary shop
at Object.createShop (file:///usr/local/src/app/src/core-services/shop/mutations/createShop.js:152:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async createShop (file:///usr/local/src/app/src/core-services/shop/resolvers/Mutation/createShop.js:19:16)
But it disapeared after a few seconds, and the shop was created as expected, and there is only one shop in the database. So for the sake of getting things going, I think this is OK to merge and we can address if we do see it again.
Anothing thing that needs to be addressed is the Login / registration page. This is fine for now, as we know how to step through it (create the account first), but we'll need to land on the registration for the first user before this is finalized.
Impact: breaking
Type: feature
Changes
Generally these are changes around auth and making the UI work before a shop has been created.
Countries
client-only Meteor collection is no longer used. Instead,CountryDefinitions
andCountryOptions
are imported fromapi-utils
LanguageDefinitions
andCurrencyDefinitions
are imported fromapi-utils
instead of being pulled fromshop.languages
andshop.currencies
.onCreateUser
on the server, we no longer auto-create an account for every user during user creation. The welcome email isn't sent here, either. The account and email happen on the server when the user makes their first GraphQL request.shop.layout
. For now, all layouts are hard-coded to keep things working, but PR refactor: merge the routers #3 should make them unnecessary.Breaking changes from 2.x
admin@localhost
immediately. Instead, you must click "Register" and register a new user. This user will then be make an installation owner and have permission to create the primary shop.Testing
To test you will need to point to a 3.0.0 API with changes from reactioncommerce/reaction#5722 merged.
You will also need to update various places in the reaction-admin codebase to point to that correct API URL, unless #3 has been merged already.
Verify things generally work as before, specifically around login, logout, and registering the first user on a new database. On a fresh database, it should work like this:
- First register a new user in Reaction Admin.
- This will log you in to Reaction Admin, which causes it to make some GraphQL requests.
- When the first GraphQL request comes, the account for your user is created. Because no existing "owner" user is found, it assigns you to the "owner" group instead of "customer" as usual.
- Reaction Admin then detects that there is no primary shop. It hides most of the admin UI and shows a "Create first shop" form, which uses the new
createShop
GraphQL mutation to create the primary shop.- At this point the rest of the admin UI appears and works as it did in 2.x.
Note: There is still some work to do on the Reaction Admin Accounts page, which will be done in a future PR. In particular, inviting new shop managers does not work.