diff --git a/src/components/forms/EditHardwareGroupForm/EditHardwareGroupForm.js b/src/components/forms/EditHardwareGroupForm/EditHardwareGroupForm.js index 928ea62d4..56e7c68bc 100644 --- a/src/components/forms/EditHardwareGroupForm/EditHardwareGroupForm.js +++ b/src/components/forms/EditHardwareGroupForm/EditHardwareGroupForm.js @@ -3,7 +3,8 @@ import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { reduxForm, Field } from 'redux-form'; import { Alert } from 'react-bootstrap'; -import isInt from 'validator/lib/isInt'; +import Icon from 'react-fontawesome'; + import FormBox from '../../widgets/FormBox'; import SubmitButton from '../SubmitButton'; import Button from '../../widgets/FlatButton'; @@ -72,6 +73,14 @@ const EditHardwareGroupForm = ({ } > +

+    + +

+ {submitFailed && { +const validate = ({ hardwareGroup }) => { const errors = {}; - if (!isInt(String(bonusPoints))) { - errors['bonusPoints'] = ( + if (!hardwareGroup) { + errors['hardwareGroup'] = ( ); } @@ -124,9 +134,23 @@ const validate = ({ bonusPoints }) => { return errors; }; +const warn = ({ hardwareGroup }, { warnDropLimits }) => { + const warnings = {}; + if (warnDropLimits(hardwareGroup)) { + warnings['hardwareGroup'] = ( + + ); + } + return warnings; +}; + export default reduxForm({ form: 'editHardwareGroup', enableReinitialize: true, keepDirtyOnReinitialize: false, - validate + validate, + warn })(EditHardwareGroupForm); diff --git a/src/locales/cs.json b/src/locales/cs.json index d3133c15b..53cb47dbf 100644 --- a/src/locales/cs.json +++ b/src/locales/cs.json @@ -138,22 +138,12 @@ "app.confirm.no": "Ne", "app.confirm.yes": "Ano", "app.createGroup.externalId": "Externí identifikátor skupiny (například ID ze školního informačního systému):", - "app.createGroup.groupDescription": "Description:", - "app.createGroup.groupName": "Name:", "app.createGroup.hasThreshold": "Studenti potřebují určitý počet bodů pro splnění kurzu", "app.createGroup.isPublic": "Veřejná (skupinu vidí všichni uživatelé a můžou se do ní přidat)", "app.createGroup.publicStats": "Studenti mohou vidět dosažené body ostatních", "app.createGroup.threshold": "Minimální procentuální hranice potřebná ke splnění tohoto kurzu:", - "app.createGroup.validation.emptyDescription": "Group description cannot be empty.", - "app.createGroup.validation.emptyName": "Group name cannot be empty.", - "app.createGroup.validation.nameCollision": "The name \"{name}\" is already used, please choose a different one.", "app.createGroup.validation.thresholdBetweenZeroHundred": "Procentuální hranice musí být celé číslo od 0 do 100.", "app.createGroup.validation.thresholdMustBeInteger": "Procentuální hranice musí být celé číslo.", - "app.createGroupForm.createGroup": "Create new group", - "app.createGroupForm.failed": "We are sorry but we weren't able to create a new group.", - "app.createGroupForm.processing": "Group is being created ...", - "app.createGroupForm.success": "Group has been created", - "app.createGroupForm.title": "Create new group", "app.createGroupForm.validation.noLocalizedText": "Please add at least one localized text describing the group.", "app.dashboard.sisGroupsStudent": "SIS Courses - Student", "app.dashboard.sisGroupsStudentExplain": "SIS courses you are enrolled to in particular semesters and which have correspondig groups in ReCodEx.", @@ -162,14 +152,10 @@ "app.dashboard.studentOf": "Skupiny kde jste studentem", "app.dashboard.supervisorOf": "Skupiny kde jste cvičícím", "app.deleteButton.confirm": "Opravdu toto chcete smazat? Tato operace nemůže být vrácena.", - "app.deleteButton.delete": "Delete", - "app.deleteButton.deleted": "Deleted.", - "app.deleteButton.deleting": "Deleting failed", "app.editAssignment.deleteAssignment": "Smazat zadání úlohy", "app.editAssignment.deleteAssignmentWarning": "Smazání zadané úlohy odstraní všechna studentská řešní. Pro případné obnovení těchto dat prosím kontaktujte správce ReCodExu.", "app.editAssignment.description": "Změnit nastavení zadání úlohy včetně jejích limitů", "app.editAssignment.title": "Upravit zadání úlohy", - "app.editAssignmentForm.addLanguage": "Add language variant", "app.editAssignmentForm.allowSecondDeadline": "Povolit druhý termín odevzdání.", "app.editAssignmentForm.canViewLimitRatios": "Viditelnost poměrů dosažených výsledků vůči limitům", "app.editAssignmentForm.chooseFirstDeadlineBeforeSecondDeadline": "Před nastavením druhého termínu odevzdání je nutné zvolit první termín.", @@ -181,16 +167,9 @@ "app.editAssignmentForm.localized.assignment": "Zadání úlohy a popis pro studenty:", "app.editAssignmentForm.localized.locale": "Jazyková mutace:", "app.editAssignmentForm.localized.name": "Name:", - "app.editAssignmentForm.localized.noLanguage": "There is currently no text in any language for this assignment.", - "app.editAssignmentForm.localized.reallyRemoveQuestion": "Do you really want to delete the assignmenet in this language?", - "app.editAssignmentForm.localized.remove": "Remove this language", "app.editAssignmentForm.maxPointsBeforeFirstDeadline": "Maximální počet bodů pro řešení odevzdaná před prvním termínem:", "app.editAssignmentForm.maxPointsBeforeSecondDeadline": "Maximální počet bodů pro řešení odevzdaná před druhým termínem:", - "app.editAssignmentForm.moreAboutScoreConfig": "Read more about score configuration syntax.", - "app.editAssignmentForm.name": "Assignment default name:", - "app.editAssignmentForm.newLocale": "New language", "app.editAssignmentForm.pointsPercentualThreshold": "Minimální procentuální správnost řešení, za kterou lze získat nějaké body:", - "app.editAssignmentForm.scoreConfig": "Score configuration:", "app.editAssignmentForm.secondDeadline": "Druhý termín odevzdání:", "app.editAssignmentForm.submissionsCountLimit": "Počet pokusů odevzdání:", "app.editAssignmentForm.submit": "Upravit nastavení", @@ -237,23 +216,6 @@ "app.editEnvironmentConfigVariables.stringArrayType": "Array of strings", "app.editEnvironmentConfigVariables.stringType": "Řetězec", "app.editEnvironmentConfigVariables.variables": "Proměnné:", - "app.editEnvironmentLimitsForm.box": "Box", - "app.editEnvironmentLimitsForm.environment.name": "Environment name:", - "app.editEnvironmentLimitsForm.environment.noEnvironment": "There is currently no environment specified for this assignment.", - "app.editEnvironmentLimitsForm.newEnvironment": "New environment", - "app.editEnvironmentLimitsForm.noBoxesForPipeline": "There are no boxes which need to set limits in this pipeline.", - "app.editEnvironmentLimitsForm.noPipelinesForTest": "There are no pipelines for this test to edit.", - "app.editEnvironmentLimitsForm.pipeline": "Pipeline", - "app.editEnvironmentLimitsForm.submit": "Save changes to {env}", - "app.editEnvironmentLimitsForm.submitting": "Saving changes ...", - "app.editEnvironmentLimitsForm.success": "Saved.", - "app.editEnvironmentLimitsForm.validating": "Validating...", - "app.editEnvironmentLimitsForm.validation.memory": "You must set the memory limit.", - "app.editEnvironmentLimitsForm.validation.memory.mustBePositive": "You must set the memory limit to a positive number.", - "app.editEnvironmentLimitsForm.validation.parallel": "You must set the limit for the number of parallel processes.", - "app.editEnvironmentLimitsForm.validation.parallel.mustBePositive": "You must set the limit for the number of parallel processes to a positive number.", - "app.editEnvironmentLimitsForm.validation.time": "You must set the time limit.", - "app.editEnvironmentLimitsForm.validation.time.mustBePositive": "You must set the time limit to a positive number.", "app.editEnvironmentSimpleForm.failed": "Uložení se nezdařilo. Prosíme opakujte akci později.", "app.editEnvironmentSimpleForm.reset": "Obnovit původní", "app.editEnvironmentSimpleForm.submit": "Uložit prostředí", @@ -278,12 +240,10 @@ "app.editExerciseConfigEnvironment.reallyRemoveQuestion": "Opravdu chcete smazat tuto konfiguraci prostředí?", "app.editExerciseConfigForm.addTest": "Přidat nový test", "app.editExerciseConfigForm.failed": "Uložení se nezdařilo. Prosíme opakujte akci později.", - "app.editExerciseConfigForm.fileType": "File", "app.editExerciseConfigForm.pipelines": "Pipeliny", "app.editExerciseConfigForm.removeLastTest": "Odstranit poslední test", "app.editExerciseConfigForm.smartFill": "Smart Fill", "app.editExerciseConfigForm.smartFill.yesNoQuestion": "Do you really wish to overwrite configuration of all subsequent tests using the first test as a template? Files will be paired to individual test configurations by a heuristics based on matching name substrings.", - "app.editExerciseConfigForm.stringType": "String", "app.editExerciseConfigForm.submit": "Změnit konfiguraci", "app.editExerciseConfigForm.submitting": "Ukládání konfigurace ...", "app.editExerciseConfigForm.success": "Konfigurace byla uložena.", @@ -291,7 +251,6 @@ "app.editExerciseConfigForm.validation.duplicatePipeline": "Please select a different pipeline.", "app.editExerciseConfigForm.validation.noEnvironments": "Please add at least one environment config for the exercise.", "app.editExerciseConfigForm.variables": "Proměnné", - "app.editExerciseForm.description": "Description for supervisors:", "app.editExerciseForm.difficulty": "Obtížnost", "app.editExerciseForm.easy": "Snadné", "app.editExerciseForm.failed": "Uložení se nezdařilo. Prosim, opakujte akci později.", @@ -299,7 +258,6 @@ "app.editExerciseForm.isLocked": "Úloha je zamčená (viditelná, ale není možné jí zadat v žádné skupině).", "app.editExerciseForm.isPublic": "Úloha je veřejná a může být použita cvičícími.", "app.editExerciseForm.medium": "Průměrné", - "app.editExerciseForm.name": "Exercise name:", "app.editExerciseForm.submit": "Upravit nastavení", "app.editExerciseForm.submitting": "Ukládání změn ...", "app.editExerciseForm.success": "Nastavení bylo uloženo.", @@ -320,24 +278,6 @@ "app.editExerciseLimits.multiHwGroups": "The exercise uses complex configuration of multiple hardware groups. Editting the limits using this form may simplify this configuration. Proceed at your own risk.", "app.editExerciseLimits.multiHwGroupsTitle": "Multiple hardware groups detected", "app.editExerciseLimits.title": "Změnit limity testů", - "app.editExerciseLimitsForm.failed": "Saving failed. Please try again later.", - "app.editExerciseLimitsForm.submit": "Change limits", - "app.editExerciseLimitsForm.submitting": "Saving limits ...", - "app.editExerciseLimitsForm.success": "Limits were saved.", - "app.editExerciseLimitsForm.validation.envName": "Please fill environment name.", - "app.editExerciseLimitsForm.validation.memoryIsNotNumer": "Memory limit must be an integer.", - "app.editExerciseLimitsForm.validation.memoryLimit": "Memory limit must be a positive integer.", - "app.editExerciseLimitsForm.validation.timeIsNotNumer": "Time limit must be a real number.", - "app.editExerciseLimitsForm.validation.timeLimit": "Time limit must be a positive real number.", - "app.editExerciseLimitsForm.validation.useDotDecimalSeparator": "Please use a dot as a decimal separator instead of the comma.", - "app.editExerciseRuntimeConfigsForm.failed": "Saving failed. Please try again later.", - "app.editExerciseRuntimeConfigsForm.submit": "Change runtime configurations", - "app.editExerciseRuntimeConfigsForm.submitting": "Saving runtime configurations ...", - "app.editExerciseRuntimeConfigsForm.success": "Runtime configurations were saved.", - "app.editExerciseRuntimeConfigsForm.validation.empty": "Please fill the runtime environment information.", - "app.editExerciseRuntimeConfigsForm.validation.jobConfig": "Please fill the job configuration of the runtime environment.", - "app.editExerciseRuntimeConfigsForm.validation.name": "Please fill the display name of the runtime environment.", - "app.editExerciseRuntimeConfigsForm.validation.runtimeEnvironmentId": "Please select a runtime environment.", "app.editExerciseSimpleConfig.noTests": "There are no tests yet. The form cannot be displayed until at least one test is created.", "app.editExerciseSimpleConfigForm.reset": "Obnovit původní", "app.editExerciseSimpleConfigForm.submit": "Uložit konfiguraci", @@ -378,7 +318,6 @@ "app.editGroupForm.set": "Upravit skupinu", "app.editGroupForm.success": "Nastavení skupiny bylo uloženo.", "app.editGroupForm.successNew": "Create group", - "app.editGroupForm.title": "Edit group", "app.editGroupForm.titleEdit": "Edit group", "app.editGroupForm.titleNew": "Create new group", "app.editGroupForm.validation.emptyName": "Please fill the name of the group.", @@ -386,9 +325,12 @@ "app.editGroupForm.validation.localizedText.locale": "Please select the language.", "app.editGroupForm.validation.localizedText.text": "Please fill the description in this language.", "app.editGroupForm.validation.sameLocalizedTexts": "There are more language variants with the same locale. Please make sure locales are unique.", - "app.editHardwareGroupForm.failed": "Cannot change the hardware group of the exercise.", - "app.editHardwareGroupForm.hwGroupSelect": "Hardware Group:", - "app.editHardwareGroupForm.title": "Select Hardware Group", + "app.editHardwareGroupForm.about": "Hardwarová skupina definuje workery vyhodnocovacího backendu, na kterých může být úloha vyhodnocena. Tato skupina workerů je svázána s konkrétním hardware a její změna může ovlivnit naměřené výkonostní hodnoty testovaných řešení. Hardwarová skupina také sdílí konfiguraci, ze které vyplývají omezení pro paměťové a časové limity.", + "app.editHardwareGroupForm.failed": "Nepodařilo se změnit hardwarovou skupinu úlohy.", + "app.editHardwareGroupForm.hwGroupSelect": "Hardwarová skupina:", + "app.editHardwareGroupForm.title": "Výběr hardwarové skupiny", + "app.editHardwareGroupForm.validationFailed": "Hardwarová skupina musí být vybrána.", + "app.editHardwareGroupForm.warnLimitsDrop": "Limity některých běhových prostředí neodpovídají omezením vybrané hardwarové skupiny. Tyto limity budou při změně skupiny odstraněny.", "app.editInstance.description": "Změnit nastavení instance", "app.editInstance.title": "Upravit instanci", "app.editInstanceForm.description": "Popis:", @@ -436,14 +378,6 @@ "app.editPipelineForm.validation.description": "Prosíme vyplňte popis této pipeliny.", "app.editPipelineForm.validation.emptyName": "Prosíme vyplňte název této pipeliny.", "app.editPipelineForm.validation.versionDiffers": "Někdo jiný změnit nastavení této pipeliny v průběhu vaší editace. Prosíme znovu načtěte tuto stránku a aplikujte své změny znovu.", - "app.editRuntimeConfigForm.addConfigTab": "Add new runtime configuration", - "app.editRuntimeConfigForm.configName": "Name of Configuration:", - "app.editRuntimeConfigForm.emptyConfigTabs": "There is currently no runtime configuration.", - "app.editRuntimeConfigForm.jobConfig": "Job Configuration:", - "app.editRuntimeConfigForm.moreAboutJobConfig": "Read more about job configuration syntax.", - "app.editRuntimeConfigForm.newConfig": "New configuration", - "app.editRuntimeConfigForm.reallyRemoveQuestion": "Do you really want to delete this runtime configuration?", - "app.editRuntimeConfigForm.runtimeEnvironment": "Select runtime environment:", "app.editScoreConfigForm.failed": "Saving failed. Please try again later.", "app.editScoreConfigForm.scoreConfig": "Score configuration:", "app.editScoreConfigForm.submit": "Change configuration", @@ -491,8 +425,6 @@ "app.editUserProfile.validation.emptyFirstName": "Jméno nemůže být prázdné.", "app.editUserProfile.validation.emptyLastName": "Příjmení nemůže být prázdné.", "app.editUserProfile.validation.emptyNewPassword": "Nové heslo nemůže být prázdné pokud si měníte heslo.", - "app.editUserProfile.validation.emptyOldPassword": "Old password cannot be empty if you want to change your password.", - "app.editUserProfile.validation.passwordTooWeak": "The password you chose is too weak, please choose a different one.", "app.editUserProfile.validation.passwordsDontMatch": "Hesla se neshodují.", "app.editUserProfile.validation.samePasswords": "Změnit Vaše heslo na stejné nedává žádný smysl.", "app.editUserProfile.validation.shortFirstName": "First name must contain at least 2 characters.", @@ -738,10 +670,6 @@ "app.filesTable.title": "Attached files", "app.footer.copyright": "Copyright © 2016-2018 ReCodEx. Všechna práva vyhrazena.", "app.footer.version": "Verze {version}", - "app.forkExerciseButton.confirmation": "Do you really want to fork this exercise?", - "app.forkExerciseButton.failed": "Try forking the exercise again", - "app.forkExerciseButton.fork": "Fork the exercise", - "app.forkExerciseButton.loading": "Forking ...", "app.forkExerciseButton.success": "Show the forked exercise", "app.forkExerciseForm.failed": "Saving failed. Please try again later.", "app.forkExerciseForm.submit": "Fork exercise", @@ -785,10 +713,6 @@ "app.groups.removeGroupAdminButton": "Remove group admin", "app.groups.removeSupervisorButton": "Odebrat cvičícího", "app.groupsName.loading": "Načítání ...", - "app.hardwareGroupFields.memoryLimit": "Memory limit for \"{taskId}\":", - "app.hardwareGroupFields.noReferenceSolutions": "There are no reference solutions' evaluations' for test '{testName}' and its task '{taskId}'.", - "app.hardwareGroupFields.test": "Test:", - "app.hardwareGroupFields.timeLimit": "Time limit for \"{taskId}\":", "app.hardwareGroupMetadata.cpuTimeOverlay": "Precise (CPU) time limit constraints", "app.hardwareGroupMetadata.description": "Internal Description:", "app.hardwareGroupMetadata.id": "Internal Identifier:", @@ -940,12 +864,6 @@ "app.pipelineEditor.BoxForm.success": "Saved", "app.pipelineEditor.BoxForm.type": "Type:", "app.pipelineEditor.EditBoxForm.title": "Edit the box '{name}'", - "app.pipelineEditor.addBoxForm.add": "Add", - "app.pipelineEditor.addBoxForm.emptyName": "Name cannot be empty.", - "app.pipelineEditor.addBoxForm.name": "Box name", - "app.pipelineEditor.addBoxForm.portsIn": "Inputs", - "app.pipelineEditor.addBoxForm.portsOut": "Outputs", - "app.pipelineEditor.addBoxForm.title": "Add a box", "app.pipelineFilesTable.description": "Supplementary files are files which can be referenced as remote file in pipeline configuration.", "app.pipelineFilesTable.title": "Supplementary files", "app.pipelineVisualEditor.addBoxButton": "Add box", @@ -1014,12 +932,6 @@ "app.referenceSolutionDetail.title.details": "Detail referenčního řešení", "app.referenceSolutionDetail.uploadedAt": "Nahráno:", "app.referenceSolutionEvaluation.title": "Evaluations of reference solution", - "app.referenceSolutionEvaluation.titlePrefix": "Evaluations for runtime:", - "app.referenceSolutionsEvaluations.description": "Description", - "app.referenceSolutionsEvaluations.evaluatedAt": "Evaluated on", - "app.referenceSolutionsEvaluations.memory": "Memory", - "app.referenceSolutionsEvaluations.time": "Time", - "app.referenceSolutionsEvaluations.title": "Reference solutions' evaluations", "app.registration.description": "Začněte dnes používat ReCodEx", "app.registration.title": "Vytvořte si nový účet v ReCodExu", "app.registrationForm.createAccount": "Vytvořit účet", @@ -1040,7 +952,6 @@ "app.registrationForm.validation.emptyLastName": "Příjmení nemůže být prázdné.", "app.registrationForm.validation.emptyPassword": "Heslo nemůže být prázdné.", "app.registrationForm.validation.passwordDontMatch": "Passwords don't match.", - "app.registrationForm.validation.passwordTooWeak": "The password you chose is too weak, please choose a different one.", "app.registrationForm.validation.shortFirstName": "First name must contain at least 2 characters.", "app.registrationForm.validation.shortLastName": "Last name must contain at least 2 characters.", "app.removeFromGroup.confirm": "Are you sure you want to remove the user from this group?", diff --git a/src/locales/en.json b/src/locales/en.json index bafb9cf86..da2347b51 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -138,22 +138,12 @@ "app.confirm.no": "No", "app.confirm.yes": "Yes", "app.createGroup.externalId": "External ID of the group (e. g. ID of the group in the school IS):", - "app.createGroup.groupDescription": "Description:", - "app.createGroup.groupName": "Name:", "app.createGroup.hasThreshold": "Students require cetrain number of points to complete the course", "app.createGroup.isPublic": "Public (everyone can see and join this group)", "app.createGroup.publicStats": "Students can see statistics of each other", "app.createGroup.threshold": "Minimum percent of the total points count needed to complete the course:", - "app.createGroup.validation.emptyDescription": "Group description cannot be empty.", - "app.createGroup.validation.emptyName": "Group name cannot be empty.", - "app.createGroup.validation.nameCollision": "The name \"{name}\" is already used, please choose a different one.", "app.createGroup.validation.thresholdBetweenZeroHundred": "Threshold must be an integer in between 0 and 100.", "app.createGroup.validation.thresholdMustBeInteger": "Threshold must be an integer.", - "app.createGroupForm.createGroup": "Create new group", - "app.createGroupForm.failed": "We are sorry but we weren't able to create a new group.", - "app.createGroupForm.processing": "Group is being created ...", - "app.createGroupForm.success": "Group has been created", - "app.createGroupForm.title": "Create new group", "app.createGroupForm.validation.noLocalizedText": "Please add at least one localized text describing the group.", "app.dashboard.sisGroupsStudent": "SIS Courses - Student", "app.dashboard.sisGroupsStudentExplain": "SIS courses you are enrolled to in particular semesters and which have correspondig groups in ReCodEx.", @@ -162,14 +152,10 @@ "app.dashboard.studentOf": "Groups you are student of", "app.dashboard.supervisorOf": "Groups you supervise", "app.deleteButton.confirm": "Are you sure you want to delete the resource? This cannot be undone.", - "app.deleteButton.delete": "Delete", - "app.deleteButton.deleted": "Deleted.", - "app.deleteButton.deleting": "Deleting failed", "app.editAssignment.deleteAssignment": "Delete the assignment", "app.editAssignment.deleteAssignmentWarning": "Deleting an assignment will remove all the students submissions and you will have to contact the administrator of ReCodEx if you wanted to restore the assignment in the future.", "app.editAssignment.description": "Change assignment settings and limits", "app.editAssignment.title": "Edit assignment settings", - "app.editAssignmentForm.addLanguage": "Add language variant", "app.editAssignmentForm.allowSecondDeadline": "Allow second deadline.", "app.editAssignmentForm.canViewLimitRatios": "Visibility of memory and time ratios", "app.editAssignmentForm.chooseFirstDeadlineBeforeSecondDeadline": "You must select the date of the first deadline before selecting the date of the second deadline.", @@ -181,16 +167,9 @@ "app.editAssignmentForm.localized.assignment": "Description for the students:", "app.editAssignmentForm.localized.locale": "The language:", "app.editAssignmentForm.localized.name": "Name:", - "app.editAssignmentForm.localized.noLanguage": "There is currently no text in any language for this assignment.", - "app.editAssignmentForm.localized.reallyRemoveQuestion": "Do you really want to delete the assignmenet in this language?", - "app.editAssignmentForm.localized.remove": "Remove this language", "app.editAssignmentForm.maxPointsBeforeFirstDeadline": "Maximum amount of points received when submitted before the deadline:", "app.editAssignmentForm.maxPointsBeforeSecondDeadline": "Maximum amount of points received when submitted before the second deadline:", - "app.editAssignmentForm.moreAboutScoreConfig": "Read more about score configuration syntax.", - "app.editAssignmentForm.name": "Assignment default name:", - "app.editAssignmentForm.newLocale": "New language", "app.editAssignmentForm.pointsPercentualThreshold": "Minimum percentage of points which submissions have to gain:", - "app.editAssignmentForm.scoreConfig": "Score configuration:", "app.editAssignmentForm.secondDeadline": "Second deadline:", "app.editAssignmentForm.submissionsCountLimit": "Submissions count limit:", "app.editAssignmentForm.submit": "Edit settings", @@ -237,23 +216,6 @@ "app.editEnvironmentConfigVariables.stringArrayType": "Array of strings", "app.editEnvironmentConfigVariables.stringType": "String", "app.editEnvironmentConfigVariables.variables": "Variables:", - "app.editEnvironmentLimitsForm.box": "Box", - "app.editEnvironmentLimitsForm.environment.name": "Environment name:", - "app.editEnvironmentLimitsForm.environment.noEnvironment": "There is currently no environment specified for this assignment.", - "app.editEnvironmentLimitsForm.newEnvironment": "New environment", - "app.editEnvironmentLimitsForm.noBoxesForPipeline": "There are no boxes which need to set limits in this pipeline.", - "app.editEnvironmentLimitsForm.noPipelinesForTest": "There are no pipelines for this test to edit.", - "app.editEnvironmentLimitsForm.pipeline": "Pipeline", - "app.editEnvironmentLimitsForm.submit": "Save changes to {env}", - "app.editEnvironmentLimitsForm.submitting": "Saving changes ...", - "app.editEnvironmentLimitsForm.success": "Saved.", - "app.editEnvironmentLimitsForm.validating": "Validating...", - "app.editEnvironmentLimitsForm.validation.memory": "You must set the memory limit.", - "app.editEnvironmentLimitsForm.validation.memory.mustBePositive": "You must set the memory limit to a positive number.", - "app.editEnvironmentLimitsForm.validation.parallel": "You must set the limit for the number of parallel processes.", - "app.editEnvironmentLimitsForm.validation.parallel.mustBePositive": "You must set the limit for the number of parallel processes to a positive number.", - "app.editEnvironmentLimitsForm.validation.time": "You must set the time limit.", - "app.editEnvironmentLimitsForm.validation.time.mustBePositive": "You must set the time limit to a positive number.", "app.editEnvironmentSimpleForm.failed": "Saving failed. Please try again later.", "app.editEnvironmentSimpleForm.reset": "Reset", "app.editEnvironmentSimpleForm.submit": "Save Environments", @@ -278,12 +240,10 @@ "app.editExerciseConfigEnvironment.reallyRemoveQuestion": "Do you really want to delete this runtime configuration?", "app.editExerciseConfigForm.addTest": "Add new test", "app.editExerciseConfigForm.failed": "Saving failed. Please try again later.", - "app.editExerciseConfigForm.fileType": "File", "app.editExerciseConfigForm.pipelines": "Pipelines", "app.editExerciseConfigForm.removeLastTest": "Remove last test", "app.editExerciseConfigForm.smartFill": "Smart Fill", "app.editExerciseConfigForm.smartFill.yesNoQuestion": "Do you really wish to overwrite configuration of all subsequent tests using the first test as a template? Files will be paired to individual test configurations by a heuristics based on matching name substrings.", - "app.editExerciseConfigForm.stringType": "String", "app.editExerciseConfigForm.submit": "Change configuration", "app.editExerciseConfigForm.submitting": "Saving configuration ...", "app.editExerciseConfigForm.success": "Configuration was changed.", @@ -291,7 +251,6 @@ "app.editExerciseConfigForm.validation.duplicatePipeline": "Please select a different pipeline.", "app.editExerciseConfigForm.validation.noEnvironments": "Please add at least one environment config for the exercise.", "app.editExerciseConfigForm.variables": "Variables", - "app.editExerciseForm.description": "Description for supervisors:", "app.editExerciseForm.difficulty": "Difficulty", "app.editExerciseForm.easy": "Easy", "app.editExerciseForm.failed": "Saving failed. Please try again later.", @@ -299,7 +258,6 @@ "app.editExerciseForm.isLocked": "Exercise is locked (visible, but cannot be assigned to any group).", "app.editExerciseForm.isPublic": "Exercise is public and can be assigned to students by their supervisors.", "app.editExerciseForm.medium": "Medium", - "app.editExerciseForm.name": "Exercise name:", "app.editExerciseForm.submit": "Edit settings", "app.editExerciseForm.submitting": "Saving changes ...", "app.editExerciseForm.success": "Settings were saved.", @@ -320,24 +278,6 @@ "app.editExerciseLimits.multiHwGroups": "The exercise uses complex configuration of multiple hardware groups. Editting the limits using this form may simplify this configuration. Proceed at your own risk.", "app.editExerciseLimits.multiHwGroupsTitle": "Multiple hardware groups detected", "app.editExerciseLimits.title": "Edit tests limits", - "app.editExerciseLimitsForm.failed": "Saving failed. Please try again later.", - "app.editExerciseLimitsForm.submit": "Change limits", - "app.editExerciseLimitsForm.submitting": "Saving limits ...", - "app.editExerciseLimitsForm.success": "Limits were saved.", - "app.editExerciseLimitsForm.validation.envName": "Please fill environment name.", - "app.editExerciseLimitsForm.validation.memoryIsNotNumer": "Memory limit must be an integer.", - "app.editExerciseLimitsForm.validation.memoryLimit": "Memory limit must be a positive integer.", - "app.editExerciseLimitsForm.validation.timeIsNotNumer": "Time limit must be a real number.", - "app.editExerciseLimitsForm.validation.timeLimit": "Time limit must be a positive real number.", - "app.editExerciseLimitsForm.validation.useDotDecimalSeparator": "Please use a dot as a decimal separator instead of the comma.", - "app.editExerciseRuntimeConfigsForm.failed": "Saving failed. Please try again later.", - "app.editExerciseRuntimeConfigsForm.submit": "Change runtime configurations", - "app.editExerciseRuntimeConfigsForm.submitting": "Saving runtime configurations ...", - "app.editExerciseRuntimeConfigsForm.success": "Runtime configurations were saved.", - "app.editExerciseRuntimeConfigsForm.validation.empty": "Please fill the runtime environment information.", - "app.editExerciseRuntimeConfigsForm.validation.jobConfig": "Please fill the job configuration of the runtime environment.", - "app.editExerciseRuntimeConfigsForm.validation.name": "Please fill the display name of the runtime environment.", - "app.editExerciseRuntimeConfigsForm.validation.runtimeEnvironmentId": "Please select a runtime environment.", "app.editExerciseSimpleConfig.noTests": "There are no tests yet. The form cannot be displayed until at least one test is created.", "app.editExerciseSimpleConfigForm.reset": "Reset", "app.editExerciseSimpleConfigForm.submit": "Save Configuration", @@ -378,7 +318,6 @@ "app.editGroupForm.set": "Edit group", "app.editGroupForm.success": "Group settings was saved.", "app.editGroupForm.successNew": "Create group", - "app.editGroupForm.title": "Edit group", "app.editGroupForm.titleEdit": "Edit group", "app.editGroupForm.titleNew": "Create new group", "app.editGroupForm.validation.emptyName": "Please fill the name of the group.", @@ -386,9 +325,12 @@ "app.editGroupForm.validation.localizedText.locale": "Please select the language.", "app.editGroupForm.validation.localizedText.text": "Please fill the description in this language.", "app.editGroupForm.validation.sameLocalizedTexts": "There are more language variants with the same locale. Please make sure locales are unique.", + "app.editHardwareGroupForm.about": "Hardware group is a group of backend workers on which the exercise can be evaluated. The workers are bound to explicit hardware; thus, changing the hardware group of an exercise may affect the performance results. Furthermore, the workers in the group share configuration which implies the constraints for memory and time limits.", "app.editHardwareGroupForm.failed": "Cannot change the hardware group of the exercise.", "app.editHardwareGroupForm.hwGroupSelect": "Hardware Group:", "app.editHardwareGroupForm.title": "Select Hardware Group", + "app.editHardwareGroupForm.validationFailed": "Hardware group must be selected.", + "app.editHardwareGroupForm.warnLimitsDrop": "Limits of some environments do not meet the constraints of the selected hardware group. These limits will be removed when the hardware group is changed.", "app.editInstance.description": "Change instance settings", "app.editInstance.title": "Edit instance", "app.editInstanceForm.description": "Description:", @@ -436,14 +378,6 @@ "app.editPipelineForm.validation.description": "Please fill the description of the pipeline.", "app.editPipelineForm.validation.emptyName": "Please fill the name of the pipeline.", "app.editPipelineForm.validation.versionDiffers": "Somebody has changed the pipeline while you have been editing it. Please reload the page and apply your changes once more.", - "app.editRuntimeConfigForm.addConfigTab": "Add new runtime configuration", - "app.editRuntimeConfigForm.configName": "Name of Configuration:", - "app.editRuntimeConfigForm.emptyConfigTabs": "There is currently no runtime configuration.", - "app.editRuntimeConfigForm.jobConfig": "Job Configuration:", - "app.editRuntimeConfigForm.moreAboutJobConfig": "Read more about job configuration syntax.", - "app.editRuntimeConfigForm.newConfig": "New configuration", - "app.editRuntimeConfigForm.reallyRemoveQuestion": "Do you really want to delete this runtime configuration?", - "app.editRuntimeConfigForm.runtimeEnvironment": "Select runtime environment:", "app.editScoreConfigForm.failed": "Saving failed. Please try again later.", "app.editScoreConfigForm.scoreConfig": "Score configuration:", "app.editScoreConfigForm.submit": "Change configuration", @@ -491,8 +425,6 @@ "app.editUserProfile.validation.emptyFirstName": "First name cannot be empty.", "app.editUserProfile.validation.emptyLastName": "Last name cannot be empty.", "app.editUserProfile.validation.emptyNewPassword": "New password cannot be empty if you want to change your password.", - "app.editUserProfile.validation.emptyOldPassword": "Old password cannot be empty if you want to change your password.", - "app.editUserProfile.validation.passwordTooWeak": "The password you chose is too weak, please choose a different one.", "app.editUserProfile.validation.passwordsDontMatch": "Passwords don't match.", "app.editUserProfile.validation.samePasswords": "Changing your password to the same password does not make any sense.", "app.editUserProfile.validation.shortFirstName": "First name must contain at least 2 characters.", @@ -738,10 +670,6 @@ "app.filesTable.title": "Attached files", "app.footer.copyright": "Copyright © 2016-2018 ReCodEx. All rights reserved.", "app.footer.version": "Version {version}", - "app.forkExerciseButton.confirmation": "Do you really want to fork this exercise?", - "app.forkExerciseButton.failed": "Try forking the exercise again", - "app.forkExerciseButton.fork": "Fork the exercise", - "app.forkExerciseButton.loading": "Forking ...", "app.forkExerciseButton.success": "Show the forked exercise", "app.forkExerciseForm.failed": "Saving failed. Please try again later.", "app.forkExerciseForm.submit": "Fork exercise", @@ -785,10 +713,6 @@ "app.groups.removeGroupAdminButton": "Remove group admin", "app.groups.removeSupervisorButton": "Remove supervisor", "app.groupsName.loading": "Loading ...", - "app.hardwareGroupFields.memoryLimit": "Memory limit for \"{taskId}\":", - "app.hardwareGroupFields.noReferenceSolutions": "There are no reference solutions' evaluations' for test '{testName}' and its task '{taskId}'.", - "app.hardwareGroupFields.test": "Test:", - "app.hardwareGroupFields.timeLimit": "Time limit for \"{taskId}\":", "app.hardwareGroupMetadata.cpuTimeOverlay": "Precise (CPU) time limit constraints", "app.hardwareGroupMetadata.description": "Internal Description:", "app.hardwareGroupMetadata.id": "Internal Identifier:", @@ -940,12 +864,6 @@ "app.pipelineEditor.BoxForm.success": "Saved", "app.pipelineEditor.BoxForm.type": "Type:", "app.pipelineEditor.EditBoxForm.title": "Edit the box '{name}'", - "app.pipelineEditor.addBoxForm.add": "Add", - "app.pipelineEditor.addBoxForm.emptyName": "Name cannot be empty.", - "app.pipelineEditor.addBoxForm.name": "Box name", - "app.pipelineEditor.addBoxForm.portsIn": "Inputs", - "app.pipelineEditor.addBoxForm.portsOut": "Outputs", - "app.pipelineEditor.addBoxForm.title": "Add a box", "app.pipelineFilesTable.description": "Supplementary files are files which can be referenced as remote file in pipeline configuration.", "app.pipelineFilesTable.title": "Supplementary files", "app.pipelineVisualEditor.addBoxButton": "Add box", @@ -1014,12 +932,6 @@ "app.referenceSolutionDetail.title.details": "Reference solution detail", "app.referenceSolutionDetail.uploadedAt": "Uploaded at:", "app.referenceSolutionEvaluation.title": "Evaluations of reference solution", - "app.referenceSolutionEvaluation.titlePrefix": "Evaluations for runtime:", - "app.referenceSolutionsEvaluations.description": "Description", - "app.referenceSolutionsEvaluations.evaluatedAt": "Evaluated on", - "app.referenceSolutionsEvaluations.memory": "Memory", - "app.referenceSolutionsEvaluations.time": "Time", - "app.referenceSolutionsEvaluations.title": "Reference solutions' evaluations", "app.registration.description": "Start using ReCodEx today", "app.registration.title": "Create a new ReCodEx account", "app.registrationForm.createAccount": "Create account", @@ -1040,7 +952,6 @@ "app.registrationForm.validation.emptyLastName": "Last name cannot be empty.", "app.registrationForm.validation.emptyPassword": "Password cannot be empty.", "app.registrationForm.validation.passwordDontMatch": "Passwords don't match.", - "app.registrationForm.validation.passwordTooWeak": "The password you chose is too weak, please choose a different one.", "app.registrationForm.validation.shortFirstName": "First name must contain at least 2 characters.", "app.registrationForm.validation.shortLastName": "Last name must contain at least 2 characters.", "app.removeFromGroup.confirm": "Are you sure you want to remove the user from this group?", diff --git a/src/pages/EditExerciseLimits/EditExerciseLimits.js b/src/pages/EditExerciseLimits/EditExerciseLimits.js index b3160fe13..394a1cf71 100644 --- a/src/pages/EditExerciseLimits/EditExerciseLimits.js +++ b/src/pages/EditExerciseLimits/EditExerciseLimits.js @@ -79,6 +79,83 @@ class EditExerciseLimits extends Component { dispatch(fetchExerciseTestsIfNeeded(exerciseId)) ]); + doesHardwareGroupChangeDropLimits = defaultMemoize( + ( + exerciseId, + currentHwGroupId, + limits, + tests, + exerciseRuntimeEnvironments, + hardwareGroups + ) => { + const limitsData = + currentHwGroupId && + getLimitsInitValues( + limits, + tests, + exerciseRuntimeEnvironments, + exerciseId, + currentHwGroupId + ); + + return targetHwGroupId => { + if (!targetHwGroupId || targetHwGroupId === currentHwGroupId) { + return false; + } + const constraints = getLimitsConstraints( + hardwareGroups.filter(h => h.id === targetHwGroupId), + limitsData.preciseTime + ); + + return !transformLimitsValues( + limitsData, + tests, + exerciseRuntimeEnvironments + ).reduce( + (acc, { id: envId, data }) => + acc && + validateLimitsSingleEnvironment(limitsData, envId, constraints), + true + ); + }; + /* + setExerciseHardwareGroups( + formData.hardwareGroup ? [formData.hardwareGroup] : [] + ).then( + ({ value: exercise }) => + limitsData + ? Promise.all( + exercise.hardwareGroups.map(({ id: hwgId }, idx) => { + const constraints = getLimitsConstraints( + exercise.hardwareGroups, + limitsData.preciseTime + ); + return Promise.all( + transformLimitsValues( + limitsData, + tests, + exerciseRuntimeEnvironments + ).map( + ({ id: envId, data }) => + validateLimitsSingleEnvironment( + limitsData, + envId, + constraints + ) + ? editEnvironmentLimits(hwgId, envId, data) + : idx === 0 + ? fetchExerciseEnvironmentLimit(envId, hwgId) + : Promise.resolve() + ) + ); + }) + ) + : Promise.resolve() + ); + */ + } + ); + transformAndSendHardwareGroups = defaultMemoize( (exerciseId, hwGroupId, limits, tests, exerciseRuntimeEnvironments) => { const { @@ -274,6 +351,15 @@ class EditExerciseLimits extends Component { !exercise.hardwareGroups || exercise.hardwareGroups.length !== 1 } + warnDropLimits={this.doesHardwareGroupChangeDropLimits( + exercise.id, + exercise.hardwareGroups && + exercise.hardwareGroups[0].id, + limits, + tests, + exercise.runtimeEnvironments, + hwgs + )} onSubmit={this.transformAndSendHardwareGroups( exercise.id, exercise.hardwareGroups &&