Skip to content

Commit

Permalink
feat: only show recent runs in landing page (#1289)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWitt authored Nov 27, 2023
1 parent 7014e63 commit 7b81935
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
"scripts": {
"start": "vite",
"build": "tsc && vite build",
"dev": "vite preview",
"dev": "vite",
"prettier": "prettier --write \"src/**/*.tsx\""

},
"eslintConfig": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ProjectData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Project } from './data/Project';

export const fetchProjectQuery = gql`
query getProjects {
getProjects {
getRecentProjects(size: 30) {
projectName
projectUrl
commitHashes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public List<ProjectGraphQLDto> getAllProjects() {
return projectRepository.getAll().stream().map(this::mapToDto).toList();
}

@Query("getRecentProjects")
@Description("Gets all projects from the database with a limit")
public List<ProjectGraphQLDto> getRecentProjects(int size) {
return projectRepository.getRecent(size).stream().map(this::mapToDto).toList();
}

@Query("getProjectWithName")
@Description("Gets project with given name from the database")
public ProjectGraphQLDto getProject(String projectName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,9 @@ public RemoteProject save(RemoteProject project) {
}
return project;
}

@Override
public List<RemoteProject> getRecent(int size) {
return findAll().page(0, size).stream().map(projectDaoConverter::convertToEntity).toList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public interface ProjectRepository {

List<RemoteProject> getAll();

List<RemoteProject> getRecent(int size);

List<RemoteProject> findByProjectName(String projectName);

boolean existsByProjectName(String projectName);
Expand Down
4 changes: 3 additions & 1 deletion github-bot/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
quarkus.quinoa.ui-dir=../frontend/
%dev.quarkus.quinoa.enabled=false
quarkus.quinoa.enable-spa-routing=true
%prod.quarkus.quinoa.package-manager-install=true
%prod.quarkus.quinoa.package-manager-install.node-version=18.9.0
Expand Down Expand Up @@ -56,4 +57,5 @@ quarkus.http.cors.origins=*
quarkus.vertx.max-worker-execute-time=30m
%test.quarkus.scheduler.enabled=false
quarkus.datasource.db-kind = mariadb
quarkus.hibernate-orm.database.generation = update
quarkus.hibernate-orm.database.generation = update
%dev.quarkus.quinoa=false

0 comments on commit 7b81935

Please sign in to comment.