66import * as vscode from 'vscode'
77import { getLogger } from '../../shared/logger/logger'
88import request from '../../shared/request'
9- import { getClientId } from '../../shared/telemetry/util'
10- import { telemetry } from '../../shared/telemetry/telemetry'
11- import globals from '../../shared/extensionGlobals'
12- // import { getStringHash } from '../../shared/utilities/textUtilities'
139import { ToolkitError } from '../../shared/errors'
14- import { getTabSizeSetting } from '../../shared/utilities/editorUtilities'
1510import { i18n } from '../../shared/i18n-helper'
16- import { WorkflowMode } from '../workflowStudio/types'
17-
18- const isLocalDev = true
19- const localhost = 'http://127.0.0.1:3002'
20- const cdn = 'https://d5t62uwepi9lu.cloudfront.net'
21- let clientId = ''
11+ import { ComponentType } from '../workflowStudio/types'
12+ import { isLocalDev , localhost , cdn } from '../constants/webviewResources'
2213
2314/**
2415 * Provider for Execution Details panels.
@@ -37,23 +28,21 @@ export class ExecutionDetailProvider {
3728 executionArn : string ,
3829 params ?: vscode . WebviewPanelOptions & vscode . WebviewOptions
3930 ) : Promise < void > {
40- await telemetry . stepfunctions_openWorkflowStudio . run ( async ( ) => {
41- // Create and show the webview panel
42- const panel = vscode . window . createWebviewPanel (
43- ExecutionDetailProvider . viewType ,
44- `Execution: ${ executionArn . split ( ':' ) . pop ( ) || executionArn } ` ,
45- vscode . ViewColumn . Beside ,
46- {
47- enableScripts : true ,
48- retainContextWhenHidden : true ,
49- ...params ,
50- }
51- )
52-
53- // Create the provider and initialize the panel
54- const provider = new ExecutionDetailProvider ( )
55- await provider . initializePanel ( panel , executionArn )
56- } )
31+ // Create and show the webview panel
32+ const panel = vscode . window . createWebviewPanel (
33+ ExecutionDetailProvider . viewType ,
34+ `Execution: ${ executionArn . split ( ':' ) . pop ( ) || executionArn } ` ,
35+ vscode . ViewColumn . Beside ,
36+ {
37+ enableScripts : true ,
38+ retainContextWhenHidden : true ,
39+ ...params ,
40+ }
41+ )
42+
43+ // Create the provider and initialize the panel
44+ const provider = new ExecutionDetailProvider ( )
45+ await provider . initializePanel ( panel , executionArn )
5746 }
5847
5948 /**
@@ -102,16 +91,12 @@ export class ExecutionDetailProvider {
10291 const localeTag = `<meta name='locale' content='${ locale } '>`
10392 const theme = vscode . window . activeColorTheme . kind
10493 const isDarkMode = theme === vscode . ColorThemeKind . Dark || theme === vscode . ColorThemeKind . HighContrast
105- const tabSizeTag = `<meta name='tab-size' content='${ getTabSizeSetting ( ) } '>`
10694 const darkModeTag = `<meta name='dark-mode' content='${ isDarkMode } '>`
10795
10896 // Set component type to ExecutionDetails
109- const componentTypeTag = `<meta name="component-type" content="ExecutionDetails" />`
97+ const componentTypeTag = `<meta name="component-type" content="${ ComponentType . ExecutionDetails } " />`
11098
111- // Set to read-only mode as this is just displaying execution details
112- const modeTag = `<meta name="workflow-mode" content="${ WorkflowMode . Readonly } " />`
113-
114- return `${ htmlFileSplit [ 0 ] } <head> ${ baseTag } ${ localeTag } ${ darkModeTag } ${ tabSizeTag } ${ modeTag } ${ componentTypeTag } ${ htmlFileSplit [ 1 ] } `
99+ return `${ htmlFileSplit [ 0 ] } <head> ${ baseTag } ${ localeTag } ${ darkModeTag } ${ componentTypeTag } ${ htmlFileSplit [ 1 ] } `
115100 }
116101
117102 /**
@@ -125,10 +110,6 @@ export class ExecutionDetailProvider {
125110 await this . fetchWebviewHtml ( )
126111 }
127112
128- if ( clientId === '' ) {
129- clientId = getClientId ( globals . globalState )
130- }
131-
132113 // Set up the content
133114 panel . webview . html = await this . getWebviewContent ( )
134115
0 commit comments