Merge branch 'release/v2.6.0' into feature/form-room

# Conflicts:
#	packages/shared/components/selector/sub-components/EmptyScreen.tsx
This commit is contained in:
Akmal Isomadinov 2024-07-15 20:53:08 +05:00
commit 852ef56857
36 changed files with 292 additions and 184 deletions

View File

@ -138,14 +138,13 @@ export default inject(
usersStore;
const { setCustomRoomQuota, needResetFilesSelection } = filesStore;
const { defaultUsersQuota, defaultRoomsQuota } = currentQuotaStore;
const {
selection: infoPanelSelection,
infoPanelSelection,
setNewInfoPanelSelection,
setInfoPanelSelection,
} = infoPanelStore;
const inRoom = infoPanelSelection?.inRoom;
const inRoom = !!infoPanelSelection?.navigationPath;
const needResetSelection =
type === "user" ? needResetUserSelection : needResetFilesSelection;

View File

@ -108,9 +108,6 @@ const RenameEvent = ({
: renameFolder(item.id, value)
.then(() => completeAction(item, type))
.then(() => {
if (selectedFolderId === item.id) {
setSelectedFolder({ title: value });
}
toastr.success(
t("FolderRenamed", {
folderTitle: item.title,

View File

@ -59,7 +59,7 @@ const Main = (props) => {
window.addEventListener("resize", onResize);
return () => {
window.addEventListener("resize", onResize);
window.removeEventListener("resize", onResize);
clearTimeout(updateSizeRef.current);
};

View File

@ -63,6 +63,7 @@ const StyledNav = styled.nav`
.icon-profile-menu {
cursor: pointer;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
z-index: 300;
}
`;
const HeaderNav = ({

View File

@ -87,6 +87,7 @@ const SpaceQuota = (props) => {
needResetSelection,
setSelected,
inRoom,
} = props;
const [isLoading, setIsLoading] = useState(false);
@ -123,7 +124,7 @@ const SpaceQuota = (props) => {
if (action === "no-quota") {
try {
const items = await updateQuota(-1, [item.id]);
const items = await updateQuota(-1, [item.id], inRoom);
options.map((item) => {
if (item.key === "no-quota") item.label = t("Common:Unlimited");
@ -140,7 +141,7 @@ const SpaceQuota = (props) => {
}
try {
const items = await resetQuota([item.id]);
const items = await resetQuota([item.id], inRoom);
options.map((item) => {
if (item.key === "default-quota") item.label = defaultQuotaSize;
@ -204,7 +205,13 @@ const SpaceQuota = (props) => {
export default inject(
(
{ peopleStore, filesActionsStore, filesStore, currentQuotaStore },
{
peopleStore,
filesActionsStore,
filesStore,
currentQuotaStore,
infoPanelStore,
},
{ type },
) => {
const { changeUserQuota, usersStore, selectionStore } = peopleStore;
@ -225,6 +232,9 @@ export default inject(
defaultRoomsQuota,
} = currentQuotaStore;
const { infoPanelSelection } = infoPanelStore;
const inRoom = !!infoPanelSelection?.navigationPath;
const { setSelected: setUsersSelected } = selectionStore;
const changeQuota = type === "user" ? changeUserQuota : changeRoomQuota;
@ -251,6 +261,7 @@ export default inject(
resetQuota,
defaultSize,
needResetSelection,
inRoom,
};
},
)(observer(SpaceQuota));

View File

@ -52,6 +52,7 @@ import {
StyledSelectedOwner,
} from "./StyledDialog";
import { PRODUCT_NAME } from "@docspace/shared/constants";
import { EmployeeActivationStatus } from "@docspace/shared/enums";
const ChangePortalOwnerDialog = ({
t,
@ -91,7 +92,7 @@ const ChangePortalOwnerDialog = ({
onClose && onClose();
toastr.success(
t("Settings:ConfirmEmailSended", {
ownerName: selectedUser.label,
ownerName: displayName,
}),
);
})
@ -122,6 +123,14 @@ const ChangePortalOwnerDialog = ({
t("DeactivateOrDeletePortal", { productName: PRODUCT_NAME }),
];
const filter = React.useMemo(() => {
const newFilter = new Filter();
newFilter.employeeStatus = EmployeeActivationStatus.Activated;
return newFilter;
}, []);
return (
<ModalDialog
displayType={"aside"}
@ -149,6 +158,7 @@ const ChangePortalOwnerDialog = ({
}}
currentUserId={id}
disableDisabledUsers
filter={filter}
/>
</ModalDialog.Container>
)}

View File

@ -31,9 +31,14 @@ const StyledModalDialog = styled(ModalDialog)`
.modal-header {
margin: 0;
}
.modal-body {
padding: 0 0 8px;
}
`;
const StyledBody = styled.div`
padding: 0 16px;
.embedding-panel_header-link {
margin: 10px 0 2px;
}
@ -132,10 +137,10 @@ const StyledBody = styled.div`
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
left: 16px;
left: 32px;
`
: css`
right: 16px;
right: 32px;
`}
}

View File

@ -462,6 +462,7 @@ const EmbeddingPanelComponent = (props: EmbeddingPanelProps) => {
selectedOption={selectedLink as TOption}
displaySelectedOption
directionY="bottom"
withLabel={false}
/>
</>
)}

View File

@ -109,7 +109,6 @@ const ConfirmRoute = ({
switch (validationResult) {
case ValidationResult.Ok:
case ValidationResult.UserExisted:
const confirmHeader = search.slice(1);
const linkData = {
...confirmLinkData,
@ -129,6 +128,19 @@ const ConfirmRoute = ({
setState((val) => ({ ...val, isLoaded: true, linkData, roomData }));
break;
case ValidationResult.UserExisted:
const finalUrl = res?.roomId
? `/rooms/shared/${res?.roomId}/filter?folder=${res?.roomId}`
: defaultPage;
console.log("user already exists", {
confirmLinkData,
validationResult,
finalUrl,
});
window.location.replace(finalUrl);
break;
case ValidationResult.Invalid:
console.error("invalid link", {
confirmLinkData,

View File

@ -134,10 +134,11 @@ export const getCategoryType = (location) => {
if (pathname.indexOf("personal") > -1) {
categoryType = CategoryType.Personal;
} else if (pathname.indexOf("shared") > -1) {
categoryType =
pathname.indexOf("shared/filter") > -1
? CategoryType.Shared
: CategoryType.SharedRoom;
const regexp = /(rooms)\/([\d])\/(shared)/;
categoryType = !regexp.test(location)
? CategoryType.Shared
: CategoryType.SharedRoom;
} else if (pathname.indexOf("share") > -1) {
categoryType = CategoryType.PublicRoom;
} else if (pathname.indexOf("archive") > -1) {

View File

@ -212,7 +212,7 @@ const CreateUserForm = (props) => {
});
const finalUrl = roomId
? `/rooms/shared/filter?folder=${roomId}`
? `/rooms/shared/${roomId}/filter?folder=${roomId}`
: defaultPage;
if (roomId) {
@ -324,7 +324,7 @@ const CreateUserForm = (props) => {
signupOAuth(signupAccount)
.then(() => {
const url = roomData.roomId
? `/rooms/shared/filter?folder=${roomData.roomId}/`
? `/rooms/shared/${roomData.roomId}/filter?folder=${roomData.roomId}/`
: defaultPage;
window.location.replace(url);
})
@ -352,7 +352,7 @@ const CreateUserForm = (props) => {
//console.log({ res });
const finalUrl = roomData.roomId
? `/rooms/shared/filter?folder=${roomData.roomId}`
? `/rooms/shared/${roomData.roomId}/filter?folder=${roomData.roomId}`
: defaultPage;
const isConfirm = typeof res === "string" && res.includes("confirm");

View File

@ -50,17 +50,18 @@ import { PRODUCT_NAME } from "@docspace/shared/constants";
const RemovePortal = (props) => {
const { t, greetingTitle, linkData, companyInfoSettingsData } = props;
const [isRemoved, setIsRemoved] = useState(false);
const navigate = useNavigate();
const url = companyInfoSettingsData?.site
? companyInfoSettingsData.site
: "https://onlyoffice.com";
const navigate = useNavigate();
const onDeleteClick = async () => {
try {
await deletePortal(linkData.confirmHeader);
const res = await deletePortal(linkData.confirmHeader);
setIsRemoved(true);
setTimeout(() => (location.href = url), 10000);
setTimeout(() => (location.href = res ? res : url), 10000);
} catch (e) {
toastr.error(e);
}

View File

@ -122,7 +122,7 @@ export const HistoryItemList = ({
iconName={FolderLocationReactSvgUrl}
size="16"
isFill
onClick={() => checkAndOpenLocationAction!(item)}
onClick={() => checkAndOpenLocationAction!(item, actionType)}
title={t("Files:OpenLocation")}
/>
</StyledHistoryBlockFile>

View File

@ -59,8 +59,8 @@ const GroupsRow = ({
changeGroupContextSelection(item, !rightMouseButtonClick);
};
const onOpenGroup = () => {
openGroupAction(item.id, true, item.name);
const onOpenGroup = (e) => {
openGroupAction(item.id, true, item.name, e);
};
const nameColor =

View File

@ -62,8 +62,8 @@ const GroupsTableItem = ({
changeGroupContextSelection(item, !rightMouseButtonClick);
};
const onOpenGroup = () => {
openGroupAction(item.id, true, item.name);
const onOpenGroup = (e) => {
openGroupAction(item.id, true, item.name, e);
};
const onRowClick = (e) => {

View File

@ -646,7 +646,6 @@ export default inject(
pathParts,
navigationPath,
security,
canCopyPublicLink,
rootFolderType,
shared,
} = selectedFolderStore;
@ -663,8 +662,6 @@ export default inject(
const isRoom = !!roomType;
const isPublicRoomType = roomType === RoomsType.PublicRoom;
const isCustomRoomType = roomType === RoomsType.CustomRoom;
const isFormRoomType = roomType === RoomsType.FormRoom;
const {
onCreateAndCopySharedLink,
@ -717,14 +714,9 @@ export default inject(
const sharedItem = navigationPath.find((r) => r.shared);
const showNavigationButton =
isLoading || !security?.CopyLink
isLoading || !security?.CopyLink || isPublicRoom || isArchive
? false
: (!isPublicRoom &&
!isArchive &&
canCopyPublicLink &&
(isPublicRoomType || isCustomRoomType || isFormRoomType) &&
shared) ||
(sharedItem && sharedItem.canCopyPublicLink);
: security?.Read && (shared || sharedItem);
return {
showText: settingsStore.showText,
@ -748,7 +740,6 @@ export default inject(
setSelected,
security,
canCopyPublicLink,
getHeaderMenu,
getCheckboxItemLabel,

View File

@ -57,6 +57,7 @@ const StyledWrapper = styled.div`
}
.checkbox-input {
width: fit-content;
margin: 10px 8px 6px 0;
}
@ -172,6 +173,7 @@ const FieldMapping = (props) => {
<Text fontSize="12px">{t("AdvancedSettingsTooltip")}</Text>
}
tooltipClass="advanced-settings-tooltip icon-button"
labelVisible={true}
>
<Checkbox
id="hide-auth-page"

View File

@ -185,7 +185,7 @@ const Header = (props) => {
size={17}
getData={getUserContextOptions}
isDisabled={false}
usePortal={false}
usePortal={true}
/>
)}

View File

@ -136,7 +136,7 @@ class AccessRightsStore {
isOwner: userIsOwner,
} = user;
const needActivate = status !== EmployeeStatus.Active && userId !== id;
const needActivate = status === EmployeeStatus.Disabled && userId !== id;
if (isOwner) return needActivate;
@ -158,7 +158,9 @@ class AccessRightsStore {
if (isLDAP) return false;
const needDisable = status !== EmployeeStatus.Disabled && userId !== id;
const needDisable =
(status == EmployeeStatus.Active || status == EmployeeStatus.Pending) &&
userId !== id;
if (isOwner) return needDisable;

View File

@ -399,17 +399,14 @@ class ContextOptionsStore {
};
onCopyLink = async (item, t) => {
const { shared, navigationPath, canCopyPublicLink } =
this.selectedFolderStore;
const { shared, navigationPath } = this.selectedFolderStore;
const isArchive = item.rootFolderType === FolderType.Archive;
const { href } = item;
const sharedItem = navigationPath.find((r) => r.shared);
const isShared =
(sharedItem && sharedItem.canCopyPublicLink) ||
(shared && canCopyPublicLink);
const isShared = shared || sharedItem;
if (isShared && !isArchive) {
try {
@ -1123,7 +1120,7 @@ class ContextOptionsStore {
return [
{
key: "public-room_share",
label: t("Files:CopyLink"),
label: t("Files:CopySharedLink"),
icon: TabletLinkReactSvgUrl,
onClick: () => {
copy(window.location.href);
@ -1131,6 +1128,11 @@ class ContextOptionsStore {
},
disabled: this.settingsStore.isFrame,
},
{
key: "separator0",
isSeparator: true,
disabled: !item.security?.Download,
},
{
key: "public-room_edit",
label: t("Common:Download"),
@ -1223,8 +1225,7 @@ class ContextOptionsStore {
const hasInfoPanel = contextOptions.includes("show-info");
//const emailSendIsDisabled = true;
const showSeparator0 =
(hasInfoPanel || !isMedia) && !this.publicRoomStore.isPublicRoom; // || !emailSendIsDisabled;
const showSeparator0 = hasInfoPanel || !isMedia; // || !emailSendIsDisabled;
const { isGroupMenuBlocked } = this.filesActionsStore;
@ -1316,72 +1317,71 @@ class ContextOptionsStore {
disabled: false,
},
];
const moveActions =
isDesktop() && !isInfoPanel
? [
{
id: "option_move-or-copy",
key: "move",
label: t("MoveOrCopy"),
icon: CopyReactSvgUrl,
items: [
{
id: "option_move-to",
key: "move-to",
label: t("Common:MoveTo"),
icon: MoveReactSvgUrl,
onClick: isEditing
? () => this.onShowEditingToast(t)
: () => this.onMoveAction(item),
disabled: false,
},
{
id: "option_copy-to",
key: "copy-to",
label: t("Common:Copy"),
icon: CopyReactSvgUrl,
onClick: () => this.onCopyAction(item),
disabled: false,
},
{
id: "option_create-duplicate",
key: "duplicate",
label: t("Common:Duplicate"),
icon: DuplicateReactSvgUrl,
onClick: () => this.onDuplicate(item, t),
disabled: false,
},
],
},
]
: [
{
id: "option_move-to",
key: "move-to",
label: t("Common:MoveTo"),
icon: MoveReactSvgUrl,
onClick: isEditing
? () => this.onShowEditingToast(t)
: () => this.onMoveAction(item),
disabled: false,
},
{
id: "option_copy-to",
key: "copy-to",
label: t("Common:Copy"),
icon: CopyReactSvgUrl,
onClick: () => this.onCopyAction(item),
disabled: false,
},
{
id: "option_create-duplicate",
key: "duplicate",
label: t("Common:Duplicate"),
icon: DuplicateReactSvgUrl,
onClick: () => this.onDuplicate(item, t),
disabled: false,
},
];
const moveActions = isDesktop()
? [
{
id: "option_move-or-copy",
key: "move",
label: t("MoveOrCopy"),
icon: CopyReactSvgUrl,
items: [
{
id: "option_move-to",
key: "move-to",
label: t("Common:MoveTo"),
icon: MoveReactSvgUrl,
onClick: isEditing
? () => this.onShowEditingToast(t)
: () => this.onMoveAction(item),
disabled: false,
},
{
id: "option_copy-to",
key: "copy-to",
label: t("Common:Copy"),
icon: CopyReactSvgUrl,
onClick: () => this.onCopyAction(item),
disabled: false,
},
{
id: "option_create-duplicate",
key: "duplicate",
label: t("Common:Duplicate"),
icon: DuplicateReactSvgUrl,
onClick: () => this.onDuplicate(item, t),
disabled: false,
},
],
},
]
: [
{
id: "option_move-to",
key: "move-to",
label: t("Common:MoveTo"),
icon: MoveReactSvgUrl,
onClick: isEditing
? () => this.onShowEditingToast(t)
: () => this.onMoveAction(item),
disabled: false,
},
{
id: "option_copy-to",
key: "copy-to",
label: t("Common:Copy"),
icon: CopyReactSvgUrl,
onClick: () => this.onCopyAction(item),
disabled: false,
},
{
id: "option_create-duplicate",
key: "duplicate",
label: t("Common:Duplicate"),
icon: DuplicateReactSvgUrl,
onClick: () => this.onDuplicate(item, t),
disabled: false,
},
];
const { pinOptions, muteOptions } = this.getRoomsRootContextOptions(
item,
@ -1558,8 +1558,7 @@ class ContextOptionsStore {
icon: InvitationLinkReactSvgUrl,
onClick: () => this.onCopyLink(item, t),
disabled:
(isPublicRoomType && item.canCopyPublicLink && !isArchive) ||
this.publicRoomStore.isPublicRoom ||
(isPublicRoomType && item.security?.Read && !isArchive) ||
!item.security?.CopyLink,
},
{
@ -1570,7 +1569,7 @@ class ContextOptionsStore {
disabled:
this.publicRoomStore.isPublicRoom ||
isArchive ||
!item.canCopyPublicLink ||
!item.security?.Read ||
!isPublicRoomType,
onClick: () => this.onCreateAndCopySharedLink(item, t),
// onLoad: () => this.onLoadLinks(t, item),
@ -1622,7 +1621,7 @@ class ContextOptionsStore {
label: t("Common:Info"),
icon: InfoOutlineReactSvgUrl,
onClick: () => this.onShowInfoPanel(item),
disabled: this.publicRoomStore.isPublicRoom,
disabled: false,
},
{
id: "option_block-unblock-version",
@ -1632,7 +1631,7 @@ class ContextOptionsStore {
onClick: () => this.lockFile(item, t),
disabled: false,
},
!this.publicRoomStore.isPublicRoom && {
{
key: "separator1",
isSeparator: true,
},

View File

@ -1470,7 +1470,7 @@ class FilesActionStore {
return titleWithoutExtension;
};
checkAndOpenLocationAction = async (item) => {
checkAndOpenLocationAction = async (item, actionType) => {
const { categoryType } = this.filesStore;
const { myRoomsId, myFolderId, archiveRoomsId, recycleBinFolderId } =
this.treeFoldersStore;
@ -1482,7 +1482,8 @@ class FilesActionStore {
};
const { title, fileExst } = item;
const parentId = item.parentId || item.toFolderId || recycleBinFolderId;
const parentId =
item.parentId || item.toFolderId || item.folderId || recycleBinFolderId;
const parentTitle = item.parentTitle || item.toFolderTitle;
const isRoot = [
@ -1501,7 +1502,11 @@ class FilesActionStore {
rootFolderType,
};
const url = getCategoryUrl(categoryType, parentId);
const isTrash = actionType === "delete";
const url = getCategoryUrl(
isTrash ? CategoryType.Trash : categoryType,
parentId,
);
const newFilter = FilesFilter.getDefault();
@ -2511,6 +2516,12 @@ class FilesActionStore {
clearFiles();
if (window.location.search.includes("group")) {
setSelectedNode(["accounts", "groups", "filter"]);
return window.DocSpace.navigate(`accounts/groups?${params}`, {
replace: true,
});
}
setSelectedNode(["accounts", "people", "filter"]);
if (fromHotkeys) return;

View File

@ -1573,18 +1573,14 @@ class FilesStore {
(data.current.rootFolderType === Rooms ||
data.current.rootFolderType === Archive);
let shared, canCopyPublicLink;
let shared;
if (idx === 1) {
let room = data.current;
if (!isCurrentFolder) {
room = await api.files.getFolderInfo(folderId);
shared = room.shared;
canCopyPublicLink =
room.access === ShareAccessRights.RoomManager ||
room.access === ShareAccessRights.None;
room.canCopyPublicLink = canCopyPublicLink;
this.infoPanelStore.setInfoPanelRoom(room);
}
@ -1602,7 +1598,6 @@ class FilesStore {
roomType,
isRootRoom,
shared,
canCopyPublicLink,
};
}),
).then((res) => {
@ -1941,10 +1936,10 @@ class FilesStore {
return rooms;
};
resetRoomQuota = async (itemsIDs, filter) => {
resetRoomQuota = async (itemsIDs, inRoom = false, filter) => {
const rooms = await api.rooms.resetRoomQuota(itemsIDs);
await this.fetchRooms(null, filter, false, false, false);
if (!inRoom) await this.fetchRooms(null, filter, false, false, false);
return rooms;
};
@ -2127,6 +2122,20 @@ class FilesStore {
fileOptions = this.removeOptions(fileOptions, optionsToRemove);
}
if (this.publicRoomStore.isPublicRoom) {
fileOptions = this.removeOptions(fileOptions, [
"separator0",
"sharing-settings",
"send-by-email",
"show-info",
"separator1",
"create-room",
"separator2",
"remove-from-recent",
"copy-general-link",
]);
}
if (!canDownload) {
fileOptions = this.removeOptions(fileOptions, ["download"]);
}
@ -2548,6 +2557,15 @@ class FilesStore {
folderOptions = this.removeOptions(folderOptions, optionsToRemove);
}
if (this.publicRoomStore.isPublicRoom) {
folderOptions = this.removeOptions(folderOptions, [
"show-info",
"sharing-settings",
"separator1",
"create-room",
]);
}
if (!canDownload) {
folderOptions = this.removeOptions(folderOptions, ["download"]);
}
@ -3370,10 +3388,6 @@ class FilesStore {
const isForm = fileExst === ".oform";
const canCopyPublicLink =
access === ShareAccessRights.RoomManager ||
access === ShareAccessRights.None;
return {
availableExternalRights,
access,
@ -3443,7 +3457,6 @@ class FilesStore {
type,
hasDraft,
isForm,
canCopyPublicLink,
requestToken,
lastOpened,
quotaLimit,

View File

@ -40,6 +40,7 @@ import { combineUrl } from "@docspace/shared/utils/combineUrl";
import AccountsFilter from "@docspace/shared/api/people/filter";
import api from "@docspace/shared/api";
import { TGroup } from "@docspace/shared/api/groups/types";
import { openingNewTab } from "@docspace/shared/utils/openingNewTab";
class GroupsStore {
authStore;
@ -593,10 +594,15 @@ class GroupsStore {
groupId: string,
withBackURL: boolean,
tempTitle: string,
e: React.MouseEvent<Element, MouseEvent>,
) => {
const { setIsSectionBodyLoading, setIsSectionFilterLoading } =
this.clientLoadingStore;
const url = `/accounts/groups/${groupId}`;
if (openingNewTab(url, e)) return;
this.setSelection([]);
this.setBufferSelection(null);
this.setCurrentGroup(null);
@ -610,7 +616,7 @@ class GroupsStore {
this.setInsideGroupBackUrl(url);
}
window.DocSpace.navigate(`/accounts/groups/${groupId}`);
window.DocSpace.navigate(url);
};
updateGroup = async (

View File

@ -654,7 +654,7 @@ class HotkeyStore {
},
};
if (isPublic) {
if (isPublic && !selections.rootFolderType) {
this.dialogsStore.setMoveToPublicRoomVisible(true, operationData);
return;
}

View File

@ -121,7 +121,8 @@ class InfoPanelStore {
setIsVisible = (bool) => {
if (
(this.infoPanelSelectedItems.length &&
!this.infoPanelSelectedItems[0]?.isRoom) ||
!this.infoPanelSelectedItems[0]?.isRoom &&
!this.infoPanelSelectedItems[0]?.inRoom) ||
(this.selectedFolderStore && !this.selectedFolderStore?.inRoom)
) {
this.setView(infoDetails);
@ -297,9 +298,6 @@ class InfoPanelStore {
...infoPanelSelection,
isRoom: infoPanelSelection.isRoom || !!infoPanelSelection.roomType,
icon: this.getInfoPanelItemIcon(infoPanelSelection, 32),
canCopyPublicLink:
infoPanelSelection.access === ShareAccessRights.RoomManager ||
infoPanelSelection.access === ShareAccessRights.None,
};
};

View File

@ -51,7 +51,6 @@ export type TNavigationPath = {
roomType: RoomsType;
isRootRoom: boolean;
shared: boolean;
canCopyPublicLink: boolean;
};
type ExcludeTypes = SettingsStore | Function;
@ -141,6 +140,12 @@ class SelectedFolderStore {
parentRoomType: Nullable<FolderType> = null;
usedSpace: number | undefined;
quotaLimit: number | undefined;
isCustomQuota: boolean | undefined;
constructor(settingsStore: SettingsStore) {
makeAutoObservable(this);
this.settingsStore = settingsStore;
@ -181,10 +186,12 @@ class SelectedFolderStore {
private: this.private,
canShare: this.canShare,
isArchive: this.isArchive,
canCopyPublicLink: this.canCopyPublicLink,
type: this.type,
isRootFolder: this.isRootFolder,
parentRoomType: this.parentRoomType,
usedSpace: this.usedSpace,
quotaLimit: this.quotaLimit,
isCustomQuota: this.isCustomQuota,
};
};
@ -192,13 +199,6 @@ class SelectedFolderStore {
return this.pathParts && this.pathParts.length <= 1;
}
get canCopyPublicLink() {
return (
this.access === ShareAccessRights.RoomManager ||
this.access === ShareAccessRights.None
);
}
toDefault = () => {
this.folders = null;
this.parentId = 0;
@ -230,6 +230,9 @@ class SelectedFolderStore {
this.type = null;
this.inRoom = false;
this.parentRoomType = null;
this.usedSpace = undefined;
this.quotaLimit = undefined;
this.isCustomQuota = undefined;
};
setParentId = (parentId: number) => {
@ -348,6 +351,8 @@ class SelectedFolderStore {
}
});
}
this.setInRoom(!!selectedFolder?.parentId);
};
}

View File

@ -384,9 +384,12 @@ class UsersStore {
) {
options.push("separator-1");
if (status === EmployeeStatus.Active) {
if (
status === EmployeeStatus.Active ||
status === EmployeeStatus.Pending
) {
options.push("disable");
} else {
} else if (status === EmployeeStatus.Disabled) {
options.push("enable");
}
}

View File

@ -25,6 +25,10 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import type { Metadata } from "next";
import { headers } from "next/headers";
import { getSelectorsByUserAgent } from "react-device-detect";
import { BRAND_NAME } from "@docspace/shared/constants";
import { getData } from "@/utils/actions";
@ -51,6 +55,17 @@ async function Page({ searchParams }: RootPageProps) {
const { fileId, fileid, version, doc, action, share, editorType, error } =
searchParams ?? initialSearchParams;
const hdrs = headers();
let type = editorType;
const ua = hdrs.get("user-agent");
if (ua && !type) {
const { isMobile } = getSelectorsByUserAgent(ua);
if (isMobile) type = "mobile";
}
const startDate = new Date();
const data = await getData(
@ -59,7 +74,7 @@ async function Page({ searchParams }: RootPageProps) {
doc,
action,
share,
editorType,
type,
);
const timer = new Date().getTime() - startDate.getTime();

View File

@ -28,7 +28,6 @@
import React from "react";
import { useRouter, useSearchParams } from "next/navigation";
import { isMobile } from "react-device-detect";
import { useTranslation } from "react-i18next";
import { DocumentEditor } from "@onlyoffice/document-editor-react";
@ -142,14 +141,9 @@ const Editor = ({
if (config) newConfig.editorConfig = { ...config.editorConfig };
const search = typeof window !== "undefined" ? window.location.search : "";
const editorType = new URLSearchParams(search).get("editorType");
//if (view && newConfig.editorConfig) newConfig.editorConfig.mode = "view";
if (editorType) newConfig.type = editorType;
if (isMobile) newConfig.type = "mobile";
let goBack: TGoBack = {} as TGoBack;
if (fileInfo) {

View File

@ -45,6 +45,7 @@ const DEFAULT_SORT_BY = "";
const DEFAULT_SORT_ORDER = "";
const DEFAULT_CATEGORIZE_BY = "";
const DEFAULT_CATEGORY_ID = "";
const DEFAULT_EXTENSION = "pdf";
class OformsFilter {
constructor(
@ -54,6 +55,7 @@ class OformsFilter {
categoryId = DEFAULT_CATEGORY_ID,
locale = DEFAULT_LOCALE,
search = DEFAULT_SEARCH,
extension = DEFAULT_EXTENSION,
sortBy = DEFAULT_SORT_BY,
sortOrder = DEFAULT_SORT_ORDER,
total = DEFAULT_TOTAL,
@ -64,12 +66,13 @@ class OformsFilter {
this.categoryId = categoryId;
this.locale = locale;
this.search = search;
this.extension = extension;
this.sortBy = sortBy;
this.sortOrder = sortOrder;
this.total = total;
}
static getDefault(total = DEFAULT_TOTAL) {
static getDefault(total = DEFAULT_TOTAL, extension = DEFAULT_EXTENSION) {
return new OformsFilter(
DEFAULT_PAGE,
DEFAULT_PAGE_SIZE,
@ -77,6 +80,7 @@ class OformsFilter {
DEFAULT_CATEGORY_ID,
DEFAULT_LOCALE,
DEFAULT_SEARCH,
extension,
DEFAULT_SORT_BY,
DEFAULT_SORT_ORDER,
total,
@ -110,6 +114,7 @@ class OformsFilter {
categoryId,
locale,
search,
defaultFilter.extension,
sortBy,
sortOrder,
defaultFilter.total,
@ -126,6 +131,7 @@ class OformsFilter {
this.categoryId,
this.locale,
this.search,
this.extension,
this.sortBy,
this.sortOrder,
this.total,
@ -155,6 +161,7 @@ class OformsFilter {
categoryId,
locale,
search,
extension,
sortBy,
sortOrder,
} = this;
@ -166,6 +173,7 @@ class OformsFilter {
dtoFilter[`filters[${categorizeBy}][id][$eq]`] = categoryId;
dtoFilter[LOCALE] = locale;
dtoFilter[`filters[name_form][$containsi]`] = search;
dtoFilter[`filters[form_exts][ext][$eq]`] = extension;
if (sortBy && sortOrder) dtoFilter[SORT] = `${sortBy}:${sortOrder}`;
return toUrlParams(dtoFilter, true);

View File

@ -229,7 +229,7 @@ const FilterBlock = ({
};
});
if (isSelected) {
if (isSelected && key !== "0") {
if (isMultiSelect) {
const groupIdx = value.findIndex(
(item) => "group" in item && item.group === group,
@ -293,7 +293,7 @@ const FilterBlock = ({
) {
item.key.push(key);
} else {
item.key = key;
item.key = isSelected && key === "0" ? "1" : key;
if (label) {
item.label = label;
}

View File

@ -33,6 +33,7 @@ import UpSvgUrl from "PUBLIC_DIR/images/up.svg?url";
import FormRoomEmptyDarkImageUrl from "PUBLIC_DIR/images/emptyview/selector.form.room.empty.screen.dark.svg?url";
import FormRoomEmptyLightImageUrl from "PUBLIC_DIR/images/emptyview/selector.form.room.empty.screen.light.svg?url";
import Plus16SvgUrl from "PUBLIC_DIR/images/icons/16/plus.svg?url";
import ClearEmptyFilterSvgUrl from "PUBLIC_DIR/images/clear.empty.filter.svg?url";
import { RoomsType } from "../../../enums";
@ -49,6 +50,7 @@ import useCreateDropDown from "../hooks/useCreateDropDown";
import { EmptyScreenContext } from "../contexts/EmptyScreen";
import NewItemDropDown from "./NewItemDropDown";
import { SearchContext } from "../contexts/Search";
const linkStyles = {
isHovered: true,
@ -75,6 +77,7 @@ const EmptyScreen = ({
const theme = useTheme();
const { t } = useTranslation(["Common"]);
const { onClearSearch } = useContext(SearchContext);
const { isOpenDropDown, setIsOpenDropDown, onCloseDropDown } =
useCreateDropDown();
@ -175,12 +178,19 @@ const EmptyScreen = ({
<IconButton
className="empty-folder_container-icon"
size={12}
onClick={createItem.onBackClick}
iconName={UpSvgUrl}
onClick={
withSearch ? () => onClearSearch?.() : createItem.onBackClick
}
iconName={withSearch ? ClearEmptyFilterSvgUrl : UpSvgUrl}
isFill
/>
<Link {...linkStyles} onClick={createItem.onBackClick}>
{t("Common:Back")}
<Link
{...linkStyles}
onClick={
withSearch ? () => onClearSearch?.() : createItem.onBackClick
}
>
{withSearch ? t("Common:ClearFilter") : t("Common:Back")}
</Link>
</div>
</div>

View File

@ -415,10 +415,14 @@ const StyledTableHeaderCell = styled.div<{
? props.theme.tableContainer.header.activeTextColor
: props.theme.tableContainer.header.textColor};
&:hover {
color: ${(props) =>
props.theme.tableContainer.header.hoverTextColor} !important;
}
${(props) =>
props.showIcon &&
props.sortingVisible &&
css`
&:hover {
color: ${props.theme.tableContainer.header.hoverTextColor} !important;
}
`}
}
`;

View File

@ -48,7 +48,7 @@
"react-autosize-textarea": "^7.1.0",
"react-content-loader": "^5.1.4",
"react-countdown": "2.3.5",
"react-device-detect": "^1.17.0",
"react-device-detect": "^2.2.3",
"react-dom": "^18.2.0",
"react-draggable": "^4.4.6",
"react-dropzone": "^11.7.1",

View File

@ -429,7 +429,9 @@ const FilesSelectorComponent = ({
isChecked: boolean,
) => {
const isPublic =
breadCrumbs.findIndex((f) => f.roomType === RoomsType.PublicRoom) > -1;
breadCrumbs.findIndex((f) => f.roomType === RoomsType.PublicRoom) >
-1 && rootFolderType !== FolderType.Rooms;
const folderTitle = breadCrumbs[breadCrumbs.length - 1].label;
await onSubmit(

View File

@ -2856,7 +2856,7 @@ __metadata:
react-autosize-textarea: "npm:^7.1.0"
react-content-loader: "npm:^5.1.4"
react-countdown: "npm:2.3.5"
react-device-detect: "npm:^1.17.0"
react-device-detect: "npm:^2.2.3"
react-docgen-typescript-plugin: "npm:^1.0.5"
react-dom: "npm:^18.2.0"
react-draggable: "npm:^4.4.6"
@ -23206,15 +23206,15 @@ __metadata:
languageName: node
linkType: hard
"react-device-detect@npm:^1.17.0":
version: 1.17.0
resolution: "react-device-detect@npm:1.17.0"
"react-device-detect@npm:^2.2.3":
version: 2.2.3
resolution: "react-device-detect@npm:2.2.3"
dependencies:
ua-parser-js: "npm:^0.7.24"
ua-parser-js: "npm:^1.0.33"
peerDependencies:
react: ">= 0.14.0 < 18.0.0"
react-dom: ">= 0.14.0 < 18.0.0"
checksum: 10/7a108095222057653a68bbee5d3ef208b110440a9a78790fb41737f0dec684250a5fa98da8a0e8da4443da49a29272eb6d6eb157999d4c06187f6af27b79d38d
react: ">= 0.14.0"
react-dom: ">= 0.14.0"
checksum: 10/7152e2b216b3bb6fd75c7859d3441b89658695c629a13c5d374f076756705650be585d5c4dc19d9d34908ef1b61f19b52f1055d74dd7104b77d1b6f897ee09e0
languageName: node
linkType: hard
@ -27205,13 +27205,20 @@ __metadata:
languageName: node
linkType: hard
"ua-parser-js@npm:^0.7.24, ua-parser-js@npm:^0.7.9":
"ua-parser-js@npm:^0.7.9":
version: 0.7.37
resolution: "ua-parser-js@npm:0.7.37"
checksum: 10/a50e8f7ee5618822670443b05e33ab184e3186d3f88c4761cdf65cf264219c626b74ee6cf96146091d9738c61412afe2788eeda75ef98f71a69a81495abe20ff
languageName: node
linkType: hard
"ua-parser-js@npm:^1.0.33":
version: 1.0.38
resolution: "ua-parser-js@npm:1.0.38"
checksum: 10/f2345e9bd0f9c5f85bcaa434535fae88f4bb891538e568106f0225b2c2937fbfbeb5782bd22320d07b6b3d68b350b8861574c1d7af072ff9b2362fb72d326fd9
languageName: node
linkType: hard
"ua-parser-js@npm:^1.0.35":
version: 1.0.37
resolution: "ua-parser-js@npm:1.0.37"