Export Scope Selector
Component Detail
Description
Dropdown or segmented control allowing the user to choose the organisational scope of the export: local chapter, region, or national level. Populates available options from the user's access rights within the org hierarchy.
export-scope-selector
Summaries
The Export Scope Selector directly enables accurate, permission-governed data reporting across the organisational hierarchy — from local chapters up to national level. By ensuring that each user only sees and exports data within their authorised scope, this component reduces the risk of data leakage, compliance violations, and accidental cross-organisational reporting. For Bufdir-facing submissions, accuracy at the right organisational level is critical: errors here could result in funding miscalculations or regulatory non-compliance. This component acts as a governance checkpoint that protects the integrity of reported outcomes while making the export workflow intuitive for frontline staff.
The Export Scope Selector carries medium complexity primarily due to its dependency on the org-hierarchy-resolver, which must be available and stable before this component can be fully tested end-to-end. Development requires close coordination with the team responsible for permission and access-rights logic. Testing must cover all three scope levels (local chapter, region, national) across a range of user permission profiles, including edge cases such as users with access to multiple regions. Scope-level reset behaviour (clearing child selections when the parent level changes) requires careful UI state management.
Plan for integration testing cycles after org-hierarchy-resolver stabilises.
Export Scope Selector is a mobile UI component that integrates tightly with the org-hierarchy-resolver dependency to dynamically populate available scope options based on the authenticated user's access rights. The component exposes build() for initialisation, onScopeTypeSelected(type) and onScopeEntitySelected(entityId) for event-driven scope propagation, getScopeOptions(level) for fetching permission-filtered options per hierarchy level, and reset() for clearing child selections on level change. It operates against the organisation, region, and local-chapter data models. State management must handle cascading resets when the scope type changes.
Pay attention to async loading states when fetching options from the resolver, and ensure the emitted scope ID and level are strongly typed for downstream consumers.
Responsibilities
- Render scope options based on user permissions
- Emit selected scope ID and level
- Reset child selections when scope level changes
Interfaces
build()
onScopeTypeSelected(type)
onScopeEntitySelected(entityId)
getScopeOptions(level)
reset()
Relationships
Dependencies (1)
Components this component depends on
Related Data Entities (2)
Data entities managed by this component