From ab0a6ba3fea9d5fbcea5a020579725627cdc00b0 Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Tue, 30 Jul 2024 11:46:25 +0200 Subject: [PATCH] fix: hidden widgets emoty text and styles --- i18n/en.pot | 18 ++++++------------ .../DataEntry/DataEntry.component.js | 7 ++++++- .../dataEntryOutput/withDataEntryOutput.js | 2 +- .../dataEntryOutput/withFeedbackOutput.js | 9 ++++++++- .../dataEntryOutput/withIndicatorOutput.js | 10 +++++++++- 5 files changed, 30 insertions(+), 16 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index 79a682d201..9d80cbf7a1 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2024-07-18T08:06:52.377Z\n" -"PO-Revision-Date: 2024-07-18T08:06:52.377Z\n" +"POT-Creation-Date: 2024-07-30T08:56:19.469Z\n" +"PO-Revision-Date: 2024-07-30T08:56:19.469Z\n" msgid "Choose one or more dates..." msgstr "Choose one or more dates..." @@ -366,11 +366,11 @@ msgstr "Registered person" msgid "validation failed" msgstr "validation failed" -msgid "No feedback" -msgstr "No feedback" +msgid "No feedback for this event yet" +msgstr "No feedback for this event yet" -msgid "No indicator output" -msgstr "No indicator output" +msgid "No indicator output for this event yet" +msgstr "No indicator output for this event yet" msgid "Generate new event" msgstr "Generate new event" @@ -783,12 +783,6 @@ msgstr "There was an error loading the page" msgid "Choose an organisation unit to start reporting" msgstr "Choose an organisation unit to start reporting" -msgid "No feedback for this event yet" -msgstr "No feedback for this event yet" - -msgid "No indicator output for this event yet" -msgstr "No indicator output for this event yet" - msgid "Program stage is invalid" msgstr "Program stage is invalid" diff --git a/src/core_modules/capture-core/components/DataEntry/DataEntry.component.js b/src/core_modules/capture-core/components/DataEntry/DataEntry.component.js index 9c21fbd1bc..655020b09f 100644 --- a/src/core_modules/capture-core/components/DataEntry/DataEntry.component.js +++ b/src/core_modules/capture-core/components/DataEntry/DataEntry.component.js @@ -62,10 +62,15 @@ const styles = theme => ({ position: 'relative', flexGrow: 1, width: theme.typography.pxToRem(300), - margin: theme.typography.pxToRem(10), + '& > div > div > *:not(:first-child)': { + marginTop: '10px', + }, marginRight: 0, }, verticalOutputsContainer: { + '& > *': { + marginTop: '10px', + }, marginBottom: theme.typography.pxToRem(10), }, dataEntrySectionContainer: { diff --git a/src/core_modules/capture-core/components/DataEntry/dataEntryOutput/withDataEntryOutput.js b/src/core_modules/capture-core/components/DataEntry/dataEntryOutput/withDataEntryOutput.js index 81631e3831..2d13c64fb0 100644 --- a/src/core_modules/capture-core/components/DataEntry/dataEntryOutput/withDataEntryOutput.js +++ b/src/core_modules/capture-core/components/DataEntry/dataEntryOutput/withDataEntryOutput.js @@ -21,7 +21,7 @@ const getDataEntryOutput = (InnerComponent: React.ComponentType, Output: Re return dataEntryOutputs ? [...dataEntryOutputs, output] : [output]; }; getOutput = (key: any) => ( -
+
{/* $FlowFixMe[cannot-spread-inexact] automated comment */} render = () => { const feedback = this.getItems(); - return ; + const hasItems = feedback.length > 0; + return ( +
+ {hasItems && + + } +
+ ); } }; diff --git a/src/core_modules/capture-core/components/DataEntry/dataEntryOutput/withIndicatorOutput.js b/src/core_modules/capture-core/components/DataEntry/dataEntryOutput/withIndicatorOutput.js index 9a860735cf..dd423a0281 100644 --- a/src/core_modules/capture-core/components/DataEntry/dataEntryOutput/withIndicatorOutput.js +++ b/src/core_modules/capture-core/components/DataEntry/dataEntryOutput/withIndicatorOutput.js @@ -25,7 +25,15 @@ const getIndicatorOutput = () => render = () => { const indicators = this.getItems(); - return ; + const hasItems = indicators.length > 0; + return ( +
+ {hasItems && + + } +
+ + ); } };