From f21cd91446bf74d0c7394c6a31a85f55dbbd72d5 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Wed, 10 Jul 2024 14:31:22 +0300 Subject: [PATCH] Renamed function. --- .../CreateEditRoomDialog/sub-components/SetRoomParams.js | 7 ++----- .../pages/Home/Section/Body/RowsView/FilesRowContent.js | 4 ++-- .../Home/Section/Body/TableView/sub-components/TagsCell.js | 2 +- .../Home/Section/Body/TilesView/sub-components/Tile.js | 6 +++--- packages/shared/utils/common.ts | 5 +---- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/SetRoomParams.js b/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/SetRoomParams.js index cc34d001aa..a1c6ae831c 100644 --- a/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/SetRoomParams.js +++ b/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/SetRoomParams.js @@ -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 { getRoomTypeDefaultTagTranslation } from "@docspace/shared/utils/common"; +import { getRoomTypeTranslation } from "@docspace/shared/utils/common"; const StyledSetRoomParams = styled.div` display: flex; @@ -258,10 +258,7 @@ const SetRoomParams = ({ previewIcon={previewIcon} tags={roomParams.tags.map((tag) => tag.name)} isDisabled={isDisabled} - defaultTagLabel={getRoomTypeDefaultTagTranslation( - roomParams.type, - t, - )} + defaultTagLabel={getRoomTypeTranslation(roomParams.type, t)} /> } /> diff --git a/packages/client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js b/packages/client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js index 824e3e6ffc..b37530c78f 100644 --- a/packages/client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js +++ b/packages/client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js @@ -50,7 +50,7 @@ import { } from "../../../../../helpers/filesUtils"; import { SortByFieldName } from "SRC_DIR/helpers/constants"; import { - getRoomTypeDefaultTagTranslation, + getRoomTypeTranslation, getSpaceQuotaAsText, } from "@docspace/shared/utils/common"; @@ -281,7 +281,7 @@ const FilesRowContent = ({ }; const additionalComponent = () => { - if (isRooms) return getRoomTypeDefaultTagTranslation(item.roomType, t); + if (isRooms) return getRoomTypeTranslation(item.roomType, t); if (!fileExst && !contentLength && !providerKey) return `${foldersCount} ${t("Translations:Folders")} | ${filesCount} ${t( diff --git a/packages/client/src/pages/Home/Section/Body/TableView/sub-components/TagsCell.js b/packages/client/src/pages/Home/Section/Body/TableView/sub-components/TagsCell.js index 79d1fe45d4..b61f0585e0 100644 --- a/packages/client/src/pages/Home/Section/Body/TableView/sub-components/TagsCell.js +++ b/packages/client/src/pages/Home/Section/Body/TableView/sub-components/TagsCell.js @@ -94,7 +94,7 @@ const TagsCell = ({ ) : ( onSelectOption({ option: "defaultTypeRoom", diff --git a/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js b/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js index 6f9fc362ad..a1811ed137 100644 --- a/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js +++ b/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js @@ -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 { getRoomTypeDefaultTagTranslation } from "@docspace/shared/utils/common"; +import { getRoomTypeTranslation } from "@docspace/shared/utils/common"; const svgLoader = () =>
; @@ -729,7 +729,7 @@ class Tile extends React.PureComponent { tags.push({ isDefault: true, roomType: item.roomType, - label: getRoomTypeDefaultTagTranslation(item.roomType, t), + label: getRoomTypeTranslation(item.roomType, t), onClick: () => selectOption({ option: "defaultTypeRoom", @@ -845,7 +845,7 @@ class Tile extends React.PureComponent { {/* ) : ( selectOption({ option: "defaultTypeRoom", diff --git a/packages/shared/utils/common.ts b/packages/shared/utils/common.ts index 960f491e3c..d90e46a282 100644 --- a/packages/shared/utils/common.ts +++ b/packages/shared/utils/common.ts @@ -1155,10 +1155,7 @@ export function setLanguageForUnauthorized(culture: string) { window.location.reload(); } -export const getRoomTypeDefaultTagTranslation = ( - roomType: number, - t: TTranslation, -) => { +export const getRoomTypeTranslation = (roomType: number, t: TTranslation) => { switch (roomType) { // case RoomsType.FillingFormsRoom: // return t("Common:FillingFormRooms");