diff --git a/packages/core/src/stepFunctions/activation.ts b/packages/core/src/stepFunctions/activation.ts index 95c54780820..a70af265852 100644 --- a/packages/core/src/stepFunctions/activation.ts +++ b/packages/core/src/stepFunctions/activation.ts @@ -24,6 +24,7 @@ import { WorkflowStudioEditorProvider } from './workflowStudio/workflowStudioEdi import { StateMachineNode } from './explorer/stepFunctionsNodes' import { downloadStateMachineDefinition } from './commands/downloadStateMachineDefinition' import { ExecutionDetailProvider } from './executionDetails/executionDetailProvider' +import { validate } from '@aws-sdk/util-arn-parser' /** * Activate Step Functions related functionality for the extension. @@ -100,7 +101,19 @@ async function registerStepFunctionCommands( await publishStateMachine({ awsContext: awsContext, outputChannel: outputChannel, region: region }) }), Commands.register('aws.stepfunctions.viewExecutionDetailsByExecutionARN', async () => { - await ExecutionDetailProvider.openExecutionDetails('') + const arn = await vscode.window.showInputBox({ + prompt: 'Enter Execution ARN', + placeHolder: + 'arn:aws:states:us-east-1:123456789012:execution:MyStateMachine:12345678-1234-1234-1234-123456789012', + }) + + if (validate(arn)) { + await ExecutionDetailProvider.openExecutionDetails(arn!) + } else { + void vscode.window.showErrorMessage( + 'Invalid ARN format. Please provide a valid Step Functions execution ARN (e.g., arn:aws:states:us-east-1:123456789012:execution:MyStateMachine:12345678-1234-1234-1234-123456789012)' + ) + } }) ) } diff --git a/packages/core/src/stepFunctions/executionDetails/executionDetailProvider.ts b/packages/core/src/stepFunctions/executionDetails/executionDetailProvider.ts index d1420d36bde..7a275f177fb 100644 --- a/packages/core/src/stepFunctions/executionDetails/executionDetailProvider.ts +++ b/packages/core/src/stepFunctions/executionDetails/executionDetailProvider.ts @@ -67,7 +67,7 @@ export class ExecutionDetailProvider { * Gets the webview content for Execution Details. * @private */ - private getWebviewContent = async (): Promise => { + private getWebviewContent = async (executionArn: string): Promise => { const htmlFileSplit = this.webviewHtml.split('') // Set asset source to CDN @@ -83,8 +83,9 @@ export class ExecutionDetailProvider { // Set component type to ExecutionDetails const componentTypeTag = `` + const executionArnTag = `` - return `${htmlFileSplit[0]} ${baseTag} ${localeTag} ${darkModeTag} ${componentTypeTag} ${htmlFileSplit[1]}` + return `${htmlFileSplit[0]} ${baseTag} ${localeTag} ${darkModeTag} ${componentTypeTag} ${executionArnTag} ${htmlFileSplit[1]}` } /** @@ -99,7 +100,7 @@ export class ExecutionDetailProvider { } // Set up the content - panel.webview.html = await this.getWebviewContent() + panel.webview.html = await this.getWebviewContent(executionArn) const context: ExecutionDetailsContext = { panel, loaderNotification: undefined,