-
Notifications
You must be signed in to change notification settings - Fork 56
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
[ENG-4682] Mirage for addons #2062
[ENG-4682] Mirage for addons #2062
Conversation
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.
Mostly a request to get the API contract modified to make the URLs match the model types. But also a question about a thing I didn't know was a thing.
scopes: [], | ||
defaultRootFolder: faker.system.filePath, | ||
|
||
configuringUser: belongsTo('internal-user'), |
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 do not recall doing this for my factories. Is that a thing that needs fixing? What does it do?
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.
So this was a misunderstanding of what these do. The association() helper can make it so that factories will automatically create a related model (e.g. server.create('draft-registration')
will automagically create an initiator
user). Whereas these belongsTo
and hasMany
helpers are used to define relationships in your data models (which we don't need to do, since we get this for free as we use ember-data)
Oh, actually, one more thing. Could you add to the dashboard scenario to put the box addon in to |
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.
Overall, looks good. A few small things.
Did you have a chance to try things out to make sure your mirage endpoints all worked and gave the output you were expecting?
// Addon service | ||
this.urlPrefix = addonServiceUrl; | ||
this.namespace = '/v1'; | ||
this.resource('external_storage_services', { only: ['index', 'show'] }); |
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.
Innnteresting. I didn't know this.resource
was a thing.
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.
Yea, partway through writing some of these views, I realized it was a lot simpler than what I was doing 😅
I will add those requests/responses to the PR descriptions now! |
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 should be ready to go once tests pass.
739c9f7
into
CenterForOpenScience:feature/addon-services
Purpose
Summary of Changes
To-do
Screenshot(s)
external_storage_services
internal_resources/<guid>
internal_users/<guid>
internal_users/<guid>/authorized_storage_accounts
authorized_storage_accounts/<id>
configured_storage_addons/<id>
Side Effects
QA Notes