Skip to content

Commit

Permalink
Merge pull request #60 from bitovi/new-ahead
Browse files Browse the repository at this point in the history
adding new and ahead status
  • Loading branch information
justinbmeyer authored Apr 22, 2024
2 parents ed2b84d + 8a9ae3e commit da799e9
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 78 deletions.
26 changes: 25 additions & 1 deletion public/css/colors.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
.color-bg-warning {
background-color: var(--warning-color)
}
.color-bg-ahead {
background-color: var(--ahead-color);
}
.color-bg-new {
background-color: var(--new-color);
}

.color-text-complete {
color: var(--complete-color);
Expand All @@ -62,6 +68,12 @@
.color-text-blocked {
color: var(--blocked-color);
}
.color-text-ahead {
color: var(--ahead-dark-color);
}
.color-text-new {
color: var(--new-color);
}
.color-text-black {
color: var(--black-color);
}
Expand All @@ -87,6 +99,11 @@
color: var(--black-color);
}

.color-text-and-bg-ahead-last-period {
background-color: var(--ahead-dark-color);
color: var(--black-color);
}

.color-text-and-bg-unknown {
background-color: var(--unknown-color);
color: var(--black-color);
Expand All @@ -100,7 +117,14 @@
background-color: var(--blocked-color);
color: var(--white-color);
}

.color-text-and-bg-ahead {
background-color: var(--ahead-color);
color: var(--black-color);
}
.color-text-and-bg-new {
background-color: var(--new-color);
color: var(--white-color);
}


.color-border-slate-900 {
Expand Down
3 changes: 3 additions & 0 deletions public/css/primitives.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
--unknown-color: #dab09280;
--notstarted-color: #97A0AF; /* N80 - Spooky ghost */
--blocked-color: rgb(242, 0, 11);
--ahead-color: #79E2F2; /* T100 - Hairy fairy */
--ahead-dark-color: #00A3BF;
--new-color: #6554C0;
--white-color: rgb(255 255 255);
--black-color: rgb(0 0 0);
--slate-900-color: rgb(17 24 39);
Expand Down
146 changes: 73 additions & 73 deletions public/dist/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/dist/main.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/dist/production.css

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion public/gantt-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ export class GanttGrid extends StacheElement {
left: "0",
right: "0",
bottom: "0",
zIndex: "1" // this shouldn't be needed
});
lastPeriodRoot.className = "py-1 lastPeriod"

Expand Down Expand Up @@ -157,12 +156,19 @@ export class GanttGrid extends StacheElement {
const behindTime = document.createElement("div");
behindTime.style.backgroundClip = "content-box";
behindTime.style.opacity = "0.9";
behindTime.style.position = "relative";
behindTime.className = "border-y-solid-1px"

if(timing && status === "behind") {
Object.assign(behindTime.style, getPositions(timing || {}).style);
behindTime.style.zIndex = 1;
behindTime.classList.add("color-text-and-bg-behind-last-period");
}
if(timing && status === "ahead") {
Object.assign(behindTime.style, getPositions(timing || {}).style);
behindTime.classList.add("color-text-and-bg-ahead-last-period");
behindTime.style.zIndex = -1;
}
return behindTime;
}

Expand Down
9 changes: 8 additions & 1 deletion public/status-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,14 @@ function timedStatus(timedRecord) {
} else if (timedRecord.lastPeriod &&
((+timedRecord.due) > WIGGLE_ROOM + (+timedRecord.lastPeriod.due)) ) {
return "behind";
} else if (timedRecord.start > new Date()) {
} else if(timedRecord.lastPeriod &&
((+timedRecord.due) + WIGGLE_ROOM < (+timedRecord.lastPeriod.due)) ) {
return "ahead";
} else if(!timedRecord.lastPeriod) {
return "new";
}

if (timedRecord.start > new Date()) {
return "notstarted"
}
else {
Expand Down
2 changes: 2 additions & 0 deletions public/timeline-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,10 @@ export class TimelineReport extends StacheElement {
<div class='p-2'>
<span class='color-text-and-bg-unknown p-2 inline-block'>Unknown</span>
<span class='color-text-and-bg-new p-2 inline-block'>New</span>
<span class='color-text-and-bg-notstarted p-2 inline-block'>Not Started</span>
<span class='color-text-and-bg-ontrack p-2 inline-block'>On Track</span>
<span class='color-text-and-bg-ahead p-2 inline-block'>Ahead</span>
<span class='color-text-and-bg-behind p-2 inline-block'>Behind</span>
<span class='color-text-and-bg-blocked p-2 inline-block'>Blocked</span>
<span class='color-text-and-bg-complete p-2 inline-block'>Complete</span>
Expand Down

0 comments on commit da799e9

Please sign in to comment.