-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tec: Render the full ticket page when submitting messages
In the next commit, we'll be able to change the status of the ticket when answering. Since the status appears at the top of the page, it needs to be rendered in the response. This brings some difficulties because I no longer use `<turbo-frame>` and now the scroll is set to the top of the page at the end of the submit. Also, there are two cases to handle: 1. the data are valid and we redirect to the "show" page: in this case, a new `data-turbo-preserve-scroll` attribute allows to cancel the scroll of the page 2. an error in the form (e.g. empty content) is detected and we render a bad request response: in this case, the `data-turbo-preserve-scroll` solution doesn't work (i.e. the Turbo `currentVisit` doesn't exist), so we generate an `autofocus` attribute in order to scroll to the form. The user experience is somewhat degraded, but I think it's good enough, at least for a MVP.
- Loading branch information
1 parent
732baa1
commit 3cf3cfa
Showing
6 changed files
with
126 additions
and
106 deletions.
There are no files selected for viewing
This file contains 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 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 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 was deleted.
Oops, something went wrong.
This file contains 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 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