Merge branch 'release/v2.0.0' into bugfix/list-accounts-double-fetch
This commit is contained in:
commit
20dd79e3ad
@ -21,6 +21,7 @@ const ChangeUserTypeEvent = ({
|
||||
getPeopleListItem,
|
||||
setSelection,
|
||||
needResetUserSelection,
|
||||
isRoomAdmin,
|
||||
}) => {
|
||||
const { toType, fromType, userIDs, successCallback, abortCallback } =
|
||||
peopleDialogData;
|
||||
@ -78,9 +79,11 @@ const ChangeUserTypeEvent = ({
|
||||
toastr.error(
|
||||
<>
|
||||
<Text>{t("Common:QuotaPaidUserLimitError")}</Text>
|
||||
{!isRoomAdmin && (
|
||||
<Link color="#5387AD" isHovered={true} onClick={onClickPayments}>
|
||||
{t("Common:PaymentsTitle")}
|
||||
</Link>
|
||||
)}
|
||||
</>,
|
||||
false,
|
||||
0,
|
||||
@ -140,7 +143,8 @@ export default inject(({ auth, dialogsStore, peopleStore }) => {
|
||||
changeUserTypeDialogVisible: visible,
|
||||
setChangeUserTypeDialogVisible: setVisible,
|
||||
} = dialogsStore;
|
||||
const { setSelection } = auth.infoPanelStore;
|
||||
const { isRoomAdmin, infoPanelStore } = auth;
|
||||
const { setSelection } = infoPanelStore;
|
||||
const { dialogStore, filterStore, usersStore } = peopleStore;
|
||||
|
||||
const { data: peopleDialogData } = dialogStore;
|
||||
@ -153,6 +157,7 @@ export default inject(({ auth, dialogsStore, peopleStore }) => {
|
||||
} = usersStore;
|
||||
const { setSelected } = peopleStore.selectionStore;
|
||||
return {
|
||||
isRoomAdmin,
|
||||
needResetUserSelection,
|
||||
getPeopleListItem,
|
||||
setSelection,
|
||||
|
@ -4,6 +4,8 @@ import PropTypes from "prop-types";
|
||||
import ModalDialog from "@docspace/components/modal-dialog";
|
||||
import Button from "@docspace/components/button";
|
||||
import Text from "@docspace/components/text";
|
||||
import Link from "@docspace/components/link";
|
||||
import { combineUrl } from "@docspace/common/utils";
|
||||
|
||||
import { withTranslation } from "react-i18next";
|
||||
import toastr from "@docspace/components/toast/toastr";
|
||||
@ -18,6 +20,15 @@ class ChangeUserStatusDialogComponent extends React.Component {
|
||||
this.state = { isRequestRunning: false };
|
||||
}
|
||||
|
||||
onClickPayments = () => {
|
||||
const paymentPageUrl = combineUrl(
|
||||
"/portal-settings",
|
||||
"/payments/portal-payments"
|
||||
);
|
||||
|
||||
toastr.clear();
|
||||
window.DocSpace.navigate(paymentPageUrl);
|
||||
};
|
||||
onChangeUserStatus = () => {
|
||||
const {
|
||||
updateUserStatus,
|
||||
@ -43,7 +54,24 @@ class ChangeUserStatusDialogComponent extends React.Component {
|
||||
|
||||
toastr.success(t("PeopleTranslations:SuccessChangeUserStatus"));
|
||||
})
|
||||
.catch((error) => toastr.error(error))
|
||||
.catch((err) => {
|
||||
toastr.error(
|
||||
<>
|
||||
<Text>{t("Common:QuotaPaidUserLimitError")}</Text>
|
||||
<Link
|
||||
color="#5387AD"
|
||||
isHovered={true}
|
||||
onClick={this.onClickPayments}
|
||||
>
|
||||
{t("Common:PaymentsTitle")}
|
||||
</Link>
|
||||
</>,
|
||||
false,
|
||||
0,
|
||||
true,
|
||||
true
|
||||
);
|
||||
})
|
||||
.finally(() => {
|
||||
this.setState({ isRequestRunning: false }, () => {
|
||||
needResetUserSelection && setSelected("close");
|
||||
|
@ -48,6 +48,8 @@ const DataReassignmentDialog = ({
|
||||
setIsDeletingUserWithReassignment,
|
||||
setDataReassignmentDeleteProfile,
|
||||
dataReassignmentUrl,
|
||||
needResetUserSelection,
|
||||
setSelected
|
||||
}) => {
|
||||
const [selectorVisible, setSelectorVisible] = useState(false);
|
||||
const defaultSelectedUser = isDeletingUserWithReassignment
|
||||
@ -146,6 +148,9 @@ const DataReassignmentDialog = ({
|
||||
.then(() => checkProgress())
|
||||
.catch((error) => {
|
||||
toastr.error(error?.response?.data?.error?.message);
|
||||
})
|
||||
.finally(() => {
|
||||
needResetUserSelection && setSelected("close");
|
||||
});
|
||||
};
|
||||
|
||||
@ -250,6 +255,7 @@ export default inject(({ auth, peopleStore, setup }) => {
|
||||
setIsDeletingUserWithReassignment,
|
||||
} = peopleStore.dialogStore;
|
||||
const { currentColorScheme, dataReassignmentUrl } = auth.settingsStore;
|
||||
const {setSelected} = peopleStore.selectionStore;
|
||||
const {
|
||||
dataReassignment,
|
||||
dataReassignmentProgress,
|
||||
@ -258,7 +264,7 @@ export default inject(({ auth, peopleStore, setup }) => {
|
||||
|
||||
const { user: currentUser } = peopleStore.authStore.userStore;
|
||||
|
||||
const { getUsersList } = peopleStore.usersStore;
|
||||
const { getUsersList, needResetUserSelection } = peopleStore.usersStore;
|
||||
|
||||
return {
|
||||
setDataReassignmentDialogVisible,
|
||||
@ -274,6 +280,8 @@ export default inject(({ auth, peopleStore, setup }) => {
|
||||
isDeletingUserWithReassignment,
|
||||
setIsDeletingUserWithReassignment,
|
||||
dataReassignmentUrl,
|
||||
needResetUserSelection,
|
||||
setSelected
|
||||
};
|
||||
})(
|
||||
observer(
|
||||
|
@ -267,6 +267,7 @@ const InvitePanel = ({
|
||||
|
||||
try {
|
||||
setIsLoading(true);
|
||||
const result =
|
||||
roomId === -1
|
||||
? await inviteUsers(data)
|
||||
: await setRoomSecurity(roomId, data);
|
||||
@ -279,6 +280,11 @@ const InvitePanel = ({
|
||||
|
||||
onClose();
|
||||
toastr.success(t("Common:UsersInvited"));
|
||||
|
||||
if (result?.warning) {
|
||||
toastr.warning(result?.warning);
|
||||
}
|
||||
|
||||
reloadSelectionParentRoom();
|
||||
} catch (err) {
|
||||
toastr.error(err);
|
||||
|
@ -254,6 +254,7 @@ const SectionFilterContent = ({
|
||||
setRoomsFilter,
|
||||
standalone,
|
||||
currentDeviceType,
|
||||
isRoomAdmin,
|
||||
}) => {
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
@ -1001,13 +1002,15 @@ const SectionFilterContent = ({
|
||||
group: "filter-status",
|
||||
label: t("PeopleTranslations:PendingTitle"),
|
||||
},
|
||||
{
|
||||
];
|
||||
|
||||
if (!isRoomAdmin)
|
||||
statusItems.push({
|
||||
id: "filter_status-disabled",
|
||||
key: 3,
|
||||
group: "filter-status",
|
||||
label: t("PeopleTranslations:DisabledEmployeeStatus"),
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
const typeItems = [
|
||||
{
|
||||
@ -2088,7 +2091,7 @@ export default inject(
|
||||
const { providers } = thirdPartyStore;
|
||||
|
||||
const { fetchTags } = tagsStore;
|
||||
|
||||
const { isRoomAdmin } = auth;
|
||||
const { user } = auth.userStore;
|
||||
const { personal, standalone, currentDeviceType } = auth.settingsStore;
|
||||
const {
|
||||
@ -2119,6 +2122,7 @@ export default inject(
|
||||
const { canSearchByContent } = filesSettingsStore;
|
||||
|
||||
return {
|
||||
isRoomAdmin,
|
||||
user,
|
||||
userId: user?.id,
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
temp = agent.match(
|
||||
/\b(OPR|Edge|AscDesktopEditor|SamsungBrowser|UCBrowser)\/(\d+.\d)/
|
||||
);
|
||||
|
||||
const userOS =
|
||||
agent.search("Linux") !== -1 && agent.search("X11") !== -1
|
||||
? "Linux"
|
||||
@ -45,7 +46,7 @@
|
||||
return {
|
||||
name: temp[1].replace("OPR", "Opera"),
|
||||
version: temp[2],
|
||||
chromeVersion: match[2],
|
||||
chromeVersion: match[2] || 70,
|
||||
userOS,
|
||||
};
|
||||
}
|
||||
@ -64,12 +65,16 @@
|
||||
}
|
||||
|
||||
if ((temp = agent.match(/mobile/i)) != null) {
|
||||
if ((temp = agent.match(/chrome\/?\s*(\d+)/i))) {
|
||||
if ((temp = agent.match(/chrome\/?\s*(\d+)/i)) != null) {
|
||||
match[1] = temp[1];
|
||||
}
|
||||
}
|
||||
|
||||
return { name: match[0], version: match[1] };
|
||||
return {
|
||||
name: match[0],
|
||||
version: match[1],
|
||||
chromeVersion: match[1] || 70,
|
||||
};
|
||||
})();
|
||||
}
|
||||
|
||||
@ -83,7 +88,8 @@
|
||||
return false;
|
||||
|
||||
if (
|
||||
+this.browser.version < this.unsupportedBrowsers[this.browser.name]
|
||||
+this.browser.version < this.unsupportedBrowsers[this.browser.name] &&
|
||||
+this.browser.chromeVersion < this.unsupportedBrowsers.Chrome
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user