Skip to content

Commit

Permalink
Fix #226 - dropping redundant date information in activities import
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Jan 9, 2017
1 parent 188e95c commit 4908fe0
Showing 1 changed file with 2 additions and 33 deletions.
35 changes: 2 additions & 33 deletions scripts/import/files/activities.js
Expand Up @@ -181,15 +181,11 @@ module.exports = {
}]
};

if (line.startDate) {
if (line.startDate)
activityInfo.startDate = line.startDate;
activityInfo.people[0].startDate = line.startDate;
}

if (line.endDate) {
if (line.endDate)
activityInfo.endDate = line.endDate;
activityInfo.people[0].endDate = line.endDate;
}

// Target organization
if (line.organizations) {
Expand All @@ -199,11 +195,6 @@ module.exports = {
role: 'orgadaccueil'
};

if (line.startDate)
linkInfo.startDate = line.startDate;
if (line.endDate)
linkInfo.endDate = line.endDate;

activityInfo.organizations.push(linkInfo);
});
}
Expand All @@ -215,11 +206,6 @@ module.exports = {
role: 'orgadorigine'
};

if (line.startDate)
linkInfo.startDate = line.startDate;
if (line.endDate)
linkInfo.endDate = line.endDate;

activityInfo.organizations.push(linkInfo);
}

Expand All @@ -236,11 +222,6 @@ module.exports = {
organizationTypes: ['inconnue']
};

if (line.startDate)
linkInfo.startDate = line.startDate;
if (line.endDate)
linkInfo.endDate = line.endDate;

activityInfo.organizations.push(linkInfo);
}

Expand Down Expand Up @@ -554,12 +535,10 @@ module.exports = {

if (phd.startDate) {
activity.startDate = phd.startDate;
activity.people[0].startDate = phd.startDate;
}

if (phd.endDate) {
activity.endDate = phd.endDate;
activity.people[0].endDate = phd.endDate;
}

if (phd.subject)
Expand Down Expand Up @@ -732,12 +711,10 @@ module.exports = {

if (hdr.startDate) {
activity.startDate = hdr.startDate;
activity.people[0].startDate = hdr.startDate;
}

if (hdr.endDate) {
activity.endDate = hdr.endDate;
activity.people[0].endDate = hdr.endDate;
}

if (hdr.subject)
Expand Down Expand Up @@ -1035,14 +1012,6 @@ module.exports = {
activity[prop] = line[prop];
});

[
'startDate',
'endDate'
].forEach(prop => {
if (line[prop])
activity.people[0][prop] = line[prop];
});

activities.push(activity);
});

Expand Down

0 comments on commit 4908fe0

Please sign in to comment.