fixed import new config reload

This commit is contained in:
anhefti 2019-11-05 14:22:30 +01:00
parent 9bc8dfaf8b
commit 38442dda25
3 changed files with 25 additions and 6 deletions

View file

@ -131,9 +131,12 @@ public class MainPage implements TemplateComposer {
contentObjects.setLayout(contentObjectslayout);
contentObjects.setData(
PageEventListener.LISTENER_ATTRIBUTE_KEY,
new ContentActionEventListener(event -> pageContext.composerService().compose(
event.action.definition.targetState.contentPaneComposer(),
event.action.pageContext().copyOf(contentObjects)), 2));
new ContentActionEventListener(event -> pageContext
.composerService()
.compose(
event.action.definition.targetState.contentPaneComposer(),
event.action.pageContext().copyOf(contentObjects)),
2));
final Composite actionPane = new Composite(mainSash, SWT.NONE);
actionPane.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
@ -142,9 +145,12 @@ public class MainPage implements TemplateComposer {
actionPane.setData(RWT.CUSTOM_VARIANT, "actionPane");
actionPane.setData(
PageEventListener.LISTENER_ATTRIBUTE_KEY,
new ContentActionEventListener(event -> pageContext.composerService().compose(
event.action.definition.targetState.actionPaneComposer(),
event.action.pageContext().copyOf(actionPane)), 1));
new ContentActionEventListener(event -> pageContext
.composerService()
.compose(
event.action.definition.targetState.actionPaneComposer(),
event.action.pageContext().copyOf(actionPane)),
1));
pageContext.composerService().compose(
ActivitiesPane.class,

View file

@ -23,6 +23,7 @@ import ch.ethz.seb.sebserver.gbl.model.EntityKey;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.Configuration;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gui.content.action.ActionDefinition;
import ch.ethz.seb.sebserver.gui.form.Form;
import ch.ethz.seb.sebserver.gui.form.FormBuilder;
import ch.ethz.seb.sebserver.gui.form.FormHandle;
@ -31,6 +32,7 @@ import ch.ethz.seb.sebserver.gui.service.i18n.LocTextKey;
import ch.ethz.seb.sebserver.gui.service.page.ModalInputDialogComposer;
import ch.ethz.seb.sebserver.gui.service.page.PageContext;
import ch.ethz.seb.sebserver.gui.service.page.PageService;
import ch.ethz.seb.sebserver.gui.service.page.event.ActionEvent;
import ch.ethz.seb.sebserver.gui.service.page.impl.ModalInputDialog;
import ch.ethz.seb.sebserver.gui.service.page.impl.PageAction;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
@ -141,6 +143,16 @@ public final class SebExamConfigImport {
if (!configuration.hasError()) {
context.publishInfo(SebExamConfigPropForm.FORM_IMPORT_CONFIRM_TEXT_KEY);
if (newConfig) {
final PageAction action = pageService.pageActionBuilder(context)
.newAction(ActionDefinition.SEB_EXAM_CONFIG_IMPORT_TO_NEW_CONFIG)
.create();
pageService.firePageEvent(
new ActionEvent(action),
action.pageContext());
}
return true;
}
} else {

View file

@ -371,6 +371,7 @@ public enum ActionDefinition {
SEB_EXAM_CONFIG_IMPORT_TO_NEW_CONFIG(
new LocTextKey("sebserver.examconfig.action.import-config"),
ImageIcon.IMPORT,
PageStateDefinitionImpl.SEB_EXAM_CONFIG_LIST,
ActionCategory.VARIA),
SEB_EXAM_CONFIG_MODIFY_PROP_FROM_LIST(