fixed client config selection only for cc of institution of exam
This commit is contained in:
parent
6c8aa7b12c
commit
af8cca8ab2
2 changed files with 10 additions and 4 deletions
|
@ -24,6 +24,7 @@ import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import ch.ethz.seb.sebserver.gbl.Constants;
|
import ch.ethz.seb.sebserver.gbl.Constants;
|
||||||
import ch.ethz.seb.sebserver.gbl.model.Domain;
|
import ch.ethz.seb.sebserver.gbl.model.Domain;
|
||||||
|
import ch.ethz.seb.sebserver.gbl.model.Entity;
|
||||||
import ch.ethz.seb.sebserver.gbl.model.EntityKey;
|
import ch.ethz.seb.sebserver.gbl.model.EntityKey;
|
||||||
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigCreationInfo;
|
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigCreationInfo;
|
||||||
import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
|
import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
|
||||||
|
@ -68,7 +69,7 @@ public class ExamCreateClientConfigPopup {
|
||||||
this.downloadFileName = downloadFileName;
|
this.downloadFileName = downloadFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Function<PageAction, PageAction> exportFunction() {
|
public Function<PageAction, PageAction> exportFunction(final Long examInstitutionId) {
|
||||||
|
|
||||||
return action -> {
|
return action -> {
|
||||||
|
|
||||||
|
@ -80,7 +81,8 @@ public class ExamCreateClientConfigPopup {
|
||||||
|
|
||||||
final CreationFormContext creationFormContext = new CreationFormContext(
|
final CreationFormContext creationFormContext = new CreationFormContext(
|
||||||
this.pageService,
|
this.pageService,
|
||||||
action.pageContext());
|
action.pageContext(),
|
||||||
|
String.valueOf(examInstitutionId));
|
||||||
|
|
||||||
final Predicate<FormHandle<?>> doCreate = formHandle -> doCreate(
|
final Predicate<FormHandle<?>> doCreate = formHandle -> doCreate(
|
||||||
this.pageService,
|
this.pageService,
|
||||||
|
@ -124,13 +126,16 @@ public class ExamCreateClientConfigPopup {
|
||||||
|
|
||||||
private final PageService pageService;
|
private final PageService pageService;
|
||||||
private final PageContext pageContext;
|
private final PageContext pageContext;
|
||||||
|
private final String examInstitutionId;
|
||||||
|
|
||||||
protected CreationFormContext(
|
protected CreationFormContext(
|
||||||
final PageService pageService,
|
final PageService pageService,
|
||||||
final PageContext pageContext) {
|
final PageContext pageContext,
|
||||||
|
final String examInstitutionId) {
|
||||||
|
|
||||||
this.pageService = pageService;
|
this.pageService = pageService;
|
||||||
this.pageContext = pageContext;
|
this.pageContext = pageContext;
|
||||||
|
this.examInstitutionId = examInstitutionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -138,6 +143,7 @@ public class ExamCreateClientConfigPopup {
|
||||||
|
|
||||||
final List<Tuple<String>> configs = this.pageService.getRestService().getBuilder(GetClientConfigs.class)
|
final List<Tuple<String>> configs = this.pageService.getRestService().getBuilder(GetClientConfigs.class)
|
||||||
.withQueryParam(SEBClientConfig.FILTER_ATTR_ACTIVE, Constants.TRUE_STRING)
|
.withQueryParam(SEBClientConfig.FILTER_ATTR_ACTIVE, Constants.TRUE_STRING)
|
||||||
|
.withQueryParam(Entity.FILTER_ATTR_INSTITUTION, this.examInstitutionId)
|
||||||
.call()
|
.call()
|
||||||
.getOrThrow()
|
.getOrThrow()
|
||||||
.stream()
|
.stream()
|
||||||
|
|
|
@ -397,7 +397,7 @@ public class ExamForm implements TemplateComposer {
|
||||||
|
|
||||||
.newAction(ActionDefinition.EXAM_SEB_CLIENT_CONFIG_EXPORT)
|
.newAction(ActionDefinition.EXAM_SEB_CLIENT_CONFIG_EXPORT)
|
||||||
.withEntityKey(entityKey)
|
.withEntityKey(entityKey)
|
||||||
.withExec(this.examCreateClientConfigPopup.exportFunction())
|
.withExec(this.examCreateClientConfigPopup.exportFunction(exam.institutionId))
|
||||||
.publishIf(() -> writeGrant && readonly)
|
.publishIf(() -> writeGrant && readonly)
|
||||||
|
|
||||||
.newAction(ActionDefinition.EXAM_MODIFY_SEB_RESTRICTION_DETAILS)
|
.newAction(ActionDefinition.EXAM_MODIFY_SEB_RESTRICTION_DETAILS)
|
||||||
|
|
Loading…
Reference in a new issue