github-issue-tower-defence-management 1.102.0 → 1.103.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 +14 -0
- package/README.md +1 -0
- package/bin/adapter/entry-points/console/consoleOperationApi.js +37 -1
- package/bin/adapter/entry-points/console/consoleOperationApi.js.map +1 -1
- package/bin/adapter/entry-points/console/consoleServer.js +2 -0
- package/bin/adapter/entry-points/console/consoleServer.js.map +1 -1
- package/bin/adapter/entry-points/console/ui-dist/assets/index-BpccigBS.js +101 -0
- package/bin/adapter/entry-points/console/ui-dist/assets/index-CO-f_j4f.css +1 -0
- package/bin/adapter/entry-points/console/ui-dist/index.html +2 -2
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js +71 -0
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/entry-points/console/consoleOperationApi.test.ts +96 -0
- package/src/adapter/entry-points/console/consoleOperationApi.ts +55 -1
- package/src/adapter/entry-points/console/consoleServer.ts +3 -0
- package/src/adapter/entry-points/console/ui/e2e/consoleTestHarness.ts +1 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleChangedFileList.tsx +25 -4
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleFileDiff.stories.tsx +9 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleFileDiff.test.tsx +88 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleFileDiff.tsx +197 -12
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemDetail.tsx +4 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleErrorToast.stories.tsx +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleUndoToast.test.tsx +4 -4
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOperations.test.ts +23 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOperations.ts +33 -0
- package/src/adapter/entry-points/console/ui/src/features/console/lib/consoleApi.test.ts +50 -1
- package/src/adapter/entry-points/console/ui/src/features/console/lib/consoleApi.ts +27 -0
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.test.tsx +1 -0
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.tsx +11 -0
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsolePage.test.tsx +55 -0
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsolePage.tsx +1 -1
- package/src/adapter/entry-points/console/ui/src/index.css +104 -0
- package/src/adapter/entry-points/console/ui-dist/assets/index-BpccigBS.js +101 -0
- package/src/adapter/entry-points/console/ui-dist/assets/index-CO-f_j4f.css +1 -0
- package/src/adapter/entry-points/console/ui-dist/index.html +2 -2
- package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.test.ts +106 -0
- package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.ts +108 -0
- package/src/domain/usecases/adapter-interfaces/IssueRepository.ts +9 -0
- package/types/adapter/entry-points/console/consoleOperationApi.d.ts +1 -0
- package/types/adapter/entry-points/console/consoleOperationApi.d.ts.map +1 -1
- package/types/adapter/entry-points/console/consoleServer.d.ts.map +1 -1
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts +4 -1
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts.map +1 -1
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts +2 -0
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts.map +1 -1
- package/bin/adapter/entry-points/console/ui-dist/assets/index-CFGeqgfE.js +0 -101
- package/bin/adapter/entry-points/console/ui-dist/assets/index-ES6SLB1Y.css +0 -1
- package/src/adapter/entry-points/console/ui-dist/assets/index-CFGeqgfE.js +0 -101
- package/src/adapter/entry-points/console/ui-dist/assets/index-ES6SLB1Y.css +0 -1
|
@@ -254,6 +254,61 @@ describe('ConsolePage', () => {
|
|
|
254
254
|
expect(queryByText('TDPM Console')).toBeNull();
|
|
255
255
|
expect(queryByText('project: umino')).toBeNull();
|
|
256
256
|
});
|
|
257
|
+
|
|
258
|
+
it('renders the failure toast in English without any Japanese characters', async () => {
|
|
259
|
+
const fetchMock = jest.fn(
|
|
260
|
+
async (url: string, init?: { method?: string }) => {
|
|
261
|
+
const listMatch = url.match(/\/projects\/[^/]+\/([^/]+)\/list\.json/);
|
|
262
|
+
if (listMatch !== null) {
|
|
263
|
+
return {
|
|
264
|
+
ok: true,
|
|
265
|
+
status: 200,
|
|
266
|
+
json: async () => listPayload(listMatch[1]),
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
if (init?.method === 'POST') {
|
|
270
|
+
return {
|
|
271
|
+
ok: false,
|
|
272
|
+
status: 422,
|
|
273
|
+
text: async () =>
|
|
274
|
+
JSON.stringify({ error: 'HTTP 422 Review cannot be requested' }),
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
return {
|
|
278
|
+
ok: true,
|
|
279
|
+
status: 200,
|
|
280
|
+
json: async () => ({ body: '# body' }),
|
|
281
|
+
};
|
|
282
|
+
},
|
|
283
|
+
);
|
|
284
|
+
global.fetch = fetchMock as unknown as typeof fetch;
|
|
285
|
+
|
|
286
|
+
jest.useFakeTimers();
|
|
287
|
+
try {
|
|
288
|
+
const { getByText, findByText } = render(<ConsolePage />);
|
|
289
|
+
await waitFor(() => {
|
|
290
|
+
expect(getByText('Add serveConsole subcommand')).toBeInTheDocument();
|
|
291
|
+
});
|
|
292
|
+
fireEvent.click(getByText('Add serveConsole subcommand'));
|
|
293
|
+
fireEvent.click(await findByText('Approve'));
|
|
294
|
+
|
|
295
|
+
await act(async () => {
|
|
296
|
+
jest.advanceTimersByTime(5100);
|
|
297
|
+
await Promise.resolve();
|
|
298
|
+
await Promise.resolve();
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
const toast = getByText(/^Operation failed:/);
|
|
302
|
+
expect(toast.textContent).toBe(
|
|
303
|
+
'Operation failed: HTTP 422 Review cannot be requested',
|
|
304
|
+
);
|
|
305
|
+
expect(toast.textContent).not.toMatch(
|
|
306
|
+
/[\u{3040}-\u{309F}\u{30A0}-\u{30FF}\u{4E00}-\u{9FFF}]/u,
|
|
307
|
+
);
|
|
308
|
+
} finally {
|
|
309
|
+
jest.useRealTimers();
|
|
310
|
+
}
|
|
311
|
+
});
|
|
257
312
|
});
|
|
258
313
|
|
|
259
314
|
const twoItemPrPayload = () => ({
|
|
@@ -208,7 +208,7 @@ export const ConsolePage = () => {
|
|
|
208
208
|
)}
|
|
209
209
|
{actionQueue.error !== null && (
|
|
210
210
|
<ConsoleErrorToast
|
|
211
|
-
message={
|
|
211
|
+
message={`Operation failed: ${actionQueue.error.reason}`}
|
|
212
212
|
onDismiss={actionQueue.dismissError}
|
|
213
213
|
/>
|
|
214
214
|
)}
|
|
@@ -826,6 +826,110 @@ body {
|
|
|
826
826
|
font-size: 12px;
|
|
827
827
|
}
|
|
828
828
|
|
|
829
|
+
.console-diff-comment-cell {
|
|
830
|
+
width: 1%;
|
|
831
|
+
padding: 0 2px;
|
|
832
|
+
text-align: center;
|
|
833
|
+
user-select: none;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
.console-diff-comment-button {
|
|
837
|
+
width: 18px;
|
|
838
|
+
height: 18px;
|
|
839
|
+
padding: 0;
|
|
840
|
+
line-height: 16px;
|
|
841
|
+
border: 1px solid transparent;
|
|
842
|
+
border-radius: 4px;
|
|
843
|
+
background: transparent;
|
|
844
|
+
color: #6e7681;
|
|
845
|
+
font-size: 14px;
|
|
846
|
+
cursor: pointer;
|
|
847
|
+
opacity: 0;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
.console-diff-row:hover .console-diff-comment-button,
|
|
851
|
+
.console-diff-comment-button[aria-expanded="true"] {
|
|
852
|
+
opacity: 1;
|
|
853
|
+
border-color: #2f81f7;
|
|
854
|
+
background: #1f6feb;
|
|
855
|
+
color: #ffffff;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
.console-diff-composer-row td {
|
|
859
|
+
padding: 6px 10px;
|
|
860
|
+
background: #0d1117;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
.console-diff-composer {
|
|
864
|
+
display: flex;
|
|
865
|
+
flex-direction: column;
|
|
866
|
+
gap: 6px;
|
|
867
|
+
border: 1px solid #30363d;
|
|
868
|
+
border-radius: 6px;
|
|
869
|
+
padding: 8px;
|
|
870
|
+
background: #161b22;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.console-diff-composer-anchor {
|
|
874
|
+
font-size: 11px;
|
|
875
|
+
color: #8b949e;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.console-diff-composer-input {
|
|
879
|
+
width: 100%;
|
|
880
|
+
resize: vertical;
|
|
881
|
+
border: 1px solid #30363d;
|
|
882
|
+
border-radius: 6px;
|
|
883
|
+
background: #0d1117;
|
|
884
|
+
color: #c9d1d9;
|
|
885
|
+
padding: 6px 8px;
|
|
886
|
+
font: inherit;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
.console-diff-composer-controls {
|
|
890
|
+
display: flex;
|
|
891
|
+
align-items: center;
|
|
892
|
+
gap: 8px;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
.console-diff-composer-submit {
|
|
896
|
+
border: 1px solid #238636;
|
|
897
|
+
border-radius: 6px;
|
|
898
|
+
background: #238636;
|
|
899
|
+
color: #ffffff;
|
|
900
|
+
padding: 4px 12px;
|
|
901
|
+
cursor: pointer;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
.console-diff-composer-submit:disabled {
|
|
905
|
+
opacity: 0.6;
|
|
906
|
+
cursor: default;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
.console-diff-composer-cancel {
|
|
910
|
+
border: 1px solid #30363d;
|
|
911
|
+
border-radius: 6px;
|
|
912
|
+
background: transparent;
|
|
913
|
+
color: #c9d1d9;
|
|
914
|
+
padding: 4px 12px;
|
|
915
|
+
cursor: pointer;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
.console-diff-composer-status {
|
|
919
|
+
font-size: 12px;
|
|
920
|
+
color: #8b949e;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
.console-diff-composer-error {
|
|
924
|
+
color: #ff7b72;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
.console-diff-composer-posted {
|
|
928
|
+
margin: 0;
|
|
929
|
+
font-size: 12px;
|
|
930
|
+
color: #3fb950;
|
|
931
|
+
}
|
|
932
|
+
|
|
829
933
|
.console-pr-header {
|
|
830
934
|
display: flex;
|
|
831
935
|
flex-wrap: wrap;
|