Skip to content

Commit

Permalink
Fix #498
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulo authored and Paulo committed Nov 13, 2020
1 parent 5f2728e commit 0c67ac2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/src/containers/Topic/Topic/Topic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Topic extends Root {
{
clusterId,
topicId,
selectedTab: roles.topic && roles.topic['topic/data/read'] ? tabSelected : 'partitions',
selectedTab: roles.topic && roles.topic['topic/data/read'] ? tabSelected : 'configs',
topicInternal: this.props.location.internal
},
() => {
Expand Down
18 changes: 12 additions & 6 deletions client/src/containers/Topic/TopicList/TopicList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,16 @@ class TopicList extends Root {
{colName: 'Replications', colSpan: 2},
{colName: 'Consumer Groups', colSpan: 1}
];
let onDetailsFunction = undefined;

const actions = [constants.TABLE_CONFIG];
if(roles.topic && roles.topic['topic/data/read']) {
actions.push(constants.TABLE_DETAILS);
onDetailsFunction = (id) => `/ui/${selectedCluster}/topic/${id}/data`;
}
if(roles.topic && roles.topic['topic/delete']) {
actions.push(constants.TABLE_DELETE);
}

return (
<div>
Expand Down Expand Up @@ -406,13 +416,9 @@ class TopicList extends Root {
onDelete={topic => {
this.handleOnDelete(topic);
}}
onDetails={(id) => `/ui/${selectedCluster}/topic/${id}/data`}
onDetails={onDetailsFunction}
onConfig={(id) => `/ui/${selectedCluster}/topic/${id}/configs`}
actions={
roles.topic && roles.topic['topic/delete']
? [constants.TABLE_DELETE, constants.TABLE_DETAILS, constants.TABLE_CONFIG]
: [constants.TABLE_DETAILS, constants.TABLE_CONFIG]
}
actions={actions}
/>

{roles.topic['topic/insert'] && (
Expand Down

0 comments on commit 0c67ac2

Please sign in to comment.