fix: geçmiş arşiv kayıtları ana ekranı çökertiyordu
- SummaryCards/TenderList/DailyBulletin/ResultSearch/TenderCalendar: eklenmeZamani, baslik, kurum, ikn, tarih alanlarına güvenli erişim (arşiv kayıtlarında bu alanlar bulunmuyordu → TypeError, boş ekran) - history-store: arşiv kayıtlarına arayüzün beklediği varsayılan alanlar
This commit is contained in:
@@ -126,6 +126,20 @@ function rowToTender(r) {
|
|||||||
gecerliTeklifSayisi: r.gecerli_teklif_sayisi,
|
gecerliTeklifSayisi: r.gecerli_teklif_sayisi,
|
||||||
durum: 'Sonuçlandı',
|
durum: 'Sonuçlandı',
|
||||||
items: [],
|
items: [],
|
||||||
|
// Arayüzün beklediği alanlar (geçmiş kayıtta karşılığı yok — güvenli varsayılan)
|
||||||
|
eklenmeZamani: 'arşivden',
|
||||||
|
isYeni: false,
|
||||||
|
aciliyetBadge: null,
|
||||||
|
usul: r.ihale_tipi || 'İhale',
|
||||||
|
kurumTipi: '',
|
||||||
|
brans: '',
|
||||||
|
bolge: '',
|
||||||
|
aciklama: '',
|
||||||
|
yeterlikKriterleri: [],
|
||||||
|
kanbanStatus: null,
|
||||||
|
atananPersonel: null,
|
||||||
|
takipte: false,
|
||||||
|
incelendi: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export const SummaryCards = () => {
|
|||||||
const { tenders, quickFilter, setQuickFilter, setActiveTab } = useApp();
|
const { tenders, quickFilter, setQuickFilter, setActiveTab } = useApp();
|
||||||
|
|
||||||
const activeCount = tenders.filter(t => t.durum === 'Aktif').length;
|
const activeCount = tenders.filter(t => t.durum === 'Aktif').length;
|
||||||
const todayCount = tenders.filter(t => t.eklenmeZamani.includes('önce') || t.eklenmeZamani.includes('az')).length;
|
const todayCount = tenders.filter(t => (t.eklenmeZamani || '').includes('önce') || (t.eklenmeZamani || '').includes('az')).length;
|
||||||
const trackedCount = tenders.filter(t => t.takipte).length;
|
const trackedCount = tenders.filter(t => t.takipte).length;
|
||||||
const sinceLastLoginCount = 14; // Mocked counter
|
const sinceLastLoginCount = 14; // Mocked counter
|
||||||
const unreadCount = tenders.filter(t => !t.incelendi).length;
|
const unreadCount = tenders.filter(t => !t.incelendi).length;
|
||||||
|
|||||||
@@ -27,17 +27,17 @@ export const TenderList = () => {
|
|||||||
// Search Query
|
// Search Query
|
||||||
if (searchQuery) {
|
if (searchQuery) {
|
||||||
const q = searchQuery.toLowerCase();
|
const q = searchQuery.toLowerCase();
|
||||||
const matchTitle = tender.baslik.toLowerCase().includes(q);
|
const matchTitle = (tender.baslik || '').toLowerCase().includes(q);
|
||||||
const matchKurum = tender.kurum.toLowerCase().includes(q);
|
const matchKurum = (tender.kurum || '').toLowerCase().includes(q);
|
||||||
const matchIkn = tender.ikn.toLowerCase().includes(q);
|
const matchIkn = (tender.ikn || '').toLowerCase().includes(q);
|
||||||
const matchItems = tender.items && tender.items.some(i => i.ad.toLowerCase().includes(q));
|
const matchItems = tender.items && tender.items.some(i => (i.ad || '').toLowerCase().includes(q));
|
||||||
if (!matchTitle && !matchKurum && !matchIkn && !matchItems) return false;
|
if (!matchTitle && !matchKurum && !matchIkn && !matchItems) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quick Filter
|
// Quick Filter
|
||||||
if (quickFilter === 'favori_kurumlar' && !(favoriteKurumlar || []).includes((tender.kurum || '').trim())) return false;
|
if (quickFilter === 'favori_kurumlar' && !(favoriteKurumlar || []).includes((tender.kurum || '').trim())) return false;
|
||||||
if (quickFilter === 'dogrudan_temin' && tender.alimTuru !== 'Doğrudan Temin') return false;
|
if (quickFilter === 'dogrudan_temin' && tender.alimTuru !== 'Doğrudan Temin') return false;
|
||||||
if (quickFilter === 'bugun_eklenenler' && !(tender.eklenmeZamani.includes('önce') || tender.eklenmeZamani.includes('az'))) return false;
|
if (quickFilter === 'bugun_eklenenler' && !((tender.eklenmeZamani || '').includes('önce') || (tender.eklenmeZamani || '').includes('az'))) return false;
|
||||||
if (quickFilter === 'incelenenler' && !tender.incelendi) return false;
|
if (quickFilter === 'incelenenler' && !tender.incelendi) return false;
|
||||||
if (quickFilter === 'incelenmedi' && tender.incelendi) return false;
|
if (quickFilter === 'incelenmedi' && tender.incelendi) return false;
|
||||||
if (quickFilter === 'takiptekiler' && !tender.takipte) return false;
|
if (quickFilter === 'takiptekiler' && !tender.takipte) return false;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export const DailyBulletin = () => {
|
|||||||
const { tenders, setActiveTenderDetail } = useApp();
|
const { tenders, setActiveTenderDetail } = useApp();
|
||||||
|
|
||||||
const todayStr = '10.08.2026';
|
const todayStr = '10.08.2026';
|
||||||
const todayTenders = tenders.filter(t => t.tarih === todayStr || t.eklenmeZamani.includes('az') || t.eklenmeZamani.includes('önce'));
|
const todayTenders = tenders.filter(t => t.tarih === todayStr || (t.eklenmeZamani || '').includes('az') || (t.eklenmeZamani || '').includes('önce'));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4 my-4 animate-fade-in">
|
<div className="space-y-4 my-4 animate-fade-in">
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ export const ResultSearch = () => {
|
|||||||
if (!query) return true;
|
if (!query) return true;
|
||||||
const q = query.toLowerCase();
|
const q = query.toLowerCase();
|
||||||
return (
|
return (
|
||||||
t.baslik.toLowerCase().includes(q) ||
|
(t.baslik || '').toLowerCase().includes(q) ||
|
||||||
t.ikn.toLowerCase().includes(q) ||
|
(t.ikn || '').toLowerCase().includes(q) ||
|
||||||
t.kurum.toLowerCase().includes(q) ||
|
(t.kurum || '').toLowerCase().includes(q) ||
|
||||||
(t.kazananFirma && t.kazananFirma.toLowerCase().includes(q))
|
(t.kazananFirma && t.kazananFirma.toLowerCase().includes(q))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const TenderCalendar = () => {
|
|||||||
{ date: '15.08.2026', label: 'Cumartesi', count: 1 }
|
{ date: '15.08.2026', label: 'Cumartesi', count: 1 }
|
||||||
];
|
];
|
||||||
|
|
||||||
const dayTenders = tenders.filter(t => t.tarih === selectedDay || (selectedDay === '10.08.2026' && t.tarih.includes('10')));
|
const dayTenders = tenders.filter(t => t.tarih === selectedDay || (selectedDay === '10.08.2026' && (t.tarih || '').includes('10')));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4 my-4 animate-fade-in">
|
<div className="space-y-4 my-4 animate-fade-in">
|
||||||
|
|||||||
Reference in New Issue
Block a user