Merge branch 'release/v1.0.0' into feature/alert-component

This commit is contained in:
Tatiana Lopaeva 2023-04-03 14:42:54 +03:00
commit c616e61008
10 changed files with 135 additions and 25 deletions

View File

@ -26,7 +26,7 @@
"SetAppDescription": "Включена двухфакторная аутентификация. Чтобы продолжить работу в DocSpace, настройте приложение для аутентификации. Вы можете использовать Google Authenticator для <1>Android</1> и <4>iOS</4> или Authenticator для <8>Windows Phone</8>.",
"SetAppInstallDescription": "Для подключения приложения отсканируйте QR-код или вручную введите секретный ключ <1>{{ secretKey }}</1>, а затем введите 6-значный код из приложения в поле ниже.",
"SetAppTitle": "Настройте приложение для аутентификации",
"SuccessDeactivate": "Ваш аккаунт успешно деактивирован. Через 10 секунд вы будете перенаправлены на сайт <1>site</1>.",
"SuccessReactivate": "Ваша учетная запись успешно повторно активирована. Через 10 секунд вы будете перенаправлены на <1>portal</1>.",
"SuccessDeactivate": "Ваш аккаунт успешно деактивирован. Через 10 секунд вы будете перенаправлены на <1>сайт</1>.",
"SuccessReactivate": "Ваша учетная запись успешно повторно активирована. Через 10 секунд вы будете перенаправлены на <1>портал</1>.",
"WelcomeUser": "Добро пожаловать на DocSpace!\nЧтобы приступить к работе зарегистрируйтесь, или войдите через социальную сеть."
}

View File

