Skip to content

Commit

Permalink
fix(ui): fix some link that don't respect micronaut.server.context-path
Browse files Browse the repository at this point in the history
close #469
  • Loading branch information
tchiotludo committed Oct 21, 2020
1 parent dde8114 commit 3a8f571
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import ConfirmModal from '../../../components/Modal/ConfirmModal';
import { toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import Root from "../../../components/Root";
import {Link} from "react-router-dom";

class ConsumerGroupList extends Root {
state = {
Expand Down Expand Up @@ -122,16 +123,16 @@ class ConsumerGroupList extends Root {
const offsetLag = calculateTopicOffsetLag(topicOffsets, topicId);

return (
<a
href={`/ui/${this.state.selectedCluster}/topic/${topicId}`}
<Link
to={`/ui/${this.state.selectedCluster}/topic/${topicId}`}
key={group + '-' + topicId}
className="btn btn-dark btn-sm mb-1 mr-1"
onClick={noPropagation}
>
{topicId + ' '}

<div className="badge badge-secondary">Lag: {offsetLag}</div>
</a>
</Link>
);
});
}
Expand Down
7 changes: 4 additions & 3 deletions client/src/containers/Topic/Topic/TopicGroups/TopicGroups.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Table from '../../../../components/Table';
import { uriTopicsGroups } from '../../../../utils/endpoints';
import constants from '../../../../utils/constants';
import Root from "../../../../components/Root";
import {Link} from "react-router-dom";

class TopicGroups extends Root {
state = {
Expand Down Expand Up @@ -68,15 +69,15 @@ class TopicGroups extends Root {
const noPropagation = e => e.stopPropagation();
return Object.keys(topics).map(topic => {
return (
<a
href={`/ui/${this.state.selectedCluster}/topic/${topic}`}
<Link
to={`/ui/${this.state.selectedCluster}/topic/${topic}`}
key="lagTopic.topicId"
className="btn btn-dark btn-sm mb-1 mr-1"
onClick={noPropagation}
>
{topic}
<div className="badge badge-secondary">Lag: {topics[topic]}</div>
</a>
</Link>
);
});
}
Expand Down
6 changes: 3 additions & 3 deletions client/src/containers/Topic/TopicList/TopicList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ class TopicList extends Root {
const noPropagation = e => e.stopPropagation();

return (
<a
<Link
key={consumerGroup.id}
href={`/ui/${this.state.selectedCluster}/group/${consumerGroup.id}`}
to={`/ui/${this.state.selectedCluster}/group/${consumerGroup.id}`}
className={className}
onClick={noPropagation}
>
{consumerGroup.id} <div className="badge badge-secondary"> Lag: {offsetLag}</div>
</a>
</Link>
);
});
}
Expand Down

0 comments on commit 3a8f571

Please sign in to comment.