feat: add admin_notes field to companies for internal admin notes
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Adds editable admin notes to company edit modal in admin panel, with visual indicator (pencil icon) in companies table. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a078cdb2dc
commit
893ccf7551
@ -192,7 +192,8 @@ def admin_company_get(company_id):
|
||||
'address_city': company.address_city,
|
||||
'address_street': company.address_street,
|
||||
'address_postal': company.address_postal,
|
||||
'data_quality': company.data_quality
|
||||
'data_quality': company.data_quality,
|
||||
'admin_notes': company.admin_notes
|
||||
}
|
||||
})
|
||||
finally:
|
||||
@ -251,6 +252,9 @@ def admin_company_update(company_id):
|
||||
if 'address_postal' in data:
|
||||
company.address_postal = data['address_postal'].strip() if data['address_postal'] else None
|
||||
|
||||
if 'admin_notes' in data:
|
||||
company.admin_notes = data['admin_notes'].strip() if data['admin_notes'] else None
|
||||
|
||||
company.last_updated = datetime.utcnow()
|
||||
db.commit()
|
||||
|
||||
|
||||
@ -784,6 +784,9 @@ class Company(Base):
|
||||
krs_representation = Column(Text) # Sposób reprezentacji spółki
|
||||
krs_activities = Column(PG_JSONB, default=[]) # Przedmiot działalności
|
||||
|
||||
# Admin notes (internal, not visible to users)
|
||||
admin_notes = Column(Text)
|
||||
|
||||
# Data source tracking
|
||||
data_source = Column(String(100))
|
||||
data_quality_score = Column(Integer)
|
||||
|
||||
8
database/migrations/072_company_admin_notes.sql
Normal file
8
database/migrations/072_company_admin_notes.sql
Normal file
@ -0,0 +1,8 @@
|
||||
-- Migration 072: Add admin_notes to companies
|
||||
-- Admin-only internal notes field, not visible to regular users
|
||||
-- Date: 2026-02-18
|
||||
|
||||
ALTER TABLE companies ADD COLUMN IF NOT EXISTS admin_notes TEXT;
|
||||
|
||||
-- Grant permissions
|
||||
GRANT ALL ON TABLE companies TO nordabiz_app;
|
||||
@ -521,7 +521,12 @@
|
||||
<td>{{ company.id }}</td>
|
||||
<td>
|
||||
<div class="company-info">
|
||||
<a href="{{ url_for('company_detail_by_slug', slug=company.slug) }}" class="company-name" target="_blank">{{ company.name }}</a>
|
||||
<div style="display: flex; align-items: center; gap: 6px;">
|
||||
<a href="{{ url_for('company_detail_by_slug', slug=company.slug) }}" class="company-name" target="_blank">{{ company.name }}</a>
|
||||
{% if company.admin_notes %}
|
||||
<span title="{{ company.admin_notes[:100] }}..." style="cursor: help; color: #f59e0b; font-size: 14px;">✎</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if company.address_city %}
|
||||
<span class="company-city">{{ company.address_city }}</span>
|
||||
{% endif %}
|
||||
@ -687,6 +692,10 @@
|
||||
<label class="form-label">Kod pocztowy</label>
|
||||
<input type="text" id="editPostal" class="form-control" maxlength="6">
|
||||
</div>
|
||||
<div class="form-group" style="margin-top: var(--spacing-lg); padding-top: var(--spacing-md); border-top: 1px solid var(--border);">
|
||||
<label class="form-label" style="color: var(--primary); font-weight: 600;">Notatki administracyjne</label>
|
||||
<textarea id="editAdminNotes" class="form-control" rows="4" placeholder="Wewnętrzne notatki (widoczne tylko dla adminów)..." style="resize: vertical;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary" onclick="closeEditModal()">Anuluj</button>
|
||||
@ -860,6 +869,7 @@
|
||||
document.getElementById('editCity').value = c.address_city || '';
|
||||
document.getElementById('editStreet').value = c.address_street || '';
|
||||
document.getElementById('editPostal').value = c.address_postal || '';
|
||||
document.getElementById('editAdminNotes').value = c.admin_notes || '';
|
||||
document.getElementById('editModal').classList.add('active');
|
||||
} else {
|
||||
showToast(data.error || 'Nie można pobrać danych', 'error');
|
||||
@ -899,7 +909,8 @@
|
||||
phone: document.getElementById('editPhone').value.trim() || null,
|
||||
address_city: document.getElementById('editCity').value.trim() || null,
|
||||
address_street: document.getElementById('editStreet').value.trim() || null,
|
||||
address_postal: document.getElementById('editPostal').value.trim() || null
|
||||
address_postal: document.getElementById('editPostal').value.trim() || null,
|
||||
admin_notes: document.getElementById('editAdminNotes').value.trim() || null
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user