Skip to content

Commit

Permalink
fix: hidden widgets emoty text and styles
Browse files Browse the repository at this point in the history
  • Loading branch information
simonadomnisoru committed Jul 30, 2024
1 parent 6a170a4 commit ab0a6ba
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 16 deletions.
18 changes: 6 additions & 12 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const getDataEntryOutput = (InnerComponent: React.ComponentType<any>, Output: Re
return dataEntryOutputs ? [...dataEntryOutputs, output] : [output];
};
getOutput = (key: any) => (
<div style={{ marginTop: 10 }} key={key}>
<div key={key}>
{/* $FlowFixMe[cannot-spread-inexact] automated comment */}
<Output
key={key}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ const getFeedbackOutput = () =>

render = () => {
const feedback = this.getItems();
return <WidgetFeedback feedback={feedback} emptyText={i18n.t('No feedback')} />;
const hasItems = feedback.length > 0;
return (
<div>
{hasItems &&
<WidgetFeedback feedback={feedback} emptyText={i18n.t('No feedback for this event yet')} />
}
</div>
);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ const getIndicatorOutput = () =>

render = () => {
const indicators = this.getItems();
return <WidgetIndicator indicators={indicators} emptyText={i18n.t('No indicator output')} />;
const hasItems = indicators.length > 0;
return (
<div>
{hasItems &&
<WidgetIndicator indicators={indicators} emptyText={i18n.t('No indicator output for this event yet')} />
}
</div>

);
}
};

Expand Down

0 comments on commit ab0a6ba

Please sign in to comment.