Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: only show recent runs in landing page #1289

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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