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

fix: Add web app flow for partially enrolled cards #3439

Open
wants to merge 5 commits into
base: FYLE-86cx2t82k-add-remaining-fixes
Choose a base branch
from

Conversation

bistaastha
Copy link
Contributor

@bistaastha bistaastha commented Jan 24, 2025

Preview - on clicking Continue, the user will configure the step:
Screenshot 2025-01-23 at 12 35 30 PM

Summary by CodeRabbit

  • Style Updates

    • Adjusted button width and margin in the spender onboarding connect card step component
    • Updated popup alert component styling to handle primary call-to-action container
  • User Experience Improvements

    • Refined messaging for card enrollment outcomes
    • Modified popover button text logic based on card enrollment status
    • Updated conditional rendering in the my profile page
  • Onboarding Process

    • Adjusted step completion and skipping logic in onboarding flow
    • Streamlined sidemenu options based on onboarding redirection status

Copy link

coderabbitai bot commented Jan 24, 2025

Walkthrough

Listen up, superstar! This pull request is a grand makeover of the spender onboarding flow, with precise adjustments across various components. We’ve fine-tuned the connect card step, revamped popup alerts, and modified the onboarding page's behavior. Each change is like a well-placed punch in an action scene, enhancing the user experience with clarity and style!

Changes

File Change Summary
src/app/fyle/spender-onboarding/.../spender-onboarding-connect-card-step.component.scss Reduced primary CTA button width from 50% to 40%, removed margin-bottom
src/app/fyle/spender-onboarding/.../spender-onboarding-connect-card-step.component.ts Updated message generation, modified popover button text logic, added conditional step completion emission
src/app/fyle/spender-onboarding/spender-onboarding.page.ts Removed this.onboardingComplete = true from skipOnboardingStep method
src/app/shared/components/popup-alert/.../popup-alert.component.html Enhanced class binding for CTA container
src/app/shared/components/popup-alert/.../popup-alert.component.scss Added .popup-alert--primary-cta-container with width and padding
src/app/fyle/my-profile/.../my-profile.page.html Updated conditional rendering logic for nested <ng-container> based on onboardingPending
src/app/fyle/my-profile/.../my-profile.page.ts Changed onboardingPending$ observable type and source method
src/app/shared/components/sidemenu/.../sidemenu.component.ts Modified setupSideMenu method to use checkForRedirectionToOnboarding instead of getOnboardingStatus

Possibly related PRs

Suggested Labels

size/L

Suggested Reviewers

  • Chethan-Fyle
  • arjunaj5

Poem

In the realm of code, where pixels dance,
Onboarding steps take a stylish stance.
Buttons shrink, messages refine,
Rajini's touch makes logic shine! 🚀✨
Superstar coding, breaking the frame! 💥

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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?

❤️ 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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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 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

Documentation and Community

  • 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.

@github-actions github-actions bot added the size/S Small PR label Jan 24, 2025
@github-actions github-actions bot added size/M Medium PR and removed size/S Small PR labels Jan 24, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
src/app/fyle/my-profile/my-profile.page.ts (1)

Line range hint 48-48: Aiyyo, remove the unused OnboardingState import to fix lint error.

Thalaiva, pipeline is complaining about OnboardingState at line 48. Either use it or kick it out, da!

- import { OnboardingState } from 'src/app/core/models/onboarding-state.enum';
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 189bb74 and 3320bee.

📒 Files selected for processing (3)
  • src/app/fyle/my-profile/my-profile.page.html (1 hunks)
  • src/app/fyle/my-profile/my-profile.page.ts (2 hunks)
  • src/app/shared/components/sidemenu/sidemenu.component.ts (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Lint
src/app/fyle/my-profile/my-profile.page.ts

[error] 48-48: 'OnboardingState' is defined but never used

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: gitStream.cm
  • GitHub Check: build (12.x)
🔇 Additional comments (3)
src/app/shared/components/sidemenu/sidemenu.component.ts (1)

398-401: 🧹 Nitpick (assertive)

Aiyyo, verify the meaning of redirectionAllowed.

My friend, passing redirectionAllowed to a parameter named isOnboardingPending can confuse future readers, da. If true means the user needs onboarding, rename accordingly for crystal-clear intent.

- ...this.getPrimarySidemenuOptions(isConnected, redirectionAllowed),
- ...this.getSecondarySidemenuOptions(orgs, isDelegatee, isConnected, redirectionAllowed),
+ ...this.getPrimarySidemenuOptions(isConnected, isOnboardingPending),
+ ...this.getSecondarySidemenuOptions(orgs, isDelegatee, isConnected, isOnboardingPending),
✅ Verification successful

Mind it! The review is spot on, machan! Let me break it down for you.

Looking at how this redirectionAllowed is used across the codebase, it's crystal clear that when it's true, it means the user must complete onboarding. The current name is like serving sambhar without rice - it just doesn't make sense! Other files are already using better names like shouldRedirectToOnboarding and shouldProceedToOnboarding.

The suggested name isOnboardingPending is perfect because:

  • It matches how the value is actually used in the guards and pages
  • It clearly tells other developers that onboarding is pending
  • It follows the proper boolean naming style, no confusion!
🏁 Scripts executed

The following scripts were executed for the analysis:

Error: No shell scripts found


Script:

#!/bin/bash

# Find implementation of checkForRedirectionToOnboarding
echo "=== Searching for checkForRedirectionToOnboarding implementation ==="
ast-grep --pattern 'checkForRedirectionToOnboarding() {
  $$$
}'

# Find implementations of menu option methods
echo -e "\n=== Searching for getPrimarySidemenuOptions implementation ==="
ast-grep --pattern 'getPrimarySidemenuOptions($$$) {
  $$$
}'

echo -e "\n=== Searching for getSecondarySidemenuOptions implementation ==="
ast-grep --pattern 'getSecondarySidemenuOptions($$$) {
  $$$
}'

# Search for related patterns
echo -e "\n=== Searching for related redirection patterns ==="
rg "redirectionAllowed|checkForRedirectionToOnboarding" -A 3

Length of output: 3463

src/app/fyle/my-profile/my-profile.page.ts (1)

193-195: Check logical consistency with redirectionAllowed.

Superstar, confirm this pipe logic matches your new onboarding flow. If hide_other_options: redirectionAllowed is actually the same concept, all is well. Otherwise, rename for readability, da!

src/app/fyle/my-profile/my-profile.page.html (1)

16-16: Confirm conditional usage.

Thalaiva, *ngIf="onboardingPending.hide_other_options" suggests you're hiding sections if true. Double-check that logic matches your user stories, da!

@@ -103,7 +103,7 @@

isUserFromINCluster$: Observable<boolean>;

onboardingPending$: Observable<{ is_pending: boolean }>;
onboardingPending$: Observable<{ hide_other_options: boolean }>;
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Aha, rename for clarity.

hide_other_options can be misunderstood, da. Consider shouldHideOtherOptions or something more descriptive to reveal the intent.

- onboardingPending$: Observable<{ hide_other_options: boolean }>;
+ onboardingPending$: Observable<{ shouldHideOtherOptions: boolean }>;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
onboardingPending$: Observable<{ hide_other_options: boolean }>;
onboardingPending$: Observable<{ shouldHideOtherOptions: boolean }>;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Medium PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant