11import * as vscode from 'vscode' ;
2- import * as path from 'path' ;
32
4- import { IMRWebViewDetail } from './typings/commonTypes' ;
53import { getNonce } from './common/utils' ;
64
75export class Panel {
@@ -17,7 +15,7 @@ export class Panel {
1715 private readonly _extensionPath : string ;
1816 private _disposables : vscode . Disposable [ ] = [ ] ;
1917
20- public static createOrShow ( context : vscode . ExtensionContext , data : IMRWebViewDetail ) {
18+ public static createOrShow ( context : vscode . ExtensionContext ) {
2119 const { extensionUri, extensionPath } = context ;
2220 const column = vscode . window . activeTextEditor
2321 ? vscode . window . activeTextEditor . viewColumn
@@ -42,7 +40,7 @@ export class Panel {
4240 } ,
4341 ) ;
4442
45- Panel . currentPanel = new Panel ( panel , extensionUri , extensionPath , data ) ;
43+ Panel . currentPanel = new Panel ( panel , extensionUri , extensionPath ) ;
4644 }
4745
4846 public static revive (
@@ -53,13 +51,13 @@ export class Panel {
5351 Panel . currentPanel = new Panel ( panel , extensionUri , extensionPath ) ;
5452 }
5553
56- private constructor ( panel : vscode . WebviewPanel , extensionUri : vscode . Uri , extensionPath : string , mr ?: IMRWebViewDetail ) {
54+ private constructor ( panel : vscode . WebviewPanel , extensionUri : vscode . Uri , extensionPath : string ) {
5755 this . _panel = panel ;
5856 this . _extensionUri = extensionUri ;
5957 this . _extensionPath = extensionPath ;
6058
6159 // Set the webview's initial html content
62- this . _update ( mr ) ;
60+ this . _update ( ) ;
6361
6462 // Listen for when the panel is disposed
6563 // This happens when the user closes the panel or when the panel is closed programatically
@@ -117,28 +115,28 @@ export class Panel {
117115 }
118116 }
119117
120- private _update ( data ?: IMRWebViewDetail ) {
118+ private _update ( ) {
121119 const webview = this . _panel . webview ;
122120
123121 // Vary the webview's content based on where it is located in the editor.
124122 switch ( this . _panel . viewColumn ) {
125123 case vscode . ViewColumn . Two :
126- this . _updateForCat ( webview , data ) ;
124+ this . _updateForCat ( webview ) ;
127125 return ;
128126
129127 case vscode . ViewColumn . Three :
130- this . _updateForCat ( webview , data ) ;
128+ this . _updateForCat ( webview ) ;
131129 return ;
132130
133131 case vscode . ViewColumn . One :
134132 default :
135- this . _updateForCat ( webview , data ) ;
133+ this . _updateForCat ( webview ) ;
136134 return ;
137135 }
138136 }
139137
140- private _updateForCat ( webview : vscode . Webview , data ?: IMRWebViewDetail ) {
141- this . _panel . title = `Merge Request ${ data ?. iid || `` } ` ;
138+ private _updateForCat ( webview : vscode . Webview ) {
139+ this . _panel . title = `Merge Request` ;
142140 this . _panel . webview . html = this . _getHtmlForWebview ( webview ) ;
143141 }
144142
@@ -154,7 +152,7 @@ export class Panel {
154152 <title>Merge Request Overview</title>
155153 <meta name="viewport" content="width=device-width, initial-scale=1.0">
156154 <meta http-equiv="Content-Security-Policy"
157- content="default-src 'unsafe-eval '; style-src vscode-resource: 'unsafe-inline' http: https: data:;; img-src vscode-resource: https:; script-src 'nonce-${ nonce } ' 'unsafe-eval'; connect-src https:">
155+ content="default-src 'none '; style-src vscode-resource: 'unsafe-inline' http: https: data:;; img-src vscode-resource: https:; script-src 'nonce-${ nonce } ' 'unsafe-eval'; connect-src https:">
158156 </head>
159157 <body>
160158 <div id="root"></div>
0 commit comments