Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added AI Generated Indicator. Also introduced Variable summary in value expression #3918

Merged
merged 7 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Ginger/Ginger/Activities/ActivitiesListViewHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,18 @@ public List<ListItemNotification> GetItemNotificationsList(object item)

notificationsList.Add(sharedRepoInd);
}
if (mActivity.AIGenerated)
{
ListItemNotification aIGeneratedInd = new ListItemNotification();
aIGeneratedInd.AutomationID = "aIGeneratedInd";
aIGeneratedInd.ImageType = Amdocs.Ginger.Common.Enums.eImageType.AIActivity;
aIGeneratedInd.ToolTip = string.Format("{0} is AI Generated", GingerDicser.GetTermResValue(eTermResKey.Activity));
aIGeneratedInd.ImageSize = 16;
aIGeneratedInd.BindingObject = mActivity;
aIGeneratedInd.BindingFieldName = nameof(RepositoryItemBase.AIGenerated);
aIGeneratedInd.BindingConverter = new BoolVisibilityConverter();
notificationsList.Add(aIGeneratedInd);
}
return notificationsList;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using GingerCore.Environments;
using GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib;
using GingerWPF.WizardLib;
using OpenQA.Selenium;

namespace Ginger.Environments.GingerAnalyticsEnvWizardLib
{
Expand Down Expand Up @@ -37,7 +36,7 @@ public override void Finish()
foreach(var appPlatform in tempAppPlat)
{
WorkSpace.Instance.Solution.ApplicationPlatforms.Add(appPlatform);
}
}

foreach (ProjEnvironment item in ImportedEnvs)
{
Expand Down
9 changes: 7 additions & 2 deletions Ginger/Ginger/Ginger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@
<None Remove="RunSetLib\CreateAutoRunWizardLib\AutoRunIntroduction.md" />
<None Remove="StaticDrivers\selenium-server-standalone.jar" />
<None Remove="TestLib\WizardLib\Intro.md" />
<None Remove="UserControlsLib\ImageMakerLib\Images\AIBrain.png" />
<None Remove="UserControlsLib\ImageMakerLib\Images\android.png" />
<None Remove="UserControlsLib\ImageMakerLib\Images\androidOutline.png" />
<None Remove="UserControlsLib\ImageMakerLib\Images\androidWhite.png" />
Expand Down Expand Up @@ -626,6 +627,7 @@
<None Remove="UserControlsLib\ImageMakerLib\Images\SealightsLogo.png" />
<None Remove="UserControlsLib\ImageMakerLib\Images\send.png" />
<None Remove="UserControlsLib\ImageMakerLib\Images\sendArrow.png" />
<None Remove="UserControlsLib\ImageMakerLib\Images\smart.svg" />
<None Remove="UserControlsLib\ImageMakerLib\Images\VRTLogo.png" />
<None Remove="UserControlsLib\ImageMakerLib\Images\xml.png" />
<None Remove="UserControlsLib\ImageMakerLib\Images\xml.svg" />
Expand Down Expand Up @@ -2436,7 +2438,10 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="TestLib\WizardLib\Intro.md" />
<Resource Include="UserControlsLib\ImageMakerLib\Images\android.png">
<Resource Include="UserControlsLib\ImageMakerLib\Images\AIBrain.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="UserControlsLib\ImageMakerLib\Images\android.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="UserControlsLib\ImageMakerLib\Images\androidOutline.png">
Expand Down Expand Up @@ -2521,7 +2526,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="UserControlsLib\ImageMakerLib\Images\VRTLogo.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="UserControlsLib\ImageMakerLib\Images\xml.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public static void SourceControlInit()
}
else if (WorkSpace.Instance.UserProfile.SourceControlType == SourceControlBase.eSourceControlType.None)
{
mSourceControl = new SVNSourceControl();
mSourceControl = new GITSourceControl();
}

