diff --git a/.gitignore b/.gitignore index 82d94f5..a0a7c90 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts +.last_deployed_commit diff --git a/auto_deploy_staging.sh b/auto_deploy_staging.sh index ab3777a..2c1a43d 100755 --- a/auto_deploy_staging.sh +++ b/auto_deploy_staging.sh @@ -22,8 +22,16 @@ MASTER_COMMITS=$(git rev-list --count HEAD..origin/master 2>/dev/null || echo 0) # Check 2: Commits ahead on origin/staging STAGING_COMMITS=$(git rev-list --count HEAD..origin/staging 2>/dev/null || echo 0) +DEPLOYED_COMMIT_FILE="$PROJECT_DIR/.last_deployed_commit" +LAST_DEPLOYED=$(cat "$DEPLOYED_COMMIT_FILE" 2>/dev/null || echo "") +CURRENT_HEAD=$(git rev-parse HEAD) + NEED_BUILD=0 +if [ "$CURRENT_HEAD" != "$LAST_DEPLOYED" ]; then + NEED_BUILD=1 +fi + if [ "$MASTER_COMMITS" -gt 0 ]; then echo "$LOG_TAG 🚀 Detected $MASTER_COMMITS new commit(s) on origin/master!" git log --oneline HEAD..origin/master @@ -57,6 +65,7 @@ sleep 5 HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:5561/healthz || echo "000") if [ "$HTTP_STATUS" -eq 200 ]; then + echo "$(git rev-parse HEAD)" > "$DEPLOYED_COMMIT_FILE" echo "$LOG_TAG ✅ SUCCESS: Marriage staging updated and healthy at commit $(git rev-parse --short HEAD) (HTTP 200 OK)." else echo "$LOG_TAG ⚠️ Health probe returned HTTP status $HTTP_STATUS" diff --git a/src/app/[lang]/preview-upload/page.tsx b/src/app/[lang]/preview-upload/page.tsx index 5fa986a..0c876e9 100644 --- a/src/app/[lang]/preview-upload/page.tsx +++ b/src/app/[lang]/preview-upload/page.tsx @@ -17,25 +17,20 @@ const mockQuestion: QuestionField = { description: "", tooltip: "Supporting documents for identity verification", extras: { + placeHolder: "", + range: [0, 0], options: [".pdf", ".jpg", ".jpeg", ".png"], }, options: [], }; export default function PreviewUploadPage() { - const initialAnswers = useMemo( - () => ({ - "documents_verification.other_supporting_documents": [ - "/media/tmp/MKROrQ-Screenshot_2026.png", - "/media/tmp/0UKhA-Screenshot_2026.png", - ], - }), - [], - ); - return ( - - + +
{/* Top Bar */}
diff --git a/src/app/preview-upload/page.tsx b/src/app/preview-upload/page.tsx index ed33874..031aef4 100644 --- a/src/app/preview-upload/page.tsx +++ b/src/app/preview-upload/page.tsx @@ -17,6 +17,8 @@ const mockQuestion: QuestionField = { description: "", tooltip: "Supporting documents for identity verification", extras: { + placeHolder: "", + range: [0, 0], options: [".pdf", ".jpg", ".jpeg", ".png"], }, options: [], @@ -38,7 +40,10 @@ const mockDocs = [ export default function RootPreviewUploadPage() { return ( - +
{/* Top Bar */}
diff --git a/src/app/questions-list/[slug]/question-detail-client.tsx b/src/app/questions-list/[slug]/question-detail-client.tsx index d14beb3..4533518 100644 --- a/src/app/questions-list/[slug]/question-detail-client.tsx +++ b/src/app/questions-list/[slug]/question-detail-client.tsx @@ -464,6 +464,7 @@ export default function QuestionDetailClient({ "Very High", ]; const defaultLabels = locale === "fa" ? DEFAULT_LABELS_FA : DEFAULT_LABELS_EN; + const tMap = t as Record; return questionsList .filter((q: any) => q && (q.question_number || q.id) && q.text) @@ -474,9 +475,9 @@ export default function QuestionDetailClient({ ? rawOptions.map((opt: any, idx: number) => { const score = idx + 1; if (typeof opt === "string") { - return { id: String(score), value: score, label: t[opt] || opt }; + return { id: String(score), value: score, label: tMap[opt] || opt }; } - const defaultLabel = t[DEFAULT_LABELS_EN[idx]] || defaultLabels[idx] || String(score); + const defaultLabel = tMap[DEFAULT_LABELS_EN[idx]] || defaultLabels[idx] || String(score); return { id: String(opt.id || opt.value || score), value: typeof opt.value === "number" ? opt.value : score, @@ -488,7 +489,7 @@ export default function QuestionDetailClient({ : [1, 2, 3, 4, 5].map((score, idx) => ({ id: String(score), value: score, - label: t[DEFAULT_LABELS_EN[idx]] || defaultLabels[idx] || String(score), + label: tMap[DEFAULT_LABELS_EN[idx]] || defaultLabels[idx] || String(score), })); return {