Skip to content

Commit d14b499

Browse files
authored
Merge pull request #854 from appirio-tech/fixUnsavedChangesPopup
Temporary fix for unsaved changes popup for app screens changes
2 parents 5ff3965 + 6cbc3bd commit d14b499

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/projects/detail/components/EditProjectForm.jsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ class EditProjectForm extends Component {
5050
isFeaturesDirty: false, // Since we just saved, features are not dirty anymore.
5151
canSubmit: false,
5252
isSaving: false
53-
}, () => {
54-
// Reset form
55-
if (this.refs.form && this.refs.form.isChanged()) this.refs.form.reset(nextProps)
5653
})
5754
}
5855

@@ -68,6 +65,16 @@ class EditProjectForm extends Component {
6865
// Notify user if they navigate away while the form is modified.
6966
onLeave(e) {
7067
if (this.isChanged()) {
68+
// TODO: remove this block - it disables unsaved changes popup
69+
// for app screens changes
70+
if (this.refs.form){
71+
const pristine = this.refs.form.getPristineValues()
72+
const current = this.refs.form.getCurrentValues()
73+
pristine['details.appScreens.screens']=current['details.appScreens.screens']
74+
if (_.isEqual(pristine, current)){
75+
return
76+
}
77+
}
7178
return e.returnValue = 'You have unsaved changes. Are you sure you want to leave?'
7279
}
7380
}

0 commit comments

Comments
 (0)