Skip to content

Commit

Permalink
Add styling to h tags and fix multiple css classes
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelMoeri committed Nov 11, 2024
1 parent 40e4d88 commit f47e198
Show file tree
Hide file tree
Showing 180 changed files with 3,579 additions and 2,985 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/backend-test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK ${{vars.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: ${{vars.JAVA_VERSION}}
distribution: 'adopt'

- name: Use Maven to run unittests and integration tests
run: mvn clean verify
run: mvn clean verify -X
4 changes: 2 additions & 2 deletions .github/workflows/demo-deploy-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK ${{vars.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: ${{vars.JAVA_VERSION}}
distribution: 'adopt'

- name: Set up node 18
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK ${{vars.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: ${{vars.JAVA_VERSION}}
distribution: 'adopt'

- name: Set up node 18
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/format-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK ${{vars.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: ${{vars.JAVA_VERSION}}
distribution: 'adopt'
server-id: github
settings-path: ${{github.workspace}}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/frontend-test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK ${{vars.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: ${{vars.JAVA_VERSION}}
distribution: 'adopt'

- uses: abhi1693/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/staging-deploy-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK ${{vars.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: ${{vars.JAVA_VERSION}}
distribution: 'adopt'

- name: Set up node
Expand Down
17 changes: 17 additions & 0 deletions .run/OkrApplication-debug-docker.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

<component name="ProjectRunConfigurationManager">
<configuration default="false" name="OkrApplication Debug Docker" type="Remote">
<module name="OkrApplication" />
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<option name="AUTO_RESTART" value="false" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="5005" />
<option name="LOCAL" value="false" />
</RunnerSettings>
<method v="2" />
</configuration>
</component>
48 changes: 42 additions & 6 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-ldap</artifactId>
</dependency>
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit5</artifactId>
Expand All @@ -87,6 +83,15 @@
<version>3.26.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.8.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down Expand Up @@ -202,8 +207,6 @@
<dataFile>${project.build.directory}/jacoco-output/merged.exec</dataFile>
</configuration>
</execution>


</executions>
</plugin>

Expand Down Expand Up @@ -240,6 +243,7 @@
</configuration>
<executions>
<execution>
<id>code-format</id>
<goals>
<goal>format</goal>
</goals>
Expand Down Expand Up @@ -282,5 +286,37 @@
</plugins>
</build>
</profile>
<profile>
<id>debug</id>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.8.RELEASE</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>no-formatter</id>
<build>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.23.0</version>
<executions>
<execution>
<id>code-format</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.List;

@RestController
@RequestMapping("api/v1/quarters")
@RequestMapping("api/v2/quarters")
public class QuarterController {

private final QuarterBusinessService quarterBusinessService;
Expand All @@ -28,9 +28,17 @@ public QuarterController(QuarterBusinessService quarterBusinessService) {

@Operation(summary = "Get quarters", description = "Get a List of quarters depending on current date")
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Returned a List of quarters", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = TeamDto.class)) }) })
@Content(mediaType = "application/json", schema = @Schema(implementation = Quarter.class)) }) })
@GetMapping("")
public ResponseEntity<List<Quarter>> getCurrentQuarters() {
return ResponseEntity.status(HttpStatus.OK).body(this.quarterBusinessService.getQuarters());
}

@Operation(summary = "Get current quarter", description = "Get the current quarter depending on current date")
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Returned the current quarter", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Quarter.class)) }) })
@GetMapping("/current")
public ResponseEntity<Quarter> getCurrentQuarter() {
return ResponseEntity.status(HttpStatus.OK).body(this.quarterBusinessService.getCurrentQuarter());
}
}
22 changes: 0 additions & 22 deletions backend/src/main/java/ch/puzzle/okr/mapper/CnAttributesMapper.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
package ch.puzzle.okr.repository;

import ch.puzzle.okr.models.Team;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface TeamRepository extends CrudRepository<Team, Long> {

@Query(value = """
select distinct teamOrg.team_id from team_organisation teamOrg
inner join organisation o on o.id = teamOrg.organisation_id
where o.org_name in (:organisationNames)
""", nativeQuery = true)
List<Long> findTeamIdsByOrganisationNames(@Param("organisationNames") List<String> organisationNames);

List<Team> findTeamsByName(String name);
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ public String getModelName() {
return OBJECTIVE;
}

/**
* Get the number of Objectives of a Team in a Quarter. The underling sql looks like "select count(*) from objective
* where teamId = team.id and quarterId = quarter.id."
*
* @param team
* Team
* @param quarter
* Quarter
*
* @return number of Objectives of team in quarter
*/
public Integer countByTeamAndQuarter(Team team, Quarter quarter) {
return getRepository().countByTeamAndQuarter(team, quarter);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ public String getModelName() {
return TEAM;
}

public List<Long> findTeamIdsByOrganisationName(String organisationName) {
return findTeamIdsByOrganisationNames(List.of(organisationName));
}

public List<Long> findTeamIdsByOrganisationNames(List<String> organisationNames) {
return getRepository().findTeamIdsByOrganisationNames(organisationNames);
}

public List<Team> findTeamsByName(String name) {
return getRepository().findTeamsByName(name);
}
Expand Down
14 changes: 14 additions & 0 deletions backend/src/main/java/ch/puzzle/okr/util/CollectionUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package ch.puzzle.okr.util;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;

public class CollectionUtils {

public static <T> List<T> iterableToList(Iterable<T> iterable) {
return StreamSupport //
.stream(iterable.spliterator(), false) //
.collect(Collectors.toList());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import ch.puzzle.okr.util.quarter.generate.QuarterData;
import ch.puzzle.okr.util.quarter.generate.Quarters;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

Expand All @@ -21,6 +23,7 @@ public class QuarterFunction {
public static final int NEXT_QUARTER_DB_ID = 3;

private static final Map<Integer, QuarterData> QUARTERS = new HashMap<>();
private static final Logger logger = LoggerFactory.getLogger(QuarterFunction.class);

public static void initQuarterData() {
LocalDate now = LocalDate.now();
Expand All @@ -37,27 +40,40 @@ private static void registerCurrentQuarterForDate(LocalDate date, int dbId) {
}

public static String currentQuarterLabel() {
return QUARTERS.get(CURRENT_QUARTER_DB_ID).label();
var label = QUARTERS.get(CURRENT_QUARTER_DB_ID).label();
logger.info("currentQuarterLabel : {}", label);
return label;

}

public static String currentQuarterStartDate() {
return QUARTERS.get(CURRENT_QUARTER_DB_ID).startDateAsIsoString();
var start = QUARTERS.get(CURRENT_QUARTER_DB_ID).startDateAsIsoString();
logger.info("currentQuarterStartDate: {}", start);
return start;
}

public static String currentQuarterEndDate() {
return QUARTERS.get(CURRENT_QUARTER_DB_ID).endDateAsIsoString();
var end = QUARTERS.get(CURRENT_QUARTER_DB_ID).endDateAsIsoString();
logger.info("currentQuarterEndDate : {}", end);
return end;
}

public static String nextQuarterLabel() {
return QUARTERS.get(NEXT_QUARTER_DB_ID).label();
var label = QUARTERS.get(NEXT_QUARTER_DB_ID).label();
logger.info("nextQuarterLabel : {}", label);
return label;
}

public static String nextQuarterStartDate() {
return QUARTERS.get(NEXT_QUARTER_DB_ID).startDateAsIsoString();
var start = QUARTERS.get(NEXT_QUARTER_DB_ID).startDateAsIsoString();
logger.info("nextQuarterStartDate : {}", start);
return start;
}

public static String nextQuarterEndDate() {
return QUARTERS.get(NEXT_QUARTER_DB_ID).endDateAsIsoString();
var end = QUARTERS.get(NEXT_QUARTER_DB_ID).endDateAsIsoString();
logger.info("nextQuarterEndDate : {}", end);
return end;
}

}
10 changes: 6 additions & 4 deletions backend/src/main/resources/application-staging.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# logging level for staging
logging.level.org.springframework=debug
logging.level.ch.puzzle.okr=DEBUG
#logging.level.org.flywaydb.core=DEBUG


connect.src=http://localhost:8544 http://localhost:8545


hibernate.connection.url=jdbc:postgresql://okr-dev-db:5432/okr
hibernate.connection.url=jdbc:postgresql://localhost:5432/okr
hibernate.connection.username=user
hibernate.connection.password=pwd
hibernate.multiTenancy=SCHEMA
Expand All @@ -16,7 +18,7 @@ okr.datasource.driver-class-name=org.postgresql.Driver
okr.user.champion.usernames=peggimann

# pitc
okr.tenants.pitc.datasource.url=jdbc:postgresql://okr-dev-db:5432/okr
okr.tenants.pitc.datasource.url=jdbc:postgresql://localhost:5432/okr
okr.tenants.pitc.datasource.username=user
okr.tenants.pitc.datasource.password=pwd
okr.tenants.pitc.datasource.schema=okr_pitc
Expand All @@ -27,7 +29,7 @@ okr.tenants.pitc.security.oauth2.frontend.client-id=pitc_okr_staging


# acme
okr.tenants.acme.datasource.url=jdbc:postgresql://okr-dev-db:5432/okr
okr.tenants.acme.datasource.url=jdbc:postgresql://localhost:5432/okr
okr.tenants.acme.datasource.username=user
okr.tenants.acme.datasource.password=pwd
okr.tenants.acme.datasource.schema=okr_acme
Expand Down
Loading

0 comments on commit f47e198

Please sign in to comment.