-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/preview flow #23
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
49 commits
Select commit
Hold shift + click to select a range
61dc4bc
add: startPage should not be filtered
FionaSprinkles d80add6
add: startPage to permitted endpoints
FionaSprinkles a47fe70
Create StartPageController and add initial code
FionaSprinkles bfa108e
Correct path to login view
FionaSprinkles 62d5ff3
add : layout to login
FionaSprinkles 53813f8
add : token login and box styling
FionaSprinkles b7be9cd
Create startPage
FionaSprinkles 8676421
Permit access to root endpoint
FionaSprinkles 9f12a28
Update navigation links and make logo clickable
FionaSprinkles 2b74474
Create preview before submitting ticket
FionaSprinkles 77b05eb
add: ticket preview method
FionaSprinkles 0948b89
update endpoint to preview
FionaSprinkles fee34fb
permit access to ticket create and preview endpoints
FionaSprinkles 5e4912a
feat: add anonymous and authenticated ticket submission endpoints
FionaSprinkles 1512997
feat: add preview page actions for anonymous and authenticated submis…
FionaSprinkles b9c3cf1
refactor: move token generation from entity to service
FionaSprinkles 6e34d83
add: method for anonymous ticket
FionaSprinkles 419a420
add: token field
FionaSprinkles 6b7eed6
feat(auth): add user feedback for login, logout and token validation
addee1 304ea31
adds success message if ticket created successfully
addee1 a412f14
feat(global): add isLoggedIn to all views via ControllerAdvice
addee1 817804a
feat(layout): add conditional navbar and success toast
addee1 bf89d3b
feat(login): add token form and error handling
addee1 27ef419
feat(tickets): add my tickets view
addee1 c1a85b7
feat(tickets): pass success message to preview page
addee1 c7eb1b7
fix(security): allow access to logout endpoint
addee1 777313c
style(auth): improve signup page layout and styling
addee1 264bb62
feat(home): enable success toast on start page
addee1 6f37340
Add Model parameter to start page handler
addee1 bac8b3d
Adds styling
addee1 0d97015
Change reportToken to have nullable true
addee1 b4dfd49
feat(tickets): add ticket-created page with token display
addee1 01ae946
feat(tickets): improve ticket creation flow with success feedback and…
addee1 44ce296
feat(tickets): support anonymous ticket creation with reporter token
addee1 0b784ee
feat(tickets): add formatted createdAt helper in TicketViewDTO
addee1 fa034bd
add success toast support to ticket view page
addee1 c55e12a
feat: improve create ticket UX based on login state
addee1 7b38dd3
fix(tickets): handle anonymous user safely in ticket creation
addee1 6eed49a
Merge remote-tracking branch 'refs/remotes/origin/main' into feature/…
simonforsberg 4486ddf
Refactor `TicketServiceTest` to use nested class for `createNewTicket…
simonforsberg 0230126
Add verification that `getMyTickets` does not call repository for una…
simonforsberg cc4e5c9
Enhance `createNewTicket` tests in `TicketServiceTest` by adding asse…
simonforsberg 33cfc79
fix: narrow exception handling in GlobalModelAttributes
addee1 9c0b3d0
fix: only return null for auth failures in getCurrentUserOrNull
addee1 2ee1dc1
fix: encode token in URL to prevent invalid routing
addee1 2ba8839
fix: remove duplicate JS toast animation and rely on CSS
addee1 d5b8315
fix: remove absolute security claim in UI text
addee1 c21f2d1
fix: include token in TicketViewDTO for token-based access
addee1 089b0e8
style: fix CSS lint issues (import syntax, font-family, keyframes nam…
addee1 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
35 changes: 35 additions & 0 deletions
35
src/main/java/org/example/alfs/config/GlobalModelAttributes.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,35 @@ | ||
| package org.example.alfs.config; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
| import org.springframework.web.bind.annotation.ControllerAdvice; | ||
| import org.example.alfs.security.SecurityUtils; | ||
| import org.springframework.ui.Model; | ||
| import org.springframework.web.bind.annotation.ModelAttribute; | ||
|
|
||
| @ControllerAdvice | ||
| public class GlobalModelAttributes { | ||
| private static final Logger log = LoggerFactory.getLogger(GlobalModelAttributes.class); | ||
| private final SecurityUtils securityUtils; | ||
|
|
||
| public GlobalModelAttributes(SecurityUtils securityUtils) { | ||
| this.securityUtils = securityUtils; | ||
| } | ||
|
|
||
| @ModelAttribute | ||
| public void addGlobalAttributes(Model model) { | ||
|
|
||
| boolean isLoggedIn = false; | ||
| String username = null; | ||
|
|
||
| try { | ||
| var user = securityUtils.getCurrentUser(); | ||
| isLoggedIn = true; | ||
| username = user.getUsername(); | ||
| } catch (RuntimeException ex) { | ||
| log.debug("Could not resolve current user for global model attributes", ex); | ||
| } | ||
|
|
||
| model.addAttribute("isLoggedIn", isLoggedIn); | ||
| model.addAttribute("username", username); | ||
| } | ||
| } | ||
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
14 changes: 14 additions & 0 deletions
14
src/main/java/org/example/alfs/controllers/StartPageController.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,14 @@ | ||
| package org.example.alfs.controllers; | ||
|
|
||
| import org.springframework.stereotype.Controller; | ||
| import org.springframework.ui.Model; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
|
|
||
| @Controller | ||
| public class StartPageController { | ||
|
|
||
| @GetMapping("/") | ||
| public String startPage(Model model){ | ||
| return "startPage"; | ||
| } | ||
| } |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.