if (mSourceControl != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ private void SetImage()
case eImageType.Activity:
SetAsFontAwesomeIcon(EFontAwesomeIcon.Solid_Bars);
break;
case eImageType.AIActivity:
SetAsStaticImage("AIBrain.png");
break;
case eImageType.Action:
SetAsFontAwesomeIcon(EFontAwesomeIcon.Solid_Bolt);
break;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions Ginger/Ginger/ValueExpression/ValueExpressionEditorPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<StackPanel Grid.Column="1" Grid.Row="0" Background="{StaticResource $BackgroundColor_White}" Margin="0,27,0,0">
<UserControls:ucButton x:Name="xClearButton" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="16" ButtonImageType="Delete" Click="xClearButton_Click" ToolTip="Clear Expression" Margin="-1,-5,0,0"/>
<UserControls:ucButton x:Name="xTestButton" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="16" ButtonImageType="Run" Click="xTestButton_Click" ToolTip="Calculate Expression" Margin="0,-5,0,0"/>
<UserControls:ucButton x:Name="xCopyButton" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="16" ButtonImageType="Copy" Click="xCopyExpressionButton_Click" ToolTip="Copy Expression" Margin="0,-5,0,0"/>
</StackPanel>

<!--<GridSplitter ResizeDirection="Rows" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Height="1" Background="Transparent" VerticalAlignment="Top" HorizontalAlignment="Stretch" IsEnabled="True" Margin="0,0,0,0"/>-->
Expand All @@ -59,9 +60,10 @@
</DockPanel>
</Border>

<DockPanel Grid.Column="1" Grid.Row="1" Margin="0,0,0,0">
<UserControls:ucButton x:Name="xClearCalculatedButton" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Top" ButtonFontImageSize="16" ButtonImageType="Delete" Click="xClearCalculatedButton_Click" ToolTip="Clear Calculation" DockPanel.Dock="Top" Margin="0,20,0,0"/>
</DockPanel>
<StackPanel Grid.Column="1" Grid.Row="1" Background="{StaticResource $BackgroundColor_White}" Margin="0,30,0,0">
<UserControls:ucButton x:Name="xClearCalculatedButton" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="16" ButtonImageType="Delete" Click="xClearCalculatedButton_Click" ToolTip="Clear Calculation" Margin="0,0,0,0"/>
<UserControls:ucButton x:Name="xCopyCalculatedButton" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="16" ButtonImageType="Copy" Click="xCopyCalculatedButton_Click" ToolTip="Copy Calculation" Margin="0,-5,0,0"/>
</StackPanel>
</Grid>
</Grid>
</Page>
28 changes: 27 additions & 1 deletion Ginger/Ginger/ValueExpression/ValueExpressionEditorPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@ private void xTestButton_Click(object sender, RoutedEventArgs e)
mVE.Value = this.xExpressionUCTextEditor.textEditor.Text;
xCalculatedTextBox.Text = mVE.ValueCalculated;
}

/// <summary>
/// Finds the selected environment from the total list of environments
/// </summary>
Expand All @@ -987,7 +988,6 @@ private void xTestButton_Click(object sender, RoutedEventArgs e)
return mEnvs.FirstOrDefault((mEnv) => mEnv.Guid == WorkSpace.Instance.UserProfile.RecentEnvironment);
}


private void OKButton_Click(object sender, RoutedEventArgs e)
{
string value = xExpressionUCTextEditor.textEditor.Text;
Expand Down Expand Up @@ -1176,5 +1176,31 @@ private void XObjectsTreeView_LostFocus(object sender, RoutedEventArgs e)

//}
}

