-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/frontend #7
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
5514942
html
JohanHiths 94fc4e6
code rabbit suggestions
JohanHiths 0422f88
More coderabbits suggestions, avoiding style conflicts fragment mismatch
JohanHiths 1d98a12
More coderabbits suggestions, font style mismatch
JohanHiths 5673775
Merge branch 'main' into feature/frontend-structure
JohanHiths 279f8d8
fixed navbar
JohanHiths dbd0689
Added controllers for viewing home and booking. todo: fix commented o…
JohanHiths b07d5dd
added error.html, also refactored usercontroller
JohanHiths 7041268
update
JohanHiths 4a97c2c
fixed multiple controllers issue
JohanHiths 70024a8
Added modelattribute to UserController, started with admin.html and p…
JohanHiths b0573ba
Added contact html/css
JohanHiths b216e28
Added admin, register, login
JohanHiths 87413af
Merge branch 'refs/heads/main' into backend-repository-service
JohanHiths 7fa5ec9
Moved UserEntity to user, added dtos and UserService
JohanHiths 3ce3d4f
update
JohanHiths 9d8e0af
Exceptions, mapper
JohanHiths e7b5973
Exceptions, mapper
JohanHiths dc4fbb4
Frontend
JohanHiths 8f35c66
Merge branch 'main' into feature/frontend
JohanHiths 6687341
Update pom.xml
JohanHiths c10b8b3
Added fiels to UserEntity
JohanHiths 50efee3
Merge remote-tracking branch 'origin/feature/frontend' into feature/f…
JohanHiths 71c6e02
UserController, UserMapper, UserService
JohanHiths b4e3731
fixed maven errors
JohanHiths 2be9c9b
fixed maven errors
JohanHiths 9648aca
Added htmx to admin , booking, contact
JohanHiths 3fc58b0
contact-fragments.html
JohanHiths bfa7ad8
Refactored controllers, added HTMX integration, enhanced Thymeleaf te…
JohanHiths 3c56df8
add DuplicateEmailException, globalexception, UsernotfoundException
JohanHiths File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/main/java/backendlab/team4you/contact/ContactFormDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package backendlab.team4you.contact; | ||
|
|
||
| public record ContactFormDTO( | ||
| String firstName, | ||
| String lastName, | ||
| String email, | ||
| String phone, | ||
| String message | ||
| ) {} |
88 changes: 88 additions & 0 deletions
88
src/main/java/backendlab/team4you/contact/ContactMessage.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| package backendlab.team4you.contact; | ||
|
|
||
| import jakarta.persistence.Column; | ||
| import jakarta.persistence.Entity; | ||
| import jakarta.persistence.Id; | ||
| import jakarta.persistence.Table; | ||
|
|
||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
|
|
||
|
|
||
| @Entity | ||
| @Table(name = "contact_messages") | ||
| public class ContactMessage { | ||
| @Id | ||
| private Long id; | ||
|
|
||
| private String firstName; | ||
| private String email; | ||
|
|
||
| private String phone; | ||
| private String lastName; | ||
|
|
||
|
|
||
| @Column(columnDefinition = "TEXT") | ||
| private String message; | ||
|
|
||
| private LocalDateTime submittedAt = LocalDateTime.now(); | ||
|
|
||
|
|
||
| public ContactMessage() { | ||
| } | ||
| public ContactMessage(String firstName, String email, String phone, String lastName, String message) { | ||
| this.firstName = firstName; | ||
| this.email = email; | ||
| this.phone = phone; | ||
| this.lastName = lastName; | ||
| this.message = message; | ||
| } | ||
|
|
||
| public String getFirstName() { | ||
| return firstName; | ||
| } | ||
| public void setFirstName(String firstName) { | ||
| this.firstName = firstName; | ||
| } | ||
| public String getEmail() { | ||
| return email; | ||
| } | ||
| public void setEmail(String email) { | ||
| this.email = email; | ||
| } | ||
| public String getPhone() { | ||
| return phone; | ||
| } | ||
| public void setPhone(String phone) { | ||
| this.phone = phone; | ||
| } | ||
| public String getLastName() { | ||
| return lastName; | ||
| } | ||
| public void setLastName(String lastName) { | ||
| this.lastName = lastName; | ||
| } | ||
| public String getMessage() { | ||
| return message; | ||
| } | ||
| public void setMessage(String message) { | ||
| this.message = message; | ||
| } | ||
| public LocalDateTime getSubmittedAt() { | ||
| return submittedAt; | ||
| } | ||
| public void setSubmittedAt(LocalDateTime submittedAt) { | ||
| this.submittedAt = submittedAt; | ||
|
|
||
| } | ||
|
|
||
|
|
||
| public Long getId() { | ||
| return id; | ||
| } | ||
| public void setId(Long id) { | ||
| this.id = id; | ||
| } | ||
|
|
||
| } |
10 changes: 10 additions & 0 deletions
10
src/main/java/backendlab/team4you/contact/ContactRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package backendlab.team4you.contact; | ||
|
|
||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.stereotype.Repository; | ||
|
|
||
| @Repository | ||
| public interface ContactRepository extends JpaRepository<ContactMessage, Long> { | ||
|
|
||
|
|
||
| } |
70 changes: 70 additions & 0 deletions
70
src/main/java/backendlab/team4you/controller/AdminController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| package backendlab.team4you.controller; | ||
|
|
||
| import backendlab.team4you.service.LogService; | ||
| import backendlab.team4you.user.UserService; | ||
| import groovy.util.logging.Slf4j; | ||
|
|
||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
| import org.springframework.stereotype.Controller; | ||
| import org.springframework.ui.Model; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PostMapping; | ||
| import org.springframework.web.bind.annotation.RequestParam; | ||
|
|
||
| import java.util.List; | ||
|
|
||
|
|
||
| @Slf4j | ||
| @Controller | ||
| public class AdminController { | ||
|
|
||
| private final LogService logService = new LogService(); | ||
|
|
||
| private final UserService userService; | ||
|
|
||
| public AdminController(UserService userService) { | ||
| this.userService = userService; | ||
| } | ||
|
|
||
| @GetMapping("/admin/logs") | ||
| public String logs(Model model) { | ||
| List<String> logs = List.of( | ||
| "User johndoe loggade in", | ||
| "Ny användare registrerad", | ||
| "Admin tog bort user #123" | ||
| ); | ||
|
|
||
| model.addAttribute("logs", logs); | ||
| return "fragments/admin-logs :: content"; | ||
| } | ||
|
|
||
|
|
||
| @GetMapping("/admin/users") | ||
| public String adminLogs(Model model){ | ||
| List<String> users = List.of( | ||
| "User johndoe", | ||
| "User janedoe", | ||
| "User anna" | ||
| ); | ||
|
|
||
| model.addAttribute("users", users); | ||
| return "fragments/admin-users :: content"; | ||
| } | ||
|
|
||
| @PostMapping("/admin/users") | ||
| public String deleteUser(@RequestParam String id){ | ||
| userService.deleteUser(id); | ||
| return ""; | ||
| } | ||
|
|
||
| @PostMapping("/admin/logs/delete") | ||
| public String deleteLog(@RequestParam String log) { | ||
| logService.delete(log); | ||
| return ""; | ||
| } | ||
|
|
||
|
|
||
|
|
||
| } | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: ithsjava25/project-backend-team4you
Length of output: 532
🏁 Script executed:
cat -n pom.xml | head -150Repository: ithsjava25/project-backend-team4you
Length of output: 5505
Deduplicate the copied dependency block.
Lines 39–66 and 75–78 re-declare coordinates that are already present later in the same
<dependencies>section (lines 79–114). Remove these duplicate declarations and keep only the new Thymeleaf entries (lines 67–74) in this added block.🧹 Cleanup diff
🤖 Prompt for AI Agents