-
Notifications
You must be signed in to change notification settings - Fork 61
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
[DefectID: 39207] Environment Application name is changed after Target Application name is changed #3702
Merged
Maheshkale447
merged 2 commits into
Releases/Official-Release
from
Defect/EnvApplicationNameChanged
May 14, 2024
Merged
[DefectID: 39207] Environment Application name is changed after Target Application name is changed #3702
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ limitations under the License. | |
using Ginger.UserControls; | ||
using Ginger.UserControlsLib; | ||
using GingerCore; | ||
using GingerCore.Environments; | ||
using GingerCore.Platforms; | ||
using GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib; | ||
using System.Collections.Generic; | ||
|
@@ -224,6 +225,19 @@ private void UpdateApplicationNameChangeInSolution(ApplicationPlatform app) | |
} | ||
} | ||
|
||
foreach(ProjEnvironment projEnv in WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems<ProjEnvironment>()) | ||
{ | ||
foreach (EnvApplication envApplication in projEnv.Applications) | ||
{ | ||
|
||
if(string.Equals(envApplication.Name, app.NameBeforeEdit)) | ||
{ | ||
projEnv.StartDirtyTracking(); | ||
envApplication.Name = app.AppName; | ||
} | ||
} | ||
} | ||
|
||
Comment on lines
+228
to
+240
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure proper error handling and logging. The new logic for updating application names in project environments does not include error handling or logging. Consider adding error handling to manage potential issues and logging to track changes for debugging purposes. try
{
foreach (ProjEnvironment projEnv in WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems<ProjEnvironment>())
{
foreach (EnvApplication envApplication in projEnv.Applications)
{
if (string.Equals(envApplication.Name, app.NameBeforeEdit))
{
projEnv.StartDirtyTracking();
envApplication.Name = app.AppName;
}
}
}
}
catch (Exception ex)
{
Reporter.ToUser(eUserMsgKey.StaticErrorMessage, $"An error occurred while updating application names: {ex.Message}");
// Optionally log the exception
} |
||
if(numOfAfectedItems > 0 && OnActivityUpdate!=null) | ||
{ | ||
OnActivityUpdate(); | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary import statement.
The import statement
using GingerCore.Environments;
is not used in the code. Consider removing it to keep the code clean and maintainable.- using GingerCore.Environments;
Committable suggestion