보안 감사 결과 CRITICAL 2건, HIGH 5건 발견 → 수정 완료 + 자동화 구축. [보안 수정] - issue-view.js: 하드코딩 비밀번호 → crypto.getRandomValues() 랜덤 생성 - pushSubscriptionController.js: ntfy 비밀번호 → process.env.NTFY_SUB_PASSWORD - DEPLOY-GUIDE.md/PROGRESS.md/migration SQL: 평문 비밀번호 → placeholder - docker-compose.yml/.env.example: NTFY_SUB_PASSWORD 환경변수 추가 [보안 강제 시스템 - 신규] - scripts/security-scan.sh: 8개 규칙 (CRITICAL 2, HIGH 4, MEDIUM 2) 3모드(staged/all/diff), severity, .securityignore, MEDIUM 임계값 - .githooks/pre-commit: 로컬 빠른 피드백 - .githooks/pre-receive-server.sh: Gitea 서버 최종 차단 bypass 거버넌스([SECURITY-BYPASS: 사유] + 사용자 제한 + 로그) - SECURITY-CHECKLIST.md: 10개 카테고리 자동/수동 구분 - docs/SECURITY-GUIDE.md: 운영자 가이드 (워크플로우, bypass, FAQ) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
89 lines
2.6 KiB
JavaScript
89 lines
2.6 KiB
JavaScript
/**
|
|
* issue-helpers.js — 부적합 관리 공통 유틸리티 함수
|
|
* dashboard, management, inbox, archive 등에서 공유
|
|
*/
|
|
|
|
function getDepartmentText(department) {
|
|
const departments = {
|
|
'production': '생산',
|
|
'quality': '품질',
|
|
'purchasing': '구매',
|
|
'design': '설계',
|
|
'sales': '영업'
|
|
};
|
|
return department ? departments[department] || department : '-';
|
|
}
|
|
|
|
function getCategoryText(category) {
|
|
const categoryMap = {
|
|
'material_missing': '자재 누락',
|
|
'design_error': '설계 오류',
|
|
'incoming_defect': '반입 불량',
|
|
'inspection_miss': '검사 누락',
|
|
'quality': '품질',
|
|
'safety': '안전',
|
|
'environment': '환경',
|
|
'process': '공정',
|
|
'equipment': '장비',
|
|
'material': '자재',
|
|
'etc': '기타'
|
|
};
|
|
return categoryMap[category] || category || '-';
|
|
}
|
|
|
|
function getStatusBadgeClass(status) {
|
|
const statusMap = {
|
|
'new': 'new',
|
|
'processing': 'processing',
|
|
'pending': 'pending',
|
|
'completed': 'completed',
|
|
'archived': 'archived',
|
|
'cancelled': 'cancelled'
|
|
};
|
|
return statusMap[status] || 'new';
|
|
}
|
|
|
|
function getStatusText(status) {
|
|
const statusMap = {
|
|
'new': '새 부적합',
|
|
'processing': '처리 중',
|
|
'pending': '대기 중',
|
|
'completed': '완료',
|
|
'archived': '보관',
|
|
'cancelled': '취소'
|
|
};
|
|
return statusMap[status] || status;
|
|
}
|
|
|
|
function getIssueTitle(issue) {
|
|
const description = issue.description || issue.final_description || '';
|
|
const lines = description.split('\n');
|
|
return lines[0] || '부적합명 없음';
|
|
}
|
|
|
|
function getIssueDetail(issue) {
|
|
const description = issue.description || issue.final_description || '';
|
|
const lines = description.split('\n');
|
|
return lines.slice(1).join('\n') || '상세 내용 없음';
|
|
}
|
|
|
|
function getDisposalReasonText(reason) {
|
|
const reasonMap = {
|
|
'duplicate': '중복',
|
|
'invalid_report': '잘못된 신고',
|
|
'not_applicable': '해당 없음',
|
|
'spam': '스팸/오류',
|
|
'custom': '직접 입력'
|
|
};
|
|
return reasonMap[reason] || reason;
|
|
}
|
|
|
|
function getReporterNames(issue) {
|
|
let names = [issue.reporter?.full_name || issue.reporter?.username || '알 수 없음'];
|
|
if (issue.duplicate_reporters && issue.duplicate_reporters.length > 0) {
|
|
const duplicateNames = issue.duplicate_reporters.map(r => r.full_name || r.username);
|
|
names = names.concat(duplicateNames);
|
|
}
|
|
return names.join(', ');
|
|
}
|