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

704 benutzerverwaltung #758

Merged
merged 296 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 106 commits
Commits
Show all changes
296 commits
Select commit Hold shift + click to select a range
ce83563
#705 add team to user frontend
janikEndtner Jan 8, 2024
4cf36e4
Merge remote-tracking branch 'origin/704_benutzerverwaltung' into 704…
janikEndtner Jan 8, 2024
324de79
[FM] Automated formating frontend
actions-user Jan 8, 2024
46dfd31
#705 navigate to created team after team creation
janikEndtner Jan 9, 2024
a814f70
#705 refactor reload methods of user and team service
janikEndtner Jan 9, 2024
6b89a7b
Merge remote-tracking branch 'origin/704_benutzerverwaltung' into 704…
janikEndtner Jan 9, 2024
a565350
#705 fix team service
janikEndtner Jan 9, 2024
b54a24c
#705 fix bug when user is logged in the first time
janikEndtner Jan 9, 2024
6d9325f
[FM] Automated formating backend
actions-user Jan 9, 2024
4db333e
#705 fix angular tests and add more
janikEndtner Jan 9, 2024
0659481
Merge remote-tracking branch 'origin/704_benutzerverwaltung' into 704…
janikEndtner Jan 9, 2024
d4fecd1
[FM] Automated formating frontend
actions-user Jan 9, 2024
6bdf9f5
Test commit
Jan 9, 2024
62bdce8
Add search in search-team-management.component.
Jan 9, 2024
06adafe
Clean up code
Jan 10, 2024
517f06c
Clean up code
Jan 10, 2024
2ef0997
#705 manual merge corrections
Jan 10, 2024
5532f75
#705 - Make max-height of autocomplete bigger in teams- and member se…
Jan 10, 2024
f4c9948
#705 - Make max-height of autocomplete bigger in teams- and member se…
Jan 10, 2024
3510e57
#705 Add missing translations
Jan 10, 2024
4d9ee9b
#705 Sort filtered suggestions by position of search text within it
Jan 10, 2024
1106f1f
#705 Add unit tests for search-team-management.component
Jan 10, 2024
ca6e0f7
[FM] Automated formating frontend
actions-user Jan 10, 2024
20f622b
#705 Fix routing in team management and fix tests
Jan 10, 2024
dfd7aa5
[FM] Automated formating frontend
actions-user Jan 10, 2024
fc5ff6e
#704 Add interceptor in cypress. Add missing ALTER SEQUENCE definitio…
Jan 12, 2024
d7633d8
#704 Add interceptor in cypress. Add missing ALTER SEQUENCE definitio…
Jan 12, 2024
70509e5
#704 Add missing package-l
Jan 15, 2024
04d48ac
#704 Add better handling when user clicks on search result. Preselect…
Jan 15, 2024
a04031c
#704 Remove only focus on cy tests
Jan 15, 2024
341218a
#704 add more tests for frontend
janikEndtner Jan 15, 2024
d2285fa
#704 fix some other warnings in angular tests
janikEndtner Jan 16, 2024
99b0257
#704 Fix overview component and team-management component
Jan 16, 2024
3a812b6
#704 Add missing flex in keyresult-detail.component
Jan 16, 2024
df4b4ca
#704 fix member-list component
janikEndtner Jan 16, 2024
b6505e1
Merge remote-tracking branch 'origin/feature/704-mkaeser_search' into…
janikEndtner Jan 16, 2024
7fb5341
use figma icon to have more customization options
kcinay055679 Jan 18, 2024
941a015
#704 add cypress tests
janikEndtner Jan 18, 2024
b1db0f9
Merge remote-tracking branch 'origin/main' into 704_benutzerverwaltung
janikEndtner Jan 19, 2024
480b805
#704 reload current user when adding, deleting or updating a team
janikEndtner Jan 19, 2024
a8130e6
#704 fix tests
janikEndtner Jan 19, 2024
602c1b4
#704 fix backend tests
janikEndtner Jan 19, 2024
118830a
[FM] Automated formating backend
actions-user Jan 19, 2024
062bbc8
fix width of text
kcinay055679 Jan 19, 2024
8d92608
use correct color for hover state
kcinay055679 Jan 19, 2024
b432c09
Merge pull request #757 from puzzle/feature/733-hovereffect-on-menu
peggimann Jan 22, 2024
128b84a
[VU] Automated version update
actions-user Jan 22, 2024
a7d4bb4
Merge pull request #721 from puzzle/renovate/actions-upload-artifact-4.x
kcinay055679 Jan 22, 2024
182364f
[VU] Automated version update
actions-user Jan 22, 2024
a8c0d7f
Update actions/download-artifact action to v4
renovate[bot] Dec 17, 2023
65cefbb
Merge pull request #720 from puzzle/renovate/actions-download-artifac…
kcinay055679 Jan 22, 2024
096d681
[VU] Automated version update
actions-user Jan 22, 2024
d97c6e7
change search icon to svg
kcinay055679 Jan 18, 2024
a64474b
move 1px to the left
kcinay055679 Jan 18, 2024
2583108
Merge pull request #755 from puzzle/feature/734-search-icon-size
kcinay055679 Jan 22, 2024
310d93c
[VU] Automated version update
actions-user Jan 22, 2024
d98a039
add new font formats and apply them
kcinay055679 Jan 18, 2024
a7b5219
add e2e test
kcinay055679 Jan 19, 2024
c7d38ac
use only roboto as font familiy
kcinay055679 Jan 19, 2024
7848079
add e2e check for font weight
kcinay055679 Jan 22, 2024
0ac508a
remove uselsss fonts
kcinay055679 Jan 22, 2024
5665c0c
update e2e test
kcinay055679 Jan 22, 2024
cd3cc06
Merge pull request #756 from puzzle/feature/730-font-without-fallback
peggimann Jan 22, 2024
b9910dc
[VU] Automated version update
actions-user Jan 22, 2024
89ef2e7
display exclamation mark in bar
kcinay055679 Jan 16, 2024
31eee62
display error message correctly
kcinay055679 Jan 16, 2024
c69216d
fix bug with double lines for stretched
kcinay055679 Jan 16, 2024
345f0fb
update e2e tests
kcinay055679 Jan 16, 2024
e539407
show icon in every possible case
kcinay055679 Jan 18, 2024
bd42e89
update e2e tests
kcinay055679 Jan 18, 2024
ad1af0f
remove .only in e2e test
kcinay055679 Jan 18, 2024
be973a0
remove useless comment
kcinay055679 Jan 18, 2024
0e9de02
implement percentage as measure to display icon
Jan 22, 2024
69f8c72
Merge pull request #751 from puzzle/feature/736-display-fail
kcinay055679 Jan 22, 2024
700fde3
[VU] Automated version update
actions-user Jan 22, 2024
2a42fff
update icon placement
kcinay055679 Jan 16, 2024
0edf1a1
align icons
kcinay055679 Jan 18, 2024
e1a1c9d
realign icons
kcinay055679 Jan 22, 2024
244160b
Merge pull request #749 from puzzle/feature/729-icon-header
peggimann Jan 22, 2024
36ef439
[VU] Automated version update
actions-user Jan 22, 2024
1d55181
add woff to nonFilteredFileExteions
kcinay055679 Jan 22, 2024
a83a9a3
Merge pull request #761 from puzzle/feature/730-font-without-fallback
kcinay055679 Jan 22, 2024
ef4658e
[VU] Automated version update
actions-user Jan 22, 2024
d8d350c
update jest-preset-angular
kcinay055679 Jan 22, 2024
e0a03e9
Merge pull request #762 from puzzle/update/jest-preset-angular
kcinay055679 Jan 22, 2024
619796d
Update dependency org.cyclonedx:cyclonedx-maven-plugin to v2.7.11
renovate[bot] Jan 22, 2024
7317c73
[VU] Automated version update
actions-user Jan 22, 2024
30eb121
Merge pull request #763 from puzzle/renovate/org.cyclonedx-cyclonedx-…
kcinay055679 Jan 22, 2024
1c51919
[VU] Automated version update
actions-user Jan 22, 2024
b193eff
Update dependency org.flywaydb:flyway-database-postgresql to v10.6.0
renovate[bot] Jan 16, 2024
12ae3cb
Merge pull request #719 from puzzle/renovate/org.flywaydb-flyway-data…
kcinay055679 Jan 22, 2024
dbbd24e
[VU] Automated version update
actions-user Jan 22, 2024
2d4d358
Update dependency org.springframework.boot:spring-boot-starter-parent…
renovate[bot] Jan 22, 2024
c584e6a
Merge pull request #765 from puzzle/renovate/spring-boot
kcinay055679 Jan 22, 2024
149b0b2
[VU] Automated version update
actions-user Jan 22, 2024
d65c4df
set minimum of confidence slider to 0
kcinay055679 Jan 15, 2024
91f853c
add e2e tests
kcinay055679 Jan 18, 2024
d8ab118
update min confidence value in backend unit tests
kcinay055679 Jan 18, 2024
7b927d0
update validators of confidence in check-in-form-compoentn
kcinay055679 Jan 22, 2024
3a2e611
Merge pull request #743 from puzzle/feature/725-confidence-slider
kcinay055679 Jan 22, 2024
7651985
[VU] Automated version update
actions-user Jan 22, 2024
0355d30
Update angular monorepo
renovate[bot] Jan 18, 2024
b40be6c
Merge pull request #716 from puzzle/renovate/angular-monorepo
kcinay055679 Jan 22, 2024
99d61ab
[VU] Automated version update
actions-user Jan 22, 2024
c8431e8
Update angular-cli monorepo to v17.1.0
renovate[bot] Jan 22, 2024
1a39bb6
Update angular-cli monorepo to v17.1.0
renovate[bot] Jan 22, 2024
845b436
Merge pull request #767 from puzzle/renovate/angular-cli-monorepo
kcinay055679 Jan 22, 2024
ebbd385
[VU] Automated version update
actions-user Jan 22, 2024
2566594
update cypress to 13.6.3
kcinay055679 Jan 22, 2024
056cc76
Merge pull request #766 from puzzle/update/cypress
kcinay055679 Jan 22, 2024
3424e00
[VU] Automated version update
actions-user Jan 22, 2024
fb488f3
update moment to 2.30.1
kcinay055679 Jan 22, 2024
2b46ec2
Merge pull request #769 from puzzle/update/moment
kcinay055679 Jan 22, 2024
a1cc775
[VU] Automated version update
actions-user Jan 22, 2024
0cba521
update package.lock
kcinay055679 Jan 22, 2024
898554b
format
kcinay055679 Jan 22, 2024
baf078d
import MatIcon instead of declerate it inside the teamcomponent test
kcinay055679 Jan 22, 2024
db1eca3
Merge pull request #770 from puzzle/update/package-lock
kcinay055679 Jan 22, 2024
fd72c07
[VU] Automated version update
actions-user Jan 22, 2024
17b9343
Update dependency org.flywaydb:flyway-core to v10.6.0
renovate[bot] Jan 22, 2024
239ffeb
update prettier
kcinay055679 Jan 22, 2024
8c0529c
format
kcinay055679 Jan 22, 2024
0c20ec4
update lockfile
kcinay055679 Jan 22, 2024
5e3ee19
Merge pull request #689 from puzzle/renovate/org.flywaydb-flyway-core…
kcinay055679 Jan 22, 2024
feef97b
[VU] Automated version update
actions-user Jan 22, 2024
953380b
Update quay.io/keycloak/keycloak Docker tag to v23.0.4
renovate[bot] Jan 22, 2024
ccdb190
Merge pull request #773 from puzzle/update/prettier
kcinay055679 Jan 22, 2024
b31fa62
[VU] Automated version update
actions-user Jan 22, 2024
9239e36
Merge pull request #718 from puzzle/renovate/quay.io-keycloak-keycloa…
kcinay055679 Jan 22, 2024
15ef84a
[VU] Automated version update
actions-user Jan 22, 2024
8b0618d
Update dependency angular-oauth2-oidc to v17
renovate[bot] Jan 22, 2024
ad04bc7
Merge pull request #772 from puzzle/renovate/angular-oauth2-oidc-17.x
kcinay055679 Jan 22, 2024
f6f46b5
[VU] Automated version update
actions-user Jan 22, 2024
db4f838
Update dependency org.assertj:assertj-core to v3.25.1
renovate[bot] Jan 22, 2024
e0048e4
Merge pull request #771 from puzzle/renovate/org.assertj-assertj-core…
kcinay055679 Jan 22, 2024
0880f3b
[VU] Automated version update
actions-user Jan 22, 2024
053dbb3
update maven plugins
kcinay055679 Jan 22, 2024
3b10836
Merge pull request #774 from puzzle/update/maven-plugin
kcinay055679 Jan 22, 2024
6a6573d
[VU] Automated version update
actions-user Jan 22, 2024
40f2205
override angualr var
kcinay055679 Jan 22, 2024
b662744
restore letterspacing
kcinay055679 Jan 22, 2024
07fa22f
Merge pull request #775 from puzzle/bug/reset-letter-spacing
peggimann Jan 22, 2024
42f8729
[VU] Automated version update
actions-user Jan 22, 2024
266255a
Change svg and try to fix spacing
ManuelMoeri Jan 22, 2024
ee36a62
Find first solution not approved from UX or PO yet
ManuelMoeri Jan 22, 2024
91eda2a
Fix placment of plus in actionplan
ManuelMoeri Jan 22, 2024
39e6e68
Implement smaller version of plussign after talking to UX again
ManuelMoeri Jan 23, 2024
74e1c73
#704 backend fixes from review
janikEndtner Jan 23, 2024
2d6e92f
Make shadow of button a bit smaller
ManuelMoeri Jan 23, 2024
520ada8
Format code
ManuelMoeri Jan 23, 2024
ec6e484
[FM] Automated formating frontend
actions-user Jan 23, 2024
8256b5c
#704 frontend fixes from review
janikEndtner Jan 23, 2024
21cf9a9
#704 frontend fixes from review
janikEndtner Jan 23, 2024
7caf004
[FM] Automated formating frontend
actions-user Jan 23, 2024
5c82c78
Merge remote-tracking branch 'origin/704_benutzerverwaltung' into 704…
janikEndtner Jan 23, 2024
3f193c6
#704 - Fix resetting filteredUsers when no search value is provided
Jan 24, 2024
c442495
#704 - Redirect user to team/user page if he is assigned to a team
Jan 24, 2024
4e05238
#704 - Fix unit test
Jan 24, 2024
966e1e3
#704 - Fix issue with bundle size
Jan 24, 2024
31e4c26
Remove unnecessary important tags to resolve conversation
ManuelMoeri Jan 24, 2024
653d426
Merge branch 'feature/731-plussign-balance' of github.com:puzzle/okr …
ManuelMoeri Jan 24, 2024
012fece
Fix button size after re-reading conversation
ManuelMoeri Jan 24, 2024
a2aa397
Format code
ManuelMoeri Jan 24, 2024
17b5c4d
[FM] Automated formating frontend
actions-user Jan 24, 2024
1e4f7de
#704 - Add missing injectable annotation
Jan 24, 2024
cd2cc45
#704 - Fix integration tests
Jan 24, 2024
c44639d
#704 - Fix integration tests
Jan 24, 2024
e066e60
Merge pull request #764 from puzzle/feature/731-plussign-balance
peggimann Jan 24, 2024
b021ae4
[VU] Automated version update
actions-user Jan 24, 2024
688eb76
remove notnull constraint from dates on quarter model in backend writ…
RandomTannenbaum Jan 16, 2024
5c3190b
Fix new migration and add insert of backlog quarter
lkleisa Jan 17, 2024
7cbfd41
Pass backlog to frontend
lkleisa Jan 17, 2024
7b54626
Disable button in frontend when adding no draft objective to backlog
lkleisa Jan 17, 2024
0c279f8
Remove publish option in three dot menu when in backlog
lkleisa Jan 17, 2024
621136d
Remove not null in db schema for testing and add backlog in testdata
lkleisa Jan 17, 2024
16aa115
Write test for backlog return value in getquarters
lkleisa Jan 17, 2024
2c8b32e
Add backlogQuarter in controller test
lkleisa Jan 17, 2024
5e18c90
Allow on duplicate to choose backlog
lkleisa Jan 17, 2024
af157ba
Add validation that quarter start end date on objective create and up…
lkleisa Jan 17, 2024
0fa0df8
Write e2e test for backlog
lkleisa Jan 18, 2024
4e5b4d4
Fix wrong button alignment in objective dialog
lkleisa Jan 18, 2024
f16de72
Add check for null on start end date on quarter generation
lkleisa Jan 18, 2024
135c9b9
Move exception check for quarter start end date to QuarterValidationS…
lkleisa Jan 18, 2024
2e9da39
Write unit test for objective.component
lkleisa Jan 18, 2024
1ec2f06
Write unit test for objective.form.component
lkleisa Jan 18, 2024
bf128ea
Add custom toaster message on objective creation in backlog
lkleisa Jan 18, 2024
ddd9682
Check for backlog quarter over start and end date and not id
lkleisa Jan 18, 2024
d6d3e44
Make overview view all uppercase for fixing tests
lkleisa Jan 18, 2024
2e97459
Remove last check on id 999 and use check on null start end date
lkleisa Jan 18, 2024
eb3dd46
[FM] Automated formating frontend
actions-user Jan 18, 2024
a4f4fa9
Fix frontend tests
lkleisa Jan 18, 2024
fb98143
Fix e2e tests
lkleisa Jan 18, 2024
8089658
Change id from 999 to 199 in tests
lkleisa Jan 18, 2024
c618b82
Add backlog to index 0
lkleisa Jan 19, 2024
c90538e
Backend check that objective state must be draft when backlog quarter
lkleisa Jan 19, 2024
5958252
fix shouldGetBacklogQuarter test in QuarterBusinessServiceTest
RandomTannenbaum Jan 19, 2024
b67d29a
add objective validation service tests to ensure you cant move or cre…
RandomTannenbaum Jan 19, 2024
783b9a3
Fix frontend tests
lkleisa Jan 19, 2024
791f9f5
Make migration working
lkleisa Jan 19, 2024
9f21ebf
Remove save button when creating objective in backlog
lkleisa Jan 22, 2024
aa0849a
Remove start end date in dtos and check with regex on quarter label
lkleisa Jan 22, 2024
575ad50
Use validation service in QuarterBusinessService
lkleisa Jan 22, 2024
b33f798
Add publish option in backlog
lkleisa Jan 22, 2024
99b6425
Fix bugs with new option to publish from backlog
lkleisa Jan 22, 2024
a46e86c
Fix frontend test for new quarter backlog
lkleisa Jan 24, 2024
c666472
Adjust code and add ongoing state on release of backlog objective
lkleisa Jan 24, 2024
ca9f265
Fix e2e test
lkleisa Jan 24, 2024
ef198da
Rename migration
lkleisa Jan 24, 2024
0ffdd89
#704 - Fix cypress test checkIn.cy.ts
Jan 24, 2024
c55bf40
#704 - Fix cypress test checkIn.cy.ts
Jan 24, 2024
03dff7c
#704 - Fix cypress test overview.cy.ts
Jan 24, 2024
72113e5
Merge pull request #754 from puzzle/feature/727-backlog
peggimann Jan 24, 2024
00dbb61
[VU] Automated version update
actions-user Jan 24, 2024
4eefcc0
#704 - Fix cypress tests
Jan 25, 2024
7bd4c35
update icon
kcinay055679 Jan 25, 2024
f135c30
#704 fix tab.cy and team.cy tests
janikEndtner Jan 25, 2024
99c2a46
#704 fix margin of p elements
janikEndtner Jan 25, 2024
7d8db11
Merge pull request #779 from puzzle/feature/732-icon-ongoing-objectives
peggimann Jan 29, 2024
b43fb54
[VU] Automated version update
actions-user Jan 29, 2024
f62ae6f
implement field on form and media queries to switch places of divs in…
Vakmeth Jan 16, 2024
388a1de
add margin-bottom when divs are under each other
Vakmeth Jan 16, 2024
22afaa9
change naming of label
Vakmeth Jan 16, 2024
18e9382
write e2e test and add double dot in label of check-in
Vakmeth Jan 16, 2024
8544ce6
decrease breaktpoint of input fields
Vakmeth Jan 16, 2024
3d6466e
fix styling
kcinay055679 Jan 22, 2024
db707fb
remove double dot
kcinay055679 Jan 22, 2024
2cabd3f
divide aktuller wert and letzter wert as much as possible
kcinay055679 Jan 22, 2024
7f84884
split with gap
kcinay055679 Jan 23, 2024
924bad2
Adjust height on mobile device between input field and current value
lkleisa Jan 29, 2024
639c9e8
Merge pull request #750 from puzzle/feature/728-letzter-wert-check-in…
peggimann Jan 29, 2024
8fa02de
[VU] Automated version update
actions-user Jan 29, 2024
f424245
#704 set okr champion from application properties in registrationServ…
janikEndtner Jan 29, 2024
8b9a41c
[FM] Automated formating backend
actions-user Jan 29, 2024
e24486c
#704 fix button margins and remove unnecessary properties from applic…
janikEndtner Jan 29, 2024
5652cf2
Merge remote-tracking branch 'origin/704_benutzerverwaltung' into 704…
janikEndtner Jan 29, 2024
f12c5f2
#704 - Stay on the current team-management page / or sub page when cl…
Jan 29, 2024
8e4fae8
Merge remote-tracking branch 'origin/704_benutzerverwaltung' into 704…
Jan 29, 2024
4543647
#704 - Fix unit test
Jan 29, 2024
19a7fbf
#704 - Fix issue with sequence_person_team in dev-db
Jan 29, 2024
05f06c7
#704 update first- and lastname from jwt token
janikEndtner Jan 29, 2024
fa9dc99
Merge remote-tracking branch 'origin/704_benutzerverwaltung' into 704…
janikEndtner Jan 29, 2024
bd6a0da
#704 fix test
janikEndtner Jan 29, 2024
7227d4a
Merge branch 'main' into 704_benutzerverwaltung
janikEndtner Jan 29, 2024
6a161a7
#704 fix issues after merge
janikEndtner Jan 29, 2024
8e4adab
[FM] Automated formating frontend
actions-user Jan 29, 2024
8fbc48e
#704 fix cypress tests after merge
janikEndtner Jan 29, 2024
d070849
Merge remote-tracking branch 'origin/704_benutzerverwaltung' into 704…
janikEndtner Jan 29, 2024
87377e8
#704 - Fix issue with cypress interception of @keyresults
Jan 29, 2024
29e80bb
#704 - Fix issue with cypress interception of @keyresults
Jan 29, 2024
0f65754
#704 - Fix cypress tests
Jan 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ sonar-project.properties
/frontend/cypress/downloads/
/frontend/cypress/screenshots/
/toolchains.xml
/backend/src/main/resources/db/okr_schema.sql
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This project contains two parts:

