From 5384121c867cecb8526f3cff8e316030813b3c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilia=20M=C3=A4kel=C3=A4?= Date: Mon, 20 Nov 2023 10:01:29 +0200 Subject: [PATCH] Fix application opening section always appearing --- src/plotSearch/components/PlotSearchPage.js | 2 +- .../basicInfo/PlotSearchApplicationsOpeningSection.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plotSearch/components/PlotSearchPage.js b/src/plotSearch/components/PlotSearchPage.js index 6ca91503f..8e8738803 100644 --- a/src/plotSearch/components/PlotSearchPage.js +++ b/src/plotSearch/components/PlotSearchPage.js @@ -635,7 +635,7 @@ class PlotSearchPage extends Component { isEditMode={isEditMode} isSaveDisabled={isSaveClicked && !areFormsValid} onCancel={this.cancelChanges} - onEdit={this.handleShowEditMode} + onEdit={() => this.handleShowEditMode(false)} onSave={this.saveChanges} showCommentButton={false} showCopyButton={false} diff --git a/src/plotSearch/components/plotSearchSections/basicInfo/PlotSearchApplicationsOpeningSection.js b/src/plotSearch/components/plotSearchSections/basicInfo/PlotSearchApplicationsOpeningSection.js index 20b241bb7..e6118f35b 100644 --- a/src/plotSearch/components/plotSearchSections/basicInfo/PlotSearchApplicationsOpeningSection.js +++ b/src/plotSearch/components/plotSearchSections/basicInfo/PlotSearchApplicationsOpeningSection.js @@ -107,7 +107,7 @@ export default (flowRight( connect((state: RootState) => ({ applicationAttributes: getAttributes(state), plotSearch: getCurrentPlotSearch(state), - enabled: formValueSelector(FormNames.PLOT_SEARCH_APPLICATIONS_OPENING)(state, 'openingRecord') !== null, + enabled: formValueSelector(FormNames.PLOT_SEARCH_APPLICATIONS_OPENING)(state, 'opening_record') !== null, })), reduxForm({ form: FormNames.PLOT_SEARCH_APPLICATIONS_OPENING,