-
Notifications
You must be signed in to change notification settings - Fork 2
feat(risks): implement 5x5 risk matrix and fix persistence bug #62
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
mtrznadel24
merged 2 commits into
develop
from
IP-102-implementacja-nowego-modelu-ryzyk
May 23, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
21 changes: 0 additions & 21 deletions
21
...manager/src/main/java/pl/edu/agh/project_manager/controller/dto/project/RiskResponse.java
This file was deleted.
Oops, something went wrong.
17 changes: 11 additions & 6 deletions
17
...r/controller/dto/project/RiskRequest.java → ...oject/projectrisk/ProjectRiskRequest.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 |
|---|---|---|
| @@ -1,26 +1,31 @@ | ||
| package pl.edu.agh.project_manager.controller.dto.project; | ||
| package pl.edu.agh.project_manager.controller.dto.project.projectrisk; | ||
|
|
||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import org.hibernate.validator.constraints.Range; | ||
| import pl.edu.agh.project_manager.service.command.project.RiskCommand; | ||
|
|
||
| public record RiskRequest( | ||
| public record ProjectRiskRequest( | ||
| @NotBlank(message = "Nazwa ryzyka nie może być pusta!") | ||
| String name, | ||
|
|
||
| @NotBlank(message = "Opis ryzyka nie może być pusty!") | ||
| String description, | ||
|
|
||
| @NotNull(message = "Poziom prawdopodobieństwa jest wymagany!") | ||
| @Range(min = 0, max = 100, message = "Prawdopodobieństwo musi być w skali 0-100%!") | ||
| Integer probability | ||
| @Range(min = 1, max = 5, message = "Prawdopodobieństwo musi być w skali 1-5!") | ||
| Integer probability, | ||
|
|
||
| @NotNull(message = "Poziom wpływu jest wymagany!") | ||
| @Range(min = 1, max = 5, message = "Wpływ musi być w skali 1-5!") | ||
| Integer impact | ||
| ) { | ||
| public RiskCommand toCommand() { | ||
| return new RiskCommand( | ||
| this.name, | ||
| this.description, | ||
| this.probability | ||
| this.probability, | ||
| this.impact | ||
| ); | ||
| } | ||
| } | ||
| } |
25 changes: 25 additions & 0 deletions
25
...va/pl/edu/agh/project_manager/controller/dto/project/projectrisk/ProjectRiskResponse.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,25 @@ | ||
| package pl.edu.agh.project_manager.controller.dto.project.projectrisk; | ||
|
|
||
| import pl.edu.agh.project_manager.domain.entity.project.ProjectRisk; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| public record ProjectRiskResponse( | ||
| UUID id, | ||
| String name, | ||
| String description, | ||
| Integer probability, | ||
| Integer impact, | ||
| Integer value | ||
| ) { | ||
| public static ProjectRiskResponse from(ProjectRisk risk) { | ||
| return new ProjectRiskResponse( | ||
| risk.getId(), | ||
| risk.getName(), | ||
| risk.getDescription(), | ||
| risk.getProbability(), | ||
| risk.getImpact(), | ||
| risk.getProbability() * risk.getImpact() | ||
| ); | ||
| } | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,8 @@ export const CreateProjectForm = () => { | |
| }, | ||
| }); | ||
|
|
||
| const { data: groups = [] } = useProjectGroups(); | ||
| const { data: groupsData = [] } = useProjectGroups(); | ||
| const groups = groupsData.map(g => ({ id: g.id, name: g.name })); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. potrzebne to? |
||
|
|
||
| const [sponsorsQuery, setSponsorsQuery] = useState(""); | ||
| const [sponsorsQueryValue] = useDebounce(sponsorsQuery, 300); | ||
|
|
@@ -44,11 +45,7 @@ export const CreateProjectForm = () => { | |
| const navigate = useNavigate(); | ||
|
|
||
| const onSubmit = methods.handleSubmit((data) => { | ||
| const payload = { | ||
| ...data, | ||
| }; | ||
|
|
||
| mutation.mutate(payload, { | ||
| mutation.mutate(data, { | ||
| onSuccess: (newProjectId) => { | ||
| methods.reset(); | ||
| navigate(PATHS.PROJECT(newProjectId)); | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Czy jak się to wprowadzi to nie będzie problemu dla ryzyk już istniejących? Trzeba będzie wyczyścić wszystko?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bedzie trzeba