From f1c1290fe70f5ea1309dd33c91aaf221bfb78da1 Mon Sep 17 00:00:00 2001 From: ritvje Date: Sun, 17 Jul 2016 14:06:07 +0300 Subject: [PATCH 1/5] Add properties for nickname (partionimi) & country & import from kuksa --- src/common/models/kuksa-participant.json | 12 ++++++++++++ src/common/models/participant.json | 24 ++++++++++++++++++++++++ src/kuksa-integration/fetch-data.js | 1 + src/kuksa-integration/rebuild-tables.js | 2 ++ 4 files changed, 39 insertions(+) diff --git a/src/common/models/kuksa-participant.json b/src/common/models/kuksa-participant.json index 77f86e8d..885cfa6c 100644 --- a/src/common/models/kuksa-participant.json +++ b/src/common/models/kuksa-participant.json @@ -58,6 +58,18 @@ "nullable": "YES" } }, + "nickname": { + "type": "string", + "required": false, + "postgresql": { + "columnName": "nickname", + "dataType": "character varying", + "dataLength": 255, + "dataPrecision": null, + "dataScale": null, + "nullable": "YES" + } + }, "dateOfBirth": { "type": "date", "postgresql": { diff --git a/src/common/models/participant.json b/src/common/models/participant.json index 0a064f1b..d90ef625 100644 --- a/src/common/models/participant.json +++ b/src/common/models/participant.json @@ -46,6 +46,18 @@ "nullable": "NO" } }, + "nickname": { + "type": "string", + "required": false, + "postgresql": { + "columnName": "nickname", + "dataType": "character varying", + "dataLength": 255, + "dataPrecision": null, + "dataScale": null, + "nullable": "YES" + } + }, "nonScout": { "type": "boolean", "required": true, @@ -148,6 +160,18 @@ "nullable": "YES" } }, + "country": { + "type": "string", + "required": false, + "postgresql": { + "columnName": "country", + "dataType": "character varying", + "dataLength": 255, + "dataPrecision": null, + "dataScale": null, + "nullable": "YES" + } + }, "staffPosition": { "type": "string", "postgresql": { diff --git a/src/kuksa-integration/fetch-data.js b/src/kuksa-integration/fetch-data.js index 7c5e6161..3b8aac8a 100644 --- a/src/kuksa-integration/fetch-data.js +++ b/src/kuksa-integration/fetch-data.js @@ -126,6 +126,7 @@ function transferParticipants(eventApi) { id: participant.id, firstName: participant.firstName || 'x', lastName: participant.lastName || 'x', + nickname: participant.nickname, memberNumber: participant.memberNumber, dateOfBirth: new Date(participant.birthDate), phoneNumber: participant.phoneNumber, diff --git a/src/kuksa-integration/rebuild-tables.js b/src/kuksa-integration/rebuild-tables.js index be609a34..0c3822d8 100644 --- a/src/kuksa-integration/rebuild-tables.js +++ b/src/kuksa-integration/rebuild-tables.js @@ -88,6 +88,7 @@ function rebuildParticipantsTable() { participantId: participant.id, firstName: participant.firstName, lastName: participant.lastName, + nickname: participant.nickname, memberNumber: participant.memberNumber, dateOfBirth: participant.dateOfBirth, billedDate: getPaymentStatus(participant.paymentStatus, 'billed'), @@ -101,6 +102,7 @@ function rebuildParticipantsTable() { campGroup: _.get(participant, 'campGroup.name') || 'Muu', subCamp: getSubCamp(participant), village: _.get(participant, 'village.name') || 'Muu', + country: _.get(participant, 'localGroup.country') || 'Suomi', ageGroup: getSelectionForGroup(participant, 'Osallistun seuraavan ikäkauden ohjelmaan:') || 'Muu', // Not a scout if a) no finnish member number 2) not part of international group ("local group") nonScout: !participant.memberNumber && !_.get(participant, 'localGroup.name'), From 8ee1b0d2dcbf47aa896a53f004a5291f10e54729 Mon Sep 17 00:00:00 2001 From: ritvje Date: Sun, 17 Jul 2016 14:22:12 +0300 Subject: [PATCH 2/5] Add country & nickname to participant details page --- .../ParticipantDetailsPage/ParticipantDetailsPage.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx b/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx index 1d646bea..c8a3f3e1 100644 --- a/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx +++ b/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx @@ -61,12 +61,14 @@ export function getParticipantDetailsPage(participantStore, participantActions) const { firstName, lastName, + nickname, dateOfBirth, nonScout, billedDate, paidDate, memberNumber, homeCity, + country, email, phoneNumber, ageGroup, @@ -89,7 +91,7 @@ export function getParticipantDetailsPage(participantStore, participantActions) } = this.state.participantDetails; const participantName = `${firstName} ${lastName}`; - const participantStatus = internationalGuest ? 'KV-osallistuja' : ( nonScout ? 'EVP' : `Partiolainen (jäsennumero: ${memberNumber})` ); + const participantStatus = internationalGuest ? `KV-osallistuja, ${country}` : ( nonScout ? 'EVP' : `Partiolainen (jäsennumero: ${memberNumber})` ); const formattedBilledDate = billedDate ? moment(billedDate).format('D.M.YYYY') : '–'; const formattedPaidDate = paidDate ? moment(paidDate).format('D.M.YYYY') : '–'; @@ -115,6 +117,7 @@ export function getParticipantDetailsPage(participantStore, participantActions)

{ participantName } + { nickname || ''} (synt. { moment(dateOfBirth).format('D.M.YYYY') })

{ participantStatus }

@@ -152,7 +155,7 @@ export function getParticipantDetailsPage(participantStore, participantActions) { swimmingSkill ?
Uimataito
: '' } { swimmingSkill ?
{ swimmingSkill }
: '' }
Lippukunta
-
{ localGroup }
+
{ `${localGroup}, ${country}` }
Leirilippukunta
{ campGroup }
Kylä
From f981ab12191a52ed3b5def80bc6096921d04f842 Mon Sep 17 00:00:00 2001 From: ritvje Date: Sun, 17 Jul 2016 14:32:28 +0300 Subject: [PATCH 3/5] Add village & accommodation to list page & filter to village --- .../ParticipantListPage/ParticipantListPage.jsx | 2 ++ .../components/ParticipantListPage/ParticipantRow.jsx | 4 ++++ .../containers/QuickFilterContainer.jsx | 8 +++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/client/components/ParticipantListPage/ParticipantListPage.jsx b/src/client/components/ParticipantListPage/ParticipantListPage.jsx index 4a238598..78e18b85 100644 --- a/src/client/components/ParticipantListPage/ParticipantListPage.jsx +++ b/src/client/components/ParticipantListPage/ParticipantListPage.jsx @@ -213,7 +213,9 @@ export function getParticipantListPage(participantStore, participantActions, sea email: 'Sähköposti', phoneNumber: 'Puhelinnumero', ageGroup: 'Ikäkausi', + accommodation: 'Majoitus', localGroup: 'Lippukunta', + village: 'Kylä', subCamp: 'Alaleiri', campGroup: 'Leirilippukunta', }; diff --git a/src/client/components/ParticipantListPage/ParticipantRow.jsx b/src/client/components/ParticipantListPage/ParticipantRow.jsx index 282aedcc..221d4ee0 100644 --- a/src/client/components/ParticipantListPage/ParticipantRow.jsx +++ b/src/client/components/ParticipantListPage/ParticipantRow.jsx @@ -55,6 +55,8 @@ export class ParticipantRow extends React.Component { localGroup, subCamp, campGroup, + village, + accommodation, presence, } = this.props.participant; @@ -87,7 +89,9 @@ export class ParticipantRow extends React.Component { { formatNullableString(email) } { formatNullableString(phoneNumber) } { ageGroup } + { formatNullableString(accommodation) } { localGroup } + { village } { subCamp } { campGroup } diff --git a/src/client/components/ParticipantListPage/containers/QuickFilterContainer.jsx b/src/client/components/ParticipantListPage/containers/QuickFilterContainer.jsx index 661625fe..81ecfb64 100644 --- a/src/client/components/ParticipantListPage/containers/QuickFilterContainer.jsx +++ b/src/client/components/ParticipantListPage/containers/QuickFilterContainer.jsx @@ -25,7 +25,7 @@ export function getQuickFilterContainer(participantStore, participantActions, se } function QuickFilterContainer(props, context) { - const currentSelection = getCurrentSelection(['textSearch', 'ageGroup', 'subCamp', 'localGroup', 'campGroup', 'presence'], props.filter); + const currentSelection = getCurrentSelection(['textSearch', 'ageGroup', 'subCamp', 'localGroup', 'campGroup', 'presence', 'village'], props.filter); function resetFilters(event) { event.preventDefault(); @@ -66,6 +66,12 @@ export function getQuickFilterContainer(participantStore, participantActions, se label="Alaleiri" property="subCamp" /> + Date: Sun, 17 Jul 2016 14:41:08 +0300 Subject: [PATCH 4/5] Fix linter err --- .../ParticipantDetailsPage/ParticipantDetailsPage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx b/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx index c8a3f3e1..6a21c3b3 100644 --- a/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx +++ b/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx @@ -117,7 +117,7 @@ export function getParticipantDetailsPage(participantStore, participantActions)

{ participantName } - { nickname || ''} + { nickname || '' } (synt. { moment(dateOfBirth).format('D.M.YYYY') })

{ participantStatus }

From 32381a98672d8da0d7c23e4d71552fd31fed585a Mon Sep 17 00:00:00 2001 From: ritvje Date: Sun, 17 Jul 2016 14:45:08 +0300 Subject: [PATCH 5/5] Change column label --- .../components/ParticipantListPage/ParticipantListPage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/components/ParticipantListPage/ParticipantListPage.jsx b/src/client/components/ParticipantListPage/ParticipantListPage.jsx index 78e18b85..acd36671 100644 --- a/src/client/components/ParticipantListPage/ParticipantListPage.jsx +++ b/src/client/components/ParticipantListPage/ParticipantListPage.jsx @@ -213,7 +213,7 @@ export function getParticipantListPage(participantStore, participantActions, sea email: 'Sähköposti', phoneNumber: 'Puhelinnumero', ageGroup: 'Ikäkausi', - accommodation: 'Majoitus', + accommodation: 'Majoittuminen', localGroup: 'Lippukunta', village: 'Kylä', subCamp: 'Alaleiri',