github-issue-tower-defence-management 2.16.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 +14 -0
- package/README.md +1 -0
- package/bin/adapter/entry-points/cli/fleetConfig.js +30 -4
- package/bin/adapter/entry-points/cli/fleetConfig.js.map +1 -1
- package/bin/adapter/entry-points/cli/index.js +5 -1
- package/bin/adapter/entry-points/cli/index.js.map +1 -1
- package/bin/adapter/entry-points/console/ui-dist/assets/{index-DuOimMCC.js → index-CfqusL5j.js} +11 -11
- package/bin/adapter/entry-points/console/ui-dist/index.html +1 -1
- package/bin/adapter/entry-points/console/webServer.js +4 -1
- package/bin/adapter/entry-points/console/webServer.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/entry-points/cli/fleetConfig.test.ts +63 -0
- package/src/adapter/entry-points/cli/fleetConfig.ts +38 -5
- package/src/adapter/entry-points/cli/index.ts +13 -1
- package/src/adapter/entry-points/console/ui/e2e/consoleScenario.spec.ts +66 -0
- package/src/adapter/entry-points/console/ui/e2e/consoleTestHarness.ts +4 -1
- 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/layout/ConsoleTabList.stories.tsx +26 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsoleTabList.test.tsx +39 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsoleTabList.tsx +13 -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/hooks/useConsoleProjectList.test.ts +24 -1
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleProjectList.ts +7 -3
- package/src/adapter/entry-points/console/ui/src/features/console/lib/consoleApi.ts +17 -8
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.tsx +5 -0
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsolePage.tsx +6 -1
- package/src/adapter/entry-points/console/ui-dist/assets/{index-DuOimMCC.js → index-CfqusL5j.js} +11 -11
- package/src/adapter/entry-points/console/ui-dist/index.html +1 -1
- package/src/adapter/entry-points/console/webServer.test.ts +34 -1
- package/src/adapter/entry-points/console/webServer.ts +6 -1
- package/types/adapter/entry-points/cli/fleetConfig.d.ts +3 -1
- package/types/adapter/entry-points/cli/fleetConfig.d.ts.map +1 -1
- package/types/adapter/entry-points/cli/index.d.ts.map +1 -1
- package/types/adapter/entry-points/console/webServer.d.ts +1 -0
- package/types/adapter/entry-points/console/webServer.d.ts.map +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>
|
|
@@ -2757,7 +2757,7 @@ describe('webServer GET /api/projects', () => {
|
|
|
2757
2757
|
});
|
|
2758
2758
|
};
|
|
2759
2759
|
|
|
2760
|
-
it('returns the dashboardProjectNames with a valid token', async () => {
|
|
2760
|
+
it('returns the dashboardProjectNames with a valid token and null workflowImprovementIssueUrl when not configured', async () => {
|
|
2761
2761
|
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'console-server-'));
|
|
2762
2762
|
const server = await startWebServer({
|
|
2763
2763
|
accessToken: testToken,
|
|
@@ -2778,6 +2778,39 @@ describe('webServer GET /api/projects', () => {
|
|
|
2778
2778
|
expect(response.statusCode).toBe(200);
|
|
2779
2779
|
expect(JSON.parse(response.body)).toEqual({
|
|
2780
2780
|
pjcodes: ['alpha', 'beta', 'gamma'],
|
|
2781
|
+
workflowImprovementIssueUrl: null,
|
|
2782
|
+
});
|
|
2783
|
+
} finally {
|
|
2784
|
+
await closeServer(server);
|
|
2785
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
2786
|
+
}
|
|
2787
|
+
});
|
|
2788
|
+
|
|
2789
|
+
it('returns the workflowImprovementIssueUrl when configured', async () => {
|
|
2790
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'console-server-'));
|
|
2791
|
+
const server = await startWebServer({
|
|
2792
|
+
accessToken: testToken,
|
|
2793
|
+
uiDistDir: path.join(tmpDir, 'ui-dist'),
|
|
2794
|
+
consoleDataOutputDir: null,
|
|
2795
|
+
inTmuxDataDir: null,
|
|
2796
|
+
dashboardDir: null,
|
|
2797
|
+
dashboardDataDir: null,
|
|
2798
|
+
dashboardProjectNames: ['alpha'],
|
|
2799
|
+
workflowImprovementIssueUrl:
|
|
2800
|
+
'https://github.com/owner/repo/issues/new?assignees=someone',
|
|
2801
|
+
port: 0,
|
|
2802
|
+
});
|
|
2803
|
+
try {
|
|
2804
|
+
const response = await request(
|
|
2805
|
+
server,
|
|
2806
|
+
'GET',
|
|
2807
|
+
`/api/projects?k=${testToken}`,
|
|
2808
|
+
);
|
|
2809
|
+
expect(response.statusCode).toBe(200);
|
|
2810
|
+
expect(JSON.parse(response.body)).toEqual({
|
|
2811
|
+
pjcodes: ['alpha'],
|
|
2812
|
+
workflowImprovementIssueUrl:
|
|
2813
|
+
'https://github.com/owner/repo/issues/new?assignees=someone',
|
|
2781
2814
|
});
|
|
2782
2815
|
} finally {
|
|
2783
2816
|
await closeServer(server);
|
|
@@ -231,6 +231,7 @@ export type WebServerOptions = {
|
|
|
231
231
|
dashboardDir: string | null;
|
|
232
232
|
dashboardDataDir: string | null;
|
|
233
233
|
dashboardProjectNames: string[];
|
|
234
|
+
workflowImprovementIssueUrl?: string | null;
|
|
234
235
|
resolveGithubToken?: ConsoleGithubTokenResolver | null;
|
|
235
236
|
imageFetcher?: ImageFetcher | null;
|
|
236
237
|
issueRepository?: IssueRepository | null;
|
|
@@ -475,7 +476,11 @@ const handleReadApi = async (
|
|
|
475
476
|
if (requestPath === '/api/projects') {
|
|
476
477
|
return {
|
|
477
478
|
statusCode: 200,
|
|
478
|
-
body: {
|
|
479
|
+
body: {
|
|
480
|
+
pjcodes: options.dashboardProjectNames,
|
|
481
|
+
workflowImprovementIssueUrl:
|
|
482
|
+
options.workflowImprovementIssueUrl ?? null,
|
|
483
|
+
},
|
|
479
484
|
};
|
|
480
485
|
}
|
|
481
486
|
const defaultIssueRepository = options.issueRepository ?? null;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { LiveSessionOauthTokenSelectionSettings } from '../../../domain/usecases/LiveSessionOauthTokenSelectUseCase';
|
|
1
|
+
import { type LiveSessionOauthTokenSelectionSettings } from '../../../domain/usecases/LiveSessionOauthTokenSelectUseCase';
|
|
2
2
|
export declare const FLEET_CONFIG_FILE_PATH_ENVIRONMENT_VARIABLE = "TDPM_FLEET_CONFIG";
|
|
3
3
|
export declare const LIVE_SESSION_OAUTH_TOKEN_SELECTION_SECTION_KEY = "liveSessionOauthTokenSelection";
|
|
4
4
|
export declare const PREPARATION_WORKER_SECTION_KEY = "preparationWorker";
|
|
5
5
|
export declare const START_PREPARATION_SECTION_KEY = "startPreparation";
|
|
6
|
+
export declare const WORKFLOW_IMPROVEMENT_ISSUE_URL_KEY = "workflowImprovementIssueUrl";
|
|
6
7
|
export declare const DEFAULT_FLEET_MAXIMUM_PREPARING_ISSUES_COUNT = 80;
|
|
7
8
|
export declare const DEFAULT_MAX_CONCURRENT_WORKERS = 40;
|
|
8
9
|
export declare const DEFAULT_GRAPHQL_RATE_LIMIT_FLOOR = 500;
|
|
@@ -20,4 +21,5 @@ export declare const resolveFleetConfigFilePath: (cliValue: string | null) => st
|
|
|
20
21
|
export declare const loadLiveSessionOauthTokenSelectionSettings: (fleetConfigFilePath: string | null) => LiveSessionOauthTokenSelectionSettings;
|
|
21
22
|
export declare const loadPreparationWorkerSettings: (fleetConfigFilePath: string | null) => PreparationWorkerSettings;
|
|
22
23
|
export declare const loadStartPreparationFleetSettings: (fleetConfigFilePath: string | null) => StartPreparationFleetSettings;
|
|
24
|
+
export declare const loadWorkflowImprovementIssueUrl: (fleetConfigFilePath: string | null) => string | null;
|
|
23
25
|
//# sourceMappingURL=fleetConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fleetConfig.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/fleetConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,sCAAsC,
|
|
1
|
+
{"version":3,"file":"fleetConfig.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/fleetConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,sCAAsC,EAC5C,MAAM,6DAA6D,CAAC;AAGrE,eAAO,MAAM,2CAA2C,sBAAsB,CAAC;AAE/E,eAAO,MAAM,8CAA8C,mCACzB,CAAC;AACnC,eAAO,MAAM,8BAA8B,sBAAsB,CAAC;AAClE,eAAO,MAAM,6BAA6B,qBAAqB,CAAC;AAChE,eAAO,MAAM,kCAAkC,gCAAgC,CAAC;AAEhF,eAAO,MAAM,4CAA4C,KAAK,CAAC;AAE/D,eAAO,MAAM,8BAA8B,KAAK,CAAC;AACjD,eAAO,MAAM,gCAAgC,MAAM,CAAC;AAEpD,MAAM,MAAM,yBAAyB,GAAG;IACtC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,yBAIjD,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,2BAA2B,EAAE,MAAM,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,wCAAwC,EAAE,6BAGpD,CAAC;AAEJ,eAAO,MAAM,0BAA0B,GACrC,UAAU,MAAM,GAAG,IAAI,KACtB,MAAM,GAAG,IAUX,CAAC;AAoEF,eAAO,MAAM,0CAA0C,GACrD,qBAAqB,MAAM,GAAG,IAAI,KACjC,sCAiDF,CAAC;AAEF,eAAO,MAAM,6BAA6B,GACxC,qBAAqB,MAAM,GAAG,IAAI,KACjC,yBAwCF,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAC5C,qBAAqB,MAAM,GAAG,IAAI,KACjC,6BAsBF,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAC1C,qBAAqB,MAAM,GAAG,IAAI,KACjC,MAAM,GAAG,IAkBX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AAoPzB,eAAO,MAAM,OAAO,SAAgB,CAAC;AAynCrC,eAAO,MAAM,uBAAuB,GAAI,OAAO,OAAO,KAAG,IAGxD,CAAC;AAwCF,eAAO,MAAM,aAAa,GACxB,MAAM,MAAM,EAAE,EACd,kBAAkB,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,KACzC,OAAO,CAAC,IAAI,CAqCd,CAAC"}
|
|
@@ -26,6 +26,7 @@ export type WebServerOptions = {
|
|
|
26
26
|
dashboardDir: string | null;
|
|
27
27
|
dashboardDataDir: string | null;
|
|
28
28
|
dashboardProjectNames: string[];
|
|
29
|
+
workflowImprovementIssueUrl?: string | null;
|
|
29
30
|
resolveGithubToken?: ConsoleGithubTokenResolver | null;
|
|
30
31
|
imageFetcher?: ImageFetcher | null;
|
|
31
32
|
issueRepository?: IssueRepository | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webServer.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/webServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,uEAAuE,CAAC;AAClH,OAAO,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAC;AAC9F,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAM3D,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EAQvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,8BAA8B,EAE9B,sBAAsB,EACtB,gCAAgC,EAChC,sBAAsB,EAWvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACL,0BAA0B,EAE3B,MAAM,8BAA8B,CAAC;AAUtC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD,eAAO,MAAM,oBAAoB,aAAa,CAAC;A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EI,CAAC;AAEtE,eAAO,MAAM,yBAAyB,GACpC,eAAe,MAAM,EACrB,aAAa,MAAM,KAClB,MAAM,GAAG,IAoBX,CAAC;AAgeF,eAAO,MAAM,uBAAuB,GAClC,SAAS,gBAAgB,EACzB,aAAa,MAAM,KAClB,MAAM,GAAG,IAeX,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,SAAS,gBAAgB,EACzB,SAAS,IAAI,CAAC,eAAe,EAC7B,UAAU,IAAI,CAAC,cAAc,KAC5B,OAAO,CAAC,IAAI,CAuFd,CAAC;AAcF,eAAO,MAAM,eAAe,GAAI,SAAS,gBAAgB,KAAG,IAAI,CAAC,MAM7D,CAAC;AAEL,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG;IACrD,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,SAAS,qBAAqB,KAC7B,OAAO,CAAC,IAAI,CAAC,MAAM,CAQlB,CAAC"}
|
|
@@ -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
|
-
};
|