Skip to content

Commit 3fad5dd

Browse files
committed
fix/qg-273: исправлена проблема с мерцанием начала формы и клавиатуры при выходе с экрана создания записи журнала
1 parent f89136b commit 3fad5dd

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

app/src/main/kotlin/pro/qyoga/app/therapist/clients/journal/edit_entry/create/CreateJournalEntryPageController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class CreateJournalEntryPageController(
6969
return when {
7070
result.isSuccess ->
7171
ResponseEntity
72-
.ok()
72+
.noContent()
7373
.header("HX-Trigger", "formSaved")
7474
.build<Unit>()
7575

app/src/main/resources/templates/therapist/clients/client-add_journal_entry-fragment.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@
6969
return serverState != null && serverState[key] !== form[key];
7070
}
7171

72-
function closeForm() {
72+
function closeForm(event) {
7373
resetLocalState();
74-
window.location.href = document.referrer;
74+
window.location.replace(document.referrer);
75+
if (event) {
76+
event.preventDefault();
77+
}
7578
}
7679

7780
window.addEventListener("htmx:afterSettle", () => {
@@ -155,7 +158,7 @@
155158

156159
<div class="row g-2 justify-content-end">
157160
<div class="col-6 col-sm-auto text-center">
158-
<button @click="closeForm()"
161+
<button @click="closeForm(event)"
159162
class="btn btn-outline-danger"
160163
style="min-width: 110px;">
161164
Отмена

app/src/test/kotlin/pro/qyoga/tests/clients/api/TherapistClientJournalApi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class TherapistClientJournalApi(override val authCookie: Cookie) : AuthorizedApi
9191

9292
fun createJournalEntry(clientId: UUID, journalEntry: EditJournalEntryRq) {
9393
postNewJournalEntry(journalEntry, clientId) Then {
94-
statusCode(HttpStatus.OK.value())
94+
statusCode(HttpStatus.NO_CONTENT.value())
9595
}
9696
}
9797

0 commit comments

Comments
 (0)