Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'master' of https://github.com/ioet/time-tracker-ui into…
… TT-294-Fex-calendar-text-overflow
  • Loading branch information
ridouku committed Aug 11, 2021
commit 3023169d2c6cf9071ec76bf14b252d29a74f8ed5
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,29 @@ $activity-text-size: $max-lines-activity * $line-height-base;
@return darken(saturate(adjust-hue($text-color, 6), 46.19), 40.98);
}

.switch-calendar-view {
height: calc(100vh - 320px);
overflow-y: auto;
}

::-webkit-scrollbar {
width: 5px;
}

::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 5px;
}

::-webkit-scrollbar-thumb {
background: transparent;
}

::-webkit-scrollbar-thumb:hover {
background: #888;
border-radius: 5px;
}

@for $card-height from 12 through $max-lines-description {
$wrap-height: ($card-height * 0.625rem) -
$project-text-size -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ import { differenceInMinutes, startOfDay, startOfHour } from 'date-fns';
styleUrls: ['./calendar.component.scss'],
})
export class CalendarComponent implements OnInit {
readonly HALF_HOUR: number = 30;
readonly DEFAULT_HEADER_HEIGHT = 52;
readonly VARIATION_HEIGHT: number = 2;
readonly VISIBLE_TARGETS_FOR_TIME_ENTRIES_DESCRIPTION: CalendarView[] = [CalendarView.Week, CalendarView.Day];
readonly CALENDAR_VIEW_ENUM: typeof CalendarView = CalendarView;

@Input() set timeEntries$(timeEntries: Observable<DataSource<Entry>>){
@ViewChild('scrollContainer') scrollContainer: ElementRef<HTMLElement>;

@Input() set timeEntries$(timeEntries: Observable<DataSource<Entry>>) {
this.castEntryToCalendarEvent(timeEntries);
}
@Input() calendarView: CalendarView = CalendarView.Month;
Expand Down Expand Up @@ -59,6 +61,14 @@ export class CalendarComponent implements OnInit {
this.navigationEnable(this.calendarView);
}

scrollToCurrentTimeMarker() {
if (this.calendarView === CalendarView.Week || CalendarView.Day) {
const minutesSinceStartOfDay = differenceInMinutes(startOfHour(this.currentDate), startOfDay(this.currentDate));
const headerHeight = this.calendarView === CalendarView.Week ? this.DEFAULT_HEADER_HEIGHT : 0;
this.scrollContainer.nativeElement.scrollTop = minutesSinceStartOfDay * this.VARIATION_HEIGHT + headerHeight;
}
}

castEntryToCalendarEvent(timeEntries$: Observable<DataSource<Entry>>) {
timeEntries$
.pipe(
Expand Down Expand Up @@ -131,6 +141,7 @@ export class CalendarComponent implements OnInit {
return new SubstractDatePipe().transformInMinutes(endDate, startDate);
}

timeIsGreaterThan(startDate: Date, endDate: Date, timeRange: number): boolean {
getCardEntryHeight(startDate: Date, endDate: Date): number{
const heightCard = this.getTimeWork(startDate, endDate) * this.VARIATION_HEIGHT;
const finalHeightCard = heightCard / 10;
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.