Skip to content

Commit fea261e

Browse files
committed
webapp/form: disable single option select
1 parent 78ae226 commit fea261e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

webapp/cypress/e2e/task-creation.cy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ it("submits with tabular task", () => {
2525
});
2626

2727
cy.get("select[name='trainingInformation.scheme']").select("federated");
28-
cy.get("select[name='trainingInformation.aggregationStrategy']").select("mean");
2928
cy.get("input[name='trainingInformation.epochs']").type("10");
3029
cy.get("input[name='trainingInformation.batchSize']").type("5");
3130
cy.get("input[name='trainingInformation.roundDuration']").type("2");

webapp/src/components/task_creation_form/TaskCreationForm.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,10 @@
314314
name="trainingInformation.aggregationStrategy"
315315
as="select"
316316
v-model="aggregationStrategy"
317+
:disabled="scheme !== 'decentralized'"
317318
>
318319
<option value="mean">Mean</option>
319-
<option v-if="scheme === 'decentralized'" value="secure">
320-
Secure
321-
</option>
320+
<option value="secure">Secure</option>
322321
</FormField>
323322

324323
<FormLabel
@@ -597,6 +596,13 @@ watch([dataType, form], ([dataType, form]) => {
597596
}
598597
});
599598
599+
watch([scheme, form], ([scheme, form]) => {
600+
if (form === null) return;
601+
602+
if (scheme !== "decentralized")
603+
form.setFieldValue("trainingInformation.aggregationStrategy", "mean");
604+
});
605+
600606
// warn user on page content loss
601607
window.onbeforeunload = (event) => {
602608
if (form.value === null || form.value.meta.dirty === false) return;

0 commit comments

Comments
 (0)