Skip to content

Commit

Permalink
5421 box shadow on frozen header and first column (#6130)
Browse files Browse the repository at this point in the history
- Refactored components in table
- Added a isTableRecordScrolledLeftState and
isTableRecordScrolledTopState to subscribe to table scroll
- Added a zIndex logic that subscribes to those new states in new tinier
components

---------

Co-authored-by: Charles Bochet <[email protected]>
  • Loading branch information
lucasbordeau and charlesBochet authored Jul 5, 2024
1 parent cc6ce14 commit 7b3a590
Show file tree
Hide file tree
Showing 68 changed files with 1,530 additions and 1,129 deletions.
29 changes: 1 addition & 28 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
module.exports = {
root: true,
extends: ['plugin:prettier/recommended'],
plugins: [
'@nx',
'prefer-arrow',
'import',
'simple-import-sort',
'unused-imports',
'unicorn',
],
plugins: ['@nx', 'prefer-arrow', 'import', 'unused-imports', 'unicorn'],
rules: {
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
'no-console': ['warn', { allow: ['group', 'groupCollapsed', 'groupEnd'] }],
Expand Down Expand Up @@ -53,26 +46,6 @@ module.exports = {
},
],

'simple-import-sort/imports': [
'error',
{
groups: [
// Packages
['^react', '^@?\\w'],
// Internal modules
['^(@|~|src|@ui)(/.*|$)'],
// Side effect imports
['^\\u0000'],
// Relative imports
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
// CSS imports
['^.+\\.?(css)$'],
],
},
],
'simple-import-sort/exports': 'error',

'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': [
'warn',
Expand Down
9 changes: 6 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.addMissingImports": "always"
"source.addMissingImports": "always",
"source.organizeImports": "always"
}
},
"[javascript]": {
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.addMissingImports": "always"
"source.addMissingImports": "always",
"source.organizeImports": "always"
}
},
"[typescriptreact]": {
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.addMissingImports": "always"
"source.addMissingImports": "always",
"source.organizeImports": "always"
}
},
"[json]": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { FieldContext } from '../contexts/FieldContext';
export const useIsFieldEmpty = () => {
const { entityId, fieldDefinition, overridenIsFieldEmpty } =
useContext(FieldContext);

const fieldValue = useRecordFieldValue(
entityId,
fieldDefinition?.metadata?.fieldName ?? '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModa
import { useCombinedViewSorts } from '@/views/hooks/useCombinedViewSorts';
import { useGetCurrentView } from '@/views/hooks/useGetCurrentView';

export const RemoveSortingModal = ({
export const RecordIndexRemoveSortingModal = ({
recordTableId,
}: {
recordTableId: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord';
import { RecordUpdateHookParams } from '@/object-record/record-field/contexts/FieldContext';
import { RecordIndexRemoveSortingModal } from '@/object-record/record-index/components/RecordIndexRemoveSortingModal';
import { RecordTableActionBar } from '@/object-record/record-table/action-bar/components/RecordTableActionBar';
import { RecordTableWithWrappers } from '@/object-record/record-table/components/RecordTableWithWrappers';
import { RemoveSortingModal } from '@/object-record/record-table/components/RemoveSortingModal';
import { RecordTableContextMenu } from '@/object-record/record-table/context-menu/components/RecordTableContextMenu';

type RecordIndexTableContainerProps = {
Expand Down Expand Up @@ -39,7 +39,7 @@ export const RecordIndexTableContainer = ({
createRecord={createRecord}
/>
<RecordTableActionBar recordTableId={recordTableId} />
<RemoveSortingModal recordTableId={recordTableId} />
<RecordIndexRemoveSortingModal recordTableId={recordTableId} />
<RecordTableContextMenu recordTableId={recordTableId} />
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import styled from '@emotion/styled';
import { IconComponent } from 'twenty-ui';

import { AnimatedContainer } from '@/object-record/record-table/components/AnimatedContainer';
import { FloatingIconButton } from '@/ui/input/button/components/FloatingIconButton';
import { AnimatedContainer } from '@/ui/utilities/animation/components/AnimatedContainer';

const StyledInlineCellButtonContainer = styled.div`
align-items: center;
Expand Down

This file was deleted.

Loading

0 comments on commit 7b3a590

Please sign in to comment.