diff --git a/client/src/components/Table/Table.jsx b/client/src/components/Table/Table.jsx
index e6308c282..0d8ab5841 100644
--- a/client/src/components/Table/Table.jsx
+++ b/client/src/components/Table/Table.jsx
@@ -43,7 +43,8 @@ class Table extends Component {
};
renderHeader() {
- const { has2Headers, firstHeader, columns, actions, data } = this.props;
+ const { has2Headers, firstHeader, columns, actions, data, loading, updateCheckbox, isChecked } =
+ this.props;
return (
<>
{has2Headers && (
@@ -74,7 +75,19 @@ class Table extends Component {
return (
- {column.colName}
+ {!loading && data && data.length > 0 && column.id === 'checkboxes' ? (
+ <>
+ {
+ updateCheckbox(e);
+ }}
+ />
+ >
+ ) : (
+ column.colName
+ )}
{column.sortable && (
{
+ this.setState({ isAllTopicDataSelected: isAllTopicDataSelected, messages: messages });
+ };
+
+ _renderDownloadFormat = isChecked => {
+ const { downloadOptions } = this.state;
+
+ let renderedOptions = [];
+ for (let option of downloadOptions) {
+ renderedOptions.push(
+
+ this.setState({ downloadFormat: option }, () => {
+ this._handleDownloadAll(option);
+ })
+ }
+ >
+ {option}
+
+ );
+ }
+ return renderedOptions;
+ };
+
+ _handleDownloadAll(option) {
+ let messages = this.state.messages;
+ if (this.state.isAllTopicDataSelected && option !== 'Select') {
+ let allData = [];
+ messages.map(tableData => {
+ allData.push(tableData.value);
+ allData.push('\n');
+ });
+ const a = document.createElement('a');
+ const type = 'text/' + option;
+ a.href = URL.createObjectURL(new Blob([allData], { type: type }));
+ a.download = `file.${option}`;
+
+ a.click();
+ a.remove();
+ }
+ }
+
showDeleteModal = deleteMessage => {
this.setState({ showDeleteModal: true, deleteMessage });
};
@@ -136,7 +187,14 @@ class Topic extends Root {
switch (selectedTab) {
case 'data':
return (
-
+
);
case 'partitions':
return ;
@@ -236,6 +294,18 @@ class Topic extends Root {
{selectedTab !== 'configs' && roles.topic && roles.topic['topic/data/insert'] && (
|