Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/projects/actions/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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'])
)
Expand Down