fix(page): 첨부 업로드 검증 실패 시 사용자 안내 토스트 노출
- 페이지 폼 FileUploader 에 onUploadError→toast 연결 (용량/확장자 초과 안내) - 사용자 템플릿(sirsoft-basic) 개수 초과 시 onUploadError 발화 추가 (silent 무시 방지) - 개수 초과 문구를 이미지 전용에서 일반 파일 범용 공통 메시지로 통일 (ko/en/ja)
This commit is contained in:
1 parent
2473ca7242
commit
98989e3c2c
23 files changed
+6142
-5945
No files matched your search
@@ -20,6 +20,7 @@
|
||||
- 페이지 관리 목록에서 아주 긴 검색어를 입력하면 오류 화면이 뜨던 문제를 수정했습니다 — 검색어 길이를 100자로 제한해 안내 메시지로 처리합니다.
|
||||
- 페이지 상세의 버전 이력에서 "변경내역" 항목이 `title`·`content` 같은 영문 필드명으로 표시되던 문제를 수정했습니다 — 이제 "제목", "내용", "SEO 정보" 처럼 알아보기 쉬운 이름으로 표시됩니다.
|
||||
- 관리자가 발행 전 페이지를 사용자 화면에서 미리 확인할 수 있게 되었습니다. 미리보기 화면에는 미발행 상태임을 알리는 안내가 표시되며, 비로그인 사용자와 일반 회원에게는 이전과 동일하게 노출되지 않습니다.
|
||||
- 페이지 첨부파일을 올릴 때 허용 용량을 초과하거나 허용되지 않은 형식의 파일을 선택하면 안내 메시지가 표시됩니다 — 이전에는 업로드가 조용히 막히기만 하고 이유를 알 수 없었습니다.
|
||||
|
||||
## [1.0.0] - 2026-07-01
|
||||
|
||||
|
||||
+15
@@ -638,6 +638,21 @@ describe('admin_page_form.json', () => {
|
||||
expect(onReorder.params['form.attachments']).toContain('$args[0]');
|
||||
});
|
||||
|
||||
// ─── 첨부 검증 실패 안내 (용량/확장자/개수 초과 toast) ───
|
||||
|
||||
it('FileUploader 에 onUploadError → toast 액션이 있어 검증 실패를 사용자에게 안내함', () => {
|
||||
// 회귀 배경: onUploadError 핸들러 부재로 용량/확장자/개수 초과 시 백엔드/클라이언트
|
||||
// 차단은 되나 toast 안내가 없어 사용자가 이유를 알 수 없었음.
|
||||
const uploaders = findComponentsByName(adminPageForm, 'FileUploader');
|
||||
const actions = uploaders[0].actions ?? [];
|
||||
const onUploadError = actions.find((a: any) => a.event === 'onUploadError');
|
||||
expect(onUploadError, 'onUploadError 액션').toBeDefined();
|
||||
expect(onUploadError.handler).toBe('toast');
|
||||
expect(onUploadError.params.type).toBe('error');
|
||||
// 훅이 만든 에러 메시지 문자열($args[0])을 그대로 표시
|
||||
expect(onUploadError.params.message).toContain('$args[0]');
|
||||
});
|
||||
|
||||
it('FileUploader reorder 엔드포인트가 수정 모드(route.id)에서만 활성화됨 (생성 모드는 temp 첨부라 reorder 불가)', () => {
|
||||
const uploaders = findComponentsByName(adminPageForm, 'FileUploader');
|
||||
expect(uploaders[0].props.apiEndpoints.reorder).toContain('route?.id');
|
||||
|
||||
@@ -756,6 +756,15 @@
|
||||
"target": "local",
|
||||
"form.attachments": "{{(_local.form?.attachments ?? []).filter(item => (item.hash || item.id) !== $args[0])}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "업로드 검증 실패(용량/확장자/개수 초과 등) 시 사용자에게 toast 안내",
|
||||
"event": "onUploadError",
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"type": "error",
|
||||
"message": "{{$args[0]}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+10
-2
@@ -6,8 +6,11 @@
|
||||
# 무의미 조합이 다수 포함되므로 docblock @scenario 전수 마킹이 부적합하다.
|
||||
# 실제 회귀 가드는 test_files 의 통과 테스트가 결함별로 담당한다:
|
||||
# 6-1 → PageControllerTest(Feature) / 6-2 → PageAttachmentServiceTest(Unit) +
|
||||
# admin-page-layouts.test.ts(레이아웃 렌더) / 7 → admin-page-layouts.test.ts /
|
||||
# 12-2 → SeoPageCacheListenerTest(Unit) / 13 → admin-page-layouts.test.ts.
|
||||
# admin-page-layouts.test.ts(레이아웃 렌더) / 7(폼 잔존) → admin-page-layouts.test.ts /
|
||||
# 12-2 → SeoPageCacheListenerTest(Unit) / 13 → admin-page-layouts.test.ts /
|
||||
# 7(검증 안내 toast) → admin-page-layouts.test.ts(onUploadError→toast 핸들러 존재) +
|
||||
# FileUploaderLimit.test.ts(개수 초과 발화). upload_validation 축은 용량/확장자/개수/정상
|
||||
# 4값이나 용량·확장자는 컴포넌트 기존 검증이라 레이아웃 핸들러 존재로, 개수는 훅 단위로 커버.
|
||||
# E2E: 페이지 모듈에 Playwright 인프라를 이커머스와 동일 패턴으로 신설(config + page-auth/
|
||||
# page-seed fixture + playwright:seed-page stub)하고 spec 3건을 form_mode/upload_count/
|
||||
# page_change axis 와 1:1 매핑해 등록했으며, 대상 화면 data-testid 보강 전까지 skip placeholder
|
||||
@@ -60,6 +63,7 @@ axes:
|
||||
upload_count: [single, multiple]
|
||||
page_change: [create, update, delete, restore]
|
||||
cached_entry: [layout_tagged, url_only]
|
||||
upload_validation: [size_exceeded, ext_not_allowed, count_exceeded, valid]
|
||||
|
||||
effects:
|
||||
- admin_context_returns_admin_download_and_preview_url
|
||||
@@ -76,12 +80,16 @@ effects:
|
||||
- page_restore_invalidates_page_detail_seo_cache
|
||||
- page_restore_creates_new_version_and_preserves_history
|
||||
- page_version_changed_fields_render_localized_labels
|
||||
- attachment_size_or_ext_rejection_shows_error_toast
|
||||
- attachment_count_exceeded_shows_error_toast_and_truncates
|
||||
- valid_attachment_upload_shows_no_error_toast
|
||||
|
||||
test_files:
|
||||
- modules/_bundled/sirsoft-page/tests/Unit/Services/PageAttachmentServiceTest.php
|
||||
- modules/_bundled/sirsoft-page/tests/Feature/Admin/PageControllerTest.php
|
||||
- modules/_bundled/sirsoft-page/tests/Unit/Listeners/SeoPageCacheListenerTest.php
|
||||
- modules/_bundled/sirsoft-page/resources/js/__tests__/layouts/admin-page-layouts.test.ts
|
||||
- templates/_bundled/sirsoft-basic/src/components/composite/__tests__/FileUploaderLimit.test.ts
|
||||
- modules/_bundled/sirsoft-page/tests/Playwright/specs/admin/page-form-reset-on-route-switch.spec.ts
|
||||
- modules/_bundled/sirsoft-page/tests/Playwright/specs/admin/page-attachment-order.spec.ts
|
||||
- modules/_bundled/sirsoft-page/tests/Playwright/specs/admin/page-version-changed-fields-i18n.spec.ts
|
||||
|
||||
Reference in new issue
Block a user