github-issue-tower-defence-management 2.17.0 → 2.18.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 +7 -0
- package/bin/adapter/entry-points/console/ui-dist/assets/{index-DKxao68k.js → index-CfqusL5j.js} +8 -8
- package/bin/adapter/entry-points/console/ui-dist/index.html +1 -1
- package/package.json +1 -1
- package/src/adapter/entry-points/console/ui/e2e/consoleScenario.spec.ts +34 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleCommentComposer.stories.tsx +8 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleCommentComposer.test.tsx +81 -2
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleCommentComposer.tsx +12 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleOperationMenu.tsx +0 -5
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.tsx +5 -0
- package/src/adapter/entry-points/console/ui-dist/assets/{index-DKxao68k.js → index-CfqusL5j.js} +8 -8
- package/src/adapter/entry-points/console/ui-dist/index.html +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleOkAndAwaitingWorkspaceActions.stories.tsx +0 -25
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleOkAndAwaitingWorkspaceActions.test.tsx +0 -62
- package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleOkAndAwaitingWorkspaceActions.tsx +0 -33
|
@@ -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-CfqusL5j.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-DshIymWu.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { consoleStatusOptionsFixture } from '../../testing/fixtures';
|
|
3
|
-
import { ConsoleOkAndAwaitingWorkspaceActions } from './ConsoleOkAndAwaitingWorkspaceActions';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof ConsoleOkAndAwaitingWorkspaceActions> = {
|
|
6
|
-
title: 'Console/ConsoleOkAndAwaitingWorkspaceActions',
|
|
7
|
-
component: ConsoleOkAndAwaitingWorkspaceActions,
|
|
8
|
-
args: { onOkAndAwaitingWorkspace: () => {} },
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
|
|
13
|
-
type Story = StoryObj<typeof ConsoleOkAndAwaitingWorkspaceActions>;
|
|
14
|
-
|
|
15
|
-
export const WithAwaitingWorkspaceOption: Story = {
|
|
16
|
-
args: { statusOptions: consoleStatusOptionsFixture },
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const WithoutAwaitingWorkspaceOption: Story = {
|
|
20
|
-
args: {
|
|
21
|
-
statusOptions: consoleStatusOptionsFixture.filter(
|
|
22
|
-
(o) => o.name.toLowerCase() !== 'awaiting workspace',
|
|
23
|
-
),
|
|
24
|
-
},
|
|
25
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { fireEvent, render } from '@testing-library/react';
|
|
2
|
-
import { consoleStatusOptionsFixture } from '../../testing/fixtures';
|
|
3
|
-
import { ConsoleOkAndAwaitingWorkspaceActions } from './ConsoleOkAndAwaitingWorkspaceActions';
|
|
4
|
-
|
|
5
|
-
const [awaitingWorkspaceOption] = consoleStatusOptionsFixture.filter(
|
|
6
|
-
(o) => o.name.toLowerCase() === 'awaiting workspace',
|
|
7
|
-
);
|
|
8
|
-
|
|
9
|
-
const statusOptionsWithoutAwaitingWorkspace =
|
|
10
|
-
consoleStatusOptionsFixture.filter(
|
|
11
|
-
(o) => o.name.toLowerCase() !== 'awaiting workspace',
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
describe('ConsoleOkAndAwaitingWorkspaceActions', () => {
|
|
15
|
-
it('renders the button when the awaiting workspace option is present', () => {
|
|
16
|
-
const { getByRole } = render(
|
|
17
|
-
<ConsoleOkAndAwaitingWorkspaceActions
|
|
18
|
-
statusOptions={consoleStatusOptionsFixture}
|
|
19
|
-
onOkAndAwaitingWorkspace={() => {}}
|
|
20
|
-
/>,
|
|
21
|
-
);
|
|
22
|
-
expect(
|
|
23
|
-
getByRole('button', { name: 'ok & Awaiting Workspace' }),
|
|
24
|
-
).toBeInTheDocument();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('returns null when the awaiting workspace option is absent', () => {
|
|
28
|
-
const { container } = render(
|
|
29
|
-
<ConsoleOkAndAwaitingWorkspaceActions
|
|
30
|
-
statusOptions={statusOptionsWithoutAwaitingWorkspace}
|
|
31
|
-
onOkAndAwaitingWorkspace={() => {}}
|
|
32
|
-
/>,
|
|
33
|
-
);
|
|
34
|
-
expect(container.firstChild).toBeNull();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('applies the approve green style class regardless of the status option color', () => {
|
|
38
|
-
const { getByRole } = render(
|
|
39
|
-
<ConsoleOkAndAwaitingWorkspaceActions
|
|
40
|
-
statusOptions={consoleStatusOptionsFixture}
|
|
41
|
-
onOkAndAwaitingWorkspace={() => {}}
|
|
42
|
-
/>,
|
|
43
|
-
);
|
|
44
|
-
expect(
|
|
45
|
-
getByRole('button', { name: 'ok & Awaiting Workspace' }),
|
|
46
|
-
).toHaveClass('console-op-button-approve');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('calls the callback with the awaiting workspace option on click', () => {
|
|
50
|
-
const onOkAndAwaitingWorkspace = jest.fn();
|
|
51
|
-
const { getByRole } = render(
|
|
52
|
-
<ConsoleOkAndAwaitingWorkspaceActions
|
|
53
|
-
statusOptions={consoleStatusOptionsFixture}
|
|
54
|
-
onOkAndAwaitingWorkspace={onOkAndAwaitingWorkspace}
|
|
55
|
-
/>,
|
|
56
|
-
);
|
|
57
|
-
fireEvent.click(getByRole('button', { name: 'ok & Awaiting Workspace' }));
|
|
58
|
-
expect(onOkAndAwaitingWorkspace).toHaveBeenCalledWith(
|
|
59
|
-
awaitingWorkspaceOption,
|
|
60
|
-
);
|
|
61
|
-
});
|
|
62
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { ConsoleFieldOption } from '../../logic/types';
|
|
2
|
-
|
|
3
|
-
export type ConsoleOkAndAwaitingWorkspaceActionsProps = {
|
|
4
|
-
statusOptions: ConsoleFieldOption[];
|
|
5
|
-
onOkAndAwaitingWorkspace: (option: ConsoleFieldOption) => void;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const AWAITING_WORKSPACE_NAME = 'awaiting workspace';
|
|
9
|
-
|
|
10
|
-
export const ConsoleOkAndAwaitingWorkspaceActions = ({
|
|
11
|
-
statusOptions,
|
|
12
|
-
onOkAndAwaitingWorkspace,
|
|
13
|
-
}: ConsoleOkAndAwaitingWorkspaceActionsProps) => {
|
|
14
|
-
const option = statusOptions.find(
|
|
15
|
-
(o) => o.name.toLowerCase() === AWAITING_WORKSPACE_NAME,
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
if (option === undefined) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<div className="console-op-group">
|
|
24
|
-
<button
|
|
25
|
-
type="button"
|
|
26
|
-
className="console-op-button console-op-button-approve"
|
|
27
|
-
onClick={() => onOkAndAwaitingWorkspace(option)}
|
|
28
|
-
>
|
|
29
|
-
ok & Awaiting Workspace
|
|
30
|
-
</button>
|
|
31
|
-
</div>
|
|
32
|
-
);
|
|
33
|
-
};
|