-
Notifications
You must be signed in to change notification settings - Fork 2
Ip 60 formularz wprowadzania nazwy portfela programu #45
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
Merged
mistermotopl
merged 7 commits into
develop
from
IP-60-Formularz-wprowadzania-nazwy-portfela-programu
May 11, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f5b5897
Add form to create new group and connect it to backend
mistermotopl 76c0376
Change endpoint for searching projects by attributes
mistermotopl 4b8a320
Merge branch 'develop' into IP-60-Formularz-wprowadzania-nazwy-portfe…
mistermotopl 6195d28
Fix after merging
mistermotopl c88cb1d
Change enpoints for searching for projects, add access for authority …
mistermotopl 4e4c468
Change search project endpoint (add specification), clear some things…
mistermotopl 77255a4
Correct default values in form
mistermotopl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...rc/main/java/pl/edu/agh/project_manager/service/command/project/SearchProjectCommand.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package pl.edu.agh.project_manager.service.command.project; | ||
|
|
||
| import pl.edu.agh.project_manager.domain.enums.UserRole; | ||
| import pl.edu.agh.project_manager.security.UserPrincipal; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| public record SearchProjectCommand( | ||
| UserPrincipal user, | ||
| String query, | ||
| UUID groupId, | ||
| Boolean unassignedOnly | ||
| ) { | ||
| public SearchProjectCommand toCommand(UserPrincipal user, String query, UUID groupId, Boolean unassignedOnly) { | ||
| return new SearchProjectCommand(user, query, groupId, unassignedOnly); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...anager/src/main/java/pl/edu/agh/project_manager/service/project/ProjectSpecification.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package pl.edu.agh.project_manager.service.project; | ||
|
|
||
| import jakarta.persistence.criteria.Join; | ||
| import org.springframework.data.jpa.domain.Specification; | ||
| import pl.edu.agh.project_manager.domain.entity.project.Project; | ||
| import pl.edu.agh.project_manager.domain.entity.user.User; | ||
| import pl.edu.agh.project_manager.security.UserPrincipal; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| public class ProjectSpecification { | ||
|
|
||
| public static Specification<Project> withSearchPattern(String query) { | ||
| return (root, query1, cb) -> { | ||
| String pattern = "%" + query.toLowerCase() + "%"; | ||
| return cb.like(cb.lower(root.get("title")), pattern); | ||
| }; | ||
| } | ||
|
|
||
| public static Specification<Project> accessibleByUser(UserPrincipal user) { | ||
| return (root, query, cb) -> switch (user.userRole()) { | ||
| case PROJECT_MANAGER -> | ||
| cb.equal(root.get("projectManager").get("id"), user.userId()); | ||
| case LINEAR_MANAGER, COMMON -> { | ||
| Join<Project, User> membersJoin = root.join("members"); | ||
| query.distinct(true); | ||
| yield cb.equal(membersJoin.get("id"), user.userId()); | ||
| } | ||
| case ADMINISTRATOR, AUTHORITY -> cb.conjunction(); | ||
| }; | ||
| } | ||
|
|
||
| public static Specification<Project> inGroup(UUID groupId) { | ||
| return (root, query, cb) -> cb.equal(root.get("projectGroup").get("id"), groupId); | ||
| } | ||
|
|
||
| public static Specification<Project> unassigned() { | ||
| return (root, query, cb) -> cb.isNull(root.get("projectGroup")); | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.