Fix hotkey scope in settings (#12387)
Too many conflicts on hotkey scopes (e.g. we still had the issue on the graphql playground). Let's disable all shortcuts in settings.
This commit is contained in:
@ -32,7 +32,6 @@ import { getRecordIndexIdFromObjectNamePluralAndViewId } from '@/object-record/u
|
|||||||
import { AppBasePath } from '@/types/AppBasePath';
|
import { AppBasePath } from '@/types/AppBasePath';
|
||||||
import { AppPath } from '@/types/AppPath';
|
import { AppPath } from '@/types/AppPath';
|
||||||
import { PageHotkeyScope } from '@/types/PageHotkeyScope';
|
import { PageHotkeyScope } from '@/types/PageHotkeyScope';
|
||||||
import { SettingsPath } from '@/types/SettingsPath';
|
|
||||||
import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';
|
import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';
|
||||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||||
import { isDefined } from 'twenty-shared/utils';
|
import { isDefined } from 'twenty-shared/utils';
|
||||||
@ -152,27 +151,12 @@ export const PageChangeEffect = () => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case isMatchingLocation(location, AppPath.RecordShowPage): {
|
case isMatchingLocation(location, AppPath.RecordShowPage): {
|
||||||
setHotkeyScope(PageHotkeyScope.CompanyShowPage, {
|
setHotkeyScope(PageHotkeyScope.RecordShowPage, {
|
||||||
goto: true,
|
goto: true,
|
||||||
keyboardShortcutMenu: true,
|
keyboardShortcutMenu: true,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case isMatchingLocation(location, AppPath.OpportunitiesPage): {
|
|
||||||
setHotkeyScope(PageHotkeyScope.OpportunitiesPage, {
|
|
||||||
goto: true,
|
|
||||||
keyboardShortcutMenu: true,
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case isMatchingLocation(location, AppPath.TasksPage): {
|
|
||||||
setHotkeyScope(PageHotkeyScope.TaskPage, {
|
|
||||||
goto: true,
|
|
||||||
keyboardShortcutMenu: true,
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isMatchingLocation(location, AppPath.SignInUp): {
|
case isMatchingLocation(location, AppPath.SignInUp): {
|
||||||
setHotkeyScope(PageHotkeyScope.SignInUp);
|
setHotkeyScope(PageHotkeyScope.SignInUp);
|
||||||
break;
|
break;
|
||||||
@ -201,47 +185,12 @@ export const PageChangeEffect = () => {
|
|||||||
setHotkeyScope(PageHotkeyScope.PlanRequired);
|
setHotkeyScope(PageHotkeyScope.PlanRequired);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case isMatchingLocation(
|
case location.pathname.startsWith(AppBasePath.Settings): {
|
||||||
location,
|
|
||||||
SettingsPath.ProfilePage,
|
|
||||||
AppBasePath.Settings,
|
|
||||||
): {
|
|
||||||
setHotkeyScope(PageHotkeyScope.ProfilePage, {
|
|
||||||
goto: true,
|
|
||||||
keyboardShortcutMenu: true,
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case isMatchingLocation(
|
|
||||||
location,
|
|
||||||
SettingsPath.Domain,
|
|
||||||
AppBasePath.Settings,
|
|
||||||
): {
|
|
||||||
setHotkeyScope(PageHotkeyScope.Settings, {
|
setHotkeyScope(PageHotkeyScope.Settings, {
|
||||||
goto: false,
|
goto: false,
|
||||||
keyboardShortcutMenu: true,
|
keyboardShortcutMenu: false,
|
||||||
});
|
commandMenu: false,
|
||||||
break;
|
commandMenuOpen: false,
|
||||||
}
|
|
||||||
case isMatchingLocation(
|
|
||||||
location,
|
|
||||||
SettingsPath.RestPlayground,
|
|
||||||
AppBasePath.Settings,
|
|
||||||
): {
|
|
||||||
setHotkeyScope(PageHotkeyScope.Settings, {
|
|
||||||
goto: false,
|
|
||||||
keyboardShortcutMenu: true,
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case isMatchingLocation(
|
|
||||||
location,
|
|
||||||
SettingsPath.WorkspaceMembersPage,
|
|
||||||
AppBasePath.Settings,
|
|
||||||
): {
|
|
||||||
setHotkeyScope(PageHotkeyScope.WorkspaceMemberPage, {
|
|
||||||
goto: true,
|
|
||||||
keyboardShortcutMenu: true,
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,13 +6,5 @@ export enum PageHotkeyScope {
|
|||||||
InviteTeam = 'invite-team',
|
InviteTeam = 'invite-team',
|
||||||
SyncEmail = 'sync-email',
|
SyncEmail = 'sync-email',
|
||||||
PlanRequired = 'plan-required',
|
PlanRequired = 'plan-required',
|
||||||
ShowPage = 'show-page',
|
RecordShowPage = 'record-show-page',
|
||||||
PersonShowPage = 'person-show-page',
|
|
||||||
CompanyShowPage = 'company-show-page',
|
|
||||||
CompaniesPage = 'companies-page',
|
|
||||||
PeoplePage = 'people-page',
|
|
||||||
OpportunitiesPage = 'opportunities-page',
|
|
||||||
ProfilePage = 'profile-page',
|
|
||||||
WorkspaceMemberPage = 'workspace-member-page',
|
|
||||||
TaskPage = 'task-page',
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,8 +45,6 @@ const testCases = [
|
|||||||
{ loc: AppPath.PlanRequiredSuccess, res: true },
|
{ loc: AppPath.PlanRequiredSuccess, res: true },
|
||||||
|
|
||||||
{ loc: AppPath.Index, res: false },
|
{ loc: AppPath.Index, res: false },
|
||||||
{ loc: AppPath.TasksPage, res: false },
|
|
||||||
{ loc: AppPath.OpportunitiesPage, res: false },
|
|
||||||
{ loc: AppPath.RecordIndexPage, res: false },
|
{ loc: AppPath.RecordIndexPage, res: false },
|
||||||
{ loc: AppPath.RecordShowPage, res: false },
|
{ loc: AppPath.RecordShowPage, res: false },
|
||||||
{ loc: AppPath.SettingsCatchAll, res: false },
|
{ loc: AppPath.SettingsCatchAll, res: false },
|
||||||
|
|||||||
Reference in New Issue
Block a user