Fix review issues: clipboard error handling, merge conflicts, mutation error checks, and category ranking
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -67,12 +67,14 @@ const createMutation = graphql`
|
||||
interface CategoryDialogProps {
|
||||
cookieBannerId: string;
|
||||
connectionId: string;
|
||||
nextRank: number;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
}
|
||||
|
||||
export function CategoryDialog({
|
||||
cookieBannerId,
|
||||
connectionId,
|
||||
nextRank,
|
||||
onOpenChange,
|
||||
}: CategoryDialogProps) {
|
||||
const { __ } = useTranslate();
|
||||
@@ -93,7 +95,7 @@ export function CategoryDialog({
|
||||
name,
|
||||
description,
|
||||
required: false,
|
||||
rank: 0,
|
||||
rank: nextRank,
|
||||
},
|
||||
connections: [connectionId],
|
||||
},
|
||||
|
||||
@@ -195,6 +195,7 @@ export function CategoryList({ cookieBannerKey }: CategoryListProps) {
|
||||
<CategoryDialog
|
||||
cookieBannerId={banner.id}
|
||||
connectionId={connectionId}
|
||||
nextRank={sorted.length > 0 ? sorted[sorted.length - 1].rank + 1 : 0}
|
||||
onOpenChange={setShowCreateDialog}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -123,7 +123,15 @@ export function CategorySection({ categoryKey }: CategorySectionProps) {
|
||||
...input,
|
||||
},
|
||||
},
|
||||
onCompleted() {
|
||||
onCompleted(_response, errors) {
|
||||
if (errors?.length) {
|
||||
toast({
|
||||
title: __("Error"),
|
||||
description: errors[0].message,
|
||||
variant: "error",
|
||||
});
|
||||
return;
|
||||
}
|
||||
toast({
|
||||
title: __("Success"),
|
||||
description: __("Category updated"),
|
||||
@@ -169,6 +177,7 @@ export function CategorySection({ categoryKey }: CategorySectionProps) {
|
||||
|
||||
const handleSaveEditCookie = () => {
|
||||
if (editingCookieIndex === null) return;
|
||||
if (!cookieForm.name.trim()) return;
|
||||
const newCookies = category.cookies.map((c, i) =>
|
||||
i === editingCookieIndex
|
||||
? { ...cookieForm }
|
||||
|
||||
@@ -31,12 +31,22 @@ export function CodeSnippets() {
|
||||
></script>`;
|
||||
|
||||
const handleCopy = () => {
|
||||
void navigator.clipboard.writeText(code);
|
||||
toast({
|
||||
title: __("Copied"),
|
||||
description: __("Code copied to clipboard"),
|
||||
variant: "success",
|
||||
});
|
||||
navigator.clipboard.writeText(code).then(
|
||||
() => {
|
||||
toast({
|
||||
title: __("Copied"),
|
||||
description: __("Code copied to clipboard"),
|
||||
variant: "success",
|
||||
});
|
||||
},
|
||||
() => {
|
||||
toast({
|
||||
title: __("Error"),
|
||||
description: __("Failed to copy to clipboard"),
|
||||
variant: "error",
|
||||
});
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -326,16 +326,10 @@ pages/organizations/vendors/
|
||||
VendorsPageLoader.tsx # lazy entry — providers + Suspense + query loader
|
||||
VendorsPage.tsx # page component (usePreloadedQuery)
|
||||
VendorsPageSkeleton.tsx # loading fallback
|
||||
<<<<<<< HEAD
|
||||
VendorDetailPageLoader.tsx # lazy entry for detail view
|
||||
VendorDetailPage.tsx # detail page component
|
||||
VendorDetailPageSkeleton.tsx # detail loading fallback
|
||||
=======
|
||||
VendorDetailLayoutLoader.tsx # lazy entry for detail layout
|
||||
VendorDetailLayout.tsx # layout — breadcrumbs, tabs, <Outlet />
|
||||
VendorDetailLayoutSkeleton.tsx # detail loading fallback
|
||||
NewVendorPage.tsx # mutation-only page — default export, wraps itself in the Relay provider
|
||||
>>>>>>> 4dcc034f7 (Update contrib guides)
|
||||
_components/ # sub-components used only by vendor pages
|
||||
VendorContactRow.tsx
|
||||
VendorRiskSummary.tsx
|
||||
|
||||
Reference in New Issue
Block a user