Merge branch 'develop' into feature/login-nextjs

This commit is contained in:
Timofey Boyko 2024-04-15 16:53:34 +03:00
commit 4d066fb839
28 changed files with 47 additions and 106 deletions

View File

@ -1,42 +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 { inject, observer } from "mobx-react";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
import type { DocspaceLogoProps } from "@docspace/shared/components/docspace-logo/DocspaceLogo.types";
const DocspaceLogoWrapper = ({ className }: Partial<DocspaceLogoProps>) => {
return <DocspaceLogo className={className} />;
};
export default inject<TStore>(({ settingsStore }) => {
const { whiteLabelLogoUrls } = settingsStore;
return {
whiteLabelLogoUrls,
};
})(observer(DocspaceLogoWrapper));

View File

@ -154,17 +154,14 @@ const ThirdPartyComboBox = ({
const options = thirdparties.map((item) => ({
label: item.title,
title: item.title,
key: item?.category ?? item.id,
}));
const onSelect = (elem) => {
console.log("123a", elem);
console.log("thirdparties", thirdparties);
const thirdparty = thirdparties.find(
(t) => elem.key === t.id || elem.key === t.category,
);
console.log("thirdparty", thirdparty);
thirdparty && setStorageLocaiton(thirdparty);
};
@ -184,7 +181,6 @@ const ThirdPartyComboBox = ({
scaled
withBackdrop={isMobile}
size="content"
title={t("Common:Role")}
manualWidth={"fit-content"}
isMobileView={isMobileOnly}
directionY="both"

View File

@ -79,8 +79,7 @@ const StyledInvitePanel = styled.div`
}
.invite-panel-body {
height: ${(props) =>
props.hasInvitedUsers ? "calc(100% - 55px - 73px)" : "calc(100% - 55px)"};
height: calc(100% - 55px - 73px);
.scroll-body {
${(props) =>

View File

@ -111,7 +111,6 @@ const InvitePanel = ({
const invitePanelBodyRef = useRef();
const invitePanelWrapper = useRef(null);
const invitePanelRef = useRef(null);
const windowHeight = useRef(window.innerHeight);
const loaderRef = useRef();
const onChangeExternalLinksVisible = (visible) => {

View File

@ -50,7 +50,7 @@ import {
RegisterContainer,
StyledCreateUserContent,
} from "./StyledCreateUser";
import DocspaceLogo from "SRC_DIR/components/DocspaceLogoWrapper";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
import GreetingUserContainer from "./GreetingUserContainer";
const ActivateUserForm = (props) => {

View File

@ -39,7 +39,7 @@ import {
import withLoader from "../withLoader";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { toastr } from "@docspace/shared/components/toast";
import DocspaceLogo from "../../../components/DocspaceLogoWrapper";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
import { ownerChange } from "@docspace/shared/api/settings";
import { getUserFromConfirm } from "@docspace/shared/api/people";

View File

@ -39,7 +39,7 @@ import { createPasswordHash } from "@docspace/shared/utils/common";
import { login } from "@docspace/shared/utils/loginUtils";
import { getPasswordErrorMessage } from "@docspace/shared/utils/getPasswordErrorMessage";
import DocspaceLogo from "../../../components/DocspaceLogoWrapper";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
import withLoader from "../withLoader";
import { StyledPage, StyledBody, StyledContent } from "./StyledConfirm";

View File

@ -34,7 +34,7 @@ import { inject, observer } from "mobx-react";
import { StyledPage, StyledBody, StyledContent } from "./StyledConfirm";
import withLoader from "../withLoader";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import DocspaceLogo from "../../../components/DocspaceLogoWrapper";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
const ChangePhoneForm = (props) => {
const { t, greetingTitle } = props;

View File

@ -43,7 +43,7 @@ import {
import withLoader from "../withLoader";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import DocspaceLogo from "../../../components/DocspaceLogoWrapper";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
const ContinuePortal = (props) => {
const { t, greetingTitle, linkData } = props;

View File

@ -58,7 +58,7 @@ import { IconButton } from "@docspace/shared/components/icon-button";
import { ColorTheme, ThemeId } from "@docspace/shared/components/color-theme";
import { getPasswordErrorMessage } from "@docspace/shared/utils/getPasswordErrorMessage";
import DocspaceLogo from "SRC_DIR/components/DocspaceLogoWrapper";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
import withLoader from "../withLoader";
import { StyledPage } from "./StyledConfirm";

View File

@ -43,7 +43,7 @@ import {
import withLoader from "../withLoader";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import DocspaceLogo from "../../../components/DocspaceLogoWrapper";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
const DeactivatePortal = (props) => {
const { t, greetingTitle, linkData, companyInfoSettingsData } = props;

View File

@ -36,7 +36,7 @@ import { toastr } from "@docspace/shared/components/toast";
import { StyledPage, StyledBody, StyledContent } from "./StyledConfirm";
import withLoader from "../withLoader";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import DocspaceLogo from "../../../components/DocspaceLogoWrapper";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
const ProfileRemoveForm = (props) => {
const { t, greetingTitle, linkData, legalTerms, currentColorScheme } = props;

View File

@ -44,7 +44,7 @@ import {
import withLoader from "../withLoader";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import DocspaceLogo from "../../../components/DocspaceLogoWrapper";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
const RemovePortal = (props) => {
const { t, greetingTitle, linkData, companyInfoSettingsData } = props;

View File

@ -41,7 +41,7 @@ import ErrorContainer from "@docspace/shared/components/error-container/ErrorCon
import { mobile, tablet } from "@docspace/shared/utils";
import { Link } from "@docspace/shared/components/link";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import DocspaceLogo from "../../../components/DocspaceLogoWrapper";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
import { StyledPage, StyledContent } from "./StyledConfirm";
import {
getTfaSecretKeyAndQR,

View File

@ -38,7 +38,7 @@ import { toastr } from "@docspace/shared/components/toast";
import withLoader from "../withLoader";
import { mobile } from "@docspace/shared/utils";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import DocspaceLogo from "../../../components/DocspaceLogoWrapper";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
import { StyledPage, StyledContent } from "./StyledConfirm";
import { validateTfaCode } from "@docspace/shared/api/settings";
import { loginWithTfaCode } from "@docspace/shared/api/user";

View File

@ -200,7 +200,7 @@ const SelectFileStep = ({
uploadInterval.current = setInterval(async () => {
try {
const res = await getMigrationStatus();
setProgress(res.progress);
setProgress(res?.progress);
if (res.progress > 10) {
setIsVisible(false);
@ -233,6 +233,7 @@ const SelectFileStep = ({
) {
setUsers(res.parseResult);
setShowReminder(true);
setIsBackupEmpty(false);
} else {
setIsBackupEmpty(true);
cancelMigration();

View File

@ -187,7 +187,7 @@ const SelectFileStep = ({
uploadInterval.current = setInterval(async () => {
try {
const res = await getMigrationStatus();
setProgress(res.progress);
setProgress(res?.progress);
if (res.progress > 10) {
setIsVisible(false);

View File

@ -87,6 +87,7 @@ const DataImportLoader = () => {
<div className="content">
<RectangleSkeleton className="item" width="340px" height="64px" />
<RectangleSkeleton className="item" width="340px" height="64px" />
<RectangleSkeleton className="item" width="340px" height="64px" />
</div>
</StyledLoader>
);

View File

@ -270,7 +270,7 @@ const DocumentService = ({
cancelButtonLabel={t("Common:Restore")}
reminderText={t("Settings:YouHaveUnsavedChanges")}
saveButtonDisabled={saveButtonDisabled}
cancelButtonDisabled={
disableRestoreToDefault={
isDefaultSettings || isSaveLoading || isResetLoading
}
displaySettings={true}

View File

@ -36,7 +36,7 @@ import { StyledPage, StyledBody, StyledContent } from "./RoomStyles";
import { frameCallCommand } from "@docspace/shared/utils/common";
import { toastr } from "@docspace/shared/components/toast";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import DocspaceLogo from "../../../components/DocspaceLogoWrapper";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
import { ValidationStatus } from "../../../helpers/constants";
import PublicRoomIcon from "PUBLIC_DIR/images/icons/32/room/public.svg";

View File

@ -67,8 +67,7 @@ import {
StyledContent,
} from "./StyledWizard";
import { getUserTimezone, getSelectZone } from "./timezonesHelper";
import DocspaceLogo from "../../components/DocspaceLogoWrapper";
import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
import RefreshReactSvgUrl from "PUBLIC_DIR/images/refresh.react.svg?url";
import {
DEFAULT_SELECT_TIMEZONE,

View File

@ -29,15 +29,15 @@ import styled, { css } from "styled-components";
import { mobile } from "@docspace/shared/utils";
export const StyledWrapper = styled.div<{
currentDeviceType?: string;
isResizing?: boolean;
isMobile?: boolean;
isResizable?: boolean;
}>`
@media ${mobile} {
${(props) => !props.isResizing && "display: none"};
${(props) => !props.isResizable && "display: none"};
${(props) =>
props.currentDeviceType === "mobile" &&
props.isResizing &&
props.isMobile &&
props.isResizable &&
css`
display: flex;
background-color: ${props.theme.header.backgroundColor};

View File

@ -24,48 +24,46 @@
// 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 React, { useState } from "react";
import { useTheme } from "styled-components";
import { inject, observer } from "mobx-react";
import { classNames, getLogoUrl } from "@docspace/shared/utils";
import { DeviceType, WhiteLabelLogoType } from "../../enums";
import { WhiteLabelLogoType } from "../../enums";
import { size as deviceSize } from "../../utils";
import { StyledWrapper } from "./DocspaceLogo.styled";
import type { DocspaceLogoProps } from "./DocspaceLogo.types";
const DocspaceLogo = ({
className,
isResizing = false,
currentDeviceType,
setWindowWidth,
isResizable = false,
}: DocspaceLogoProps) => {
const theme = useTheme();
const [size, setSize] = useState(window.innerWidth);
const onResize = () => {
if (setWindowWidth) setWindowWidth(window.innerWidth);
setSize(window.innerWidth);
};
React.useEffect(() => {
if (isResizing) window.addEventListener("resize", onResize);
if (isResizable) window.addEventListener("resize", onResize);
return () => {
window.removeEventListener("resize", onResize);
};
}, []);
}, [isResizable]);
const isMobile = size <= deviceSize.mobile;
const logoSize =
isResizing && currentDeviceType === DeviceType.mobile
isResizable && isMobile
? WhiteLabelLogoType.LightSmall
: WhiteLabelLogoType.LoginPage;
const logo = getLogoUrl(logoSize, !theme.isBase);
return (
<StyledWrapper
currentDeviceType={currentDeviceType}
isResizing={isResizing}
>
<StyledWrapper isMobile={isMobile} isResizable={isResizable} logo={!!logo}>
{logo && (
<img
src={logo}
@ -77,11 +75,4 @@ const DocspaceLogo = ({
);
};
export default inject(({ settingsStore }) => {
const { currentDeviceType, setWindowWidth } = settingsStore;
return {
currentDeviceType,
setWindowWidth,
};
})(observer(DocspaceLogo));
export default DocspaceLogo;

View File

@ -26,8 +26,5 @@
export interface DocspaceLogoProps {
className?: string;
size?: string;
isResizing?: boolean;
currentDeviceType?: string;
setWindowWidth?: (res: number) => void;
isResizable?: boolean;
}

View File

@ -53,7 +53,7 @@ const ErrorContainer = (props: ErrorContainerProps) => {
isEditor={isEditor}
data-testid="ErrorContainer"
>
<DocspaceLogo isResizing />
<DocspaceLogo isResizable />
<div id="container">
<svg
id="background"

View File

@ -29,10 +29,6 @@ import { mobile } from "../../utils";
export const ErrorUnavailableWrapper = styled.div`
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 64px;
`;

View File

@ -284,6 +284,8 @@
})
.replace(lt, rlt)
.replace(gt, rgt);
const windowHeight = 778, windowWidth = 610;
button.addEventListener("click", () => {
const winHtml = `<!DOCTYPE html>
@ -338,7 +340,7 @@
new Blob([winHtml], { type: "text/html" })
);
window.open(winUrl, "_blank", `width=610,height=778`);
window.open(winUrl, "_blank", `width=${windowWidth},height=${windowHeight}`);
});
button.setAttribute("id", config.frameId + "-container");

View File

@ -329,6 +329,8 @@
.replace(lt, rlt)
.replace(gt, rgt);
const windowHeight = 778, windowWidth = 610;
button.addEventListener("click", () => {
const winHtml = `<!DOCTYPE html>
<html>
@ -382,7 +384,7 @@
new Blob([winHtml], { type: "text/html" })
);
window.open(winUrl, "_blank", `width=610,height=778`);
window.open(winUrl, "_blank", `width=${windowWidth},height=${windowHeight}`);
});
button.setAttribute("id", config.frameId + "-container");