github-issue-tower-defence-management 1.90.0 → 1.91.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +19 -5
- package/bin/adapter/entry-points/cli/index.js +17 -13
- package/bin/adapter/entry-points/cli/index.js.map +1 -1
- package/bin/adapter/entry-points/cli/projectConfig.js +2 -0
- package/bin/adapter/entry-points/cli/projectConfig.js.map +1 -1
- package/bin/adapter/entry-points/console/consoleOperationApi.js +54 -27
- package/bin/adapter/entry-points/console/consoleOperationApi.js.map +1 -1
- package/bin/adapter/entry-points/console/consoleProjectResolver.js +38 -0
- package/bin/adapter/entry-points/console/consoleProjectResolver.js.map +1 -0
- package/bin/adapter/entry-points/console/consoleServer.js +3 -4
- package/bin/adapter/entry-points/console/consoleServer.js.map +1 -1
- package/bin/adapter/entry-points/console/ui-dist/assets/index-BU6p3cGU.css +1 -0
- package/bin/adapter/entry-points/console/ui-dist/assets/index-BvuSQN9s.js +100 -0
- package/bin/adapter/entry-points/console/ui-dist/index.html +2 -2
- package/bin/adapter/entry-points/handlers/consoleListsWriter.js +1 -0
- package/bin/adapter/entry-points/handlers/consoleListsWriter.js.map +1 -1
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js +16 -0
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js.map +1 -1
- package/bin/domain/usecases/console/GenerateConsoleListsUseCase.js +3 -0
- package/bin/domain/usecases/console/GenerateConsoleListsUseCase.js.map +1 -1
- package/jest.config.js +57 -9
- package/package.json +17 -13
- package/src/adapter/entry-points/cli/index.test.ts +18 -3
- package/src/adapter/entry-points/cli/index.ts +32 -14
- package/src/adapter/entry-points/cli/projectConfig.ts +3 -0
- package/src/adapter/entry-points/console/consoleOperationApi.test.ts +129 -15
- package/src/adapter/entry-points/console/consoleOperationApi.ts +83 -28
- package/src/adapter/entry-points/console/consoleProjectResolver.test.ts +96 -0
- package/src/adapter/entry-points/console/consoleProjectResolver.ts +50 -0
- package/src/adapter/entry-points/console/consoleServer.test.ts +5 -4
- package/src/adapter/entry-points/console/consoleServer.ts +5 -7
- package/src/adapter/entry-points/console/ui/jest.setup.ts +1 -0
- package/src/adapter/entry-points/console/ui/jest.styleMock.js +1 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/content/ConsoleMarkdownContent.stories.tsx +27 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/content/ConsoleMarkdownContent.test.tsx +36 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/content/ConsoleMarkdownContent.tsx +50 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/content/ConsoleMermaidDiagram.stories.tsx +22 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/content/ConsoleMermaidDiagram.test.tsx +38 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/content/ConsoleMermaidDiagram.tsx +65 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleChangedFileList.stories.tsx +28 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleChangedFileList.test.tsx +42 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleChangedFileList.tsx +55 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleCommentList.stories.tsx +29 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleCommentList.test.tsx +55 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleCommentList.tsx +66 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleCommitList.stories.tsx +25 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleCommitList.test.tsx +53 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleCommitList.tsx +53 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemDetail.stories.tsx +79 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemDetail.test.tsx +81 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemDetail.tsx +229 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemIcon.stories.tsx +82 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemIcon.test.tsx +52 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemIcon.tsx +32 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsolePullRequestDetail.stories.tsx +31 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsolePullRequestDetail.test.tsx +40 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsolePullRequestDetail.tsx +88 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsolePanel.stories.tsx +26 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsolePanel.test.tsx +32 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsolePanel.tsx +36 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleProjectHeader.stories.tsx → layout/ConsoleProjectSummary.stories.tsx} +5 -5
- package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsoleProjectSummary.test.tsx +14 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleProjectHeader.tsx → layout/ConsoleProjectSummary.tsx} +3 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsoleTabList.stories.tsx +70 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsoleTabList.test.tsx +59 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsoleTabList.tsx +41 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/list/ConsoleItemList.stories.tsx +60 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/list/ConsoleItemList.test.tsx +87 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/list/ConsoleItemList.tsx +68 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/list/ConsoleItemSummary.stories.tsx +25 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/list/ConsoleItemSummary.test.tsx +43 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/list/ConsoleItemSummary.tsx +34 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/list/ConsoleStorySummary.stories.tsx +27 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/list/ConsoleStorySummary.test.tsx +24 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/list/ConsoleStorySummary.tsx +28 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleCloseActions.stories.tsx +14 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleCloseActions.test.tsx +21 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleCloseActions.tsx +26 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleNextActionDateActions.stories.tsx +20 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleNextActionDateActions.test.tsx +42 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleNextActionDateActions.tsx +28 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleOperationMenu.stories.tsx +55 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleOperationMenu.test.tsx +85 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleOperationMenu.tsx +58 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsolePullRequestReviewActions.stories.tsx +14 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsolePullRequestReviewActions.test.tsx +33 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsolePullRequestReviewActions.tsx +34 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleStatusActions.stories.tsx +17 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleStatusActions.test.tsx +49 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleStatusActions.tsx +66 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleStoryActions.stories.tsx +17 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleStoryActions.test.tsx +39 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleStoryActions.tsx +42 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleCaches.test.ts +22 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleCaches.ts +42 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleItemDetailData.test.ts +126 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleItemDetailData.ts +167 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOperations.test.ts +198 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOperations.ts +243 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOverlay.test.ts +40 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOverlay.ts +71 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleResource.test.ts +41 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleResource.ts +57 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleTabData.test.ts +63 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleTabData.ts +129 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleToken.test.ts +41 -0
- package/src/adapter/entry-points/console/ui/src/features/console/lib/consoleApi.test.ts +155 -0
- package/src/adapter/entry-points/console/ui/src/features/console/lib/consoleApi.ts +187 -0
- package/src/adapter/entry-points/console/ui/src/features/console/lib/markdown.test.ts +76 -0
- package/src/adapter/entry-points/console/ui/src/features/console/lib/markdown.ts +73 -0
- package/src/adapter/entry-points/console/ui/src/features/console/lib/mermaidLoader.test.ts +27 -0
- package/src/adapter/entry-points/console/ui/src/features/console/lib/mermaidLoader.ts +71 -0
- package/src/adapter/entry-points/console/ui/src/features/console/lib/resourceCache.test.ts +56 -0
- package/src/adapter/entry-points/console/ui/src/features/console/lib/resourceCache.ts +51 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/colors.test.ts +34 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/colors.ts +73 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/fileStatus.test.ts +35 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/fileStatus.ts +21 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/grouping.test.ts +91 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/grouping.ts +79 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/itemIcons.test.ts +97 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/itemIcons.ts +95 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/operations.test.ts +37 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/operations.ts +35 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/overlay.test.ts +124 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/overlay.ts +101 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/relativeTime.test.ts +52 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/relativeTime.ts +51 -0
- package/src/adapter/entry-points/console/ui/src/features/console/logic/types.ts +141 -0
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.test.tsx +79 -0
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.tsx +109 -0
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsolePage.test.tsx +74 -0
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsolePage.tsx +137 -11
- package/src/adapter/entry-points/console/ui/src/features/console/testing/fixtures.ts +244 -0
- package/src/adapter/entry-points/console/ui/src/index.css +352 -2
- package/src/adapter/entry-points/console/ui/tsconfig.json +1 -0
- package/src/adapter/entry-points/console/ui/vite.config.ts +5 -0
- package/src/adapter/entry-points/console/ui-dist/assets/index-BU6p3cGU.css +1 -0
- package/src/adapter/entry-points/console/ui-dist/assets/index-PtVrAcBb.js +100 -0
- package/src/adapter/entry-points/console/ui-dist/index.html +2 -2
- package/src/adapter/entry-points/handlers/consoleListsWriter.test.ts +27 -2
- package/src/adapter/entry-points/handlers/consoleListsWriter.ts +1 -0
- package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.ts +25 -0
- package/src/domain/usecases/adapter-interfaces/IssueRepository.ts +4 -0
- package/src/domain/usecases/console/GenerateConsoleListsUseCase.test.ts +26 -0
- package/src/domain/usecases/console/GenerateConsoleListsUseCase.ts +17 -1
- package/types/adapter/entry-points/cli/index.d.ts.map +1 -1
- package/types/adapter/entry-points/cli/projectConfig.d.ts +1 -0
- package/types/adapter/entry-points/cli/projectConfig.d.ts.map +1 -1
- package/types/adapter/entry-points/console/consoleOperationApi.d.ts +6 -2
- package/types/adapter/entry-points/console/consoleOperationApi.d.ts.map +1 -1
- package/types/adapter/entry-points/console/consoleProjectResolver.d.ts +6 -0
- package/types/adapter/entry-points/console/consoleProjectResolver.d.ts.map +1 -0
- package/types/adapter/entry-points/console/consoleServer.d.ts +2 -3
- package/types/adapter/entry-points/console/consoleServer.d.ts.map +1 -1
- package/types/adapter/entry-points/handlers/consoleListsWriter.d.ts.map +1 -1
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts +1 -0
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts.map +1 -1
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts +1 -0
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts.map +1 -1
- package/types/domain/usecases/console/GenerateConsoleListsUseCase.d.ts +2 -1
- package/types/domain/usecases/console/GenerateConsoleListsUseCase.d.ts.map +1 -1
- package/bin/adapter/entry-points/console/ui-dist/assets/index-DDjYPXRT.js +0 -49
- package/bin/adapter/entry-points/console/ui-dist/assets/index-DHlBLm7d.css +0 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/ConsoleListView.stories.tsx +0 -44
- package/src/adapter/entry-points/console/ui/src/features/console/components/ConsoleListView.tsx +0 -58
- package/src/adapter/entry-points/console/ui/src/features/console/components/ConsoleTabBar.stories.tsx +0 -34
- package/src/adapter/entry-points/console/ui/src/features/console/components/ConsoleTabBar.tsx +0 -32
- package/src/adapter/entry-points/console/ui/src/features/console/fixtures.ts +0 -47
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleList.ts +0 -78
- package/src/adapter/entry-points/console/ui/src/features/console/types.ts +0 -69
- package/src/adapter/entry-points/console/ui-dist/assets/index-DDjYPXRT.js +0 -49
- package/src/adapter/entry-points/console/ui-dist/assets/index-DHlBLm7d.css +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { fireEvent, render } from '@testing-library/react';
|
|
2
|
+
import { consoleCommentsFixture } from '../../testing/fixtures';
|
|
3
|
+
import { ConsoleCommentList } from './ConsoleCommentList';
|
|
4
|
+
|
|
5
|
+
const now = Date.parse('2026-06-19T12:00:00.000Z');
|
|
6
|
+
|
|
7
|
+
describe('ConsoleCommentList', () => {
|
|
8
|
+
it('shows only the latest comment until expanded', () => {
|
|
9
|
+
const { getByText, queryByText } = render(
|
|
10
|
+
<ConsoleCommentList
|
|
11
|
+
comments={consoleCommentsFixture}
|
|
12
|
+
isLoading={false}
|
|
13
|
+
error={null}
|
|
14
|
+
now={now}
|
|
15
|
+
/>,
|
|
16
|
+
);
|
|
17
|
+
expect(
|
|
18
|
+
getByText(/Looks good now\. Approving once the rebase is green\./),
|
|
19
|
+
).toBeInTheDocument();
|
|
20
|
+
expect(queryByText(/Please split the token validation/)).toBeNull();
|
|
21
|
+
fireEvent.click(getByText('Show all 3'));
|
|
22
|
+
expect(getByText(/Please split the token validation/)).toBeInTheDocument();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('shows the loading state', () => {
|
|
26
|
+
const { getByText } = render(
|
|
27
|
+
<ConsoleCommentList comments={[]} isLoading error={null} now={now} />,
|
|
28
|
+
);
|
|
29
|
+
expect(getByText('Loading comments...')).toBeInTheDocument();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('shows the empty state', () => {
|
|
33
|
+
const { getByText } = render(
|
|
34
|
+
<ConsoleCommentList
|
|
35
|
+
comments={[]}
|
|
36
|
+
isLoading={false}
|
|
37
|
+
error={null}
|
|
38
|
+
now={now}
|
|
39
|
+
/>,
|
|
40
|
+
);
|
|
41
|
+
expect(getByText('No comments.')).toBeInTheDocument();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('shows the error state', () => {
|
|
45
|
+
const { getByRole } = render(
|
|
46
|
+
<ConsoleCommentList
|
|
47
|
+
comments={[]}
|
|
48
|
+
isLoading={false}
|
|
49
|
+
error="HTTP 500"
|
|
50
|
+
now={now}
|
|
51
|
+
/>,
|
|
52
|
+
);
|
|
53
|
+
expect(getByRole('alert')).toHaveTextContent('HTTP 500');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { formatRelativeTime } from '../../logic/relativeTime';
|
|
3
|
+
import type { ConsoleComment } from '../../logic/types';
|
|
4
|
+
import { ConsoleMarkdownContent } from '../content/ConsoleMarkdownContent';
|
|
5
|
+
|
|
6
|
+
export type ConsoleCommentListProps = {
|
|
7
|
+
comments: ConsoleComment[];
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
error: string | null;
|
|
10
|
+
now: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const ConsoleCommentList = ({
|
|
14
|
+
comments,
|
|
15
|
+
isLoading,
|
|
16
|
+
error,
|
|
17
|
+
now,
|
|
18
|
+
}: ConsoleCommentListProps) => {
|
|
19
|
+
const [showAll, setShowAll] = useState<boolean>(false);
|
|
20
|
+
|
|
21
|
+
if (error !== null) {
|
|
22
|
+
return (
|
|
23
|
+
<p role="alert" className="console-comment-error">
|
|
24
|
+
Failed to load comments: {error}
|
|
25
|
+
</p>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (isLoading) {
|
|
30
|
+
return <p className="console-comment-loading">Loading comments...</p>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (comments.length === 0) {
|
|
34
|
+
return <p className="console-comment-empty">No comments.</p>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const visible = showAll ? comments : comments.slice(-1);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div className="console-comment-list">
|
|
41
|
+
{!showAll && comments.length > 1 && (
|
|
42
|
+
<button
|
|
43
|
+
type="button"
|
|
44
|
+
className="console-comment-show-all"
|
|
45
|
+
onClick={() => setShowAll(true)}
|
|
46
|
+
>
|
|
47
|
+
Show all {comments.length}
|
|
48
|
+
</button>
|
|
49
|
+
)}
|
|
50
|
+
{visible.map((comment) => (
|
|
51
|
+
<article
|
|
52
|
+
key={`${comment.author}:${comment.createdAt}:${comment.body}`}
|
|
53
|
+
className="console-comment"
|
|
54
|
+
>
|
|
55
|
+
<header className="console-comment-header">
|
|
56
|
+
<span className="console-comment-author">{comment.author}</span>
|
|
57
|
+
<span className="console-comment-time">
|
|
58
|
+
{formatRelativeTime(comment.createdAt, now)}
|
|
59
|
+
</span>
|
|
60
|
+
</header>
|
|
61
|
+
<ConsoleMarkdownContent body={comment.body} />
|
|
62
|
+
</article>
|
|
63
|
+
))}
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { consoleCommitsFixture } from '../../testing/fixtures';
|
|
3
|
+
import { ConsoleCommitList } from './ConsoleCommitList';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof ConsoleCommitList> = {
|
|
6
|
+
title: 'Console/ConsoleCommitList',
|
|
7
|
+
component: ConsoleCommitList,
|
|
8
|
+
args: { now: Date.parse('2026-06-19T12:00:00.000Z') },
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof ConsoleCommitList>;
|
|
14
|
+
|
|
15
|
+
export const WithCommits: Story = {
|
|
16
|
+
args: { commits: consoleCommitsFixture, isLoading: false, error: null },
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Loading: Story = {
|
|
20
|
+
args: { commits: [], isLoading: true, error: null },
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Empty: Story = {
|
|
24
|
+
args: { commits: [], isLoading: false, error: null },
|
|
25
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { consoleCommitsFixture } from '../../testing/fixtures';
|
|
3
|
+
import { ConsoleCommitList } from './ConsoleCommitList';
|
|
4
|
+
|
|
5
|
+
const now = Date.parse('2026-06-19T12:00:00.000Z');
|
|
6
|
+
|
|
7
|
+
describe('ConsoleCommitList', () => {
|
|
8
|
+
it('renders the first message line, short sha and author', () => {
|
|
9
|
+
const { getByText } = render(
|
|
10
|
+
<ConsoleCommitList
|
|
11
|
+
commits={consoleCommitsFixture}
|
|
12
|
+
isLoading={false}
|
|
13
|
+
error={null}
|
|
14
|
+
now={now}
|
|
15
|
+
/>,
|
|
16
|
+
);
|
|
17
|
+
expect(
|
|
18
|
+
getByText('feat(console): add serveConsole subcommand and HTTP server'),
|
|
19
|
+
).toBeInTheDocument();
|
|
20
|
+
expect(getByText('4f9c2a1')).toBeInTheDocument();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('shows the loading state', () => {
|
|
24
|
+
const { getByText } = render(
|
|
25
|
+
<ConsoleCommitList commits={[]} isLoading error={null} now={now} />,
|
|
26
|
+
);
|
|
27
|
+
expect(getByText('Loading commits...')).toBeInTheDocument();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('shows the empty state', () => {
|
|
31
|
+
const { getByText } = render(
|
|
32
|
+
<ConsoleCommitList
|
|
33
|
+
commits={[]}
|
|
34
|
+
isLoading={false}
|
|
35
|
+
error={null}
|
|
36
|
+
now={now}
|
|
37
|
+
/>,
|
|
38
|
+
);
|
|
39
|
+
expect(getByText('No commits.')).toBeInTheDocument();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('shows the error state', () => {
|
|
43
|
+
const { getByRole } = render(
|
|
44
|
+
<ConsoleCommitList
|
|
45
|
+
commits={[]}
|
|
46
|
+
isLoading={false}
|
|
47
|
+
error="HTTP 500"
|
|
48
|
+
now={now}
|
|
49
|
+
/>,
|
|
50
|
+
);
|
|
51
|
+
expect(getByRole('alert')).toHaveTextContent('HTTP 500');
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { formatRelativeTime } from '../../logic/relativeTime';
|
|
2
|
+
import type { ConsoleCommit } from '../../logic/types';
|
|
3
|
+
|
|
4
|
+
export type ConsoleCommitListProps = {
|
|
5
|
+
commits: ConsoleCommit[];
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
error: string | null;
|
|
8
|
+
now: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const shortSha = (sha: string): string => sha.slice(0, 7);
|
|
12
|
+
|
|
13
|
+
const firstLine = (message: string): string => message.split('\n')[0];
|
|
14
|
+
|
|
15
|
+
export const ConsoleCommitList = ({
|
|
16
|
+
commits,
|
|
17
|
+
isLoading,
|
|
18
|
+
error,
|
|
19
|
+
now,
|
|
20
|
+
}: ConsoleCommitListProps) => {
|
|
21
|
+
if (error !== null) {
|
|
22
|
+
return (
|
|
23
|
+
<p role="alert" className="console-commits-error">
|
|
24
|
+
Failed to load commits: {error}
|
|
25
|
+
</p>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (isLoading) {
|
|
30
|
+
return <p className="console-commits-loading">Loading commits...</p>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (commits.length === 0) {
|
|
34
|
+
return <p className="console-commits-empty">No commits.</p>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<ul className="console-commits">
|
|
39
|
+
{commits.map((commit) => (
|
|
40
|
+
<li key={commit.sha} className="console-commit">
|
|
41
|
+
<span className="console-commit-message">
|
|
42
|
+
{firstLine(commit.message)}
|
|
43
|
+
</span>
|
|
44
|
+
<span className="console-commit-sha">{shortSha(commit.sha)}</span>
|
|
45
|
+
<span className="console-commit-author">{commit.author}</span>
|
|
46
|
+
<span className="console-commit-time">
|
|
47
|
+
{formatRelativeTime(commit.authoredAt, now)}
|
|
48
|
+
</span>
|
|
49
|
+
</li>
|
|
50
|
+
))}
|
|
51
|
+
</ul>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import {
|
|
3
|
+
consoleChangedFilesFixture,
|
|
4
|
+
consoleCommentsFixture,
|
|
5
|
+
consoleCommitsFixture,
|
|
6
|
+
consoleListItemsFixture,
|
|
7
|
+
consoleMermaidBodyFixture,
|
|
8
|
+
consoleRelatedPullRequestsFixture,
|
|
9
|
+
} from '../../testing/fixtures';
|
|
10
|
+
import { ConsoleItemDetail } from './ConsoleItemDetail';
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof ConsoleItemDetail> = {
|
|
13
|
+
title: 'Console/ConsoleItemDetail',
|
|
14
|
+
component: ConsoleItemDetail,
|
|
15
|
+
args: {
|
|
16
|
+
now: Date.parse('2026-06-19T12:00:00.000Z'),
|
|
17
|
+
operationBar: null,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
|
|
23
|
+
type Story = StoryObj<typeof ConsoleItemDetail>;
|
|
24
|
+
|
|
25
|
+
export const PullRequestItem: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
item: consoleListItemsFixture[0],
|
|
28
|
+
storyName: 'TDPM Console port',
|
|
29
|
+
storyColorEnum: 'BLUE',
|
|
30
|
+
overlayStatus: null,
|
|
31
|
+
state: { state: 'open', merged: false, isPullRequest: true },
|
|
32
|
+
body: consoleMermaidBodyFixture,
|
|
33
|
+
bodyIsLoading: false,
|
|
34
|
+
bodyError: null,
|
|
35
|
+
comments: consoleCommentsFixture,
|
|
36
|
+
commentsAreLoading: false,
|
|
37
|
+
commentsError: null,
|
|
38
|
+
files: consoleChangedFilesFixture,
|
|
39
|
+
filesAreLoading: false,
|
|
40
|
+
filesError: null,
|
|
41
|
+
commits: consoleCommitsFixture,
|
|
42
|
+
commitsAreLoading: false,
|
|
43
|
+
commitsError: null,
|
|
44
|
+
relatedPullRequests: [],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const IssueWithLinkedPullRequest: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
item: consoleListItemsFixture[2],
|
|
51
|
+
storyName: 'TDPM Console port',
|
|
52
|
+
storyColorEnum: 'BLUE',
|
|
53
|
+
overlayStatus: null,
|
|
54
|
+
state: { state: 'open', merged: false, isPullRequest: false },
|
|
55
|
+
body: '## Issue body\n\nThis issue has a linked pull request.',
|
|
56
|
+
bodyIsLoading: false,
|
|
57
|
+
bodyError: null,
|
|
58
|
+
comments: consoleCommentsFixture,
|
|
59
|
+
commentsAreLoading: false,
|
|
60
|
+
commentsError: null,
|
|
61
|
+
files: [],
|
|
62
|
+
filesAreLoading: false,
|
|
63
|
+
filesError: null,
|
|
64
|
+
commits: [],
|
|
65
|
+
commitsAreLoading: false,
|
|
66
|
+
commitsError: null,
|
|
67
|
+
relatedPullRequests: [
|
|
68
|
+
{
|
|
69
|
+
pullRequest: consoleRelatedPullRequestsFixture[0],
|
|
70
|
+
files: consoleChangedFilesFixture,
|
|
71
|
+
filesAreLoading: false,
|
|
72
|
+
filesError: null,
|
|
73
|
+
commits: consoleCommitsFixture,
|
|
74
|
+
commitsAreLoading: false,
|
|
75
|
+
commitsError: null,
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import {
|
|
3
|
+
consoleChangedFilesFixture,
|
|
4
|
+
consoleCommentsFixture,
|
|
5
|
+
consoleCommitsFixture,
|
|
6
|
+
consoleListItemsFixture,
|
|
7
|
+
} from '../../testing/fixtures';
|
|
8
|
+
import { ConsoleItemDetail } from './ConsoleItemDetail';
|
|
9
|
+
|
|
10
|
+
jest.mock('../../lib/mermaidLoader', () => ({
|
|
11
|
+
renderMermaidToSvg: jest.fn(async () => '<svg></svg>'),
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
const now = Date.parse('2026-06-19T12:00:00.000Z');
|
|
15
|
+
const prItem = consoleListItemsFixture[0];
|
|
16
|
+
const issueItem = consoleListItemsFixture[2];
|
|
17
|
+
|
|
18
|
+
const baseProps = {
|
|
19
|
+
storyName: 'TDPM Console port',
|
|
20
|
+
storyColorEnum: 'BLUE' as const,
|
|
21
|
+
overlayStatus: null,
|
|
22
|
+
state: { state: 'open', merged: false, isPullRequest: true },
|
|
23
|
+
body: '## Body heading',
|
|
24
|
+
bodyIsLoading: false,
|
|
25
|
+
bodyError: null,
|
|
26
|
+
comments: consoleCommentsFixture,
|
|
27
|
+
commentsAreLoading: false,
|
|
28
|
+
commentsError: null,
|
|
29
|
+
files: consoleChangedFilesFixture,
|
|
30
|
+
filesAreLoading: false,
|
|
31
|
+
filesError: null,
|
|
32
|
+
commits: consoleCommitsFixture,
|
|
33
|
+
commitsAreLoading: false,
|
|
34
|
+
commitsError: null,
|
|
35
|
+
relatedPullRequests: [],
|
|
36
|
+
now,
|
|
37
|
+
operationBar: <div>operation-bar</div>,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
describe('ConsoleItemDetail', () => {
|
|
41
|
+
it('renders the PR title with the PR number, sub bar and changed files panel', () => {
|
|
42
|
+
const { getByText, getAllByText } = render(
|
|
43
|
+
<ConsoleItemDetail item={prItem} {...baseProps} />,
|
|
44
|
+
);
|
|
45
|
+
expect(getAllByText(`PR #${prItem.number}`).length).toBeGreaterThan(0);
|
|
46
|
+
expect(getByText('Changed files')).toBeInTheDocument();
|
|
47
|
+
expect(getByText('Commits')).toBeInTheDocument();
|
|
48
|
+
expect(getByText('operation-bar')).toBeInTheDocument();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('renders the story tag and opened relative time', () => {
|
|
52
|
+
const { getByText } = render(
|
|
53
|
+
<ConsoleItemDetail item={prItem} {...baseProps} />,
|
|
54
|
+
);
|
|
55
|
+
expect(getByText('TDPM Console port')).toBeInTheDocument();
|
|
56
|
+
expect(getByText(/opened/)).toBeInTheDocument();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('renders an issue without the changed files or commits panels', () => {
|
|
60
|
+
const { queryByText } = render(
|
|
61
|
+
<ConsoleItemDetail
|
|
62
|
+
item={issueItem}
|
|
63
|
+
{...baseProps}
|
|
64
|
+
state={{ state: 'open', merged: false, isPullRequest: false }}
|
|
65
|
+
/>,
|
|
66
|
+
);
|
|
67
|
+
expect(queryByText('Changed files')).toBeNull();
|
|
68
|
+
expect(queryByText('Commits')).toBeNull();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('renders the overlay status chip when set', () => {
|
|
72
|
+
const { getByText } = render(
|
|
73
|
+
<ConsoleItemDetail
|
|
74
|
+
item={issueItem}
|
|
75
|
+
{...baseProps}
|
|
76
|
+
overlayStatus={{ name: 'Awaiting Workspace', color: 'BLUE' }}
|
|
77
|
+
/>,
|
|
78
|
+
);
|
|
79
|
+
expect(getByText('Awaiting Workspace')).toBeInTheDocument();
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { colorFromEnum } from '../../logic/colors';
|
|
3
|
+
import {
|
|
4
|
+
formatFullTimestamp,
|
|
5
|
+
formatRelativeTime,
|
|
6
|
+
} from '../../logic/relativeTime';
|
|
7
|
+
import type {
|
|
8
|
+
ConsoleChangedFile,
|
|
9
|
+
ConsoleColor,
|
|
10
|
+
ConsoleComment,
|
|
11
|
+
ConsoleCommit,
|
|
12
|
+
ConsoleIssueState,
|
|
13
|
+
ConsoleListItem,
|
|
14
|
+
ConsoleOverlayStatus,
|
|
15
|
+
ConsoleRelatedPullRequest,
|
|
16
|
+
} from '../../logic/types';
|
|
17
|
+
import { ConsoleMarkdownContent } from '../content/ConsoleMarkdownContent';
|
|
18
|
+
import { ConsolePanel } from '../layout/ConsolePanel';
|
|
19
|
+
import { ConsoleChangedFileList } from './ConsoleChangedFileList';
|
|
20
|
+
import { ConsoleCommentList } from './ConsoleCommentList';
|
|
21
|
+
import { ConsoleCommitList } from './ConsoleCommitList';
|
|
22
|
+
import { ConsoleItemIcon } from './ConsoleItemIcon';
|
|
23
|
+
import { ConsolePullRequestDetail } from './ConsolePullRequestDetail';
|
|
24
|
+
|
|
25
|
+
export type ConsoleRelatedPullRequestView = {
|
|
26
|
+
pullRequest: ConsoleRelatedPullRequest;
|
|
27
|
+
files: ConsoleChangedFile[];
|
|
28
|
+
filesAreLoading: boolean;
|
|
29
|
+
filesError: string | null;
|
|
30
|
+
commits: ConsoleCommit[];
|
|
31
|
+
commitsAreLoading: boolean;
|
|
32
|
+
commitsError: string | null;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type ConsoleItemDetailProps = {
|
|
36
|
+
item: ConsoleListItem;
|
|
37
|
+
storyName: string | null;
|
|
38
|
+
storyColorEnum: ConsoleColor | null;
|
|
39
|
+
overlayStatus: ConsoleOverlayStatus | null;
|
|
40
|
+
state: ConsoleIssueState | null;
|
|
41
|
+
body: string;
|
|
42
|
+
bodyIsLoading: boolean;
|
|
43
|
+
bodyError: string | null;
|
|
44
|
+
comments: ConsoleComment[];
|
|
45
|
+
commentsAreLoading: boolean;
|
|
46
|
+
commentsError: string | null;
|
|
47
|
+
files: ConsoleChangedFile[];
|
|
48
|
+
filesAreLoading: boolean;
|
|
49
|
+
filesError: string | null;
|
|
50
|
+
commits: ConsoleCommit[];
|
|
51
|
+
commitsAreLoading: boolean;
|
|
52
|
+
commitsError: string | null;
|
|
53
|
+
relatedPullRequests: ConsoleRelatedPullRequestView[];
|
|
54
|
+
now: number;
|
|
55
|
+
operationBar: ReactNode;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const ConsoleItemDetail = ({
|
|
59
|
+
item,
|
|
60
|
+
storyName,
|
|
61
|
+
storyColorEnum,
|
|
62
|
+
overlayStatus,
|
|
63
|
+
state,
|
|
64
|
+
body,
|
|
65
|
+
bodyIsLoading,
|
|
66
|
+
bodyError,
|
|
67
|
+
comments,
|
|
68
|
+
commentsAreLoading,
|
|
69
|
+
commentsError,
|
|
70
|
+
files,
|
|
71
|
+
filesAreLoading,
|
|
72
|
+
filesError,
|
|
73
|
+
commits,
|
|
74
|
+
commitsAreLoading,
|
|
75
|
+
commitsError,
|
|
76
|
+
relatedPullRequests,
|
|
77
|
+
now,
|
|
78
|
+
operationBar,
|
|
79
|
+
}: ConsoleItemDetailProps) => {
|
|
80
|
+
const resolvedState = state?.state ?? 'open';
|
|
81
|
+
const merged = state?.merged ?? false;
|
|
82
|
+
const closedStateLabel =
|
|
83
|
+
!item.isPr && resolvedState === 'closed' ? 'Closed' : null;
|
|
84
|
+
const storyPalette = colorFromEnum(storyColorEnum);
|
|
85
|
+
const statusPalette = overlayStatus
|
|
86
|
+
? colorFromEnum(overlayStatus.color)
|
|
87
|
+
: null;
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<article className="console-detail">
|
|
91
|
+
{storyName !== null && (
|
|
92
|
+
<div className="console-detail-story">
|
|
93
|
+
<span className="console-storytag">
|
|
94
|
+
<span
|
|
95
|
+
className="console-story-dot"
|
|
96
|
+
style={{ backgroundColor: storyPalette.dot }}
|
|
97
|
+
/>
|
|
98
|
+
{storyName}
|
|
99
|
+
</span>
|
|
100
|
+
</div>
|
|
101
|
+
)}
|
|
102
|
+
|
|
103
|
+
{overlayStatus !== null && statusPalette !== null && (
|
|
104
|
+
<span
|
|
105
|
+
className="console-detail-status-chip"
|
|
106
|
+
style={{
|
|
107
|
+
color: statusPalette.fg,
|
|
108
|
+
borderColor: statusPalette.border,
|
|
109
|
+
backgroundColor: statusPalette.bg,
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
{overlayStatus.name}
|
|
113
|
+
</span>
|
|
114
|
+
)}
|
|
115
|
+
|
|
116
|
+
<h2 className="console-detail-title">
|
|
117
|
+
<ConsoleItemIcon
|
|
118
|
+
isPr={item.isPr}
|
|
119
|
+
state={resolvedState}
|
|
120
|
+
merged={merged}
|
|
121
|
+
isDraft={false}
|
|
122
|
+
stateReason=""
|
|
123
|
+
/>
|
|
124
|
+
<span className="console-detail-title-text">{item.title}</span>
|
|
125
|
+
<span className="console-detail-number">
|
|
126
|
+
{item.isPr ? `PR #${item.number}` : `#${item.number}`}
|
|
127
|
+
</span>
|
|
128
|
+
{closedStateLabel !== null && (
|
|
129
|
+
<span className="console-detail-closed-label">
|
|
130
|
+
{closedStateLabel}
|
|
131
|
+
</span>
|
|
132
|
+
)}
|
|
133
|
+
</h2>
|
|
134
|
+
|
|
135
|
+
<div className="console-detail-subbar">
|
|
136
|
+
<a
|
|
137
|
+
href={item.url}
|
|
138
|
+
className="console-detail-link"
|
|
139
|
+
target="_blank"
|
|
140
|
+
rel="noopener noreferrer"
|
|
141
|
+
>
|
|
142
|
+
{item.isPr ? `PR #${item.number}` : `Issue #${item.number}`}
|
|
143
|
+
</a>
|
|
144
|
+
<span className="console-detail-repo">{item.repo}</span>
|
|
145
|
+
<span className="console-detail-pill">
|
|
146
|
+
{item.isPr ? 'PR' : 'Issue'}
|
|
147
|
+
</span>
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
{item.labels.length > 0 && (
|
|
151
|
+
<div className="console-detail-labels">
|
|
152
|
+
{item.labels.map((label) => (
|
|
153
|
+
<span key={label} className="console-label-chip">
|
|
154
|
+
{label}
|
|
155
|
+
</span>
|
|
156
|
+
))}
|
|
157
|
+
</div>
|
|
158
|
+
)}
|
|
159
|
+
|
|
160
|
+
<div
|
|
161
|
+
className="console-detail-createdat"
|
|
162
|
+
title={formatFullTimestamp(item.createdAt)}
|
|
163
|
+
>
|
|
164
|
+
opened {formatRelativeTime(item.createdAt, now)}
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<ConsolePanel title="Description">
|
|
168
|
+
{bodyError !== null ? (
|
|
169
|
+
<p role="alert" className="console-detail-body-error">
|
|
170
|
+
Failed to load description: {bodyError}
|
|
171
|
+
</p>
|
|
172
|
+
) : bodyIsLoading ? (
|
|
173
|
+
<p className="console-detail-body-loading">Loading description...</p>
|
|
174
|
+
) : (
|
|
175
|
+
<ConsoleMarkdownContent body={body} />
|
|
176
|
+
)}
|
|
177
|
+
</ConsolePanel>
|
|
178
|
+
|
|
179
|
+
{item.isPr && (
|
|
180
|
+
<ConsolePanel title="Changed files">
|
|
181
|
+
<ConsoleChangedFileList
|
|
182
|
+
files={files}
|
|
183
|
+
isLoading={filesAreLoading}
|
|
184
|
+
error={filesError}
|
|
185
|
+
/>
|
|
186
|
+
</ConsolePanel>
|
|
187
|
+
)}
|
|
188
|
+
|
|
189
|
+
<ConsolePanel title="Comments" defaultCollapsed={item.isPr}>
|
|
190
|
+
<ConsoleCommentList
|
|
191
|
+
comments={comments}
|
|
192
|
+
isLoading={commentsAreLoading}
|
|
193
|
+
error={commentsError}
|
|
194
|
+
now={now}
|
|
195
|
+
/>
|
|
196
|
+
</ConsolePanel>
|
|
197
|
+
|
|
198
|
+
{item.isPr && (
|
|
199
|
+
<ConsolePanel title="Commits" defaultCollapsed>
|
|
200
|
+
<ConsoleCommitList
|
|
201
|
+
commits={commits}
|
|
202
|
+
isLoading={commitsAreLoading}
|
|
203
|
+
error={commitsError}
|
|
204
|
+
now={now}
|
|
205
|
+
/>
|
|
206
|
+
</ConsolePanel>
|
|
207
|
+
)}
|
|
208
|
+
|
|
209
|
+
{!item.isPr &&
|
|
210
|
+
relatedPullRequests.map((related) => (
|
|
211
|
+
<ConsolePullRequestDetail
|
|
212
|
+
key={related.pullRequest.url}
|
|
213
|
+
pullRequest={related.pullRequest}
|
|
214
|
+
body={related.pullRequest.summary?.body ?? ''}
|
|
215
|
+
bodyIsLoading={false}
|
|
216
|
+
files={related.files}
|
|
217
|
+
filesAreLoading={related.filesAreLoading}
|
|
218
|
+
filesError={related.filesError}
|
|
219
|
+
commits={related.commits}
|
|
220
|
+
commitsAreLoading={related.commitsAreLoading}
|
|
221
|
+
commitsError={related.commitsError}
|
|
222
|
+
now={now}
|
|
223
|
+
/>
|
|
224
|
+
))}
|
|
225
|
+
|
|
226
|
+
<div className="console-detail-operations">{operationBar}</div>
|
|
227
|
+
</article>
|
|
228
|
+
);
|
|
229
|
+
};
|