github-issue-tower-defence-management 1.91.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 +8 -0
- package/README.md +5 -4
- package/bin/adapter/entry-points/cli/index.js +1 -1
- package/bin/adapter/entry-points/cli/index.js.map +1 -1
- package/bin/adapter/entry-points/handlers/consoleListsWriter.js +1 -0
- package/bin/adapter/entry-points/handlers/consoleListsWriter.js.map +1 -1
- package/bin/domain/usecases/console/GenerateConsoleListsUseCase.js +3 -0
- package/bin/domain/usecases/console/GenerateConsoleListsUseCase.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/entry-points/cli/index.test.ts +6 -1
- package/src/adapter/entry-points/cli/index.ts +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleMarkdownView.stories.tsx → content/ConsoleMarkdownContent.stories.tsx} +6 -6
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleMarkdownView.test.tsx → content/ConsoleMarkdownContent.test.tsx} +6 -6
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleMarkdownView.tsx → content/ConsoleMarkdownContent.tsx} +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleMermaidDiagram.stories.tsx → content/ConsoleMermaidDiagram.stories.tsx} +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleMermaidDiagram.test.tsx → content/ConsoleMermaidDiagram.test.tsx} +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleMermaidDiagram.tsx → content/ConsoleMermaidDiagram.tsx} +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleChangedFileList.stories.tsx → detail/ConsoleChangedFileList.stories.tsx} +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleChangedFileList.test.tsx → detail/ConsoleChangedFileList.test.tsx} +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleChangedFileList.tsx → detail/ConsoleChangedFileList.tsx} +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleCommentList.stories.tsx → detail/ConsoleCommentList.stories.tsx} +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleCommentList.test.tsx → detail/ConsoleCommentList.test.tsx} +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleCommentList.tsx → detail/ConsoleCommentList.tsx} +4 -4
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleCommitList.stories.tsx → detail/ConsoleCommitList.stories.tsx} +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleCommitList.test.tsx → detail/ConsoleCommitList.test.tsx} +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleCommitList.tsx → detail/ConsoleCommitList.tsx} +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleItemDetail.stories.tsx → detail/ConsoleItemDetail.stories.tsx} +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleItemDetail.test.tsx → detail/ConsoleItemDetail.test.tsx} +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleItemDetail.tsx → detail/ConsoleItemDetail.tsx} +11 -8
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleItemIcon.test.tsx → detail/ConsoleItemIcon.test.tsx} +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleItemIcon.tsx → detail/ConsoleItemIcon.tsx} +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsolePullRequestSection.stories.tsx → detail/ConsolePullRequestDetail.stories.tsx} +6 -6
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsolePullRequestSection.test.tsx → detail/ConsolePullRequestDetail.test.tsx} +5 -5
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsolePullRequestSection.tsx → detail/ConsolePullRequestDetail.tsx} +5 -5
- 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/{ConsoleProjectHeader.test.tsx → layout/ConsoleProjectSummary.test.tsx} +4 -4
- 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/{ConsoleTabBar.stories.tsx → layout/ConsoleTabList.stories.tsx} +7 -7
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleTabBar.test.tsx → layout/ConsoleTabList.test.tsx} +7 -7
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleTabBar.tsx → layout/ConsoleTabList.tsx} +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleListView.stories.tsx → list/ConsoleItemList.stories.tsx} +7 -7
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleListView.test.tsx → list/ConsoleItemList.test.tsx} +9 -9
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleListView.tsx → list/ConsoleItemList.tsx} +13 -7
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleListItemRow.stories.tsx → list/ConsoleItemSummary.stories.tsx} +6 -6
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleListItemRow.test.tsx → list/ConsoleItemSummary.test.tsx} +7 -7
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleListItemRow.tsx → list/ConsoleItemSummary.tsx} +3 -3
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleStoryGroupHeader.stories.tsx → list/ConsoleStorySummary.stories.tsx} +5 -5
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleStoryGroupHeader.test.tsx → list/ConsoleStorySummary.test.tsx} +4 -4
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleStoryGroupHeader.tsx → list/ConsoleStorySummary.tsx} +3 -3
- 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/{ConsoleCloseButtonGroup.test.tsx → operations/ConsoleCloseActions.test.tsx} +4 -6
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleCloseButtonGroup.tsx → operations/ConsoleCloseActions.tsx} +2 -2
- 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/{ConsoleNextActionDateGroup.test.tsx → operations/ConsoleNextActionDateActions.test.tsx} +5 -5
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleNextActionDateGroup.tsx → operations/ConsoleNextActionDateActions.tsx} +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleOperationBar.stories.tsx → operations/ConsoleOperationMenu.stories.tsx} +7 -7
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleOperationBar.test.tsx → operations/ConsoleOperationMenu.test.tsx} +8 -8
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleOperationBar.tsx → operations/ConsoleOperationMenu.tsx} +16 -13
- 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/{ConsolePullRequestReviewGroup.test.tsx → operations/ConsolePullRequestReviewActions.test.tsx} +4 -4
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsolePullRequestReviewGroup.tsx → operations/ConsolePullRequestReviewActions.tsx} +2 -2
- 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/{ConsoleStatusButtonGroup.test.tsx → operations/ConsoleStatusActions.test.tsx} +6 -6
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleStatusButtonGroup.tsx → operations/ConsoleStatusActions.tsx} +7 -4
- 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/{ConsoleStoryButtonGroup.test.tsx → operations/ConsoleStoryActions.test.tsx} +5 -11
- package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleStoryButtonGroup.tsx → operations/ConsoleStoryActions.tsx} +3 -3
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleCaches.ts +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleItemDetailData.test.ts +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleItemDetailData.ts +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOperations.test.ts +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOperations.ts +3 -3
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOverlay.test.ts +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOverlay.ts +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleTabData.ts +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/lib/consoleApi.ts +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/{grouping.ts → logic/grouping.ts} +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.test.tsx +4 -4
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.tsx +6 -6
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsolePage.tsx +10 -10
- package/src/adapter/entry-points/console/ui/src/features/console/{fixtures.ts → testing/fixtures.ts} +1 -1
- package/src/adapter/entry-points/console/ui-dist/assets/{index-BvuSQN9s.js → index-PtVrAcBb.js} +11 -11
- package/src/adapter/entry-points/console/ui-dist/index.html +1 -1
- package/src/adapter/entry-points/handlers/consoleListsWriter.test.ts +27 -2
- package/src/adapter/entry-points/handlers/consoleListsWriter.ts +1 -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/handlers/consoleListsWriter.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/src/adapter/entry-points/console/ui/src/features/console/components/ConsoleCloseButtonGroup.stories.tsx +0 -14
- package/src/adapter/entry-points/console/ui/src/features/console/components/ConsoleNextActionDateGroup.stories.tsx +0 -20
- package/src/adapter/entry-points/console/ui/src/features/console/components/ConsolePullRequestReviewGroup.stories.tsx +0 -14
- package/src/adapter/entry-points/console/ui/src/features/console/components/ConsoleStatusButtonGroup.stories.tsx +0 -17
- package/src/adapter/entry-points/console/ui/src/features/console/components/ConsoleStoryButtonGroup.stories.tsx +0 -17
- /package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsoleItemIcon.stories.tsx → detail/ConsoleItemIcon.stories.tsx} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsolePanel.stories.tsx → layout/ConsolePanel.stories.tsx} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsolePanel.test.tsx → layout/ConsolePanel.test.tsx} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/components/{ConsolePanel.tsx → layout/ConsolePanel.tsx} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{colors.test.ts → logic/colors.test.ts} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{colors.ts → logic/colors.ts} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{fileStatus.test.ts → logic/fileStatus.test.ts} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{fileStatus.ts → logic/fileStatus.ts} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{grouping.test.ts → logic/grouping.test.ts} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{itemIcons.test.ts → logic/itemIcons.test.ts} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{itemIcons.ts → logic/itemIcons.ts} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{operations.test.ts → logic/operations.test.ts} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{operations.ts → logic/operations.ts} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{overlay.test.ts → logic/overlay.test.ts} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{overlay.ts → logic/overlay.ts} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{relativeTime.test.ts → logic/relativeTime.test.ts} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{relativeTime.ts → logic/relativeTime.ts} +0 -0
- /package/src/adapter/entry-points/console/ui/src/features/console/{types.ts → logic/types.ts} +0 -0
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type ConsoleOperationHandlers,
|
|
3
|
+
isTodoByHumanTab,
|
|
4
|
+
} from '../../logic/operations';
|
|
2
5
|
import type {
|
|
3
6
|
ConsoleFieldOption,
|
|
4
7
|
ConsoleListItem,
|
|
5
8
|
ConsoleTabName,
|
|
6
|
-
} from '
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
} from '../../logic/types';
|
|
10
|
+
import { ConsoleCloseActions } from './ConsoleCloseActions';
|
|
11
|
+
import { ConsoleNextActionDateActions } from './ConsoleNextActionDateActions';
|
|
12
|
+
import { ConsolePullRequestReviewActions } from './ConsolePullRequestReviewActions';
|
|
13
|
+
import { ConsoleStatusActions } from './ConsoleStatusActions';
|
|
14
|
+
import { ConsoleStoryActions } from './ConsoleStoryActions';
|
|
12
15
|
|
|
13
16
|
export type ConsoleOperationBarProps = {
|
|
14
17
|
tab: ConsoleTabName;
|
|
@@ -19,7 +22,7 @@ export type ConsoleOperationBarProps = {
|
|
|
19
22
|
handlers: ConsoleOperationHandlers;
|
|
20
23
|
};
|
|
21
24
|
|
|
22
|
-
export const
|
|
25
|
+
export const ConsoleOperationMenu = ({
|
|
23
26
|
tab,
|
|
24
27
|
item,
|
|
25
28
|
hasPullRequest,
|
|
@@ -32,24 +35,24 @@ export const ConsoleOperationBar = ({
|
|
|
32
35
|
return (
|
|
33
36
|
<div className="console-operation-bar">
|
|
34
37
|
{hasPullRequest && (
|
|
35
|
-
<
|
|
38
|
+
<ConsolePullRequestReviewActions onReview={handlers.onReview} />
|
|
36
39
|
)}
|
|
37
|
-
<
|
|
40
|
+
<ConsoleNextActionDateActions
|
|
38
41
|
isTodoByHuman={isTodoByHumanTab(tab)}
|
|
39
42
|
onSetNextActionDate={handlers.onSetNextActionDate}
|
|
40
43
|
/>
|
|
41
44
|
{showStory && (
|
|
42
|
-
<
|
|
45
|
+
<ConsoleStoryActions
|
|
43
46
|
storyOptions={storyOptions}
|
|
44
47
|
onSetStory={handlers.onSetStory}
|
|
45
48
|
/>
|
|
46
49
|
)}
|
|
47
|
-
<
|
|
50
|
+
<ConsoleStatusActions
|
|
48
51
|
statusOptions={statusOptions}
|
|
49
52
|
onSetStatus={handlers.onSetStatus}
|
|
50
53
|
onSetInTmuxByHuman={handlers.onSetInTmuxByHuman}
|
|
51
54
|
/>
|
|
52
|
-
{showClose && <
|
|
55
|
+
{showClose && <ConsoleCloseActions onClose={handlers.onClose} />}
|
|
53
56
|
</div>
|
|
54
57
|
);
|
|
55
58
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ConsolePullRequestReviewActions } from './ConsolePullRequestReviewActions';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof ConsolePullRequestReviewActions> = {
|
|
5
|
+
title: 'Console/ConsolePullRequestReviewActions',
|
|
6
|
+
component: ConsolePullRequestReviewActions,
|
|
7
|
+
args: { onReview: () => {} },
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof ConsolePullRequestReviewActions>;
|
|
13
|
+
|
|
14
|
+
export const Default: Story = {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { fireEvent, render } from '@testing-library/react';
|
|
2
|
-
import {
|
|
2
|
+
import { ConsolePullRequestReviewActions } from './ConsolePullRequestReviewActions';
|
|
3
3
|
|
|
4
|
-
describe('
|
|
4
|
+
describe('ConsolePullRequestReviewActions', () => {
|
|
5
5
|
it('renders the four buttons left to right', () => {
|
|
6
6
|
const { getAllByRole } = render(
|
|
7
|
-
<
|
|
7
|
+
<ConsolePullRequestReviewActions onReview={() => {}} />,
|
|
8
8
|
);
|
|
9
9
|
expect(getAllByRole('button').map((button) => button.textContent)).toEqual([
|
|
10
10
|
'Unnecessary',
|
|
@@ -17,7 +17,7 @@ describe('ConsolePullRequestReviewGroup', () => {
|
|
|
17
17
|
it('reports each review action', () => {
|
|
18
18
|
const onReview = jest.fn();
|
|
19
19
|
const { getByText } = render(
|
|
20
|
-
<
|
|
20
|
+
<ConsolePullRequestReviewActions onReview={onReview} />,
|
|
21
21
|
);
|
|
22
22
|
fireEvent.click(getByText('Unnecessary'));
|
|
23
23
|
fireEvent.click(getByText('Totally wrong'));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConsoleReviewAction } from '
|
|
1
|
+
import type { ConsoleReviewAction } from '../../logic/operations';
|
|
2
2
|
|
|
3
3
|
export type ConsolePullRequestReviewGroupProps = {
|
|
4
4
|
onReview: (action: ConsoleReviewAction) => void;
|
|
@@ -15,7 +15,7 @@ const REVIEW_BUTTONS: {
|
|
|
15
15
|
{ action: 'approve', label: 'Approve', color: '#3fb950' },
|
|
16
16
|
];
|
|
17
17
|
|
|
18
|
-
export const
|
|
18
|
+
export const ConsolePullRequestReviewActions = ({
|
|
19
19
|
onReview,
|
|
20
20
|
}: ConsolePullRequestReviewGroupProps) => (
|
|
21
21
|
<div className="console-op-group">
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { consoleStatusOptionsFixture } from '../../testing/fixtures';
|
|
3
|
+
import { ConsoleStatusActions } from './ConsoleStatusActions';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof ConsoleStatusActions> = {
|
|
6
|
+
title: 'Console/ConsoleStatusActions',
|
|
7
|
+
component: ConsoleStatusActions,
|
|
8
|
+
args: { onSetStatus: () => {}, onSetInTmuxByHuman: () => {} },
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof ConsoleStatusActions>;
|
|
14
|
+
|
|
15
|
+
export const AllStatusOptions: Story = {
|
|
16
|
+
args: { statusOptions: consoleStatusOptionsFixture },
|
|
17
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { fireEvent, render } from '@testing-library/react';
|
|
2
|
-
import { consoleStatusOptionsFixture } from '
|
|
3
|
-
import {
|
|
2
|
+
import { consoleStatusOptionsFixture } from '../../testing/fixtures';
|
|
3
|
+
import { ConsoleStatusActions } from './ConsoleStatusActions';
|
|
4
4
|
|
|
5
|
-
describe('
|
|
5
|
+
describe('ConsoleStatusActions', () => {
|
|
6
6
|
it('renders only the four routed status buttons that exist in the data', () => {
|
|
7
7
|
const { getByText, queryByText } = render(
|
|
8
|
-
<
|
|
8
|
+
<ConsoleStatusActions
|
|
9
9
|
statusOptions={consoleStatusOptionsFixture}
|
|
10
10
|
onSetStatus={() => {}}
|
|
11
11
|
onSetInTmuxByHuman={() => {}}
|
|
@@ -22,7 +22,7 @@ describe('ConsoleStatusButtonGroup', () => {
|
|
|
22
22
|
const onSetStatus = jest.fn();
|
|
23
23
|
const onSetInTmuxByHuman = jest.fn();
|
|
24
24
|
const { getByText } = render(
|
|
25
|
-
<
|
|
25
|
+
<ConsoleStatusActions
|
|
26
26
|
statusOptions={consoleStatusOptionsFixture}
|
|
27
27
|
onSetStatus={onSetStatus}
|
|
28
28
|
onSetInTmuxByHuman={onSetInTmuxByHuman}
|
|
@@ -38,7 +38,7 @@ describe('ConsoleStatusButtonGroup', () => {
|
|
|
38
38
|
|
|
39
39
|
it('renders nothing when no routed option exists', () => {
|
|
40
40
|
const { container } = render(
|
|
41
|
-
<
|
|
41
|
+
<ConsoleStatusActions
|
|
42
42
|
statusOptions={[{ id: 'x', name: 'Preparation', color: 'YELLOW' }]}
|
|
43
43
|
onSetStatus={() => {}}
|
|
44
44
|
onSetInTmuxByHuman={() => {}}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { colorFromEnum } from '
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { colorFromEnum } from '../../logic/colors';
|
|
2
|
+
import {
|
|
3
|
+
IN_TMUX_BY_HUMAN_NAME,
|
|
4
|
+
STATUS_BUTTON_NAMES,
|
|
5
|
+
} from '../../logic/operations';
|
|
6
|
+
import type { ConsoleFieldOption } from '../../logic/types';
|
|
4
7
|
|
|
5
8
|
export type ConsoleStatusButtonGroupProps = {
|
|
6
9
|
statusOptions: ConsoleFieldOption[];
|
|
@@ -18,7 +21,7 @@ const findStatusOption = (
|
|
|
18
21
|
);
|
|
19
22
|
};
|
|
20
23
|
|
|
21
|
-
export const
|
|
24
|
+
export const ConsoleStatusActions = ({
|
|
22
25
|
statusOptions,
|
|
23
26
|
onSetStatus,
|
|
24
27
|
onSetInTmuxByHuman,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { consoleStoryOptionsFixture } from '../../testing/fixtures';
|
|
3
|
+
import { ConsoleStoryActions } from './ConsoleStoryActions';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof ConsoleStoryActions> = {
|
|
6
|
+
title: 'Console/ConsoleStoryActions',
|
|
7
|
+
component: ConsoleStoryActions,
|
|
8
|
+
args: { onSetStory: () => {} },
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof ConsoleStoryActions>;
|
|
14
|
+
|
|
15
|
+
export const AssignableStories: Story = {
|
|
16
|
+
args: { storyOptions: consoleStoryOptionsFixture },
|
|
17
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fireEvent, render } from '@testing-library/react';
|
|
2
|
-
import {
|
|
2
|
+
import { ConsoleStoryActions } from './ConsoleStoryActions';
|
|
3
3
|
|
|
4
4
|
const options = [
|
|
5
5
|
{ id: '1', name: 'TDPM Console port', color: 'BLUE' as const },
|
|
@@ -11,10 +11,10 @@ const options = [
|
|
|
11
11
|
{ id: '3', name: 'Move to Okinawa', color: 'PURPLE' as const },
|
|
12
12
|
];
|
|
13
13
|
|
|
14
|
-
describe('
|
|
14
|
+
describe('ConsoleStoryActions', () => {
|
|
15
15
|
it('excludes no-story options', () => {
|
|
16
16
|
const { getByText, queryByText } = render(
|
|
17
|
-
<
|
|
17
|
+
<ConsoleStoryActions storyOptions={options} onSetStory={() => {}} />,
|
|
18
18
|
);
|
|
19
19
|
expect(getByText('TDPM Console port')).toBeInTheDocument();
|
|
20
20
|
expect(getByText('Move to Okinawa')).toBeInTheDocument();
|
|
@@ -24,10 +24,7 @@ describe('ConsoleStoryButtonGroup', () => {
|
|
|
24
24
|
it('reports the selected story option', () => {
|
|
25
25
|
const onSetStory = jest.fn();
|
|
26
26
|
const { getByText } = render(
|
|
27
|
-
<
|
|
28
|
-
storyOptions={options}
|
|
29
|
-
onSetStory={onSetStory}
|
|
30
|
-
/>,
|
|
27
|
+
<ConsoleStoryActions storyOptions={options} onSetStory={onSetStory} />,
|
|
31
28
|
);
|
|
32
29
|
fireEvent.click(getByText('Move to Okinawa'));
|
|
33
30
|
expect(onSetStory).toHaveBeenCalledWith(options[2]);
|
|
@@ -35,10 +32,7 @@ describe('ConsoleStoryButtonGroup', () => {
|
|
|
35
32
|
|
|
36
33
|
it('renders nothing when only no-story options exist', () => {
|
|
37
34
|
const { container } = render(
|
|
38
|
-
<
|
|
39
|
-
storyOptions={[options[1]]}
|
|
40
|
-
onSetStory={() => {}}
|
|
41
|
-
/>,
|
|
35
|
+
<ConsoleStoryActions storyOptions={[options[1]]} onSetStory={() => {}} />,
|
|
42
36
|
);
|
|
43
37
|
expect(container.firstChild).toBeNull();
|
|
44
38
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { colorFromEnum } from '
|
|
2
|
-
import type { ConsoleFieldOption } from '
|
|
1
|
+
import { colorFromEnum } from '../../logic/colors';
|
|
2
|
+
import type { ConsoleFieldOption } from '../../logic/types';
|
|
3
3
|
|
|
4
4
|
export type ConsoleStoryButtonGroupProps = {
|
|
5
5
|
storyOptions: ConsoleFieldOption[];
|
|
@@ -9,7 +9,7 @@ export type ConsoleStoryButtonGroupProps = {
|
|
|
9
9
|
const isNoStoryOption = (option: ConsoleFieldOption): boolean =>
|
|
10
10
|
option.name.toLowerCase().includes('no story');
|
|
11
11
|
|
|
12
|
-
export const
|
|
12
|
+
export const ConsoleStoryActions = ({
|
|
13
13
|
storyOptions,
|
|
14
14
|
onSetStory,
|
|
15
15
|
}: ConsoleStoryButtonGroupProps) => {
|
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
ConsoleIssueState,
|
|
8
8
|
ConsoleListItem,
|
|
9
9
|
ConsoleRelatedPullRequest,
|
|
10
|
-
} from '../types';
|
|
10
|
+
} from '../logic/types';
|
|
11
11
|
import type { ConsoleCaches } from './useConsoleCaches';
|
|
12
12
|
import { useConsoleItemDetailData } from './useConsoleItemDetailData';
|
|
13
13
|
|
package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleItemDetailData.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import type { ConsoleRelatedPullRequestView } from '../components/ConsoleItemDetail';
|
|
2
|
+
import type { ConsoleRelatedPullRequestView } from '../components/detail/ConsoleItemDetail';
|
|
3
3
|
import type {
|
|
4
4
|
ConsoleChangedFile,
|
|
5
5
|
ConsoleComment,
|
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
ConsoleIssueState,
|
|
8
8
|
ConsoleListItem,
|
|
9
9
|
ConsoleRelatedPullRequest,
|
|
10
|
-
} from '../types';
|
|
10
|
+
} from '../logic/types';
|
|
11
11
|
import type { ConsoleCaches } from './useConsoleCaches';
|
|
12
12
|
import { useConsoleResource } from './useConsoleResource';
|
|
13
13
|
|
package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOperations.test.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { act, renderHook } from '@testing-library/react';
|
|
2
|
+
import { overlayStorageKey } from '../logic/overlay';
|
|
2
3
|
import {
|
|
3
4
|
consoleListItemsFixture,
|
|
4
5
|
consoleStatusOptionsFixture,
|
|
5
|
-
} from '../fixtures';
|
|
6
|
-
import { overlayStorageKey } from '../overlay';
|
|
6
|
+
} from '../testing/fixtures';
|
|
7
7
|
import { useConsoleOperations } from './useConsoleOperations';
|
|
8
8
|
import { useConsoleOverlay } from './useConsoleOverlay';
|
|
9
9
|
|
package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOperations.ts
CHANGED
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
type ConsoleReviewAction,
|
|
12
12
|
TOTALLY_WRONG_COMMENT_BODY,
|
|
13
13
|
UNNECESSARY_COMMENT_BODY,
|
|
14
|
-
} from '../operations';
|
|
15
|
-
import { overlayKeyForItem } from '../overlay';
|
|
14
|
+
} from '../logic/operations';
|
|
15
|
+
import { overlayKeyForItem } from '../logic/overlay';
|
|
16
16
|
import type {
|
|
17
17
|
ConsoleFieldOption,
|
|
18
18
|
ConsoleListItem,
|
|
19
19
|
ConsoleTabName,
|
|
20
|
-
} from '../types';
|
|
20
|
+
} from '../logic/types';
|
|
21
21
|
import type { ConsoleOverlayState } from './useConsoleOverlay';
|
|
22
22
|
import { useConsoleToken } from './useConsoleToken';
|
|
23
23
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useCallback, useState } from 'react';
|
|
2
|
-
import { overlayStorageKey, writeOverlayEntry } from '../overlay';
|
|
2
|
+
import { overlayStorageKey, writeOverlayEntry } from '../logic/overlay';
|
|
3
3
|
import type {
|
|
4
4
|
ConsoleOverlay,
|
|
5
5
|
ConsoleOverlayEntry,
|
|
6
6
|
ConsoleTabName,
|
|
7
|
-
} from '../types';
|
|
7
|
+
} from '../logic/types';
|
|
8
8
|
|
|
9
9
|
const isOverlayEntry = (value: unknown): value is ConsoleOverlayEntry =>
|
|
10
10
|
value !== null &&
|
|
@@ -4,8 +4,8 @@ import type {
|
|
|
4
4
|
ConsoleListItem,
|
|
5
5
|
ConsoleStoryColorSource,
|
|
6
6
|
ConsoleTabName,
|
|
7
|
-
} from '../types';
|
|
8
|
-
import { CONSOLE_TABS } from '../types';
|
|
7
|
+
} from '../logic/types';
|
|
8
|
+
import { CONSOLE_TABS } from '../logic/types';
|
|
9
9
|
import { useConsoleToken } from './useConsoleToken';
|
|
10
10
|
|
|
11
11
|
export type ConsoleTabSnapshot = {
|
package/src/adapter/entry-points/console/ui/src/features/console/{grouping.ts → logic/grouping.ts}
RENAMED
|
@@ -44,12 +44,12 @@ export type ConsoleListGroupRow = {
|
|
|
44
44
|
count: number;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
export type
|
|
47
|
+
export type ConsoleItemSummary = {
|
|
48
48
|
kind: 'item';
|
|
49
49
|
item: ConsoleListItem;
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
export type ConsoleListRow = ConsoleListGroupRow |
|
|
52
|
+
export type ConsoleListRow = ConsoleListGroupRow | ConsoleItemSummary;
|
|
53
53
|
|
|
54
54
|
export const buildConsoleListRows = (
|
|
55
55
|
items: ConsoleListItem[],
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { fireEvent, render, waitFor } from '@testing-library/react';
|
|
2
|
+
import type { ConsoleCaches } from '../hooks/useConsoleCaches';
|
|
3
|
+
import type { ConsoleOperationsApi } from '../hooks/useConsoleOperations';
|
|
4
|
+
import { ResourceCache } from '../lib/resourceCache';
|
|
2
5
|
import {
|
|
3
6
|
consoleListItemsFixture,
|
|
4
7
|
consoleStatusOptionsFixture,
|
|
5
8
|
consoleStoryColorsFixture,
|
|
6
9
|
consoleStoryOptionsFixture,
|
|
7
|
-
} from '../fixtures';
|
|
8
|
-
import type { ConsoleCaches } from '../hooks/useConsoleCaches';
|
|
9
|
-
import type { ConsoleOperationsApi } from '../hooks/useConsoleOperations';
|
|
10
|
-
import { ResourceCache } from '../lib/resourceCache';
|
|
10
|
+
} from '../testing/fixtures';
|
|
11
11
|
import { ConsoleItemDetailContainer } from './ConsoleItemDetailContainer';
|
|
12
12
|
|
|
13
13
|
jest.mock('../lib/mermaidLoader', () => ({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ConsoleItemDetail } from '../components/ConsoleItemDetail';
|
|
2
|
-
import {
|
|
3
|
-
import { resolveStoryColorEnum } from '../grouping';
|
|
1
|
+
import { ConsoleItemDetail } from '../components/detail/ConsoleItemDetail';
|
|
2
|
+
import { ConsoleOperationMenu } from '../components/operations/ConsoleOperationMenu';
|
|
4
3
|
import type { ConsoleCaches } from '../hooks/useConsoleCaches';
|
|
5
4
|
import { useConsoleItemDetailData } from '../hooks/useConsoleItemDetailData';
|
|
6
5
|
import type { ConsoleOperationsApi } from '../hooks/useConsoleOperations';
|
|
7
|
-
import
|
|
6
|
+
import { resolveStoryColorEnum } from '../logic/grouping';
|
|
7
|
+
import type { ConsoleOperationHandlers } from '../logic/operations';
|
|
8
8
|
import type {
|
|
9
9
|
ConsoleColor,
|
|
10
10
|
ConsoleFieldOption,
|
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
ConsoleOverlayStatus,
|
|
13
13
|
ConsoleStoryColorSource,
|
|
14
14
|
ConsoleTabName,
|
|
15
|
-
} from '../types';
|
|
15
|
+
} from '../logic/types';
|
|
16
16
|
|
|
17
17
|
export type ConsoleItemDetailContainerProps = {
|
|
18
18
|
tab: ConsoleTabName;
|
|
@@ -95,7 +95,7 @@ export const ConsoleItemDetailContainer = ({
|
|
|
95
95
|
relatedPullRequests={detail.relatedPullRequests}
|
|
96
96
|
now={now}
|
|
97
97
|
operationBar={
|
|
98
|
-
<
|
|
98
|
+
<ConsoleOperationMenu
|
|
99
99
|
tab={tab}
|
|
100
100
|
item={item}
|
|
101
101
|
hasPullRequest={hasPullRequest}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { useMemo, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { buildConsoleListRows, resolveItemStory } from '../grouping';
|
|
2
|
+
import { ConsoleProjectSummary } from '../components/layout/ConsoleProjectSummary';
|
|
3
|
+
import { ConsoleTabList } from '../components/layout/ConsoleTabList';
|
|
4
|
+
import { ConsoleItemList } from '../components/list/ConsoleItemList';
|
|
6
5
|
import { useConsoleCaches } from '../hooks/useConsoleCaches';
|
|
7
6
|
import { useConsoleOperations } from '../hooks/useConsoleOperations';
|
|
8
7
|
import { useConsoleOverlay } from '../hooks/useConsoleOverlay';
|
|
9
8
|
import { useConsolePjcode } from '../hooks/useConsolePjcode';
|
|
10
9
|
import { useConsoleTabData } from '../hooks/useConsoleTabData';
|
|
10
|
+
import { buildConsoleListRows, resolveItemStory } from '../logic/grouping';
|
|
11
11
|
import {
|
|
12
12
|
countPendingItems,
|
|
13
13
|
filterPendingItems,
|
|
14
14
|
overlayKeyForItem,
|
|
15
15
|
parseGeneratedAtMs,
|
|
16
|
-
} from '../overlay';
|
|
16
|
+
} from '../logic/overlay';
|
|
17
17
|
import type {
|
|
18
18
|
ConsoleListItem,
|
|
19
19
|
ConsoleOverlayStatus,
|
|
20
20
|
ConsoleTabName,
|
|
21
|
-
} from '../types';
|
|
22
|
-
import { CONSOLE_TABS } from '../types';
|
|
21
|
+
} from '../logic/types';
|
|
22
|
+
import { CONSOLE_TABS } from '../logic/types';
|
|
23
23
|
import { ConsoleItemDetailContainer } from './ConsoleItemDetailContainer';
|
|
24
24
|
|
|
25
25
|
const emptyCounts = (): Record<ConsoleTabName, number> => {
|
|
@@ -106,14 +106,14 @@ export const ConsolePage = () => {
|
|
|
106
106
|
|
|
107
107
|
return (
|
|
108
108
|
<main className="console-app">
|
|
109
|
-
<
|
|
110
|
-
<
|
|
109
|
+
<ConsoleProjectSummary pjcode={pjcode} />
|
|
110
|
+
<ConsoleTabList
|
|
111
111
|
activeTab={activeTab}
|
|
112
112
|
counts={counts}
|
|
113
113
|
onSelectTab={selectTab}
|
|
114
114
|
/>
|
|
115
115
|
{selectedItem === null ? (
|
|
116
|
-
<
|
|
116
|
+
<ConsoleItemList
|
|
117
117
|
rows={rows}
|
|
118
118
|
storyColors={storyColors}
|
|
119
119
|
activeItemId={null}
|
package/src/adapter/entry-points/console/ui/src/features/console/{fixtures.ts → testing/fixtures.ts}
RENAMED
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
ConsoleListItem,
|
|
8
8
|
ConsoleRelatedPullRequest,
|
|
9
9
|
ConsoleStoryColorSource,
|
|
10
|
-
} from '
|
|
10
|
+
} from '../logic/types';
|
|
11
11
|
|
|
12
12
|
export const consoleStatusOptionsFixture: ConsoleFieldOption[] = [
|
|
13
13
|
{ id: 'f75ad846', name: 'Unread', color: 'ORANGE' },
|