From 84e46809064f609dcb570a355a11ebb11f626829 Mon Sep 17 00:00:00 2001 From: maxceem Date: Wed, 17 Jul 2019 20:44:10 +0800 Subject: [PATCH 1/4] [HOTFIX] [DEV] Filter skills ignore case of categories (#3187) * fix: filter skills inside SkillsQuestion component ignoring case of skill categories which come from skill API * improve fix to make sure it's not broken if data from skills API is not complete --- .../detail/components/SkillsQuestion/SkillsQuestion.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/projects/detail/components/SkillsQuestion/SkillsQuestion.jsx b/src/projects/detail/components/SkillsQuestion/SkillsQuestion.jsx index e0f5b6321..ada9585e5 100644 --- a/src/projects/detail/components/SkillsQuestion/SkillsQuestion.jsx +++ b/src/projects/detail/components/SkillsQuestion/SkillsQuestion.jsx @@ -60,8 +60,8 @@ class SkillsQuestion extends React.Component { const mappedSelectedCategories = _.map(selectedCategories, (category) => categoriesMapping[category] ? categoriesMapping[category].toLowerCase() : null) const currentValues = getValue() || [] - const prevAvailableOptions = options.filter(option => _.intersection(option.categories, mappedPrevSelectedCategories).length > 0) - const nextAvailableOptions = options.filter(option => _.intersection(option.categories, mappedSelectedCategories).length > 0) + const prevAvailableOptions = options.filter(option => _.intersection((option.categories || []).map(c => c.toLowerCase()), mappedPrevSelectedCategories).length > 0) + const nextAvailableOptions = options.filter(option => _.intersection((option.categories || []).map(c => c.toLowerCase()), mappedSelectedCategories).length > 0) const prevValues = currentValues.filter(skill => _.some(prevAvailableOptions, skill)) const nextValues = currentValues.filter(skill => _.some(nextAvailableOptions, skill)) @@ -114,7 +114,7 @@ class SkillsQuestion extends React.Component { const selectedCategories = _.get(currentProjectData, categoriesField, []) const mappedCategories = _.map(selectedCategories, (category) => categoriesMapping[category] ? categoriesMapping[category].toLowerCase() : null) const availableOptions = options - .filter(option => _.intersection(option.categories, mappedCategories).length > 0) + .filter(option => _.intersection((option.categories || []).map(c => c.toLowerCase()), mappedCategories).length > 0) .map( option => _.pick(option, ['id', 'name']) ) From aaef15116a777e99bc5fa7dedbbb0eb64474b033 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Thu, 18 Jul 2019 13:02:27 +0530 Subject: [PATCH 2/4] =?UTF-8?q?Github=20issue#3189,=20Unable=20to=20activa?= =?UTF-8?q?te=20a=20phase=20without=20explicitly=20setting=20start=20date?= =?UTF-8?q?=20to=20today's=20date=20=E2=80=94=20Calculate=20the=20end=20da?= =?UTF-8?q?te=20as=20well=20when=20activating=20the=20phase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/projects/actions/project.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/projects/actions/project.js b/src/projects/actions/project.js index 8d04333df..ffa43fe4d 100644 --- a/src/projects/actions/project.js +++ b/src/projects/actions/project.js @@ -342,7 +342,9 @@ export function updatePhase(projectId, phaseId, updatedProps, phaseIndex) { const startDateChanged = updatedProps.startDate ? updatedProps.startDate.diff(phaseStartDate) : null const phaseActivated = phaseStatusChanged && updatedProps.status === PHASE_STATUS_ACTIVE if (phaseActivated) { - updatedProps.startDate = moment().hours(0).minutes(0).seconds(0).milliseconds(0) + const duration = updatedProps.duration ? updatedProps.duration : phase.duration + updatedProps.startDate = moment().utc().hours(0).minutes(0).seconds(0).milliseconds(0).toISOString() + updatedProps.endDate = moment(updatedProps.startDate).add(duration - 1, 'days').toISOString() } return dispatch({ From d4bbef8ae7d14bc491aa6b2490c017455f5c601a Mon Sep 17 00:00:00 2001 From: vikasrohit Date: Thu, 18 Jul 2019 15:21:38 +0530 Subject: [PATCH 3/4] Hotfix/post release 2.4.13.2 (#3191) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [HOTFIX] [PROD] Filter skills ignore case of categories (#3186) * fix: filter skills inside SkillsQuestion component ignoring case of skill categories which come from skill API * improve fix to make sure it's not broken if data from skills API is not complete * Github issue#3189, Unable to activate a phase without explicitly setting start date to today's date — Calculate the end date as well when activating the phase --- src/projects/actions/project.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/projects/actions/project.js b/src/projects/actions/project.js index 8d04333df..ffa43fe4d 100644 --- a/src/projects/actions/project.js +++ b/src/projects/actions/project.js @@ -342,7 +342,9 @@ export function updatePhase(projectId, phaseId, updatedProps, phaseIndex) { const startDateChanged = updatedProps.startDate ? updatedProps.startDate.diff(phaseStartDate) : null const phaseActivated = phaseStatusChanged && updatedProps.status === PHASE_STATUS_ACTIVE if (phaseActivated) { - updatedProps.startDate = moment().hours(0).minutes(0).seconds(0).milliseconds(0) + const duration = updatedProps.duration ? updatedProps.duration : phase.duration + updatedProps.startDate = moment().utc().hours(0).minutes(0).seconds(0).milliseconds(0).toISOString() + updatedProps.endDate = moment(updatedProps.startDate).add(duration - 1, 'days').toISOString() } return dispatch({ From 274dd9e46d204f7c9fcb1c4588490eaac8a09407 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Thu, 18 Jul 2019 16:52:59 +0530 Subject: [PATCH 4/4] Fixed bug with last hot fix --- src/projects/actions/project.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/projects/actions/project.js b/src/projects/actions/project.js index ffa43fe4d..10291c3be 100644 --- a/src/projects/actions/project.js +++ b/src/projects/actions/project.js @@ -343,8 +343,8 @@ export function updatePhase(projectId, phaseId, updatedProps, phaseIndex) { const phaseActivated = phaseStatusChanged && updatedProps.status === PHASE_STATUS_ACTIVE if (phaseActivated) { const duration = updatedProps.duration ? updatedProps.duration : phase.duration - updatedProps.startDate = moment().utc().hours(0).minutes(0).seconds(0).milliseconds(0).toISOString() - updatedProps.endDate = moment(updatedProps.startDate).add(duration - 1, 'days').toISOString() + updatedProps.startDate = moment().utc().hours(0).minutes(0).seconds(0).milliseconds(0).format('YYYY-MM-DD') + updatedProps.endDate = moment(updatedProps.startDate).add(duration - 1, 'days').format('YYYY-MM-DD') } return dispatch({ @@ -388,7 +388,7 @@ export function updatePhase(projectId, phaseId, updatedProps, phaseIndex) { timeline.id, { name: timeline.name, - startDate: updatedProps.startDate.format('YYYY-MM-DD'), + startDate: updatedProps.startDate, reference: timeline.reference, referenceId: timeline.referenceId, }