feat: Eigenentwicklung-Filter im Typ-Dropdown mit Counts
All checks were successful
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Successful in 36s
CI/CD / test-python-backend-compliance (push) Successful in 36s
CI/CD / test-python-document-crawler (push) Successful in 27s
CI/CD / test-python-dsms-gateway (push) Successful in 18s
CI/CD / validate-canonical-controls (push) Successful in 12s
CI/CD / Deploy (push) Successful in 2s
All checks were successful
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Successful in 36s
CI/CD / test-python-backend-compliance (push) Successful in 36s
CI/CD / test-python-document-crawler (push) Successful in 27s
CI/CD / test-python-dsms-gateway (push) Successful in 18s
CI/CD / validate-canonical-controls (push) Successful in 12s
CI/CD / Deploy (push) Successful in 2s
Backend: control_type=eigenentwicklung in list_controls + count_controls, type_counts (rich/atomic/eigenentwicklung) in controls-meta Endpoint. Frontend: Typ-Dropdown zeigt Eigenentwicklung mit Anzahl. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -368,6 +368,11 @@ async def list_controls(
|
||||
query += " AND decomposition_method = 'pass0b'"
|
||||
elif control_type == "rich":
|
||||
query += " AND (decomposition_method IS NULL OR decomposition_method != 'pass0b')"
|
||||
elif control_type == "eigenentwicklung":
|
||||
query += """ AND generation_strategy = 'ungrouped'
|
||||
AND (pipeline_version = '1' OR pipeline_version IS NULL)
|
||||
AND source_citation IS NULL
|
||||
AND parent_control_uuid IS NULL"""
|
||||
if search:
|
||||
query += " AND (control_id ILIKE :q OR title ILIKE :q OR objective ILIKE :q)"
|
||||
params["q"] = f"%{search}%"
|
||||
@@ -450,6 +455,11 @@ async def count_controls(
|
||||
query += " AND decomposition_method = 'pass0b'"
|
||||
elif control_type == "rich":
|
||||
query += " AND (decomposition_method IS NULL OR decomposition_method != 'pass0b')"
|
||||
elif control_type == "eigenentwicklung":
|
||||
query += """ AND generation_strategy = 'ungrouped'
|
||||
AND (pipeline_version = '1' OR pipeline_version IS NULL)
|
||||
AND source_citation IS NULL
|
||||
AND parent_control_uuid IS NULL"""
|
||||
if search:
|
||||
query += " AND (control_id ILIKE :q OR title ILIKE :q OR objective ILIKE :q)"
|
||||
params["q"] = f"%{search}%"
|
||||
@@ -484,11 +494,34 @@ async def controls_meta():
|
||||
WHERE source_citation IS NULL OR source_citation->>'source' IS NULL OR source_citation->>'source' = ''
|
||||
""")).scalar()
|
||||
|
||||
# Type counts for filter dropdown
|
||||
atomic_count = db.execute(text("""
|
||||
SELECT count(*) FROM canonical_controls WHERE decomposition_method = 'pass0b'
|
||||
""")).scalar() or 0
|
||||
|
||||
eigenentwicklung_count = db.execute(text("""
|
||||
SELECT count(*) FROM canonical_controls
|
||||
WHERE generation_strategy = 'ungrouped'
|
||||
AND (pipeline_version = '1' OR pipeline_version IS NULL)
|
||||
AND source_citation IS NULL
|
||||
AND parent_control_uuid IS NULL
|
||||
""")).scalar() or 0
|
||||
|
||||
rich_count = db.execute(text("""
|
||||
SELECT count(*) FROM canonical_controls
|
||||
WHERE (decomposition_method IS NULL OR decomposition_method != 'pass0b')
|
||||
""")).scalar() or 0
|
||||
|
||||
return {
|
||||
"total": total,
|
||||
"domains": [{"domain": r[0], "count": r[1]} for r in domains],
|
||||
"sources": [{"source": r[0], "count": r[1]} for r in sources],
|
||||
"no_source_count": no_source,
|
||||
"type_counts": {
|
||||
"rich": rich_count,
|
||||
"atomic": atomic_count,
|
||||
"eigenentwicklung": eigenentwicklung_count,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user