mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: project select validation (#2723)
This commit is contained in:
parent
5a84ed279d
commit
621d551c4a
@ -272,9 +272,13 @@ export const IssueForm: FC<IssueFormProps> = observer((props) => {
|
|||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="project"
|
name="project"
|
||||||
render={({ field: { value, onChange } }) => (
|
rules={{
|
||||||
|
required: true,
|
||||||
|
}}
|
||||||
|
render={({ field: { value, onChange }, fieldState: { error } }) => (
|
||||||
<IssueProjectSelect
|
<IssueProjectSelect
|
||||||
value={value}
|
value={value}
|
||||||
|
error={error}
|
||||||
onChange={(val: string) => {
|
onChange={(val: string) => {
|
||||||
onChange(val);
|
onChange(val);
|
||||||
setActiveProject(val);
|
setActiveProject(val);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
|
import type { FieldError } from "react-hook-form";
|
||||||
// mobx store
|
// mobx store
|
||||||
import { useMobxStore } from "lib/mobx/store-provider";
|
import { useMobxStore } from "lib/mobx/store-provider";
|
||||||
// popper js
|
// popper js
|
||||||
@ -15,6 +16,7 @@ import { Check, Clipboard, Search } from "lucide-react";
|
|||||||
export interface IssueProjectSelectProps {
|
export interface IssueProjectSelectProps {
|
||||||
value: string;
|
value: string;
|
||||||
onChange: (value: string) => void;
|
onChange: (value: string) => void;
|
||||||
|
error?: FieldError;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const IssueProjectSelect: React.FC<IssueProjectSelectProps> = observer((props) => {
|
export const IssueProjectSelect: React.FC<IssueProjectSelectProps> = observer((props) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user