github-issue-tower-defence-management 1.189.0 → 1.189.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 +7 -0
- package/bin/adapter/entry-points/console/consoleOperationApi.js +11 -0
- package/bin/adapter/entry-points/console/consoleOperationApi.js.map +1 -1
- package/bin/adapter/entry-points/console/ui-dist/assets/{index-CZ1NNzIm.js → index-B22eMy23.js} +1 -1
- package/bin/adapter/entry-points/console/ui-dist/index.html +1 -1
- package/package.json +1 -1
- package/src/adapter/entry-points/console/consoleOperationApi.test.ts +28 -0
- package/src/adapter/entry-points/console/consoleOperationApi.ts +17 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOperations.test.ts +1 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOperations.ts +1 -0
- package/src/adapter/entry-points/console/ui-dist/assets/{index-CZ1NNzIm.js → index-B22eMy23.js} +1 -1
- package/src/adapter/entry-points/console/ui-dist/index.html +1 -1
- package/types/adapter/entry-points/console/consoleOperationApi.d.ts.map +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>TDPM Console</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-B22eMy23.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-CLHvrafO.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
package/package.json
CHANGED
|
@@ -292,6 +292,34 @@ describe('consoleOperationApi', () => {
|
|
|
292
292
|
expectRecordedAcrossTabs('PVTI_c');
|
|
293
293
|
});
|
|
294
294
|
|
|
295
|
+
it('closes a pull request and moves linked issue to Awaiting workspace when issueUrl is provided', async () => {
|
|
296
|
+
const response = await handleReview(context, {
|
|
297
|
+
pjcode: 'acme',
|
|
298
|
+
action: 'close',
|
|
299
|
+
prUrl: 'https://github.com/o/r/pull/1',
|
|
300
|
+
issueUrl: 'https://github.com/o/r/issues/7',
|
|
301
|
+
projectItemId: 'PVTI_c_totally_wrong',
|
|
302
|
+
commentBody: 'totally wrong',
|
|
303
|
+
});
|
|
304
|
+
expect(response.statusCode).toBe(200);
|
|
305
|
+
expect(issueRepository.closePullRequest).toHaveBeenCalledWith(
|
|
306
|
+
'https://github.com/o/r/pull/1',
|
|
307
|
+
);
|
|
308
|
+
expect(issueRepository.createCommentByUrl).toHaveBeenCalledWith(
|
|
309
|
+
'https://github.com/o/r/pull/1',
|
|
310
|
+
'totally wrong',
|
|
311
|
+
);
|
|
312
|
+
expect(issueRepository.updateStatus).toHaveBeenCalledWith(
|
|
313
|
+
project,
|
|
314
|
+
expect.objectContaining({
|
|
315
|
+
itemId: 'PVTI_c_totally_wrong',
|
|
316
|
+
url: 'https://github.com/o/r/issues/7',
|
|
317
|
+
}),
|
|
318
|
+
'status_aw',
|
|
319
|
+
);
|
|
320
|
+
expectRecordedAcrossTabs('PVTI_c_totally_wrong');
|
|
321
|
+
});
|
|
322
|
+
|
|
295
323
|
it('marks a pull request unnecessary by closing it, labelling the item chore and moving it to Awaiting workspace', async () => {
|
|
296
324
|
issueRepository.getIssueByUrl.mockResolvedValue({
|
|
297
325
|
...issue,
|
|
@@ -294,6 +294,23 @@ export const handleReview = async (
|
|
|
294
294
|
.resolveIssueRepository(prUrl)
|
|
295
295
|
.createCommentByUrl(prUrl, body.commentBody);
|
|
296
296
|
}
|
|
297
|
+
const issueUrl = body.issueUrl;
|
|
298
|
+
if (isNonEmptyString(issueUrl)) {
|
|
299
|
+
const binding = await context.resolveProject(pjcodeResult);
|
|
300
|
+
if (binding === null) {
|
|
301
|
+
return badRequest(`no project configured for pjcode "${pjcodeResult}"`);
|
|
302
|
+
}
|
|
303
|
+
const statusFailure = await updateStatusByName(
|
|
304
|
+
context.resolveIssueRepository(issueUrl),
|
|
305
|
+
binding.project,
|
|
306
|
+
issueUrl,
|
|
307
|
+
projectItemId,
|
|
308
|
+
AWAITING_WORKSPACE_STATUS_NAME,
|
|
309
|
+
);
|
|
310
|
+
if (statusFailure !== null) {
|
|
311
|
+
return statusFailure;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
297
314
|
recordDone(context, pjcodeResult, projectItemId);
|
|
298
315
|
return ok();
|
|
299
316
|
}
|