Skip to content

Commit

Permalink
Navigate to field settings page on Go to Settings (twentyhq#6128)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijreilly authored Jul 8, 2024
1 parent f458322 commit 0ceda01
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadat
import { navigationMemorizedUrlState } from '@/ui/navigation/states/navigationMemorizedUrlState';
import { useViewStates } from '@/views/hooks/internal/useViewStates';
import { FieldMetadataType } from '~/generated-metadata/graphql';
import { isDefined } from '~/utils/isDefined';

export const useGetAvailableFieldsForKanban = () => {
const { viewObjectMetadataIdState } = useViewStates();
Expand All @@ -31,7 +32,13 @@ export const useGetAvailableFieldsForKanban = () => {
const navigateToSelectSettings = useCallback(() => {
setNavigationMemorizedUrl(location.pathname + location.search);

navigate(`/settings/objects/${objectMetadataItem?.namePlural}`);
if (isDefined(objectMetadataItem?.namePlural)) {
navigate(
`/settings/objects/${objectMetadataItem?.namePlural}/new-field/step-2`,
);
} else {
navigate(`/settings/objects`);
}
}, [
navigate,
objectMetadataItem?.namePlural,
Expand Down

0 comments on commit 0ceda01

Please sign in to comment.