[Frontend description](frontend/README.md)


## Backend
[Backend description](backend/README.md)

Expand Down
1 change: 1 addition & 0 deletions backend/src/main/java/ch/puzzle/okr/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ private Constants() {
public static final String QUARTER = "Quarter";
public static final String TEAM = "Team";
public static final String USER = "User";
public static final String USER_TEAM = "UserTeam";
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public class SpringCachingConfig {

@Bean
public CacheManager cacheManager() {
return new ConcurrentMapCacheManager(AUTHORIZATION_USER_CACHE, USER_CACHE);
return new ConcurrentMapCacheManager(AUTHORIZATION_USER_CACHE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ public void emptyAuthorizationUsersCache() {
cacheService.emptyAuthorizationUsersCache();
}

@Operation(summary = "Delete users cache", description = "Delete users cache")
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Users cache deleted") })
@PostMapping("emptyUsersCache")
public void emptyUsersCache() {
cacheService.emptyUsersCache();
}

@Operation(summary = "Delete all caches", description = "Delete all caches")
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "All caches deleted") })
@PostMapping("emptyAllCaches")
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package ch.puzzle.okr.controller;

import ch.puzzle.okr.dto.overview.DashboardDto;
import ch.puzzle.okr.dto.overview.OverviewDto;
import ch.puzzle.okr.mapper.DashboardMapper;
import ch.puzzle.okr.mapper.OverviewMapper;
import ch.puzzle.okr.service.authorization.OverviewAuthorizationService;
import io.swagger.v3.oas.annotations.Operation;
Expand All @@ -23,14 +21,12 @@
@RequestMapping("api/v2/overview")
public class OverviewController {
private final OverviewMapper overviewMapper;
private final DashboardMapper dashboardMapper;
private final OverviewAuthorizationService overviewAuthorizationService;

public OverviewController(OverviewMapper overviewMapper, OverviewAuthorizationService overviewAuthorizationService,
DashboardMapper dashboardMapper) {
public OverviewController(OverviewMapper overviewMapper,
OverviewAuthorizationService overviewAuthorizationService) {
this.overviewMapper = overviewMapper;
this.overviewAuthorizationService = overviewAuthorizationService;
this.dashboardMapper = dashboardMapper;
}

@Operation(summary = "Get all teams and their objectives", description = "Get a List of teams with their objectives")
Expand All @@ -41,14 +37,11 @@ public OverviewController(OverviewMapper overviewMapper, OverviewAuthorizationSe
@ApiResponse(responseCode = "401", description = "Not authorized to read teams with their objectives", content = @Content),
@ApiResponse(responseCode = "404", description = "The quarter or one of the teams were not found", content = @Content) })
@GetMapping("")
public ResponseEntity<DashboardDto> getOverview(
public ResponseEntity<List<OverviewDto>> getOverview(
@RequestParam(required = false, defaultValue = "", name = "team") List<Long> teamFilter,
@RequestParam(required = false, defaultValue = "", name = "quarter") Long quarterFilter,
@RequestParam(required = false, defaultValue = "", name = "objectiveQuery") String objectiveQuery) {
boolean hasWriteAllAccess = overviewAuthorizationService.hasWriteAllAccess();
return ResponseEntity.status(HttpStatus.OK)
.body(dashboardMapper.toDto(overviewMapper.toDto(
overviewAuthorizationService.getFilteredOverview(quarterFilter, teamFilter, objectiveQuery)),
hasWriteAllAccess));
return ResponseEntity.status(HttpStatus.OK).body(overviewMapper
.toDto(overviewAuthorizationService.getFilteredOverview(quarterFilter, teamFilter, objectiveQuery)));
}
}
45 changes: 40 additions & 5 deletions backend/src/main/java/ch/puzzle/okr/controller/TeamController.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ch.puzzle.okr.controller;

import ch.puzzle.okr.dto.TeamDto;
import ch.puzzle.okr.dto.UserDto;
import ch.puzzle.okr.mapper.TeamMapper;
import ch.puzzle.okr.models.Team;
import ch.puzzle.okr.service.authorization.TeamAuthorizationService;
Expand Down Expand Up @@ -34,9 +35,7 @@ public TeamController(TeamAuthorizationService teamAuthorizationService, TeamMap
@Content(mediaType = "application/json", schema = @Schema(implementation = TeamDto.class)) }), })
@GetMapping
public List<TeamDto> getAllTeams() {
List<Long> userTeamIds = teamAuthorizationService.getUserTeamIds();
return teamAuthorizationService.getAllTeams().stream().map(team -> teamMapper.toDto(team, userTeamIds))
.toList();
return teamAuthorizationService.getAllTeams().stream().map(teamMapper::toDto).toList();
}

