내정보, 비밀번호 확인, 내정보 수정 : UX에 따라 수정 필요.

This commit is contained in:
DESKTOP-E9DJS27\etribe
2025-06-14 11:18:58 +09:00
parent 7ab2739e2a
commit 2c7c7894df
25 changed files with 429 additions and 477 deletions

View File

@@ -0,0 +1,3 @@
<svg width="32" height="33" viewBox="0 0 32 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20.8047 26.0977L11.2047 16.4977L20.8047 6.89766" stroke="#212529" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 245 B

View File

@@ -39,7 +39,9 @@ var ajaxUtil = {
message: alertMessage,
type: "alert",
callback: function() {
console.log("alert callback");
if (typeof afterEvent === 'function') {
afterEvent();
}
},
});
} else {
@@ -47,7 +49,9 @@ var ajaxUtil = {
message: alertMessage,
type: "alert",
callback: function() {
console.log("alert callback");
if (typeof afterEvent === 'function') {
afterEvent();
}
},
});
}
@@ -161,16 +165,23 @@ var ajaxUtil = {
},
422:function(rstData, status) {
console.log(rstData)
/**
* TODO
* 폼이 너무 여러가지 형식이 있는데 서버에러를 가지고 처리하는게 맞는지 검토 필요
* 코드 정리는 나중에 하려고 그냥 만듬.... 정리 필요.
*/
let isResetDone = false;
$(rstData.responseJSON.fieldErrors).each((idx, oj) => {
const target = $('[name="' + oj.field + '"]');
let infoBox = null;
if (!isResetDone) {
const formElement = target.closest('form');
if (formElement.length > 0) {
$(formElement).find('.component-input').removeClass('input-invalid');
$(formElement).find('.input-flex-group').removeClass('invalid');
$(formElement).find('.select-group').removeClass('input-invalid');
$(formElement).find('.input-info').each(function () {
$(this).remove();
@@ -180,28 +191,44 @@ var ajaxUtil = {
}
if (target.length > 0) {
const component = target.closest('.component-input');
if(component){
component.addClass('input-invalid');
let infoBox = component.find('.input-info');
if (infoBox.length === 0) {
infoBox = $('<ul class="input-info"></ul>').appendTo(component);
}
infoBox.html('<li>' + oj.message + '</li>');
}
}
component.addClass('input-invalid');
//연결된 구조 일 경우 상위에 변경
if(target.closest('.input-flex-group').length > 0){
infoBox = target.closest('.input-flex-group').find('.input-info');
} else {
infoBox = component.find('.input-info');
}
if (target.data('type') == 'select') {
const component = target.parent().parent().closest('.select-group');
if(component){
component.addClass('select-invalid');
let infoBox = component.find('.input-info');
if (infoBox.length === 0) {
infoBox = $('<ul class="input-info"></ul>').appendTo(component);
if(target.closest('.input-flex-group').length > 0){
infoBox = $('<ul class="input-info"></ul>').appendTo(target.closest('.input-flex-group'));
target.closest('.input-flex-group').addClass('invalid');
} else {
infoBox = $('<ul class="input-info"></ul>').appendTo(component);
}
}
infoBox.html('<li>' + oj.message + '</li>');
}
}
if (target.data('type') === 'select') {
const component = target.parent().parent().closest('.select-group');
if (component) {
component.addClass('select-invalid');
infoBox = component.find('.input-info');
if (infoBox.length === 0) {
infoBox = $('<ul class="input-info"></ul>').appendTo(component);
}
infoBox.html('<li>' + oj.message + '1111</li>');
}
}
});
if ($('.input-info').length === 0) {