From d8fb0694479c220056a18e426e3d72c24dda2a3d Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Wed, 31 Jan 2024 10:45:22 +0000 Subject: [PATCH 1/3] fixed the import section with list collector bug --- eq-author-api/schema/resolvers/importing.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eq-author-api/schema/resolvers/importing.js b/eq-author-api/schema/resolvers/importing.js index c546684b11..0a5d37e9fe 100644 --- a/eq-author-api/schema/resolvers/importing.js +++ b/eq-author-api/schema/resolvers/importing.js @@ -136,7 +136,10 @@ module.exports = { page.routing = null; page.skipConditions = null; - if (page.pageType !== "ListCollectorPage") { + if ( + page.pageType !== "ListCollectorPage" && + page.answers !== undefined + ) { page.answers.forEach((answer) => { return stripQCodes(answer); }); @@ -152,6 +155,7 @@ module.exports = { } }); }); + // Fix for missing validation error after importing repeating section if (section.repeatingSectionListId) { section.repeatingSectionListId = ""; From 5ea3aca03d6db707495c0c668eae0bbe70bcdb6b Mon Sep 17 00:00:00 2001 From: farres1 Date: Wed, 31 Jan 2024 11:12:12 +0000 Subject: [PATCH 2/3] Fix refresh required when importing section with list collector --- eq-author/src/graphql/importSections.graphql | 52 ++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/eq-author/src/graphql/importSections.graphql b/eq-author/src/graphql/importSections.graphql index b9854d28fc..bafc0e022c 100644 --- a/eq-author/src/graphql/importSections.graphql +++ b/eq-author/src/graphql/importSections.graphql @@ -74,6 +74,58 @@ mutation ImportSections($input: ImportSectionsInput!) { ...Comment } } + ... on ListCollectorQualifierPage { + id + answers { + id + ... on MultipleChoiceAnswer { + ...Answer + options { + ...Option + } + mutuallyExclusiveOption { + id + } + } + } + comments { + ...Comment + } + } + ... on ListCollectorAddItemPage { + id + description + descriptionEnabled + guidance + guidanceEnabled + definitionLabel + definitionContent + definitionEnabled + additionalInfoLabel + additionalInfoContent + additionalInfoEnabled + comments { + ...Comment + } + } + ... on ListCollectorConfirmationPage { + id + answers { + id + ... on MultipleChoiceAnswer { + ...Answer + options { + ...Option + } + mutuallyExclusiveOption { + id + } + } + } + comments { + ...Comment + } + } } } } From ad5e26d00eaa8f0bbbe62e1b443e7bf512b57e2c Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Fri, 2 Feb 2024 10:29:27 +0000 Subject: [PATCH 3/3] added code to remove folder listId to empty string --- eq-author-api/schema/resolvers/importing.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eq-author-api/schema/resolvers/importing.js b/eq-author-api/schema/resolvers/importing.js index 0a5d37e9fe..449b27217a 100644 --- a/eq-author-api/schema/resolvers/importing.js +++ b/eq-author-api/schema/resolvers/importing.js @@ -131,6 +131,9 @@ module.exports = { section.displayConditions = null; section.questionnaireId = ctx.questionnaire.id; section.folders.forEach((folder) => { + if (folder.listId) { + folder.listId = ""; + } folder.skipConditions = null; folder.pages.forEach((page) => { page.routing = null;