Fix 2 small bugs following tasks migration (#6483)
This PR fixes two bugs: - A broken link to the task page that had been left on the mobile version - On Kanban cards, the badge for notes/tasks wasn't properly displayed because the title wasn't loaded from the backend
This commit is contained in:
@ -1,21 +1,12 @@
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useRecoilState } from 'recoil';
|
||||
import {
|
||||
IconCheckbox,
|
||||
IconComponent,
|
||||
IconList,
|
||||
IconSearch,
|
||||
IconSettings,
|
||||
} from 'twenty-ui';
|
||||
import { IconComponent, IconList, IconSearch, IconSettings } from 'twenty-ui';
|
||||
|
||||
import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';
|
||||
import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpenedState';
|
||||
import { AppPath } from '@/types/AppPath';
|
||||
import { NavigationBar } from '@/ui/navigation/navigation-bar/components/NavigationBar';
|
||||
import { isNavigationDrawerOpenState } from '@/ui/navigation/states/isNavigationDrawerOpenState';
|
||||
|
||||
import { useIsSettingsPage } from '../hooks/useIsSettingsPage';
|
||||
import { useIsTasksPage } from '../hooks/useIsTasksPage';
|
||||
import { currentMobileNavigationDrawerState } from '../states/currentMobileNavigationDrawerState';
|
||||
|
||||
type NavigationBarItemName = 'main' | 'search' | 'tasks' | 'settings';
|
||||
@ -23,9 +14,7 @@ type NavigationBarItemName = 'main' | 'search' | 'tasks' | 'settings';
|
||||
export const MobileNavigationBar = () => {
|
||||
const [isCommandMenuOpened] = useRecoilState(isCommandMenuOpenedState);
|
||||
const { closeCommandMenu, openCommandMenu } = useCommandMenu();
|
||||
const isTasksPage = useIsTasksPage();
|
||||
const isSettingsPage = useIsSettingsPage();
|
||||
const navigate = useNavigate();
|
||||
const [isNavigationDrawerOpen, setIsNavigationDrawerOpen] = useRecoilState(
|
||||
isNavigationDrawerOpenState,
|
||||
);
|
||||
@ -36,11 +25,9 @@ export const MobileNavigationBar = () => {
|
||||
? currentMobileNavigationDrawer
|
||||
: isCommandMenuOpened
|
||||
? 'search'
|
||||
: isTasksPage
|
||||
? 'tasks'
|
||||
: isSettingsPage
|
||||
? 'settings'
|
||||
: 'main';
|
||||
: isSettingsPage
|
||||
? 'settings'
|
||||
: 'main';
|
||||
|
||||
const items: {
|
||||
name: NavigationBarItemName;
|
||||
@ -68,15 +55,6 @@ export const MobileNavigationBar = () => {
|
||||
setIsNavigationDrawerOpen(false);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'tasks',
|
||||
Icon: IconCheckbox,
|
||||
onClick: () => {
|
||||
closeCommandMenu();
|
||||
setIsNavigationDrawerOpen(false);
|
||||
navigate(AppPath.TasksPage);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'settings',
|
||||
Icon: IconSettings,
|
||||
|
||||
@ -44,6 +44,18 @@ export const useRecordBoardRecordGqlFields = ({
|
||||
),
|
||||
...(hasPositionField(objectMetadataItem) ? { position: true } : undefined),
|
||||
...identifierQueryFields,
|
||||
noteTargets: {
|
||||
note: {
|
||||
id: true,
|
||||
title: true,
|
||||
},
|
||||
},
|
||||
taskTargets: {
|
||||
task: {
|
||||
id: true,
|
||||
title: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
if (isDefined(kanbanFieldMetadataName)) {
|
||||
|
||||
Reference in New Issue
Block a user