Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/core/src/stepFunctions/activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -100,7 +101,21 @@ 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 (arn) {
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)'
)
}
}
})
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class ExecutionDetailProvider {
* Gets the webview content for Execution Details.
* @private
*/
private getWebviewContent = async (): Promise<string> => {
private getWebviewContent = async (executionArn: string): Promise<string> => {
const htmlFileSplit = this.webviewHtml.split('<head>')

// Set asset source to CDN
Expand All @@ -83,8 +83,9 @@ export class ExecutionDetailProvider {

// Set component type to ExecutionDetails
const componentTypeTag = `<meta name="component-type" content="${ComponentType.ExecutionDetails}" />`
const executionArnTag = `<meta name="execution-arn" content="${executionArn}" />`

return `${htmlFileSplit[0]} <head> ${baseTag} ${localeTag} ${darkModeTag} ${componentTypeTag} ${htmlFileSplit[1]}`
return `${htmlFileSplit[0]} <head> ${baseTag} ${localeTag} ${darkModeTag} ${componentTypeTag} ${executionArnTag} ${htmlFileSplit[1]}`
}

/**
Expand All @@ -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,
Expand Down
Loading