Skip to content

Commit

Permalink
pubiiii
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnnsrs committed Sep 12, 2023
1 parent 450634f commit bf9a469
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/repo/repo-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const RepoProvider: React.FC<{ children: React.ReactNode }> = ({
}
catch (e) {
if (e instanceof ValidationError) {
setErrorRepos(errors => [...errors, {repo: repoResult.name || "unknown", errors: e.inner}]);
setErrorRepos(errors => [...errors, {repo: repoResult.repo || "unknown", errors: e.inner}]);
}
console.error(e);
}
Expand Down
12 changes: 7 additions & 5 deletions src/screens/wizard/fields/ChannelSelectionField.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useField } from "formik";
import { Badge } from "../../../components/ui/badge";
import { Card } from "../../../components/ui/card";
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../../../components/ui/card";
import { Channel, useRepo } from "../../../repo/repo-context";
import { ScrollArea } from "../../../components/ui/scroll-area";

export const ChannelSelectionField = ({ ...props }: any) => {
const [field, meta, helpers] = useField<string | undefined>(props);
Expand Down Expand Up @@ -47,10 +48,11 @@ export const ChannelSelectionField = ({ ...props }: any) => {
);
})}
</div>
<div>
{errors.map((e) => <div>{e.repo}
<div>{e.errors.map((e) => <div>{e.path} {e.message}</div>)}</div></div>)}
</div>
{errors.length > 0 && <div className="grid grid-cols-2 @xl:grid-cols-2 gap-2 mt-2 ">
{errors.map((e) => <Card className="bg-destructive"><CardHeader><CardTitle>Error</CardTitle><CardDescription>The repo {e.repo} is faulty</CardDescription></CardHeader>
<CardContent><ScrollArea>{e.errors.map((e) => <div>{e.path} {e.message}</div>)}</ScrollArea></CardContent>
<CardFooter>Tell these errors to the Repo Owner </CardFooter></Card>)}
</div>}

{meta.touched && meta.error ? (
<div className="error">{meta.error}</div>
Expand Down

0 comments on commit bf9a469

Please sign in to comment.