Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1905253: update events timeline empty state and end messages #7467

Merged
merged 1 commit into from Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/public/components/_sysevent-stream.scss
Expand Up @@ -184,6 +184,6 @@ $color-dark-border: #ddd;
}

.co-sysevent-stream__timeline__end-message {
left: 45px;
left: 57px;
}
}
14 changes: 2 additions & 12 deletions frontend/public/components/events.jsx
Expand Up @@ -265,9 +265,7 @@ export const NoEvents = () => {
const { t } = useTranslation();
return (
<Box className="co-sysevent-stream__status-box-empty">
<div className="text-center cos-status-box__detail">
{t('events~No events in the past hour')}
</div>
<div className="text-center cos-status-box__detail">{t('events~No events')}</div>
</Box>
);
};
Expand Down Expand Up @@ -328,7 +326,6 @@ class EventStream extends React.Component {
filteredEvents: [],
error: null,
loading: true,
oldestTimestamp: new Date(),
};
this.toggleStream = this.toggleStream_.bind(this);
}
Expand Down Expand Up @@ -469,13 +466,8 @@ class EventStream extends React.Component {
// update an instance variable, and throttle the actual UI update (see constructor)
flushMessages() {
const sorted = sortEvents(this.messages);
const oldestTimestamp = _.min([
this.state.oldestTimestamp,
getLastTime(new Date(_.last(sorted))),
]);
sorted.splice(maxMessages);
this.setState({
oldestTimestamp,
sortedMessages: sorted,
filteredEvents: EventStream.filterEvents(sorted, this.props),
});
Expand Down Expand Up @@ -554,9 +546,7 @@ class EventStream extends React.Component {
className="co-sysevent-stream__timeline__btn"
/>
<div className="co-sysevent-stream__timeline__end-message">
<Trans ns="events">
There are no events before <Timestamp timestamp={this.state.oldestTimestamp} />
</Trans>
{t('events~Older events are not stored.')}
</div>
</div>
{count > 0 && <EventStreamList events={filteredEvents} EventComponent={Inner} />}
Expand Down
4 changes: 2 additions & 2 deletions frontend/public/locales/en/events.json
Expand Up @@ -11,7 +11,7 @@
"Resource": "Resource",
"All": "All",
"Close": "Close",
"No events in the past hour": "No events in the past hour",
"No events": "No events",
"No matching events": "No matching events",
"{{allCount}}+ events exist, but none match the current filter": "{{allCount}}+ events exist, but none match the current filter",
"{{allCount}} events exist, but none match the current filter": "{{allCount}} events exist, but none match the current filter",
Expand All @@ -27,5 +27,5 @@
"Showing {{count}} event": "Showing {{count}} event",
"Showing {{count}} event_plural": "Showing {{count}} events",
"Showing {{messageCount}} of {{allCount}}+ events": "Showing {{messageCount}} of {{allCount}}+ events",
"There are no events before <1></1>": "There are no events before <1></1>"
"Older events are not stored.": "Older events are not stored."
}