-
Notifications
You must be signed in to change notification settings - Fork 569
fix(UI): show domain full path and fix sorting #3100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
faa84b7
a180d42
d4fd52e
ba18198
74df1c6
3984204
c248975
024a2d3
45a60b1
16dbe8d
be27fbc
8474ad7
46104f6
5b7bad6
e7c07f5
33a08b9
88296d0
8b9ad46
f3a4789
60cf938
01547c6
ef95425
d445a7b
29b854e
1f8353a
f4169df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -228,7 +228,7 @@ export const URL_MODEL_MAP: ModelMap = { | |
| { field: 'ebios_rm_study', urlModel: 'ebios-rm' } | ||
| ], | ||
| reverseForeignKeyFields: [{ field: 'risk_assessment', urlModel: 'risk-scenarios' }], | ||
| selectFields: [{ field: 'status' }, { field: 'risk_tolerance', valueType: 'number' }], | ||
| selectFields: [{ field: 'status' }], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's examine the actual file and the selectFields definition for risk-assessments
cat -n frontend/src/lib/utils/crud.ts | sed -n '220,240p'Repository: intuitem/ciso-assistant-community Length of output: 1191 🏁 Script executed: # Search for all references to risk_tolerance in the entire codebase
echo "=== All risk_tolerance references ==="
rg -n 'risk_tolerance' --type=ts --type=js --type=svelteRepository: intuitem/ciso-assistant-community Length of output: 162 🏁 Script executed: # Search for risk-assessments model definition to understand context
echo "=== Risk assessments model definition ==="
rg -B5 -A10 "'risk-assessments'" frontend/src/lib/utils/crud.tsRepository: intuitem/ciso-assistant-community Length of output: 5671 🏁 Script executed: # Check if risk_tolerance is used in any components or forms
echo "=== Searching for risk_tolerance in component code ==="
fd -e svelte -e ts -e js . frontend/src -x grep -l 'risk_tolerance' {} \;Repository: intuitem/ciso-assistant-community Length of output: 432 🏁 Script executed: # Check how risk_tolerance is used in RiskAssessmentForm.svelte
echo "=== RiskAssessmentForm.svelte usage ==="
grep -n 'risk_tolerance' frontend/src/lib/components/Forms/ModelForm/RiskAssessmentForm.svelte -C3Repository: intuitem/ciso-assistant-community Length of output: 433 🏁 Script executed: # Check how risk_tolerance is defined in schemas.ts
echo "=== risk_tolerance in schemas.ts ==="
grep -n 'risk_tolerance' frontend/src/lib/utils/schemas.ts -C3Repository: intuitem/ciso-assistant-community Length of output: 763 🏁 Script executed: # Check the crud.ts file to see if there are other selectFields definitions or if this was previously set
echo "=== Check if risk_tolerance appears elsewhere in crud.ts ==="
grep -n 'risk_tolerance' frontend/src/lib/utils/crud.ts -C3Repository: intuitem/ciso-assistant-community Length of output: 444 🏁 Script executed: # Check QuantitativeRiskStudyForm for context
echo "=== QuantitativeRiskStudyForm.svelte usage ==="
grep -n 'risk_tolerance' frontend/src/lib/components/Forms/ModelForm/QuantitativeRiskStudyForm.svelte -C3Repository: intuitem/ciso-assistant-community Length of output: 2536 Restore The The field is defined in the schema as 🤖 Prompt for AI Agents |
||
| filters: [{ field: 'perimeter' }, { field: 'auditor' }, { field: 'status' }] | ||
| }, | ||
| 'risk-assessment_duplicate': { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 809
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 59
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 1080
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 536
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 59
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 59
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 2298
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 714
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 148
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 59
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 59
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 550
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 59
🏁 Script executed:
# Check the import structure head -50 backend/core/models.pyRepository: intuitem/ciso-assistant-community
Length of output: 1640
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 1456
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 388
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 1191
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 1671
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 59
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 4107
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 59
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 59
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 188
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 3472
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 1354
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 3951
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 1398
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 483
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 59
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 188
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 115
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 573
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 1936
🏁 Script executed:
Repository: intuitem/ciso-assistant-community
Length of output: 2245
LGTM! Verify and fix query optimization for folder list views.
The addition of the
strfield to expose the Folder's string representation is consistent with the codebase. However, there is a genuine N+1 query concern:The
Folder.__str__()method traversesparent_folderrelationships to build a hierarchical path. When serializing folder lists, each folder will trigger separate queries to fetch its parent folders. Additionally, there's an attribute name mismatch:FolderViewSetdeclarespath_related_fields = "parent_folder"(plural), butPathAwareOrderingFilterlooks forpath_related_field(singular), preventing the filter'sselect_related()optimization from being applied.To fix this, either:
path_related_fieldstopath_related_fieldinFolderViewSet, orprefetch_related("parent_folder")toFolderViewSet.get_queryset()🤖 Prompt for AI Agents