File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
routes/settings/routes/profile/components Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -200,8 +200,12 @@ class ProjectDetail extends Component {
200200 }
201201 }
202202
203- // as soon as user profile settings are loaded, check if all required fields are completed or show the popup
204- if ( this . props . profileSettings . isLoading && ! profileSettings . isLoading && ! isUserProfileComplete ( nextProps . currentUser , profileSettings . settings ) ) {
203+ // as soon as user profile settings and project are both loaded, check if all required fields are completed or show the popup
204+ const profileSettingsJustLoaded = this . props . profileSettings . isLoading && ! profileSettings . isLoading
205+ const projectJustLoaded = this . props . isLoading && ! isLoading
206+ const timeToShowIncompleteProfile = ! profileSettings . isLoading && ! isLoading && ( profileSettingsJustLoaded || projectJustLoaded )
207+ const projectLoadingError = nextProps . error && ( nextProps . error . type === LOAD_PROJECT_FAILURE || nextProps . error . type === ACCEPT_OR_REFUSE_INVITE_FAILURE )
208+ if ( ! projectLoadingError && timeToShowIncompleteProfile && ! isUserProfileComplete ( nextProps . currentUser , profileSettings . settings ) ) {
205209 this . setState ( { showIncompleteProfilePopup : true } )
206210 }
207211
Original file line number Diff line number Diff line change @@ -47,8 +47,10 @@ class ProfileSettingsForm extends Component {
4747 }
4848
4949 componentDidUpdate ( ) {
50+ // if we want to show validation errors on form showing
5051 if ( this . refs . form && ! this . isValidated && this . props . shouldDoValidateOnStart ) {
51- this . refs . form . submit ( )
52+ // we have to mark the form as not pristine, so validation errors are shown
53+ this . refs . form . setFormPristine ( false )
5254 this . isValidated = true
5355 }
5456 }
@@ -423,7 +425,7 @@ ProfileSettingsForm.defaultProps = {
423425ProfileSettingsForm . propTypes = {
424426 values : PropTypes . object . isRequired ,
425427 saveSettings : PropTypes . func . isRequired ,
426- uploadPhoto : PropTypes . func . isRequired ,
428+ uploadPhoto : PropTypes . func ,
427429 fieldsConfig : PropTypes . shape ( {
428430 avatar : PropTypes . bool ,
429431 firstName : PropTypes . bool ,
You can’t perform that action at this time.
0 commit comments