added external links

This commit is contained in:
namushka 2024-06-14 12:21:08 +03:00
parent 9f0b84389c
commit 8fc9bfef35
No known key found for this signature in database
7 changed files with 109 additions and 6 deletions

View File

@ -19,14 +19,15 @@
"FolderMoved": "Folders moved.",
"FolderCopied": "Folders copied.",
"FolderDeleted": "Folders removed.",
"RoomCreated": "<strong>«{{roomName}}»</strong> room created",
"RoomRenamed": "Room <strong>«{{oldRoomName}}»</strong> renamed to <strong>«{newRoomName}»</strong>",
"RoomCreated": "<strong>«{{roomTitle}}»</strong> room created",
"RoomRenamed": "Room <strong>«{{oldRoomTitle}}»</strong> renamed to <strong>«{{roomTitle}}»</strong>",
"AddedRoomTags": "Tags added.",
"DeletedRoomTags": "Tags removed.",
"RoomLogoCreated": "Icon changed",
"RoomLogoDeleted": "Icon changed",
"RoomExternalLinkCreated": "External link created.",
"RoomExternalLinkDeleted": "External link deleted.",
"RoomExternalLinkCreated": "Link created.",
"RoomExternalLinkRenamed": "Link <strong>«{{oldLinkTitle}}»</strong> renamed to <strong>«{{linkTitle}}»</strong>",
"RoomExternalLinkDeleted": "Link <strong>«{{linkTitle}}»</strong> deleted.",
"RoomCreateUser": "Users added.",
"RoomUpdateAccessForUser": "has been assigned role",
"RoomRemoveUser": "User removed.",

View File

@ -131,6 +131,11 @@ export const feedInfo = [
targetType: `${FeedTarget.RoomExternalLink}`,
actionType: `${FeedAction.Create}`,
},
{
key: "RoomExternalLinkRenamed",
targetType: `${FeedTarget.RoomExternalLink}`,
actionType: `${FeedAction.Rename}`,
},
{
key: "RoomExternalLinkDeleted",
targetType: `${FeedTarget.RoomExternalLink}`,

View File

@ -42,7 +42,12 @@ const HistoryMainText = ({ t, feed }: HistoryMainTextProps) => {
t={t}
ns="InfoPanel"
i18nKey={feed.action.key}
values={{ roomName: feed.data?.title }}
values={{
roomTitle: feed.data?.title || feed.data?.newTitle,
oldRoomTitle: feed.data?.oldTitle,
linkTitle: feed.data?.title,
oldLinkTitle: feed.data?.oldTitle,
}}
components={{ bold: <strong /> }}
/>
</span>{" "}

View File

@ -0,0 +1,75 @@
// (c) Copyright Ascensio System SIA 2009-2024
//
// This program is a free software product.
// You can redistribute it and/or modify it under the terms
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
// any third-party rights.
//
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
//
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
//
// The interactive user interfaces in modified source and object code versions of the Program must
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
//
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
// trademark law for use of our trademarks.
//
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import { inject, observer } from "mobx-react";
import {
StyledHistoryBlockTagList,
StyledHistoryLink,
} from "../../../styles/history";
import { ActionByTarget, AnyFeedInfo, getFeedInfo } from "../FeedInfo";
import { Tag } from "@docspace/shared/components/tag";
import { decode } from "he";
import { Link } from "@docspace/shared/components/link";
import { Text } from "@docspace/shared/components/text";
interface HistoryRoomExternalLinkProps {
feed: any;
actionType: ActionByTarget<"roomTag">;
}
const HistoryRoomExternalLink = ({
feed,
actionType,
additionalLinks,
setEditLinkPanelIsVisible,
setLinkParams,
}: HistoryRoomExternalLinkProps) => {
console.log(additionalLinks);
const onEditLink = () => {
setEditLinkPanelIsVisible(true);
setLinkParams({
isEdit: true,
link: { ...feed.data },
});
};
if (actionType === "create")
return (
<StyledHistoryLink>
<Link className="text link" onClick={onEditLink}>
{decode(feed.data.title)}
</Link>
</StyledHistoryLink>
);
};
export default inject(({ publicRoomStore, dialogsStore }) => ({
additionalLinks: publicRoomStore.additionalLinks,
setEditLinkPanelIsVisible: dialogsStore.setEditLinkPanelIsVisible,
setLinkParams: dialogsStore.setLinkParams,
}))(observer(HistoryRoomExternalLink));

View File

@ -37,6 +37,16 @@ const HistoryUserRoleChange = ({ feed }: HistoryUserRoleChangeProps) => {
<StyledHistoryBlockMessage className="message">
<span className="main-message">
<strong>«{feed.data.access}»</strong>
</span>{" "}
<span
className="old-role"
style={{
color: "#657077",
fontWeight: 600,
textDecoration: "line-through",
}}
>
«{feed.data.oldAccess}»
</span>
</StyledHistoryBlockMessage>
);

View File

@ -31,7 +31,7 @@ import HistoryUserList from "./UserList";
import HistoryMainText from "./MainText";
import HistoryItemList from "./ItemList";
import HistoryMainTextFolderInfo from "./MainTextFolderInfo";
import HistoryRoomExternalLink from "./RoomExternalLink";
import HistoryGroupList from "./GroupList";
import HistoryUserGroupRoleChange from "./UserGroupRoleChange";
import HistoryRoomTagList from "./RoomTagList";
@ -76,6 +76,10 @@ const HistoryBlockContent = ({
<HistoryRoomTagList feed={feed} actionType={actionType} />
)}
{targetType === "roomExternalLink" && actionType === "create" && (
<HistoryRoomExternalLink feed={feed} actionType={actionType} />
)}
{targetType === "user" && actionType !== "update" && (
<HistoryUserList feed={feed} />
)}

View File

@ -79,6 +79,7 @@ const Members = ({
membersIsLoading,
searchValue,
isMembersPanelUpdating,
getExternalLinks,
}) => {
const withoutTitlesAndLinks = !!searchValue;
const membersHelper = new MembersHelper({ t });
@ -87,6 +88,7 @@ const Members = ({
useEffect(() => {
updateInfoPanelMembers(t);
getExternalLinks();
}, [infoPanelSelection, searchValue]);
useEffect(() => {
@ -316,6 +318,7 @@ export default inject(
infoPanelSelection?.length > 1 ? null : infoPanelSelection;
return {
getExternalLinks: publicRoomStore.getExternalLinks,
infoPanelSelection: infoSelection,
setIsScrollLocked,
selfId,