[fix] 게시판 목록 역순 번호 계산에 pageSize 대신 recordCountPerPage 사용#129
Open
dasomel wants to merge 1 commit into
Open
Conversation
목록 항목의 역순 번호(listIdx)를 itemIdxByPage로 계산할 때 paginationInfo.pageSize (페이지 목록에 보여줄 페이지 번호 개수)를 페이지당 레코드 수로 잘못 사용하고 있었다. PaginationInfo의 실제 의미상 페이지당 레코드 수는 recordCountPerPage이며(예: EgovMainApiController가 recordCountPerPage=5, pageSize=10처럼 서로 다른 값을 명시적으로 설정), 두 값이 다르게 설정된 게시판에서는 2페이지 이후부터 번호가 어긋난다. Globals.pageUnit과 Globals.pageSize 기본값이 둘 다 10이라 기본 설정에서는 드러나지 않는다. 7개 목록 화면(공지/갤러리/관리자 공지·갤러리·게시판·회원·이용현황)에서 동일하게 수정.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 사유
목록 화면에서 항목의 역순 번호(listIdx)를
itemIdxByPage로 계산할 때,resp.result.paginationInfo.pageSize를 페이지당 레코드 수로 사용하고 있었습니다.그런데
PaginationInfo의 실제 의미는 다릅니다.recordCountPerPage: 한 페이지당 게시되는 게시물 건 수pageSize: 페이지 리스트에 게시되는 페이지 건수(페이저에 보여줄 페이지 번호 개수)백엔드에서도 이 둘을 서로 다른 값으로 명시적으로 설정하는 사례가 있습니다(
EgovMainApiController:recordCountPerPage=5,pageSize=10).Globals.pageUnit과Globals.pageSize가 기본값(10, 10)으로 같을 때는 드러나지 않지만, 둘을 다르게 설정한 게시판에서는 2페이지부터 역순 번호가 어긋납니다.변경 내용
다음 7개 목록 화면에서
paginationInfo.pageSize→paginationInfo.recordCountPerPage로 수정했습니다.EgovNoticeList.jsx,EgovGalleryList.jsx(공지/갤러리)EgovAdminBoardList.jsx,EgovAdminGalleryList.jsx,EgovAdminNoticeList.jsx,EgovAdminMemberList.jsx,EgovAdminUsageList.jsx(관리자 목록)EgovPaging.jsx의pageSize사용(페이저 그룹 크기)은 올바른 용례라 변경하지 않았습니다.테스트 방법 / 영향 범위
npm run build정상 통과,npm run lint결과 기존에 있던 무관한 경고/에러(38건, 이 변경 전후 동일)만 남아있고 신규 문제는 없습니다.Globals.pageUnit과Globals.pageSize를 다르게 설정한 게시판의 목록 화면에서 2페이지 이후 역순 번호가 정상적으로 계산되도록 동작이 수정됩니다.