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

This commit is contained in:
Akmal Isomadinov 2022-12-07 17:33:01 +05:00
commit 139677b29a
4 changed files with 39 additions and 17 deletions

View File

@ -3,6 +3,7 @@ import styled from "styled-components";
import { useDropzone } from "react-dropzone";
import resizeImage from "resize-image";
import { Base } from "@docspace/components/themes";
import { ColorTheme, ThemeType } from "@docspace/common/components/ColorTheme";
const StyledDropzone = styled.div`
cursor: pointer;
@ -33,8 +34,6 @@ const StyledDropzone = styled.div`
font-size: 13px;
line-height: 20px;
&-main {
color: ${(props) =>
props.theme.createEditRoomDialog.dropzone.linkMainColor};
font-weight: 600;
text-decoration: underline;
text-decoration-style: dashed;
@ -103,7 +102,9 @@ const Dropzone = ({ t, setUploadedFile, isDisabled }) => {
<div {...getRootProps({ className: "dropzone" })}>
<input {...getInputProps()} />
<div className="dropzone-link">
<span className="dropzone-link-main">{t("DropzoneTitleLink")}</span>
<ColorTheme className="dropzone-link-main" themeId={ThemeType.Link}>
{t("DropzoneTitleLink")}
</ColorTheme>
<span className="dropzone-link-secondary">
{t("DropzoneTitleSecondary")}
</span>

View File

@ -1,7 +1,10 @@
import React from "react";
import { inject, observer } from "mobx-react";
import styled from "styled-components";
import { withTranslation } from "react-i18next";
import { PaymentsType } from "@docspace/common/constants";
import Badge from "@docspace/components/badge";
import commonIconsStyles from "@docspace/components/utils/common-icons-style";
@ -33,8 +36,24 @@ const StyledCatalogSpamIcon = styled(CatalogSpamIcon)`
}
`;
//TODO: need backed isPaid
const Badges = ({ t, statusType, withoutPaid, isPaid = false }) => {
const Badges = ({
t,
statusType,
withoutPaid,
isPaid = false,
filter,
getUsersList,
}) => {
const onClickPaid = () => {
if (filter.payments === PaymentsType.Paid) return;
const newFilter = filter.clone();
newFilter.payments = PaymentsType.Paid;
getUsersList(newFilter, true);
};
return (
<StyledBadgesContainer className="badges additional-badges">
{!withoutPaid && isPaid && (
@ -47,6 +66,7 @@ const Badges = ({ t, statusType, withoutPaid, isPaid = false }) => {
fontWeight={800}
lineHeight={"13px"}
noHover
onClick={onClickPaid}
/>
)}
{statusType === "pending" && <StyledSendClockIcon size="small" />}
@ -55,4 +75,11 @@ const Badges = ({ t, statusType, withoutPaid, isPaid = false }) => {
);
};
export default withTranslation(["Common"])(Badges);
export default inject(({ peopleStore }) => {
const { filterStore, usersStore } = peopleStore;
const { filter } = filterStore;
const { getUsersList } = usersStore;
return { filter, getUsersList };
})(withTranslation(["Common"])(observer(Badges)));

View File

@ -16,7 +16,7 @@ const EmptyScreen = ({ resetFilter, isEmptyGroup, setIsLoading }) => {
const onResetFilter = () => {
setIsLoading(true);
resetFilter(true).finally(() => setIsLoading(false));
resetFilter().finally(() => setIsLoading(false));
};
return (

View File

@ -21,6 +21,7 @@ import { isMobileRDD } from "react-device-detect";
import toastr from "@docspace/components/toast/toastr";
import { EmployeeStatus } from "@docspace/common/constants";
import Filter from "@docspace/common/api/people/filter";
class PeopleStore {
contextOptionsStore = null;
@ -86,19 +87,12 @@ class PeopleStore {
this.loadingStore.setIsLoaded(false);
};
resetFilter = (withoutGroup = false) => {
const { filter } = this.filterStore;
resetFilter = () => {
const { getUsersList } = this.usersStore;
let newFilter;
if (withoutGroup) {
const { group } = filter;
newFilter = filter.reset(group);
} else {
newFilter = filter.clone(true);
}
const filter = Filter.getDefault();
return getUsersList(newFilter);
return getUsersList(filter, true);
};
onChangeType = (e) => {