@Operation(summary = "Create Team", description = "Create a new Team")
Expand All @@ -49,7 +48,7 @@ public List<TeamDto> getAllTeams() {
public ResponseEntity<TeamDto> createTeam(
@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The Team as json to create a new Team.", required = true) @RequestBody TeamDto teamDto) {
Team createdTeam = teamAuthorizationService.createEntity(teamMapper.toTeam(teamDto));
return ResponseEntity.status(HttpStatus.CREATED).body(teamMapper.toDto(createdTeam, List.of()));
return ResponseEntity.status(HttpStatus.CREATED).body(teamMapper.toDto(createdTeam));
}

@Operation(summary = "Update Team", description = "Update a Team by ID.")
Expand All @@ -64,7 +63,7 @@ public ResponseEntity<TeamDto> updateTeam(
@Parameter(description = "The ID for updating a Team.", required = true) @PathVariable long id,
@RequestBody TeamDto teamDto) {
Team updatedTeam = teamAuthorizationService.updateEntity(teamMapper.toTeam(teamDto), id);
return ResponseEntity.status(OK).body(teamMapper.toDto(updatedTeam, List.of()));
return ResponseEntity.status(OK).body(teamMapper.toDto(updatedTeam));
}

@Operation(summary = "Delete Team by ID", description = "Delete Team by ID")
Expand All @@ -76,4 +75,40 @@ public void deleteTeamById(
@Parameter(description = "The ID of an Team to delete it.", required = true) @PathVariable long id) {
teamAuthorizationService.deleteEntity(id);
}

@Operation(summary = "Add users to a team", description = "Add users to a team")
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Added users to team"),
@ApiResponse(responseCode = "401", description = "Not authorized to add users to the team", content = @Content),
@ApiResponse(responseCode = "404", description = "Did not find the Team with requested ID") })
@PutMapping("/{id}/addusers")
public void addUsersToTeam(
@Parameter(description = "The ID of an Team to add to users to it.", required = true) @PathVariable long id,
@RequestBody List<UserDto> userDtoList) {
var userIds = userDtoList.stream().map(UserDto::id).toList();
teamAuthorizationService.addUsersToTeam(id, userIds);
}

