Please enable JavaScript.
Coggle requires JavaScript to display documents.
Ask To Open Dialog, Defs, Dialog Did Open, Close The Dialog, Ask To Open…
Ask To Open Dialog
[ACTION] Dispatch OpenDialog(dialogType)
[REDUCER] set dialogType state
[EFFECT] open the dialog with properly component
[ACTION] Dispatch DialogOpened
[REDUCER] Save the dialogRef on a proper store state
Defs
Actions
OpenDialog
CloseDialog
DialogOpened
DialogClosed
Layes
Regular Content{Z-Index: from 0 to 199}
Modals{Z-Index: from 200 to 399}
Dropdowns{Z-Index: from 400 to 599}
Toasts{Z-Index: from 600 to 899}
Store
DialogStore
Dialog Did Open
[COMPONENT] Component gets mounted
[ACTION] Dispatch loadComponentState
[SELECTOR] Get proper data from store
[COMPONENT] create an observable of the specific state data to be used with async pipe
Close The Dialog
[ACTION] Dispatch CloseDialog
[EFFECT] Get the dialog ref from store and close the dialog
[ACTION] Dispatch DialogClosed
[Reducer] Clear dialogRef on store
[EFFECT] Check state nextDialog on store
If has value
[ACTION] Dispatch openDialog(nextDialog)
Ask To Open Dialog
[ACTION] Dispatch OpenDialog(dialogType)
[REDUCER] set dialogType state
[EFFECT] open the dialog with properly component
[ACTION] Dispatch DialogOpened
[REDUCER] Save the dialogRef on a proper store state
Behaviors
Concurrently Dialogs
Should allow only 1 dialog at time?
Should block when try open another dialog?
Should close current dialog an then open the new one?
Should allow multiples dialogs at time?
opens new dialog above the previous one
Navigation Back Event
[GUARD] Check dialogRef on DialogStore
If is not null
Prevent/cancel naviagation
[ACTION] Dispatch CloseDialog
If is null
proceed with navigation
Notes
If adopted multiple opened dialogs at time
CloseDialog action will affect the dialog with highest Z-Index