Skip to content

Categories removed from regular activities#4276

Merged
Maheshkale447 merged 3 commits into
masterfrom
Feature/CategoriesRemovedFrom_RegularActivities
Aug 18, 2025
Merged

Categories removed from regular activities#4276
Maheshkale447 merged 3 commits into
masterfrom
Feature/CategoriesRemovedFrom_RegularActivities

Conversation

@jainamehta7

@jainamehta7 jainamehta7 commented Aug 12, 2025

Copy link
Copy Markdown

…ked activities

Thank you for your contribution.
Before submitting this PR, please make sure:

  • PR description and commit message should describe the changes done in this PR
  • Verify the PR is pointing to correct branch i.e. Release or Beta branch if the code fix is for specific release , else point it to master
  • Latest Code from master or specific release branch is merged to your branch
  • No unwanted\commented\junk code is included
  • No new warning upon build solution
  • Code Summary\Comments are added to my code which explains what my code is doing
  • Existing unit test cases are passed
  • New Unit tests are added for your development
  • Sanity Tests are successfully executed for New and Existing Functionality
  • Verify that changes are compatible with all relevant browsers and platforms.
  • After creating pull request there should not be any conflicts
  • Resolve all Codacy comments
  • Builds and checks are passed before PR is sent for review
  • Resolve code review comments
  • Update the Help Library document to match any feature changes

Summary by CodeRabbit

  • New Features
    • Activity Details includes a context-aware Categories panel.
    • The panel is hidden by default and contains preloaded content for smoother navigation.
    • In View and Shared Repository modes it is shown expanded and read-only.
    • In edit modes it appears for linked or referenced activities; otherwise remains hidden.

@coderabbitai

coderabbitai Bot commented Aug 12, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Adds a collapsed Categories Expander with a Frame to ActivityDetailsPage XAML and updates ActivityDetailsPage.UpdatePageViewMode to accept an Activity. UI logic now shows/enables/expands the expander based on page view mode, SharedRepository state, and activity linkage; callers (ActivityPage) pass mActivity through.

Changes

Cohort / File(s) Summary
UI markup: Categories Expander
Ginger/Ginger/Activities/ActivityDetailsPage.xaml
Adds xCategoriesExpander attribute Visibility="Collapsed" and an Expander.Content containing a Frame (xCategoriesFrame). Header and other attributes unchanged.
Details page logic and API
Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs
Changes signature UpdatePageViewMode(eRIPageViewMode)UpdatePageViewMode(eRIPageViewMode, Activity). Assigns mActivity, may call UpdateActivity(activity), then SetUI(). SetUI adjusts xCategoriesExpander per mode: View → visible, expanded, disabled; SharedRepository → visible & enabled; Edit/Other → visible & enabled only if activity.IsLinkedItem or activity.ParentGuid != Guid.Empty, else collapsed.
Caller update
Ginger/Ginger/Activities/ActivityPage.xaml.cs
Calls updated API: mConfigurationsPage.UpdatePageViewMode(mPageViewMode, mActivity) (passes Activity parameter).

Sequence Diagram(s)

sequenceDiagram
  participant AP as ActivityPage
  participant ADP as ActivityDetailsPage
  participant UI as SetUI

  AP->>ADP: UpdatePageViewMode(pageViewMode, activity)
  ADP->>ADP: mActivity = activity\n(optional) UpdateActivity(activity)
  ADP->>UI: SetUI()
  alt View mode
    UI->>UI: xCategoriesExpander Visible, Expanded, Disabled
  else SharedRepository mode
    UI->>UI: xCategoriesExpander Visible & Enabled
  else Edit/Other modes
    alt activity.IsLinkedItem OR activity.ParentGuid != Guid.Empty
      UI->>UI: xCategoriesExpander Visible & Enabled
    else
      UI->>UI: xCategoriesExpander Collapsed
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Possibly related PRs

Suggested reviewers

  • ravirk91
  • prashelke
  • Maheshkale447

Poem

I’m a rabbit in the XAML glen,
I tuck an Expander in my den.
Modes peek in to show or hide,
Activities decide inside.
Hop—frames ready for the categorized trend. 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Feature/CategoriesRemovedFrom_RegularActivities

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 comments (1)
Ginger/Ginger/Activities/ActivityDetailsPage.xaml (1)

