From 0caa4c8ac0f02399b343ab788a4bbb3e75bdd494 Mon Sep 17 00:00:00 2001 From: ritvje Date: Fri, 22 Jul 2016 09:55:10 +0300 Subject: [PATCH] Change family camp group label in kuksa import --- src/kuksa-integration/rebuild-tables.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/kuksa-integration/rebuild-tables.js b/src/kuksa-integration/rebuild-tables.js index fba8ab4d..e2b905e4 100644 --- a/src/kuksa-integration/rebuild-tables.js +++ b/src/kuksa-integration/rebuild-tables.js @@ -73,6 +73,15 @@ function rebuildParticipantsTable() { return _.get(participant, 'subCamp.name') || 'Muu'; } + function getAgeGroup(participant) { + const ageGroup = getSelectionForGroup(participant, 'Osallistun seuraavan ikäkauden ohjelmaan:') || 'Muu'; + if (ageGroup === 'perheleirin ohjelmaan (0-11v.), muistathan merkitä lisätiedot osallistumisesta \"vain perheleirin osallistujille\" -osuuteen.') { + return 'perheleiri (0-11v.)'; + } else { + return ageGroup; + } + } + console.log('Rebuilding participants table...'); return findKuksaParticipants({ @@ -107,7 +116,7 @@ function rebuildParticipantsTable() { subCamp: getSubCamp(participant), village: _.get(participant, 'village.name') || 'Muu', country: _.get(participant, 'localGroup.country') || 'Suomi', - ageGroup: getSelectionForGroup(participant, 'Osallistun seuraavan ikäkauden ohjelmaan:') || 'Muu', + ageGroup: getAgeGroup(participant), // Not a scout if a) no finnish member number 2) not part of international group ("local group") nonScout: !participant.memberNumber && !_.get(participant, 'localGroup.name'), staffPosition: getInfoForField(participant, 'Pesti'), @@ -238,4 +247,3 @@ function buildOptionTable() { })); } } -