diff --git a/view/src/main/java/se/su/dsv/scipro/match/AbstractAdminIdeaPanel.java b/view/src/main/java/se/su/dsv/scipro/match/AbstractAdminIdeaPanel.java index e7f1301dcf..f2f43bfc13 100644 --- a/view/src/main/java/se/su/dsv/scipro/match/AbstractAdminIdeaPanel.java +++ b/view/src/main/java/se/su/dsv/scipro/match/AbstractAdminIdeaPanel.java @@ -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()); diff --git a/view/src/main/webapp/css/scipro_m.css b/view/src/main/webapp/css/scipro_m.css index 5c4184a9c0..7ce4954a00 100755 --- a/view/src/main/webapp/css/scipro_m.css +++ b/view/src/main/webapp/css/scipro_m.css @@ -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; diff --git a/war/src/main/resources/application.properties b/war/src/main/resources/application.properties index bb89287006..0df6b375e6 100644 --- a/war/src/main/resources/application.properties +++ b/war/src/main/resources/application.properties @@ -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