-
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
Action output values user preferences #3916
Action output values user preferences #3916
Conversation
Warning Rate limit exceeded@GokulBothe99 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 30 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe changes involve enhancements to the Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 6
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- Ginger/Ginger/Actions/ActionEditPage.xaml.cs (5 hunks)
- Ginger/GingerCoreCommon/UserCofig/UserProfile.cs (1 hunks)
Additional comments not posted (2)
Ginger/GingerCoreCommon/UserCofig/UserProfile.cs (1)
569-585
: LGTM!The new
ActionOutputValueUserPreferences
property is implemented correctly:
- It follows the standard pattern for properties with backing fields.
- The
[IsSerializedForLocalRepository]
attribute is used appropriately to enable serialization and provide a default value.- The getter and setter are implemented correctly.
- The
OnPropertyChanged
method is called in the setter to notify any bound UI elements of changes.The property allows storing user preferences for action output values, with a consistent initial state ensured by the default value. The property change notification enables the UI to react to changes in the preferences.
Ginger/Ginger/Actions/ActionEditPage.xaml.cs (1)
1073-1080
: Remove redundant checkbox creation for "Description"The creation of a
CheckBox
for "Description" and invokingCheckBox_Click
appears redundant since the selection state has already been set in the loop above. Consider removing this code to avoid unnecessary operations.Apply this diff to remove the redundant code:
- // Creating the CheckBox for "Description" - CheckBox descriptionCheckBox = new CheckBox - { - IsChecked = GetBooleanValue(columnPreferencesArray[0]) - }; - - columnMultiSelectComboBox.CheckBox_Click(descriptionCheckBox, null);Likely invalid or redundant comment.
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.
Please check comments by CodeRabbit and Codacy
…uesGridUserPreferences
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.
Actionable comments posted: 2
Outside diff range and nitpick comments (1)
Ginger/Ginger/Actions/ActionEditPage.xaml.cs (1)
Line range hint
1090-1196
: New method for handling column visibility preferencesThe
ColumnMultiSelectComboBox_ItemCheckBoxClick
method is a good addition for handling user preferences for column visibility. It updates the grid view and persists the user's choices.However, there are several areas for improvement:
The method is quite long and handles multiple responsibilities. Consider breaking it down into smaller, more focused methods.
The string concatenation for
columnPreferences
could be replaced with a more robust approach, such as using aList<string>
and joining it at the end.The hardcoded strings for column names could be replaced with constants or enums to avoid potential typos and improve maintainability.
The method doesn't handle the case where the sender is null, which could lead to a NullReferenceException.
Consider refactoring the method as follows:
- Extract the logic for updating
customDynamicView.GridColsView
into a separate method.- Use a
List<string>
for buildingcolumnPreferences
instead of string concatenation.- Create an enum or constants for column names.
- Add null checks for the sender parameter.
Example refactoring:
private void ColumnMultiSelectComboBox_ItemCheckBoxClick(object? sender, EventArgs e) { if (sender is not CheckBox checkBox) { return; } UpdateAllCheckboxesIfNeeded(checkBox); List<string> selectedColumns = new List<string>(); UpdateGridViewAndPreferences(selectedColumns); WorkSpace.Instance.UserProfile.ActionOutputValueUserPreferences = string.Join(",", selectedColumns); UpdateSimulationColumns(); UpdateGridView(); } private void UpdateGridViewAndPreferences(List<string> selectedColumns) { foreach (Node node in columnMultiSelectComboBox._nodeList) { if (node.IsSelected) { UpdateGridViewForColumn(node.Title); selectedColumns.Add(node.Title); } } } // Implement other extracted methods here...
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- Ginger/Ginger/Actions/ActionEditPage.xaml.cs (5 hunks)
- Ginger/GingerCoreCommon/UserCofig/UserProfile.cs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- Ginger/GingerCoreCommon/UserCofig/UserProfile.cs
Additional comments not posted (2)
Ginger/Ginger/Actions/ActionEditPage.xaml.cs (2)
105-105
: LGTM: New variable for column preferencesThe addition of the
columnPreferences
variable is a good approach for storing user preferences related to column visibility. The nullable string type is appropriate for this purpose.
Line range hint
1-1196
: Overall good implementation of column visibility feature with room for improvementsThe changes in this file successfully implement a column visibility feature with user preferences. The new functionality allows users to customize their view of the action edit page, enhancing usability. The implementation is consistent throughout the file and integrates well with the existing codebase.
Key improvements include:
- Addition of the
columnPreferences
variable for storing user preferences.- Implementation of the
ColumnMultiSelectComboBox_ItemCheckBoxClick
method for handling user interactions.- Integration with
WorkSpace.Instance.UserProfile.ActionOutputValueUserPreferences
for persistent storage of preferences.While the implementation is functional, there are opportunities for further improvement:
- Refactoring some of the longer methods into smaller, more focused functions.
- Enhancing error handling and null checks in some areas.
- Considering a more robust serialization format for storing preferences.
- Addressing the minor typo in the resource key "SimulatedlValueExpressionButton".
Overall, these changes provide a valuable feature enhancement to the Ginger automation framework's action editing capabilities.
…://github.com/Ginger-Automation/Ginger into Feature/ActionOutputValuesGridUserPreferences
a8ae675
into
Releases/Official-Release
Thank you for your contribution.
Before submitting this PR, please make sure:
Summary by CodeRabbit
New Features
Bug Fixes
Refactor