scrumlr.io
scrumlr.io copied to clipboard
refactor: settings dialog
Description
Refactors the settings dialog. The reason for this is the fact the settings will be required at other locations (like templates/sessions, #4254), and while the current state was great, it had some issues:
- hardcoded menu items
- state that wouldn't be available on other pages (like board state)
- hardcoded navigation
The new solution provides solutions for all of these:
- dynamically render menu items
- all sections are kept in a configurable file
- each section can be enabled/disabled using props
- remove or outsource unnessecary state
- dynamic navigation
- returning to previous route instead of navigatin to hardcoded routes
- when navigating to
/settings
, automatically redirect to the first allowed option
Changelog
- add file
constants/settings.ts
incuding nessecary types and list of all menu items - SettingsDialog
- add render function
- adjust logic
- add tests
Checklist
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] The application was tested in the most commonly used browsers (e.g. Chrome, Firefox, Safari)