fix(ui) - issue form fetch the projects

This commit is contained in:
Shekar Siri 2022-11-25 18:33:33 +01:00
parent 30014d0b6d
commit 3d8ad1a625
3 changed files with 10 additions and 4 deletions

View file

@ -76,8 +76,6 @@ class IssueForm extends React.PureComponent {
const selectedIssueType = issueTypes.filter((issue) => issue.id == instance.issueType)[0];
console.log('instance', instance);
return (
<Loader loading={projectsLoading} size={40}>
<Form onSubmit={this.onSubmit} className="text-left">

View file

@ -70,6 +70,7 @@ class Issues extends React.Component {
<div className="relative h-full w-full p-3">
<div className={stl.buttonWrapper}>
<Popover
onOpen={this.handleOpen}
render={({ close }) => (
<div>
<IssuesModal

View file

@ -1,4 +1,4 @@
import React, { cloneElement, useMemo, useState } from 'react';
import React, { cloneElement, useEffect, useMemo, useState } from 'react';
import {
Placement,
offset,
@ -20,11 +20,18 @@ interface Props {
render: (data: { close: () => void; labelId: string; descriptionId: string }) => React.ReactNode;
placement?: Placement;
children: JSX.Element;
onOpen?: () => void;
}
const Popover = ({ children, render, placement }: Props) => {
const Popover = ({ children, render, placement, onOpen = () => {} }: Props) => {
const [open, setOpen] = useState(false);
useEffect(() => {
if (open) {
onOpen();
}
}, [open]);
const { x, y, reference, floating, strategy, context } = useFloating({
open,
onOpenChange: setOpen,