Skip to content

Commit

Permalink
fix: updated create issue form status
Browse files Browse the repository at this point in the history
  • Loading branch information
aaryan610 committed Jan 26, 2023
1 parent 34e6a93 commit 67da0c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions apps/app/components/issues/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface IssueFormProps {
createMore: boolean;
setCreateMore: React.Dispatch<React.SetStateAction<boolean>>;
handleClose: () => void;
status: boolean;
}

export const IssueForm: FC<IssueFormProps> = ({
Expand All @@ -67,6 +68,7 @@ export const IssueForm: FC<IssueFormProps> = ({
createMore,
setCreateMore,
handleClose,
status,
}) => {
// states
const [mostSimilarIssue, setMostSimilarIssue] = useState<IIssue | undefined>();
Expand Down Expand Up @@ -151,7 +153,7 @@ export const IssueForm: FC<IssueFormProps> = ({
)}
/>
<h3 className="text-lg font-medium leading-6 text-gray-900">
{initialData ? "Update" : "Create"} Issue
{status ? "Update" : "Create"} Issue
</h3>
</div>
{watch("parent") && watch("parent") !== "" ? (
Expand Down Expand Up @@ -364,7 +366,7 @@ export const IssueForm: FC<IssueFormProps> = ({
Discard
</Button>
<Button type="submit" disabled={isSubmitting}>
{initialData
{status
? isSubmitting
? "Updating Issue..."
: "Update Issue"
Expand Down
1 change: 1 addition & 0 deletions apps/app/components/issues/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = ({
handleClose={handleClose}
projectId={activeProject ?? ""}
setActiveProject={setActiveProject}
status={data ? true : false}
/>
</Dialog.Panel>
</Transition.Child>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,12 @@ const SingleBoard: React.FC<Props> = ({

const addIssueToState = () => {
setIsIssueOpen(true);
if (selectedGroup !== null) {
if (selectedGroup)
setPreloadedData({
state: stateId !== null ? stateId : undefined,
[selectedGroup]: groupTitle,
actionType: "createIssue",
});
}
};

return (
Expand Down

0 comments on commit 67da0c7

Please sign in to comment.