Fix hotkeys blocking comments (#487)
* Fix hotkeys blocking comments * Fix tests
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
import { useEffect } from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import { useRecoilState } from 'recoil';
|
||||
|
||||
import { captureHotkeyTypeInFocusState } from '@/hotkeys/states/captureHotkeyTypeInFocusState';
|
||||
import { isDefined } from '@/utils/type-guards/isDefined';
|
||||
|
||||
import { Panel } from '../../Panel';
|
||||
@ -16,9 +18,14 @@ const StyledRightDrawer = styled.div`
|
||||
`;
|
||||
|
||||
export function RightDrawer() {
|
||||
const [, setCaptureHotkeyTypeInFocus] = useRecoilState(
|
||||
captureHotkeyTypeInFocusState,
|
||||
);
|
||||
const [isRightDrawerOpen] = useRecoilState(isRightDrawerOpenState);
|
||||
const [rightDrawerPage] = useRecoilState(rightDrawerPageState);
|
||||
|
||||
useEffect(() => {
|
||||
setCaptureHotkeyTypeInFocus(isRightDrawerOpen);
|
||||
}, [isRightDrawerOpen, setCaptureHotkeyTypeInFocus]);
|
||||
if (!isRightDrawerOpen || !isDefined(rightDrawerPage)) {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
|
||||
import { AuthModal } from '@/auth/components/ui/Modal';
|
||||
import { AuthLayout } from '@/ui/layout/AuthLayout';
|
||||
import { graphqlMocks } from '~/testing/graphqlMocks';
|
||||
import { getRenderWrapperForPage } from '~/testing/renderWrappers';
|
||||
|
||||
@ -15,7 +17,14 @@ export default meta;
|
||||
export type Story = StoryObj<typeof Index>;
|
||||
|
||||
export const Default: Story = {
|
||||
render: getRenderWrapperForPage(<Index />, '/auth'),
|
||||
render: getRenderWrapperForPage(
|
||||
<AuthLayout>
|
||||
<AuthModal>
|
||||
<Index />
|
||||
</AuthModal>
|
||||
</AuthLayout>,
|
||||
'/auth',
|
||||
),
|
||||
parameters: {
|
||||
msw: graphqlMocks,
|
||||
},
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
|
||||
import { AuthModal } from '@/auth/components/ui/Modal';
|
||||
import { AuthLayout } from '@/ui/layout/AuthLayout';
|
||||
import { graphqlMocks } from '~/testing/graphqlMocks';
|
||||
import { getRenderWrapperForPage } from '~/testing/renderWrappers';
|
||||
|
||||
@ -15,7 +17,14 @@ export default meta;
|
||||
export type Story = StoryObj<typeof PasswordLogin>;
|
||||
|
||||
export const Default: Story = {
|
||||
render: getRenderWrapperForPage(<PasswordLogin />, '/auth/password-login'),
|
||||
render: getRenderWrapperForPage(
|
||||
<AuthLayout>
|
||||
<AuthModal>
|
||||
<PasswordLogin />
|
||||
</AuthModal>
|
||||
</AuthLayout>,
|
||||
'/auth/password-login',
|
||||
),
|
||||
parameters: {
|
||||
msw: graphqlMocks,
|
||||
},
|
||||
|
||||
@ -20,11 +20,11 @@ export class PersonCreateManyCompanyInput {
|
||||
lastName!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsEmail()
|
||||
@Validator.IsString()
|
||||
email!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsPhoneNumber()
|
||||
@Validator.IsString()
|
||||
phone!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
|
||||
@ -20,11 +20,11 @@ export class PersonCreateManyWorkspaceInput {
|
||||
lastName!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsEmail()
|
||||
@Validator.IsString()
|
||||
email!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsPhoneNumber()
|
||||
@Validator.IsString()
|
||||
phone!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
|
||||
@ -20,11 +20,11 @@ export class PersonCreateManyInput {
|
||||
lastName!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsEmail()
|
||||
@Validator.IsString()
|
||||
email!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsPhoneNumber()
|
||||
@Validator.IsString()
|
||||
phone!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
|
||||
@ -21,11 +21,11 @@ export class PersonCreateWithoutCompanyInput {
|
||||
lastName!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsEmail()
|
||||
@Validator.IsString()
|
||||
email!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsPhoneNumber()
|
||||
@Validator.IsString()
|
||||
phone!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
|
||||
@ -21,11 +21,11 @@ export class PersonCreateWithoutWorkspaceInput {
|
||||
lastName!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsEmail()
|
||||
@Validator.IsString()
|
||||
email!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsPhoneNumber()
|
||||
@Validator.IsString()
|
||||
phone!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
|
||||
@ -22,11 +22,11 @@ export class PersonCreateInput {
|
||||
lastName!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsEmail()
|
||||
@Validator.IsString()
|
||||
email!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsPhoneNumber()
|
||||
@Validator.IsString()
|
||||
phone!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
|
||||
@ -23,11 +23,11 @@ export class PersonGroupBy {
|
||||
lastName!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsEmail()
|
||||
@Validator.IsString()
|
||||
email!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsPhoneNumber()
|
||||
@Validator.IsString()
|
||||
phone!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
|
||||
@ -20,11 +20,11 @@ export class PersonMaxAggregate {
|
||||
lastName?: string;
|
||||
|
||||
@Field(() => String, {nullable:true})
|
||||
@Validator.IsEmail()
|
||||
@Validator.IsString()
|
||||
email?: string;
|
||||
|
||||
@Field(() => String, {nullable:true})
|
||||
@Validator.IsPhoneNumber()
|
||||
@Validator.IsString()
|
||||
phone?: string;
|
||||
|
||||
@Field(() => String, {nullable:true})
|
||||
|
||||
@ -20,11 +20,11 @@ export class PersonMinAggregate {
|
||||
lastName?: string;
|
||||
|
||||
@Field(() => String, {nullable:true})
|
||||
@Validator.IsEmail()
|
||||
@Validator.IsString()
|
||||
email?: string;
|
||||
|
||||
@Field(() => String, {nullable:true})
|
||||
@Validator.IsPhoneNumber()
|
||||
@Validator.IsString()
|
||||
phone?: string;
|
||||
|
||||
@Field(() => String, {nullable:true})
|
||||
|
||||
@ -20,11 +20,11 @@ export class PersonUncheckedCreateWithoutCompanyInput {
|
||||
lastName!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsEmail()
|
||||
@Validator.IsString()
|
||||
email!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsPhoneNumber()
|
||||
@Validator.IsString()
|
||||
phone!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
|
||||
@ -20,11 +20,11 @@ export class PersonUncheckedCreateWithoutWorkspaceInput {
|
||||
lastName!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsEmail()
|
||||
@Validator.IsString()
|
||||
email!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsPhoneNumber()
|
||||
@Validator.IsString()
|
||||
phone!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
|
||||
@ -20,11 +20,11 @@ export class PersonUncheckedCreateInput {
|
||||
lastName!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsEmail()
|
||||
@Validator.IsString()
|
||||
email!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
@Validator.IsPhoneNumber()
|
||||
@Validator.IsString()
|
||||
phone!: string;
|
||||
|
||||
@Field(() => String, {nullable:false})
|
||||
|
||||
@ -275,9 +275,9 @@ model Person {
|
||||
firstName String
|
||||
/// @Validator.IsString()
|
||||
lastName String
|
||||
/// @Validator.IsEmail()
|
||||
/// @Validator.IsString()
|
||||
email String
|
||||
/// @Validator.IsPhoneNumber()
|
||||
/// @Validator.IsString()
|
||||
phone String
|
||||
/// @Validator.IsString()
|
||||
city String
|
||||
|
||||
Reference in New Issue
Block a user