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

dev #1137

Merged
merged 33 commits into from
Nov 8, 2024
Merged

dev #1137

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
65f642c
remove cnAttributesMapper and all the related files
Miguel7373 Oct 14, 2024
36b74bb
remove ldab properties and dependency
Miguel7373 Oct 15, 2024
2af5a18
update config
kcinay055679 Oct 15, 2024
c3dd20c
auto restart spring if jar changes
kcinay055679 Oct 15, 2024
7bcd59d
jar is now debuggable
kcinay055679 Oct 15, 2024
022c780
add jar debug dev tools only on profile
kcinay055679 Oct 15, 2024
132f05f
change log levels
kcinay055679 Oct 15, 2024
104e3f6
try to fix autorestart of spring
kcinay055679 Oct 15, 2024
06f5196
complete auto restart of container
kcinay055679 Oct 15, 2024
8d39382
rename intelij config and change log level of spring to debug in stag…
kcinay055679 Oct 17, 2024
b959298
rename folder
kcinay055679 Oct 18, 2024
88bb944
exclude formatter plugin in build for docker
kcinay055679 Oct 18, 2024
a526783
use external profile to disable formatter
kcinay055679 Oct 18, 2024
a61e98d
clean up
kcinay055679 Oct 18, 2024
c154b4a
update local prod dockerfile
kcinay055679 Oct 18, 2024
c3799f5
fix display of tangram
kcinay055679 Oct 18, 2024
d0058da
update test and change const cname
kcinay055679 Oct 18, 2024
5939953
add logging to QuarterFunction (#1076)
clean-coder Oct 23, 2024
f800fea
add a Observable that triggers a refresh when called (#1041)
nevio18324 Oct 23, 2024
d90d1a0
#1030: tests for delete() and deleteAll() (#1034)
clean-coder Oct 25, 2024
ed539f9
Test/1012 service (#1050)
clean-coder Oct 25, 2024
3a458a5
Feature/624 Dialog creation refactoring using a service (#1045)
kcinay055679 Oct 25, 2024
c11a2ac
create tests for dialog-service (#1112)
nevio18324 Oct 31, 2024
6dc0e42
Feature/1032 update javaversion (#1103)
Miguel7373 Oct 31, 2024
f6cac24
Get current quarter from backend (#1039)
kcinay055679 Nov 4, 2024
55170f6
fix git history (#1124)
kcinay055679 Nov 4, 2024
2035535
Fix/fix git history (#1125)
kcinay055679 Nov 4, 2024
28e3861
refactor styles of dialogs (#1072)
kcinay055679 Nov 6, 2024
1d8d99f
Bug/1013 routing to overview (#1084)
nevio18324 Nov 6, 2024
f3a8271
Feature/624 refactor objective menu (#1078)
kcinay055679 Nov 8, 2024
e9c41dd
Bug/845-chf-label (#1106)
Miguel7373 Nov 8, 2024
f9846fb
Feature/977 HTML structure (#1040)
ManuelMoeri Nov 8, 2024
4b6382c
Fix bug with checked item (#1138)
ManuelMoeri Nov 8, 2024
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
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/setup-browser@v0.3.5
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
Loading