fix(competitor-analysis): final migration fixes and documentation updates

This commit is contained in:
2026-05-15 21:06:29 +00:00
parent a367a72c00
commit ff045c90d0
3 changed files with 40 additions and 6 deletions

View File

@@ -202,10 +202,7 @@ function App() {
const childrenNames = parts[2] ? parts[2].trim() : "Euren Kindern";
const kindergartenName = selectedJob
? selectedJob.name
.replace(/\(JOB\d+\)\s*/, '')
.replace(/Kindergarten\s+/gi, '') // Remove "Kindergarten" prefix
.replace(/\s+\d{4}$/, '') // Remove year at the end
.trim()
.replace(/\(JOB\d+\)/gi, '').replace(/Kindergarten/gi, '').replace(/\d{4}/g, '').replace(/\s+/g, ' ').trim()
: "dem Kindergarten";
let subject = "Eure Bilder vom Kindergarten-Fotoshooting";
@@ -227,7 +224,7 @@ function App() {
return reminderResult.map(row => {
let einrichtung = selectedJob
? selectedJob.name.replace(/\(JOB\d+\)\s*/, '').replace(/Kindergarten\s+/gi, '').replace(/\s+\d{4}$/, '').trim()
? .replace(/\(JOB\d+\)/gi, '').replace(/Kindergarten/gi, '').replace(/\d{4}/g, '').replace(/\s+/g, ' ').trim()
: "eurer Einrichtung";
let subject = emailSubject
.replace(/{Kindernamen}/g, row["Kindernamen"])
@@ -730,7 +727,7 @@ function App() {
const emailsToSend = reminderResult.map(row => {
let einrichtung = selectedJob
? selectedJob.name.replace(/\(JOB\d+\)\s*/, '').replace(/Kindergarten\s+/gi, '').replace(/\s+\d{4}$/, '').trim()
? .replace(/\(JOB\d+\)/gi, '').replace(/Kindergarten/gi, '').replace(/\d{4}/g, '').replace(/\s+/g, ' ').trim()
: "eurer Einrichtung";
let subject = emailSubject
.replace(/{Kindernamen}/g, row["Kindernamen"])

18
patch_cleaning.py Normal file
View File

@@ -0,0 +1,18 @@
import sys
with open('fotograf-de-scraper/frontend/src/App.tsx', 'r') as f:
content = f.read()
# Robust cleaning logic
new_cleaning = ".replace(/\\(JOB\\d+\\)/gi, '').replace(/Kindergarten/gi, '').replace(/\\d{4}/g, '').replace(/\\s+/g, ' ').trim()"
# Old cleaning pattern (multi-line)
old_pattern = """selectedJob.name.replace(/\\(JOB\\d+\\)\\s*/, '').replace(/Kindergarten\\s+/gi, '').replace(/\\s+\\d{4}$/, '').trim()"""
if old_pattern in content:
content = content.replace(old_pattern, new_cleaning)
with open('fotograf-de-scraper/frontend/src/App.tsx', 'w') as f:
f.write(content)
print("Cleaning logic updated")
else:
print("Old cleaning pattern not found")

19
patch_cleaning_release.py Normal file
View File

@@ -0,0 +1,19 @@
import sys
with open('fotograf-de-scraper/frontend/src/App.tsx', 'r') as f:
content = f.read()
new_cleaning = ".replace(/\\(JOB\\d+\\)/gi, '').replace(/Kindergarten/gi, '').replace(/\\d{4}/g, '').replace(/\\s+/g, ' ').trim()"
old_pattern = """.replace(/\\(JOB\\d+\\)\\s*/, '')
.replace(/Kindergarten\\s+/gi, '') // Remove "Kindergarten" prefix
.replace(/\\s+\\d{4}$/, '') // Remove year at the end
.trim()"""
if old_pattern in content:
content = content.replace(old_pattern, new_cleaning)
with open('fotograf-de-scraper/frontend/src/App.tsx', 'w') as f:
f.write(content)
print("Cleaning logic updated for release feature")
else:
print("Old cleaning pattern not found")