87-94: Hide frame navigation chrome and avoid accidental focus

Minor UX polish: prevent the WPF Frame from showing navigation UI and from receiving focus unexpectedly.

Apply this diff:

-                <Expander.Content>
-                    <Frame x:Name="xCategoriesFrame"/>
-                </Expander.Content>
+                <Expander.Content>
+                    <Frame x:Name="xCategoriesFrame"
+                           NavigationUIVisibility="Hidden"
+                           Focusable="False"/>
+                </Expander.Content>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d186aab and ac19ce2.

📒 Files selected for processing (3)
  • Ginger/Ginger/Activities/ActivityDetailsPage.xaml (1 hunks)
  • Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs (3 hunks)
  • Ginger/Ginger/Activities/ActivityPage.xaml.cs (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
Ginger/Ginger/Activities/ActivityPage.xaml.cs (1)
Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs (1)
  • UpdatePageViewMode (65-70)
Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs (2)
Ginger/GingerCoreCommon/Repository/BusinessFlowLib/Activity.cs (3)
  • Activity (81-1351)
  • Activity (142-149)
  • Activity (940-962)
Ginger/GingerCoreCommon/Repository/BusinessFlowLib/BusinessFlow.cs (2)
  • Activity (1610-1618)
  • Activity (1620-1646)
🔇 Additional comments (3)
Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs (2)

65-70: Make UpdatePageViewMode robust to Activity changes

Verified that the only two-argument call to UpdatePageViewMode is in ActivityPage.xaml.cs (mConfigurationsPage.UpdatePageViewMode). No other usages pass an Activity, so applying the conditional flow is safe and prevents stale bindings when the Activity changes.

Locations to update:

  • Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs (method UpdatePageViewMode)

Apply this diff:

 public void UpdatePageViewMode(Ginger.General.eRIPageViewMode pageViewMode, Activity activity)
 {
   mPageViewMode = pageViewMode;
-  mActivity = activity;
-  SetUI();
+  if (!ReferenceEquals(mActivity, activity))
+  {
+      UpdateActivity(activity);
+  }
+  else
+  {
+      SetUI();
+  }
 }

91-94: Confirm Category Expander Visibility in View Modes

Currently, in SetUI() for View/ViewAndExecute (lines 91–93), the expander is always shown (Visible, Expanded, Disabled), whereas in Edit modes it’s only shown for linked/shared activities. If the intent of this PR is to hide Categories entirely for regular activities, you’ll need to apply the same conditional logic in the View branches:

--- a/Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs
+++ b/Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs
@@ private void SetUI()
-                xCategoriesExpander.Visibility = Visibility.Visible;
-                xCategoriesExpander.IsExpanded = true;
-                xCategoriesExpander.IsEnabled = false;
+                // Show only for linked/shared activities in View modes
+                bool showCategoriesInView = mActivity != null
+                    && (mActivity.Type == Amdocs.Ginger.Repository.eSharedItemType.Link
+                        || mActivity.ParentGuid != Guid.Empty);
+                xCategoriesExpander.Visibility = showCategoriesInView 
+                    ? Visibility.Visible 
+                    : Visibility.Collapsed;
+                xCategoriesExpander.IsExpanded = showCategoriesInView;
+                xCategoriesExpander.IsEnabled = false;

Please verify that hiding the Categories expander for regular activities in View/ViewAndExecute modes aligns with the PR’s goals.

Ginger/Ginger/Activities/ActivityPage.xaml.cs (1)

167-168: LGTM: Caller updated to new API signature

Passing mActivity into UpdatePageViewMode aligns with the new signature and ensures the details page has the current Activity context.

Comment thread Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs Outdated
Comment thread Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs (1)

127-131: Bug: SharedRepo column width is collapsed and never restored

You collapse xSharedRepoInstanceUCCol to width 0 in SharedReposiotry mode but never restore it when leaving that mode. The column will remain collapsed for subsequent SetUI calls.

Recommend capturing the initial width and restoring it when not in SharedReposiotry mode.

Proposed implementation (outside the selected lines):

// Add fields to the class
private GridLength _sharedRepoInitialWidth;
private bool _sharedRepoWidthCaptured;

// In constructor, after InitializeComponent():
if (!_sharedRepoWidthCaptured)
{
    _sharedRepoInitialWidth = xSharedRepoInstanceUCCol.Width;
    _sharedRepoWidthCaptured = true;
}

Inside SetUI(), in the SharedReposiotry branch (keep your current code that sets width to 0), and add at the end of SetUI():

// Restore column width when not in SharedReposiotry mode
if (mPageViewMode != Ginger.General.eRIPageViewMode.SharedReposiotry)
{
    if (_sharedRepoWidthCaptured && Math.Abs(xSharedRepoInstanceUCCol.Width.Value) < double.Epsilon)
    {
        xSharedRepoInstanceUCCol.Width = _sharedRepoInitialWidth;
        xSharedRepoInstanceUC.Visibility = Visibility.Visible;
    }
}

Optionally verify where the column is defined to confirm the initial width captured matches the XAML default:

#!/bin/bash
rg -n -A 2 -B 2 'xSharedRepoInstanceUCCol|xSharedRepoInstanceUC' -- '*.xaml' '*/ActivityDetailsPage*'
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ac19ce2 and 296e4b6.

📒 Files selected for processing (1)
  • Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-07-26T22:04:12.930Z
Learnt from: IamRanjeetSingh
PR: Ginger-Automation/Ginger#0
File: :0-0
Timestamp: 2024-07-26T22:04:12.930Z
Learning: The comment regarding the use of `referenceActivity.Guid` instead of `itemCopy.Guid` in the `MarkActivityAsLink` method is considered outdated by the user IamRanjeetSingh.

Applied to files:

  • Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs
🧬 Code Graph Analysis (1)
Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs (2)
Ginger/GingerCoreCommon/Repository/BusinessFlowLib/Activity.cs (3)
  • Activity (81-1351)
  • Activity (142-149)
  • Activity (940-962)
Ginger/Ginger/Actions/ActionEditPages/ActWebSmartSyncEditPage.xaml.cs (1)
  • Visibility (124-139)
🔇 Additional comments (2)
Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs (2)

91-94: LGTM: predictable read-only Categories in View modes

Making Categories visible, expanded, and disabled in View/View+Execute gives users consistent read-only visibility without edit affordances. Looks good.


113-121: Correct: guarded and semantic check for linked items

Good null-guard and usage of IsLinkedItem combined with ParentGuid check. This aligns with intent to show Categories only for linked/parented activities in edit modes.

Comment thread Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 296e4b6 and cdf8c3e.

📒 Files selected for processing (1)
  • Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-07-26T22:04:12.930Z
Learnt from: IamRanjeetSingh
PR: Ginger-Automation/Ginger#0
File: :0-0
Timestamp: 2024-07-26T22:04:12.930Z
Learning: The comment regarding the use of `referenceActivity.Guid` instead of `itemCopy.Guid` in the `MarkActivityAsLink` method is considered outdated by the user IamRanjeetSingh.

Applied to files:

  • Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs
🧬 Code Graph Analysis (1)
Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs (2)
Ginger/GingerCoreCommon/Repository/BusinessFlowLib/Activity.cs (3)
  • Activity (81-1351)
  • Activity (142-149)
  • Activity (940-962)
Ginger/Ginger/Activities/ActivityPage.xaml.cs (1)
  • UpdateActivity (230-250)
🔇 Additional comments (2)
Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs (2)

94-97: View/Execute mode: Correctly shows and locks Categories

Making the Categories expander visible, expanded, and read-only in View/Execute mode matches the intent to allow viewing without editing.


116-124: Null-guard + IsLinkedItem usage — thanks for addressing the earlier suggestion

Condition now guards against null and uses IsLinkedItem with ParentGuid fallback; visibility/enabled states look correct for linked items only.

Comment thread Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs
Comment thread Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs
Comment thread Ginger/Ginger/Activities/ActivityDetailsPage.xaml.cs
@Maheshkale447
Maheshkale447 merged commit 81f74b3 into master Aug 18, 2025
10 of 22 checks passed
@Maheshkale447
Maheshkale447 deleted the Feature/CategoriesRemovedFrom_RegularActivities branch August 18, 2025 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants