-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve design of fields menu (#5729)
Improve design of field options menu and redirect to the right object edit page <img width="215" alt="Screenshot 2024-06-04 at 12 15 43" src="https://github.com/twentyhq/twenty/assets/6399865/a8da18a1-49d4-40e3-b2cd-3a1a384366b2">
- Loading branch information
1 parent
d964f65
commit 719cce1
Showing
2 changed files
with
42 additions
and
15 deletions.
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
19 changes: 17 additions & 2 deletions
19
packages/twenty-front/src/modules/settings/utils/getSettingsPagePath.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 |
---|---|---|
@@ -1,4 +1,19 @@ | ||
import { SettingsPath } from '@/types/SettingsPath'; | ||
import { isDefined } from '~/utils/isDefined'; | ||
|
||
export const getSettingsPagePath = <Path extends SettingsPath>(path: Path) => | ||
`/settings/${path}` as const; | ||
type PathParams = { | ||
objectSlug?: string; | ||
}; | ||
|
||
export const getSettingsPagePath = <Path extends SettingsPath>( | ||
path: Path, | ||
params?: PathParams, | ||
) => { | ||
let resultPath = `/settings/${path}`; | ||
|
||
if (isDefined(params?.objectSlug)) { | ||
resultPath = resultPath.replace(':objectSlug', params.objectSlug); | ||
} | ||
|
||
return resultPath; | ||
}; |