Skip to content
Snippets Groups Projects
Commit dc2ffa53 authored by Otto Visser's avatar Otto Visser
Browse files

Merge branch '195-default-values-labs' into 'development'

Add default options for the enqueueing form

Closes #195

See merge request !146
parents 733db9d3 1b66d623
No related branches found
No related tags found
1 merge request!154Development
...@@ -69,6 +69,7 @@ public class Request implements RecordsEvents<Request>, Serializable, Comparable ...@@ -69,6 +69,7 @@ public class Request implements RecordsEvents<Request>, Serializable, Comparable
@JsonView(View.Summary.class) @JsonView(View.Summary.class)
private Room room; private Room room;
@NotNull
@JsonView(View.Summary.class) @JsonView(View.Summary.class)
@OneToOne @OneToOne
private RequestType requestType; private RequestType requestType;
......
...@@ -24,6 +24,8 @@ import javax.validation.constraints.Size; ...@@ -24,6 +24,8 @@ import javax.validation.constraints.Size;
import nl.tudelft.ewi.queue.views.View; import nl.tudelft.ewi.queue.views.View;
import org.hibernate.validator.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonView; import com.fasterxml.jackson.annotation.JsonView;
@Entity @Entity
...@@ -35,6 +37,7 @@ public class RequestType implements Serializable { ...@@ -35,6 +37,7 @@ public class RequestType implements Serializable {
@GeneratedValue @GeneratedValue
private Long id; private Long id;
@NotBlank
@JsonView(View.Summary.class) @JsonView(View.Summary.class)
@Size(max = 250) @Size(max = 250)
private String name; private String name;
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" th:classappend="${#fields.hasErrors('assignment')} ? 'is-invalid'" <select class="form-control" th:classappend="${#fields.hasErrors('assignment')} ? 'is-invalid'"
id="inputAssignment" th:field="*{assignment}"> id="inputAssignment" th:field="*{assignment}">
<option value="" th:selected="selected">Choose an assignment</option>
<option th:each="assignment : ${lab.assignments}" th:value="${assignment.id}" <option th:each="assignment : ${lab.assignments}" th:value="${assignment.id}"
th:text="${assignment.name}">Assembly programming th:text="${assignment.name}">Assembly programming
</option> </option>
...@@ -101,6 +102,7 @@ ...@@ -101,6 +102,7 @@
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" id="inputType" th:field="*{requestType}" <select class="form-control" id="inputType" th:field="*{requestType}"
th:classappend="${#fields.hasErrors('requestType')} ? 'is-invalid'"> th:classappend="${#fields.hasErrors('requestType')} ? 'is-invalid'">
<option value="" th:selected="selected">Choose the type</option>
<option th:each="requestType : ${lab.allowedRequestTypes}" th:value="${requestType.id}" <option th:each="requestType : ${lab.allowedRequestTypes}" th:value="${requestType.id}"
th:text="${requestType.name}"></option> th:text="${requestType.name}"></option>
</select> </select>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment