Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0b0517c
#185 Solved: Max. / Min. Text for slider questions is not validated
Apr 16, 2026
58b0261
Bumped Version to 3.4.0
ywarnecke Apr 17, 2026
046d020
correction of .env and messages.properties
aluapaula Apr 17, 2026
566dec3
Merge branch 'main' into 185-max-min-text-for-slider-questions-is-not…
ywarnecke Apr 17, 2026
b30c29a
Merge branch 'v3.4.0' into 185-max-min-text-for-slider-questions-is-n…
ywarnecke Apr 17, 2026
3c16807
unit-test for minmaxText, correction of messages.properties & related…
aluapaula Apr 17, 2026
c546058
Merge branch '185-max-min-text-for-slider-questions-is-not-validated'…
aluapaula Apr 17, 2026
7c2dd30
Merge remote-tracking branch 'origin/185-max-min-text-for-slider-ques…
aluapaula Apr 17, 2026
9bfe12c
"Missing property in messages_en_GB.properties"
aluapaula Apr 23, 2026
991d8f9
unified messages.properties to fix errors
aluapaula Apr 23, 2026
fc3897d
Merge pull request #296 from imi-ms/185-max-min-text-for-slider-quest…
ywarnecke Apr 23, 2026
0e56eb6
Added demo flag to properties
ywarnecke May 27, 2026
6d3ac2f
Added demo flag to root controller
ywarnecke May 27, 2026
9f025c2
Added disabled class
ywarnecke May 27, 2026
a25cafd
Added demo messages
ywarnecke May 27, 2026
697d6df
Made login page pre-populated with demo flag
ywarnecke May 27, 2026
9d4c7c2
Made configuration page empty with demo flag
ywarnecke May 27, 2026
0297d17
Hide password inputs with demo flag
ywarnecke May 27, 2026
2487d59
Hide configuration page from navigation with demo flag
ywarnecke May 27, 2026
16783c5
Added simple tests to check if flag works on login page
ywarnecke May 28, 2026
3bf877a
Merge pull request #313 from imi-ms/312-add-flag-to-add-demo-instance…
ywarnecke May 29, 2026
bb7a2e8
Merge branch 'main' into v3.4.0
ywarnecke Aug 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>de.imi</groupId>
<artifactId>MoPat</artifactId>
<version>3.3.7</version>
<version>3.4.0</version>
<packaging>war</packaging>
<name>MoPat</name>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public String showAdmin(final Model model) {
model.addAttribute("gitRepositoryMetadata", gitRepositoryMetadataHandler.getGitRepositoryMetadata());
return "admin/index";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public class QuestionnaireController {
@PreAuthorize("hasRole('ROLE_EDITOR')")
public String listQuestionnaires(final Model model) {
List<Questionnaire> allQuestionnaires = questionnaireDao.getAllElements();
// This map contians a questionnaire id as key and a set with all
// This map contains a questionnaire id as key and a set with all
// languages
// which are available for all questions in this questionnaire.
Map<Long, List<String>> availableLanguagesInQuestionForQuestionnaires = new HashMap<>();
Expand Down
45 changes: 44 additions & 1 deletion src/main/java/de/imi/mopat/controller/RootController.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.InitBinder;
Expand Down Expand Up @@ -36,7 +37,11 @@ public class RootController {

@Autowired
private ServletContext context;


@Value("${de.imi.mopat.isDemoInstance:false}")
private boolean isDemoInstance;


/**
* Globally set Form limit to more than 256
* @param binder
Expand Down Expand Up @@ -126,33 +131,71 @@ public LocaleHelper localeHelper() {
return localeHelper;
}

/**
* Adds context path for request to frontend
* @param request to process
* @return context path
*/
@ModelAttribute("contextPath")
public String getRequestContextPath(HttpServletRequest request) {
return request.getContextPath();
}

/**
* Adds query string for request to frontend
* @param request to process
* @return query string for request
*/
@ModelAttribute("queryString")
public String getQueryString(HttpServletRequest request) {
return request.getQueryString();
}

/**
* Adds request URL to frontend
* @param request to add url for
* @return URL for request
*/
@ModelAttribute("requestURL")
public String getRequestURL(HttpServletRequest request) {
return request.getRequestURL().toString();
}

/**
* Adds the real path for the application to frontend
* @return real path
*/
@ModelAttribute("realPath")
public String getRealPath() {
return this.context.getRealPath("");
}

/**
* Adds requestURI to frontend
* @param request to process
* @return URI for request
*/
@ModelAttribute("requestURI")
public String getRequestURI(HttpServletRequest request) {
return request.getRequestURI();
}

/**
* Adds servlet path to frontend
* @param request to process this for
* @return servlet path
*/
@ModelAttribute("servletPath")
public String getServletPath(HttpServletRequest request) {
return request.getServletPath();
}

/**
* Adds a flag for the demo instance of MoPat
* @return true if instance should run in demo mode
*/
@ModelAttribute("isDemoInstance")
public boolean isDemoInstance() {
return isDemoInstance;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Map;

import de.imi.mopat.model.dto.export.SliderIconDTO;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -114,6 +115,31 @@ public void validate(final Object target, final Errors errors) {
errors.popNestedPath();
}
}

//for each entry in localizedMinimumText check if size of entry is bigger than 255 char
Map<String, String> localizedMinimumText = sliderAnswer.getLocalizedMinimumText();
if (localizedMinimumText != null){
for (Map.Entry<String, String> entry : localizedMinimumText.entrySet()){
if (entry.getValue() != null && entry.getValue().length() > 255){
errors.rejectValue("localizedMinimumText['" + entry.getKey() + "']",
MoPatValidator.ERRORCODE_ERRORMESSAGE,
messageSource.getMessage("sliderAnswer.validator.localizedMinMaxText",
new Object[]{}, LocaleContextHolder.getLocale()));
}
}
}

Map <String, String> localizedMaximumText = sliderAnswer.getLocalizedMaximumText();
if (localizedMaximumText != null) {
for (Map.Entry<String, String> entry : localizedMaximumText.entrySet()) {
if (entry.getValue() != null && entry.getValue().length() > 255) {
errors.rejectValue("localizedMaximumText['" + entry.getKey() + "']",
MoPatValidator.ERRORCODE_ERRORMESSAGE,
messageSource.getMessage("sliderAnswer.validator.localizedMinMaxText",
new Object[]{}, LocaleContextHolder.getLocale()));
}
}
}
} catch (NumberFormatException ex) {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
Expand Down Expand Up @@ -94,6 +95,7 @@ public void validate(final Object target, final Errors errors) {
}
}
}

} catch (NumberFormatException ex) {
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/less/mobile/survey.less
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ select.btn-lowEmphasis {
}
}

&:disabled {
&:disabled, &.disabled {
background-color: @color-gray-lighter-darker !important;
color: @color-gray !important;
box-shadow: none !important;
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/message/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ helpMode.label.question.dropDown=This question allows choosing an answer from a
helpMode.label.question.freeText=This question allows entering a text. Please click/tap the field and write your answer in the field.
helpMode.label.question.image=This is an image question. Please mark the specific position with a click/tap on the image.
helpMode.label.question.multipleChoice=This question allows choosing one or several answers from a given set of answers. If it is possible to choose more than one answer you will find a hint above the answers.
helpMode.label.question.numberCheckbox=This question allows choosing anumber from a given set of numbers. Please click/tap on the desired number to select it.
helpMode.label.question.numberCheckbox=This question allows choosing a number from a given set of numbers. Please click/tap on the desired number to select it.
helpMode.label.question.numberCheckboxText=This question allows choosing a number from a given set of numbers and an additional text. Please click/tap on the desired number to select it and write your answer in the field below.
helpMode.label.question.numberInput=This question allows entering a number. If there are any restrictions concerning the number you will find a hint above the answer field.
helpMode.label.question.slider=This question allows entering a number on a so-called slider. Please click/tap and hold the handle to move it to the desired position. To delete your answer click/tap on the handle.
Expand Down Expand Up @@ -899,6 +899,7 @@ sliderAnswer.validator.stepsizeBiggerThanDifferenceMaxMin=The answer's step size
sliderAnswer.validator.stepsizeLowerEqualZero=The answer's step size was <= 0
sliderAnswer.validator.stepsizeWrongPattern=The answer's step size does not match the required pattern.
sliderAnswer.validator.tooManySteps=There are more than 200 steps available. Alternatively you can also use the question type number input.
sliderAnswer.validator.localizedMinMaxText=The text is longer than 255 characters
sliderIcon.validator.missingIconValue=An icon for every field has to be selected, if the feature is enabled.
sliderIcon.validator.missingPosition=The icon's position is required.
sliderIcon.validator.positionAlreadyInUse=The icon's position of one ore more icons is identical. Please select different values.
Expand Down Expand Up @@ -1146,6 +1147,7 @@ user.type.local=Local
value=Value
valueOf=Value of question
valueOfScore=Value of score
login.demo.infoText=Welcome to MoPat Demo! This is a test installation with unrestricted access to the application. You can try out all the functions of MoPat here. If you need help, you can consult our <a href='https://github.com/imi-ms/MoPat/wiki/MoPat-Admin-instructions'>manual</a>, which contains detailed information on all functions. <br/><b>Please note:</b> The data is reset regularly. Questionnaires and surveys you have created will be deleted and there is no way to restore them. Use this system for testing only. If you require further information, please contact us: <a href="mailto:mopat@uni-muenster.de">mopat@uni-muenster.de</a>
questionnaire.download.mopatComplete=MoPat with Export Templates
configuration.label.exportFHIRViaHL7v2=Send FHIR export via HL7 communication server.
configuration.label.FHIRViaHL7v2Host=Send FHIR export via HL7 communication server.
Expand Down
Loading
Loading