Skip to content

Commit

Permalink
KAAV-1473 generate all values to vis timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
henrihaapalasiili committed Jun 25, 2024
1 parent f3b3a98 commit b691926
Show file tree
Hide file tree
Showing 4 changed files with 233 additions and 44 deletions.
3 changes: 2 additions & 1 deletion src/components/ProjectTimeline/TimelineModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const TimelineModal = ({ open,group,content,deadlinegroup,deadlines,openDialog,v
const renderedSections = []
sections.forEach(subsection => {
const attr = subsection?.attributes
console.log('attr', attr, deadlinegroup)
if(attr[deadlinegroup]){
renderedSections.push(
<Tabs key={"tab" + sectionIndex}>
Expand All @@ -124,7 +125,7 @@ const TimelineModal = ({ open,group,content,deadlinegroup,deadlines,openDialog,v
})
return renderedSections
}

console.log('deadlineSections', deadlineSections)
const title = deadlineSections.find(section => section?.id === group)?.title
return (
<Modal open={open} size={'large'} className='timeline-edit-right'>
Expand Down
93 changes: 89 additions & 4 deletions src/components/ProjectTimeline/VisTimeline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,28 @@
}
}
}
.inner,.inner-end{
.inner-end{
z-index: 1000;
pointer-events: auto;
border-width: 0;
height: $size24;
border-radius: 15px;
.vis-item-overflow{
border: 1px solid #000000;
background: #fff;
border-radius: 15px;
.vis-item-content{
pointer-events: auto;
padding:0;
}
}
}

.board{
//Makes range item apper to be two single items
.vis-item-overflow{
height: $size5;
border-top: $size4 dotted rgba(0, 0, 0, .95);
border-top: $size4 solid rgba(0, 0, 0, .95);
color: #fff;
background-color: #fff;
width: 100%;
Expand All @@ -82,17 +97,73 @@
padding:0;
}
}
.vis-drag-left,.vis-drag-right{
.vis-drag-left{
height: $size18 !important;
width: $size18 !important;
background-color:#f2f2f2;
border-radius: 50%;
top: -8px !important;
display: inline-block;
border: $size1 solid #1a1a1a;
border-radius: 8px;
padding: 5px;
background-color: #fff;
}
.vis-drag-right{
height: $size18 !important;
width: $size18 !important;
background-color:#f2f2f2;
border-radius: 50%;
top: -8px !important;
display: inline-block;
border: $size1 solid black;
border: $size1 solid #fff;
border-radius: 8px;
padding: 5px;
background-color: #1a1a1a;
box-shadow: 0 0 0 2px #1a1a1a;
}
}

.phase-length{
z-index: 1000;
pointer-events: auto;
border-width: 0;
height: $size24;
.vis-item-overflow{
border: 1px solid #000000;
background: #fff;
border-radius: 6px;
.vis-item-content{
pointer-events: auto;
padding:0;
}
}
}

.vis-dot-board{
position: absolute;
padding: 5px;
border-width: 1px !important;
border-style: solid;
border-radius: 8px;
background-color: #1a1a1a;
border-color: #fff;
box-shadow: 0 0 0 2px #1a1a1a;
}

.vis-dot{
position: absolute;
padding: 0px;
border-width: 1px !important;
border-style: solid;
border-radius: 12px;
position: absolute;
background-color: #fff;
border-color: #1a1a1a;
height: 24px;
width: 24px;
}

.locked{
background-color: rgba(255, 0, 0, 0.2);
}
Expand Down Expand Up @@ -331,22 +402,36 @@

.color-tram{
background-color: $color_tram !important;
height: $size8;
}
.color-summer{
background-color: $color-summer !important;
height: $size8;
}
.color-metro{
background-color: $color_metro !important;
height: $size8;
}
.color-bus{
background-color: $color_bus !important;
color:white;
height: $size8;
}
.color-gold{
background-color: $color_gold !important;
height: $size8;
}
.color-fog{
background-color: $color_fog !important;
height: $size8;
}
.color-green{
background-color: $color_phase_principles !important;
height: $size8;
}
.color-suomenlinna{
background-color: $color_phase_draft !important;
height: $size8;
}

.vis-foreground .vis-group {
Expand Down
14 changes: 10 additions & 4 deletions src/components/ProjectTimeline/VisTimelineGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,17 @@ const VisTimelineGroup = forwardRef(({ groups, items, deadlines, visValues, dead
const esillaoloCount = matchingGroups.filter(group => group.content === 'Esilläolo').length > 1 ? '_' + matchingGroups.filter(group => group.content === 'Esilläolo').length : '';
const lautakuntaCount = matchingGroups.filter(group => group.content === 'Lautakunta').length > 1 ? '_' + matchingGroups.filter(group => group.content === 'Lautakunta').length : '';
const phase = data.content.toLowerCase();

// Check if existing groups have been confirmed
const esillaoloConfirmed = Object.prototype.hasOwnProperty.call(visValRef, `vahvista_${phase}_esillaolo_alkaa${esillaoloCount}`) && visValRef[`vahvista_${phase}_esillaolo_alkaa${esillaoloCount}`] === true;
const lautakuntaConfirmed = Object.prototype.hasOwnProperty.call(visValRef, `vahvista_${phase}_lautakunnassa${lautakuntaCount}`) && visValRef[`vahvista_${phase}_lautakunnassa${lautakuntaCount}`] === true;

let esillaoloConfirmed = Object.prototype.hasOwnProperty.call(visValRef, `vahvista_${phase}_esillaolo_alkaa${esillaoloCount}`) && visValRef[`vahvista_${phase}_esillaolo_alkaa${esillaoloCount}`] === true;
let lautakuntaConfirmed = Object.prototype.hasOwnProperty.call(visValRef, `vahvista_${phase}_lautakunnassa${lautakuntaCount}`) && visValRef[`vahvista_${phase}_lautakunnassa${lautakuntaCount}`] === true;
console.log(phase)
if(phase === "periaatteet" && !(phase + "_lautakuntaan_1" in visValRef)|| phase === "luonnos" && !(phase + "_lautakuntaan_1")){
lautakuntaConfirmed = true
}
if(phase === "luonnos" && !("jarjestetaan_" + phase + "_esillaolo_1" in visValRef) || phase === "periaatteet" && !("jarjestetaan_"+phase+"_esillaolo_1" in visValRef)){
esillaoloConfirmed = true
}

// Initialize returned values
let canAddEsillaolo = false;
let nextEsillaoloClean = false;
Expand Down
Loading

0 comments on commit b691926

Please sign in to comment.