diff --git a/WebContent/jsp/onl/admin/rule/layoutManDetail.jsp b/WebContent/jsp/onl/admin/rule/layoutManDetail.jsp index 8bcf3eb..4ab7166 100644 --- a/WebContent/jsp/onl/admin/rule/layoutManDetail.jsp +++ b/WebContent/jsp/onl/admin/rule/layoutManDetail.jsp @@ -375,10 +375,20 @@ url:url, data:postData, success:function(args){ - alert("<%=localeMessage.getString("common.saveMsg")%>"); if(isPop == "true"){ + alert("<%=localeMessage.getString("common.saveMsg")%> \n저장 후 변환정보 수정이 필수입니다. 변환정보를 확인하세요"); + const origin = window.location.origin; + + const layoutName = $("input[name='loutName']").val(); + + parent.postMessage({ + action: 'LAYOUT_SAVED_OPEN_TRANSFORM', + layoutPartName: '${param.layoutPartName}' + }, origin); + window.close(); } else { + alert("<%=localeMessage.getString("common.saveMsg")%>"); goNav(returnUrl); } }, diff --git a/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp b/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp index 4072679..7450ced 100644 --- a/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp +++ b/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp @@ -1153,27 +1153,41 @@ addLayoutBtnEvent('outboundErrResponse', '아웃바운드 오류', 'TGTE'); window.addEventListener('message', function(e) { + if (e.origin !== window.location.origin) return; + const popupMessage = e.data; - if('DELETE' == popupMessage.cmd){ - if('layout' == popupMessage.type){ - $('#'+popupMessage.layoutPartName).val(''); + if (!popupMessage) return; + + if ('DELETE' == popupMessage.cmd) { + if ('layout' == popupMessage.type) { + $('#' + popupMessage.layoutPartName).val(''); } - if('transform' == popupMessage.type){ + if ('transform' == popupMessage.type) { const partName = popupMessage.transformName.endsWith('REQ') ? '#requestTransform' : '#responseTransform'; $(partName).val(''); } transformSetStateChange(); + return; } - }); - $('#requestTransformButton').on("click", function(event) { - modifyTransform('request'); - }); - $('#responseTransformButton').on("click", function(event) { - modifyTransform('response'); - }); - $('#errResponseTransformButton').on("click", function(event) { - modifyTransform('errResponse'); + // 레이아웃 저장 후 변환 팝업 자동 실행 로직 + if (popupMessage.action === 'LAYOUT_SAVED_OPEN_TRANSFORM') { + + // 혹시 모를 popup창 닫기 + if ($('.ui-dialog-content').length > 0) { + $('.ui-dialog-content').dialog('close'); + } + + const part = popupMessage.layoutPartName || ""; + + if (part.includes('Request')) { + modifyTransform('request'); + } else if (part.includes('Response')) { + modifyTransform('response'); + } else if (part.includes('ErrResponse')) { + modifyTransform('errResponse'); + } + } }); // modifyLayout('inboundRequestLayout', '인바운드 요청', 'CBSS')