Duplicate function removed.

This commit is contained in:
Tatiana Lopaeva 2024-07-10 14:50:55 +03:00
parent b92b737b7f
commit bb1092a5ec
9 changed files with 16 additions and 39 deletions

View File

@ -47,7 +47,7 @@ import { Text } from "@docspace/shared/components/text";
import ChangeRoomOwner from "./ChangeRoomOwner";
import RoomQuota from "./RoomQuota";
import { RoomsType } from "@docspace/shared/enums";
import { getRoomTypeTranslation } from "@docspace/shared/utils/common";
import { getRoomTypeName } from "SRC_DIR/helpers/filesUtils";
const StyledSetRoomParams = styled.div`
display: flex;
@ -258,7 +258,7 @@ const SetRoomParams = ({
previewIcon={previewIcon}
tags={roomParams.tags.map((tag) => tag.name)}
isDisabled={isDisabled}
defaultTagLabel={getRoomTypeTranslation(roomParams.type, t)}
defaultTagLabel={getRoomTypeName(roomParams.type, t)}
/>
}
/>

View File

@ -67,7 +67,7 @@ export const getFileTypeName = (fileType) => {
}
};
export const getDefaultRoomName = (room, t) => {
export const getRoomTypeName = (room, t) => {
switch (room) {
case RoomsType.CustomRoom:
return t("Common:CustomRooms");

View File

@ -37,8 +37,8 @@ import { decode } from "he";
import {
connectedCloudsTypeTitleTranslation as getProviderTranslation,
getDefaultRoomName,
getFileTypeName,
getRoomTypeName,
} from "@docspace/client/src/helpers/filesUtils";
import CommentEditor from "../sub-components/CommentEditor";
@ -299,7 +299,7 @@ class DetailsHelper {
getItemType = () => {
return text(
this.item.isRoom
? getDefaultRoomName(this.item.roomType, this.t)
? getRoomTypeName(this.item.roomType, this.t)
: getFileTypeName(this.item.fileType),
);
};

View File

@ -47,12 +47,10 @@ import { Base } from "@docspace/shared/themes";
import {
connectedCloudsTypeTitleTranslation,
getFileTypeName,
getRoomTypeName,
} from "../../../../../helpers/filesUtils";
import { SortByFieldName } from "SRC_DIR/helpers/constants";
import {
getRoomTypeTranslation,
getSpaceQuotaAsText,
} from "@docspace/shared/utils/common";
import { getSpaceQuotaAsText } from "@docspace/shared/utils/common";
const SimpleFilesRowContent = styled(RowContent)`
.row-main-container-wrapper {
@ -281,7 +279,7 @@ const FilesRowContent = ({
};
const additionalComponent = () => {
if (isRooms) return getRoomTypeTranslation(item.roomType, t);
if (isRooms) return getRoomTypeName(item.roomType, t);
if (!fileExst && !contentLength && !providerKey)
return `${foldersCount} ${t("Translations:Folders")} | ${filesCount} ${t(

View File

@ -94,7 +94,7 @@ const TagsCell = ({
) : (
<Tag
isDefault
label={getRoomTypeTranslation(item.roomType, t)}
label={getRoomTypeName(item.roomType, t)}
onClick={() =>
onSelectOption({
option: "defaultTypeRoom",

View File

@ -27,7 +27,7 @@
import React from "react";
import { StyledTypeCell } from "./CellStyles";
import { FileType } from "@docspace/shared/enums";
import { getDefaultRoomName } from "../../../../../../helpers/filesUtils";
import { getRoomTypeName } from "../../../../../../helpers/filesUtils";
const TypeCell = ({ t, item, sideColor }) => {
const { fileExst, fileTypeName, fileType, roomType } = item;
@ -58,7 +58,7 @@ const TypeCell = ({ t, item, sideColor }) => {
}
};
const type = item.isRoom ? getDefaultRoomName(roomType, t) : getItemType();
const type = item.isRoom ? getRoomTypeName(roomType, t) : getItemType();
const Exst = fileExst ? fileExst.slice(1).toUpperCase() : "";
const data = `${type} ${Exst}`;

View File

@ -39,7 +39,7 @@ import { Loader } from "@docspace/shared/components/loader";
import { Base } from "@docspace/shared/themes";
import { Tags } from "@docspace/shared/components/tags";
import { Tag } from "@docspace/shared/components/tag";
import { getRoomTypeTranslation } from "@docspace/shared/utils/common";
import { getRoomTypeName } from "SRC_DIR/helpers/filesUtils";
const svgLoader = () => <div style={{ width: "96px" }} />;
@ -729,7 +729,7 @@ class Tile extends React.PureComponent {
tags.push({
isDefault: true,
roomType: item.roomType,
label: getRoomTypeTranslation(item.roomType, t),
label: getRoomTypeName(item.roomType, t),
onClick: () =>
selectOption({
option: "defaultTypeRoom",
@ -845,7 +845,7 @@ class Tile extends React.PureComponent {
{/* ) : (
<Tag
isDefault
label={getRoomTypeTranslation(item.roomType, t)}
label={getRoomTypeName(item.roomType, t)}
onClick={() =>
selectOption({
option: "defaultTypeRoom",

View File

@ -60,7 +60,7 @@ import {
ROOMS_PROVIDER_TYPE_NAME,
} from "@docspace/shared/constants";
import { getDefaultRoomName } from "SRC_DIR/helpers/filesUtils";
import { getRoomTypeName } from "SRC_DIR/helpers/filesUtils";
import { SortByFieldName, TableVersions } from "SRC_DIR/helpers/constants";
@ -1027,7 +1027,7 @@ const SectionFilterContent = ({
if (roomsFilter.type) {
const key = +roomsFilter.type;
const label = getDefaultRoomName(key, t);
const label = getRoomTypeName(key, t);
filterValues.push({
key: key,

View File

@ -1154,24 +1154,3 @@ export function setLanguageForUnauthorized(culture: string) {
window.location.reload();
}
export const getRoomTypeTranslation = (roomType: number, t: TTranslation) => {
switch (roomType) {
// case RoomsType.FillingFormsRoom:
// return t("Common:FillingFormRooms");
case RoomsType.EditingRoom:
return t("Common:CollaborationRooms");
// case RoomsType.ReviewRoom:
// return t("Common:Review");
// case RoomsType.ReadOnlyRoom:
// return t("Common:ViewOnlyRooms");
case RoomsType.PublicRoom:
return t("Common:PublicRoom");
case RoomsType.FormRoom:
return t("Common:FormRoom");
default:
return t("Common:CustomRooms");
}
};