Merge branch 'ConstructionConsent/modify-faulty-view' into 'master'

modified faulty view

See merge request fronk/thetool!1374
This commit is contained in:
Luca Haid
2025-05-20 12:10:32 +00:00
2 changed files with 95 additions and 41 deletions
@@ -3,12 +3,12 @@ Vue.component('construction-consent-faulty-entries', {
template: `
<div>
<tt-card>
<tt-table :data="window['TT_CONFIG']['FAULTY_ENTRIES']" :config="FaultyEntriesTableConfig" excel-export>
<template v-slot:project_name="{ row }">
{{ row.project_name }}
</template>
<template v-slot:building_info="{ row }">
<div>
<strong>Name:</strong> {{ row.building_name || 'N/A' }} <br>
@@ -31,7 +31,7 @@ Vue.component('construction-consent-faulty-entries', {
</div>
</div>
</template>
<template v-slot:address_info="{ row }">
<div>
<div>
@@ -39,19 +39,24 @@ Vue.component('construction-consent-faulty-entries', {
</div>
<div :class="{'text-danger': row.errors.includes('zip')}">
<strong>PLZ:</strong> {{ row.zip || '⚠️ Fehlt' }}
<span v-if="row.errors.includes('zip') && isAustria(row)" class="badge badge-warning">
Muss 4-stellig sein
<span v-if="row.errors.includes('zip')" class="badge badge-warning">
<span v-if="isAustria(row)">Muss 4-stellig sein</span>
<span v-else-if="isGermany(row)">Muss 5-stellig sein</span>
<span v-else>Ungültig</span>
</span>
</div>
<div :class="{'text-danger': row.errors.includes('city')}">
<strong>Stadt:</strong> {{ row.city || '⚠️ Fehlt' }}
</div>
<div>
<div :class="{'text-danger': row.errors.includes('country')}">
<strong>Land:</strong> {{ row.country || 'N/A' }}
<span v-if="row.errors.includes('country')" class="badge badge-warning">
Keine Zahlen erlaubt
</span>
</div>
</div>
</template>
<template v-slot:contact_info="{ row }">
<div>
<div>
@@ -62,7 +67,7 @@ Vue.component('construction-consent-faulty-entries', {
</div>
</div>
</template>
<template v-slot:status="{ row }">
<span :class="getStatusBadgeClass(row.status)">
{{ formatStatus(row.status) }}
@@ -72,7 +77,7 @@ Vue.component('construction-consent-faulty-entries', {
{{ formatResult(row.result) }}
</span>
</template>
<template v-slot:errors="{ row }">
<div class="error-list">
<ul class="mb-0 pl-3">
@@ -82,7 +87,7 @@ Vue.component('construction-consent-faulty-entries', {
</ul>
</div>
</template>
<template v-slot:actions="{ row }">
<div class="btn-group btn-group-sm">
<a :href="window['TT_CONFIG']['BASE_URL'] + '/ConstructionConsent/View?id=' + row.consent_id + '&highlight_owner_id=' + row.owner_id"
@@ -160,7 +165,8 @@ Vue.component('construction-consent-faulty-entries', {
'firstname': 'Fehlender Vorname',
'lastname': 'Fehlender Nachname',
'city': 'Fehlende Stadt',
'zip': 'Ungültige PLZ'
'zip': 'Ungültige PLZ',
'country': 'Ungültiges Land (enthält Zahlen)'
};
return errors[error] || error;
},
@@ -184,7 +190,12 @@ Vue.component('construction-consent-faulty-entries', {
return classes[result] || 'badge badge-secondary';
},
isAustria(row) {
return row.country && (row.country.toLowerCase() === 'österreich' || row.country.toLowerCase() === 'austria');
const country = (row.country || '').toLowerCase();
return country === 'österreich' || country === 'austria' || country === '';
},
isGermany(row) {
const country = (row.country || '').toLowerCase();
return country === 'deutschland' || country === 'germany';
},
filterByProject() {
// Redirect to same page with project filter