@Operation(summary = "Remove User from Team", description = "Remove User with given UserID from Team")
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Removed User from Team"),
@ApiResponse(responseCode = "401", description = "Not authorized to remove user from team", content = @Content),
@ApiResponse(responseCode = "404", description = "Did not find the Team with requested ID") })
@PutMapping("/{id}/user/{userId}/removeuser")
Makae marked this conversation as resolved.
Show resolved Hide resolved
public void removeUserFromTeam(
@Parameter(description = "The ID of an team to remove the user from it.", required = true) @PathVariable long id,
@Parameter(description = "The User ID to remove from the team.", required = true) @PathVariable long userId) {
teamAuthorizationService.removeUserFromTeam(id, userId);
}

@Operation(summary = "Update or add team membership", description = "If user is already member of this team, isAdmin is set. otherwise new team membership "
+ "is added with isAdmin true or false")
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Update or add team membership"),
@ApiResponse(responseCode = "401", description = "Not authorized to update or add team membership", content = @Content),
@ApiResponse(responseCode = "404", description = "Did not find the Team with requested ID") })
@PutMapping("/{id}/user/{userId}/updateaddteammembership/{isAdmin}")
public void updateOrAddTeamMembership(
@Parameter(description = "The ID of an team to update or add membership", required = true) @PathVariable long id,
@Parameter(description = "The User ID to update or add membership", required = true) @PathVariable long userId,
@Parameter(description = "The parameter if user should be admin or not", required = true) @PathVariable boolean isAdmin) {
teamAuthorizationService.updateOrAddTeamMembership(id, userId, isAdmin);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

import ch.puzzle.okr.dto.UserDto;
import ch.puzzle.okr.mapper.UserMapper;
import ch.puzzle.okr.service.authorization.AuthorizationService;
import ch.puzzle.okr.service.authorization.UserAuthorizationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -19,10 +22,13 @@
public class UserController {

private final UserAuthorizationService userAuthorizationService;
private final AuthorizationService authorizationService;
private final UserMapper userMapper;

public UserController(UserAuthorizationService userAuthorizationService, UserMapper userMapper) {
public UserController(UserAuthorizationService userAuthorizationService, AuthorizationService authorizationService,
UserMapper userMapper) {
this.userAuthorizationService = userAuthorizationService;
this.authorizationService = authorizationService;
this.userMapper = userMapper;
}

Expand All @@ -34,4 +40,24 @@ public List<UserDto> getAllUsers() {
return userAuthorizationService.getAllUsers().stream().map(userMapper::toDto).toList();
}

@Operation(summary = "Get Current User", description = "Get all current logged in user.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Returned current logged in user.", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = UserDto.class)) }), })
@GetMapping(path = "/current")
public UserDto getCurrentUser() {
var currentUser = this.authorizationService.updateOrAddAuthorizationUser().user();
return userMapper.toDto(currentUser);
}

