-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data settings new layout - anchor navigation #8334
Merged
Merged
Changes from 25 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
6ba2970
Implement object fields and settings new layout
gitstart-twenty 5628299
update `if` block to fix eslint error
gitstart-twenty d7f7232
Merge branch 'main' of github.com:twentyhq/twenty into TWNTY-5491-new…
ijreilly 4d9644a
Fix form saving
ijreilly 3fb0300
Fix renaming applied to other workspaces
ijreilly 3216337
Refactor
ijreilly 0e93fa4
disable toggle for standard object
ijreilly 29e04cd
fix object metadata renaming
Weiko 8d81b38
Merge branch 'main' of github.com:twentyhq/twenty into TWNTY-5491-new…
ijreilly ef14dc0
Fix after merge and add workspaceId as arg
ijreilly 039c4ed
fix missing workspaceId
Weiko a5eb182
some design fixes
ijreilly 3c034a7
fix activeTabId
ijreilly ffc32c1
Merge branch 'main' of github.com:twentyhq/twenty into TWNTY-5491-new…
ijreilly c53cf5b
other design fixes
ijreilly c2f334c
wip - stories fix
ijreilly 60e7d6e
write new storybook test
ijreilly 8bdfd35
Merge branch 'main' of github.com:twentyhq/twenty into TWNTY-5491-new…
ijreilly ec78125
Fix design after merging main
ijreilly ec4095e
Navigation between tabs changes url
ijreilly dd7e2ed
Merge branch 'main' of github.com:twentyhq/twenty into new-layout-anc…
ijreilly a8fd2f0
finish merge
ijreilly aa02a45
Merge branch 'main' of github.com:twentyhq/twenty into new-layout-anc…
ijreilly 35cd287
use Link in Tab to benefit from anchor navigation
ijreilly 10856a1
move shared consts to a file in constants folder
ijreilly 6fc2831
remove console
ijreilly 1d3f119
Merge branch 'main' into new-layout-anchor-navigation
charlesBochet 50d6630
Merge branch 'main' into new-layout-anchor-navigation
charlesBochet 10ca2bf
Fix console.log
charlesBochet 3f3de5b
Fix
charlesBochet 856f85d
Fix
charlesBochet 4bc1233
Fix
charlesBochet e478821
Fix
charlesBochet 3ba8078
Fix
charlesBochet 8738065
Fix
charlesBochet 7f4c4ef
Fix CI
charlesBochet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
.../twenty-front/src/pages/settings/data-model/SettingsObjectDetailsPageTabFromUrlEffect.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { useTabList } from '@/ui/layout/tab/hooks/useTabList'; | ||
import { useEffect } from 'react'; | ||
import { useLocation } from 'react-router-dom'; | ||
import { useRecoilValue } from 'recoil'; | ||
import { OBJECT_DETAIL_TABS } from '~/pages/settings/data-model/constants/SettingsObjectDetailTabs'; | ||
|
||
type TabId = | ||
(typeof OBJECT_DETAIL_TABS.TABS_IDS)[keyof typeof OBJECT_DETAIL_TABS.TABS_IDS]; | ||
|
||
const validHashes = [ | ||
OBJECT_DETAIL_TABS.TABS_IDS.FIELDS, | ||
OBJECT_DETAIL_TABS.TABS_IDS.SETTINGS, | ||
OBJECT_DETAIL_TABS.TABS_IDS.INDEXES, | ||
]; | ||
|
||
export const SettingsObjectDetailsPageTabFromUrlEffect = () => { | ||
const location = useLocation(); | ||
const { activeTabIdState } = useTabList(OBJECT_DETAIL_TABS.TAB_LIST_ID); | ||
const { setActiveTabId } = useTabList(OBJECT_DETAIL_TABS.TAB_LIST_ID); | ||
|
||
const hash = location.hash.replace('#', ''); | ||
const activeTabId = useRecoilValue(activeTabIdState); | ||
useEffect(() => { | ||
console.log( | ||
'hash', | ||
hash, | ||
'activeTabId', | ||
activeTabId, | ||
'isvalid', | ||
validHashes.includes(hash as TabId), | ||
); | ||
if (hash === activeTabId) return; | ||
|
||
if (validHashes.includes(hash as TabId)) { | ||
console.log('setting active tab id', hash); | ||
setActiveTabId(hash as TabId); | ||
} | ||
}, [hash, activeTabId, setActiveTabId]); | ||
|
||
return <></>; | ||
}; |
8 changes: 8 additions & 0 deletions
8
packages/twenty-front/src/pages/settings/data-model/constants/SettingsObjectDetailTabs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const OBJECT_DETAIL_TABS = { | ||
TAB_LIST_ID: 'object-details-tab-list', | ||
TABS_IDS: { | ||
FIELDS: 'fields', | ||
SETTINGS: 'settings', | ||
INDEXES: 'indexes', | ||
}, | ||
} as const; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this changes the behaviour for all tabs but I think we may want that?