From 5eb6f951cbaf09a34cee39a2625b512beac87ca9 Mon Sep 17 00:00:00 2001 From: DmitrySychugov Date: Wed, 17 Apr 2024 20:22:58 +0500 Subject: [PATCH] Client: TableView: added idx column --- .../Section/Body/TableView/TableHeader.js | 21 +++++++++ .../TableView/sub-components/IndexCell.js | 46 +++++++++++++++++++ .../Body/TableView/sub-components/RowData.js | 20 ++++++++ 3 files changed, 87 insertions(+) create mode 100644 packages/client/src/pages/Home/Section/Body/TableView/sub-components/IndexCell.js diff --git a/packages/client/src/pages/Home/Section/Body/TableView/TableHeader.js b/packages/client/src/pages/Home/Section/Body/TableView/TableHeader.js index 2f9120af9b..729abdede8 100644 --- a/packages/client/src/pages/Home/Section/Body/TableView/TableHeader.js +++ b/packages/client/src/pages/Home/Section/Body/TableView/TableHeader.js @@ -26,6 +26,7 @@ import React from "react"; import { TableHeader } from "@docspace/shared/components/table"; +import { RoomsType } from "@docspace/shared/enums"; import { inject, observer } from "mobx-react"; import { withTranslation } from "react-i18next"; import { Events } from "@docspace/shared/enums"; @@ -55,6 +56,8 @@ class FilesTableHeader extends React.Component { isDefaultRoomsQuotaSet, showStorageInfo, isArchiveFolder, + indexing, + roomType, } = this.props; const defaultColumns = []; @@ -287,6 +290,16 @@ class FilesTableHeader extends React.Component { ]; defaultColumns.push(...columns); } else { + const indexBlock = + indexing && roomType === RoomsType.VirtualDataRoom + ? { + key: "Index", + title: t("idx"), + enable: this.props.indexColumnIsEnabled, + minWidth: 50, + } + : {}; + const authorBlock = !isPublicRoom ? { key: "Author", @@ -300,6 +313,7 @@ class FilesTableHeader extends React.Component { : {}; const columns = [ + { ...indexBlock }, { key: "Name", title: t("Common:Name"), @@ -603,6 +617,8 @@ export default inject( const { isDefaultRoomsQuotaSet, showStorageInfo } = currentQuotaStore; + const { indexing, roomType } = selectedFolderStore; + const { isHeaderChecked, @@ -633,6 +649,7 @@ export default inject( roomColumnIsEnabled, erasureColumnIsEnabled, sizeColumnIsEnabled, + indexColumnIsEnabled, sizeTrashColumnIsEnabled, typeColumnIsEnabled, typeTrashColumnIsEnabled, @@ -661,6 +678,9 @@ export default inject( withContent, sortingVisible, + indexing, + roomType, + setIsLoading: clientLoadingStore.setIsSectionBodyLoading, roomsFilter, @@ -684,6 +704,7 @@ export default inject( roomColumnIsEnabled, erasureColumnIsEnabled, sizeColumnIsEnabled, + indexColumnIsEnabled, sizeTrashColumnIsEnabled, typeColumnIsEnabled, typeTrashColumnIsEnabled, diff --git a/packages/client/src/pages/Home/Section/Body/TableView/sub-components/IndexCell.js b/packages/client/src/pages/Home/Section/Body/TableView/sub-components/IndexCell.js new file mode 100644 index 0000000000..dc71262bbe --- /dev/null +++ b/packages/client/src/pages/Home/Section/Body/TableView/sub-components/IndexCell.js @@ -0,0 +1,46 @@ +// (c) Copyright Ascensio System SIA 2009-2024 +// +// This program is a free software product. +// You can redistribute it and/or modify it under the terms +// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software +// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended +// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of +// any third-party rights. +// +// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see +// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html +// +// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021. +// +// The interactive user interfaces in modified source and object code versions of the Program must +// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3. +// +// Pursuant to Section 7(b) of the License you must retain the original Product logo when +// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under +// trademark law for use of our trademarks. +// +// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing +// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 +// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + +import React from "react"; +import { StyledText } from "./CellStyles"; + +const IndexCell = ({ t, item, sideColor }) => { + const { order } = item; + + return ( + + {order} + + ); +}; + +export default IndexCell; diff --git a/packages/client/src/pages/Home/Section/Body/TableView/sub-components/RowData.js b/packages/client/src/pages/Home/Section/Body/TableView/sub-components/RowData.js index 8ccdd392fc..b122010aa4 100644 --- a/packages/client/src/pages/Home/Section/Body/TableView/sub-components/RowData.js +++ b/packages/client/src/pages/Home/Section/Body/TableView/sub-components/RowData.js @@ -32,6 +32,7 @@ import TypeCell from "./TypeCell"; import AuthorCell from "./AuthorCell"; import DateCell from "./DateCell"; import SizeCell from "./SizeCell"; +import IndexCell from "./IndexCell"; import { classNames } from "@docspace/shared/utils"; import { StyledBadgesContainer, @@ -45,6 +46,7 @@ const RowDataComponent = (props) => { modifiedColumnIsEnabled, sizeColumnIsEnabled, typeColumnIsEnabled, + indexColumnIsEnabled, quickButtonsColumnIsEnabled, dragStyles, @@ -62,6 +64,22 @@ const RowDataComponent = (props) => { return ( <> + {indexColumnIsEnabled ? ( + + + + ) : ( +
+ )} + { createdColumnIsEnabled, modifiedColumnIsEnabled, sizeColumnIsEnabled, + indexColumnIsEnabled, typeColumnIsEnabled, quickButtonsColumnIsEnabled, } = tableStore; @@ -206,6 +225,7 @@ export default inject(({ tableStore }) => { createdColumnIsEnabled, modifiedColumnIsEnabled, sizeColumnIsEnabled, + indexColumnIsEnabled, typeColumnIsEnabled, quickButtonsColumnIsEnabled, };