Merge branch 'release/rc-v1.2.0' of github.com:ONLYOFFICE/AppServer into release/rc-v1.2.0
This commit is contained in:
commit
cb29f2041f
@ -32,7 +32,8 @@ public class EmployeeDto
|
||||
public string DisplayName { get; set; }
|
||||
public string Title { 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()
|
||||
{
|
||||
@ -99,7 +100,8 @@ public class EmployeeDtoHelper
|
||||
protected async Task<EmployeeDto> Init(EmployeeDto result, UserInfo userInfo)
|
||||
{
|
||||
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))
|
||||
{
|
||||
|
@ -128,6 +128,7 @@ export default function withFileActions(WrappedFileItem) {
|
||||
e.target.tagName === "SPAN" ||
|
||||
e.target.tagName === "A" ||
|
||||
e.target.closest(".checkbox") ||
|
||||
e.target.closest(".table-container_row-checkbox") ||
|
||||
e.button !== 0 ||
|
||||
e.target.closest(".expandButton") ||
|
||||
e.target.querySelector(".expandButton") ||
|
||||
|
@ -15,10 +15,10 @@ export default function withQuickButtons(WrappedComponent) {
|
||||
}
|
||||
|
||||
onClickLock = () => {
|
||||
const { item, lockFileAction, isAdmin, t } = this.props;
|
||||
const { locked, id, access } = item;
|
||||
const { item, lockFileAction, t } = this.props;
|
||||
const { locked, id, security } = item;
|
||||
|
||||
if ((isAdmin || access === 0) && !this.state.isLoading) {
|
||||
if (security?.Lock && !this.state.isLoading) {
|
||||
this.setState({ isLoading: true });
|
||||
return lockFileAction(id, !locked)
|
||||
.then(() =>
|
||||
|
@ -23,33 +23,7 @@ const EncryptedFileIcon = styled.div`
|
||||
margin-left: 12px;
|
||||
`;
|
||||
|
||||
const ItemIcon = ({
|
||||
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"} />
|
||||
// )}
|
||||
// </>
|
||||
// );
|
||||
|
||||
const ItemIcon = ({ icon, fileExst, isPrivacy, isRoom }) => {
|
||||
return (
|
||||
<>
|
||||
<StyledIcon className={`react-svg-icon`} isRoom={isRoom} src={icon} />
|
||||
@ -58,14 +32,8 @@ const ItemIcon = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default inject(({ filesStore, treeFoldersStore }) => {
|
||||
// const { type, extension, id } = filesStore.fileActionStore;
|
||||
|
||||
export default inject(({ treeFoldersStore }) => {
|
||||
return {
|
||||
viewAs: filesStore.viewAs,
|
||||
isPrivacy: treeFoldersStore.isPrivacyFolder,
|
||||
// actionType: type,
|
||||
// actionExtension: extension,
|
||||
// actionId: id,
|
||||
};
|
||||
})(observer(ItemIcon));
|
||||
|
@ -24,8 +24,7 @@ const QuickButtons = (props) => {
|
||||
isCanWebEdit,
|
||||
} = props;
|
||||
|
||||
const { id, locked, fileStatus, title, fileExst, security } = item;
|
||||
const canLockFileAbility = security?.Lock;
|
||||
const { id, locked, fileStatus, title, fileExst } = item;
|
||||
|
||||
const isFavorite =
|
||||
(fileStatus & FileStatus.IsFavorite) === FileStatus.IsFavorite;
|
||||
@ -57,8 +56,7 @@ const QuickButtons = (props) => {
|
||||
|
||||
const setFavorite = () => onClickFavorite(isFavorite);
|
||||
|
||||
const isAvailableLockFile =
|
||||
canLockFileAbility && fileExst && displayBadges && isCanWebEdit;
|
||||
const isAvailableLockFile = fileExst && displayBadges && isCanWebEdit;
|
||||
|
||||
return (
|
||||
<div className="badges additional-badges">
|
||||
|
@ -34,7 +34,7 @@ const ArchiveDialogComponent = (props) => {
|
||||
items,
|
||||
} = props;
|
||||
|
||||
const [requestRunning, setRequestRunning] = React.useState(false);
|
||||
// const [requestRunning, setRequestRunning] = React.useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
window.addEventListener("keydown", onKeyPress);
|
||||
@ -43,19 +43,16 @@ const ArchiveDialogComponent = (props) => {
|
||||
}, []);
|
||||
|
||||
const onClose = () => {
|
||||
if (!requestRunning) {
|
||||
setRestoreAllArchive(false);
|
||||
setArchiveActionType(null);
|
||||
setArchiveDialogVisible(false);
|
||||
}
|
||||
setRestoreAllArchive(false);
|
||||
setArchiveActionType(null);
|
||||
setArchiveDialogVisible(false);
|
||||
};
|
||||
|
||||
const onAction = () => {
|
||||
setRequestRunning(true);
|
||||
|
||||
setArchiveDialogVisible(false);
|
||||
setArchiveAction(action, items, t).then(() => {
|
||||
setRequestRunning(false);
|
||||
onClose();
|
||||
setRestoreAllArchive(false);
|
||||
setArchiveActionType(null);
|
||||
});
|
||||
};
|
||||
|
||||
@ -116,7 +113,6 @@ const ArchiveDialogComponent = (props) => {
|
||||
size="normal"
|
||||
primary
|
||||
onClick={onAction}
|
||||
isLoading={requestRunning}
|
||||
scale
|
||||
/>
|
||||
<Button
|
||||
@ -125,7 +121,6 @@ const ArchiveDialogComponent = (props) => {
|
||||
label={t("Common:CancelButton")}
|
||||
size="normal"
|
||||
onClick={onClose}
|
||||
isDisabled={requestRunning}
|
||||
scale
|
||||
/>
|
||||
</ModalDialog.Footer>
|
||||
|
@ -3,10 +3,16 @@ import { StyledText, StyledAuthorCell } from "./CellStyles";
|
||||
import Avatar from "@docspace/components/avatar";
|
||||
|
||||
const AuthorCell = ({ fileOwner, sideColor, item }) => {
|
||||
const { avatarSmall, hasAvatar } = item.createdBy;
|
||||
|
||||
const avatarSource = hasAvatar
|
||||
? avatarSmall
|
||||
: "/images/default_user_photo_size_32-32.png";
|
||||
|
||||
return (
|
||||
<StyledAuthorCell className="author-cell">
|
||||
<Avatar
|
||||
source={item.createdBy.avatarSmall}
|
||||
source={avatarSource}
|
||||
className="author-avatar-cell"
|
||||
role="user"
|
||||
/>
|
||||
|
@ -2165,7 +2165,7 @@ class FilesStore {
|
||||
const isRoom = !!roomType;
|
||||
|
||||
const icon =
|
||||
isRoom && !isArchive && logo?.medium
|
||||
isRoom && logo?.medium
|
||||
? logo?.medium
|
||||
: getIcon(
|
||||
iconSize,
|
||||
|
@ -237,6 +237,7 @@ class SettingsSetupStore {
|
||||
|
||||
setLifetimeAuditSettings = async (data) => {
|
||||
await api.settings.setLifetimeAuditSettings(data);
|
||||
this.getLifetimeAuditSettings();
|
||||
};
|
||||
|
||||
setSecurityLifeTime = (lifetime) => {
|
||||
|
@ -358,6 +358,7 @@ class UsersStore {
|
||||
id,
|
||||
displayName,
|
||||
avatar,
|
||||
hasAvatar,
|
||||
email,
|
||||
isOwner,
|
||||
isAdmin: isAdministrator,
|
||||
@ -387,6 +388,10 @@ class UsersStore {
|
||||
status
|
||||
);
|
||||
|
||||
const currentAvatar = hasAvatar
|
||||
? avatar
|
||||
: "/images/default_user_photo_size_32-32.png";
|
||||
|
||||
return {
|
||||
id,
|
||||
status,
|
||||
@ -397,7 +402,8 @@ class UsersStore {
|
||||
isAdmin: isAdministrator,
|
||||
isVisitor,
|
||||
displayName,
|
||||
avatar,
|
||||
avatar: currentAvatar,
|
||||
hasAvatar,
|
||||
email,
|
||||
userName,
|
||||
mobilePhone,
|
||||
|
@ -209,7 +209,7 @@ class DropDown extends React.PureComponent {
|
||||
getItemHeight = (item) => {
|
||||
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 heightTablet = item?.props.heightTablet;
|
||||
@ -245,20 +245,20 @@ class DropDown extends React.PureComponent {
|
||||
const { maxHeight, children, showDisabledItems, theme } = this.props;
|
||||
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)
|
||||
);
|
||||
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 =
|
||||
fullHeight > 0 && fullHeight < maxHeight ? fullHeight : maxHeight;
|
||||
const dropDownMaxHeightProp = maxHeight
|
||||
? { height: calculatedHeight + "px" }
|
||||
: {};
|
||||
|
||||
let cleanChildren = children;
|
||||
if (!showDisabledItems) cleanChildren = this.hideDisabledItems();
|
||||
|
||||
return (
|
||||
<StyledDropdown
|
||||
ref={this.dropDownRef}
|
||||
|
Loading…
Reference in New Issue
Block a user