feat: redirecting to same protected route after signin, fix: id showing up in kanban view
This commit is contained in:
parent
27d9b349cf
commit
0d35845995
12 changed files with 69 additions and 29 deletions
|
|
@ -51,7 +51,13 @@ const SendProjectInvitationModal: React.FC<Props> = ({ isOpen, setIsOpen, member
|
|||
|
||||
const { data: people } = useSWR<WorkspaceMember[]>(
|
||||
activeWorkspace ? WORKSPACE_MEMBERS(activeWorkspace.slug) : null,
|
||||
activeWorkspace ? () => workspaceService.workspaceMembers(activeWorkspace.slug) : null
|
||||
activeWorkspace ? () => workspaceService.workspaceMembers(activeWorkspace.slug) : null,
|
||||
{
|
||||
onErrorRetry(err, _, __, revalidate, revalidateOpts) {
|
||||
if (err?.status === 403) return;
|
||||
setTimeout(() => revalidate(revalidateOpts), 5000);
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const {
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ type Props = {
|
|||
>
|
||||
>;
|
||||
bgColor?: string;
|
||||
stateId?: string;
|
||||
createdBy?: string;
|
||||
stateId: string | null;
|
||||
createdBy: string | null;
|
||||
};
|
||||
|
||||
const SingleBoard: React.FC<Props> = ({
|
||||
|
|
@ -109,7 +109,7 @@ const SingleBoard: React.FC<Props> = ({
|
|||
<span
|
||||
className={`w-3 h-3 block rounded-full ${!show ? "" : "mr-1"}`}
|
||||
style={{
|
||||
backgroundColor: bgColor,
|
||||
backgroundColor: Boolean(bgColor) ? bgColor : undefined,
|
||||
}}
|
||||
/>
|
||||
<h2
|
||||
|
|
@ -151,7 +151,7 @@ const SingleBoard: React.FC<Props> = ({
|
|||
setIsIssueOpen(true);
|
||||
if (selectedGroup !== null)
|
||||
setPreloadedData({
|
||||
state: stateId,
|
||||
state: stateId !== null ? stateId : undefined,
|
||||
[selectedGroup]: groupTitle,
|
||||
actionType: "createIssue",
|
||||
});
|
||||
|
|
@ -201,10 +201,12 @@ const SingleBoard: React.FC<Props> = ({
|
|||
? "text-xs text-black"
|
||||
: key === "priority"
|
||||
? `text-xs bg-gray-200 px-2 py-1 mt-2 flex items-center gap-x-1 rounded w-min whitespace-nowrap capitalize font-medium ${
|
||||
childIssue.priority === "high"
|
||||
childIssue.priority === "urgent"
|
||||
? "bg-red-100 text-red-600"
|
||||
: childIssue.priority === "high"
|
||||
? "bg-orange-100 text-orange-600"
|
||||
: childIssue.priority === "medium"
|
||||
? "bg-orange-100 text-orange-500"
|
||||
? "bg-yellow-100 text-yellow-500"
|
||||
: childIssue.priority === "low"
|
||||
? "bg-green-100 text-green-500"
|
||||
: "hidden"
|
||||
|
|
@ -224,7 +226,7 @@ const SingleBoard: React.FC<Props> = ({
|
|||
: "None"}
|
||||
</span>
|
||||
)}
|
||||
{key === "target_date" && (
|
||||
{key === "due_date" && (
|
||||
<>
|
||||
<span
|
||||
className={`flex items-center gap-x-1 group ${
|
||||
|
|
@ -320,7 +322,7 @@ const SingleBoard: React.FC<Props> = ({
|
|||
setIsIssueOpen(true);
|
||||
if (selectedGroup !== null) {
|
||||
setPreloadedData({
|
||||
state: stateId,
|
||||
state: stateId !== null ? stateId : undefined,
|
||||
[selectedGroup]: groupTitle,
|
||||
actionType: "createIssue",
|
||||
});
|
||||
|
|
|
|||
|
|
@ -197,9 +197,10 @@ const BoardView: React.FC<Props> = ({ properties, selectedGroup, groupedByIssues
|
|||
selectedGroup={selectedGroup}
|
||||
groupTitle={singleGroup}
|
||||
createdBy={
|
||||
members
|
||||
? members?.find((m) => m.member.id === singleGroup)?.member.first_name
|
||||
: undefined
|
||||
selectedGroup === "created_by"
|
||||
? members?.find((m) => m.member.id === singleGroup)?.member
|
||||
.first_name ?? "loading..."
|
||||
: null
|
||||
}
|
||||
groupedByIssues={groupedByIssues}
|
||||
index={index}
|
||||
|
|
@ -208,8 +209,8 @@ const BoardView: React.FC<Props> = ({ properties, selectedGroup, groupedByIssues
|
|||
setPreloadedData={setPreloadedData}
|
||||
stateId={
|
||||
selectedGroup === "state_detail.name"
|
||||
? states?.find((s) => s.name === singleGroup)?.id
|
||||
: undefined
|
||||
? states?.find((s) => s.name === singleGroup)?.id ?? null
|
||||
: null
|
||||
}
|
||||
bgColor={
|
||||
selectedGroup === "state_detail.name"
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ const ListView: React.FC<Props> = ({
|
|||
)}
|
||||
</Listbox>
|
||||
</td>
|
||||
) : (key as keyof Properties) === "target_date" ? (
|
||||
) : (key as keyof Properties) === "due_date" ? (
|
||||
<td className="px-3 py-4 text-sm font-medium text-gray-900 whitespace-nowrap">
|
||||
{issue.target_date
|
||||
? renderShortNumericDateFormat(issue.target_date)
|
||||
|
|
@ -440,4 +440,4 @@ const ListView: React.FC<Props> = ({
|
|||
);
|
||||
};
|
||||
|
||||
export default ListView;
|
||||
export default ListView;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue