mitodl / micromasters

Portal for learners and course teams to access MITx Micromasters® programs
https://mm.mit.edu
BSD 3-Clause "New" or "Revised" License
29 stars 17 forks source link

Refactor dialog actions and reducers #2627

Open gsidebo opened 7 years ago

gsidebo commented 7 years ago

We currently have a huge amount of code dedicated to the relatively simple act of opening and closing dialogs. For every dialog in Micromasters, we define an action to set the dialog's visibility to true, and a reducer to change the state accordingly. PR #2555 introduces the SHOW_DIALOG and HIDE_DIALOG actions, which can show and hide any number of dialogs without the boilerplate code. We should change our existing dialog actions/reducers to follow this new pattern. As an example, the invocation of the setLearnerPageDialogVisibility action would change from setLearnerPageDialogVisibility() to showDialog(LEARNER_PAGE_DIALOG).

We also have 3 actions which appear to be dead code: UPDATE_DIALOG_TEXT, UPDATE_DIALOG_TITLE, and SET_DIALOG_VISIBILITY in static/js/actions/ui.js.

alicewriteswrongs commented 7 years ago

Yes, those are dead, I think I added those originally for the signup dialog and they weren't taken out.