From be8595eafdfcf6cbfdf01054df0eee09db6f45c5 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Wed, 12 Feb 2025 14:49:34 -0500 Subject: [PATCH] UI tweaks --- src/pages/tools/community-repos/index.js | 315 +++++++++++++---------- 1 file changed, 173 insertions(+), 142 deletions(-) diff --git a/src/pages/tools/community-repos/index.js b/src/pages/tools/community-repos/index.js index 34a5bd9b8510..433f1559cdd6 100644 --- a/src/pages/tools/community-repos/index.js +++ b/src/pages/tools/community-repos/index.js @@ -18,15 +18,16 @@ import { Typography, Alert, Chip, + SvgIcon, } from "@mui/material"; -import { TrashIcon } from "@heroicons/react/24/outline"; +import { MagnifyingGlassIcon, TrashIcon } from "@heroicons/react/24/outline"; import { ApiPostCall } from "/src/api/ApiCall"; import { useForm, FormProvider } from "react-hook-form"; import { Radio, RadioGroup, FormControlLabel } from "@mui/material"; import { CippFormCondition } from "/src/components/CippComponents/CippFormCondition"; import AddIcon from "@mui/icons-material/Add"; import { Box } from "@mui/system"; -import { Add, ForkLeft, OpenInNew } from "@mui/icons-material"; +import { Add, AddBox, ForkLeft, OpenInNew } from "@mui/icons-material"; import { CippApiResults } from "/src/components/CippComponents/CippApiResults"; import CippFormComponent from "../../../components/CippComponents/CippFormComponent"; import { ApiGetCall } from "../../../api/ApiCall"; @@ -176,15 +177,22 @@ const Page = () => { simpleColumns={["Name", "Owner", "URL", "Visibility", "WriteAccess", "UploadBranch"]} cardButton={ <> - } @@ -226,6 +234,10 @@ const Page = () => { valueField: "login", }} multiple={false} + required={true} + validators={{ + required: { value: true, message: "Organization is required" }, + }} /> { name="repoName" label="Repository Name" formControl={createForm} + required={true} /> { setOpenSearch(false)}> Add Community Repositories from GitHub - - - searchForm.setValue("searchType", e.target.value)} + + searchForm.setValue("searchType", e.target.value)} + > + } label="User" /> + } label="Org" /> + } label="Repository" /> + + + - } label="User" /> - } label="Org" /> - } label="Repository" /> - - - setRepo(e.target.value)} + required={true} + /> + + + setUser(e.target.value)} + required={true} + /> + + - setRepo(e.target.value)} - /> - - + + + setOrg(e.target.value)} + required={true} + /> + - setUser(e.target.value)} - /> + freeSolo + fullWidth + options={[]} + label="Search Terms" + /> + + + - - - - setOrg(e.target.value)} - /> - - + {searchMutation.isPending || + (searchMutation.isSuccess && ( + + + Search Results - - - - {searchMutation.isPending || - (searchMutation.isSuccess && Search Results)} - {searchMutation.isPending ? ( - - - - ) : ( - <> - {searchMutation.isSuccess && results.length === 0 && ( + ))} + {searchMutation.isPending ? ( + <> + + + Searching... + + + + + + + + + + + + ) : ( + <> + {(searchMutation.isSuccess && results.length === 0) || + (searchMutation.isError && ( No search results found. Refine your query and try again. - )} - - {results.map((r) => ( - - - - - handleAdd(r.id)}> - - - - - window.open(r.html_url, "_blank")} - > - - - - - - - {r.full_name} - - - - - {r.html_url} + ))} + + {results.map((r) => ( + + + + + handleAdd(r.id)}> + + + + + window.open(r.html_url, "_blank")} + > + + + + + + + {r.full_name} + - - - - ))} - - - )} - - - - + + {r.html_url} + + + + + + ))} + + + )} + + +