Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Samuel Dudík
PA165 Winery Management System
Commits
4a88ad00
Commit
4a88ad00
authored
May 24, 2022
by
Jakub Balga
Browse files
Merge branch 'feature/balga/reviewfix' into 'main'
Feature/balga/reviewfix See merge request
!50
parents
3007ef20
e888eb76
Pipeline
#142402
passed with stages
in 2 minutes and 22 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
winery/api/src/main/java/cz/muni/fi/pa165/winery/dto/wine/WineBottleDto.java
View file @
4a88ad00
...
@@ -18,10 +18,9 @@ import java.math.BigDecimal;
...
@@ -18,10 +18,9 @@ import java.math.BigDecimal;
public
class
WineBottleDto
extends
PersistentDtoBase
{
public
class
WineBottleDto
extends
PersistentDtoBase
{
/**
/**
* name of the bottle
, allows only alphanumerical characters
* name of the bottle
*/
*/
@NotBlank
@NotBlank
@Pattern
(
regexp
=
"^[\\w0-9 ]+$"
,
message
=
"Only alphanumerical characters and spaces"
)
private
String
name
;
private
String
name
;
/**
/**
...
...
winery/api/src/main/java/cz/muni/fi/pa165/winery/dto/wine/WineTypeDto.java
View file @
4a88ad00
...
@@ -5,7 +5,6 @@ import lombok.*;
...
@@ -5,7 +5,6 @@ import lombok.*;
import
lombok.experimental.SuperBuilder
;
import
lombok.experimental.SuperBuilder
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Pattern
;
/**
/**
* @author Jakub Balga
* @author Jakub Balga
...
@@ -18,10 +17,9 @@ import javax.validation.constraints.Pattern;
...
@@ -18,10 +17,9 @@ import javax.validation.constraints.Pattern;
public
class
WineTypeDto
extends
PersistentDtoBase
{
public
class
WineTypeDto
extends
PersistentDtoBase
{
/**
/**
* Name of the wine
, allows only alphanumerical characters
* Name of the wine
*/
*/
@NotBlank
@NotBlank
@Pattern
(
regexp
=
"^[\\w0-9 ]+$"
,
message
=
"Only alphanumerical characters and spaces"
)
private
String
name
;
private
String
name
;
/**
/**
...
...
winery/dao/src/main/java/cz/muni/fi/pa165/winery/persistence/entities/WineBottle.java
View file @
4a88ad00
...
@@ -27,11 +27,9 @@ public class WineBottle extends EntityBase{
...
@@ -27,11 +27,9 @@ public class WineBottle extends EntityBase{
/**
/**
* attribute of type String representing name,
* attribute of type String representing name,
* allows only alphanumerical characters
*/
*/
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
@NotNull
@NotBlank
@Pattern
(
regexp
=
"^[\\w0-9 ]*$"
,
message
=
"Only alphanumerical characters"
)
private
String
name
;
private
String
name
;
/**
/**
...
...
winery/webapp/src/main/java/cz/muni/fi/pa165/winery/webapp/models/wineBottle/WineBottleUpsertViewModel.java
View file @
4a88ad00
...
@@ -11,7 +11,6 @@ import org.modelmapper.ModelMapper;
...
@@ -11,7 +11,6 @@ import org.modelmapper.ModelMapper;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.PositiveOrZero
;
import
javax.validation.constraints.PositiveOrZero
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
...
@@ -38,7 +37,6 @@ public class WineBottleUpsertViewModel extends ViewModelBase {
...
@@ -38,7 +37,6 @@ public class WineBottleUpsertViewModel extends ViewModelBase {
* name of wine bottle
* name of wine bottle
*/
*/
@NotNull
(
message
=
"Cannot be empty"
)
@NotNull
(
message
=
"Cannot be empty"
)
@Pattern
(
regexp
=
"^[\\w0-9 ]*$"
,
message
=
"Only alphanumerical characters"
)
private
String
name
;
private
String
name
;
/**
/**
...
...
winery/webapp/src/main/resources/templates/grape/edit.html
View file @
4a88ad00
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
th:for=
"*{name}"
th:value=
"*{name}"
>
Name
</label>
<label
th:for=
"*{name}"
th:value=
"*{name}"
>
Name
</label>
<input
class=
"form-control"
type=
"text"
th:field=
"*{name}"
>
<input
class=
"form-control"
type=
"text"
th:field=
"*{name}"
>
<p
class=
"text-danger"
th:each=
"error : ${#fields.errors('name')}"
th:text=
"${error}"
></p>
</div>
</div>
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
</form>
</form>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment