mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-29 18:51:43 +02:00
fix(permissions): self-heal Administrators to ALL_PERMISSIONS on upgrade + Pipelines runs dashboard polish
Administrators system group sync - Fresh installs already bootstrap with ALL_PERMISSIONS, so they always have every permission. Upgrades previously only got what one-off backfill blocks in seed_default_groups() explicitly listed (library:purge, archives:purge, the OWN/ALL read-flag block, orca_cloud:auth, pipelines:*). Any Permission enum member added without a matching block silently stayed missing on existing admin rows. The most recent gap was printer_sensor_history:read (Sensor History charts returned 403 for upgraded admins). - seed_default_groups() now syncs Administrators to ALL_PERMISSIONS on every startup: append every Permission value that isn't already on the row. Additive only -- hand-added custom permissions are preserved. - The pure-admin one-off backfills (library:purge / archives:purge block, the OWN/ALL + orca_cloud:auth + legacy-read-flag block, the Administrators branch of the pipeline backfill) are retired since the sync subsumes them. Non-admin backfills (Operators / Viewers OWN-tier reads, Operators orca_cloud:auth, pipelines for non-admin groups, makerworld:*, clear_plate cross-group adders) are untouched. - Tests: test_administrators_printer_sensor_history_read_backfilled (regression for the reported gap), test_administrators_sync_covers_every_current_permission (generic invariant -- any future new permission lands on admin without needing a one-off test), test_administrators_sync_is_additive_only (custom permissions preserved). 12/12 backfill-migration + 102/102 broader permission tests green; ruff clean. Pipelines runs dashboard - PipelineRunsPage.tsx: the Pipeline / Status / Target filter row's three native <select> elements are replaced with a bambu-themed FilterDropdown (button trigger, floating menu, optgroup-style headers for the Target picker, hover + selected states with a check mark, closes on outside click and Escape). Same value/onChange contract -- visual only. - SlicerPipelinesPanel.tsx: wrap list?.pipelines ?? [] in useMemo so the reference is stable when the data is stable. Fixes the react-hooks/exhaustive-deps warning where the inline fallback returned a fresh empty array every render, invalidating both downstream useMemo caches (target-options + filtered-pipelines list).
This commit is contained in:
@@ -119,6 +119,7 @@ function isAlwaysAllowedIdentical(value) {
|
||||
if (/^v?\d+(\.\d+)+/.test(value)) return true; // version-like
|
||||
if (/^#[0-9a-fA-F]{3,8}$/.test(value)) return true; // hex color
|
||||
if (/^\{\{[^}]+\}\}$/.test(value)) return true; // pure placeholder
|
||||
if (/^\{\{[^}]+\}\}([\s/\-–·,]+\{\{[^}]+\}\})+$/.test(value)) return true; // placeholders joined by punctuation only ({{a}} / {{b}})
|
||||
if (/^[0-9a-fA-F]{6}$/.test(value)) return true; // bare hex color
|
||||
if (/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i.test(value)) return true; // email
|
||||
if (/^https?:\/\//.test(value)) return true; // URL
|
||||
@@ -148,6 +149,7 @@ const DE_COGNATES = [
|
||||
'Pause', 'Power', 'System', 'Problem', 'Designer', 'Extruder', 'Firmware',
|
||||
'Material', 'Original', 'Position', 'Webhook', 'Workflow', 'Slicer',
|
||||
'Pipeline', 'Pipelines', 'Filament {{n}}', // #1425 — Slicer Pipelines (DE)
|
||||
'parallel', // #1425 PR C polish — "parallel" is the same word in German
|
||||
'Region', 'Normal', 'Orange', 'Branch', 'Budget', 'Commit', 'Global',
|
||||
'Version', 'Slot', 'Live', 'Rate', 'Host', 'Trend', 'Min', 'Admin', 'Cloud',
|
||||
'Filament', 'Filaments', 'Software', 'Hardware', 'Avatar', 'Pin', 'Modal',
|
||||
@@ -182,6 +184,7 @@ const FR_COGNATES = [
|
||||
'Job', 'Modal', 'Pin', 'Pro', 'Mini', 'Studio', 'Excellent', 'Description',
|
||||
'Pipeline', 'Pipelines', 'Filament {{n}}', // #1425 — Slicer Pipelines (FR)
|
||||
'Copies', '{{n}} copies', 'max {{n}}', // #1425 PR C — French uses these forms verbatim
|
||||
'round robin', // borrowed English term used as-is in French tech contexts
|
||||
'Action', 'Actions', 'Date', 'Type', 'Cache', 'Service', 'Configuration',
|
||||
'Archives', 'Maintenance', 'Notifications', 'Notification', 'Position',
|
||||
'Pause', 'Solution', 'Source', 'Version', 'Format', 'Documentation',
|
||||
@@ -222,6 +225,7 @@ const IT_COGNATES = [
|
||||
'Email', // common loanword in Italian, used verbatim in UI labels
|
||||
'Pipeline', 'slicing', // #1425 — Slicer Pipelines (cognate in IT)
|
||||
'max {{n}}', // #1425 PR C — same form in Italian (max + number)
|
||||
'round robin', // borrowed English term used as-is in Italian tech contexts
|
||||
'Status', 'Tag', 'Tags', 'Online', 'Offline', 'Standard', 'Filament',
|
||||
'Filaments', 'Software', 'Hardware', 'Stop', 'Reset', 'Test', 'Code',
|
||||
'Token', 'Server', 'Port', 'Plate', 'Layer', 'Modal', 'Pin', 'Pro', 'Mini',
|
||||
@@ -266,6 +270,7 @@ const PT_BR_COGNATES = [
|
||||
'Bambu Cloud', 'Orca Cloud', // brand names — same in every locale
|
||||
'AMS Filament Backup', // Bambu Lab product/firmware feature name
|
||||
'Pipeline', 'Pipelines', // #1425 — Slicer Pipelines (PT-BR)
|
||||
'round robin', // borrowed English term used as-is in Portuguese tech contexts
|
||||
'Status', 'Tag', 'Tags', 'Online', 'Offline', 'Standard', 'Filament',
|
||||
'Software', 'Hardware', 'Stop', 'Reset', 'Test', 'Code', 'Token', 'Server',
|
||||
'Port', 'Plate', 'Layer', 'Modal', 'Pin', 'Pro', 'Mini', 'Studio', 'Cache',
|
||||
@@ -339,6 +344,7 @@ const ES_COGNATES = [
|
||||
'Bambu Cloud', 'Orca Cloud', // brand names — same in every locale
|
||||
'AMS Filament Backup', // Bambu Lab product/firmware feature name
|
||||
'Pipeline', 'Pipelines', // #1425 — Slicer Pipelines (ES)
|
||||
'round robin', // borrowed English term used as-is in Spanish tech contexts
|
||||
'Error', 'Firmware', 'General', 'Control', 'Total', 'total', 'Material',
|
||||
'Material:', 'Color', 'Hex', 'Local', 'Global', 'China', 'Editable',
|
||||
'Normal', 'Metal', 'Multicolor', 'Proxy', 'Host', 'Factor', 'Original',
|
||||
|
||||
Reference in New Issue
Block a user