Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/vspc 271 - Exhibition Configuration: if not exhibition language should be required #348

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

pooja-thalur
Copy link
Member

@pooja-thalur pooja-thalur commented Jun 20, 2024

Guidelines for Pull Requests

If you haven't yet read our code review guidelines, please do so, You can find them here.

Please confirm the following by adding an x for each item (turn [ ] into [x]).

  • I have removed all code style changes that are not necessary (e.g. changing blanks across the whole file that don’t need to be changed, adding empty lines in parts other than your own code)
  • I am not making any changes to files that don’t have any effect (e.g. imports added that don’t need to be added)
  • I do not have any sysout statements in my code or commented out code that isn’t needed anymore
  • I am not reformatting any files in the wrong format or without cause.
  • I am not changing file encoding or line endings to something else than UTF-8, LF
  • My pull request does not show an insane amount of files being changed although my ticket only requires a few files being changed
  • I have added Javadoc/documentation where appropriate
  • I have added test cases where appropriate
  • I have explained any part of my code/implementation decisions that is not be self-explanatory

Please provide a brief description of your ticket

(you can copy the ticket if it hasn't changed)
Exhibition Configuration: if not exhibition language should be required

...Put description here...
The user should select at least one exhibition language from the list (right now there is a tomcat error). There should also be a field help “To select multiple languages, hold down the shift key when selecting.”

Anything else the reviewer needs to know?

... describe here ...

@diging-jenkins
Copy link

Can one of the admins verify this patch?

@jdamerow
Copy link
Member

There should also be server-side validation.

@jdamerow jdamerow closed this Jun 21, 2024
@pooja-thalur pooja-thalur reopened this Jun 25, 2024
@@ -99,6 +99,13 @@ public RedirectView createOrUpdateExhibition(HttpServletRequest request,
exhibition.setStartSpace(startSpace);
exhibition.setTitle(title);
exhibition.setMode(exhibitMode);

if(languages.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you can simply make the RequestParam exhibitLanguage required instead. Have you tried that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I checked that - the RequestParam exhibitLanguage is required by default and it was giving the server error.

Can I make it required = false and add a null check here to give out an error message in the ui or remove this if block and keep it as before?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that there are quite a few request parameter by now, I would create a class the paramters and validate that. Similar to how it's done here:
https://www.baeldung.com/spring-mvc-form-tutorial

@jdamerow jdamerow closed this Jun 26, 2024
@pooja-thalur pooja-thalur reopened this Jul 5, 2024

private String defaultExhibitLanguage;

private String exhibitionParam;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's that? what's a exhibition param?

private ExhibitionModes exhibitMode;

@NotEmpty
private String spaceParam;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's space param?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was passed from the form, removed it from here now

@jdamerow jdamerow closed this Jul 10, 2024
@pooja-thalur pooja-thalur reopened this Jul 12, 2024
private List<String> exhibitLanguage;

@NotNull(message = "Please select exhibit mode")
private ExhibitionModes exhibitMode;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is not really a reason to save 3 characters, just write out "exhibition" (and in the message it definitely need to be written out)

@jdamerow
Copy link
Member

Make it so, Jenkins.

@jdamerow
Copy link
Member

after that should be good

@jdamerow jdamerow closed this Jul 18, 2024
@pooja-thalur pooja-thalur reopened this Jul 18, 2024
@pooja-thalur pooja-thalur changed the title Bug/vspc 271 Bug/vspc 271 - Exhibition Configuration: if not exhibition language should be required Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants