Skip to content

Commit

Permalink
Merge branch 'hotfix/v3.0.1' of git.onlyoffice.com:ONLYOFFICE/DocSpac…
Browse files Browse the repository at this point in the history
…e-client into hotfix/v3.0.1
  • Loading branch information
gopienkonikita committed Dec 4, 2024
2 parents bde99e6 + e5b725f commit b95ea89
Show file tree
Hide file tree
Showing 22 changed files with 332 additions and 385 deletions.
9 changes: 6 additions & 3 deletions packages/client/src/components/Article/Body/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ const ArticleBodyContent = (props) => {

const isAccountsClick = folderId === "accounts";

let withTimer = isAccountsClick ? false : !!selectedFolderId;
let withTimer = isAccountsClick
? window.location.pathname.includes("accounts") &&
!window.location.pathname.includes("groups")
: !!selectedFolderId;

if (isAccountsClick) {
clearFiles();
Expand Down Expand Up @@ -309,12 +312,12 @@ export default inject(
const {
showArticleLoader,

setIsSectionFilterLoading,
setIsSectionBodyLoading,
firstLoad,
} = clientLoadingStore;

const setIsLoading = (param, withTimer) => {
setIsSectionFilterLoading(param, withTimer);
setIsSectionBodyLoading(param, withTimer);

if (param && withTimer) showProgress();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,10 @@ export default inject(
}) => {
const { isDesktopClient, isEncryptionSupport, theme } = settingsStore;

const { setIsSectionFilterLoading } = clientLoadingStore;
const { setIsSectionBodyLoading } = clientLoadingStore;

const setIsLoading = (param) => {
setIsSectionFilterLoading(param);
setIsSectionBodyLoading(param);
};

const { filter, privacyInstructions, isEmptyPage } = filesStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ export default inject(

const { onClickInviteUsers } = contextOptionsStore;

const { setIsSectionFilterLoading, isLoading } = clientLoadingStore;
const { setIsSectionBodyLoading, isLoading } = clientLoadingStore;

const setIsLoading = (param) => {
setIsSectionFilterLoading(param);
setIsSectionBodyLoading(param);
};

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ export const useOptions = (

const path = getCategoryUrl(CategoryType.Personal);

// setIsSectionFilterLoading(true);

return {
to: {
pathname: path,
Expand Down
12 changes: 0 additions & 12 deletions packages/client/src/components/GlobalEvents/CreateEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const CreateEvent = ({
templateId,
fromTemplate,
onClose,
setIsLoading,

createFolder,
addActiveItems,
Expand Down Expand Up @@ -124,8 +123,6 @@ const CreateEvent = ({

const isMakeFormFromFile = templateId ? true : false;

setIsLoading(true);

let newValue = value;

if (value.trim() === "") {
Expand Down Expand Up @@ -163,7 +160,6 @@ const CreateEvent = ({

clearActiveOperations(null, folderIds);
onCloseAction();
return setIsLoading(false);
});
} else {
try {
Expand Down Expand Up @@ -222,7 +218,6 @@ const CreateEvent = ({
} catch (error) {
toastr.error(error);
} finally {
setIsLoading(false);
onCloseAction();
}
}
Expand Down Expand Up @@ -259,12 +254,6 @@ export default inject(
currentTariffStatusStore,
publicRoomStore,
}) => {
const { setIsSectionBodyLoading } = clientLoadingStore;

const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
};

const publicRoomKey = publicRoomStore.publicRoomKey;

const {
Expand Down Expand Up @@ -303,7 +292,6 @@ export default inject(
setPortalTariff,
setEventDialogVisible,
eventDialogVisible,
setIsLoading,
createFile,
createFolder,
addActiveItems,
Expand Down
31 changes: 17 additions & 14 deletions packages/client/src/components/Layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,18 @@ const Layout = (props) => {
isFrame,
} = props;

const [contentHeight, setContentHeight] = useState();
const [isPortrait, setIsPortrait] = useState();

if (window.DocSpace) {
window.DocSpace.navigate = useNavigate();
window.DocSpace.location = useLocation();
} else {
window.DocSpace = { navigate: useNavigate(), location: useLocation() };
}
const navigate = useNavigate();
const location = useLocation();

window.DocSpace = {
...window.DocSpace,
navigate,
location,
};

const isSDKPath = window.DocSpace.location.pathname.includes("/sdk/");

let intervalHandler;
let timeoutHandler;
Expand Down Expand Up @@ -161,12 +164,12 @@ const Layout = (props) => {
};

return (
<StyledContainer
className="Layout"
contentHeight={contentHeight}
isPortrait={isPortrait}
>
<Scrollbar id="customScrollBar">{children}</Scrollbar>
<StyledContainer className="Layout" isPortrait={isPortrait}>
{isSDKPath ? (
children
) : (
<Scrollbar id="customScrollBar">{children}</Scrollbar>
)}
</StyledContainer>
);
};
Expand All @@ -182,8 +185,8 @@ export default inject(({ settingsStore }) => {
isTabletView,
setIsTabletView,
setWindowWidth,
isFrame,
setWindowAngle,
isFrame,
} = settingsStore;
return {
isTabletView,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export const NewFilesPanelComponent = ({
<Scrollbar>{content}</Scrollbar>
{markAsReadButton}
</StyledPanel>
{isMobile() && <Backdrop visible withoutBackground withoutBlur />}
{!isMobile() && <Backdrop visible withoutBackground withoutBlur />}
</>
);

Expand Down
8 changes: 6 additions & 2 deletions packages/client/src/pages/Home/Section/Filter/useContacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,11 @@ export const useContactsFilter = ({
};

if (isGuests) {
options.push(email, inviter, registrationDate);
options.push(firstName, email);

if (!isRoomAdmin) options.push(inviter);

options.push(registrationDate);
} else {
options.push(firstName, type, department, email);
if (showStorageInfo) options.push(storage);
Expand Down Expand Up @@ -833,7 +837,7 @@ export const useContactsFilter = ({
groupsOptions.push(title, people, manager);

return groupsOptions;
}, [isGroups, isGuests, showStorageInfo, t]);
}, [isGroups, isGuests, isRoomAdmin, showStorageInfo, t]);

const removeContactsSelectedItem = React.useCallback(
(group: FilterGroups) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/pages/Home/Section/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -782,14 +782,14 @@ export default inject(
} = filesStore;

const {
setIsSectionFilterLoading,
setIsSectionBodyLoading,
showHeaderLoader,

isLoading,
} = clientLoadingStore;

const setIsLoading = (param) => {
setIsSectionFilterLoading(param);
setIsSectionBodyLoading(param);
};

const { isRecycleBinFolder, isRoomsFolder, isArchiveFolder } =
Expand Down
35 changes: 15 additions & 20 deletions packages/client/src/pages/Home/Section/Tabs/ContactsTabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,16 @@ import {
} from "SRC_DIR/helpers/contacts";

type ContactsTabsProps = {
showFilterLoader: ClientLoadingStore["showFilterLoader"];
showTabsLoader: ClientLoadingStore["showTabsLoader"];

setUsersSelection: UsersStore["setSelection"];
setUsersBufferSelection: UsersStore["setBufferSelection"];
isUsersFetched: UsersStore["isUsersFetched"];
setContactsTab: UsersStore["setContactsTab"];
guestsTabVisited: UsersStore["guestsTabVisited"];
contactsTab: UsersStore["contactsTab"];

setGroupsSelection: GroupsStore["setSelection"];
setGroupsBufferSelection: GroupsStore["setBufferSelection"];
isGroupsFetched: GroupsStore["isGroupsFetched"];

setIsSectionBodyLoading: ClientLoadingStore["setIsSectionBodyLoading"];

Expand All @@ -69,7 +68,7 @@ type ContactsTabsProps = {
};

const ContactsTabs = ({
showFilterLoader,
showTabsLoader,
setUsersSelection,
setGroupsSelection,
setUsersBufferSelection,
Expand All @@ -80,12 +79,11 @@ const ContactsTabs = ({
isCollaborator,
isRoomAdmin,

isUsersFetched,
isGroupsFetched,

setContactsTab,

guestsTabVisited,

contactsTab,
}: ContactsTabsProps) => {
const { t } = useTranslation(["Common"]);
const location = useLocation();
Expand All @@ -98,15 +96,15 @@ const ContactsTabs = ({
setUsersBufferSelection(null);
setGroupsSelection([]);
setGroupsBufferSelection(null);
setIsSectionBodyLoading(true, isUsersFetched);
setIsSectionBodyLoading(true, contactsTab !== "groups");
setContactsTab("people");
navigate(PEOPLE_ROUTE_WITH_FILTER);
};

const onGroups = () => {
setUsersSelection([]);
setUsersBufferSelection(null);
setIsSectionBodyLoading(true, isGroupsFetched);
setIsSectionBodyLoading(true, false);
setContactsTab("groups");

navigate(GROUPS_ROUTE_WITH_FILTER);
Expand All @@ -118,7 +116,7 @@ const ContactsTabs = ({
setUsersBufferSelection(null);
setGroupsSelection([]);
setGroupsBufferSelection(null);
setIsSectionBodyLoading(true, isUsersFetched);
setIsSectionBodyLoading(true, contactsTab !== "groups");

const filter = Filter.getDefault();

Expand All @@ -133,7 +131,7 @@ const ContactsTabs = ({

if (contactsView === "inside_group") return null;

if (showFilterLoader) return <SectionSubmenuSkeleton />;
if (showTabsLoader) return <SectionSubmenuSkeleton />;

const items: TTabItem[] = [
{
Expand Down Expand Up @@ -185,7 +183,7 @@ export default inject(
clientLoadingStore: ClientLoadingStore;
userStore: UserStore;
}) => {
const { showFilterLoader, setIsSectionBodyLoading } = clientLoadingStore;
const { showTabsLoader, setIsSectionBodyLoading } = clientLoadingStore;
const { usersStore, groupsStore } = peopleStore;

const {
Expand All @@ -199,21 +197,19 @@ export default inject(
setSelection: setUsersSelection,
setBufferSelection: setUsersBufferSelection,

isUsersFetched,

setContactsTab,

guestsTabVisited,

contactsTab,
} = usersStore!;
const {
setSelection: setGroupsSelection,
setBufferSelection: setGroupsBufferSelection,

isGroupsFetched,
} = groupsStore!;

return {
showFilterLoader,
showTabsLoader,
setUsersSelection,
setUsersBufferSelection,
setGroupsSelection,
Expand All @@ -226,12 +222,11 @@ export default inject(
isCollaborator,
isRoomAdmin,

isUsersFetched,
isGroupsFetched,

setContactsTab,

guestsTabVisited,

contactsTab,
};
},
)(observer(ContactsTabs));
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const MyDocumentsTabs = ({
isPersonalRoom,
isRecentTab,
setFilter,
showBodyLoader,
showTabsLoader,
isRoot,
user,
setChangeDocumentsTabs,
Expand Down Expand Up @@ -90,7 +90,7 @@ const MyDocumentsTabs = ({
? tabs[1].id
: tabs[0].id;

if (showTabs && showBodyLoader) return <SectionSubmenuSkeleton />;
if (showTabs && showTabsLoader) return <SectionSubmenuSkeleton />;

return showTabs ? (
<Tabs items={tabs} selectedItemId={startSelectId} onSelect={onSelect} />
Expand All @@ -107,15 +107,15 @@ export default inject(
}) => {
const { isPersonalRoom, isRecentTab, isRoot } = treeFoldersStore;
const { setFilter } = filesStore;
const { showBodyLoader } = clientLoadingStore;
const { showTabsLoader } = clientLoadingStore;
const { user } = userStore;
const { setChangeDocumentsTabs } = selectedFolderStore;

return {
isPersonalRoom,
isRecentTab,
setFilter,
showBodyLoader,
showTabsLoader,
isRoot,
user,
setChangeDocumentsTabs,
Expand Down
7 changes: 1 addition & 6 deletions packages/client/src/pages/Home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,9 @@ const PureHome = (props) => {
const setIsLoading = React.useCallback(
(param, withoutTimer, withHeaderLoader) => {
if (withHeaderLoader) setIsSectionHeaderLoading(param, !withoutTimer);
setIsSectionFilterLoading(param, !withoutTimer);
setIsSectionBodyLoading(param, !withoutTimer);
},
[
setIsSectionHeaderLoading,
setIsSectionFilterLoading,
setIsSectionBodyLoading,
],
[setIsSectionHeaderLoading, setIsSectionBodyLoading],
);

const { onDrop } = useFiles({
Expand Down
Loading

0 comments on commit b95ea89

Please sign in to comment.