Fix bug 63472 - Removed badges "paid" from accounts and invite panel for standalone mode.

This commit is contained in:
Tatiana Lopaeva 2023-08-02 17:08:48 +03:00
parent 3380e0a73c
commit 49c32801d7
5 changed files with 29 additions and 12 deletions

View File

@ -135,7 +135,8 @@ export default function withContent(WrappedContent) {
};
return inject(({ auth, peopleStore }, { item }) => {
const { userStore } = auth;
const { userStore, settingsStore } = auth;
const { theme, standalone } = settingsStore;
const { selectGroup } = peopleStore.selectedGroupStore;
const { getTargetUser } = peopleStore.targetUserStore;
@ -152,8 +153,8 @@ export default function withContent(WrappedContent) {
} = selectionStore;
return {
theme: auth.settingsStore.theme,
theme,
standalone,
currentUserId: userStore.user.id,
selectGroup,
fetchProfile: getTargetUser,

View File

@ -1,10 +1,13 @@
import React, { useEffect, useState } from "react";
import { inject, observer } from "mobx-react";
import AccessRightSelect from "@docspace/components/access-right-select";
import { getAccessOptions } from "../utils";
import { isMobileOnly } from "react-device-detect";
import { StyledAccessSelector } from "../StyledInvitePanel";
import { isSmallTablet } from "@docspace/components/utils/device";
const AccessSelector = ({
t,
roomType,
@ -13,6 +16,7 @@ const AccessSelector = ({
defaultAccess,
isOwner,
withRemove,
standalone,
}) => {
const [horizontalOrientation, setHorizontalOrientation] = useState(false);
const width = containerRef?.current?.offsetWidth - 32;
@ -22,7 +26,8 @@ const AccessSelector = ({
roomType,
withRemove,
true,
isOwner
isOwner,
standalone
);
const selectedOption = accessOptions.filter(
@ -75,4 +80,10 @@ const AccessSelector = ({
);
};
export default AccessSelector;
export default inject(({ auth }) => {
const { standalone } = auth.settingsStore;
return {
standalone,
};
})(observer(AccessSelector));

View File

@ -9,7 +9,8 @@ export const getAccessOptions = (
roomType = RoomsType.CustomRoom,
withRemove = false,
withSeparator = false,
isOwner = false
isOwner = false,
standalone = false
) => {
let options = [];
const accesses = {
@ -17,7 +18,7 @@ export const getAccessOptions = (
key: "docSpaceAdmin",
label: t("Common:DocSpaceAdmin"),
description: t("Translations:RoleDocSpaceAdminDescription"),
quota: t("Common:Paid"),
...(!standalone && { quota: t("Common:Paid") }),
color: "#EDC409",
access:
roomType === -1 ? EmployeeType.Admin : ShareAccessRights.FullAccess,
@ -26,7 +27,7 @@ export const getAccessOptions = (
key: "roomAdmin",
label: t("Common:RoomAdmin"),
description: t("Translations:RoleRoomAdminDescription"),
quota: t("Common:Paid"),
...(!standalone && { quota: t("Common:Paid") }),
color: "#EDC409",
access:
roomType === -1 ? EmployeeType.User : ShareAccessRights.RoomManager,
@ -35,7 +36,7 @@ export const getAccessOptions = (
key: "collaborator",
label: t("Common:PowerUser"),
description: t("Translations:RolePowerUserDescription"),
quota: t("Common:Paid"),
...(!standalone && { quota: t("Common:Paid") }),
color: "#EDC409",
access:
roomType === -1

View File

@ -39,6 +39,7 @@ const UserContent = ({
t,
theme,
standalone,
}) => {
const {
displayName,
@ -67,6 +68,8 @@ const UserContent = ({
? t("Common:User")
: t("Common:RoomAdmin");
const isPaidUser = !standalone && !isVisitor;
return (
<StyledRowContent
sideColor={sideInfoColor}
@ -91,7 +94,7 @@ const UserContent = ({
: email}
</Link>
<Badges statusType={statusType} isPaid={!isVisitor} isSSO={isSSO} />
<Badges statusType={statusType} isPaid={isPaidUser} isSSO={isSSO} />
<Link
containerMinWidth="140px"

View File

@ -132,6 +132,7 @@ const PeopleTableRow = (props) => {
isSeveralSelection,
canChangeUserType,
value,
standalone,
} = props;
const {
@ -319,7 +320,7 @@ const PeopleTableRow = (props) => {
onContentRowClick && onContentRowClick(!isChecked, item);
};
const isPaidUser = !standalone && !isVisitor;
return (
<StyledWrapper
className={`user-item ${
@ -367,7 +368,7 @@ const PeopleTableRow = (props) => {
? displayName
: email}
</Link>
<Badges statusType={statusType} isPaid={!isVisitor} isSSO={isSSO} />
<Badges statusType={statusType} isPaid={isPaidUser} isSSO={isSSO} />
</TableCell>
<TableCell className={"table-cell_type"}>{typeCell}</TableCell>