Skip to content

Commit

Permalink
Merge pull request #201 from ShanePark/#hotfix
Browse files Browse the repository at this point in the history
#hotfix  fix some bugs and enhance ui
  • Loading branch information
ShanePark authored Oct 10, 2024
2 parents 7b8ac2f + 825cbd7 commit f57b7e3
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import jakarta.servlet.http.HttpServletRequest
import net.gpedro.integrations.slack.SlackAttachment
import net.gpedro.integrations.slack.SlackField
import net.gpedro.integrations.slack.SlackMessage
import org.apache.catalina.connector.ClientAbortException
import org.slf4j.Logger
import org.springframework.http.ResponseEntity
import org.springframework.web.HttpRequestMethodNotSupportedException
Expand Down Expand Up @@ -35,7 +36,7 @@ class ErrorDetectAdvisor(

@ExceptionHandler(Exception::class)
fun handleException(req: HttpServletRequest, e: Exception) {
if (e is NoResourceFoundException) {
if (e is NoResourceFoundException || e is ClientAbortException) {
return
}

Expand Down
13 changes: 8 additions & 5 deletions src/main/resources/static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ body a:hover {
padding: 0 0 5px;
}

.day-grid .DAY.has-schedule {
filter: brightness(85%);
.day-grid .DAY.has-schedule:not(.month-next):not(.month-prev) {
filter: brightness(90%);
}

.day-grid .month-prev,
.day-grid .month-next {
filter: opacity(0.5);
filter: opacity(0.6);
}

.day-grid.editable .DAY:hover {
Expand Down Expand Up @@ -656,16 +656,19 @@ a.homeButton:hover {
display: flex;
align-items: center;
justify-content: center;
min-height: 60px;
border-right: 0.5px solid black;
}

#todo-list-container {
display: flex;
overflow: hidden;
padding-top: 0.5rem;
padding-top: 0.3rem;
padding-bottom: 0.3rem;
}

#todo-list {
overflow-x: scroll;
overflow-x: auto;
}

.todo-item {
Expand Down
58 changes: 26 additions & 32 deletions src/main/resources/templates/duty/duty.html
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ <h5 class="modal-title" id="addModalLabel">할일 추가</h5>
</div>
</div>
<div class="buttons mt-3" v-if="!isEditing(schedule)">
<template v-if="schedule.isTagged">
<template v-if="schedule.isTagged && isMyCalendar">
<button class="btn btn-danger" v-on:click="untagSelf(schedule)">태그제거</button>
</template>
<template v-else>
Expand Down Expand Up @@ -1025,7 +1025,7 @@ <h5 class="modal-title" id="addModalLabel">할일 추가</h5>
}
,
loadFriends() {
if (!loginMemberId) {
if (!loginMemberId || !app.isMyCalendar) {
return;
}
fetch('/api/friends')
Expand Down Expand Up @@ -1055,6 +1055,9 @@ <h5 class="modal-title" id="addModalLabel">할일 추가</h5>
}
,
untag(scheduleId, friendId) {
if (!app.isMyCalendar) {
return;
}
fetch(`/api/schedules/${scheduleId}/tags/${friendId}`, {
method: 'DELETE',
}).then(response => {
Expand All @@ -1072,6 +1075,9 @@ <h5 class="modal-title" id="addModalLabel">할일 추가</h5>
}
,
untagSelf(schedule) {
if (!app.isMyCalendar) {
return;
}
const scheduleId = schedule.id;
const scheduleElement = document.getElementById('schedule-' + scheduleId);
const scheduleBy = scheduleElement.querySelector('.schedule-tags').querySelector('.schedule-tag').innerText;
Expand Down Expand Up @@ -1177,7 +1183,7 @@ <h5 class="modal-title" id="addModalLabel">할일 추가</h5>
}, showTodoDetails(todo) {
const modal = document.getElementById("todo-details-modal");
modal.querySelector(".todo-title").value = todo.title;
modal.querySelector(".todo-content").textContent = todo.content;
modal.querySelector(".todo-content").value = todo.content;
modal.querySelector(".todo-date").textContent = todo.createdDate;
$('#todo-details-modal').modal('show');

Expand All @@ -1187,39 +1193,27 @@ <h5 class="modal-title" id="addModalLabel">할일 추가</h5>
deleteTodo() {
const modal = document.getElementById("todo-details-modal");
const todoId = modal.getAttribute('data-id');
Swal.fire({
title: '할 일을 삭제하시겠습니까?',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#d33',
cancelButtonColor: '#999',
confirmButtonText: '삭제',
cancelButtonText: '취소',
}).then((result) => {
if (!result.isConfirmed) {
return;
}
fetch(`/api/todos/${todoId}`, {
method: 'DELETE',
}).then(response => {
if (!response.ok) {
Swal.fire({
icon: 'error',
title: '할 일 삭제에 실패했습니다.',
showConfirmButton: false,
timer: 1500
});
return;
}

fetch(`/api/todos/${todoId}`, {
method: 'DELETE',
}).then(response => {
if (!response.ok) {
Swal.fire({
icon: 'success',
title: '할 일이 삭제되었습니다.',
icon: 'error',
title: '할 일 삭제에 실패했습니다.',
showConfirmButton: false,
timer: 1500
});
app.loadTodos();
$('#todo-details-modal').modal('hide');
return;
}
Swal.fire({
icon: 'success',
title: '할 일이 삭제되었습니다.',
showConfirmButton: false,
timer: 1500
});
app.loadTodos();
$('#todo-details-modal').modal('hide');
});
},
initSortable() {
Expand Down Expand Up @@ -1273,7 +1267,7 @@ <h5 class="modal-title" id="addModalLabel">할일 추가</h5>
const modal = document.getElementById("todo-details-modal");
const todoId = modal.getAttribute('data-id');
const title = modal.querySelector('.todo-title').value;
const content = modal.querySelector('.todo-content').textContent;
const content = modal.querySelector('.todo-content').value;
fetch(`/api/todos/${todoId}`, {
method: 'PUT',
headers: {
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/templates/layout/include.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<script th:src="@{/lib/dayjs/relativeTime.js}"></script>
<script th:src="@{/lib/dayjs/ko.js}"></script>

<link rel="stylesheet" th:href="@{/css/base.css?v=20241009.2}"/>
<link rel="stylesheet" th:href="@{/css/mquery.css?v=20241009.2}"/>
<link rel="stylesheet" th:href="@{/css/base.css?v=20241010.2}"/>
<link rel="stylesheet" th:href="@{/css/mquery.css?v=20241010.2}"/>
<script>
dayjs.extend(window.dayjs_plugin_relativeTime)
dayjs.locale('ko')
</script>

<script th:src="@{/js/common.js?v=20241009.2}"></script>
<script th:src="@{/js/common.js?v=20241010.2}"></script>
</head>

0 comments on commit f57b7e3

Please sign in to comment.