Accept + implement ADR-010 frontend plugin hooks (contract 0.7.0)
Four data-only hooks on BasePlugin (get_settings_cards, get_asset_panels, get_map_overlays, get_asset_presentation) with a GET-only /api/pluginui consumer surface copying the dashboard-widgets semantics. Pilots: warranty declares its asset panel; measuringtools supplies its settings card, presentation, and calibration overlay - the last hardcoded settings-nav entry is now hook-sourced. Generic renderers for panels/overlays/presentation deferred per the ADR's incremental adoption plan (documented in CONTRACT-STABILITY.md). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -72,5 +72,21 @@ class WarrantyPlugin(BasePlugin):
|
||||
},
|
||||
]
|
||||
|
||||
def get_asset_panels(self) -> List[Dict]:
|
||||
# ADR-010 pilot. Warranty is asset-general so it shows on every detail
|
||||
# page (['*']). Declares the existing per-asset warranty endpoint the
|
||||
# WarrantyPanel already reads; the generic core panel renderer consumes
|
||||
# this instead of each detail view hand-composing the panel.
|
||||
return [
|
||||
{
|
||||
'id': 'warranty',
|
||||
'title': 'Warranty',
|
||||
'assettypes': ['*'],
|
||||
'endpoint': '/api/warranty/asset/{assetid}',
|
||||
'render': 'table',
|
||||
'position': 30,
|
||||
},
|
||||
]
|
||||
|
||||
def init_app(self, app: Flask, db_instance) -> None:
|
||||
logger.info(f"Warranty plugin initialized (v{self.meta.version})")
|
||||
|
||||
Reference in New Issue
Block a user