File tree 3 files changed +53
-13
lines changed
3 files changed +53
-13
lines changed Original file line number Diff line number Diff line change 1104
1104
},
1105
1105
{
1106
1106
"command" : " openshift.experimental.mode.enable" ,
1107
- "when" : " view == openshiftComponentsView && !config.openshiftToolkit.enableExperimentialMode "
1107
+ "when" : " view == openshiftComponentsView && !config.openshiftToolkit.experimentalFeatures "
1108
1108
},
1109
1109
{
1110
1110
"command" : " openshift.experimental.mode.disable" ,
1111
- "when" : " view == openshiftComponentsView && config.openshiftToolkit.enableExperimentialMode "
1111
+ "when" : " view == openshiftComponentsView && config.openshiftToolkit.experimentalFeatures "
1112
1112
}
1113
1113
],
1114
1114
"view/item/context" : [
1244
1244
},
1245
1245
{
1246
1246
"command" : " openshift.component.dev.onPodman" ,
1247
- "when" : " view == openshiftComponentsView && config.openshiftToolkit.enableExperimentialMode && viewItem =~ /openshift\\ .component.*\\ .dev-nrn.*/" ,
1247
+ "when" : " view == openshiftComponentsView && config.openshiftToolkit.experimentalFeatures && viewItem =~ /openshift\\ .component.*\\ .dev-nrn.*/" ,
1248
1248
"group" : " c1@2"
1249
1249
},
1250
1250
{
1446
1446
"default" : true ,
1447
1447
"description" : " Show Welcome Page when using OpenShift Toolkit Extension."
1448
1448
},
1449
- "openshiftToolkit.enableExperimentialMode" : {
1450
- "type" : " boolean" ,
1451
- "default" : false ,
1452
- "description" : " Show OpenShift Toolkit Experimental Features."
1453
- },
1454
1449
"openshiftToolkit.showChannelOnOutput" : {
1455
1450
"type" : " boolean" ,
1456
1451
"default" : false ,
1525
1520
"default" : 100000
1526
1521
}
1527
1522
}
1528
- }
1523
+ },
1524
+ {
1525
+ "type" : " object" ,
1526
+ "order" : 4 ,
1527
+ "title" : " Experimental Features" ,
1528
+ "properties" : {
1529
+ "openshiftToolkit.experimentalFeatures" : {
1530
+ "order" : 1 ,
1531
+ "description" : " Show OpenShift Toolkit Experimental Features." ,
1532
+ "type" : " boolean" ,
1533
+ "default" : true
1534
+ },
1535
+ "openshiftToolkit.devModeRunOnPodman" : {
1536
+ "order" : 2 ,
1537
+ "description" : " Show warning about experimental feature" ,
1538
+ "type" : " boolean" ,
1539
+ "default" : true
1540
+ }
1541
+ }
1542
+ }
1529
1543
]
1530
1544
},
1531
1545
"extensionDependencies" : [
Original file line number Diff line number Diff line change 6
6
import { workspace } from 'vscode' ;
7
7
import { vsCommand } from './vscommand' ;
8
8
9
+ async function setShowExperimentalFeatures ( set : boolean ) : Promise < void > {
10
+ await workspace . getConfiguration ( 'openshiftToolkit' ) . update ( 'experimentalFeatures' , set ) ;
11
+ }
12
+
9
13
export class ExperimentalMode {
10
14
11
15
@vsCommand ( 'openshift.experimental.mode.enable' )
12
- public static enable ( ) {
13
- workspace . getConfiguration ( 'openshiftToolkit' ) . update ( 'enableExperimentialMode' , true ) ;
16
+ public static async enable ( ) {
17
+ await setShowExperimentalFeatures ( true ) ;
14
18
}
15
19
16
20
@vsCommand ( 'openshift.experimental.mode.disable' )
17
- public static disable ( ) {
18
- workspace . getConfiguration ( 'openshiftToolkit' ) . update ( 'enableExperimentialMode' , false ) ;
21
+ public static async disable ( ) {
22
+ await setShowExperimentalFeatures ( false ) ;
19
23
}
24
+
20
25
}
Original file line number Diff line number Diff line change @@ -194,6 +194,27 @@ export class Component extends OpenShiftItem {
194
194
195
195
@vsCommand ( 'openshift.component.dev.onPodman' )
196
196
static async devOnPodman ( component : ComponentWorkspaceFolder ) {
197
+ if ( workspace . getConfiguration ( 'openshiftToolkit' ) . get ( 'devModeRunOnPodman' ) ) {
198
+ let choice = 'Cancel' ;
199
+ do {
200
+ const choices = [ 'About Podman' , 'Continue' , 'Continue and don\'t ask again' ] ;
201
+ choice = await window . showWarningMessage (
202
+ 'The command \'Start Dev on Podman\' is experimental. It requires Podman to be installed and configured. It isn\'t guaranteed to work.' ,
203
+ ...choices ) ;
204
+ switch ( choice ) {
205
+ case choices [ 0 ] : // open link to external site with podman documentation
206
+ await commands . executeCommand ( 'vscode.open' , Uri . parse ( 'https://docs.podman.io/en/latest/index.html' ) ) ;
207
+ break ;
208
+ case choices [ 1 ] : // continue with execution
209
+ break ;
210
+ case choices [ 2 ] : // save request to not show warning again
211
+ await workspace . getConfiguration ( 'openshiftToolkit' ) . update ( 'devModeRunOnPodman' , false ) ;
212
+ break ;
213
+ default :
214
+ return ;
215
+ }
216
+ } while ( choice === 'About Podman' )
217
+ }
197
218
return Component . dev ( component , 'podman' ) ;
198
219
}
199
220
You can’t perform that action at this time.
0 commit comments