Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: script error is caused by calling removeCheckedRows API(#1053) #1052

Merged
merged 5 commits into from
May 22, 2020

Conversation

js87zz
Copy link
Contributor

@js87zz js87zz commented May 19, 2020

Please check if the PR fulfills these requirements

  • It's submitted to right branch according to our branching model
  • It's right issue type on title
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • It does not introduce a breaking change or has description for the breaking change

Description


Thank you for your contribution to TOAST UI product. 🎉 😘 ✨

@@ -371,7 +371,7 @@ describe('removeRow()', () => {
describe('removeCheckedRows()', () => {
beforeEach(() => {
// @ts-ignore
createGrid({ rowHeaders: ['_checked'] });
createGrid({ rowHeaders: ['checkbox'] });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

언더바가 제거된 이유가 있나요?? 제 기억에.. 로우 헤더 설정할 때 값이 문자열일 때 컬럼명을 그대로 사용했던 것 같아서요 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

옵션명이 처음부터 잘못 들어갔어요. 튜토리얼에서도 checkbox로 가이드하고 있습니다~!

for (let index = 0, end = rawData.length; index < end; index += 1) {
const targetIndex = targetIndexes[index];
data.viewData.splice(targetIndex, 1, viewData[index]);
data.rawData.splice(targetIndex, 1, rawData[index]);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

데이터를 한개씩 추가해주다보면 데이터가 섞일 것 같은데 순서 보장이 되는지 궁금합니다!

test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data.viewDataviewData는 다른 데이터라서 상관없을 것 같습니다~!

@@ -38,12 +38,13 @@ function calculateRange(
let start = findIndexByPosition(offsets, scrollPos);
let end = findIndexByPosition(offsets, scrollPos + totalSize) + 1;
const { filteredRawData, sortState, pageRowRange } = data;
const dataLength = filteredRawData.length;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filteredRawDatanull이나 undefined 처리되는 경우는 없나요~?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵~!필터 조건이 없는 경우는 rawData와 항상 동일하기 때문에 없습니다

Copy link
Member

@seonim-ryu seonim-ryu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[5/21] 에러를 잡기 위해 많은 부분 수정하시느라 고생 많으셨습니다 ㅜㅜ

cy.getCell(0, 'name').should('exist');
cy.getCell(1, 'name').should('not.exist');

cy.getRowHeaderCell(0, '_checked')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier 버전을 올리면 이런것들이 한줄로 표현이 될텐데..언제 한번 날을 잡고 전체적으로 올려도 좋을 것 같네요

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 안그래도 하루 잡고 cypress랑 storybook 도 전부 같이 올릴 예정입니다.

return;
}

Object.keys(prevRowSpanMap).forEach(columnName => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

생각해보니까..저희 forEachObject라는 메서드가 있었는데.. 전체를 찾아보니까 별로 사용하는곳이 없네요///

Copy link
Contributor Author

@js87zz js87zz May 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사실 이런 케이스는 성능은 크게 상관없을 것 같은데 아무래도 Object.keys를 사용하는게 더 빠르기도 하고 이 함수를 써도 코드가 많이 줄거나 그렇지 않기 때문에 더 안 쓰게 된 것 같긴하네요. forEachObject 내부에서 Object.keys를 좀더 편하게 쓰도록 랩핑하는 정도로 변경하면 될 것같은데 그럼 별로 이 유틸함수의 의미가 없어지기도 하고 추후 제거해도 될 것 같네요

Copy link
Member

@jung-han jung-han left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

완료입니다!

@js87zz js87zz changed the title fix: script error is caused by calling removeCheckedRows API fix: script error is caused by calling removeCheckedRows API(#1053) May 21, 2020
@js87zz js87zz force-pushed the fix/removeCheckedRows-script-error branch from a03b074 to 88168e2 Compare May 22, 2020 07:32
@js87zz js87zz merged commit 0875404 into master May 22, 2020
@js87zz js87zz deleted the fix/removeCheckedRows-script-error branch May 22, 2020 08:09
@js87zz js87zz restored the fix/removeCheckedRows-script-error branch May 22, 2020 08:09
@js87zz js87zz deleted the fix/removeCheckedRows-script-error branch May 22, 2020 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants