Client: TableView: added idx column

This commit is contained in:
Dmitry Sychugov 2024-04-17 20:22:58 +05:00
parent 54dc154567
commit 5eb6f951cb
3 changed files with 87 additions and 0 deletions

View File

@ -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,

View File

@ -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 (
<StyledText
color={sideColor}
fontSize="12px"
fontWeight={600}
title={order}
truncate
>
{order}
</StyledText>
);
};
export default IndexCell;

View File

@ -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 ? (
<TableCell
style={
!indexColumnIsEnabled ? { background: "none" } : dragStyles.style
}
{...selectionProp}
>
<IndexCell
sideColor={theme.filesSection.tableView.row.sideColor}
{...props}
/>
</TableCell>
) : (
<div />
)}
<TableCell
{...dragStyles}
className={classNames(
@ -197,6 +215,7 @@ export default inject(({ tableStore }) => {
createdColumnIsEnabled,
modifiedColumnIsEnabled,
sizeColumnIsEnabled,
indexColumnIsEnabled,
typeColumnIsEnabled,
quickButtonsColumnIsEnabled,
} = tableStore;
@ -206,6 +225,7 @@ export default inject(({ tableStore }) => {
createdColumnIsEnabled,
modifiedColumnIsEnabled,
sizeColumnIsEnabled,
indexColumnIsEnabled,
typeColumnIsEnabled,
quickButtonsColumnIsEnabled,
};