You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have crud1 and crud2, where crud2 is embedded in a custom tab on crud1 edit/show view, crud2 should (?) inherit parent spinner. Otherwise we can end up having 2 different spinners on an assumingly single app.
Proposed solution: move custom spinner from model definition into uiConfig props. In this case developer can just pass spinner from parent's uiConfig into the embedded one. (Crud will have defaultProps.spinner with the default value anyway, so passing a prop won't be mandatory).
The text was updated successfully, but these errors were encountered:
Current proposable solution: single spinner (singleton) passed from parent app via React context.
Spinner singleton is an instance of a class, which exposes start and stop methods. Any child can execute these methods to signal that is started/finished some async task.
Upon start spinner increments its counter, upon stop counter is decremented.
If counter is equal 1, spinner renders its component. If counter is 0, component is unmounted.
Apps should properly inform spinner with start/stop methods; if one stop is lost spinner will spin indefinitely.
Spinner singleton adds spinner class which can be used to position custom spinner in the center of the screen.
How crud editor decides where to get the spinner from:
if spinner prop exists in context -> pass it to own context
otherwise check modelDefinition.ui.spinner. If it's found - pass a built-in spinner singleton to own context, with this custom component to be rendered instead of the default one
if none is true - pass built-in singleton spinner with default spinner component.
If we have
crud1
andcrud2
, wherecrud2
is embedded in a custom tab oncrud1
edit/show view,crud2
should (?) inherit parent spinner. Otherwise we can end up having 2 different spinners on an assumingly single app.Proposed solution: move custom spinner from model definition into
uiConfig
props. In this case developer can just pass spinner from parent'suiConfig
into the embedded one. (Crud will have defaultProps.spinner with the default value anyway, so passing a prop won't be mandatory).The text was updated successfully, but these errors were encountered: