diff --git a/src/main/java/com/maradona/backend/DefaultValueLoader.java b/src/main/java/com/maradona/backend/DefaultValueLoader.java index f66470c..aae7469 100644 --- a/src/main/java/com/maradona/backend/DefaultValueLoader.java +++ b/src/main/java/com/maradona/backend/DefaultValueLoader.java @@ -4,15 +4,19 @@ import com.maradona.backend.entities.Employee; import com.maradona.backend.entities.EmployeeSecondarySkill; import com.maradona.backend.entities.FormOfAddress; import com.maradona.backend.entities.PrimarySkill; +import com.maradona.backend.entities.Project; import com.maradona.backend.entities.SecondarySkill; import com.maradona.backend.repositories.EmployeeRepository; import com.maradona.backend.repositories.FormOfAddressRepository; import com.maradona.backend.repositories.PrimarySkillRepository; +import com.maradona.backend.repositories.ProjectRepository; import com.maradona.backend.repositories.SecondarySkillRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; +import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Component; +import java.time.LocalDate; import java.time.LocalTime; import java.util.ArrayList; import java.util.List; @@ -32,6 +36,9 @@ public class DefaultValueLoader implements CommandLineRunner { @Autowired private FormOfAddressRepository formOfAddressRepository; + @Autowired + private ProjectRepository projectRepository; + @Override public void run(String... args) { @@ -104,5 +111,15 @@ public class DefaultValueLoader implements CommandLineRunner { employee1.setSecondarySkills(employee1Skills); employeeRepository.save(employee1); + + // add a default project + Project project = new Project(); + project.setName("Project 1"); + project.setStartDate(LocalDate.now()); + project.setEndDate(LocalDate.now().plusDays(30)); + project.setDescription("This is a project description"); + + // save project + project = projectRepository.save(project); } } \ No newline at end of file diff --git a/src/main/resources/templates/pages/skills/create.html b/src/main/resources/templates/pages/skills/create.html index 308b73a..58f7833 100644 --- a/src/main/resources/templates/pages/skills/create.html +++ b/src/main/resources/templates/pages/skills/create.html @@ -13,48 +13,30 @@

Create Skill

-
+
- +
- +
- -
- - -
@@ -62,5 +44,35 @@
+ - + \ No newline at end of file