Skip to content

Commit

Permalink
KAAV-1473 vis timeline to show correct symbols on timeline when savin…
Browse files Browse the repository at this point in the history
…g luonnos phase
  • Loading branch information
henrihaapalasiili committed Aug 27, 2024
1 parent 3e07b32 commit bc21d2f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/components/ProjectTimeline/VisTimelineGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ const VisTimelineGroup = forwardRef(({ groups, items, deadlines, visValues, dead
if(key.includes("kaavaluonnos_lautakuntaan_") || key.includes("jarjestetaan_luonnos_esillaolo_") || key.includes("periaatteet_lautakuntaan_") || key.includes("jarjestetaan_periaatteet_esillaolo_")){
deleteValue = false
}
console.log("dispatch",key,deleteValue)
dispatch(change(EDIT_PROJECT_TIMETABLE_FORM, key, deleteValue));
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/components/input/DeadlineInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,18 @@ const DeadLineInput = ({
inputValue = ''
}
let currentDeadlineDate = ''
const index = input.name.match(/\d+/);
const indexString = index ? "_"+index[0] : '';

if(currentDeadline?.deadline?.attribute && attributeData[currentDeadline.deadline.attribute]){
currentDeadlineDate = attributeData[currentDeadline.deadline.attribute]
}
else if(input.name === 'ehdotus_nahtaville_aineiston_maaraaika' && attributeData['ehdotus_kylk_aineiston_maaraaika']){
inputValue = attributeData['ehdotus_kylk_aineiston_maaraaika']
}
else if(input.name === 'luonnosaineiston_maaraaika'+indexString && attributeData['kaavaluonnos_kylk_aineiston_maaraaika'+indexString]){
inputValue = attributeData['kaavaluonnos_kylk_aineiston_maaraaika'+indexString]
}
else if (currentDeadline?.date) {
currentDeadlineDate = currentDeadline.date
}
Expand Down
5 changes: 3 additions & 2 deletions src/components/project/EditProjectTimetableModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ class EditProjectTimeTableModal extends Component {
const groups = this.state.groups.get();
let className = "";
let matchingValues = Object.entries(this.props.formValues);

// Iterate over the keys
for (let key of keys) {
// Split the key into an array of substrings
Expand Down Expand Up @@ -704,6 +704,7 @@ class EditProjectTimeTableModal extends Component {
key === 'milloin_' + phase + '_' + content + '_paattyy' + indexKey ||
key === 'milloin_' + syntaxToCheck + '_' + filterContent + '_paattyy' + indexKey ||
key === phase + '_kylk_aineiston_maaraaika' + indexKey ||
key === "kaava"+phase + '_kylk_aineiston_maaraaika' + indexKey ||
key === phase + '_nahtaville_aineiston_maaraaika' + indexKey ||
key === phase + '_esillaolo_aineiston_maaraaika' + indexKey ||
key === phase + '_kylk_maaraaika' + indexKey ||
Expand Down Expand Up @@ -782,7 +783,7 @@ class EditProjectTimeTableModal extends Component {
locked: false,
phase: false,
phaseID: groupID,
start: validValues[2].value,
start: phase === "luonnos" ? validValues[3].value : validValues[2].value,
end: validValues[0].value,
title: "divider"
}
Expand Down

0 comments on commit bc21d2f

Please sign in to comment.