Merge branch 'hotfix/v2.6.1' into feature/translations-quotas
This commit is contained in:
commit
2253d871b1
@ -30,5 +30,6 @@
|
||||
"SignUp": "Sign up",
|
||||
"SuccessDeactivate": "Your account has been successfully deactivated. In 10 seconds you will be redirected to the <1>site</1>.",
|
||||
"SuccessReactivate": "Your account has been successfully reactivated. In 10 seconds you will be redirected to the <1>portal</1>.",
|
||||
"SuccessRemoved": "Your account has been successfully removed. In 10 seconds you will be redirected to the <1>site</1>."
|
||||
"SuccessRemoved": "Your account has been successfully removed. In 10 seconds you will be redirected to the <1>site</1>.",
|
||||
"TermsAndConditions": "By continuing, you understand and agree to our <1>Terms and conditions</1> and <2>Privacy statement</2>."
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ import { inject, observer } from "mobx-react";
|
||||
|
||||
import { DeviceType, RoomsType } from "@docspace/shared/enums";
|
||||
import Planet12ReactSvgUrl from "PUBLIC_DIR/images/icons/12/planet.react.svg?url";
|
||||
import { toastr } from "@docspace/shared/components/toast";
|
||||
|
||||
export default function withFileActions(WrappedFileItem) {
|
||||
class WithFileActions extends React.Component {
|
||||
@ -67,9 +68,13 @@ export default function withFileActions(WrappedFileItem) {
|
||||
|
||||
dragging && setDragging(false);
|
||||
|
||||
createFoldersTree(files, uploadToFolder).then((f) => {
|
||||
if (f.length > 0) startUpload(f, null, t);
|
||||
});
|
||||
createFoldersTree(t, files, uploadToFolder)
|
||||
.then((f) => {
|
||||
if (f.length > 0) startUpload(f, null, t);
|
||||
})
|
||||
.catch((err) => {
|
||||
toastr.error(err);
|
||||
});
|
||||
};
|
||||
|
||||
onDrop = (items) => {
|
||||
|
@ -39,6 +39,7 @@ const PureAccountsItem = ({
|
||||
onClick,
|
||||
t,
|
||||
currentColorScheme,
|
||||
getLinkData,
|
||||
}) => {
|
||||
const onClickAction = React.useCallback(
|
||||
(e, id) => {
|
||||
@ -51,10 +52,13 @@ const PureAccountsItem = ({
|
||||
|
||||
const title = t("Accounts");
|
||||
|
||||
const linkData = getLinkData("accounts");
|
||||
|
||||
return (
|
||||
<ArticleItem
|
||||
key="accounts"
|
||||
text={title}
|
||||
linkData={linkData}
|
||||
title={title}
|
||||
icon={icon}
|
||||
showText={showText}
|
||||
|
@ -45,6 +45,7 @@ import BonusItem from "./BonusItem";
|
||||
import AccountsItem from "./AccountsItem";
|
||||
|
||||
import ClearTrashReactSvgUrl from "PUBLIC_DIR/images/clear.trash.react.svg?url";
|
||||
import { toastr } from "@docspace/shared/components/toast";
|
||||
|
||||
const StyledDragAndDrop = styled(DragAndDrop)`
|
||||
display: contents;
|
||||
@ -75,6 +76,7 @@ const Item = ({
|
||||
iconBadge,
|
||||
folderId,
|
||||
currentColorScheme,
|
||||
getLinkData,
|
||||
}) => {
|
||||
const [isDragActive, setIsDragActive] = useState(false);
|
||||
|
||||
@ -87,9 +89,13 @@ const Item = ({
|
||||
(files, uploadToFolder) => {
|
||||
dragging && setDragging(false);
|
||||
|
||||
createFoldersTree(files, uploadToFolder).then((f) => {
|
||||
if (f.length > 0) startUpload(f, null, t);
|
||||
});
|
||||
createFoldersTree(t, files, uploadToFolder)
|
||||
.then((f) => {
|
||||
if (f.length > 0) startUpload(f, null, t);
|
||||
})
|
||||
.catch((err) => {
|
||||
toastr.error(err);
|
||||
});
|
||||
},
|
||||
[t, dragging, setDragging, startUpload, createFoldersTree],
|
||||
);
|
||||
@ -126,18 +132,24 @@ const Item = ({
|
||||
(e, folderId) => {
|
||||
setBufferSelection(null);
|
||||
|
||||
onClick &&
|
||||
onClick(
|
||||
e,
|
||||
folderId,
|
||||
item.title,
|
||||
item.rootFolderType,
|
||||
item.security.Create,
|
||||
);
|
||||
onClick?.(
|
||||
e,
|
||||
folderId,
|
||||
item.title,
|
||||
item.rootFolderType,
|
||||
item.security.Create,
|
||||
);
|
||||
},
|
||||
[onClick, item.title, item.rootFolderType],
|
||||
);
|
||||
|
||||
const linkData = getLinkData(
|
||||
item.id,
|
||||
item.title,
|
||||
item.rootFolderType,
|
||||
item.security.Create,
|
||||
);
|
||||
|
||||
return (
|
||||
<StyledDragAndDrop
|
||||
key={item.id}
|
||||
@ -170,6 +182,7 @@ const Item = ({
|
||||
onClickBadge={onBadgeClick}
|
||||
iconBadge={iconBadge}
|
||||
badgeTitle={labelBadge ? "" : t("EmptyRecycleBin")}
|
||||
linkData={linkData}
|
||||
$currentColorScheme={currentColorScheme}
|
||||
/>
|
||||
</StyledDragAndDrop>
|
||||
@ -215,6 +228,8 @@ const Items = ({
|
||||
currentDeviceType,
|
||||
folderAccess,
|
||||
currentColorScheme,
|
||||
|
||||
getLinkData,
|
||||
}) => {
|
||||
const getEndOfBlock = React.useCallback((item) => {
|
||||
switch (item.key) {
|
||||
@ -329,6 +344,7 @@ const Items = ({
|
||||
getEndOfBlock={getEndOfBlock}
|
||||
showText={showText}
|
||||
onClick={onClick}
|
||||
getLinkData={getLinkData}
|
||||
onMoveTo={isTrash ? onRemove : onMoveTo}
|
||||
onBadgeClick={isTrash ? onEmptyTrashAction : onBadgeClick}
|
||||
showDragItems={showDragItems}
|
||||
@ -341,16 +357,6 @@ const Items = ({
|
||||
);
|
||||
});
|
||||
|
||||
/*if (!firstLoad && !isVisitor)
|
||||
items.splice(
|
||||
3,
|
||||
0,
|
||||
<SettingsItem
|
||||
key="settings-item"
|
||||
onClick={onClick}
|
||||
isActive={activeItemId === "settings"}
|
||||
/>
|
||||
);*/
|
||||
if (!isVisitor && !isCollaborator)
|
||||
items.splice(
|
||||
3,
|
||||
@ -358,6 +364,7 @@ const Items = ({
|
||||
<AccountsItem
|
||||
key="accounts-item"
|
||||
onClick={onClick}
|
||||
getLinkData={getLinkData}
|
||||
isActive={activeItemId === "accounts"}
|
||||
/>,
|
||||
);
|
||||
@ -375,6 +382,7 @@ const Items = ({
|
||||
dragging,
|
||||
getFolderIcon,
|
||||
onClick,
|
||||
getLinkData,
|
||||
onMoveTo,
|
||||
getEndOfBlock,
|
||||
onBadgeClick,
|
||||
|
@ -1,72 +0,0 @@
|
||||
// (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 React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { withTranslation } from "react-i18next";
|
||||
|
||||
import { ArticleItem } from "@docspace/shared/components/article-item";
|
||||
|
||||
import CatalogSettingsReactSvgUrl from "PUBLIC_DIR/images/catalog.settings.react.svg?url";
|
||||
|
||||
const PureSettingsItem = ({
|
||||
t,
|
||||
showText,
|
||||
isActive,
|
||||
onClick,
|
||||
currentColorScheme,
|
||||
}) => {
|
||||
const onClickAction = React.useCallback(() => {
|
||||
onClick && onClick("settings");
|
||||
}, [onClick]);
|
||||
|
||||
const title = t("Common:Settings");
|
||||
|
||||
return (
|
||||
<ArticleItem
|
||||
key="settings"
|
||||
text={title}
|
||||
title={title}
|
||||
icon={CatalogSettingsReactSvgUrl}
|
||||
showText={showText}
|
||||
onClick={onClickAction}
|
||||
isActive={isActive}
|
||||
folderId="document_catalog-settings"
|
||||
$currentColorScheme={currentColorScheme}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const SettingsItem = withTranslation(["FilesSettings", "Common"])(
|
||||
PureSettingsItem,
|
||||
);
|
||||
|
||||
export default inject(({ settingsStore }) => {
|
||||
return {
|
||||
showText: settingsStore.showText,
|
||||
currentColorScheme: settingsStore.currentColorScheme,
|
||||
};
|
||||
})(observer(SettingsItem));
|
@ -28,7 +28,7 @@ import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { withTranslation } from "react-i18next";
|
||||
|
||||
import { useNavigate, useLocation } from "react-router-dom";
|
||||
import { useLocation } from "react-router-dom";
|
||||
|
||||
import { DeviceType, RoomSearchArea } from "@docspace/shared/enums";
|
||||
import Items from "./Items";
|
||||
@ -43,9 +43,7 @@ import { getCategoryUrl } from "SRC_DIR/helpers/utils";
|
||||
import { CategoryType } from "SRC_DIR/helpers/constants";
|
||||
import { ArticleFolderLoader } from "@docspace/shared/skeletons/article";
|
||||
import { MEDIA_VIEW_URL } from "@docspace/shared/constants";
|
||||
import { combineUrl } from "@docspace/shared/utils/combineUrl";
|
||||
import { showProgress } from "@docspace/shared/utils/common";
|
||||
import { openingNewTab } from "@docspace/shared/utils/openingNewTab";
|
||||
|
||||
const ArticleBodyContent = (props) => {
|
||||
const {
|
||||
@ -77,18 +75,13 @@ const ArticleBodyContent = (props) => {
|
||||
isFrame,
|
||||
} = props;
|
||||
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
|
||||
const [disableBadgeClick, setDisableBadgeClick] = React.useState(false);
|
||||
const [activeItemId, setActiveItemId] = React.useState(null);
|
||||
|
||||
const isAccounts = location.pathname.includes("accounts/filter");
|
||||
|
||||
const onClick = React.useCallback(
|
||||
(e, folderId, title, rootFolderType, canCreate) => {
|
||||
const { toggleArticleOpen } = props;
|
||||
|
||||
const getLinkData = React.useCallback(
|
||||
(folderId, title, rootFolderType, canCreate) => {
|
||||
let params = null;
|
||||
let path = ``;
|
||||
|
||||
@ -100,8 +93,6 @@ const ArticleBodyContent = (props) => {
|
||||
canCreate,
|
||||
};
|
||||
|
||||
let withTimer = !!selectedFolderId;
|
||||
|
||||
switch (folderId) {
|
||||
case myFolderId:
|
||||
const myFilter = FilesFilter.getDefault();
|
||||
@ -155,17 +146,7 @@ const ArticleBodyContent = (props) => {
|
||||
params = accountsFilter.toUrlParams();
|
||||
path = getCategoryUrl(CategoryType.Accounts);
|
||||
|
||||
withTimer = false;
|
||||
|
||||
break;
|
||||
case "settings":
|
||||
path = getCategoryUrl(CategoryType.Settings);
|
||||
navigate(path);
|
||||
|
||||
if (currentDeviceType === DeviceType.mobile) {
|
||||
toggleArticleOpen();
|
||||
}
|
||||
return;
|
||||
case roomsFolderId:
|
||||
default:
|
||||
const roomsFilter = RoomsFilter.getDefault(
|
||||
@ -181,16 +162,33 @@ const ArticleBodyContent = (props) => {
|
||||
|
||||
path += `?${params}&date=${new Date().getTime()}`;
|
||||
|
||||
if (openingNewTab(path, e)) return;
|
||||
return { path, state };
|
||||
},
|
||||
[
|
||||
roomsFolderId,
|
||||
archiveFolderId,
|
||||
myFolderId,
|
||||
recycleBinFolderId,
|
||||
activeItemId,
|
||||
],
|
||||
);
|
||||
|
||||
if (folderId === "accounts" || folderId === "settings") clearFiles();
|
||||
const onClick = React.useCallback(
|
||||
(e, folderId) => {
|
||||
if (e?.ctrlKey || e?.metaKey || e?.shiftKey || e?.button) return;
|
||||
|
||||
setSelection && setSelection([]);
|
||||
const { toggleArticleOpen } = props;
|
||||
|
||||
const isAccountsClick = folderId === "accounts";
|
||||
|
||||
let withTimer = isAccountsClick ? false : !!selectedFolderId;
|
||||
|
||||
if (isAccountsClick) clearFiles();
|
||||
|
||||
setSelection?.([]);
|
||||
|
||||
setIsLoading(true, withTimer);
|
||||
|
||||
navigate(path, { state });
|
||||
|
||||
if (currentDeviceType === DeviceType.mobile) {
|
||||
toggleArticleOpen();
|
||||
}
|
||||
@ -202,7 +200,7 @@ const ArticleBodyContent = (props) => {
|
||||
recycleBinFolderId,
|
||||
activeItemId,
|
||||
selectedFolderId,
|
||||
isAccounts,
|
||||
|
||||
setSelection,
|
||||
],
|
||||
);
|
||||
@ -281,6 +279,7 @@ const ArticleBodyContent = (props) => {
|
||||
<Items
|
||||
onClick={onClick}
|
||||
onBadgeClick={onShowNewFilesPanel}
|
||||
getLinkData={getLinkData}
|
||||
showText={showText}
|
||||
onHide={toggleArticleOpen}
|
||||
activeItemId={activeItemId}
|
||||
|
@ -245,9 +245,13 @@ const ArticleMainButtonContent = (props) => {
|
||||
async (e) => {
|
||||
const files = await getFilesFromEvent(e);
|
||||
|
||||
createFoldersTree(files).then((f) => {
|
||||
if (f.length > 0) startUpload(f, null, t);
|
||||
});
|
||||
createFoldersTree(t, files)
|
||||
.then((f) => {
|
||||
if (f.length > 0) startUpload(f, null, t);
|
||||
})
|
||||
.catch((err) => {
|
||||
toastr.error(err);
|
||||
});
|
||||
},
|
||||
[startUpload, t],
|
||||
);
|
||||
|
@ -116,6 +116,10 @@ export const RegisterContainer = styled.div`
|
||||
.email-container{
|
||||
${(props) => props.registrationForm && "display:none"};
|
||||
}
|
||||
|
||||
.terms-conditions{
|
||||
margin: 20px 0;
|
||||
}
|
||||
@media ${tablet} {
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -74,6 +74,7 @@ import LanguageComboboxWrapper from "./LanguageCombobox";
|
||||
import withCultureNames from "SRC_DIR/HOCs/withCultureNames";
|
||||
|
||||
import { setCookie } from "@docspace/shared/utils/cookie";
|
||||
import { ColorTheme, ThemeId } from "@docspace/shared/components/color-theme";
|
||||
|
||||
const DEFAULT_ROOM_TEXT =
|
||||
"<strong>{{firstName}} {{lastName}}</strong> invites you to join the room <strong>{{roomName}}</strong> for secure document collaboration.";
|
||||
@ -113,6 +114,9 @@ const CreateUserForm = (props) => {
|
||||
defaultPage,
|
||||
cultures,
|
||||
i18n,
|
||||
|
||||
licenseUrl,
|
||||
legalTerms,
|
||||
} = props;
|
||||
|
||||
const currentCultureName = i18n.language;
|
||||
@ -473,6 +477,37 @@ const CreateUserForm = (props) => {
|
||||
}
|
||||
: {};
|
||||
|
||||
const termsConditionsComponent = (
|
||||
<div className="terms-conditions">
|
||||
<Text fontSize={"12px"} textAlign="center">
|
||||
<Trans
|
||||
t={t}
|
||||
ns="Confirm"
|
||||
i18nKey="TermsAndConditions"
|
||||
components={{
|
||||
1: (
|
||||
<ColorTheme
|
||||
tag="a"
|
||||
themeId={ThemeId.Link}
|
||||
href={licenseUrl}
|
||||
target="_blank"
|
||||
fontSize={"12px"}
|
||||
/>
|
||||
),
|
||||
2: (
|
||||
<ColorTheme
|
||||
tag="a"
|
||||
themeId={ThemeId.Link}
|
||||
href={legalTerms}
|
||||
target="_blank"
|
||||
fontSize={"12px"}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Text>
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<StyledPage>
|
||||
<LanguageComboboxWrapper
|
||||
@ -687,6 +722,8 @@ const CreateUserForm = (props) => {
|
||||
/>
|
||||
</FieldContainer>
|
||||
|
||||
{termsConditionsComponent}
|
||||
|
||||
<Button
|
||||
className="login-button"
|
||||
primary
|
||||
@ -738,6 +775,8 @@ export default inject(({ settingsStore, authStore }) => {
|
||||
currentColorScheme,
|
||||
userNameRegex,
|
||||
cultures,
|
||||
licenseUrl,
|
||||
legalTerms,
|
||||
} = settingsStore;
|
||||
return {
|
||||
settings: passwordSettings,
|
||||
@ -752,6 +791,9 @@ export default inject(({ settingsStore, authStore }) => {
|
||||
currentColorScheme,
|
||||
userNameRegex,
|
||||
cultures,
|
||||
|
||||
licenseUrl,
|
||||
legalTerms,
|
||||
};
|
||||
})(
|
||||
withCultureNames(
|
||||
|
@ -45,6 +45,7 @@ import { useParams } from "react-router-dom";
|
||||
|
||||
import { getCategoryType, getCategoryUrl } from "SRC_DIR/helpers/utils";
|
||||
import { CategoryType } from "SRC_DIR/helpers/constants";
|
||||
import { toastr } from "@docspace/shared/components/toast";
|
||||
|
||||
const useFiles = ({
|
||||
t,
|
||||
@ -118,9 +119,13 @@ const useFiles = ({
|
||||
|
||||
if (disableDrag) return;
|
||||
|
||||
createFoldersTree(files, uploadToFolder).then((f) => {
|
||||
if (f.length > 0) startUpload(f, null, t);
|
||||
});
|
||||
createFoldersTree(t, files, uploadToFolder)
|
||||
.then((f) => {
|
||||
if (f.length > 0) startUpload(f, null, t);
|
||||
})
|
||||
.catch((err) => {
|
||||
toastr.error(err);
|
||||
});
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
|
@ -51,6 +51,7 @@ import {
|
||||
} from "SRC_DIR/helpers/utils";
|
||||
import TariffBar from "SRC_DIR/components/TariffBar";
|
||||
import getFilesFromEvent from "@docspace/shared/components/drag-and-drop/get-files-from-event";
|
||||
import { toastr } from "@docspace/shared/components/toast";
|
||||
|
||||
const StyledContainer = styled.div`
|
||||
width: 100%;
|
||||
@ -244,9 +245,13 @@ const SectionHeaderContent = (props) => {
|
||||
async (e) => {
|
||||
const files = await getFilesFromEvent(e);
|
||||
|
||||
createFoldersTree(files).then((f) => {
|
||||
if (f.length > 0) startUpload(f, null, t);
|
||||
});
|
||||
createFoldersTree(t, files)
|
||||
.then((f) => {
|
||||
if (f.length > 0) startUpload(f, null, t);
|
||||
})
|
||||
.catch((err) => {
|
||||
toastr.error(err);
|
||||
});
|
||||
},
|
||||
[startUpload, t],
|
||||
);
|
||||
|
@ -173,26 +173,19 @@ const ArticleBodyContent = (props) => {
|
||||
selectedKeys,
|
||||
]);
|
||||
|
||||
const onSelect = (value, e) => {
|
||||
if (isArrayEqual([value], selectedKeys)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const settingsPath = `/portal-settings${getSelectedLinkByKey(
|
||||
const getLinkData = (value) => {
|
||||
const path = `/portal-settings${getSelectedLinkByKey(
|
||||
value + "-0",
|
||||
settingsTree,
|
||||
)}`;
|
||||
|
||||
if (openingNewTab(settingsPath, e)) return;
|
||||
// setSelectedKeys([value + "-0"]);
|
||||
return { path, state: {} };
|
||||
};
|
||||
|
||||
const onSelect = (value, e) => {
|
||||
if (currentDeviceType === DeviceType.mobile) {
|
||||
toggleArticleOpen();
|
||||
}
|
||||
|
||||
if (settingsPath === location.pathname) return;
|
||||
|
||||
navigate(`${settingsPath}`);
|
||||
};
|
||||
|
||||
const mapKeys = (tKey) => {
|
||||
@ -303,6 +296,7 @@ const ArticleBodyContent = (props) => {
|
||||
const patternSearching = selectedKeys[0].split("-");
|
||||
const selectedKey = patternSearching[0];
|
||||
const title = mapKeys(item.tKey);
|
||||
const linkData = getLinkData(item.key);
|
||||
|
||||
items.push(
|
||||
<ArticleItem
|
||||
@ -315,6 +309,7 @@ const ArticleBodyContent = (props) => {
|
||||
value={item.link}
|
||||
isActive={item.key === selectedKey}
|
||||
onClick={(e) => onSelect(item.key, e)}
|
||||
linkData={linkData}
|
||||
folderId={item.id}
|
||||
style={{
|
||||
marginTop: `${item.key.includes(9) ? "16px" : "0"}`,
|
||||
|
@ -91,7 +91,7 @@ const Wizard = (props) => {
|
||||
getIsRequiredLicense,
|
||||
getPortalTimezones,
|
||||
machineName,
|
||||
urlLicense,
|
||||
licenseUrl,
|
||||
theme,
|
||||
cultureNames,
|
||||
culture,
|
||||
@ -496,11 +496,7 @@ const Wizard = (props) => {
|
||||
}
|
||||
fontSize="13px"
|
||||
target="_blank"
|
||||
href={
|
||||
urlLicense
|
||||
? urlLicense
|
||||
: "https://gnu.org/licenses/gpl-3.0.html"
|
||||
}
|
||||
href={licenseUrl}
|
||||
>
|
||||
{t("LicenseLink")}
|
||||
</Link>
|
||||
@ -527,7 +523,7 @@ export default inject(({ authStore, settingsStore, wizardStore }) => {
|
||||
passwordSettings,
|
||||
wizardToken,
|
||||
timezone,
|
||||
urlLicense,
|
||||
licenseUrl,
|
||||
hashSettings,
|
||||
setWizardComplete,
|
||||
getPortalTimezones,
|
||||
@ -556,7 +552,7 @@ export default inject(({ authStore, settingsStore, wizardStore }) => {
|
||||
wizardToken,
|
||||
passwordSettings,
|
||||
timezone,
|
||||
urlLicense,
|
||||
licenseUrl,
|
||||
hashSettings,
|
||||
isWizardLoaded,
|
||||
machineName,
|
||||
|
@ -79,7 +79,11 @@ import { CategoryType } from "SRC_DIR/helpers/constants";
|
||||
import RoomsFilter from "@docspace/shared/api/rooms/filter";
|
||||
import AccountsFilter from "@docspace/shared/api/people/filter";
|
||||
import { RoomSearchArea, UrlActionType } from "@docspace/shared/enums";
|
||||
import { getObjectByLocation } from "@docspace/shared/utils/common";
|
||||
import {
|
||||
getConvertedQuota,
|
||||
getConvertedSize,
|
||||
getObjectByLocation,
|
||||
} from "@docspace/shared/utils/common";
|
||||
import uniqueid from "lodash/uniqueId";
|
||||
import FilesFilter from "@docspace/shared/api/files/filter";
|
||||
import {
|
||||
@ -280,13 +284,41 @@ class FilesActionStore {
|
||||
return treeList;
|
||||
};
|
||||
|
||||
createFoldersTree = async (files, folderId) => {
|
||||
createFoldersTree = async (t, files, folderId) => {
|
||||
//console.log("createFoldersTree", files, folderId);
|
||||
|
||||
const { primaryProgressDataStore } = this.uploadDataStore;
|
||||
|
||||
const { setPrimaryProgressBarData, clearPrimaryProgressData } =
|
||||
primaryProgressDataStore;
|
||||
this.uploadDataStore.primaryProgressDataStore;
|
||||
|
||||
const roomFolder = this.selectedFolderStore.navigationPath.find(
|
||||
(r) => r.isRoom,
|
||||
);
|
||||
|
||||
const withoutHiddenFiles = Object.values(files).filter((f) => {
|
||||
const isHidden = /(^|\/)\.[^\/\.]/g.test(f.name);
|
||||
|
||||
return !isHidden;
|
||||
});
|
||||
|
||||
if (roomFolder && roomFolder.quotaLimit) {
|
||||
const freeSpace = roomFolder.quotaLimit - roomFolder.usedSpace;
|
||||
|
||||
const filesSize = withoutHiddenFiles.reduce((acc, file) => {
|
||||
return acc + file.size;
|
||||
}, 0);
|
||||
|
||||
if (filesSize > freeSpace) {
|
||||
clearPrimaryProgressData();
|
||||
|
||||
const size = getConvertedSize(t, roomFolder.quotaLimit);
|
||||
|
||||
throw new Error(
|
||||
t("Common:RoomSpaceQuotaExceeded", {
|
||||
size,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const operationId = uniqueid("operation_");
|
||||
|
||||
@ -302,7 +334,7 @@ class FilesActionStore {
|
||||
|
||||
setPrimaryProgressBarData({ ...pbData, disableUploadPanelOpen: true });
|
||||
|
||||
const tree = this.convertToTree(files);
|
||||
const tree = this.convertToTree(withoutHiddenFiles);
|
||||
|
||||
const filesList = [];
|
||||
await this.createFolderTree(tree, toFolderId, filesList);
|
||||
|
@ -1606,13 +1606,16 @@ class FilesStore {
|
||||
(data.current.rootFolderType === Rooms ||
|
||||
data.current.rootFolderType === Archive);
|
||||
|
||||
let shared;
|
||||
let shared, quotaLimit, usedSpace;
|
||||
if (idx === 1) {
|
||||
let room = data.current;
|
||||
|
||||
if (!isCurrentFolder) {
|
||||
room = await api.files.getFolderInfo(folderId);
|
||||
|
||||
shared = room.shared;
|
||||
quotaLimit = room.quotaLimit;
|
||||
usedSpace = room.usedSpace;
|
||||
|
||||
this.infoPanelStore.setInfoPanelRoom(room);
|
||||
}
|
||||
@ -1631,6 +1634,8 @@ class FilesStore {
|
||||
roomType,
|
||||
isRootRoom,
|
||||
shared,
|
||||
quotaLimit,
|
||||
usedSpace,
|
||||
};
|
||||
}),
|
||||
).then((res) => {
|
||||
|
@ -692,9 +692,13 @@ class HotkeyStore {
|
||||
|
||||
const files = await getFilesFromEvent(event);
|
||||
|
||||
createFoldersTree(files).then((f) => {
|
||||
if (f.length > 0) startUpload(f, null, t);
|
||||
});
|
||||
createFoldersTree(t, files)
|
||||
.then((f) => {
|
||||
if (f.length > 0) startUpload(f, null, t);
|
||||
})
|
||||
.catch((err) => {
|
||||
toastr.error(err);
|
||||
});
|
||||
};
|
||||
|
||||
get countTilesInRow() {
|
||||
|
@ -714,14 +714,6 @@ class UploadDataStore {
|
||||
};
|
||||
|
||||
startUpload = (uploadFiles, folderId, t) => {
|
||||
const withoutHiddenFiles = Object.values(uploadFiles).filter((f) => {
|
||||
const isHidden = /(^|\/)\.[^\/\.]/g.test(f.name);
|
||||
|
||||
return !isHidden;
|
||||
});
|
||||
|
||||
console.log("startUpload", { withoutHiddenFiles, uploadFiles });
|
||||
|
||||
const { canConvert } = this.filesSettingsStore;
|
||||
|
||||
const toFolderId = folderId ? folderId : this.selectedFolderStore.id;
|
||||
@ -743,10 +735,10 @@ class UploadDataStore {
|
||||
let filesSize = 0;
|
||||
let convertSize = 0;
|
||||
|
||||
const uploadFilesArray = Object.keys(withoutHiddenFiles);
|
||||
const uploadFilesArray = Object.keys(uploadFiles);
|
||||
const hasFolder =
|
||||
uploadFilesArray.findIndex((_, ind) => {
|
||||
const file = withoutHiddenFiles[ind];
|
||||
const file = uploadFiles[ind];
|
||||
|
||||
const filePath = file.path
|
||||
? file.path
|
||||
@ -761,13 +753,13 @@ class UploadDataStore {
|
||||
if (this.uploaded) {
|
||||
this.isParallel = false;
|
||||
} else if (this.isParallel) {
|
||||
this.tempFiles.push({ withoutHiddenFiles, folderId, t });
|
||||
this.tempFiles.push({ uploadFiles, folderId, t });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (let index of uploadFilesArray) {
|
||||
const file = withoutHiddenFiles[index];
|
||||
const file = uploadFiles[index];
|
||||
|
||||
const parts = file.name.split(".");
|
||||
const ext = parts.length > 1 ? "." + parts.pop() : "";
|
||||
|
@ -68,18 +68,11 @@ const ArticleBodyContent = () => {
|
||||
}, []);
|
||||
|
||||
const onClickItem = (item: TSettingsTreeItem, e: React.MouseEvent) => {
|
||||
const path = item.link;
|
||||
const url = combineUrl(PROXY_BASE_URL, path);
|
||||
|
||||
if (openingNewTab(url, e)) return;
|
||||
|
||||
setSelectedKey(item?.key);
|
||||
|
||||
if (isMobileOnly || isMobile()) {
|
||||
toggleArticleOpen();
|
||||
}
|
||||
|
||||
navigate(path);
|
||||
};
|
||||
|
||||
const catalogItems = () => {
|
||||
@ -108,6 +101,7 @@ const ArticleBodyContent = () => {
|
||||
onClick={(e) => onClickItem(item, e)}
|
||||
folderId={item.id}
|
||||
$currentColorScheme={currentColorScheme}
|
||||
linkData={{ path: item.link, state: {} }}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
import React from "react";
|
||||
import { ReactSVG } from "react-svg";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
import { Text } from "../text";
|
||||
|
||||
@ -69,6 +70,7 @@ export const ArticleItemPure = (props: ArticleItemProps) => {
|
||||
badgeTitle,
|
||||
$currentColorScheme,
|
||||
title,
|
||||
linkData,
|
||||
} = props;
|
||||
|
||||
const onClickAction = (e: React.MouseEvent) => {
|
||||
@ -105,62 +107,68 @@ export const ArticleItemPure = (props: ArticleItemProps) => {
|
||||
|
||||
const renderItem = () => {
|
||||
return (
|
||||
<StyledArticleItemTheme
|
||||
className={className}
|
||||
style={style}
|
||||
showText={showText}
|
||||
isEndOfBlock={isEndOfBlock}
|
||||
isActive={isActive}
|
||||
data-testid="article-item"
|
||||
$currentColorScheme={$currentColorScheme}
|
||||
title={tooltipTitle}
|
||||
<Link
|
||||
style={{ textDecoration: "none" }}
|
||||
to={linkData?.path}
|
||||
state={linkData?.state}
|
||||
>
|
||||
<StyledArticleItemSibling
|
||||
id={folderId}
|
||||
<StyledArticleItemTheme
|
||||
className={className}
|
||||
style={style}
|
||||
showText={showText}
|
||||
isEndOfBlock={isEndOfBlock}
|
||||
isActive={isActive}
|
||||
isDragging={isDragging}
|
||||
isDragActive={isDragActive}
|
||||
onClick={onClickAction}
|
||||
onMouseUp={onMouseUpAction}
|
||||
onMouseDown={onMouseDown}
|
||||
/>
|
||||
<StyledArticleItemImg isActive={isActive}>
|
||||
<ReactSVG className="icon" src={icon} />
|
||||
{!showText && (
|
||||
<>
|
||||
{showInitial && (
|
||||
<StyledArticleItemInitialText>
|
||||
{getInitial(text)}
|
||||
</StyledArticleItemInitialText>
|
||||
)}
|
||||
{showBadge && !iconBadge && (
|
||||
<StyledArticleItemBadgeWrapper
|
||||
onClick={onClickBadgeAction}
|
||||
showText={showText}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</StyledArticleItemImg>
|
||||
{showText && (
|
||||
<StyledArticleItemText isActive={isActive} noSelect>
|
||||
{text}
|
||||
</StyledArticleItemText>
|
||||
)}
|
||||
{showBadge && showText && (
|
||||
<StyledArticleItemBadgeWrapper
|
||||
showText={showText}
|
||||
onClick={onClickBadgeAction}
|
||||
title={badgeTitle}
|
||||
>
|
||||
{!iconBadge ? (
|
||||
<Badge className="catalog-item__badge" label={labelBadge} />
|
||||
) : (
|
||||
<ReactSVG className="catalog-item__icon" src={iconBadge} />
|
||||
data-testid="article-item"
|
||||
$currentColorScheme={$currentColorScheme}
|
||||
title={tooltipTitle}
|
||||
>
|
||||
<StyledArticleItemSibling
|
||||
id={folderId}
|
||||
isActive={isActive}
|
||||
isDragging={isDragging}
|
||||
isDragActive={isDragActive}
|
||||
onClick={onClickAction}
|
||||
onMouseUp={onMouseUpAction}
|
||||
onMouseDown={onMouseDown}
|
||||
/>
|
||||
<StyledArticleItemImg isActive={isActive}>
|
||||
<ReactSVG className="icon" src={icon} />
|
||||
{!showText && (
|
||||
<>
|
||||
{showInitial && (
|
||||
<StyledArticleItemInitialText>
|
||||
{getInitial(text)}
|
||||
</StyledArticleItemInitialText>
|
||||
)}
|
||||
{showBadge && !iconBadge && (
|
||||
<StyledArticleItemBadgeWrapper
|
||||
onClick={onClickBadgeAction}
|
||||
showText={showText}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</StyledArticleItemBadgeWrapper>
|
||||
)}
|
||||
</StyledArticleItemTheme>
|
||||
</StyledArticleItemImg>
|
||||
{showText && (
|
||||
<StyledArticleItemText isActive={isActive} noSelect>
|
||||
{text}
|
||||
</StyledArticleItemText>
|
||||
)}
|
||||
{showBadge && showText && (
|
||||
<StyledArticleItemBadgeWrapper
|
||||
showText={showText}
|
||||
onClick={onClickBadgeAction}
|
||||
title={badgeTitle}
|
||||
>
|
||||
{!iconBadge ? (
|
||||
<Badge className="catalog-item__badge" label={labelBadge} />
|
||||
) : (
|
||||
<ReactSVG className="catalog-item__icon" src={iconBadge} />
|
||||
)}
|
||||
</StyledArticleItemBadgeWrapper>
|
||||
)}
|
||||
</StyledArticleItemTheme>
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -26,6 +26,21 @@
|
||||
|
||||
import { TColorScheme } from "../../themes";
|
||||
|
||||
export type TArticleLinkDataState =
|
||||
| {
|
||||
title: string;
|
||||
isRoot: boolean;
|
||||
isPublicRoomType: boolean;
|
||||
rootFolderType: number;
|
||||
canCreate: boolean;
|
||||
}
|
||||
| {};
|
||||
|
||||
export type TArticleLinkData = {
|
||||
path: string;
|
||||
state: TArticleLinkDataState;
|
||||
};
|
||||
|
||||
export interface ArticleItemProps {
|
||||
/** Accepts className */
|
||||
className?: string;
|
||||
@ -70,4 +85,5 @@ export interface ArticleItemProps {
|
||||
badgeTitle?: string;
|
||||
$currentColorScheme?: TColorScheme;
|
||||
title?: string;
|
||||
linkData: TArticleLinkData;
|
||||
}
|
||||
|
@ -162,8 +162,6 @@ class SettingsStore {
|
||||
|
||||
enabledJoin = false;
|
||||
|
||||
urlLicense = "https://gnu.org/licenses/gpl-3.0.html";
|
||||
|
||||
urlSupport = "https://helpdesk.onlyoffice.com/";
|
||||
|
||||
forumLink = null;
|
||||
|
@ -515,5 +515,6 @@
|
||||
"Website": "Website",
|
||||
"Yes": "Yes",
|
||||
"Yesterday": "Yesterday",
|
||||
"You": "You"
|
||||
"You": "You",
|
||||
"RoomSpaceQuotaExceeded": "Room space quota exceeded ({{size}})."
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user