@ -1,13 +1,27 @@
import React from "react";
import styled from "styled-components";
import ErrorContainer from "@docspace/common/components/ErrorContainer";
import { I18nextProvider, useTranslation } from "react-i18next";
import i18n from "./i18n";
import DocspaceLogo from "../../../DocspaceLogo";
const ErrorUnavailable = () => {
const StyledWrapper = styled.div`
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 64px;
`;
const ErrorUnavailable = ({ logoUrl }) => {
const { t, ready } = useTranslation("Errors");
return ready ? (
<ErrorContainer headerText={t("ErrorUnavailableText")} />
<StyledWrapper>
<DocspaceLogo />
<ErrorContainer headerText={t("ErrorUnavailableText")} />
</StyledWrapper>
) : (
<></>
);

View File

@ -428,6 +428,7 @@ class Tile extends React.PureComponent {
this.cm = React.createRef();
this.tile = React.createRef();
this.checkboxContainerRef = React.createRef();
}
onError = () => {
@ -503,7 +504,8 @@ class Tile extends React.PureComponent {
e.target.nodeName !== "INPUT" &&
e.target.nodeName !== "rect" &&
e.target.nodeName !== "path" &&
e.target.nodeName !== "svg"
e.target.nodeName !== "svg" &&
!this.checkboxContainerRef.current?.contains(e.target)
) {
setSelection && setSelection([]);
}
@ -637,7 +639,10 @@ class Tile extends React.PureComponent {
{renderElement && !(!fileExst && id === -1) && !isEdit && (
<>
{!inProgress ? (
<div className="file-icon_container">
<div
className="file-icon_container"
ref={this.checkboxContainerRef}
>
<StyledElement
className="file-icon"
isRoom={isRoom}

View File

@ -3,8 +3,10 @@ import HotkeysReactSvgUrl from "PUBLIC_DIR/images/hotkeys.react.svg?url";
import ProfileReactSvgUrl from "PUBLIC_DIR/images/profile.react.svg?url";
import PaymentsReactSvgUrl from "PUBLIC_DIR/images/payments.react.svg?url";
import HelpCenterReactSvgUrl from "PUBLIC_DIR/images/help.center.react.svg?url";
import SupportReactSvgUrl from "PUBLIC_DIR/images/support.react.svg?url";
import VideoGuidesReactSvgUrl from "PUBLIC_DIR/images/video.guides.react.svg?url";
import EmailReactSvgUrl from "PUBLIC_DIR/images/email.react.svg?url";
import LiveChatReactSvgUrl from "PUBLIC_DIR/images/support.react.svg?url";
import BookTrainingReactSvgUrl from "PUBLIC_DIR/images/book.training.react.svg?url";
//import VideoGuidesReactSvgUrl from "PUBLIC_DIR/images/video.guides.react.svg?url";
import InfoOutlineReactSvgUrl from "PUBLIC_DIR/images/info.outline.react.svg?url";
import LogoutReactSvgUrl from "PUBLIC_DIR/images/logout.react.svg?url";
import { makeAutoObservable } from "mobx";
@ -93,6 +95,10 @@ class ProfileActionsStore {
window.open(helpUrl, "_blank");
};
onLiveChatClick = () => {
//window.open(supportUrl, "_blank");
};
onSupportClick = () => {
const supportUrl = this.authStore.settingsStore.additionalResourcesData
?.feedbackAndSupportUrl;
@ -100,6 +106,13 @@ class ProfileActionsStore {
window.open(supportUrl, "_blank");
};
onBookTraining = () => {
const trainingEmail = this.authStore.settingsStore.additionalResourcesData
?.trainingEmail;
trainingEmail && window.open(`mailto:${trainingEmail}`, "_blank");
};
// onVideoGuidesClick = () => {
// window.open(VIDEO_GUIDES_URL, "_blank");
// };
@ -173,6 +186,29 @@ class ProfileActionsStore {
};
}
// }
let liveChat = null;
if (!isMobile) {
liveChat = {
key: "user-menu-live-chat",
icon: LiveChatReactSvgUrl,
label: t("Common:LiveChat"),
onClick: this.onLiveChatClick,
};
}
let bookTraining = null;
if (!isMobile) {
bookTraining = {
key: "user-menu-book-training",
icon: BookTrainingReactSvgUrl,
label: t("Common:BookTraining"),
onClick: this.onBookTraining,
};
}
const actions = [
{
key: "user-menu-profile",
@ -187,18 +223,16 @@ class ProfileActionsStore {
label: t("Common:PaymentsTitle"),
onClick: this.onPaymentsClick,
},
{
isSeparator: true,
key: "separator1",
},
{
key: "user-menu-help-center",
icon: HelpCenterReactSvgUrl,
label: t("Common:HelpCenter"),
onClick: this.onHelpCenterClick,
},
{
key: "user-menu-support",
icon: SupportReactSvgUrl,
label: t("Common:FeedbackAndSupport"),
onClick: this.onSupportClick,
},
// {
// key: "user-menu-video",
// icon: VideoGuidesReactSvgUrl,
@ -206,6 +240,18 @@ class ProfileActionsStore {
// onClick: this.onVideoGuidesClick,
// },
hotkeys,
{
isSeparator: true,
key: "separator2",
},
liveChat,
{
key: "user-menu-support",
icon: EmailReactSvgUrl,
label: t("Common:FeedbackAndSupport"),
onClick: this.onSupportClick,
},
bookTraining,
{
key: "user-menu-about",
icon: InfoOutlineReactSvgUrl,
@ -214,7 +260,7 @@ class ProfileActionsStore {
},
{
isSeparator: true,
key: "separator",
key: "separator3",
},
{
key: "user-menu-logout",
@ -226,7 +272,7 @@ class ProfileActionsStore {
];
if (debugInfo) {
actions.splice(3, 0, {
actions.splice(4, 0, {
key: "user-menu-debug",
icon: InfoOutlineReactSvgUrl,
label: "Debug Info",

View File

@ -389,6 +389,9 @@ class SettingsStore {
setAdditionalResourcesData = (data) => {
this.additionalResourcesData = data;
if (!this.additionalResourcesData?.trainingEmail) {
this.additionalResourcesData.trainingEmail = "training@onlyoffice.com";
}
};
setAdditionalResourcesIsDefault = (additionalResourcesIsDefault) => {

View File

@ -842,6 +842,15 @@ namespace ASC.Files.Core.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to You don&apos;t have enough permission to archive the room.
/// </summary>
public static string ErrorMessage_SecurityException_ArchiveRoom {
get {
return ResourceManager.GetString("ErrorMessage_SecurityException_ArchiveRoom", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You don&apos;t have permission to copy to this folder.
/// </summary>
@ -870,11 +879,11 @@ namespace ASC.Files.Core.Resources {
}
/// <summary>
/// Looks up a localized string similar to You don&apos;t have enough permission to archive the room.
/// Looks up a localized string similar to You don&apos;t have enough permission to unarchive the room.
/// </summary>
public static string ErrorMessage_UnarchiveRoom {
public static string ErrorMessage_SecurityException_UnarchiveRoom {
get {
return ResourceManager.GetString("ErrorMessage_UnarchiveRoom", resourceCulture);
return ResourceManager.GetString("ErrorMessage_SecurityException_UnarchiveRoom", resourceCulture);
}
}

View File

@ -375,8 +375,8 @@
<data name="ErrorMessage_SecurityException_MoveToFolder" xml:space="preserve">
<value>You don't have permission to move to this folder</value>
</data>
<data name="ErrorMessage_UnarchiveRoom" xml:space="preserve">
<value>You don't have enough permission to archive the room</value>
<data name="ErrorMessage_SecurityException_UnarchiveRoom" xml:space="preserve">
<value>You don't have enough permission to unarchive the room</value>
</data>
<data name="ErrorMessage_UpdateArchivedRoom" xml:space="preserve">
<value>You cannot edit archived rooms</value>
@ -472,4 +472,7 @@ Highest compatibility with docx, xlsx, pptx. </value>
<data name="AceStatusEnum_Collaborator" xml:space="preserve">
<value>Collaborator</value>
</data>
<data name="ErrorMessage_SecurityException_ArchiveRoom" xml:space="preserve">
<value>You don't have enough permission to archive the room</value>
</data>
</root>

View File

@ -146,6 +146,7 @@ class FileMoveCopyOperation<T> : FileOperation<FileMoveCopyOperationData<T>, T>
if (0 < Folders.Count)
{
var firstFolder = await FolderDao.GetFolderAsync(Folders[0]);
var isRoom = DocSpaceHelper.IsRoom(firstFolder.FolderType);
if (_copy && !await FilesSecurity.CanCopyAsync(firstFolder))
{
@ -155,7 +156,17 @@ class FileMoveCopyOperation<T> : FileOperation<FileMoveCopyOperationData<T>, T>
}
if (!_copy && !await FilesSecurity.CanMoveAsync(firstFolder))
{
this[Err] = FilesCommonResource.ErrorMassage_SecurityException_MoveFile;
if (isRoom)
{
this[Err] = toFolder.FolderType == FolderType.Archive
? FilesCommonResource.ErrorMessage_SecurityException_ArchiveRoom
: FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom;
}
else
{
this[Err] = FilesCommonResource.ErrorMassage_SecurityException_MoveFolder;
}
return;
}
@ -187,7 +198,9 @@ class FileMoveCopyOperation<T> : FileOperation<FileMoveCopyOperationData<T>, T>
}
if (!_copy && !await fileSecurity.CanMoveToAsync(toFolder))
{
this[Err] = FilesCommonResource.ErrorMessage_SecurityException_MoveToFolder;
this[Err] = toFolder.FolderType == FolderType.VirtualRooms ? FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom :
toFolder.FolderType == FolderType.Archive ? FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom :
FilesCommonResource.ErrorMessage_SecurityException_MoveToFolder;
return;
}
@ -270,7 +283,16 @@ class FileMoveCopyOperation<T> : FileOperation<FileMoveCopyOperationData<T>, T>
}
else if (!copy && checkPermissions && !canMoveOrCopy)
{
this[Err] = FilesCommonResource.ErrorMassage_SecurityException_MoveFolder;
if (isRoom)
{
this[Err] = toFolder.FolderType == FolderType.Archive
? FilesCommonResource.ErrorMessage_SecurityException_ArchiveRoom
: FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom;
}
else
{
this[Err] = FilesCommonResource.ErrorMassage_SecurityException_MoveFolder;
}
}
else if (!isRoom && (toFolder.FolderType == FolderType.VirtualRooms || toFolder.RootFolderType == FolderType.Archive))
{
@ -278,7 +300,7 @@ class FileMoveCopyOperation<T> : FileOperation<FileMoveCopyOperationData<T>, T>
}
else if (isRoom && toFolder.FolderType != FolderType.VirtualRooms && toFolder.FolderType != FolderType.Archive)
{
this[Err] = FilesCommonResource.ErrorMessage_UnarchiveRoom;
this[Err] = FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom;
}
else if (!isRoom && folder.Private && !await CompliesPrivateRoomRulesAsync(folder, toFolderParents))
{

View File

@ -0,0 +1,6 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.25807 1.11309C7.53755 0.967522 7.86929 0.962209 8.1533 1.09875L15.4333 4.59875C15.7797 4.76529 16 5.11564 16 5.5C16 5.88436 15.7797 6.23471 15.4333 6.40125L8.1533 9.90125C7.86929 10.0378 7.53755 10.0325 7.25807 9.88691L2 7.14834V9C2 9.55228 1.55228 10 1 10C0.447715 10 0 9.55228 0 9V5.5C0 5.12717 0.207401 4.78531 0.538066 4.61309L7.25807 1.11309ZM7.73791 7.88182L12.6921 5.5L7.73791 3.11818L3.16481 5.5L7.73791 7.88182Z" fill="#333333"/>
<path d="M2 12C2 11.4477 1.55228 11 1 11C0.447715 11 0 11.4477 0 12C0 12.5523 0.447715 13 1 13C1.55228 13 2 12.5523 2 12Z" fill="#333333"/>
<path d="M13 9.01632L11 9.97786V12.4812C9.92129 13.198 8.93284 13.5144 7.99797 13.5156C7.06354 13.5167 6.07649 13.2032 5 12.4832V10.1471L3 9.10542V13C3 13.3154 3.14878 13.6123 3.40141 13.8011C4.88035 14.9062 6.40699 15.5176 8.0005 15.5156C9.59296 15.5135 11.1183 14.8991 12.5958 13.8032C12.8501 13.6145 13 13.3166 13 13V9.01632Z" fill="#333333"/>
<path d="M5 9H4.96241L5 9.01958V9Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -20,6 +20,7 @@
"Audio": "Audio",
"BarMaintenanceDescription": "We apologize for any short-term technical issues in service functioning that may appear on {{targetDate}} during the update of {{productName}}.",
"BarMaintenanceDisclaimer": "Please, make sure that all the changes are successfully saved during this day.",
"BookTraining": "Book a training",
"ByFirstNameSorting": "By first name",
"ByLastNameSorting": "By last name",
"Bytes": "bytes",
@ -124,6 +125,7 @@
"LastName": "Last name",
"LatePayment": "Late payment",
"LearnMore": "Learn more",
"LiveChat": "Live chat",
"Load": "Load",
"LoadingDescription": "Please wait...",
"LoadingProcessing": "Loading...",