Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implemented the workspace issues table #3340

Merged
merged 21 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f582dee
chore: created the useGetWorkspaceIssues hook
nickytonline May 8, 2024
72f067a
chore: initial workspace issues table
nickytonline May 8, 2024
18d0078
chore: added sub tabs for activity page
nickytonline May 8, 2024
1356b8f
chore: created the IssueStateAuthorIcon component
nickytonline May 8, 2024
d42de41
chore: fixed types
nickytonline May 8, 2024
9c55a9d
chore: fixed path for Storybook story
nickytonline May 8, 2024
282fa82
chore: fix author/issue state icon for smaller screens
nickytonline May 8, 2024
b1666ba
chore: now you can order by heart reactions ASC/DESC
nickytonline May 8, 2024
bf79620
chore: added count to heart reaction column header
nickytonline May 8, 2024
7396a71
chore: added bottom border to top level tabs
nickytonline May 8, 2024
cd1af87
chore: preparing for new sub tab list component
nickytonline May 8, 2024
bfbe5df
chore: updated some copy
nickytonline May 8, 2024
752a6df
chore: reverted change to .env
nickytonline May 8, 2024
b780c5a
chore: added an aria-label to the heart icon
nickytonline May 8, 2024
65db2bf
chore: added heart reaction to smaller screen view
nickytonline May 8, 2024
d0fc92a
wip
nickytonline May 8, 2024
4a676f7
chore: updated header for heart reactions
nickytonline May 9, 2024
cf537e4
chore: added sub tabs (temp ones) to issue page
nickytonline May 9, 2024
7b3b798
chore: added the SubTabsList component
nickytonline May 9, 2024
20c00bf
chore: removed poc component
nickytonline May 9, 2024
9a7a1e2
Merge branch 'beta' into nickytonline/issues-table
nickytonline May 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions components/Issues/IssueStateAuthorIcon.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Meta, StoryObj } from "@storybook/react";
import { IssueStateAuthorIcon } from "../Issues/IssueStateAuthorIcon";

type Story = StoryObj<typeof IssueStateAuthorIcon>;

const meta: Meta<typeof IssueStateAuthorIcon> = {
title: "Components/Issues/IssueStateAuthorIcon",
component: IssueStateAuthorIcon,
args: {
author: "brandonroberts",
},
};

export default meta;

export const OpenPR: Story = {
args: {
state: "open",
},
};

export const ClosedPR: Story = {
args: {
state: "closed",
},
};

export const Reopened: Story = {
args: {
state: "reopened",
},
};
51 changes: 51 additions & 0 deletions components/Issues/IssueStateAuthorIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { IssueClosedIcon, IssueOpenedIcon, IssueReopenedIcon } from "@primer/octicons-react";
import Link from "next/link";
import { Avatar } from "components/atoms/Avatar/avatar-hover-card";

type IssueState = DbRepoIssueEvents["issue_state"];

function getPullRequestStateIcon(state: IssueState) {
const size = 14;

switch (state) {
case "open":
return <IssueOpenedIcon aria-label="open pull request" size={size} className="text-white" />;

case "reopened":
return <IssueReopenedIcon aria-label="open pull request" size={size} className="text-white" />;

case "closed":
return <IssueClosedIcon size={size} aria-label="closed pull request" className="text-white" />;
}
}

export const IssueStateAuthorIcon = ({ state, author }: { state: IssueState; author: string }) => {
let backgroundColor = "";

switch (state) {
case "open":
backgroundColor = "bg-green-600";
break;

case "reopened":
backgroundColor = "bg-green-600";
break;
case "closed":
backgroundColor = "bg-red-600";
break;
}

return (
<div className="relative w-max">
<Link href={`/user/${author}`} title={`User profile for ${author}`}>
<Avatar contributor={author} size="medium" />
</Link>
<div
className={`absolute -bottom-[10px] -right-[12px] p-1 border-[2px] border-white rounded-full [&_svg]:absolute [&_svg]:top-[3.5px] [&_svg]:left-[3.5px] ${backgroundColor}`}
style={{ width: "25px", height: "25px" }}
>
{getPullRequestStateIcon(state)}
</div>
</div>
);
};
2 changes: 1 addition & 1 deletion components/Workspaces/TrackedRepositoryFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function TrackedRepositoryFilter({ options, handleSelect }: Track

return (
<MultiSelect
placeholder="Filter"
placeholder="All Repositories"
nickytonline marked this conversation as resolved.
Show resolved Hide resolved
inputPlaceholder="Search repositories"
className="px-3 text-sm"
options={options}
Expand Down
Loading
Loading