fix: alter RLS policies
This commit is contained in:
@@ -6,12 +6,54 @@ import {
|
||||
} from "react-icons/hi2";
|
||||
import { IoFilterOutline } from "react-icons/io5";
|
||||
|
||||
import type { GetBoardByIdOutput } from "@kan/api/types";
|
||||
|
||||
import Button from "~/components/Button";
|
||||
import CheckboxDropdown from "~/components/CheckboxDropdown";
|
||||
import { formatToArray } from "~/utils/helpers";
|
||||
|
||||
interface BoardData {
|
||||
publicId: string;
|
||||
name: string;
|
||||
slug: string;
|
||||
workspace: {
|
||||
publicId: string;
|
||||
members?: {
|
||||
publicId: string;
|
||||
user: {
|
||||
name: string | null;
|
||||
} | null;
|
||||
}[];
|
||||
} | null;
|
||||
labels: {
|
||||
publicId: string;
|
||||
name: string;
|
||||
colourCode: string | null;
|
||||
}[];
|
||||
lists: {
|
||||
publicId: string;
|
||||
name: string;
|
||||
boardId: number;
|
||||
index: number;
|
||||
cards: {
|
||||
publicId: string;
|
||||
title: string;
|
||||
description: string | null;
|
||||
listId: number;
|
||||
index: number;
|
||||
labels: {
|
||||
publicId: string;
|
||||
name: string;
|
||||
colourCode: string | null;
|
||||
}[];
|
||||
members?: {
|
||||
publicId: string;
|
||||
user: {
|
||||
name: string | null;
|
||||
} | null;
|
||||
}[];
|
||||
}[];
|
||||
}[];
|
||||
}
|
||||
|
||||
const LabelIcon = ({ colourCode }: { colourCode: string | null }) => (
|
||||
<svg
|
||||
fill={colourCode ?? "#3730a3"}
|
||||
@@ -39,7 +81,7 @@ const Filters = ({
|
||||
boardData,
|
||||
}: {
|
||||
position?: "left" | "right";
|
||||
boardData: GetBoardByIdOutput;
|
||||
boardData: BoardData | null;
|
||||
}) => {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -58,7 +100,7 @@ const Filters = ({
|
||||
};
|
||||
|
||||
const formattedMembers =
|
||||
boardData?.workspace?.members.map((member) => ({
|
||||
boardData?.workspace?.members?.map((member) => ({
|
||||
key: member.publicId,
|
||||
value: member.user?.name ?? "",
|
||||
selected: !!router.query.members?.includes(member.publicId),
|
||||
@@ -74,12 +116,16 @@ const Filters = ({
|
||||
})) ?? [];
|
||||
|
||||
const groups = [
|
||||
{
|
||||
key: "members",
|
||||
label: "Members",
|
||||
icon: <HiOutlineUserCircle size={16} />,
|
||||
items: formattedMembers,
|
||||
},
|
||||
...(formattedMembers.length
|
||||
? [
|
||||
{
|
||||
key: "members",
|
||||
label: "Members",
|
||||
icon: <HiOutlineUserCircle size={16} />,
|
||||
items: formattedMembers,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
key: "labels",
|
||||
label: "Labels",
|
||||
|
||||
@@ -96,7 +96,7 @@ export function CardModal({
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className="border-t-[1px] border-light-600 pt-12 dark:border-dark-400">
|
||||
<div className="border-t-[1px] border-light-600 pb-4 pt-12 dark:border-dark-400">
|
||||
<h2 className="text-md pb-4 font-medium text-light-900 dark:text-dark-1000">
|
||||
Activity
|
||||
</h2>
|
||||
|
||||
@@ -139,7 +139,7 @@ export default function PublicBoardView() {
|
||||
}}
|
||||
>
|
||||
<div>{card.title}</div>
|
||||
{card.labels.length || card.members.length ? (
|
||||
{card.labels.length ? (
|
||||
<div className="mt-2 flex justify-end space-x-1">
|
||||
{card.labels.map((label) => (
|
||||
<span
|
||||
@@ -157,7 +157,7 @@ export default function PublicBoardView() {
|
||||
<div>{label.name}</div>
|
||||
</span>
|
||||
))}
|
||||
<div className="isolate flex -space-x-1 overflow-hidden">
|
||||
{/* <div className="isolate flex -space-x-1 overflow-hidden">
|
||||
{card.members.map((member) => (
|
||||
<span
|
||||
key={member.publicId}
|
||||
@@ -173,7 +173,7 @@ export default function PublicBoardView() {
|
||||
</span>
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
</div> */}
|
||||
</div>
|
||||
) : null}
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user