From 64ea57f0eb031c192432609893ede9ee41bb26cd Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Wed, 21 Aug 2024 15:50:02 +0400 Subject: [PATCH] Shared: restored Table.constants.ts --- .../client/src/store/AccountsHotkeysStore.ts | 2 +- packages/client/src/store/HotkeyStore.js | 2 +- .../components/table/Table.constants.ts | 30 +++++++++++++++++++ .../shared/components/table/Table.utils.ts | 5 +--- .../shared/components/table/TableHeader.tsx | 8 ++--- packages/shared/utils/device.ts | 1 - 6 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 packages/shared/components/table/Table.constants.ts diff --git a/packages/client/src/store/AccountsHotkeysStore.ts b/packages/client/src/store/AccountsHotkeysStore.ts index 6320e49d08..d8a669658c 100644 --- a/packages/client/src/store/AccountsHotkeysStore.ts +++ b/packages/client/src/store/AccountsHotkeysStore.ts @@ -28,7 +28,7 @@ import { makeAutoObservable } from "mobx"; import { isMobile } from "@docspace/shared/utils"; import { checkDialogsOpen } from "@docspace/shared/utils/checkDialogsOpen"; import { TUser, TUserGroup } from "@docspace/shared/api/people/types"; -import { TABLE_HEADER_HEIGHT } from "@docspace/shared/utils/device"; +import { TABLE_HEADER_HEIGHT } from "@docspace/shared/components/table/Table.constants"; type AccountsType = TUser | TUserGroup; diff --git a/packages/client/src/store/HotkeyStore.js b/packages/client/src/store/HotkeyStore.js index 559ed6d98d..80c747e88b 100644 --- a/packages/client/src/store/HotkeyStore.js +++ b/packages/client/src/store/HotkeyStore.js @@ -37,7 +37,7 @@ import getFilesFromEvent from "@docspace/shared/components/drag-and-drop/get-fil import config from "PACKAGE_FILE"; import { getCategoryUrl } from "SRC_DIR/helpers/utils"; import { encryptionUploadDialog } from "../helpers/encryptionUploadDialog"; -import { TABLE_HEADER_HEIGHT } from "@docspace/shared/utils/device"; +import { TABLE_HEADER_HEIGHT } from "@docspace/shared/components/table/Table.constants"; class HotkeyStore { filesStore; diff --git a/packages/shared/components/table/Table.constants.ts b/packages/shared/components/table/Table.constants.ts new file mode 100644 index 0000000000..e7229cf00f --- /dev/null +++ b/packages/shared/components/table/Table.constants.ts @@ -0,0 +1,30 @@ +// (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 + +export const DEFAULT_MIN_COLUMN_SIZE = 110; +export const SETTINGS_SIZE = 24; +export const MIN_SIZE_FIRST_COLUMN = 210; +export const TABLE_HEADER_HEIGHT = 40; diff --git a/packages/shared/components/table/Table.utils.ts b/packages/shared/components/table/Table.utils.ts index 04957826d9..9c5693d206 100644 --- a/packages/shared/components/table/Table.utils.ts +++ b/packages/shared/components/table/Table.utils.ts @@ -24,10 +24,7 @@ // 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 -export const MIN_SIZE_FIRST_COLUMN = 210; -export const DEFAULT_MIN_COLUMN_SIZE = 110; -export const SETTINGS_SIZE = 24; -export const HANDLE_OFFSET = 8; +import { SETTINGS_SIZE } from "./Table.constants"; export const getSubstring = (str: string) => +str.substring(0, str.length - 2); diff --git a/packages/shared/components/table/TableHeader.tsx b/packages/shared/components/table/TableHeader.tsx index 56f529a56a..dccf21e530 100644 --- a/packages/shared/components/table/TableHeader.tsx +++ b/packages/shared/components/table/TableHeader.tsx @@ -38,14 +38,12 @@ import { import { TTableColumn, TableHeaderProps } from "./Table.types"; import { TableSettings } from "./sub-components/TableSettings"; import { TableHeaderCell } from "./sub-components/TableHeaderCell"; +import { checkingForUnfixedSize, getSubstring } from "./Table.utils"; import { DEFAULT_MIN_COLUMN_SIZE, - MIN_SIZE_FIRST_COLUMN, SETTINGS_SIZE, - HANDLE_OFFSET, - checkingForUnfixedSize, - getSubstring, -} from "./Table.utils"; + MIN_SIZE_FIRST_COLUMN, +} from "./Table.constants"; import { isDesktop } from "../../utils"; class TableHeaderComponent extends React.Component< diff --git a/packages/shared/utils/device.ts b/packages/shared/utils/device.ts index 5ca02c86ce..c1522c1599 100644 --- a/packages/shared/utils/device.ts +++ b/packages/shared/utils/device.ts @@ -25,7 +25,6 @@ // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode export const INFO_PANEL_WIDTH = 400; -export const TABLE_HEADER_HEIGHT = 40; export const MAX_INFINITE_LOADER_SHIFT = 800; export function checkIsSSR() {