Project

General

Profile

Actions

Refactor #30724

closed

Remove console errors from ForemanModal

Added by Jeremy Lenz about 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
JavaScript stack
Target version:
-
Fixed in Releases:
Found in Releases:

Description

Currently ForemanModal has Redux reducers which behave in the following ways:

When you try to use ADD_MODAL for a modal that exists already: JS error thrown
When you try to SET_MODAL_OPEN for a modal that doesn't exist: JS error thrown
When you try to SET_MODAL_CLOSED for a modal that doesn't exist: JS error thrown

This causes a bad developer experience. At least one and possibly all three of the errors should be removed.

Suggested change:

When you try to use ADD_MODAL for a modal that exists already: No error; change is idempotent and Redux store is unchanged
When you try to SET_MODAL_OPEN for a modal that doesn't exist: Console warning; modal is created for you
When you try to SET_MODAL_CLOSED for a modal that doesn't exist: Console warning; modal is created for you

Actions

Also available in: Atom PDF