Skip to content

Commit d64f5cd

Browse files
author
Diler Zaza
committed
feat(stepfunctions): add View by Execution ARN command and provider
1 parent 693644d commit d64f5cd

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

packages/core/src/stepFunctions/constants/webviewResources.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
export const isLocalDev = true // eslint-disable-line @typescript-eslint/naming-convention
7-
export const localhost = 'http://127.0.0.1:3002' // eslint-disable-line @typescript-eslint/naming-convention
8-
export const cdn = 'https://d5t62uwepi9lu.cloudfront.net' // eslint-disable-line @typescript-eslint/naming-convention
6+
export const isLocalDev = true
7+
export const localhost = 'http://127.0.0.1:3002'
8+
export const cdn = 'https://d5t62uwepi9lu.cloudfront.net'

packages/core/src/stepFunctions/executionDetails/executionDetailProvider.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { ToolkitError } from '../../shared/errors'
1010
import { i18n } from '../../shared/i18n-helper'
1111
import { ComponentType } from '../workflowStudio/types'
1212
import { isLocalDev, localhost, cdn } from '../constants/webviewResources'
13+
import { ComponentType } from '../workflowStudio/types'
14+
import { isLocalDev, localhost, cdn } from '../constants/webviewResources'
1315

1416
/**
1517
* Provider for Execution Details panels.
@@ -39,25 +41,23 @@ export class ExecutionDetailProvider {
3941
...params,
4042
}
4143
)
44+
// Create and show the webview panel
45+
const panel = vscode.window.createWebviewPanel(
46+
ExecutionDetailProvider.viewType,
47+
`Execution: ${executionArn.split(':').pop() || executionArn}`,
48+
vscode.ViewColumn.Beside,
49+
{
50+
enableScripts: true,
51+
retainContextWhenHidden: true,
52+
...params,
53+
}
54+
)
4255

4356
// Create the provider and initialize the panel
4457
const provider = new ExecutionDetailProvider()
4558
await provider.initializePanel(panel, executionArn)
4659
}
4760

48-
/**
49-
* Registers the command to open execution details.
50-
* @remarks This should only be called once per extension.
51-
*/
52-
public static register(): vscode.Disposable {
53-
return vscode.commands.registerCommand(
54-
'aws.stepFunctions.viewExecutionDetails',
55-
async (executionArn: string) => {
56-
await ExecutionDetailProvider.openExecutionDetails(executionArn)
57-
}
58-
)
59-
}
60-
6161
protected webviewHtml: string
6262
protected readonly logger = getLogger()
6363

@@ -95,8 +95,10 @@ export class ExecutionDetailProvider {
9595

9696
// Set component type to ExecutionDetails
9797
const componentTypeTag = `<meta name="component-type" content="${ComponentType.ExecutionDetails}" />`
98+
const componentTypeTag = `<meta name="component-type" content="${ComponentType.ExecutionDetails}" />`
9899

99100
return `${htmlFileSplit[0]} <head> ${baseTag} ${localeTag} ${darkModeTag} ${componentTypeTag} ${htmlFileSplit[1]}`
101+
return `${htmlFileSplit[0]} <head> ${baseTag} ${localeTag} ${darkModeTag} ${componentTypeTag} ${htmlFileSplit[1]}`
100102
}
101103

102104
/**

0 commit comments

Comments
 (0)