github-issue-tower-defence-management 1.189.0 → 1.189.2

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.
@@ -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-CZ1NNzIm.js"></script>
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-issue-tower-defence-management",
3
- "version": "1.189.0",
3
+ "version": "1.189.2",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {
@@ -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
  }
@@ -3,7 +3,7 @@ import { type ComponentProps, useEffect, useRef, useState } from 'react';
3
3
  import type { ConsoleTabName } from '../../logic/types';
4
4
  import { ConsoleTabList } from './ConsoleTabList';
5
5
 
6
- const allPjcodes = ['utage3', 'cmg', 'xmile', 'xcare', 'umino'];
6
+ const allPjcodes = ['acme', 'beta', 'gamma', 'delta', 'epsilon'];
7
7
 
8
8
  const meta: Meta<typeof ConsoleTabList> = {
9
9
  title: 'Console/ConsoleTabList',
@@ -135,7 +135,7 @@ export const WithProjectSwitcherClosed: Story = {
135
135
  args: {
136
136
  activeTab: 'prs',
137
137
  counts,
138
- pjcode: 'umino',
138
+ pjcode: 'acme',
139
139
  pjcodes: allPjcodes,
140
140
  },
141
141
  };
@@ -159,7 +159,7 @@ export const WithProjectSwitcherOpen: Story = {
159
159
  args: {
160
160
  activeTab: 'prs',
161
161
  counts,
162
- pjcode: 'umino',
162
+ pjcode: 'acme',
163
163
  pjcodes: allPjcodes,
164
164
  },
165
165
  render: (args) => <DropdownOpen {...args} />,
@@ -14,7 +14,7 @@ const counts: Record<ConsoleTabName, number> = {
14
14
 
15
15
  const baseProps = {
16
16
  pjcode: 'acme',
17
- pjcodes: ['utage3', 'cmg', 'xmile', 'xcare', 'umino'],
17
+ pjcodes: ['acme', 'beta', 'gamma', 'delta', 'epsilon'],
18
18
  generatedAt: '2026-06-19T08:42:11.000Z',
19
19
  fromCache: false,
20
20
  tabHref: (tab: ConsoleTabName) => `/projects/acme/${tab}`,
@@ -195,11 +195,11 @@ describe('ConsoleTabList', () => {
195
195
  baseElement.querySelectorAll('.console-tab-pjname-option'),
196
196
  );
197
197
  expect(options.map((o) => o.textContent)).toEqual([
198
- 'utage3',
199
- 'cmg',
200
- 'xmile',
201
- 'xcare',
202
- 'umino',
198
+ 'acme',
199
+ 'beta',
200
+ 'gamma',
201
+ 'delta',
202
+ 'epsilon',
203
203
  ]);
204
204
  });
205
205
 
@@ -214,8 +214,8 @@ describe('ConsoleTabList', () => {
214
214
  />,
215
215
  );
216
216
  fireEvent.click(getByRole('button', { name: /acme/i }));
217
- fireEvent.click(getByText('xmile'));
218
- expect(onSelectProject).toHaveBeenCalledWith('xmile');
217
+ fireEvent.click(getByText('gamma'));
218
+ expect(onSelectProject).toHaveBeenCalledWith('gamma');
219
219
  });
220
220
 
221
221
  it('closes the dropdown after a project option is selected', () => {
@@ -226,7 +226,7 @@ describe('ConsoleTabList', () => {
226
226
  expect(
227
227
  baseElement.querySelector('.console-tab-pjname-dropdown'),
228
228
  ).toBeInTheDocument();
229
- fireEvent.click(getByText('xmile'));
229
+ fireEvent.click(getByText('gamma'));
230
230
  expect(
231
231
  baseElement.querySelector('.console-tab-pjname-dropdown'),
232
232
  ).toBeNull();
@@ -68,6 +68,7 @@ describe('useConsoleOperations', () => {
68
68
  pjcode: 'acme',
69
69
  action: 'close',
70
70
  prUrl: prItem.url,
71
+ issueUrl: prItem.url,
71
72
  commentBody: 'totally wrong',
72
73
  });
73
74
  });
@@ -113,6 +113,7 @@ const reviewRequest = (
113
113
  pjcode,
114
114
  action: 'close',
115
115
  prUrl,
116
+ issueUrl: item.url,
116
117
  projectItemId: item.projectItemId,
117
118
  commentBody: TOTALLY_WRONG_COMMENT_BODY,
118
119
  };