github-issue-tower-defence-management 2.2.0 → 2.4.0
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 +14 -0
- package/bin/adapter/entry-points/cli/fleetConfig.js +19 -1
- package/bin/adapter/entry-points/cli/fleetConfig.js.map +1 -1
- package/bin/adapter/entry-points/console/consoleDoneStore.js +0 -2
- package/bin/adapter/entry-points/console/consoleDoneStore.js.map +1 -1
- package/bin/adapter/entry-points/console/consoleTabNames.js +0 -1
- package/bin/adapter/entry-points/console/consoleTabNames.js.map +1 -1
- package/bin/adapter/entry-points/console/ui-dist/assets/index-C5cOzhyn.js +86 -0
- package/bin/adapter/entry-points/console/ui-dist/index.html +1 -1
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +4 -1
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
- package/bin/domain/usecases/console/GenerateConsoleListsUseCase.js +0 -15
- package/bin/domain/usecases/console/GenerateConsoleListsUseCase.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/entry-points/cli/fleetConfig.test.ts +86 -0
- package/src/adapter/entry-points/cli/fleetConfig.ts +38 -0
- package/src/adapter/entry-points/console/consoleDataDelivery.test.ts +15 -9
- package/src/adapter/entry-points/console/consoleDoneStore.ts +0 -2
- package/src/adapter/entry-points/console/consoleItemUrlLookup.test.ts +1 -1
- package/src/adapter/entry-points/console/consoleTabNames.ts +0 -1
- package/src/adapter/entry-points/console/ui/e2e/consoleScenario.spec.ts +7 -115
- package/src/adapter/entry-points/console/ui/e2e/consoleTestHarness.ts +0 -16
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemDetail.stories.tsx +1 -3
- package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsoleTabList.stories.tsx +0 -4
- package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsoleTabList.test.tsx +0 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleOperationMenu.stories.tsx +0 -10
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleOperationMenu.test.tsx +2 -28
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleOperationMenu.tsx +0 -10
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleNavigation.test.ts +18 -14
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOverlay.test.ts +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/logic/actionToast.test.ts +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/logic/grouping.test.ts +7 -7
- package/src/adapter/entry-points/console/ui/src/features/console/logic/overlay.test.ts +10 -8
- package/src/adapter/entry-points/console/ui/src/features/console/logic/tabAdvance.test.ts +9 -11
- package/src/adapter/entry-points/console/ui/src/features/console/logic/types.ts +1 -12
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.test.tsx +0 -12
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.tsx +0 -3
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsolePage.tsx +10 -57
- package/src/adapter/entry-points/console/ui-dist/assets/index-C5cOzhyn.js +86 -0
- package/src/adapter/entry-points/console/ui-dist/index.html +1 -1
- package/src/adapter/entry-points/console/webServer.test.ts +2 -2
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.test.ts +24 -0
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts +10 -1
- package/src/adapter/entry-points/handlers/consoleListsWriter.test.ts +0 -1
- package/src/domain/usecases/console/GenerateConsoleListsUseCase.test.ts +2 -160
- package/src/domain/usecases/console/GenerateConsoleListsUseCase.ts +0 -37
- package/types/adapter/entry-points/cli/fleetConfig.d.ts +7 -0
- package/types/adapter/entry-points/cli/fleetConfig.d.ts.map +1 -1
- package/types/adapter/entry-points/console/consoleDoneStore.d.ts.map +1 -1
- package/types/adapter/entry-points/console/consoleTabNames.d.ts.map +1 -1
- package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts.map +1 -1
- package/types/domain/usecases/console/GenerateConsoleListsUseCase.d.ts +1 -11
- package/types/domain/usecases/console/GenerateConsoleListsUseCase.d.ts.map +1 -1
- package/bin/adapter/entry-points/console/ui-dist/assets/index-BVyeR7xJ.js +0 -86
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleStoryActions.stories.tsx +0 -80
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleStoryActions.test.tsx +0 -39
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleStoryActions.tsx +0 -42
- package/src/adapter/entry-points/console/ui-dist/assets/index-BVyeR7xJ.js +0 -86
|
@@ -26,7 +26,6 @@ type Story = StoryObj<typeof ConsoleTabList>;
|
|
|
26
26
|
const counts: Record<ConsoleTabName, number> = {
|
|
27
27
|
'workflow-blocker': 5,
|
|
28
28
|
prs: 35,
|
|
29
|
-
triage: 132,
|
|
30
29
|
'failed-preparation': 2,
|
|
31
30
|
'todo-by-human': 66,
|
|
32
31
|
'todo-by-agent': 24,
|
|
@@ -46,7 +45,6 @@ export const ZeroCountTabsHidden: Story = {
|
|
|
46
45
|
counts: {
|
|
47
46
|
'workflow-blocker': 0,
|
|
48
47
|
prs: 35,
|
|
49
|
-
triage: 0,
|
|
50
48
|
'failed-preparation': 0,
|
|
51
49
|
'todo-by-human': 18,
|
|
52
50
|
'todo-by-agent': 0,
|
|
@@ -61,7 +59,6 @@ export const ZeroCountActiveTabStaysVisible: Story = {
|
|
|
61
59
|
counts: {
|
|
62
60
|
'workflow-blocker': 0,
|
|
63
61
|
prs: 35,
|
|
64
|
-
triage: 0,
|
|
65
62
|
'failed-preparation': 0,
|
|
66
63
|
'todo-by-human': 18,
|
|
67
64
|
'todo-by-agent': 0,
|
|
@@ -76,7 +73,6 @@ export const AfterAutoAdvanceToNextTab: Story = {
|
|
|
76
73
|
counts: {
|
|
77
74
|
'workflow-blocker': 0,
|
|
78
75
|
prs: 0,
|
|
79
|
-
triage: 0,
|
|
80
76
|
'failed-preparation': 2,
|
|
81
77
|
'todo-by-human': 4,
|
|
82
78
|
'todo-by-agent': 0,
|
|
@@ -3,7 +3,6 @@ import type { ConsoleOperationHandlers } from '../../logic/operations';
|
|
|
3
3
|
import {
|
|
4
4
|
consoleListItemsFixture,
|
|
5
5
|
consoleStatusOptionsFixture,
|
|
6
|
-
consoleStoryOptionsFixture,
|
|
7
6
|
} from '../../testing/fixtures';
|
|
8
7
|
import { ConsoleOperationMenu } from './ConsoleOperationMenu';
|
|
9
8
|
|
|
@@ -23,7 +22,6 @@ const meta: Meta<typeof ConsoleOperationMenu> = {
|
|
|
23
22
|
args: {
|
|
24
23
|
rejectEnabled: false,
|
|
25
24
|
statusOptions: consoleStatusOptionsFixture,
|
|
26
|
-
storyOptions: consoleStoryOptionsFixture,
|
|
27
25
|
handlers,
|
|
28
26
|
},
|
|
29
27
|
};
|
|
@@ -49,14 +47,6 @@ export const PrsTabPullRequestRejectEnabled: Story = {
|
|
|
49
47
|
},
|
|
50
48
|
};
|
|
51
49
|
|
|
52
|
-
export const TriageTabIssueWithStoryGroup: Story = {
|
|
53
|
-
args: {
|
|
54
|
-
tab: 'triage',
|
|
55
|
-
item: consoleListItemsFixture[2],
|
|
56
|
-
hasPullRequest: false,
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
50
|
export const TodoByHumanTabIssue: Story = {
|
|
61
51
|
args: {
|
|
62
52
|
tab: 'todo-by-human',
|
|
@@ -3,7 +3,6 @@ import type { ConsoleOperationHandlers } from '../../logic/operations';
|
|
|
3
3
|
import {
|
|
4
4
|
consoleListItemsFixture,
|
|
5
5
|
consoleStatusOptionsFixture,
|
|
6
|
-
consoleStoryOptionsFixture,
|
|
7
6
|
} from '../../testing/fixtures';
|
|
8
7
|
import { ConsoleOperationMenu } from './ConsoleOperationMenu';
|
|
9
8
|
|
|
@@ -21,7 +20,7 @@ const prItem = consoleListItemsFixture[0];
|
|
|
21
20
|
const issueItem = consoleListItemsFixture[2];
|
|
22
21
|
|
|
23
22
|
describe('ConsoleOperationMenu', () => {
|
|
24
|
-
it('shows the review and close groups for a PR
|
|
23
|
+
it('shows the review and close groups for a PR on the prs tab', () => {
|
|
25
24
|
const { getByText, queryByText } = render(
|
|
26
25
|
<ConsoleOperationMenu
|
|
27
26
|
tab="prs"
|
|
@@ -29,7 +28,6 @@ describe('ConsoleOperationMenu', () => {
|
|
|
29
28
|
hasPullRequest
|
|
30
29
|
rejectEnabled={false}
|
|
31
30
|
statusOptions={consoleStatusOptionsFixture}
|
|
32
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
33
31
|
handlers={handlers}
|
|
34
32
|
/>,
|
|
35
33
|
);
|
|
@@ -42,23 +40,6 @@ describe('ConsoleOperationMenu', () => {
|
|
|
42
40
|
expect(queryByText('TDPM Console port')).toBeNull();
|
|
43
41
|
});
|
|
44
42
|
|
|
45
|
-
it('shows the story group on the triage tab and the close group for an issue', () => {
|
|
46
|
-
const { getByText } = render(
|
|
47
|
-
<ConsoleOperationMenu
|
|
48
|
-
tab="triage"
|
|
49
|
-
item={issueItem}
|
|
50
|
-
hasPullRequest={false}
|
|
51
|
-
rejectEnabled={false}
|
|
52
|
-
statusOptions={consoleStatusOptionsFixture}
|
|
53
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
54
|
-
handlers={handlers}
|
|
55
|
-
/>,
|
|
56
|
-
);
|
|
57
|
-
expect(getByText('Move to Okinawa')).toBeInTheDocument();
|
|
58
|
-
expect(getByText('Close')).toBeInTheDocument();
|
|
59
|
-
expect(getByText('Close as not planned')).toBeInTheDocument();
|
|
60
|
-
});
|
|
61
|
-
|
|
62
43
|
it('shows +1 week and skip on the todo-by-human tab', () => {
|
|
63
44
|
const { getByText } = render(
|
|
64
45
|
<ConsoleOperationMenu
|
|
@@ -67,7 +48,6 @@ describe('ConsoleOperationMenu', () => {
|
|
|
67
48
|
hasPullRequest={false}
|
|
68
49
|
rejectEnabled={false}
|
|
69
50
|
statusOptions={consoleStatusOptionsFixture}
|
|
70
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
71
51
|
handlers={handlers}
|
|
72
52
|
/>,
|
|
73
53
|
);
|
|
@@ -82,7 +62,6 @@ describe('ConsoleOperationMenu', () => {
|
|
|
82
62
|
hasPullRequest={false}
|
|
83
63
|
rejectEnabled={false}
|
|
84
64
|
statusOptions={consoleStatusOptionsFixture}
|
|
85
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
86
65
|
handlers={handlers}
|
|
87
66
|
/>,
|
|
88
67
|
);
|
|
@@ -97,7 +76,6 @@ describe('ConsoleOperationMenu', () => {
|
|
|
97
76
|
hasPullRequest={false}
|
|
98
77
|
rejectEnabled={false}
|
|
99
78
|
statusOptions={consoleStatusOptionsFixture}
|
|
100
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
101
79
|
handlers={handlers}
|
|
102
80
|
/>,
|
|
103
81
|
);
|
|
@@ -105,7 +83,7 @@ describe('ConsoleOperationMenu', () => {
|
|
|
105
83
|
expect(queryByText('Close')).not.toBeNull();
|
|
106
84
|
});
|
|
107
85
|
|
|
108
|
-
it('shows status, close and next-action groups
|
|
86
|
+
it('shows status, close and next-action groups on the workflow-blocker tab', () => {
|
|
109
87
|
const { getByText, queryByText } = render(
|
|
110
88
|
<ConsoleOperationMenu
|
|
111
89
|
tab="workflow-blocker"
|
|
@@ -113,7 +91,6 @@ describe('ConsoleOperationMenu', () => {
|
|
|
113
91
|
hasPullRequest={false}
|
|
114
92
|
rejectEnabled={false}
|
|
115
93
|
statusOptions={consoleStatusOptionsFixture}
|
|
116
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
117
94
|
handlers={handlers}
|
|
118
95
|
/>,
|
|
119
96
|
);
|
|
@@ -133,7 +110,6 @@ describe('ConsoleOperationMenu', () => {
|
|
|
133
110
|
hasPullRequest
|
|
134
111
|
rejectEnabled={false}
|
|
135
112
|
statusOptions={consoleStatusOptionsFixture}
|
|
136
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
137
113
|
handlers={handlers}
|
|
138
114
|
/>,
|
|
139
115
|
);
|
|
@@ -149,7 +125,6 @@ describe('ConsoleOperationMenu', () => {
|
|
|
149
125
|
hasPullRequest
|
|
150
126
|
rejectEnabled={false}
|
|
151
127
|
statusOptions={consoleStatusOptionsFixture}
|
|
152
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
153
128
|
handlers={handlers}
|
|
154
129
|
/>,
|
|
155
130
|
);
|
|
@@ -161,7 +136,6 @@ describe('ConsoleOperationMenu', () => {
|
|
|
161
136
|
hasPullRequest
|
|
162
137
|
rejectEnabled={true}
|
|
163
138
|
statusOptions={consoleStatusOptionsFixture}
|
|
164
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
165
139
|
handlers={handlers}
|
|
166
140
|
/>,
|
|
167
141
|
);
|
|
@@ -12,7 +12,6 @@ import { ConsoleNextActionDateActions } from './ConsoleNextActionDateActions';
|
|
|
12
12
|
import { ConsoleOkAndAwaitingWorkspaceActions } from './ConsoleOkAndAwaitingWorkspaceActions';
|
|
13
13
|
import { ConsolePullRequestReviewActions } from './ConsolePullRequestReviewActions';
|
|
14
14
|
import { ConsoleStatusActions } from './ConsoleStatusActions';
|
|
15
|
-
import { ConsoleStoryActions } from './ConsoleStoryActions';
|
|
16
15
|
|
|
17
16
|
export type ConsoleOperationBarProps = {
|
|
18
17
|
tab: ConsoleTabName;
|
|
@@ -20,7 +19,6 @@ export type ConsoleOperationBarProps = {
|
|
|
20
19
|
hasPullRequest: boolean;
|
|
21
20
|
rejectEnabled: boolean;
|
|
22
21
|
statusOptions: ConsoleFieldOption[];
|
|
23
|
-
storyOptions: ConsoleFieldOption[];
|
|
24
22
|
handlers: ConsoleOperationHandlers;
|
|
25
23
|
};
|
|
26
24
|
|
|
@@ -29,10 +27,8 @@ export const ConsoleOperationMenu = ({
|
|
|
29
27
|
hasPullRequest,
|
|
30
28
|
rejectEnabled,
|
|
31
29
|
statusOptions,
|
|
32
|
-
storyOptions,
|
|
33
30
|
handlers,
|
|
34
31
|
}: ConsoleOperationBarProps) => {
|
|
35
|
-
const showStory = tab === 'triage';
|
|
36
32
|
return (
|
|
37
33
|
<div className="console-operation-bar">
|
|
38
34
|
<ConsoleOkAndAwaitingWorkspaceActions
|
|
@@ -49,12 +45,6 @@ export const ConsoleOperationMenu = ({
|
|
|
49
45
|
isManualTriage={isManualTriageTab(tab)}
|
|
50
46
|
onSetNextActionDate={handlers.onSetNextActionDate}
|
|
51
47
|
/>
|
|
52
|
-
{showStory && (
|
|
53
|
-
<ConsoleStoryActions
|
|
54
|
-
storyOptions={storyOptions}
|
|
55
|
-
onSetStory={handlers.onSetStory}
|
|
56
|
-
/>
|
|
57
|
-
)}
|
|
58
48
|
<ConsoleStatusActions
|
|
59
49
|
statusOptions={statusOptions}
|
|
60
50
|
onSetStatus={handlers.onSetStatus}
|
package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleNavigation.test.ts
CHANGED
|
@@ -11,7 +11,6 @@ const counts = (
|
|
|
11
11
|
): Record<ConsoleTabName, number> => ({
|
|
12
12
|
'workflow-blocker': 0,
|
|
13
13
|
prs: 0,
|
|
14
|
-
triage: 0,
|
|
15
14
|
'failed-preparation': 0,
|
|
16
15
|
'todo-by-human': 0,
|
|
17
16
|
'todo-by-agent': 0,
|
|
@@ -21,13 +20,17 @@ const counts = (
|
|
|
21
20
|
|
|
22
21
|
describe('parseTabFromPath', () => {
|
|
23
22
|
it('reads a known tab from the project path', () => {
|
|
24
|
-
expect(parseTabFromPath('/projects/acme/
|
|
23
|
+
expect(parseTabFromPath('/projects/acme/prs')).toBe('prs');
|
|
25
24
|
});
|
|
26
25
|
|
|
27
26
|
it('returns null for an unknown tab segment', () => {
|
|
28
27
|
expect(parseTabFromPath('/projects/acme/unknown')).toBeNull();
|
|
29
28
|
});
|
|
30
29
|
|
|
30
|
+
it('returns null for the removed triage segment', () => {
|
|
31
|
+
expect(parseTabFromPath('/projects/acme/triage')).toBeNull();
|
|
32
|
+
});
|
|
33
|
+
|
|
31
34
|
it('returns null when there is no tab segment', () => {
|
|
32
35
|
expect(parseTabFromPath('/projects/acme')).toBeNull();
|
|
33
36
|
});
|
|
@@ -56,16 +59,18 @@ describe('useConsoleNavigation', () => {
|
|
|
56
59
|
|
|
57
60
|
it('builds a project tab href', () => {
|
|
58
61
|
const { result } = renderHook(() => useConsoleNavigation('acme', counts()));
|
|
59
|
-
expect(result.current.tabHref('
|
|
62
|
+
expect(result.current.tabHref('todo-by-human')).toBe(
|
|
63
|
+
'/projects/acme/todo-by-human',
|
|
64
|
+
);
|
|
60
65
|
});
|
|
61
66
|
|
|
62
67
|
it('selects a tab and updates the path', () => {
|
|
63
68
|
const { result } = renderHook(() => useConsoleNavigation('acme', counts()));
|
|
64
69
|
act(() => {
|
|
65
|
-
result.current.selectTab('
|
|
70
|
+
result.current.selectTab('todo-by-human');
|
|
66
71
|
});
|
|
67
|
-
expect(result.current.activeTab).toBe('
|
|
68
|
-
expect(window.location.pathname).toBe('/projects/acme/
|
|
72
|
+
expect(result.current.activeTab).toBe('todo-by-human');
|
|
73
|
+
expect(window.location.pathname).toBe('/projects/acme/todo-by-human');
|
|
69
74
|
});
|
|
70
75
|
|
|
71
76
|
it('opens an item and reflects it in the hash', () => {
|
|
@@ -101,7 +106,6 @@ describe('useConsoleNavigation default tab without a tab segment', () => {
|
|
|
101
106
|
counts({
|
|
102
107
|
'workflow-blocker': 3,
|
|
103
108
|
prs: 5,
|
|
104
|
-
triage: 2,
|
|
105
109
|
'failed-preparation': 1,
|
|
106
110
|
'todo-by-human': 4,
|
|
107
111
|
}),
|
|
@@ -114,10 +118,10 @@ describe('useConsoleNavigation default tab without a tab segment', () => {
|
|
|
114
118
|
const { result } = renderHook(() =>
|
|
115
119
|
useConsoleNavigation(
|
|
116
120
|
'acme',
|
|
117
|
-
counts({ 'workflow-blocker': 0, prs: 0,
|
|
121
|
+
counts({ 'workflow-blocker': 0, prs: 0, 'failed-preparation': 8 }),
|
|
118
122
|
),
|
|
119
123
|
);
|
|
120
|
-
expect(result.current.activeTab).toBe('
|
|
124
|
+
expect(result.current.activeTab).toBe('failed-preparation');
|
|
121
125
|
});
|
|
122
126
|
|
|
123
127
|
it('falls back to the first tab when every tab is empty', () => {
|
|
@@ -132,15 +136,15 @@ describe('useConsoleNavigation default tab without a tab segment', () => {
|
|
|
132
136
|
{ initialProps: { tabCounts: counts() } },
|
|
133
137
|
);
|
|
134
138
|
expect(result.current.activeTab).toBe('workflow-blocker');
|
|
135
|
-
rerender({ tabCounts: counts({
|
|
136
|
-
expect(result.current.activeTab).toBe('
|
|
139
|
+
rerender({ tabCounts: counts({ 'failed-preparation': 6 }) });
|
|
140
|
+
expect(result.current.activeTab).toBe('failed-preparation');
|
|
137
141
|
});
|
|
138
142
|
|
|
139
143
|
it('keeps the tab from the path even when counts are present', () => {
|
|
140
|
-
window.history.replaceState({}, '', '/projects/acme/
|
|
144
|
+
window.history.replaceState({}, '', '/projects/acme/todo-by-human?k=token');
|
|
141
145
|
const { result } = renderHook(() =>
|
|
142
|
-
useConsoleNavigation('acme', counts({
|
|
146
|
+
useConsoleNavigation('acme', counts({ 'todo-by-human': 6 })),
|
|
143
147
|
);
|
|
144
|
-
expect(result.current.activeTab).toBe('
|
|
148
|
+
expect(result.current.activeTab).toBe('todo-by-human');
|
|
145
149
|
});
|
|
146
150
|
});
|
package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOverlay.test.ts
CHANGED
|
@@ -19,10 +19,10 @@ describe('useConsoleOverlay', () => {
|
|
|
19
19
|
it('patches and persists overlay entries with timestamp and mode', () => {
|
|
20
20
|
const { result } = renderHook(() => useConsoleOverlay('acme'));
|
|
21
21
|
act(() => {
|
|
22
|
-
result.current.patchOverlay('PVTI_2', { done: true }, '
|
|
22
|
+
result.current.patchOverlay('PVTI_2', { done: true }, 'todo-by-human');
|
|
23
23
|
});
|
|
24
24
|
expect(result.current.overlay.PVTI_2?.done).toBe(true);
|
|
25
|
-
expect(result.current.overlay.PVTI_2?.mode).toBe('
|
|
25
|
+
expect(result.current.overlay.PVTI_2?.mode).toBe('todo-by-human');
|
|
26
26
|
const stored = JSON.parse(
|
|
27
27
|
localStorage.getItem(overlayStorageKey('acme')) ?? '{}',
|
|
28
28
|
);
|
|
@@ -47,7 +47,7 @@ describe('resolveItemStory', () => {
|
|
|
47
47
|
const overlay: ConsoleOverlay = {
|
|
48
48
|
PVTI_1: {
|
|
49
49
|
ts: 1,
|
|
50
|
-
mode: '
|
|
50
|
+
mode: 'todo-by-human',
|
|
51
51
|
story: { name: 'Overlay', color: 'BLUE' },
|
|
52
52
|
},
|
|
53
53
|
};
|
|
@@ -73,7 +73,7 @@ describe('resolveItemStory', () => {
|
|
|
73
73
|
const overlay: ConsoleOverlay = {
|
|
74
74
|
PVTI_4: {
|
|
75
75
|
ts: snapshotTs,
|
|
76
|
-
mode: '
|
|
76
|
+
mode: 'todo-by-human',
|
|
77
77
|
story: { name: 'FreshOverlay', color: 'GREEN' },
|
|
78
78
|
},
|
|
79
79
|
};
|
|
@@ -92,7 +92,7 @@ describe('resolveItemStory', () => {
|
|
|
92
92
|
const overlay: ConsoleOverlay = {
|
|
93
93
|
PVTI_5: {
|
|
94
94
|
ts: overlayTs,
|
|
95
|
-
mode: '
|
|
95
|
+
mode: 'todo-by-human',
|
|
96
96
|
story: { name: 'StaleOverlay', color: 'RED' },
|
|
97
97
|
},
|
|
98
98
|
};
|
|
@@ -109,7 +109,7 @@ describe('resolveItemStory', () => {
|
|
|
109
109
|
const overlay: ConsoleOverlay = {
|
|
110
110
|
PVTI_6: {
|
|
111
111
|
ts: 1,
|
|
112
|
-
mode: '
|
|
112
|
+
mode: 'todo-by-human',
|
|
113
113
|
story: { name: 'OverlayStory', color: 'BLUE' },
|
|
114
114
|
},
|
|
115
115
|
};
|
|
@@ -122,7 +122,7 @@ describe('resolveItemStory', () => {
|
|
|
122
122
|
const overlay: ConsoleOverlay = {
|
|
123
123
|
PVTI_7: {
|
|
124
124
|
ts: 1,
|
|
125
|
-
mode: '
|
|
125
|
+
mode: 'todo-by-human',
|
|
126
126
|
story: { name: 'OverlayStory', color: 'BLUE' },
|
|
127
127
|
},
|
|
128
128
|
};
|
|
@@ -166,7 +166,7 @@ describe('buildConsoleListRows', () => {
|
|
|
166
166
|
const overlay: ConsoleOverlay = {
|
|
167
167
|
PVTI_1: {
|
|
168
168
|
ts: 1,
|
|
169
|
-
mode: '
|
|
169
|
+
mode: 'todo-by-human',
|
|
170
170
|
story: { name: 'Alpha', color: 'BLUE' },
|
|
171
171
|
},
|
|
172
172
|
};
|
|
@@ -212,7 +212,7 @@ describe('buildConsoleListRows', () => {
|
|
|
212
212
|
const overlay: ConsoleOverlay = {
|
|
213
213
|
PVTI_1: {
|
|
214
214
|
ts: overlayTs,
|
|
215
|
-
mode: '
|
|
215
|
+
mode: 'todo-by-human',
|
|
216
216
|
story: { name: 'StaleStory', color: 'RED' },
|
|
217
217
|
},
|
|
218
218
|
};
|
|
@@ -70,9 +70,9 @@ describe('isOverlayEntryActed', () => {
|
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
it('treats a done entry as acted regardless of the mode it was written in', () => {
|
|
73
|
-
expect(
|
|
74
|
-
true,
|
|
75
|
-
);
|
|
73
|
+
expect(
|
|
74
|
+
isOverlayEntryActed({ ts: 100, mode: 'todo-by-human', done: true }),
|
|
75
|
+
).toBe(true);
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
|
|
@@ -86,7 +86,7 @@ describe('counts driven to zero do not revive on tab switch', () => {
|
|
|
86
86
|
|
|
87
87
|
it('does not subtract a done item from a tab other than the one it was processed in', () => {
|
|
88
88
|
const overlay: ConsoleOverlay = {
|
|
89
|
-
PVTI_1: { ts: 100, mode: '
|
|
89
|
+
PVTI_1: { ts: 100, mode: 'todo-by-human', done: true },
|
|
90
90
|
};
|
|
91
91
|
expect(countPendingItems([item(1)], overlay, 'prs')).toBe(1);
|
|
92
92
|
});
|
|
@@ -102,8 +102,10 @@ describe('counts driven to zero do not revive on tab switch', () => {
|
|
|
102
102
|
const overlay: ConsoleOverlay = {
|
|
103
103
|
PVTI_1: { ts: 100, mode: 'prs', done: true },
|
|
104
104
|
};
|
|
105
|
-
expect(countPendingItems([item(1)], overlay, '
|
|
106
|
-
expect(filterPendingItems([item(1)], overlay, '
|
|
105
|
+
expect(countPendingItems([item(1)], overlay, 'todo-by-human')).toBe(1);
|
|
106
|
+
expect(filterPendingItems([item(1)], overlay, 'todo-by-human')).toEqual([
|
|
107
|
+
item(1),
|
|
108
|
+
]);
|
|
107
109
|
});
|
|
108
110
|
|
|
109
111
|
it('counts an item that has no done entry', () => {
|
|
@@ -237,14 +239,14 @@ describe('writeOverlayEntry', () => {
|
|
|
237
239
|
overlay,
|
|
238
240
|
'PVTI_1',
|
|
239
241
|
{ story: { name: 'New Story', color: 'GREEN' } },
|
|
240
|
-
'
|
|
242
|
+
'todo-by-human',
|
|
241
243
|
999,
|
|
242
244
|
);
|
|
243
245
|
expect(next.PVTI_1).toEqual({
|
|
244
246
|
done: true,
|
|
245
247
|
story: { name: 'New Story', color: 'GREEN' },
|
|
246
248
|
ts: 999,
|
|
247
|
-
mode: '
|
|
249
|
+
mode: 'todo-by-human',
|
|
248
250
|
});
|
|
249
251
|
});
|
|
250
252
|
});
|
|
@@ -9,7 +9,6 @@ const counts = (
|
|
|
9
9
|
): Record<ConsoleTabName, number> => ({
|
|
10
10
|
'workflow-blocker': 0,
|
|
11
11
|
prs: 0,
|
|
12
|
-
triage: 0,
|
|
13
12
|
'failed-preparation': 0,
|
|
14
13
|
'todo-by-human': 0,
|
|
15
14
|
'todo-by-agent': 0,
|
|
@@ -19,16 +18,16 @@ const counts = (
|
|
|
19
18
|
|
|
20
19
|
describe('findNextNonEmptyTabToRight', () => {
|
|
21
20
|
it('returns the first non-empty tab to the right of the active tab', () => {
|
|
22
|
-
expect(
|
|
23
|
-
'
|
|
24
|
-
);
|
|
21
|
+
expect(
|
|
22
|
+
findNextNonEmptyTabToRight('prs', counts({ 'failed-preparation': 7 })),
|
|
23
|
+
).toBe('failed-preparation');
|
|
25
24
|
});
|
|
26
25
|
|
|
27
26
|
it('skips empty tabs and returns the next non-empty tab further right', () => {
|
|
28
27
|
expect(
|
|
29
28
|
findNextNonEmptyTabToRight(
|
|
30
29
|
'prs',
|
|
31
|
-
counts({
|
|
30
|
+
counts({ 'failed-preparation': 0, 'todo-by-human': 4 }),
|
|
32
31
|
),
|
|
33
32
|
).toBe('todo-by-human');
|
|
34
33
|
});
|
|
@@ -43,9 +42,9 @@ describe('findNextNonEmptyTabToRight', () => {
|
|
|
43
42
|
});
|
|
44
43
|
|
|
45
44
|
it('returns the immediately adjacent tab when it is non-empty', () => {
|
|
46
|
-
expect(
|
|
47
|
-
'
|
|
48
|
-
);
|
|
45
|
+
expect(
|
|
46
|
+
findNextNonEmptyTabToRight('prs', counts({ 'failed-preparation': 12 })),
|
|
47
|
+
).toBe('failed-preparation');
|
|
49
48
|
});
|
|
50
49
|
|
|
51
50
|
it('returns null when no tab to the right has any items', () => {
|
|
@@ -68,7 +67,6 @@ describe('resolveDefaultActiveTab', () => {
|
|
|
68
67
|
counts({
|
|
69
68
|
'workflow-blocker': 3,
|
|
70
69
|
prs: 5,
|
|
71
|
-
triage: 2,
|
|
72
70
|
'failed-preparation': 1,
|
|
73
71
|
'todo-by-human': 4,
|
|
74
72
|
}),
|
|
@@ -79,9 +77,9 @@ describe('resolveDefaultActiveTab', () => {
|
|
|
79
77
|
it('skips empty left-most tabs and returns the first non-empty tab', () => {
|
|
80
78
|
expect(
|
|
81
79
|
resolveDefaultActiveTab(
|
|
82
|
-
counts({ 'workflow-blocker': 0, prs: 0,
|
|
80
|
+
counts({ 'workflow-blocker': 0, prs: 0, 'failed-preparation': 8 }),
|
|
83
81
|
),
|
|
84
|
-
).toBe('
|
|
82
|
+
).toBe('failed-preparation');
|
|
85
83
|
});
|
|
86
84
|
|
|
87
85
|
it('falls back to the first tab when every tab is empty', () => {
|
|
@@ -43,16 +43,7 @@ export type ConsoleStatusTab = {
|
|
|
43
43
|
items: ConsoleListItem[];
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
export type
|
|
47
|
-
pjcode: string;
|
|
48
|
-
generatedAt: string;
|
|
49
|
-
storyOptions: ConsoleFieldOption[];
|
|
50
|
-
storyOrder: string[];
|
|
51
|
-
storyColors: Record<string, ConsoleColor>;
|
|
52
|
-
items: ConsoleListItem[];
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export type ConsoleTabData = ConsoleStatusTab | ConsoleTriageTab;
|
|
46
|
+
export type ConsoleTabData = ConsoleStatusTab;
|
|
56
47
|
|
|
57
48
|
export type ConsoleStoryColorSource = Record<
|
|
58
49
|
string,
|
|
@@ -144,7 +135,6 @@ export type ConsoleOverlay = Record<string, ConsoleOverlayEntry>;
|
|
|
144
135
|
export type ConsoleTabName =
|
|
145
136
|
| 'workflow-blocker'
|
|
146
137
|
| 'prs'
|
|
147
|
-
| 'triage'
|
|
148
138
|
| 'failed-preparation'
|
|
149
139
|
| 'todo-by-human'
|
|
150
140
|
| 'todo-by-agent'
|
|
@@ -166,7 +156,6 @@ export type ConsoleTab = {
|
|
|
166
156
|
export const CONSOLE_TABS: ConsoleTab[] = [
|
|
167
157
|
{ name: 'workflow-blocker', label: 'Workflow Blocker' },
|
|
168
158
|
{ name: 'prs', label: 'Awaiting Quality Check' },
|
|
169
|
-
{ name: 'triage', label: 'Triage' },
|
|
170
159
|
{ name: 'failed-preparation', label: 'Failed Preparation' },
|
|
171
160
|
{ name: 'todo-by-human', label: 'Todo by human' },
|
|
172
161
|
{ name: 'todo-by-agent', label: 'Todo by agent' },
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
consoleRelatedPullRequestsFixture,
|
|
14
14
|
consoleStatusOptionsFixture,
|
|
15
15
|
consoleStoryColorsFixture,
|
|
16
|
-
consoleStoryOptionsFixture,
|
|
17
16
|
} from '../testing/fixtures';
|
|
18
17
|
import { ConsoleItemDetailContainer } from './ConsoleItemDetailContainer';
|
|
19
18
|
|
|
@@ -110,7 +109,6 @@ describe('ConsoleItemDetailContainer', () => {
|
|
|
110
109
|
caches={buildCaches()}
|
|
111
110
|
operations={operations}
|
|
112
111
|
statusOptions={consoleStatusOptionsFixture}
|
|
113
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
114
112
|
storyColors={consoleStoryColorsFixture}
|
|
115
113
|
storyName="TDPM Console port"
|
|
116
114
|
overlayStatus={null}
|
|
@@ -144,7 +142,6 @@ describe('ConsoleItemDetailContainer', () => {
|
|
|
144
142
|
caches={buildCaches()}
|
|
145
143
|
operations={buildOperations()}
|
|
146
144
|
statusOptions={consoleStatusOptionsFixture}
|
|
147
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
148
145
|
storyColors={consoleStoryColorsFixture}
|
|
149
146
|
storyName="TDPM Console port"
|
|
150
147
|
overlayStatus={null}
|
|
@@ -170,7 +167,6 @@ describe('ConsoleItemDetailContainer', () => {
|
|
|
170
167
|
caches={buildCaches()}
|
|
171
168
|
operations={operations}
|
|
172
169
|
statusOptions={consoleStatusOptionsFixture}
|
|
173
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
174
170
|
storyColors={consoleStoryColorsFixture}
|
|
175
171
|
storyName="TDPM Console port"
|
|
176
172
|
overlayStatus={null}
|
|
@@ -212,7 +208,6 @@ describe('ConsoleItemDetailContainer', () => {
|
|
|
212
208
|
caches={buildCaches()}
|
|
213
209
|
operations={operations}
|
|
214
210
|
statusOptions={consoleStatusOptionsFixture}
|
|
215
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
216
211
|
storyColors={consoleStoryColorsFixture}
|
|
217
212
|
storyName="TDPM Console port"
|
|
218
213
|
overlayStatus={null}
|
|
@@ -260,7 +255,6 @@ describe('ConsoleItemDetailContainer', () => {
|
|
|
260
255
|
caches={buildCaches()}
|
|
261
256
|
operations={operations}
|
|
262
257
|
statusOptions={consoleStatusOptionsFixture}
|
|
263
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
264
258
|
storyColors={consoleStoryColorsFixture}
|
|
265
259
|
storyName="TDPM Console port"
|
|
266
260
|
overlayStatus={null}
|
|
@@ -311,7 +305,6 @@ describe('ConsoleItemDetailContainer', () => {
|
|
|
311
305
|
caches={buildCaches({ relatedPrsNeverResolve: true })}
|
|
312
306
|
operations={operations}
|
|
313
307
|
statusOptions={consoleStatusOptionsFixture}
|
|
314
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
315
308
|
storyColors={consoleStoryColorsFixture}
|
|
316
309
|
storyName="TDPM Console port"
|
|
317
310
|
overlayStatus={null}
|
|
@@ -348,7 +341,6 @@ describe('ConsoleItemDetailContainer', () => {
|
|
|
348
341
|
caches={buildCaches({ prFiles: consoleChangedFilesFixture })}
|
|
349
342
|
operations={operations}
|
|
350
343
|
statusOptions={consoleStatusOptionsFixture}
|
|
351
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
352
344
|
storyColors={consoleStoryColorsFixture}
|
|
353
345
|
storyName="TDPM Console port"
|
|
354
346
|
overlayStatus={null}
|
|
@@ -414,7 +406,6 @@ describe('ConsoleItemDetailContainer', () => {
|
|
|
414
406
|
caches={buildCaches()}
|
|
415
407
|
operations={buildOperations()}
|
|
416
408
|
statusOptions={consoleStatusOptionsFixture}
|
|
417
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
418
409
|
storyColors={consoleStoryColorsFixture}
|
|
419
410
|
storyName="TDPM Console port"
|
|
420
411
|
overlayStatus={null}
|
|
@@ -437,7 +428,6 @@ describe('ConsoleItemDetailContainer', () => {
|
|
|
437
428
|
caches={buildCaches()}
|
|
438
429
|
operations={buildOperations()}
|
|
439
430
|
statusOptions={statusOptionsWithoutAwaitingWorkspace}
|
|
440
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
441
431
|
storyColors={consoleStoryColorsFixture}
|
|
442
432
|
storyName="TDPM Console port"
|
|
443
433
|
overlayStatus={null}
|
|
@@ -458,7 +448,6 @@ describe('ConsoleItemDetailContainer', () => {
|
|
|
458
448
|
caches={buildCaches()}
|
|
459
449
|
operations={operations}
|
|
460
450
|
statusOptions={consoleStatusOptionsFixture}
|
|
461
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
462
451
|
storyColors={consoleStoryColorsFixture}
|
|
463
452
|
storyName="TDPM Console port"
|
|
464
453
|
overlayStatus={null}
|
|
@@ -508,7 +497,6 @@ describe('ConsoleItemDetailContainer', () => {
|
|
|
508
497
|
})}
|
|
509
498
|
operations={operations}
|
|
510
499
|
statusOptions={consoleStatusOptionsFixture}
|
|
511
|
-
storyOptions={consoleStoryOptionsFixture}
|
|
512
500
|
storyColors={consoleStoryColorsFixture}
|
|
513
501
|
storyName="TDPM Console port"
|
|
514
502
|
overlayStatus={null}
|
|
@@ -38,7 +38,6 @@ export type ConsoleItemDetailContainerProps = {
|
|
|
38
38
|
caches: ConsoleCaches;
|
|
39
39
|
operations: ConsoleOperationsApi;
|
|
40
40
|
statusOptions: ConsoleFieldOption[];
|
|
41
|
-
storyOptions: ConsoleFieldOption[];
|
|
42
41
|
storyColors: ConsoleStoryColorSource;
|
|
43
42
|
storyName: string | null;
|
|
44
43
|
overlayStatus: ConsoleOverlayStatus | null;
|
|
@@ -54,7 +53,6 @@ export const ConsoleItemDetailContainer = ({
|
|
|
54
53
|
caches,
|
|
55
54
|
operations,
|
|
56
55
|
statusOptions,
|
|
57
|
-
storyOptions,
|
|
58
56
|
storyColors,
|
|
59
57
|
storyName,
|
|
60
58
|
overlayStatus,
|
|
@@ -231,7 +229,6 @@ export const ConsoleItemDetailContainer = ({
|
|
|
231
229
|
hasPullRequest={hasPullRequest}
|
|
232
230
|
rejectEnabled={pendingReviewComments.length > 0}
|
|
233
231
|
statusOptions={statusOptions}
|
|
234
|
-
storyOptions={storyOptions}
|
|
235
232
|
handlers={handlers}
|
|
236
233
|
/>
|
|
237
234
|
}
|