Merge branch 'hotfix/v2.5.1' of github.com:ONLYOFFICE/DocSpace-client into hotfix/v2.5.1

This commit is contained in:
Timofey Boyko 2024-05-02 12:44:11 +03:00
commit 63dfb64457
11 changed files with 252 additions and 267 deletions

View File

@ -78,7 +78,6 @@ const ChangeRoomOwner = (props) => {
} = props; } = props;
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
const [isChecked, setIsChecked] = useState(!showBackButton);
useEffect(() => { useEffect(() => {
document.addEventListener("keyup", onKeyUp, false); document.addEventListener("keyup", onKeyUp, false);
@ -93,7 +92,12 @@ const ChangeRoomOwner = (props) => {
if (e.keyCode === 13 || e.which === 13) onChangeRoomOwner(); if (e.keyCode === 13 || e.which === 13) onChangeRoomOwner();
}; };
const onChangeRoomOwner = async (user) => { const onChangeRoomOwner = async (
user,
selectedAccess,
newFooterInputValue,
isChecked,
) => {
if (showBackButton) { if (showBackButton) {
setRoomParams && setRoomParams(user[0]); setRoomParams && setRoomParams(user[0]);
} else { } else {
@ -146,8 +150,7 @@ const ChangeRoomOwner = (props) => {
isLoading={isLoading} isLoading={isLoading}
withFooterCheckbox={!showBackButton} withFooterCheckbox={!showBackButton}
footerCheckboxLabel={t("Files:LeaveTheRoom")} footerCheckboxLabel={t("Files:LeaveTheRoom")}
isChecked={isChecked} isChecked={!showBackButton}
setIsChecked={setIsChecked}
withOutCurrentAuthorizedUser withOutCurrentAuthorizedUser
filterUserId={roomOwnerId} filterUserId={roomOwnerId}
currentUserId={userId} currentUserId={userId}

View File

@ -42,6 +42,7 @@ import { Button } from "@docspace/shared/components/button";
import { FieldContainer } from "@docspace/shared/components/field-container"; import { FieldContainer } from "@docspace/shared/components/field-container";
import ErrorContainer from "@docspace/shared/components/error-container/ErrorContainer"; import ErrorContainer from "@docspace/shared/components/error-container/ErrorContainer";
import { FileInput } from "@docspace/shared/components/file-input"; import { FileInput } from "@docspace/shared/components/file-input";
import { Scrollbar } from "@docspace/shared/components/scrollbar";
import { Loader } from "@docspace/shared/components/loader"; import { Loader } from "@docspace/shared/components/loader";
@ -314,6 +315,7 @@ const Wizard = (props) => {
return ( return (
<Wrapper> <Wrapper>
<div className="bg-cover"></div> <div className="bg-cover"></div>
<Scrollbar id="customScrollBar">
<StyledContent> <StyledContent>
<WizardContainer> <WizardContainer>
<DocspaceLogo className="docspace-logo" /> <DocspaceLogo className="docspace-logo" />
@ -515,6 +517,7 @@ const Wizard = (props) => {
</FormWrapper> </FormWrapper>
</WizardContainer> </WizardContainer>
</StyledContent> </StyledContent>
</Scrollbar>
</Wrapper> </Wrapper>
); );
}; };

View File

@ -35,7 +35,6 @@ import AppLoader from "@docspace/shared/components/app-loader";
import { TResponse } from "@/types"; import { TResponse } from "@/types";
import useError from "@/hooks/useError"; import useError from "@/hooks/useError";
import useDeviceType from "@/hooks/useDeviceType";
import useRootInit from "@/hooks/useRootInit"; import useRootInit from "@/hooks/useRootInit";
import useDeepLink from "@/hooks/useDeepLink"; import useDeepLink from "@/hooks/useDeepLink";
import useSelectFileDialog from "@/hooks/useSelectFileDialog"; import useSelectFileDialog from "@/hooks/useSelectFileDialog";
@ -85,7 +84,6 @@ const Root = ({
editorUrl: documentserverUrl, editorUrl: documentserverUrl,
}); });
const { currentDeviceType } = useDeviceType();
const { isShowDeepLink, setIsShowDeepLink } = useDeepLink({ const { isShowDeepLink, setIsShowDeepLink } = useDeepLink({
settings, settings,
fileInfo, fileInfo,
@ -159,7 +157,6 @@ const Root = ({
<DeepLink <DeepLink
fileInfo={fileInfo} fileInfo={fileInfo}
userEmail={user?.email} userEmail={user?.email}
currentDeviceType={currentDeviceType}
deepLinkConfig={settings?.deepLink} deepLinkConfig={settings?.deepLink}
setIsShowDeepLink={setIsShowDeepLink} setIsShowDeepLink={setIsShowDeepLink}
/> />

View File

@ -109,26 +109,34 @@ export const BgBlock = styled.div<{ bgPattern: string }>`
`; `;
export const StyledWrapper = styled.div` export const StyledWrapper = styled.div`
height: 100%;
width: 100vw;
max-width: 960px;
@media ${mobile} {
margin: 0 auto;
align-items: flex-start;
}
`;
export const StyledBody = styled.div`
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
margin: 56px auto;
max-width: 960px; max-width: 960px;
width: 100vw; width: 100vw;
@media ${mobile} { @media ${mobile} {
margin: 0 auto; margin: 0 auto;
align-items: flex-start;
} }
`; `;
export const LogoWrapper = styled.div` export const LogoWrapper = styled.div`
width: 386px;
height: 44px;
margin-top: auto;
margin-bottom: 64px; margin-bottom: 64px;
margin-top: 56px;
@media ${mobile} { @media ${mobile} {
display: none; margin-top: 32px;
} }
`; `;

View File

@ -35,7 +35,7 @@ export interface DeepLinkProps {
fileInfo?: TFile; fileInfo?: TFile;
userEmail?: string; userEmail?: string;
currentDeviceType: DeviceType; currentDeviceType?: DeviceType;
deepLinkConfig?: TDeepLinkConfig; deepLinkConfig?: TDeepLinkConfig;
setIsShowDeepLink: (value: boolean) => void; setIsShowDeepLink: (value: boolean) => void;

View File

@ -35,12 +35,11 @@ import { Button, ButtonSize } from "@docspace/shared/components/button";
import { Link, LinkType } from "@docspace/shared/components/link"; import { Link, LinkType } from "@docspace/shared/components/link";
import { FormWrapper } from "@docspace/shared/components/form-wrapper"; import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { getBgPattern } from "@docspace/shared/utils/common"; import { getBgPattern } from "@docspace/shared/utils/common";
import { getLogoUrl } from "@docspace/shared/utils"; import DocspaceLogo from "@docspace/shared/components/docspace-logo/DocspaceLogo";
import { DeviceType, WhiteLabelLogoType } from "@docspace/shared/enums"; import { Scrollbar } from "@docspace/shared/components/scrollbar";
import { getDeepLink } from "./DeepLink.helper"; import { getDeepLink } from "./DeepLink.helper";
import { import {
StyledSimpleNav,
StyledDeepLink, StyledDeepLink,
StyledBodyWrapper, StyledBodyWrapper,
StyledFileTile, StyledFileTile,
@ -48,14 +47,15 @@ import {
BgBlock, BgBlock,
StyledWrapper, StyledWrapper,
LogoWrapper, LogoWrapper,
StyledBody,
} from "./DeepLink.styled"; } from "./DeepLink.styled";
import { DeepLinkProps } from "./DeepLink.types"; import { DeepLinkProps } from "./DeepLink.types";
const DeepLink = ({ const DeepLink = ({
fileInfo, fileInfo,
userEmail, userEmail,
setIsShowDeepLink, setIsShowDeepLink,
currentDeviceType,
deepLinkConfig, deepLinkConfig,
}: DeepLinkProps) => { }: DeepLinkProps) => {
const { t } = useTranslation(["DeepLink", "Common"]); const { t } = useTranslation(["DeepLink", "Common"]);
@ -95,31 +95,16 @@ const DeepLink = ({
: fileInfo?.title || ""; : fileInfo?.title || "";
}; };
const renderLogo = () => {
const logo = getLogoUrl(WhiteLabelLogoType.LightSmall, !theme.isBase);
if (currentDeviceType === DeviceType.mobile) {
return (
<StyledSimpleNav>
<img src={logo} alt="" />
</StyledSimpleNav>
);
} else {
return (
<LogoWrapper>
<img src={logo} alt="docspace-logo" />
</LogoWrapper>
);
}
};
const bgPattern = getBgPattern(theme.currentColorScheme?.id); const bgPattern = getBgPattern(theme.currentColorScheme?.id);
const logoElement = renderLogo();
return ( return (
<StyledWrapper> <StyledWrapper>
{logoElement} <BgBlock bgPattern={bgPattern} />
<Scrollbar>
<StyledBody>
<LogoWrapper>
<DocspaceLogo className="docspace-logo" isResizable />
</LogoWrapper>
<FormWrapper> <FormWrapper>
<StyledDeepLink> <StyledDeepLink>
<StyledBodyWrapper> <StyledBodyWrapper>
@ -158,10 +143,10 @@ const DeepLink = ({
</StyledActionsWrapper> </StyledActionsWrapper>
</StyledDeepLink> </StyledDeepLink>
</FormWrapper> </FormWrapper>
<BgBlock bgPattern={bgPattern} /> </StyledBody>
</Scrollbar>
</StyledWrapper> </StyledWrapper>
); );
}; };
export default DeepLink; export default DeepLink;

View File

@ -107,7 +107,6 @@ const Selector = ({
withFooterCheckbox, withFooterCheckbox,
footerCheckboxLabel, footerCheckboxLabel,
isChecked, isChecked,
setIsChecked,
items, items,
renderCustomItem, renderCustomItem,
@ -517,12 +516,10 @@ const Selector = ({
footerCheckboxLabel, footerCheckboxLabel,
isChecked: isFooterCheckboxChecked, isChecked: isFooterCheckboxChecked,
setIsFooterCheckboxChecked, setIsFooterCheckboxChecked,
setIsChecked,
} }
: ({ : ({
isChecked: isFooterCheckboxChecked, isChecked: isFooterCheckboxChecked,
setIsFooterCheckboxChecked, setIsFooterCheckboxChecked,
setIsChecked,
} as TSelectorFooterCheckbox); } as TSelectorFooterCheckbox);
const tabsProps: TWithTabs = withTabs const tabsProps: TWithTabs = withTabs

View File

@ -283,13 +283,11 @@ export type TSelectorCheckbox =
withFooterCheckbox: true; withFooterCheckbox: true;
footerCheckboxLabel: string; footerCheckboxLabel: string;
isChecked: boolean; isChecked: boolean;
setIsChecked: React.Dispatch<React.SetStateAction<boolean>>;
} }
| { | {
withFooterCheckbox?: undefined; withFooterCheckbox?: undefined;
footerCheckboxLabel?: undefined; footerCheckboxLabel?: undefined;
isChecked?: boolean; isChecked?: boolean;
setIsChecked?: undefined;
}; };
export type TSelectorFooterCheckbox = TSelectorCheckbox & { export type TSelectorFooterCheckbox = TSelectorCheckbox & {

View File

@ -63,7 +63,6 @@ const Footer = React.memo(
setNewFooterInputValue, setNewFooterInputValue,
isChecked, isChecked,
setIsFooterCheckboxChecked, setIsFooterCheckboxChecked,
setIsChecked,
submitButtonId, submitButtonId,
cancelButtonId, cancelButtonId,
@ -82,8 +81,6 @@ const Footer = React.memo(
}; };
const onChangeCheckbox = () => { const onChangeCheckbox = () => {
setIsChecked?.((value: boolean) => !value);
setIsFooterCheckboxChecked?.((value: boolean) => !value); setIsFooterCheckboxChecked?.((value: boolean) => !value);
}; };

View File

@ -510,7 +510,6 @@ const FilesSelector = ({
withFooterCheckbox, withFooterCheckbox,
footerCheckboxLabel, footerCheckboxLabel,
isChecked: false, isChecked: false,
setIsChecked: () => {},
} }
: {}; : {};

View File

@ -129,7 +129,6 @@ const PeopleSelector = ({
withFooterCheckbox, withFooterCheckbox,
footerCheckboxLabel, footerCheckboxLabel,
isChecked, isChecked,
setIsChecked,
withHeader, withHeader,
headerProps, headerProps,
@ -338,7 +337,6 @@ const PeopleSelector = ({
withFooterCheckbox, withFooterCheckbox,
footerCheckboxLabel, footerCheckboxLabel,
isChecked, isChecked,
setIsChecked,
} }
: {}; : {};