Skip to content

Commit

Permalink
dev (#1137)
Browse files Browse the repository at this point in the history
* remove cnAttributesMapper and all the related files

* remove ldab properties and dependency

* update config

* auto restart spring if jar changes

* jar is now debuggable

* add jar debug dev tools only on profile

* change log levels

* try to fix autorestart of spring

* complete auto restart of container

* rename intelij config and change log level of spring to debug in staging config

* rename folder

* exclude formatter plugin in build for docker

* use external profile to disable formatter

* clean up

* update local prod dockerfile

* fix display of tangram

* update test and change const cname

* add logging to QuarterFunction (#1076)

* add a Observable that triggers a refresh when called (#1041)

* jar is now debuggable

* rename folder

* add a Observable that triggers a refresh when called

* add destroy observable to stop subscription of reloadKeySubject

* add tests to observables

---------

Co-authored-by: Yanick Minder <[email protected]>

* #1030: tests for delete() and deleteAll() (#1034)

* Test/1012 service (#1050)

* tests for PersistenceBase class

* remove tests from QuarterPersistenceServiceIT which are already covered in PersistenceBaseTestIT

* remove no longer used OrganisationXXX() methods

* remove tests from TeamPersistenceServiceIT which are already covered in PersistenceBaseTestIT

* remove tests from UserPersistenceServiceIT which are already covered in PersistenceBaseTestIT and add additional tests

* remove tests from CheckInPersistenceServiceIT which are already covered in PersistenceBaseTestIT and add additional test

* umbau ObjectivePersistenceServiceIT: remove tests which are already covered in PersistenceBaseTestIT, add additional test, make the tests readable

* tests for AuthorizationCriteria

* tests for AuthorizationCriteria

* tests for AuthorizationCriteria

* enable debug trace

* debug found okr-champions in test

* add logging in findAllOkrChampionsShouldReturnAllOkrChampions() test

* disable tests which call setOkrChampion()

* enable some disabled tests

* enable some disabled tests

* enable last disabled test .. should fail

* ugly temp fix

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

---------

Co-authored-by: peggimann <[email protected]>

* Feature/624 Dialog creation refactoring using a service (#1045)

* add jar debug dev tools only on profile

* refactor dialog calls with config by introducing a service

* convert all confirmation dialog texts to i18n texts

* use refactored  confirmation component

* fix string and use interface for confirm dialog data

* Update title of delete confirmation

* clean up dialog service

* refactor frontend tests related to dialogService

* display correct dialog in objective

* fix objective release dialog

* refactor dialog responsiveness

* clean up dialog service

* remove backend/pom.xml from branch

* update translations and fix release dialog

* update dialog.service.ts

* create tests for dialog-service (#1112)

* Feature/1032 update javaversion (#1103)

* change java version to 21

* edit java version in pom and edit version in pipes to github action variable

* add generic version to name strings

---------

Co-authored-by: Nevio Di Gennaro <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>

* Get current quarter from backend (#1039)

* add auto data-migration

* jar is now debuggable

* add jar debug dev tools only on profile

* change log levels

* try to fix autorestart of spring

* complete auto restart of container

* rename intelij config and change log level of spring to debug in staging config

* rename folder

* update docker compose file

* use external profile to disable formatter

* clean up

* add jar debug dev tools only on profile

* add api endpoint

* use api to get current quarter

* convert quarter to a class instead of an interface

* use class syntax

* update specs to use the class syntax for quarters

* mock new class function in test

* add integratin test for current quarter endpoint

* fix default quarter for new objective selection

* use v2 for quarter url and update tests accoridingly

* change merhod to fakeAsync

* try to override provider mid test

* Dispatch change instead of input event in onSubmit create test and get element by test id instead of id

* Remove duplicate profile in pom

* Update swagger annotations of get current quarter and fix usage of wrong implementation class for get current quarters

* Remove unused import in common.ts

* add dependency for hot reload in again

* [FM] Automated formating frontend

* readd local debug run config

---------

Co-authored-by: Miguel Lehmann <[email protected]>
Co-authored-by: Jannik Pulfer <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>

* fix git history (#1124)

* Fix/fix git history (#1125)

* fix history

* fix hist

* refactor styles of dialogs (#1072)

* add jar debug dev tools only on profile

* change log levels

* try to fix autorestart of spring

* rename intelij config and change log level of spring to debug in staging config

* rename folder

* use external profile to disable formatter

* remove backend/pom.xml from branch

* refactor styles of dialogs

* remove useless tabindex

* refactor styling of dialog-content and dialog-actions

* refactor dialog header

* clean up

* fix invite members test

* change default width of dialog

* set cypress viewport

* remove it.only from cy tests

* use diffrent classes for default and small dialogs

* remove useless config

* clean up styling

* remove scroll-shaddow

* change height sizing strategie

* refactor styling of keyresult edit component

* introduce dialog-template-core-component

* create base template for dialogs

* align close button

* comment in dialog component

* fix scrolling of dialog

* refactor kr-type-form

* finish styling of kr-type select

* fix scrolling by setting height of action buttons

* clean up dialog content size

* clean up styles.scss

* refactor styles

* refactor styles of generic component

* move core component to shared module

* fix design because of scrollbar

* change keyresult type tabs to butotns

* delete cancel dialog and refactor related files

* refactor confirm dialog component to use template dialog core

* refactor styling

* refactor style of okr-label

* refactor example dialog

* refactor objective form component to use template dialog core

* refactor objective form dialog

* refactor dialog width

* refactor keyresult component

* fix responsive dialog

* refactor objective complete dialog

* clean up

* refactor objective form component

* minder out

* fix objective form component

* use priority to fetch logos

* refactor dialog history compoennt

* add spinner to dialog core

* refactor dialog history component

* refactor check-in componentn

* refactor metric check in component

* clean up keyresult dialog

* clean up

* fix kr type component

* finish dialog refactoring

* remove header component

* refactor css classes

* refactor styling

* insert okr-form-label-input-container

* fix dialog service tests

* fix jest of objective form compoennt

* fix tests of keyresult form

* fix pom

* fix tests of add-edit team dialog

* fix tests keyresult-dialog tests

* fix tests of complete dialog

* fix jest tests

* readd cancel button for check-in create

* fix check-in e2e tests

* fix e2e tests

* remove only from cypress tests

* fix teammanagement e2e test

* fix duplicate scorring

* clean up check-in tests

* fix objective duplicate tests

* clean up

* clean up styles

* create a dialog-data-show class

* fix check in metric

* fix keyresult type

* clean up

* implement todo

---------

Co-authored-by: peggimann <[email protected]>

* Bug/1013 routing to overview (#1084)

* Add permanent teamverwaltung button and make logo route to /

* Make router links leading to homepage preserve query params

* Change tag around logo from span to a

* Add e2e tests that test if route is preserved

---------

Co-authored-by: Jannik Pulfer <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>

* Feature/624 refactor objective menu  (#1078)

* Fix/fix git history (#1125)

* fix history

* fix hist

* jar is now debuggable

* add jar debug dev tools only on profile

* rename intelij config and change log level of spring to debug in staging config

* rename folder

* update docker compose file

* use external profile to disable formatter

* clean up

* refactor dialog calls with config by introducing a service

* refactor frontend tests related to dialogService

* remove backend/pom.xml from branch

* introduce new objective menu action service to simplify dialog creation of dialog actions

* refactor objective

* reimplement generic menu

* use pipe with map to generate menu entries

* introduce afterAction property

* add ObjectiveAfterActionFactory

* introduce objectiveMenuAction file

* refactor objective status tooltip

* clean up objective menu action service

* rename objective actions file

* Try to fix frontend unit tests

* restore staging.properties

* fix angular build

* place functions in related files instead of common.ts

* restore angular config files

* fix action service tests

* add test for actions service

* clean up

* display correct options for draft and use replay subject

* fix check-in tests

* fix objective backlog tests

* fix objective e2e tests

* fix tabbing tests

* fix tabbing tests

* schtibitz e2e strategy from pulfer

* remove console.log

* restore focus

* restore old frontend-test-action

* clean pup

* remove application.staging from pr

* clean up tests of objective

* fix e2e tests

* check for focues of threedot menu after dialog closes

---------

Co-authored-by: Manuel <[email protected]>

* Bug/845-chf-label (#1106)

* jar is now debuggable

* rename intelij config and change log level of spring to debug in staging config

* Fix bug with double label in check in history

* delete unused pipe and edit the CHF output

* edit e2e and frontend tests to work with the new format

* remove lable pipe in dialog

* add second pipe back in and edit to suffix

* fix tests and refactor value pipe

* fix spec tests for pipes

* fix e2e tests

* remove space before percent

* fix unit-lable spec and e2e tests

* fix spaceing of percent in tests

* add testId

---------

Co-authored-by: Yanick Minder <[email protected]>
Co-authored-by: Lias Kleisa <[email protected]>

* Feature/977 HTML structure (#1040)

* Implement html structure and fix tests

* Shorten logic in component

* Remove unwanted styling that broke every dialog

* Add styling to headings and fix obvious mistakes

* Fix font size in banner and alignment of stretch star

* Fix e2e test

* Remove files that do not belong to my PR

* Fix bug with checked item (#1138)

---------

Co-authored-by: Miguel Lehmann <[email protected]>
Co-authored-by: Yanick Minder <[email protected]>
Co-authored-by: Jean-Claude Brantschen <[email protected]>
Co-authored-by: nevio18324 <[email protected]>
Co-authored-by: peggimann <[email protected]>
Co-authored-by: Yanick Minder <[email protected]>
Co-authored-by: Miguel <[email protected]>
Co-authored-by: Nevio Di Gennaro <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>
Co-authored-by: Jannik Pulfer <[email protected]>
Co-authored-by: Manuel <[email protected]>
Co-authored-by: Lias Kleisa <[email protected]>
Co-authored-by: Manuel <[email protected]>
  • Loading branch information
14 people authored Nov 8, 2024
1 parent 40e4d88 commit c621f7f
Show file tree
Hide file tree
Showing 175 changed files with 3,566 additions and 2,975 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 c621f7f

Please sign in to comment.