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

[FEAT] 공홈 어드민 QA용 매직버튼 만들었어요 #197

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

lydiacho
Copy link
Member

@lydiacho lydiacho commented Jan 16, 2025

✨ 구현 기능 명세

QA할 때 매번 리로드되면 데이터 날아가고 폼 다 채워야하는게 너무 끔찍해서 제가 쓰려고 불친절한 매직버튼 만들었어요
요구사항 없던거라 진짜 대충 만들었으니 QA 끝나면 다시 지우든 아니면 괜찮다 싶으면 좀 다듬어서 살리든 하면 될 것 같아용

✅ PR Point

주 기능 : 폼에 채운 데이터 임시 저장 및 복구 가능

기능 설명 :

  • 임시저장 : 현재 폼에 채워져있는 내용들을 로컬스토리지에 임시저장
  • 불러오기 : 로컬 스토리지에 저장되어있는 폼 데이터를 불러와서 폼에 입혀요
  • 이미지 채우기 : 이미지File은 로컬스토리지로 저장 및 복구가 안됩니다.(할람할이지만..) 그래서 이미지는 따로 채워주어야 하는데, 이미지만 하나하나 넣는것도 너무 귀찮은 과정이라서 첫 이미지인 소개탭배너만 넣으면, 나머지 이미지 폼(임원진 프로필, 지원하기 헤더 등등)은 다 소개탭 배너 이미지로 밀어주게 만들었어요. (다른탭 갔다오면 미리보기도 다 채워짐)
  • 데이터삭제 : 로컬 스토리지 데이터를 날려줍니다

활용하는 법 정리

  1. 일단 처음엔 폼 내용 다 채운다 (이미지는 다 안채워도됨. 어차피 임시저장 제대로 안됨)
  2. 임시저장 누르기
    ----- 재접속 / 리로드 -----
  3. 불러오기 누르기
  4. 이미지폼은 하나하나 다시 채우거나 or 소개탭헤더만 채우고 이미지 채우기 버튼 누르기
  5. 배포 (이미지 링크 잘못됐을 경우 알럿이 뜸. 그럼 다시 이미지 채우기 누르고 배포)

머지후에 이정이한테도 불친절한사용설명서 알려줄 예정입니답 (좀더 빨리만들걸)

@lydiacho lydiacho self-assigned this Jan 16, 2025
Copy link

height bot commented Jan 16, 2025

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@lydiacho lydiacho force-pushed the feature-org-magic-button branch from 40d51a9 to 25ff92e Compare January 16, 2025 17:24
Copy link

cloudflare-workers-and-pages bot commented Jan 16, 2025

Deploying sopt-admin with  Cloudflare Pages  Cloudflare Pages

Latest commit: 54660cc
Status: ✅  Deploy successful!
Preview URL: https://7d3548d4.sopt-admin.pages.dev
Branch Preview URL: https://feature-org-magic-button.sopt-admin.pages.dev

View logs

Copy link
Member

@eonseok-jeon eonseok-jeon left a comment

Choose a reason for hiding this comment

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

이미지 채우기 : 이미지File은 로컬스토리지로 저장 및 복구가 안됩니다.

되는 거 같은데요?

2025-01-21.10.30.41.mov

이게 아닌감?

return (
<>
{process.env.NODE_ENV === 'development' && (
Copy link
Member

Choose a reason for hiding this comment

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

너무 괜찮은데용? 실제에 반영해도 좋을 거 같긴 합니다~
(물론 QA 더 해야겠지만,,)

Copy link
Member Author

Choose a reason for hiding this comment

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

인정합니당,, 일단 이정이 한번 경험시켜보고(?) 얘기해보도록 해여


if (type === 'IMAGE') {
const headerImage = getValues('headerImageFileName');
if (!(headerImage.file instanceof File)) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (!(headerImage.file instanceof File)) {
if (!(headerImage?.file instanceof File)) {

? 없어서 이미지 채우기 눌렀을 때 에러 떠요

Copy link
Member Author

@lydiacho lydiacho Jan 27, 2025

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

확인해주시면 머지할게여!

Copy link
Member

Choose a reason for hiding this comment

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

확인했습니다! 고생하셨어여 ◡̈

if (!data) {
alert('저장된 데이터가 없음ㅠ');
} else {
reset(JSON.parse(data));
Copy link
Member

Choose a reason for hiding this comment

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

오홍 대박이네여

@lydiacho
Copy link
Member Author

@eonseok-jeon 그 이미지는 previewURL대로 잘 채워지는데 File 객체가 정상적으로 저장/복구 되지 않아서 그대로 배포할 경우 공홈에서 보면 엑박이 떠요! ㅠㅡㅜ

@lydiacho lydiacho merged commit 34f4dc6 into dev Jan 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants