diff --git a/corn-backend/src/main/java/dev/corn/cornbackend/api/sprint/SprintServiceImpl.java b/corn-backend/src/main/java/dev/corn/cornbackend/api/sprint/SprintServiceImpl.java index 13476d1d..a01353bf 100644 --- a/corn-backend/src/main/java/dev/corn/cornbackend/api/sprint/SprintServiceImpl.java +++ b/corn-backend/src/main/java/dev/corn/cornbackend/api/sprint/SprintServiceImpl.java @@ -260,7 +260,7 @@ public Page getSprintsBeforeSprint(long sprintId, Pageable pagea } @Override - public final List getSprintsBetweenDates(LocalDate startDate, LocalDate endDate, long projectId, + public List getSprintsBetweenDates(LocalDate startDate, LocalDate endDate, long projectId, User user) { log.info("Getting sprints between dates: {} and {} for project with id: {}", startDate, endDate, projectId); diff --git a/corn-frontend/src/app/pages/project-list/project-list.component.html b/corn-frontend/src/app/pages/project-list/project-list.component.html index 4699415c..8c6190a0 100644 --- a/corn-frontend/src/app/pages/project-list/project-list.component.html +++ b/corn-frontend/src/app/pages/project-list/project-list.component.html @@ -1,15 +1,12 @@ -
- - @for(project of projects; track project) { - - - - } - +
+ @for(project of projects; track project) { + + }
+ + + diff --git a/corn-frontend/src/app/pages/project-list/project-list.component.ts b/corn-frontend/src/app/pages/project-list/project-list.component.ts index 09cee7b3..270af1f6 100644 --- a/corn-frontend/src/app/pages/project-list/project-list.component.ts +++ b/corn-frontend/src/app/pages/project-list/project-list.component.ts @@ -30,9 +30,6 @@ import { Router } from "@angular/router"; styleUrl: './project-list.component.scss' }) export class ProjectListComponent implements OnInit { - - cols: number = 5; - pageNumber: number = 0; projects: Project[] = []; @@ -45,8 +42,25 @@ export class ProjectListComponent implements OnInit { private router: Router) { } - ngOnInit(): void { - this.getProjects(); + async ngOnInit(): Promise { + await this.getProjects(); + await this.fetchMoreProjectsIfNeeded(); + } + + private async fetchMoreProjectsIfNeeded(): Promise { + let position: number = (document.documentElement.scrollTop || document.body.scrollTop) + window.innerHeight; + let max: number = document.documentElement.scrollHeight; + + while (position >= max) { + if(this.gotAllProjects) { + return; + } + this.pageNumber++; + await this.getProjects(); + + position = (document.documentElement.scrollTop || document.body.scrollTop) + window.innerHeight; + max = document.documentElement.scrollHeight; + } } @HostListener('window:scroll', ['$event']) @@ -89,17 +103,20 @@ export class ProjectListComponent implements OnInit { }); } - private getProjects(): void { - this.projectService - .getProjectsOnPage(this.pageNumber) - .pipe(take(1)) - .subscribe((items: Project[]) => { - if (items.length == 0) { - this.gotAllProjects = true; - return; + private async getProjects(): Promise { + return new Promise((resolve) => { + this.projectService + .getProjectsOnPage(this.pageNumber) + .pipe(take(1)) + .subscribe((items: Project[]) => { + if (items.length == 0) { + this.gotAllProjects = true; + } else { + this.projects = [...this.projects, ...items]; + } + resolve(); } - this.projects = [...this.projects, ...items]; - } - ) + ) + }); } } diff --git a/corn-frontend/src/app/pages/project-list/project/project.component.scss b/corn-frontend/src/app/pages/project-list/project/project.component.scss index ed2a373a..5ec2355e 100644 --- a/corn-frontend/src/app/pages/project-list/project/project.component.scss +++ b/corn-frontend/src/app/pages/project-list/project/project.component.scss @@ -10,10 +10,15 @@ box-shadow: #000000 0 0 1em; z-index: -2; - @media(max-width: $screen-840) { + @media(max-width: $screen-1440) { width: 11em; height: 10em; } + + @media(max-width: $screen-440) { + width: 8em; + height: 7em; + } } .background:hover { @@ -34,11 +39,16 @@ border-bottom-right-radius: 5px; background-color: map-get($dark-color-settings, container-background-color); - @media(max-width: $screen-840) { + @media(max-width: $screen-1440) { width: 10em; height: 10em; } + @media(max-width: $screen-440) { + width: 7em; + height: 7em; + } + &:before { content: ''; position: absolute; @@ -61,10 +71,15 @@ overflow: hidden; z-index: 1; - @media(max-width: $screen-840) { + @media(max-width: $screen-1440) { font-size: 1em; margin-top: 0.25em; } + + @media(max-width: $screen-440) { + font-size: 0.7em; + margin-top: 0.15em; + } } .line { @@ -87,10 +102,15 @@ width: 2.7em; height: 2.7em; - @media (max-width: $screen-840) { + @media (max-width: $screen-1440) { width: 1.8em; height: 1.8em; } + + @media (max-width: $screen-440) { + width: 1.1em; + height: 1.1em; + } } .member-row { diff --git a/corn-frontend/src/app/pages/utils/user-avatar/user-avatar.component.scss b/corn-frontend/src/app/pages/utils/user-avatar/user-avatar.component.scss index 7f7ae5ea..56bccbd5 100644 --- a/corn-frontend/src/app/pages/utils/user-avatar/user-avatar.component.scss +++ b/corn-frontend/src/app/pages/utils/user-avatar/user-avatar.component.scss @@ -16,4 +16,9 @@ display: flex; justify-content: center; align-items: center; -} \ No newline at end of file + + @media(max-width: 440px) { + font-size: 0.7em; + } +} +