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

fix(ui) clicking on Empty Topic button display blank screen #1429

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions client/src/containers/Topic/Topic/Topic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ class Topic extends Root {
canEmptyTopic = () => {
const { configs } = this.state;
const res = configs.filter(config => config.name === 'cleanup.policy');
if (res && res.length === 1 && res[0].value.includes('delete')) return true;
return false;
return res && res.length === 1 && res[0].value.includes('delete');
};

emptyTopic = () => {
Expand All @@ -95,7 +94,7 @@ class Topic extends Root {
.then(() => {
toast.success(`Topic '${topicId}' will be emptied`);
this.setState({ showDeleteModal: false }, () => {
this.topicData.current.getMessages();
this.topicData.current._getMessages(false);
});
})
.catch(() => {
Expand Down
4 changes: 2 additions & 2 deletions client/src/containers/Topic/Topic/TopicData/TopicData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class TopicData extends Root {
this._fetchMessages(requests);
}

_getMessages(changePage = false) {
_getMessages = changePage => {
const { selectedCluster, selectedTopic, nextPage } = this.state;

const filters = this._buildFilters();
Expand All @@ -315,7 +315,7 @@ class TopicData extends Root {
} else {
this._setUrlHistory(filters);
}
}
};

_fetchMessages(requests, changePage = false) {
const { nextPage, pageNumber, partitionCount, recordCount, offsets } = this.state;
Expand Down