Skip to content

Commit

Permalink
ASAP-726 Additional Quick Check Question (#4413)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabiayako authored Oct 16, 2024
1 parent 346fed8 commit 3db2826
Show file tree
Hide file tree
Showing 13 changed files with 548 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,15 @@ it('can publish a form when the data is valid and navigates to team workspace',
codeDeposited: 'Yes',
protocolsDeposited: 'Yes',
labMaterialsRegistered: 'Yes',
availabilityStatement: 'Yes',
acknowledgedGrantNumberDetails: '',
asapAffiliationIncludedDetails: '',
manuscriptLicenseDetails: '',
datasetsDepositedDetails: '',
codeDepositedDetails: '',
protocolsDepositedDetails: '',
labMaterialsRegisteredDetails: '',
availabilityStatementDetails: '',

teams: ['42'],
labs: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ export const parseGraphqlManuscriptVersion = (
version?.labMaterialsRegistered === 'No'
? version?.labMaterialsRegisteredDetails
: undefined,
availabilityStatementDetails:
version?.availabilityStatement === 'No'
? version?.availabilityStatementDetails
: undefined,
createdBy: {
id: version?.createdBy?.sys.id,
firstName: version?.createdBy?.firstName || '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ describe('Manuscripts Contentful Data Provider', () => {
${'codeDeposited'} | ${'codeDepositedDetails'}
${'protocolsDeposited'} | ${'protocolsDepositedDetails'}
${'labMaterialsRegistered'} | ${'labMaterialsRegisteredDetails'}
${'availabilityStatement'} | ${'availabilityStatementDetails'}
`(
'should return $fieldDetails value if $field is No',
async ({
Expand Down Expand Up @@ -110,6 +111,7 @@ describe('Manuscripts Contentful Data Provider', () => {
${'codeDeposited'} | ${'codeDepositedDetails'}
${'protocolsDeposited'} | ${'protocolsDepositedDetails'}
${'labMaterialsRegistered'} | ${'labMaterialsRegisteredDetails'}
${'availabilityStatement'} | ${'availabilityStatementDetails'}
`(
'should return $fieldDetails as undefined if $field is Yes',
async ({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module.exports.description = 'Add additional quick check field';

module.exports.up = (migration) => {
const manuscriptVersions = migration.editContentType('manuscriptVersions');

const field = 'availabilityStatement';
const name = 'Included an Availability Statement?';

manuscriptVersions
.createField(field)
.name(name)
.type('Symbol')
.localized(false)
.required(false)
.validations([
{
in: ['Yes', 'No'],
},
])
.disabled(false)
.omitted(false);

manuscriptVersions
.createField(`${field}Details`)
.name(`${name} (Details)`)
.type('Symbol')
.localized(false)
.required(false)
.validations([])
.disabled(false)
.omitted(false);

manuscriptVersions.changeFieldControl(
`${field}Details`,
'builtin',
'singleLine',
{},
);

manuscriptVersions
.moveField(field)
.afterField('labMaterialsRegisteredDetails');
manuscriptVersions.moveField(`${field}Details`).afterField(field);
};

module.exports.down = (migration) => {
const manuscriptVersions = migration.editContentType('manuscriptVersions');

manuscriptVersions.deleteField('availabilityStatement');
manuscriptVersions.deleteField('availabilityStatementDetails');
};
6 changes: 3 additions & 3 deletions packages/contentful/src/crn/autogenerated-gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const documents = {
types.FetchInterestGroupsByUserIdDocument,
'\n query FetchLabs($limit: Int, $skip: Int, $where: LabsFilter) {\n labsCollection(limit: $limit, skip: $skip, where: $where, order: name_ASC) {\n total\n items {\n sys {\n id\n }\n name\n }\n }\n }\n':
types.FetchLabsDocument,
'\n fragment ManuscriptsContent on Manuscripts {\n sys {\n id\n }\n title\n versionsCollection(limit: 20, order: sys_publishedAt_DESC) {\n items {\n sys {\n id\n publishedAt\n firstPublishedAt\n }\n type\n lifecycle\n manuscriptFile {\n sys {\n id\n }\n fileName\n url\n }\n keyResourceTable {\n sys {\n id\n }\n fileName\n url\n }\n additionalFilesCollection(limit: 10) {\n items {\n sys {\n id\n }\n fileName\n url\n }\n }\n preprintDoi\n publicationDoi\n requestingApcCoverage\n submitterName\n submissionDate\n otherDetails\n acknowledgedGrantNumber\n acknowledgedGrantNumberDetails\n asapAffiliationIncluded\n asapAffiliationIncludedDetails\n manuscriptLicense\n manuscriptLicenseDetails\n datasetsDeposited\n datasetsDepositedDetails\n codeDeposited\n codeDepositedDetails\n protocolsDeposited\n protocolsDepositedDetails\n labMaterialsRegistered\n labMaterialsRegisteredDetails\n teamsCollection(limit: 10) {\n items {\n sys {\n id\n }\n displayName\n inactiveSince\n }\n }\n labsCollection(limit: 10) {\n items {\n sys {\n id\n }\n name\n }\n }\n createdBy {\n sys {\n id\n }\n firstName\n nickname\n lastName\n alumniSinceDate\n avatar {\n url\n }\n teamsCollection(limit: 3) {\n items {\n team {\n sys {\n id\n }\n displayName\n }\n }\n }\n }\n linkedFrom {\n complianceReportsCollection(limit: 1) {\n items {\n url\n description\n }\n }\n }\n }\n }\n }\n':
'\n fragment ManuscriptsContent on Manuscripts {\n sys {\n id\n }\n title\n versionsCollection(limit: 20, order: sys_publishedAt_DESC) {\n items {\n sys {\n id\n publishedAt\n firstPublishedAt\n }\n type\n lifecycle\n manuscriptFile {\n sys {\n id\n }\n fileName\n url\n }\n keyResourceTable {\n sys {\n id\n }\n fileName\n url\n }\n additionalFilesCollection(limit: 10) {\n items {\n sys {\n id\n }\n fileName\n url\n }\n }\n preprintDoi\n publicationDoi\n requestingApcCoverage\n submitterName\n submissionDate\n otherDetails\n acknowledgedGrantNumber\n acknowledgedGrantNumberDetails\n asapAffiliationIncluded\n asapAffiliationIncludedDetails\n manuscriptLicense\n manuscriptLicenseDetails\n datasetsDeposited\n datasetsDepositedDetails\n codeDeposited\n codeDepositedDetails\n protocolsDeposited\n protocolsDepositedDetails\n labMaterialsRegistered\n labMaterialsRegisteredDetails\n availabilityStatement\n availabilityStatementDetails\n teamsCollection(limit: 10) {\n items {\n sys {\n id\n }\n displayName\n inactiveSince\n }\n }\n labsCollection(limit: 10) {\n items {\n sys {\n id\n }\n name\n }\n }\n createdBy {\n sys {\n id\n }\n firstName\n nickname\n lastName\n alumniSinceDate\n avatar {\n url\n }\n teamsCollection(limit: 3) {\n items {\n team {\n sys {\n id\n }\n displayName\n }\n }\n }\n }\n linkedFrom {\n complianceReportsCollection(limit: 1) {\n items {\n url\n description\n }\n }\n }\n }\n }\n }\n':
types.ManuscriptsContentFragmentDoc,
'\n query FetchManuscriptById($id: String!) {\n manuscripts(id: $id) {\n ...ManuscriptsContent\n teamsCollection(limit: 10) {\n items {\n sys {\n id\n }\n }\n }\n }\n }\n \n':
types.FetchManuscriptByIdDocument,
Expand Down Expand Up @@ -333,8 +333,8 @@ export function gql(
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function gql(
source: '\n fragment ManuscriptsContent on Manuscripts {\n sys {\n id\n }\n title\n versionsCollection(limit: 20, order: sys_publishedAt_DESC) {\n items {\n sys {\n id\n publishedAt\n firstPublishedAt\n }\n type\n lifecycle\n manuscriptFile {\n sys {\n id\n }\n fileName\n url\n }\n keyResourceTable {\n sys {\n id\n }\n fileName\n url\n }\n additionalFilesCollection(limit: 10) {\n items {\n sys {\n id\n }\n fileName\n url\n }\n }\n preprintDoi\n publicationDoi\n requestingApcCoverage\n submitterName\n submissionDate\n otherDetails\n acknowledgedGrantNumber\n acknowledgedGrantNumberDetails\n asapAffiliationIncluded\n asapAffiliationIncludedDetails\n manuscriptLicense\n manuscriptLicenseDetails\n datasetsDeposited\n datasetsDepositedDetails\n codeDeposited\n codeDepositedDetails\n protocolsDeposited\n protocolsDepositedDetails\n labMaterialsRegistered\n labMaterialsRegisteredDetails\n teamsCollection(limit: 10) {\n items {\n sys {\n id\n }\n displayName\n inactiveSince\n }\n }\n labsCollection(limit: 10) {\n items {\n sys {\n id\n }\n name\n }\n }\n createdBy {\n sys {\n id\n }\n firstName\n nickname\n lastName\n alumniSinceDate\n avatar {\n url\n }\n teamsCollection(limit: 3) {\n items {\n team {\n sys {\n id\n }\n displayName\n }\n }\n }\n }\n linkedFrom {\n complianceReportsCollection(limit: 1) {\n items {\n url\n description\n }\n }\n }\n }\n }\n }\n',
): (typeof documents)['\n fragment ManuscriptsContent on Manuscripts {\n sys {\n id\n }\n title\n versionsCollection(limit: 20, order: sys_publishedAt_DESC) {\n items {\n sys {\n id\n publishedAt\n firstPublishedAt\n }\n type\n lifecycle\n manuscriptFile {\n sys {\n id\n }\n fileName\n url\n }\n keyResourceTable {\n sys {\n id\n }\n fileName\n url\n }\n additionalFilesCollection(limit: 10) {\n items {\n sys {\n id\n }\n fileName\n url\n }\n }\n preprintDoi\n publicationDoi\n requestingApcCoverage\n submitterName\n submissionDate\n otherDetails\n acknowledgedGrantNumber\n acknowledgedGrantNumberDetails\n asapAffiliationIncluded\n asapAffiliationIncludedDetails\n manuscriptLicense\n manuscriptLicenseDetails\n datasetsDeposited\n datasetsDepositedDetails\n codeDeposited\n codeDepositedDetails\n protocolsDeposited\n protocolsDepositedDetails\n labMaterialsRegistered\n labMaterialsRegisteredDetails\n teamsCollection(limit: 10) {\n items {\n sys {\n id\n }\n displayName\n inactiveSince\n }\n }\n labsCollection(limit: 10) {\n items {\n sys {\n id\n }\n name\n }\n }\n createdBy {\n sys {\n id\n }\n firstName\n nickname\n lastName\n alumniSinceDate\n avatar {\n url\n }\n teamsCollection(limit: 3) {\n items {\n team {\n sys {\n id\n }\n displayName\n }\n }\n }\n }\n linkedFrom {\n complianceReportsCollection(limit: 1) {\n items {\n url\n description\n }\n }\n }\n }\n }\n }\n'];
source: '\n fragment ManuscriptsContent on Manuscripts {\n sys {\n id\n }\n title\n versionsCollection(limit: 20, order: sys_publishedAt_DESC) {\n items {\n sys {\n id\n publishedAt\n firstPublishedAt\n }\n type\n lifecycle\n manuscriptFile {\n sys {\n id\n }\n fileName\n url\n }\n keyResourceTable {\n sys {\n id\n }\n fileName\n url\n }\n additionalFilesCollection(limit: 10) {\n items {\n sys {\n id\n }\n fileName\n url\n }\n }\n preprintDoi\n publicationDoi\n requestingApcCoverage\n submitterName\n submissionDate\n otherDetails\n acknowledgedGrantNumber\n acknowledgedGrantNumberDetails\n asapAffiliationIncluded\n asapAffiliationIncludedDetails\n manuscriptLicense\n manuscriptLicenseDetails\n datasetsDeposited\n datasetsDepositedDetails\n codeDeposited\n codeDepositedDetails\n protocolsDeposited\n protocolsDepositedDetails\n labMaterialsRegistered\n labMaterialsRegisteredDetails\n availabilityStatement\n availabilityStatementDetails\n teamsCollection(limit: 10) {\n items {\n sys {\n id\n }\n displayName\n inactiveSince\n }\n }\n labsCollection(limit: 10) {\n items {\n sys {\n id\n }\n name\n }\n }\n createdBy {\n sys {\n id\n }\n firstName\n nickname\n lastName\n alumniSinceDate\n avatar {\n url\n }\n teamsCollection(limit: 3) {\n items {\n team {\n sys {\n id\n }\n displayName\n }\n }\n }\n }\n linkedFrom {\n complianceReportsCollection(limit: 1) {\n items {\n url\n description\n }\n }\n }\n }\n }\n }\n',
): (typeof documents)['\n fragment ManuscriptsContent on Manuscripts {\n sys {\n id\n }\n title\n versionsCollection(limit: 20, order: sys_publishedAt_DESC) {\n items {\n sys {\n id\n publishedAt\n firstPublishedAt\n }\n type\n lifecycle\n manuscriptFile {\n sys {\n id\n }\n fileName\n url\n }\n keyResourceTable {\n sys {\n id\n }\n fileName\n url\n }\n additionalFilesCollection(limit: 10) {\n items {\n sys {\n id\n }\n fileName\n url\n }\n }\n preprintDoi\n publicationDoi\n requestingApcCoverage\n submitterName\n submissionDate\n otherDetails\n acknowledgedGrantNumber\n acknowledgedGrantNumberDetails\n asapAffiliationIncluded\n asapAffiliationIncludedDetails\n manuscriptLicense\n manuscriptLicenseDetails\n datasetsDeposited\n datasetsDepositedDetails\n codeDeposited\n codeDepositedDetails\n protocolsDeposited\n protocolsDepositedDetails\n labMaterialsRegistered\n labMaterialsRegisteredDetails\n availabilityStatement\n availabilityStatementDetails\n teamsCollection(limit: 10) {\n items {\n sys {\n id\n }\n displayName\n inactiveSince\n }\n }\n labsCollection(limit: 10) {\n items {\n sys {\n id\n }\n name\n }\n }\n createdBy {\n sys {\n id\n }\n firstName\n nickname\n lastName\n alumniSinceDate\n avatar {\n url\n }\n teamsCollection(limit: 3) {\n items {\n team {\n sys {\n id\n }\n displayName\n }\n }\n }\n }\n linkedFrom {\n complianceReportsCollection(limit: 1) {\n items {\n url\n description\n }\n }\n }\n }\n }\n }\n'];
/**
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand Down
Loading

0 comments on commit 3db2826

Please sign in to comment.