/// <summary>
/// Copies the text from the calculated text box to the clipboard.
/// </summary>
/// <param name="sender">The button that triggered the event.</param>
/// <param name="e">The event arguments.</param>
private void xCopyCalculatedButton_Click(object sender, RoutedEventArgs e)
{
if (!string.IsNullOrEmpty(xCalculatedTextBox.Text))
{
GingerCore.General.SetClipboardText(xCalculatedTextBox.Text);
}
}
Maheshkale447 marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Copies the text from the expression text editor to the clipboard.
/// </summary>
/// <param name="sender">The button that triggered the event.</param>
/// <param name="e">The event arguments.</param>
private void xCopyExpressionButton_Click(object sender, RoutedEventArgs e)
{
if (!string.IsNullOrEmpty(xExpressionUCTextEditor.textEditor.Text))
{
GingerCore.General.SetClipboardText(xExpressionUCTextEditor.textEditor.Text);
}
}
Maheshkale447 marked this conversation as resolved.
Show resolved Hide resolved
}
}
1 change: 1 addition & 0 deletions Ginger/GingerCoreCommon/EnumsLib/eImageType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public enum eImageType
BusinessFlow,
ActivitiesGroup,
Activity,
AIActivity,
Action,
Agent,
RunSet,
Expand Down
11 changes: 9 additions & 2 deletions Ginger/GingerCoreCommon/GeneralLib/General.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#region License
#region License
/*
Copyright © 2014-2024 European Support Limited

Expand Down Expand Up @@ -504,6 +504,13 @@ public static Dictionary<string, object> DeserializeJson(string json)
return dictionary;
}
}


/// <summary>
/// Represents a minimal record of a variable, including its name, initial value, and current value.
/// </summary>
/// <param name="Name">The name of the variable.</param>
/// <param name="InitialValue">The initial value of the variable.</param>
/// <param name="CurrentValue">The current value of the variable.</param>
public record VariableMinimalRecord(string Name, string InitialValue, string CurrentValue);
}
Maheshkale447 marked this conversation as resolved.
Show resolved Hide resolved
}
33 changes: 25 additions & 8 deletions Ginger/GingerCoreCommon/Repository/BusinessFlowLib/Activity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ limitations under the License.
using GingerCore.Actions;
using GingerCore.Activities;
using GingerCore.FlowControlLib;
using GingerCore.Platforms;
using GingerCore.Variables;
using GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib;

using Microsoft.CodeAnalysis;

//TODO: change add core
namespace GingerCore
Expand Down Expand Up @@ -950,9 +949,9 @@ public static Activity CopySharedRepositoryActivity(Activity srActivity, bool or
return copy;
}

public override void UpdateInstance(RepositoryItemBase instance, string partToUpdate, RepositoryItemBase hostItem = null, object extradetails=null)
public override void UpdateInstance(RepositoryItemBase instance, string partToUpdate, RepositoryItemBase hostItem = null, object extradetails = null)
{

Activity activityInstance = (Activity)instance;
//Create new instance of source
Activity newInstance = null;
Expand All @@ -966,7 +965,7 @@ public override void UpdateInstance(RepositoryItemBase instance, string partToUp
newInstance.Type = activityInstance.Type;
newInstance.Active = activityInstance.Active;

if(newInstance.Guid == this.Guid)
if (newInstance.Guid == this.Guid)
{
newInstance.DevelopmentTime = newInstance.DevelopmentTime.Add(this.DevelopmentTime);
}
Expand All @@ -986,12 +985,12 @@ public override void UpdateInstance(RepositoryItemBase instance, string partToUp
else
{
newInstance = CopySharedRepositoryActivity(this, originFromSharedRepository: false);

if (this.Guid == activityInstance.Guid)
{
newInstance.DevelopmentTime = this.DevelopmentTime;
}
else
else
{
newInstance.DevelopmentTime = activityInstance.DevelopmentTime;
}
Expand Down Expand Up @@ -1201,6 +1200,7 @@ public override bool IsTempItem
return false;
}
}


public override bool IsLinkedItem
{
Expand All @@ -1217,7 +1217,7 @@ public override eImageType ItemImageType
{
get
{
return eImageType.Activity;
return AIGenerated ? eImageType.AIActivity : eImageType.Activity;
}
}

Expand Down Expand Up @@ -1268,5 +1268,22 @@ public override void PostSaveHandler()
}

public bool IsAutoLearned { get; set; }

/// <summary>
/// Gets the summary of variables in the activity.
/// </summary>
public List<General.VariableMinimalRecord> VariablesSummary
{
get
{
List<General.VariableMinimalRecord> variableDetails = [];
foreach (VariableBase variable in Variables)
{
variableDetails.Add(new General.VariableMinimalRecord(variable.Name, variable.GetInitialValue(), variable.Value));
}
return variableDetails;
}
}

Maheshkale447 marked this conversation as resolved.
Show resolved Hide resolved
}
}
16 changes: 16 additions & 0 deletions Ginger/GingerCoreCommon/Repository/BusinessFlowLib/BusinessFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2020,5 +2020,21 @@ public void CalculateExternalId(IValueExpression ve)
public string ALMTestSetLevel { get; set; }

public bool IsEntitySearchByName { get; set; }

/// <summary>
/// Gets the summary of variables in the Business flow.
/// </summary>
public List<General.VariableMinimalRecord> VariablesSummary
{
get
{
List<General.VariableMinimalRecord> variableDetails = [];
foreach (VariableBase variable in Variables)
{
variableDetails.Add(new General.VariableMinimalRecord(variable.Name, variable.GetInitialValue(), variable.Value));
}
return variableDetails;
}
}
Maheshkale447 marked this conversation as resolved.
Show resolved Hide resolved
}
}
4 changes: 4 additions & 0 deletions Ginger/GingerCoreCommon/VariablesLib/VariableBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -701,5 +701,9 @@ public static ObservableList<VariableBase> SortByMandatoryInput(ObservableList<V
}
return variables;
}

public virtual string GetInitialValue() {
return string.Empty;
}
}
}
5 changes: 5 additions & 0 deletions Ginger/GingerCoreCommon/VariablesLib/VariableDateTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,5 +252,10 @@ public override void SetInitialValue(string InitialValue)
{
this.InitialDateTime = InitialValue;
}

public override string GetInitialValue()
{
return InitialDateTime;
}
}
}
1 change: 1 addition & 0 deletions Ginger/GingerCoreCommon/VariablesLib/VariableList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,6 @@ public override void SetInitialValue(string InitialValue)
{
this.ValueList = InitialValue;
}

}
}
6 changes: 5 additions & 1 deletion Ginger/GingerCoreCommon/VariablesLib/VariableNumber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,12 @@ public bool CheckNumberInRange(float number)

public override void SetInitialValue(string InitialValue)
{

this.InitialNumberValue = InitialValue;
}

public override string GetInitialValue()
{
return InitialNumberValue;
}
}
}
5 changes: 5 additions & 0 deletions Ginger/GingerCoreCommon/VariablesLib/VariableString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,10 @@ public override void SetInitialValue(string InitialValue)
public override bool SupportResetValue { get { return true; } }

public override bool SupportAutoValue { get { return false; } }

public override string GetInitialValue()
{
return InitialStringValue;
}
}
}
8 changes: 4 additions & 4 deletions Ginger/GingerCoreNET/ActionsLib/ActCliOrchestration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,20 @@ private async Task ExecuteCliProcess()
string actualApplicationPath = WorkSpace.Instance.Solution.SolutionOperations.ConvertSolutionRelativePath(this.FilePath);
if ((Path.GetExtension(actualApplicationPath)).Equals(".vbs", StringComparison.InvariantCultureIgnoreCase) || (Path.GetExtension(actualApplicationPath)).Equals(".js",StringComparison.InvariantCultureIgnoreCase))
{
arguments.Append(actualApplicationPath).Append(" ");
arguments.Append(actualApplicationPath).Append(' ');
actualApplicationPath = GetSystemDirectory() + $"{Path.DirectorySeparatorChar}cscript.exe";
}
else if((Path.GetExtension(actualApplicationPath)).Equals(".sh", StringComparison.InvariantCultureIgnoreCase))
{
arguments.Append(actualApplicationPath).Append(" ");
arguments.Append(actualApplicationPath).Append(' ');
actualApplicationPath = $"{Path.DirectorySeparatorChar}bin{Path.DirectorySeparatorChar}bash";
}
foreach (var p in this.InputValues)
{
arguments.Append(p.Param).Append(" ");
arguments.Append(p.Param).Append(' ');
if (!string.IsNullOrEmpty(p.ValueForDriver))
{
arguments.Append(p.ValueForDriver).Append(" ");
arguments.Append(p.ValueForDriver).Append(' ');
}
}

Expand Down
Loading
Loading