Make conditions configuration ui as a simple js dialog component and fix some bugs