Merge branch 'release/rc-v1.2.0' of github.com:ONLYOFFICE/AppServer into release/rc-v1.2.0

This commit is contained in:
Vlada Gazizova 2022-12-19 18:16:01 +03:00
commit cb29f2041f
11 changed files with 41 additions and 64 deletions

View File

@ -32,7 +32,8 @@ public class EmployeeDto
public string DisplayName { get; set; } public string DisplayName { get; set; }
public string Title { get; set; } public string Title { get; set; }
public string AvatarSmall { get; set; } public string AvatarSmall { get; set; }
public string ProfileUrl { get; set; } public string ProfileUrl { get; set; }
public bool HasAvatar { get; set; }
public static EmployeeDto GetSample() public static EmployeeDto GetSample()
{ {
@ -99,7 +100,8 @@ public class EmployeeDtoHelper
protected async Task<EmployeeDto> Init(EmployeeDto result, UserInfo userInfo) protected async Task<EmployeeDto> Init(EmployeeDto result, UserInfo userInfo)
{ {
result.Id = userInfo.Id; result.Id = userInfo.Id;
result.DisplayName = _displayUserSettingsHelper.GetFullUserName(userInfo); result.DisplayName = _displayUserSettingsHelper.GetFullUserName(userInfo);
result.HasAvatar = await _userPhotoManager.UserHasAvatar(userInfo.Id);
if (!string.IsNullOrEmpty(userInfo.Title)) if (!string.IsNullOrEmpty(userInfo.Title))
{ {

View File

@ -128,6 +128,7 @@ export default function withFileActions(WrappedFileItem) {
e.target.tagName === "SPAN" || e.target.tagName === "SPAN" ||
e.target.tagName === "A" || e.target.tagName === "A" ||
e.target.closest(".checkbox") || e.target.closest(".checkbox") ||
e.target.closest(".table-container_row-checkbox") ||
e.button !== 0 || e.button !== 0 ||
e.target.closest(".expandButton") || e.target.closest(".expandButton") ||
e.target.querySelector(".expandButton") || e.target.querySelector(".expandButton") ||

View File

@ -15,10 +15,10 @@ export default function withQuickButtons(WrappedComponent) {
} }
onClickLock = () => { onClickLock = () => {
const { item, lockFileAction, isAdmin, t } = this.props; const { item, lockFileAction, t } = this.props;
const { locked, id, access } = item; const { locked, id, security } = item;
if ((isAdmin || access === 0) && !this.state.isLoading) { if (security?.Lock && !this.state.isLoading) {
this.setState({ isLoading: true }); this.setState({ isLoading: true });
return lockFileAction(id, !locked) return lockFileAction(id, !locked)
.then(() => .then(() =>

View File

@ -23,33 +23,7 @@ const EncryptedFileIcon = styled.div`
margin-left: 12px; margin-left: 12px;
`; `;
const ItemIcon = ({ const ItemIcon = ({ icon, fileExst, isPrivacy, isRoom }) => {
id,
icon,
fileExst,
isPrivacy,
viewAs,
isRoom,
// actionType,
// actionExtension,
// actionId,
}) => {
// const isEdit =
// (actionType !== null && actionId === id && fileExst === actionExtension) ||
// id <= 0;
// return (
// <>
// <StyledIcon
// className={`react-svg-icon${isEdit ? " is-edit" : ""}`}
// src={icon}
// />
// {isPrivacy && fileExst && (
// <EncryptedFileIcon isEdit={isEdit && viewAs !== "tile"} />
// )}
// </>
// );
return ( return (
<> <>
<StyledIcon className={`react-svg-icon`} isRoom={isRoom} src={icon} /> <StyledIcon className={`react-svg-icon`} isRoom={isRoom} src={icon} />
@ -58,14 +32,8 @@ const ItemIcon = ({
); );
}; };
export default inject(({ filesStore, treeFoldersStore }) => { export default inject(({ treeFoldersStore }) => {
// const { type, extension, id } = filesStore.fileActionStore;
return { return {
viewAs: filesStore.viewAs,
isPrivacy: treeFoldersStore.isPrivacyFolder, isPrivacy: treeFoldersStore.isPrivacyFolder,
// actionType: type,
// actionExtension: extension,
// actionId: id,
}; };
})(observer(ItemIcon)); })(observer(ItemIcon));

View File

@ -24,8 +24,7 @@ const QuickButtons = (props) => {
isCanWebEdit, isCanWebEdit,
} = props; } = props;
const { id, locked, fileStatus, title, fileExst, security } = item; const { id, locked, fileStatus, title, fileExst } = item;
const canLockFileAbility = security?.Lock;
const isFavorite = const isFavorite =
(fileStatus & FileStatus.IsFavorite) === FileStatus.IsFavorite; (fileStatus & FileStatus.IsFavorite) === FileStatus.IsFavorite;
@ -57,8 +56,7 @@ const QuickButtons = (props) => {
const setFavorite = () => onClickFavorite(isFavorite); const setFavorite = () => onClickFavorite(isFavorite);
const isAvailableLockFile = const isAvailableLockFile = fileExst && displayBadges && isCanWebEdit;
canLockFileAbility && fileExst && displayBadges && isCanWebEdit;
return ( return (
<div className="badges additional-badges"> <div className="badges additional-badges">

View File

@ -34,7 +34,7 @@ const ArchiveDialogComponent = (props) => {
items, items,
} = props; } = props;
const [requestRunning, setRequestRunning] = React.useState(false); // const [requestRunning, setRequestRunning] = React.useState(false);
useEffect(() => { useEffect(() => {
window.addEventListener("keydown", onKeyPress); window.addEventListener("keydown", onKeyPress);
@ -43,19 +43,16 @@ const ArchiveDialogComponent = (props) => {
}, []); }, []);
const onClose = () => { const onClose = () => {
if (!requestRunning) { setRestoreAllArchive(false);
setRestoreAllArchive(false); setArchiveActionType(null);
setArchiveActionType(null); setArchiveDialogVisible(false);
setArchiveDialogVisible(false);
}
}; };
const onAction = () => { const onAction = () => {
setRequestRunning(true); setArchiveDialogVisible(false);
setArchiveAction(action, items, t).then(() => { setArchiveAction(action, items, t).then(() => {
setRequestRunning(false); setRestoreAllArchive(false);
onClose(); setArchiveActionType(null);
}); });
}; };
@ -116,7 +113,6 @@ const ArchiveDialogComponent = (props) => {
size="normal" size="normal"
primary primary
onClick={onAction} onClick={onAction}
isLoading={requestRunning}
scale scale
/> />
<Button <Button
@ -125,7 +121,6 @@ const ArchiveDialogComponent = (props) => {
label={t("Common:CancelButton")} label={t("Common:CancelButton")}
size="normal" size="normal"
onClick={onClose} onClick={onClose}
isDisabled={requestRunning}
scale scale
/> />
</ModalDialog.Footer> </ModalDialog.Footer>

View File

@ -3,10 +3,16 @@ import { StyledText, StyledAuthorCell } from "./CellStyles";
import Avatar from "@docspace/components/avatar"; import Avatar from "@docspace/components/avatar";
const AuthorCell = ({ fileOwner, sideColor, item }) => { const AuthorCell = ({ fileOwner, sideColor, item }) => {
const { avatarSmall, hasAvatar } = item.createdBy;
const avatarSource = hasAvatar
? avatarSmall
: "/images/default_user_photo_size_32-32.png";
return ( return (
<StyledAuthorCell className="author-cell"> <StyledAuthorCell className="author-cell">
<Avatar <Avatar
source={item.createdBy.avatarSmall} source={avatarSource}
className="author-avatar-cell" className="author-avatar-cell"
role="user" role="user"
/> />

View File

@ -2165,7 +2165,7 @@ class FilesStore {
const isRoom = !!roomType; const isRoom = !!roomType;
const icon = const icon =
isRoom && !isArchive && logo?.medium isRoom && logo?.medium
? logo?.medium ? logo?.medium
: getIcon( : getIcon(
iconSize, iconSize,

View File

@ -237,6 +237,7 @@ class SettingsSetupStore {
setLifetimeAuditSettings = async (data) => { setLifetimeAuditSettings = async (data) => {
await api.settings.setLifetimeAuditSettings(data); await api.settings.setLifetimeAuditSettings(data);
this.getLifetimeAuditSettings();
}; };
setSecurityLifeTime = (lifetime) => { setSecurityLifeTime = (lifetime) => {

View File

@ -358,6 +358,7 @@ class UsersStore {
id, id,
displayName, displayName,
avatar, avatar,
hasAvatar,
email, email,
isOwner, isOwner,
isAdmin: isAdministrator, isAdmin: isAdministrator,
@ -387,6 +388,10 @@ class UsersStore {
status status
); );
const currentAvatar = hasAvatar
? avatar
: "/images/default_user_photo_size_32-32.png";
return { return {
id, id,
status, status,
@ -397,7 +402,8 @@ class UsersStore {
isAdmin: isAdministrator, isAdmin: isAdministrator,
isVisitor, isVisitor,
displayName, displayName,
avatar, avatar: currentAvatar,
hasAvatar,
email, email,
userName, userName,
mobilePhone, mobilePhone,

View File

@ -209,7 +209,7 @@ class DropDown extends React.PureComponent {
getItemHeight = (item) => { getItemHeight = (item) => {
const isTablet = window.innerWidth < 1024; //TODO: Make some better const isTablet = window.innerWidth < 1024; //TODO: Make some better
if (item && item.props.disabled) return 0; //if (item && item.props.disabled) return 0;
let height = item?.props.height; let height = item?.props.height;
let heightTablet = item?.props.heightTablet; let heightTablet = item?.props.heightTablet;
@ -245,20 +245,20 @@ class DropDown extends React.PureComponent {
const { maxHeight, children, showDisabledItems, theme } = this.props; const { maxHeight, children, showDisabledItems, theme } = this.props;
const { directionX, directionY, width, manualY } = this.state; const { directionX, directionY, width, manualY } = this.state;
const rowHeights = React.Children.map(children, (child) => let cleanChildren = children;
if (!showDisabledItems) cleanChildren = this.hideDisabledItems();
const rowHeights = React.Children.map(cleanChildren, (child) =>
this.getItemHeight(child) this.getItemHeight(child)
); );
const getItemSize = (index) => rowHeights[index]; const getItemSize = (index) => rowHeights[index];
const fullHeight = children && rowHeights.reduce((a, b) => a + b, 0); const fullHeight = cleanChildren && rowHeights.reduce((a, b) => a + b, 0);
const calculatedHeight = const calculatedHeight =
fullHeight > 0 && fullHeight < maxHeight ? fullHeight : maxHeight; fullHeight > 0 && fullHeight < maxHeight ? fullHeight : maxHeight;
const dropDownMaxHeightProp = maxHeight const dropDownMaxHeightProp = maxHeight
? { height: calculatedHeight + "px" } ? { height: calculatedHeight + "px" }
: {}; : {};
let cleanChildren = children;
if (!showDisabledItems) cleanChildren = this.hideDisabledItems();
return ( return (
<StyledDropdown <StyledDropdown
ref={this.dropDownRef} ref={this.dropDownRef}