scrumlr.io icon indicating copy to clipboard operation
scrumlr.io copied to clipboard

refactor: settings dialog

Open Schwehn42 opened this issue 8 months ago • 5 comments

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:

  1. hardcoded menu items
  2. state that wouldn't be available on other pages (like board state)
  3. hardcoded navigation

The new solution provides solutions for all of these:

  1. dynamically render menu items
    1. all sections are kept in a configurable file
    2. each section can be enabled/disabled using props
  2. remove or outsource unnessecary state
  3. dynamic navigation
    1. returning to previous route instead of navigatin to hardcoded routes
    2. 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)

Schwehn42 avatar Jun 26 '24 08:06 Schwehn42