Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

switch sums to also be bg events

ulferts1b2fb689e19c
diff --git a/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.sass b/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.sass
index 52840a30580..1d9eefc3c3d 100644
--- a/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.sass
+++ b/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.sass
@@ -7,7 +7,7 @@
.fc-head
display: table-footer-group
- .fc-event
+ .fc-event, .fc-bgevent
border-radius: 0
margin-right: 8px
margin-left: 8px
@@ -39,12 +39,10 @@
background-color: initial
color: #000000
text-align: center
- font-size: 1em
+ font-size: 0.875em
font-weight: bold
-
- .fc-title
- // as this is the height of the day sum element
- line-height: 22px
+ line-height: 22px
+ opacity: 1
.te-calendar--add-entry
text-align: center
diff --git a/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts b/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts
index d8e51f0a62d..e06bc6aa10d 100644
--- a/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts
+++ b/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts
@@ -271,10 +271,11 @@ export class TimeEntryCalendarComponent implements OnInit, OnDestroy, AfterViewI
protected sumEntry(date:Moment, duration:number) {
return {
- title: this.i18n.t('js.units.hour', { count: this.formatNumber(duration) }),
start: date.clone().add(this.maxHour - Math.min(duration * this.scaleRatio, this.maxHour - 0.5) - 0.5, 'h').format(),
end: date.clone().add(this.maxHour - Math.min(((duration + 0.05) * this.scaleRatio), this.maxHour - 0.5), 'h').format(),
- classNames: DAY_SUM_CLASS_NAME
+ classNames: DAY_SUM_CLASS_NAME,
+ rendering: 'background' as 'background',
+ sum: this.i18n.t('js.units.hour', { count: this.formatNumber(duration) })
};
}
@@ -406,6 +407,7 @@ export class TimeEntryCalendarComponent implements OnInit, OnDestroy, AfterViewI
private alterEventEntry(event:CalendarViewEvent) {
this.appendAddIcon(event);
+ this.appendSum(event);
if (!event.event.extendedProps.entry) {
return;
@@ -427,6 +429,12 @@ export class TimeEntryCalendarComponent implements OnInit, OnDestroy, AfterViewI
event.el.append(addIcon);
}
+ private appendSum(event:CalendarViewEvent) {
+ if (event.event.extendedProps.sum) {
+ event.el.append(event.event.extendedProps.sum);
+ }
+ }
+
private addTooltip(event:CalendarViewEvent) {
if (this.browserDetector.isMobile) {
return;