-
Notifications
You must be signed in to change notification settings - Fork 0
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
Models and Resolvers for License, MetadataStandard, Repository and ResearchDomain #169
Conversation
…rd. Updated models to trim text/string fields where appropriate. Fix bug in section data-migration. renamed ProjectFunder.funderId to affiliationId
…e into development
@@ -4,6 +4,7 @@ import { verifyCriticalEnvVariable } from "../utils/helpers"; | |||
verifyCriticalEnvVariable('DOMAIN'); | |||
verifyCriticalEnvVariable('APP_NAME'); | |||
verifyCriticalEnvVariable('DEFAULT_AFFILIATION_URI'); | |||
verifyCriticalEnvVariable('DMP_ID_SHOULDER'); |
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.
Would we want to add DMP_ID_BASE_URL
or the orcid
or ror
base urls to this verification list?
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 have default values in place for those. The shoulder though is tied to a specific organization (e.g. DMP Tool has one, Dryad has another, etc.), so I decided not to provide a default for it.
@@ -52,7 +52,7 @@ export const resolvers: Resolvers = { | |||
} | |||
|
|||
const affiliation = new Affiliation(input); | |||
return await affiliation.create(context); | |||
return await affiliation.update(context); |
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.
Can you call update
here on an affiliation that does not yet exist? It looks like on L50, that we throw an error if it's an existing affiliation, so I guess there would be no existing affiliation when we hit L55.
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.
yeah, we do a check for existence before it, so it shouldn't get to line 55. If it does though a MySQL error should bubble up, so I think it's ok
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.
@briri can you do a sanity check? I just tried to run updateAffiliation
and got an error because no id
is available in the object. PReviously, when we were using .create()
we didn't need an affiliation id.
src/resolvers/metadataStandard.ts
Outdated
}, | ||
|
||
Mutation: { | ||
// add a new ContributorRole |
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.
L23: Do you mean add a new addMetadataStandard
?
src/resolvers/repository.ts
Outdated
}, | ||
|
||
Mutation: { | ||
// add a new ContributorRole |
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.
L31: Same here. I think you meant add a new repository
Brian, your changes look good. I just had a few comments. |
…e into feature/BR-proj-lookups
Updated the 2 comments you pointed out above @jupiter007 and also rebased with the latest in development |
…e into feature/BR-proj-lookups
@jupiter007 I just rebased this against development (your changes for the versionedTemplates). This one was approved a couple of weeks ago, please reapprove when you have a chance |
ok @jupiter007 the updateAffiliation should now be working |
Thanks @briri |
Description
Fixes #121
Models and resolvers for Licenses, MetadataStandards, Repositories and ResearchDomains. These objects will be used to support the Project and Plan pages.
Added the models for ProjectContributor and ProjectFunder.
I also fixed a typo I found in the data migration that adds
bestPractice
to the Section tableType of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Include any relevant details for your test configuration.
I added a lot of unit tests for each new model and also made sure the Queries were working in the Apollo explorer. I did not have a chance to thoroughly verify all of the Mutations though.
Please note there are some new ENV variables that will need to be added to your local
.env
file!Checklist: