@@ -747,6 +747,15 @@ private void SwitchingInputValueBoxAndGrid(Act a)
747747 //for CLI Orchestration need to show by default
748748 minimumInputValuesToHideGrid = - 1 ;
749749 }
750+ if ( a . GetType ( ) == typeof ( ActPublishArtifacts ) )
751+ {
752+ minimumInputValuesToHideGrid = - 1 ;
753+ xInputValuesGrid . Title = "File Path of Artifacts to be Published." ;
754+ }
755+ else
756+ {
757+ xInputValuesGrid . Title = "Input Value(s)" ;
758+ }
750759
751760 if ( a . GetType ( ) != typeof ( ActDBValidation ) && a . GetType ( ) != typeof ( ActTableElement ) &&
752761 a . GetType ( ) != typeof ( ActLaunchJavaWSApplication ) && a . GetType ( ) != typeof ( ActJavaEXE ) &&
@@ -907,7 +916,20 @@ private void RefreshOutputValuesGridElements(object sender, RoutedEventArgs e)
907916
908917 private void AddInputValue ( object sender , RoutedEventArgs e )
909918 {
910- mAction . InputValues . Add ( new ActInputValue ( ) { Param = "p" + mAction . InputValues . Count } ) ;
919+ mAction . InputValues . Add ( new ActInputValue ( )
920+ {
921+ Param = GetUniqueParamName ( )
922+ } ) ;
923+ }
924+
925+ private string GetUniqueParamName ( )
926+ {
927+ if ( mAction is ActPublishArtifacts )
928+ {
929+ return "Artifact " + ( mAction . InputValues . Select ( iv => int . TryParse ( iv . Param . AsSpan ( "Artifact " . Length ) , out var n ) ? n : - 1 ) . DefaultIfEmpty ( - 1 ) . Max ( ) + 1 ) ;
930+ }
931+
932+ return "p" + ( mAction . InputValues . Select ( iv => int . TryParse ( iv . Param ? . TrimStart ( 'p' ) , out var n ) ? n : - 1 ) . DefaultIfEmpty ( - 1 ) . Max ( ) + 1 ) ;
911933 }
912934
913935 private void SetActDataSourceConfigGrid ( )
@@ -968,7 +990,7 @@ private void SetActReturnValuesGrid()
968990 viewCols . Add ( new GridColView ( ) { Field = "....." , Header = " ..." , WidthWeight = 30 , MaxWidth = 30 , StyleType = GridColView . eGridColStyleType . Template , CellTemplate = ( DataTemplate ) this . xPageGrid . Resources [ "SimulatedlValueExpressionButton" ] } ) ;
969991 viewCols . Add ( new GridColView ( ) { Field = "<<" , WidthWeight = 30 , MaxWidth = 30 , StyleType = GridColView . eGridColStyleType . Template , CellTemplate = ( DataTemplate ) this . xPageGrid . Resources [ "AddActualToSimulButton" ] } ) ;
970992 viewCols . Add ( new GridColView ( ) { Field = ActReturnValue . Fields . Actual , Header = "Actual Value" , WidthWeight = 180 , BindingMode = BindingMode . OneWay } ) ;
971- viewCols . Add ( new GridColView ( ) { Field = "......." , Header = "..." , WidthWeight = 30 , MaxWidth = 30 , StyleType = GridColView . eGridColStyleType . Template , CellTemplate = ( DataTemplate ) this . xPageGrid . Resources [ "ShowActualValueButton" ] } ) ;
993+ viewCols . Add ( new GridColView ( ) { Field = "......." , Header = "..." , WidthWeight = 30 , MaxWidth = 30 , StyleType = GridColView . eGridColStyleType . Template , CellTemplate = ( DataTemplate ) this . xPageGrid . Resources [ "ShowActualValueButton" ] } ) ;
972994 viewCols . Add ( new GridColView ( ) { Field = ">>" , WidthWeight = 30 , MaxWidth = 30 , StyleType = GridColView . eGridColStyleType . Template , CellTemplate = ( DataTemplate ) this . xPageGrid . Resources [ "AddActualToExpectButton" ] } ) ;
973995 viewCols . Add ( new GridColView ( ) { Field = nameof ( ActReturnValue . Operator ) , Header = "Operator" , WidthWeight = 130 , BindingMode = BindingMode . TwoWay , StyleType = GridColView . eGridColStyleType . ComboBox , CellValuesList = OperatorList } ) ;
974996 // viewCols.Add(new GridColView() { Field = ">>", WidthWeight = 30, StyleType = GridColView.eGridColStyleType.Template, CellTemplate = (DataTemplate)this.pageGrid.Resources["AddActualToExpectButton"] });
@@ -1159,6 +1181,7 @@ private void ColumnMultiSelectComboBox_ItemCheckBoxClick(object? sender, EventAr
11591181
11601182 case "Actual Value" :
11611183 customDynamicView . GridColsView . Add ( new GridColView ( ) { Field = ActReturnValue . Fields . Actual , Visible = node . IsSelected , WidthWeight = 180 } ) ;
1184+ customDynamicView . GridColsView . Add ( new GridColView ( ) { Field = "......." , Header = " ..." , Visible = node . IsSelected } ) ;
11621185 customDynamicView . GridColsView . Add ( new GridColView ( ) { Field = ">>" , Visible = node . IsSelected } ) ;
11631186 columnCount = node . IsSelected ? columnCount + 1 : columnCount ;
11641187 columnPreferences += node . IsSelected ? "ActualValue," : "" ;
@@ -1262,26 +1285,26 @@ private void SetActInputValuesGrid()
12621285 {
12631286 //Show/hide if needed
12641287 xInputValuesGrid . SetTitleLightStyle = true ;
1265- xInputValuesGrid . btnAdd . AddHandler ( Button . ClickEvent , new RoutedEventHandler ( AddInputValue ) ) ; //?? going to be hide in next line code
1288+ xInputValuesGrid . btnAdd . RemoveHandler ( Button . ClickEvent , new RoutedEventHandler ( AddInputValue ) ) ;
1289+ xInputValuesGrid . btnAdd . AddHandler ( Button . ClickEvent , new RoutedEventHandler ( AddInputValue ) ) ;
12661290
12671291 xInputValuesGrid . ClearTools ( ) ;
12681292 xInputValuesGrid . ShowDelete = System . Windows . Visibility . Visible ;
1269- if ( mAction . GetType ( ) == typeof ( ActCLIOrchestration ) )
1293+ if ( mAction . GetType ( ) == typeof ( ActCLIOrchestration ) || mAction . GetType ( ) == typeof ( ActPublishArtifacts ) )
12701294 {
12711295 xInputValuesGrid . ShowAdd = System . Windows . Visibility . Visible ;
12721296 xInputValuesGrid . ShowClearAll = System . Windows . Visibility . Visible ;
12731297 }
12741298
1275- //List<GridColView> view = new List<GridColView>() ;
1276- GridViewDef view = new GridViewDef ( GridViewDef . DefaultViewName )
1299+ GridViewDef view ;
1300+ if ( mAction . GetType ( ) == typeof ( ActPublishArtifacts ) )
12771301 {
1278- GridColsView =
1279- [
1280- new GridColView ( ) { Field = nameof ( ActInputValue . Param ) , WidthWeight = 40 } ,
1281- new GridColView ( ) { Field = nameof ( ActInputValue . Value ) , WidthWeight = 55 } ,
1282- new GridColView ( ) { Field = "..." , WidthWeight = 5 , StyleType = GridColView . eGridColStyleType . Template , CellTemplate = ( DataTemplate ) this . xPageGrid . Resources [ "InputValueExpressionButton" ] } ,
1283- ]
1284- } ;
1302+ view = GetGridViewForFilePathsInputValues ( ) ;
1303+ }
1304+ else
1305+ {
1306+ view = GetGridViewForParamValueInputValues ( ) ;
1307+ }
12851308 //view.GridColsView.Add(new GridColView() { Field = nameof(ActInputValue.ValueForDriver), Header = "Value ForDriver", WidthWeight = 150, BindingMode = BindingMode.OneWay });
12861309
12871310 xInputValuesGrid . SetAllColumnsDefaultView ( view ) ;
@@ -1290,6 +1313,31 @@ private void SetActInputValuesGrid()
12901313 xInputValuesGrid . DataSourceList = mAction . InputValues ;
12911314 }
12921315
1316+ private GridViewDef GetGridViewForParamValueInputValues ( )
1317+ {
1318+ return new GridViewDef ( GridViewDef . DefaultViewName )
1319+ {
1320+ GridColsView = [
1321+ new GridColView ( ) { Field = nameof ( ActInputValue . Param ) , WidthWeight = 10 } ,
1322+ new GridColView ( ) { Field = nameof ( ActInputValue . Value ) , WidthWeight = 55 } ,
1323+ new GridColView ( ) { Field = "..." , WidthWeight = 5 , StyleType = GridColView . eGridColStyleType . Template , CellTemplate = ( DataTemplate ) this . xPageGrid . Resources [ "InputValueExpressionButton" ] }
1324+ ]
1325+ } ;
1326+ }
1327+
1328+ private GridViewDef GetGridViewForFilePathsInputValues ( )
1329+ {
1330+ return new GridViewDef ( "OnlyFilePaths" )
1331+ {
1332+ GridColsView = [
1333+ new GridColView ( ) { Field = nameof ( ActInputValue . Param ) , Visible = false } ,
1334+ new GridColView ( ) { Field = nameof ( ActInputValue . Value ) , WidthWeight = 55 } ,
1335+ new GridColView ( ) { Field = "..." , WidthWeight = 5 , StyleType = GridColView . eGridColStyleType . Template , CellTemplate = ( DataTemplate ) this . xPageGrid . Resources [ "InputValueExpressionButton" ] } ,
1336+ new GridColView ( ) { Field = "Browse" , WidthWeight = 10 , StyleType = GridColView . eGridColStyleType . Template , CellTemplate = ( DataTemplate ) this . xPageGrid . Resources [ "GridInputValuesBrowseBtnTemplate" ] }
1337+ ]
1338+ } ;
1339+ }
1340+
12931341 private void LoadOperationSettingsEditPage ( Act a )
12941342 {
12951343 //Each Action need to implement ActionEditPage which return the name of the page for edit
@@ -1302,7 +1350,14 @@ private void LoadOperationSettingsEditPage(Act a)
13021350 {
13031351 // Load the page
13041352 xActionPrivateConfigsFrame . SetContent ( actEditPage ) ;
1305- xActionPrivateConfigsFrame . Visibility = System . Windows . Visibility . Visible ;
1353+ if ( actEditPage is ActPublishArtifactsEditPage )
1354+ {
1355+ xActionPrivateConfigsFrame . Visibility = Visibility . Collapsed ;
1356+ }
1357+ else
1358+ {
1359+ xActionPrivateConfigsFrame . Visibility = System . Windows . Visibility . Visible ;
1360+ }
13061361 }
13071362 }
13081363 else
@@ -2474,6 +2529,19 @@ private void xTimeoutTextBox_PreviewTextInput(object sender, TextCompositionEven
24742529
24752530 }
24762531
2532+ private void GridInputValuesBrowseBtn_Click ( object sender , RoutedEventArgs e )
2533+ {
2534+ ActInputValue item = ( ActInputValue ) xInputValuesGrid . CurrentItem ;
24772535
2536+ if ( General . SetupBrowseFile ( new System . Windows . Forms . OpenFileDialog ( )
2537+ {
2538+ DefaultExt = "*.*" ,
2539+ Filter = "All files (All Files)|*.*"
2540+ } ) is string fileName )
2541+ {
2542+ item . Value = fileName ;
2543+ xInputValuesGrid . DataSourceList . CurrentItem = item ;
2544+ }
2545+ }
24782546 }
24792547}
0 commit comments