67: Assign supervisor to student ideas no matter if target (goal) is reached

This commit is contained in:
Tom Zhao 2025-01-27 14:52:57 +01:00
parent 5439d77d73
commit b8afa202ba
3 changed files with 23 additions and 10 deletions
view/src/main
java/se/su/dsv/scipro/match
webapp/css
war/src/main/resources

@ -205,17 +205,23 @@ public abstract class AbstractAdminIdeaPanel extends Panel {
ideaService.adminUnmatchIdea(idea, SciProSession.get().getUser());
info("Unmatched idea: " + idea.getTitle());
} else {
if (
targetService.hasTargetsLeft(
idea.getApplicationPeriod(),
newSelection,
idea.getProjectType()
)
) {
ideaService.changeSupervisor(idea, newSelection, SciProSession.get().getUser());
info("Supervisor changed");
ideaService.changeSupervisor(idea, newSelection, SciProSession.get().getUser());
Target currentTarget = targetService.findOne(idea.getApplicationPeriod(), newSelection,
idea.getProjectType());
Long countMatched = ideaService.countMatched(idea.getApplicationPeriod(), newSelection,
idea.getProjectType());
int targetCounter = (currentTarget == null) ? 0 : currentTarget.getTarget();
long matchedCounter = (countMatched == null) ? 0L : countMatched;
String msg = "Supervisor changed: matched/target -> " + matchedCounter + " / " +
targetCounter;
if (matchedCounter > targetCounter) {
warn(msg);
} else {
error("The supervisor have reached current target numbers");
info(msg);
}
}
target.addListener(new AjaxFeedbackPanelUpdater());

@ -129,6 +129,12 @@ footer a:hover { color: #d95e00;}
border-color: #EBCCD1;
}
.feedbackPanelWARNING {
color: #000000;
background-color: #FFD105;
border-color: #EBCCD1;
}
.feedbackPanelINFO {
color: #3C763D;
background-color: #DFF0D8;

@ -9,6 +9,7 @@ spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.Ph
# We also need to set the implicit strategy to be JPA compliant, as we rely on this naming strategy for certain
# join tables (idea_Keyword vs idea_keyword)
spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
spring.jpa.show-sql=false
spring.mvc.servlet.path=/api