From feeabe585dc4cb74e52970798e8833414613bafe Mon Sep 17 00:00:00 2001 From: afnan Date: Thu, 11 Jan 2024 17:09:41 +0500 Subject: [PATCH 1/4] Step 3: Set up PostgreSQL Database --- .../twenty-docs/docs/contributor/local-setup/yarn-setup.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/twenty-docs/docs/contributor/local-setup/yarn-setup.mdx b/packages/twenty-docs/docs/contributor/local-setup/yarn-setup.mdx index 0a0c0fd3c12b..46d86e00cf70 100644 --- a/packages/twenty-docs/docs/contributor/local-setup/yarn-setup.mdx +++ b/packages/twenty-docs/docs/contributor/local-setup/yarn-setup.mdx @@ -109,8 +109,7 @@ All commands in the following steps should be run from the root of the project. ## Step 3: Set up PostgreSQL Database -You need to have a PostgreSQL instance available to be able to use Twenty. -You need to provision this database with a `twenty` user (password: `twenty`), a `default` database and a `test` database. +To install PostgreSQL with a `default` and a `test` database, and provision these databases with a user `twenty` (password: `twenty`), follow the steps below: From c966fbb7f78bff840ee1ddfa0bf8d5f1bf1e2a10 Mon Sep 17 00:00:00 2001 From: afnan Date: Thu, 18 Jan 2024 12:24:21 +0500 Subject: [PATCH 2/4] Tooltip on Icons --- packages/twenty-front/package.json | 2 +- .../components/RecordInlineCellContainer.tsx | 58 +++++++++++++++---- packages/twenty-server/package.json | 2 +- 3 files changed, 48 insertions(+), 14 deletions(-) diff --git a/packages/twenty-front/package.json b/packages/twenty-front/package.json index d349c65f2cf5..690c20e80066 100644 --- a/packages/twenty-front/package.json +++ b/packages/twenty-front/package.json @@ -60,4 +60,4 @@ "msw": { "workerDirectory": "public" } -} \ No newline at end of file +} diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx index 79efa52e1aa3..05ef5ff4730a 100644 --- a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx +++ b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx @@ -1,4 +1,5 @@ import { useState } from 'react'; +import { Tooltip } from 'react-tooltip'; import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { motion } from 'framer-motion'; @@ -69,6 +70,17 @@ const StyledInlineCellBaseContainer = styled.div` user-select: none; `; +const StyledTooltip = styled(Tooltip)` + background-color: ${({ theme }) => theme.background.primary}; + box-shadow: ${({ theme }) => theme.boxShadow.light}; + + color: ${({ theme }) => theme.font.color.primary}; + + font-size: ${({ theme }) => theme.font.size.sm}; + font-weight: ${({ theme }) => theme.font.weight.regular}; + padding: ${({ theme }) => theme.spacing(2)}; +`; + type RecordInlineCellContainerProps = { IconLabel?: IconComponent; label?: string; @@ -116,6 +128,18 @@ export const RecordInlineCellContainer = ({ } }; + const removeWordIcon = ( + inputString: string | undefined, + ): string | undefined => { + if (inputString === undefined) { + return ''; + } + + const wordToRemove = 'Icon'; + const regex = new RegExp(`\\b${wordToRemove}\\b`, 'g'); + return inputString.replace(regex, ''); + }; + const showEditButton = buttonIcon && !isInlineCellInEditMode && isHovered && !editModeContentOnly; @@ -127,18 +151,28 @@ export const RecordInlineCellContainer = ({ onMouseLeave={handleContainerMouseLeave} > {(!!IconLabel || !!label) && ( - - {IconLabel && ( - - - - )} - {showLabel && label && ( - - {label} - - )} - + <> + + {IconLabel && ( + + + + )} + {showLabel && label && ( + + {label} + + )} + + + )} {isInlineCellInEditMode ? ( diff --git a/packages/twenty-server/package.json b/packages/twenty-server/package.json index 47577be4c161..40fa1767b21a 100644 --- a/packages/twenty-server/package.json +++ b/packages/twenty-server/package.json @@ -44,4 +44,4 @@ "npm": "please-use-yarn", "yarn": "^4.0.2" } -} \ No newline at end of file +} From 5e3779118d73da95a5bbbb05f88780bd89a6c1f8 Mon Sep 17 00:00:00 2001 From: afnan Date: Thu, 18 Jan 2024 16:09:55 +0500 Subject: [PATCH 3/4] Cleaning icon tooltip code --- .../components/RecordInlineCellContainer.tsx | 42 +++++++------------ 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx index 05ef5ff4730a..d5bd92e8eea6 100644 --- a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx +++ b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx @@ -128,18 +128,6 @@ export const RecordInlineCellContainer = ({ } }; - const removeWordIcon = ( - inputString: string | undefined, - ): string | undefined => { - if (inputString === undefined) { - return ''; - } - - const wordToRemove = 'Icon'; - const regex = new RegExp(`\\b${wordToRemove}\\b`, 'g'); - return inputString.replace(regex, ''); - }; - const showEditButton = buttonIcon && !isInlineCellInEditMode && isHovered && !editModeContentOnly; @@ -151,28 +139,26 @@ export const RecordInlineCellContainer = ({ onMouseLeave={handleContainerMouseLeave} > {(!!IconLabel || !!label) && ( - <> - - {IconLabel && ( - - - - )} - {showLabel && label && ( - - {label} - - )} - + + {IconLabel && ( + + + + )} + {showLabel && label && ( + + {label} + + )} - + )} {isInlineCellInEditMode ? ( From 195dce7edd77017cfb360ce9a001790fdecc5fbb Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Tue, 23 Jan 2024 19:39:22 +0100 Subject: [PATCH 4/4] Fix according to review --- .../components/RecordInlineCellContainer.tsx | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx index d5bd92e8eea6..31dfee67afcb 100644 --- a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx +++ b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx @@ -3,6 +3,7 @@ import { Tooltip } from 'react-tooltip'; import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { motion } from 'framer-motion'; +import kebabCase from 'lodash.kebabcase'; import { IconComponent } from '@/ui/display/icon/types/IconComponent'; import { EllipsisDisplay } from '@/ui/field/display/components/EllipsisDisplay'; @@ -139,7 +140,7 @@ export const RecordInlineCellContainer = ({ onMouseLeave={handleContainerMouseLeave} > {(!!IconLabel || !!label) && ( - + {IconLabel && ( @@ -150,14 +151,16 @@ export const RecordInlineCellContainer = ({ {label} )} - + {!showLabel && ( + + )} )}