@Operation(summary = "Get User by ID", description = "Get user by given ID.")
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Returned user", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = UserDto.class)) }), })
@GetMapping(path = "/{id}")
public UserDto getUserById(
@Parameter(description = "The ID for requested user.", required = true) @PathVariable long id) {
var user = this.userAuthorizationService.getById(id);
return userMapper.toDto(user);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ public JwtConverterFactory(ApplicationContext appContext) {
this.appContext = appContext;
}

public synchronized Converter<Jwt, List<String>> getJwtOrganisationConverter() {
if (jwtOrganisationConverter == null) {
// place to load configured converter instead of default converter
jwtOrganisationConverter = appContext.getBean(JwtOrganisationConverter.class);
}
return jwtOrganisationConverter;
}

public synchronized Converter<Jwt, User> getJwtUserConverter() {
if (jwtUserConverter == null) {
// place to load configured converter instead of default converter
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.security.oauth2.jwt.Jwt;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Map;

import static ch.puzzle.okr.Constants.USER;
Expand All @@ -20,8 +21,6 @@ public class JwtUserConverter implements Converter<Jwt, User> {

private static final Logger logger = LoggerFactory.getLogger(JwtUserConverter.class);

@Value("${okr.jwt.user.username}")
private String username;
@Value("${okr.jwt.user.firstname}")
private String firstname;
@Value("${okr.jwt.user.lastname}")
Expand All @@ -35,9 +34,9 @@ public User convert(Jwt token) {
logger.debug("claims {}", claims);

try {
return User.Builder.builder().withUsername(claims.get(username).toString())
.withFirstname(claims.get(firstname).toString()).withLastname(claims.get(lastname).toString())
.withEmail(claims.get(email).toString()).build();
return User.Builder.builder().withFirstname(claims.get(firstname).toString())
.withLastname(claims.get(lastname).toString()).withEmail(claims.get(email).toString())
.withUserTeamList(new ArrayList<>()).build();
} catch (Exception e) {
logger.warn("can not convert user from claims {}", claims);
throw new OkrResponseStatusException(BAD_REQUEST, ErrorKey.CONVERT_TOKEN, USER);
Expand Down
6 changes: 0 additions & 6 deletions backend/src/main/java/ch/puzzle/okr/dto/OrganisationDto.java

This file was deleted.

4 changes: 1 addition & 3 deletions backend/src/main/java/ch/puzzle/okr/dto/TeamDto.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package ch.puzzle.okr.dto;

import java.util.List;

public record TeamDto(Long id, int version, String name, List<OrganisationDto> organisations, boolean filterIsActive) {
public record TeamDto(Long id, int version, String name, boolean writeable) {
}
6 changes: 4 additions & 2 deletions backend/src/main/java/ch/puzzle/okr/dto/UserDto.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package ch.puzzle.okr.dto;

public record UserDto(Long id, int version, String username, String firstname, String lastname, String email,
boolean isWriteable) {
import java.util.List;

public record UserDto(Long id, int version, String firstname, String lastname, String email,
List<UserTeamDto> userTeamList, boolean isOkrChampion) {
}
4 changes: 4 additions & 0 deletions backend/src/main/java/ch/puzzle/okr/dto/UserTeamDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package ch.puzzle.okr.dto;

public record UserTeamDto(Long id, int version, TeamDto team, boolean isTeamAdmin) {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ch.puzzle.okr.dto.overview;

public record OverviewTeamDto(Long id, int version, String name, boolean writable, boolean hasInActiveOrganisations) {
public record OverviewTeamDto(Long id, int version, String name, boolean writeable) {
}
Loading
Loading