Merge branch 'develop' into feature/user-quota
This commit is contained in:
commit
fd86a6ffa4
@ -90,6 +90,7 @@ const AddUsersPanel = ({
|
||||
isAdmin: item.isAdmin,
|
||||
isVisitor: item.isVisitor,
|
||||
isCollaborator: item.isCollaborator,
|
||||
isRoomAdmin: item.isRoomAdmin,
|
||||
};
|
||||
items.push(newItem);
|
||||
}
|
||||
@ -147,6 +148,7 @@ const AddUsersPanel = ({
|
||||
isAdmin,
|
||||
isVisitor,
|
||||
isCollaborator,
|
||||
isRoomAdmin,
|
||||
} = item;
|
||||
|
||||
const role = getUserRole(item);
|
||||
@ -164,6 +166,7 @@ const AddUsersPanel = ({
|
||||
isAdmin,
|
||||
isVisitor,
|
||||
isCollaborator,
|
||||
isRoomAdmin,
|
||||
};
|
||||
};
|
||||
|
||||
@ -238,7 +241,7 @@ const AddUsersPanel = ({
|
||||
color="#A3A9AE"
|
||||
dir="auto"
|
||||
>
|
||||
{`${capitalize(userType)} | ${email}`}
|
||||
{`${userType} | ${email}`}
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -57,11 +57,23 @@ const Item = ({
|
||||
const defaultAccess = filteredAccesses.find(
|
||||
(option) => option.access === +access,
|
||||
);
|
||||
const getUserType = (item) => {
|
||||
if (item.isOwner) return "owner";
|
||||
if (item.isAdmin) return "admin";
|
||||
if (item.isRoomAdmin) return "manager";
|
||||
if (item.isCollaborator) return "collaborator";
|
||||
return "user";
|
||||
};
|
||||
|
||||
const role = getUserRole(item);
|
||||
const type = getUserType(item);
|
||||
|
||||
const typeLabel = item?.isEmailInvite
|
||||
? getUserTypeLabel(defaultAccess.type, t)
|
||||
: getUserTypeLabel(role, t);
|
||||
: (type === "user" && defaultAccess?.type !== type) ||
|
||||
(defaultAccess?.type === "manager" && type !== "admin")
|
||||
? getUserTypeLabel(defaultAccess.type, t)
|
||||
: getUserTypeLabel(type, t);
|
||||
|
||||
const errorsInList = () => {
|
||||
const hasErrors = inviteItems.some((item) => !!item.errors?.length);
|
||||
|
@ -15,41 +15,49 @@ class MembersHelper {
|
||||
key: "owner",
|
||||
label: this.t("Common:Owner"),
|
||||
access: ShareAccessRights.FullAccess,
|
||||
type: "admin",
|
||||
},
|
||||
roomAdmin: {
|
||||
key: "roomAdmin",
|
||||
label: this.t("Common:RoomAdmin"),
|
||||
access: ShareAccessRights.RoomManager,
|
||||
type: "manager",
|
||||
},
|
||||
collaborator: {
|
||||
key: "collaborator",
|
||||
label: this.t("Common:PowerUser"),
|
||||
access: ShareAccessRights.Collaborator,
|
||||
type: "collaborator",
|
||||
},
|
||||
viewer: {
|
||||
key: "viewer",
|
||||
label: this.t("Translations:RoleViewer"),
|
||||
access: ShareAccessRights.ReadOnly,
|
||||
type: "user",
|
||||
},
|
||||
editor: {
|
||||
key: "editor",
|
||||
label: this.t("Translations:RoleEditor"),
|
||||
access: ShareAccessRights.Editing,
|
||||
type: "user",
|
||||
},
|
||||
formFiller: {
|
||||
key: "formFiller",
|
||||
label: this.t("Translations:RoleFormFiller"),
|
||||
access: ShareAccessRights.FormFilling,
|
||||
type: "user",
|
||||
},
|
||||
reviewer: {
|
||||
key: "reviewer",
|
||||
label: this.t("Translations:RoleReviewer"),
|
||||
access: ShareAccessRights.Review,
|
||||
type: "user",
|
||||
},
|
||||
commentator: {
|
||||
key: "commentator",
|
||||
label: this.t("Translations:RoleCommentator"),
|
||||
access: ShareAccessRights.Comment,
|
||||
type: "user",
|
||||
},
|
||||
};
|
||||
};
|
||||
@ -135,7 +143,7 @@ class MembersHelper {
|
||||
|
||||
const options = this.getOptions();
|
||||
const [userOption] = Object.values(options).filter(
|
||||
(opt) => opt.access === access
|
||||
(opt) => opt.access === access,
|
||||
);
|
||||
|
||||
return userOption;
|
||||
|
@ -182,8 +182,22 @@ const User = ({
|
||||
const onToggle = (e, isOpen) => {
|
||||
// setIsScrollLocked(isOpen);
|
||||
};
|
||||
const role = getUserRole(user);
|
||||
const typeLabel = getUserTypeLabel(role, t);
|
||||
const getUserType = (item) => {
|
||||
if (item.isOwner) return "owner";
|
||||
if (item.isAdmin) return "admin";
|
||||
if (item.isRoomAdmin) return "manager";
|
||||
if (item.isCollaborator) return "collaborator";
|
||||
return "user";
|
||||
};
|
||||
|
||||
const type = getUserType(user);
|
||||
const role = getUserRole(user, userRole?.type);
|
||||
|
||||
const typeLabel =
|
||||
(type === "user" && userRole?.type !== type) ||
|
||||
(userRole?.type === "manager" && type !== "admin")
|
||||
? getUserTypeLabel(userRole?.type, t)
|
||||
: getUserTypeLabel(type, t);
|
||||
|
||||
const getTooltipContent = () => (
|
||||
<div>
|
||||
|
@ -270,20 +270,6 @@ const StyledTableRow = styled(TableRow)`
|
||||
}
|
||||
}
|
||||
|
||||
.table-container_cell:not(
|
||||
.table-container_element-wrapper,
|
||||
.table-container_file-name-cell
|
||||
) {
|
||||
${(props) =>
|
||||
props.theme.interfaceDirection === "rtl"
|
||||
? css`
|
||||
padding-left: ${(props) => props.hideColumns && `0px`};
|
||||
`
|
||||
: css`
|
||||
padding-right: ${(props) => props.hideColumns && `0px`};
|
||||
`}
|
||||
}
|
||||
|
||||
.table-container_file-name-cell {
|
||||
${(props) =>
|
||||
props.theme.interfaceDirection === "rtl"
|
||||
|
@ -531,8 +531,8 @@ class Tile extends React.PureComponent {
|
||||
const icon = item.isPlugin
|
||||
? item.fileTileIcon
|
||||
: thumbnail && !this.state.errorLoadSrc
|
||||
? thumbnail
|
||||
: temporaryIcon;
|
||||
? thumbnail
|
||||
: temporaryIcon;
|
||||
|
||||
return (
|
||||
<Link type="page" onClick={thumbnailClick}>
|
||||
@ -552,7 +552,7 @@ class Tile extends React.PureComponent {
|
||||
|
||||
changeCheckbox = (e) => {
|
||||
const { onSelect, item } = this.props;
|
||||
onSelect && onSelect(!e.target.checked, item);
|
||||
onSelect && onSelect(e.target.checked, item);
|
||||
};
|
||||
|
||||
onFileIconClick = () => {
|
||||
@ -637,12 +637,12 @@ class Tile extends React.PureComponent {
|
||||
|
||||
const renderElement = Object.prototype.hasOwnProperty.call(
|
||||
this.props,
|
||||
"element"
|
||||
"element",
|
||||
);
|
||||
|
||||
const renderContentElement = Object.prototype.hasOwnProperty.call(
|
||||
this.props,
|
||||
"contentElement"
|
||||
"contentElement",
|
||||
);
|
||||
|
||||
const renderContext =
|
||||
|
@ -19,6 +19,7 @@ import MoreLoginModal from "@docspace/shared/components/more-login-modal";
|
||||
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
|
||||
import Register from "./sub-components/register-container";
|
||||
import { ColorTheme, ThemeId } from "@docspace/shared/components/color-theme";
|
||||
import SSOIcon from "PUBLIC_DIR/images/sso.react.svg";
|
||||
import { Dark, Base } from "@docspace/shared/themes";
|
||||
import { useMounted } from "../helpers/useMounted";
|
||||
import { getBgPattern, frameCallCommand } from "@docspace/shared/utils/common";
|
||||
|
@ -32,6 +32,8 @@ ArticleMainButton.displayName = MAIN_BUTTON_NAME;
|
||||
const ArticleBody = ({ children }: { children: React.ReactNode }) => null;
|
||||
ArticleBody.displayName = BODY_NAME;
|
||||
|
||||
console.log(ArticleAlerts, ArticleLiveChat);
|
||||
|
||||
const Article = ({
|
||||
showText,
|
||||
setShowText,
|
||||
@ -273,7 +275,7 @@ const Article = ({
|
||||
{articleBodyContent ? articleBodyContent.props.children : null}
|
||||
{!showArticleLoader && (
|
||||
<>
|
||||
{!hideAlerts && (
|
||||
{/* {!hideAlerts && (
|
||||
<ArticleAlerts
|
||||
articleAlertsData={articleAlertsData}
|
||||
showText={showText}
|
||||
@ -292,7 +294,7 @@ const Article = ({
|
||||
setSubmitToGalleryDialogVisible
|
||||
}
|
||||
/>
|
||||
)}
|
||||
)} */}
|
||||
{withDevTools && (
|
||||
<ArticleDevToolsBar
|
||||
articleOpen={articleOpen}
|
||||
@ -304,7 +306,7 @@ const Article = ({
|
||||
{!hideAppsBlock && (
|
||||
<ArticleApps withDevTools={withDevTools} showText={showText} />
|
||||
)}
|
||||
{!isMobile && isLiveChatAvailable && (
|
||||
{/* {!isMobile && !isLiveChatAvailable && (
|
||||
<ArticleLiveChat
|
||||
currentColorScheme={currentColorScheme}
|
||||
withMainButton={
|
||||
@ -317,7 +319,7 @@ const Article = ({
|
||||
zendeskKey={zendeskKey}
|
||||
showProgress={showProgress}
|
||||
/>
|
||||
)}
|
||||
)} */}
|
||||
</>
|
||||
)}
|
||||
</SubArticleBody>
|
||||
|
@ -13,18 +13,6 @@ const getDefaultStyles = ({
|
||||
}) =>
|
||||
$currentColorScheme &&
|
||||
css`
|
||||
.version-mark-icon {
|
||||
path {
|
||||
fill: ${!$isVersion
|
||||
? theme.filesVersionHistory.badge.defaultFill
|
||||
: theme.filesVersionHistory.badge.fill};
|
||||
|
||||
stroke: ${!$isVersion
|
||||
? theme.filesVersionHistory.badge.stroke
|
||||
: theme.filesVersionHistory.badge.fill};
|
||||
}
|
||||
}
|
||||
|
||||
.version_badge-text {
|
||||
color: ${$isVersion && $currentColorScheme.text?.accent};
|
||||
}
|
||||
|
@ -217,6 +217,7 @@ export const getUserRole = (user: TUser) => {
|
||||
//TODO: Need refactoring
|
||||
if (user.isVisitor) return "user";
|
||||
if (user.isCollaborator) return "collaborator";
|
||||
if (user.isRoomAdmin) return "manager";
|
||||
|
||||
return "user";
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user