Web: Removed the link if the user does not have rights.
This commit is contained in:
parent
be6530c8ff
commit
1b0a46303e
@ -26,6 +26,7 @@ const StyledUserNameLink = styled.span`
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
display: inline-block;
|
||||
${(props) => props.isVisitor && "cursor: default"};
|
||||
}
|
||||
|
||||
.link {
|
||||
|
@ -4,7 +4,7 @@ import { useHistory } from "react-router-dom";
|
||||
import Link from "@docspace/components/link";
|
||||
import { StyledUserNameLink } from "../../styles/history";
|
||||
|
||||
const HistoryBlockUser = ({ user, withComma, openUser }) => {
|
||||
const HistoryBlockUser = ({ user, withComma, openUser, isVisitor }) => {
|
||||
const username = user.displayName;
|
||||
const history = useHistory();
|
||||
|
||||
@ -12,9 +12,11 @@ const HistoryBlockUser = ({ user, withComma, openUser }) => {
|
||||
openUser(user, history);
|
||||
};
|
||||
|
||||
const onClickProp = isVisitor ? {} : { onClick: onUserClick };
|
||||
|
||||
return (
|
||||
<StyledUserNameLink key={user.id} className="user">
|
||||
<Link className="username link" onClick={onUserClick}>
|
||||
<StyledUserNameLink key={user.id} className="user" isVisitor={isVisitor}>
|
||||
<Link className="username link" {...onClickProp}>
|
||||
{username}
|
||||
</Link>
|
||||
{withComma ? "," : ""}
|
||||
|
@ -29,6 +29,7 @@ const History = ({
|
||||
getHistory,
|
||||
checkAndOpenLocationAction,
|
||||
openUser,
|
||||
isVisitor,
|
||||
}) => {
|
||||
const [history, setHistory] = useState(null);
|
||||
const [showLoader, setShowLoader] = useState(false);
|
||||
@ -149,6 +150,7 @@ const History = ({
|
||||
feed.target &&
|
||||
[feed.target, ...feed.groupedFeeds].map((user, i) => (
|
||||
<HistoryBlockUser
|
||||
isVisitor={isVisitor}
|
||||
key={user.id}
|
||||
user={user}
|
||||
withComma={i !== feed.groupedFeeds.length}
|
||||
@ -164,6 +166,7 @@ const History = ({
|
||||
};
|
||||
|
||||
export default inject(({ auth, filesStore, filesActionsStore }) => {
|
||||
const { userStore } = auth;
|
||||
const {
|
||||
selection,
|
||||
selectionParentRoom,
|
||||
@ -176,6 +179,9 @@ export default inject(({ auth, filesStore, filesActionsStore }) => {
|
||||
const { getHistory } = filesStore;
|
||||
const { checkAndOpenLocationAction } = filesActionsStore;
|
||||
|
||||
const { user } = userStore;
|
||||
const isVisitor = user.isVisitor;
|
||||
|
||||
return {
|
||||
personal,
|
||||
culture,
|
||||
@ -186,5 +192,6 @@ export default inject(({ auth, filesStore, filesActionsStore }) => {
|
||||
getHistory,
|
||||
checkAndOpenLocationAction,
|
||||
openUser,
|
||||
isVisitor,
|
||||
};
|
||||
})(withTranslation(["InfoPanel", "Common", "Translations"])(observer(History)));
|
||||
|
Loading…
Reference in New Issue
Block a user