Skip to content

Commit

Permalink
Merge pull request #4083 from Ginger-Automation/BugFix/ReportTemplate…
Browse files Browse the repository at this point in the history
…Error

Report Template preview issue
  • Loading branch information
Maheshkale447 authored Feb 4, 2025
2 parents c8b3ad8 + a37eef1 commit 2234fdd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Ginger/Ginger/Reports/HTMLReportTemplatePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</DockPanel>

<StackPanel Margin="5,0,0,0" Orientation="Horizontal" >
<TextBox x:Name="NewTemplateNameTextBox" Width="484px" Style="{StaticResource @TextBoxStyle}" TextChanged="NewTemplateName_TextChanged" ></TextBox>
<TextBox x:Name="NewTemplateNameTextBox" Width="484px" Style="{StaticResource @TextBoxStyle}" TextChanged="NewTemplateName_TextChanged" LostFocus="NewTemplateNameTextBox_LostFocus"></TextBox>
</StackPanel>
</StackPanel>
<StackPanel x:Name="TemplateDescription" Margin="10,10,0,0" HorizontalAlignment="Left">
Expand Down
13 changes: 12 additions & 1 deletion Ginger/Ginger/Reports/HTMLReportTemplatePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public partial class HTMLReportTemplatePage : GingerUIPage

private string mPreviewDummyReportDataPath = string.Empty;
private string mPreviewDummyReportPath = string.Empty;
private string mDefaultReportTemplateName = string.Empty;

public HTMLReportConfiguration newHTMLReportConfiguration
{
Expand Down Expand Up @@ -277,6 +278,7 @@ private void SetControls()
{
SetIsDefualtImage();
NewTemplateNameTextBox.Text = _HTMLReportConfiguration.Name.ToString();
mDefaultReportTemplateName = _HTMLReportConfiguration.Name.ToString();
xShowIDUC.Init(_HTMLReportConfiguration);
TemplateDescriptionTextBox.BindControl(_HTMLReportConfiguration, nameof(HTMLReportConfiguration.Description));
htmlShowFirstIterationOnRadioBtn.IsChecked = _HTMLReportConfiguration.ShowAllIterationsElements;
Expand Down Expand Up @@ -354,6 +356,7 @@ private void SetControlsNewTemplate()
SetIsDefualtImage();
NewTemplateNameTextBox.Text = _HTMLReportConfiguration.Name.ToString();
TemplateDescriptionTextBox.Text = _HTMLReportConfiguration.Description.ToString();
mDefaultReportTemplateName = _HTMLReportConfiguration.Name.ToString();
//htmlDefaultOnRadioBtn.IsChecked = _HTMLReportConfiguration.IsDefault;
//htmlDefaultOffRadioBtn.IsChecked = !_HTMLReportConfiguration.IsDefault;
htmlShowFirstIterationOnRadioBtn.IsChecked = _HTMLReportConfiguration.ShowAllIterationsElements;
Expand Down Expand Up @@ -1031,6 +1034,14 @@ private void _HTMLReportConfiguration_PropertyChanged(object sender, System.Comp
SetIsDefualtImage();
}
}


private void NewTemplateNameTextBox_LostFocus(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(NewTemplateNameTextBox.Text))
{
NewTemplateNameTextBox.Text = mDefaultReportTemplateName;
}
}

}
}
10 changes: 9 additions & 1 deletion Ginger/GingerCoreNET/Reports/ActionReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,15 @@ public DataTable OutputValuesDT
dr["ActualValue"] = elementsAfter[1];
dr["ExpectedValue"] = elementsAfter[2];
dr["Status"] = elementsAfter[3];
dr["Description"] = elementsAfter[4];
if (elementsAfter.Length > 4)
{
dr["Description"] = elementsAfter[4];
}
else
{
dr["Description"] = string.Empty;
}

dt.Rows.Add(dr);
}
return dt;
Expand Down

0 comments on commit 2234fdd

Please sign in to comment.