Merge branch 'feature/personal' of github.com:ONLYOFFICE/AppServer into feature/personal
This commit is contained in:
commit
c10b131cc1
@ -196,6 +196,8 @@ export default function withFileActions(WrappedFileItem) {
|
||||
checked,
|
||||
dragging,
|
||||
isFolder,
|
||||
personal,
|
||||
canWebEdit,
|
||||
} = this.props;
|
||||
const { fileExst, access, contentLength, id, shared } = item;
|
||||
|
||||
@ -218,7 +220,12 @@ export default function withFileActions(WrappedFileItem) {
|
||||
: "96px";
|
||||
|
||||
const sharedButton =
|
||||
!canShare || (isPrivacy && !fileExst) || isEdit || id <= 0 || isMobile
|
||||
!canShare ||
|
||||
(isPrivacy && !fileExst) ||
|
||||
(personal && !canWebEdit) ||
|
||||
isEdit ||
|
||||
id <= 0 ||
|
||||
isMobile
|
||||
? null
|
||||
: this.getSharedButton(shared);
|
||||
|
||||
@ -252,6 +259,7 @@ export default function withFileActions(WrappedFileItem) {
|
||||
return inject(
|
||||
(
|
||||
{
|
||||
auth,
|
||||
filesActionsStore,
|
||||
dialogsStore,
|
||||
treeFoldersStore,
|
||||
@ -351,6 +359,7 @@ export default function withFileActions(WrappedFileItem) {
|
||||
setMediaViewerData,
|
||||
getFolderInfo,
|
||||
markAsRead,
|
||||
personal: auth.settingsStore.personal,
|
||||
};
|
||||
}
|
||||
)(observer(WithFileActions));
|
||||
|
@ -57,6 +57,10 @@ class SharingModal extends React.Component {
|
||||
);
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
authStore.init();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<MobxProvider auth={authStore} {...stores}>
|
||||
|
@ -324,6 +324,7 @@ class SectionHeaderContent extends React.Component {
|
||||
isFavoritesFolder,
|
||||
isRecentFolder,
|
||||
isShareFolder,
|
||||
personal,
|
||||
} = this.props;
|
||||
|
||||
let menu = [
|
||||
@ -443,6 +444,10 @@ class SectionHeaderContent extends React.Component {
|
||||
menu.splice(4, 1);
|
||||
}
|
||||
|
||||
if ((personal && !isWebEditSelected) || selectionCount > 1) {
|
||||
menu.splice(1, 1);
|
||||
}
|
||||
|
||||
return menu;
|
||||
};
|
||||
|
||||
|
@ -462,6 +462,10 @@ class FilesStore {
|
||||
"mark-read",
|
||||
"unsubscribe",
|
||||
]);
|
||||
|
||||
if (!this.isWebEditSelected) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["sharing-settings"]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.isWebEditSelected) {
|
||||
@ -684,8 +688,10 @@ class FilesStore {
|
||||
|
||||
if (personal) {
|
||||
folderOptions = this.removeOptions(folderOptions, [
|
||||
"sharing-settings",
|
||||
"owner-change",
|
||||
"link-for-portal-users",
|
||||
"separator1",
|
||||
"docu-sign",
|
||||
"mark-read",
|
||||
"unsubscribe",
|
||||
|
@ -1,4 +1,4 @@
|
||||
<svg width="254" height="24" viewBox="0 0 254 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="220" height="24" viewBox="0 0 220 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.9387 23.7057L0.656893 18.7625C-0.218964 18.331 -0.218964 17.664 0.656893 17.2717L4.23648 15.5455L10.9006 18.7625C11.7765 19.1941 13.1855 19.1941 14.0232 18.7625L20.6874 15.5455L24.2669 17.2717C25.1428 17.7033 25.1428 18.3702 24.2669 18.7625L13.9852 23.7057C13.1855 24.098 11.7765 24.098 10.9387 23.7057Z" fill="#FF6F3D"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.9387 17.6249L0.656893 12.6817C-0.218964 12.2501 -0.218964 11.5832 0.656893 11.1909L4.16032 9.50391L10.9387 12.7601C11.8145 13.1917 13.2235 13.1917 14.0613 12.7601L20.8397 9.50391L24.3431 11.1909C25.219 11.6224 25.219 12.2894 24.3431 12.6817L14.0613 17.6249C13.1855 18.0564 11.7765 18.0564 10.9387 17.6249Z" fill="#95C038"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.9387 11.7008L0.656893 6.75765C-0.218964 6.3261 -0.218964 5.65916 0.656893 5.26684L10.9387 0.323661C11.8145 -0.107887 13.2235 -0.107887 14.0613 0.323661L24.3431 5.26684C25.219 5.69839 25.219 6.36533 24.3431 6.75765L14.0613 11.7008C13.1855 12.0931 11.7765 12.0931 10.9387 11.7008Z" fill="#5DC0E8"/>
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@ -57,6 +57,7 @@ const HeaderNav = ({
|
||||
logout,
|
||||
isAuthenticated,
|
||||
peopleAvailable,
|
||||
isPersonal,
|
||||
}) => {
|
||||
const { t } = useTranslation(["NavMenu", "Common"]);
|
||||
|
||||
@ -90,10 +91,12 @@ const HeaderNav = ({
|
||||
},
|
||||
{
|
||||
key: "SwitchToBtn",
|
||||
label: t("TurnOnDesktopVersion"),
|
||||
onClick: onSwitchToDesktopClick,
|
||||
url: `${window.location.origin}?desktop_view=true`,
|
||||
target: "_self",
|
||||
...(!isPersonal && {
|
||||
label: t("TurnOnDesktopVersion"),
|
||||
onClick: onSwitchToDesktopClick,
|
||||
url: `${window.location.origin}?desktop_view=true`,
|
||||
target: "_self",
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: "AboutBtn",
|
||||
@ -162,10 +165,11 @@ export default withRouter(
|
||||
language,
|
||||
logout,
|
||||
} = auth;
|
||||
const { defaultPage } = settingsStore;
|
||||
const { defaultPage, personal: isPersonal } = settingsStore;
|
||||
const { user } = userStore;
|
||||
const modules = auth.availableModules;
|
||||
return {
|
||||
isPersonal,
|
||||
user,
|
||||
isAuthenticated,
|
||||
isLoaded,
|
||||
|
@ -3,6 +3,7 @@ import { inject, observer } from "mobx-react";
|
||||
import PropTypes from "prop-types";
|
||||
import styled, { css } from "styled-components";
|
||||
import { Link as LinkWithoutRedirect } from "react-router-dom";
|
||||
import { isMobileOnly } from "react-device-detect";
|
||||
import NavItem from "./nav-item";
|
||||
import Headline from "@appserver/common/components/Headline";
|
||||
import Nav from "./nav";
|
||||
@ -17,6 +18,7 @@ import { desktop, tablet } from "@appserver/components/utils/device";
|
||||
import i18n from "../i18n";
|
||||
import { combineUrl } from "@appserver/common/utils";
|
||||
import { AppServerConfig } from "@appserver/common/constants";
|
||||
|
||||
const { proxyURL } = AppServerConfig;
|
||||
|
||||
const backgroundColor = "#0F4071";
|
||||
@ -33,6 +35,7 @@ const Header = styled.header`
|
||||
|
||||
${(props) =>
|
||||
props.module &&
|
||||
!props.isPersonal &&
|
||||
css`
|
||||
@media ${tablet} {
|
||||
display: none;
|
||||
@ -45,9 +48,7 @@ const Header = styled.header`
|
||||
font-size: 21px;
|
||||
line-height: 0;
|
||||
margin-top: -5px;
|
||||
cursor: ${(props) => (props.isPersonal ? "default" : "pointer")};
|
||||
|
||||
${(props) => props.isPersonal && `margin-left: 20px;`}
|
||||
cursor: "pointer";
|
||||
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
-webkit-user-drag: none;
|
||||
@ -76,17 +77,28 @@ const Header = styled.header`
|
||||
}
|
||||
|
||||
.header-logo-icon {
|
||||
width: ${(props) => (props.isPersonal ? "254px" : "146px")};
|
||||
${(props) => props.isPersonal && `margin-left: 17px;`}
|
||||
width: ${(props) => (props.isPersonal ? "220px" : "146px")};
|
||||
${(props) => props.isPersonal && `margin-left: 20px;`}
|
||||
height: 24px;
|
||||
position: relative;
|
||||
padding: 0 20px 0 6px;
|
||||
padding: ${(props) => (!props.isPersonal ? "0 20px 0 6px" : "0")};
|
||||
cursor: pointer;
|
||||
|
||||
@media (max-width: 620px) {
|
||||
display: ${(props) => (props.module ? "none" : "block")};
|
||||
padding: 0px 20px 0 6px;
|
||||
@media ${tablet} {
|
||||
${(props) => props.isPersonal && `margin-left: 16px;`}
|
||||
}
|
||||
|
||||
@media (max-width: 620px) {
|
||||
${(props) =>
|
||||
!props.isPersonal &&
|
||||
css`
|
||||
display: ${(props) => (props.module ? "none" : "block")};
|
||||
padding: 0px 20px 0 6px;
|
||||
`}
|
||||
}
|
||||
}
|
||||
.mobile-short-logo {
|
||||
width: 146px;
|
||||
}
|
||||
`;
|
||||
|
||||
@ -178,7 +190,7 @@ const HeaderComponent = ({
|
||||
<LinkWithoutRedirect className="header-logo-wrapper" to={defaultPage}>
|
||||
{!isPersonal ? (
|
||||
<img alt="logo" src={props.logoUrl} className="header-logo-icon" />
|
||||
) : (
|
||||
) : !isMobileOnly ? (
|
||||
<img
|
||||
alt="logo"
|
||||
className="header-logo-icon"
|
||||
@ -187,17 +199,27 @@ const HeaderComponent = ({
|
||||
"/static/images/personal.logo.react.svg"
|
||||
)}
|
||||
/>
|
||||
) : (
|
||||
<img
|
||||
className="header-logo-icon mobile-short-logo"
|
||||
src={combineUrl(
|
||||
AppServerConfig.proxyURL,
|
||||
"/static/images/nav.logo.opened.react.svg"
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</LinkWithoutRedirect>
|
||||
|
||||
<Headline
|
||||
className="header-module-title"
|
||||
type="header"
|
||||
color="#FFF"
|
||||
{...(!isPersonal && { onClick: onClick })}
|
||||
>
|
||||
{currentProductName}
|
||||
</Headline>
|
||||
{!isPersonal && (
|
||||
<Headline
|
||||
className="header-module-title"
|
||||
type="header"
|
||||
color="#FFF"
|
||||
onClick={onClick}
|
||||
>
|
||||
{currentProductName}
|
||||
</Headline>
|
||||
)}
|
||||
</Header>
|
||||
|
||||
{isNavAvailable && (
|
||||
|
Loading…
Reference in New Issue
Block a user