feat: [notification] 알림 사운드 추가 + 설정 개선
- default.wav, sam_voice.wav 알림 사운드 추가 - 알림 설정 UI 개선 - 테넌트 모듈 분리 계획/멀티테넌트 문서 업데이트
This commit is contained in:
@@ -28,14 +28,27 @@ import { SOUND_OPTIONS, DEFAULT_ITEM_VISIBILITY } from './types';
|
||||
import { saveNotificationSettings } from './actions';
|
||||
import { ItemSettingsDialog } from './ItemSettingsDialog';
|
||||
|
||||
// 미리듣기 함수
|
||||
// 미리듣기 - Audio API 재생
|
||||
let previewAudio: HTMLAudioElement | null = null;
|
||||
|
||||
function playPreviewSound(soundType: SoundType) {
|
||||
if (soundType === 'mute') {
|
||||
toast.info('무음으로 설정되어 있습니다.');
|
||||
return;
|
||||
}
|
||||
const soundName = soundType === 'default' ? '기본 알림음' : 'SAM 보이스';
|
||||
toast.info(`${soundName} 미리듣기`);
|
||||
|
||||
// 이전 재생 중지
|
||||
if (previewAudio) {
|
||||
previewAudio.pause();
|
||||
previewAudio = null;
|
||||
}
|
||||
|
||||
const soundFile = soundType === 'sam_voice' ? 'sam_voice.wav' : 'default.wav';
|
||||
previewAudio = new Audio(`/sounds/${soundFile}`);
|
||||
previewAudio.play().catch(() => {
|
||||
const soundName = soundType === 'default' ? '기본 알림음' : 'SAM 보이스';
|
||||
toast.info(`${soundName} 미리듣기 (음원 파일 준비 중)`);
|
||||
});
|
||||
}
|
||||
|
||||
// 알림 항목 컴포넌트
|
||||
|
||||
@@ -1,36 +1,12 @@
|
||||
/**
|
||||
* 알림 설정 타입 정의
|
||||
*
|
||||
* ========================================
|
||||
* [2026-01-05] 백엔드 API 수정 필요 사항
|
||||
* ========================================
|
||||
* API 응답 구조: { enabled, email, soundType } per item
|
||||
* soundType: 'default' | 'sam_voice' | 'mute'
|
||||
*
|
||||
* 1. NotificationItem에 soundType 필드 추가
|
||||
* - 기존: { enabled: boolean, email: boolean }
|
||||
* - 변경: { enabled: boolean, email: boolean, soundType: 'default' | 'sam_voice' | 'mute' }
|
||||
*
|
||||
* 2. OrderNotificationSettings에 approvalRequest 항목 추가
|
||||
* - 기존: { salesOrder, purchaseOrder }
|
||||
* - 변경: { salesOrder, purchaseOrder, approvalRequest }
|
||||
*
|
||||
* 3. API 응답 예시:
|
||||
* {
|
||||
* "notice": {
|
||||
* "enabled": true,
|
||||
* "notice": { "enabled": true, "email": false, "soundType": "default" },
|
||||
* "event": { "enabled": true, "email": true, "soundType": "sam_voice" }
|
||||
* },
|
||||
* "order": {
|
||||
* "enabled": true,
|
||||
* "salesOrder": { ... },
|
||||
* "purchaseOrder": { ... },
|
||||
* "approvalRequest": { "enabled": false, "email": false, "soundType": "default" } // 새로 추가
|
||||
* }
|
||||
* }
|
||||
* ========================================
|
||||
* [2026-03-18] soundType API 연동 완료
|
||||
*/
|
||||
|
||||
// 알림 소리 타입 (NEW: 2026-01-05)
|
||||
export type SoundType = 'default' | 'sam_voice' | 'mute';
|
||||
|
||||
// 알림 소리 옵션
|
||||
|
||||
Reference in New Issue
Block a user