mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: show workspace members (#852)
This commit is contained in:
parent
f5351e4419
commit
dc53708109
@ -1,7 +1,5 @@
|
||||
import { FC } from "react";
|
||||
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
// react-hook-form
|
||||
import { UseFormWatch } from "react-hook-form";
|
||||
// ui
|
||||
@ -22,8 +20,6 @@ type Props = {
|
||||
};
|
||||
|
||||
export const GithubImportUsers: FC<Props> = ({ handleStepChange, users, setUsers, watch }) => {
|
||||
const router = useRouter();
|
||||
|
||||
const isInvalid = users.filter((u) => u.import !== false && u.email === "").length > 0;
|
||||
|
||||
return (
|
||||
@ -44,7 +40,6 @@ export const GithubImportUsers: FC<Props> = ({ handleStepChange, users, setUsers
|
||||
index={index}
|
||||
users={users}
|
||||
setUsers={setUsers}
|
||||
project={watch("project")}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
@ -4,21 +4,20 @@ import { useRouter } from "next/router";
|
||||
import useSWR from "swr";
|
||||
|
||||
// services
|
||||
import projectService from "services/project.service";
|
||||
import workspaceService from "services/workspace.service";
|
||||
// ui
|
||||
import { Avatar, CustomSearchSelect, CustomSelect, Input } from "components/ui";
|
||||
// types
|
||||
import { IGithubRepoCollaborator } from "types";
|
||||
import { IUserDetails } from "./root";
|
||||
// fetch-keys
|
||||
import { PROJECT_MEMBERS } from "constants/fetch-keys";
|
||||
import { WORKSPACE_MEMBERS } from "constants/fetch-keys";
|
||||
|
||||
type Props = {
|
||||
collaborator: IGithubRepoCollaborator;
|
||||
index: number;
|
||||
users: IUserDetails[];
|
||||
setUsers: React.Dispatch<React.SetStateAction<IUserDetails[]>>;
|
||||
project: string | null;
|
||||
};
|
||||
|
||||
const importOptions = [
|
||||
@ -36,21 +35,13 @@ const importOptions = [
|
||||
},
|
||||
];
|
||||
|
||||
export const SingleUserSelect: React.FC<Props> = ({
|
||||
collaborator,
|
||||
index,
|
||||
users,
|
||||
setUsers,
|
||||
project,
|
||||
}) => {
|
||||
export const SingleUserSelect: React.FC<Props> = ({ collaborator, index, users, setUsers }) => {
|
||||
const router = useRouter();
|
||||
const { workspaceSlug } = router.query;
|
||||
|
||||
const { data: members } = useSWR(
|
||||
workspaceSlug && project ? PROJECT_MEMBERS(project) : null,
|
||||
workspaceSlug && project
|
||||
? () => projectService.projectMembers(workspaceSlug as string, project)
|
||||
: null
|
||||
workspaceSlug ? WORKSPACE_MEMBERS(workspaceSlug.toString()) : null,
|
||||
workspaceSlug ? () => workspaceService.workspaceMembers(workspaceSlug.toString()) : null
|
||||
);
|
||||
|
||||
const options =
|
||||
|
Loading…
Reference in New Issue
Block a user