Skip to content

Commit

Permalink
Merge pull request #296 from openkfw/294-display-end-of-history-corre…
Browse files Browse the repository at this point in the history
…ctly

ui: Fix display of 'No event' in history
  • Loading branch information
mathiashoeld authored May 23, 2019
2 parents 8677771 + 93f20df commit 3f1647f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

<!-- ### Removed -->

<!-- ### Fixed -->
### Fixed

- Empty history displayed after API call is finished [#294](https://github.com/openkfw/TruBudget/issues/294)

<!-- ### Security -->
## [1.0.1] - 2019-05-21
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Common/HistoryList.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function HistoryList({ events, nEventsTotal, hasMore, isLoading,
subheader={<ListSubheader disableSticky>{strings.common.history}</ListSubheader>}
style={styles.list}
>
{nEventsTotal === 0 ? (
{!isLoading && nEventsTotal === 0 ? (
<ListItem key="no-element">
<Avatar alt={""} src="" />
<ListItemText primary="" secondary={strings.common.no_history} />
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/SubProjects/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ export default function detailviewReducer(state = defaultState, action) {
isHistoryLoading: false
});
case OPEN_HISTORY:
return state.set("showHistory", true);
return state.set("showHistory", true).set("isHistoryLoading", true);

case HIDE_HISTORY:
return state.merge({
historyItems: fromJS([]),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Workflows/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export default function detailviewReducer(state = defaultState, action) {
case LOGOUT:
return defaultState;
case OPEN_HISTORY:
return state.set("showHistory", true);
return state.set("showHistory", true).set("isHistoryLoading", true);
default:
return state;
}
Expand Down

0 comments on commit 3f1647f

Please sign in to comment.