diff --git a/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/domain/Course.java b/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/domain/Course.java index 95632f4..7555ed9 100644 --- a/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/domain/Course.java +++ b/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/domain/Course.java @@ -22,22 +22,22 @@ public class Course extends BaseEntity { @Column(nullable = false) private String title; - @Column(columnDefinition = "TEXT", nullable = false) + @Column(columnDefinition = "TEXT") private String description; - @Column + @Column(nullable = false) private String duration; - @Column + @Column(nullable = false) private Integer seats; - @Column + @Column(nullable = false) private String category; - @Column + @Column(nullable = false) private String level; - @Column + @Column(nullable = false) private String instructor; private String price; diff --git a/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/domain/dto/CourseDto.java b/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/domain/dto/CourseDto.java index cd36ed1..656eeca 100644 --- a/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/domain/dto/CourseDto.java +++ b/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/domain/dto/CourseDto.java @@ -17,17 +17,21 @@ public class CourseDto { @NotNull private String title; - @NotNull private String description; + @NotNull private String duration; + @NotNull private Integer seats; + @NotNull private String category; + @NotNull private String level; + @NotNull private String instructor; private String price; diff --git a/support-portal-frontend/src/app/component/education/education.component.css b/support-portal-frontend/src/app/component/education/education.component.css index 0d3bff5..cdaa682 100644 --- a/support-portal-frontend/src/app/component/education/education.component.css +++ b/support-portal-frontend/src/app/component/education/education.component.css @@ -1144,4 +1144,11 @@ margin-left: 0; width: 100%; } +} + +/* Required field asterisk */ +.required-asterisk { + color: #e53e3e; + font-weight: bold; + margin-left: 2px; } \ No newline at end of file diff --git a/support-portal-frontend/src/app/component/education/education.component.html b/support-portal-frontend/src/app/component/education/education.component.html index 3f80e1f..28bfbc4 100644 --- a/support-portal-frontend/src/app/component/education/education.component.html +++ b/support-portal-frontend/src/app/component/education/education.component.html @@ -103,7 +103,7 @@
@@ -120,7 +120,10 @@ - +
+ + Instructor is required. +
@@ -132,7 +135,10 @@ - +
+ + Duration is required. +
@@ -142,7 +148,10 @@ - +
+ + Number of seats is required. +
@@ -169,7 +178,10 @@ - +
+ + Category is required. +
@@ -185,7 +197,10 @@ - +
+ + Level is required. +
@@ -209,10 +224,6 @@ -
- - Course description is required. -
@@ -326,7 +337,7 @@
@@ -343,10 +354,6 @@ -
- - Event description is required. -
@@ -357,7 +364,10 @@ - +
+ + Schedule is required. +
diff --git a/support-portal-frontend/src/app/component/education/education.component.ts b/support-portal-frontend/src/app/component/education/education.component.ts index 1f5cf0e..a48fbbf 100644 --- a/support-portal-frontend/src/app/component/education/education.component.ts +++ b/support-portal-frontend/src/app/component/education/education.component.ts @@ -43,12 +43,12 @@ export class EducationComponent implements OnInit { ) { this.courseForm = this.fb.group({ title: ['', Validators.required], - description: ['', Validators.required], - duration: [''], - seats: [''], - category: [''], - level: [''], - instructor: [''], + description: [''], + duration: ['', Validators.required], + seats: ['', [Validators.required, Validators.min(1)]], + category: ['', Validators.required], + level: ['', Validators.required], + instructor: ['', Validators.required], price: [''], startDate: [''], eligibility: [''], @@ -58,8 +58,8 @@ export class EducationComponent implements OnInit { }); this.upcomingEventForm = this.fb.group({ title: ['', Validators.required], - description: ['', Validators.required], - schedule: [''], + description: [''], + schedule: ['', Validators.required], eventDate: [''], isActive: [true] });