3064 PO review 6) always fetch new data instead of showing stale
This commit is contained in:
parent
41c5ffe69f
commit
5fb540a2a9
@ -1,9 +1,7 @@
|
||||
package se.su.dsv.scipro.grading;
|
||||
|
||||
import org.apache.wicket.behavior.Behavior;
|
||||
import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
|
||||
import org.apache.wicket.extensions.markup.html.tabs.ITab;
|
||||
import org.apache.wicket.extensions.markup.html.tabs.PanelCachingTab;
|
||||
import org.apache.wicket.extensions.markup.html.tabs.TabbedPanel;
|
||||
import org.apache.wicket.markup.html.WebMarkupContainer;
|
||||
import org.apache.wicket.markup.html.link.ExternalLink;
|
||||
@ -33,9 +31,6 @@ import java.util.Set;
|
||||
|
||||
@ProjectModuleComponent(ProjectModule.GRADING)
|
||||
public class SupervisorGradingReportPage extends AbstractSupervisorProjectDetailsPage {
|
||||
|
||||
public static final String FILL_OUT_PANEL = "fillOutPanel";
|
||||
|
||||
@Inject
|
||||
private GeneralSystemSettingsService generalSystemSettingsService;
|
||||
@Inject
|
||||
@ -47,20 +42,20 @@ public class SupervisorGradingReportPage extends AbstractSupervisorProjectDetail
|
||||
super(pp);
|
||||
|
||||
List<ITab> tabs = new ArrayList<>();
|
||||
tabs.add(cachedTab(Model.of("Final thesis"),
|
||||
tabs.add(createTab(Model.of("Final thesis"),
|
||||
panelId -> new ApproveFinalThesisPanel(panelId, projectModel)));
|
||||
tabs.add(cachedTab(Model.of("Plagiarism"),
|
||||
tabs.add(createTab(Model.of("Plagiarism"),
|
||||
panelId -> new UploadTextMatchingPanel(panelId, projectModel)));
|
||||
tabs.add(cachedTab(Model.of("Publication metadata"),
|
||||
tabs.add(createTab(Model.of("Publication metadata"),
|
||||
panelId -> new PublicationMetadataPanel(panelId, projectModel)));
|
||||
tabs.add(cachedTab(Model.of("Grading basis"),
|
||||
tabs.add(createTab(Model.of("Grading basis"),
|
||||
panelId -> new GradingBasisPanel(panelId, projectModel)));
|
||||
|
||||
List<ITab> authorTabs = projectModel.getObject()
|
||||
.getProjectParticipants()
|
||||
.stream()
|
||||
.map(author -> new DetachableServiceModel<>(userService, author))
|
||||
.map(authorModel -> cachedTab(
|
||||
.map(authorModel -> createTab(
|
||||
authorModel.map(User::getFullName),
|
||||
panelId -> new IndividualAuthorAssessment(panelId, projectModel, authorModel)))
|
||||
.toList();
|
||||
@ -82,13 +77,13 @@ public class SupervisorGradingReportPage extends AbstractSupervisorProjectDetail
|
||||
add(new ExaminerTimelinePanel("examiner_timeline", projectModel));
|
||||
}
|
||||
|
||||
private ITab cachedTab(IModel<String> title, SerializableFunction<String, WebMarkupContainer> newPanel) {
|
||||
return new PanelCachingTab(new AbstractTab(title) {
|
||||
private ITab createTab(IModel<String> title, SerializableFunction<String, WebMarkupContainer> newPanel) {
|
||||
return new AbstractTab(title) {
|
||||
@Override
|
||||
public WebMarkupContainer getPanel(String panelId) {
|
||||
return newPanel.apply(panelId);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user