Skip to content

feat: hide qbd iif from landing, disable export cta#1153

Merged
Hrishabh17 merged 3 commits intomasterfrom
qbd-iif-migration-changes
Jan 17, 2025
Merged

feat: hide qbd iif from landing, disable export cta#1153
Hrishabh17 merged 3 commits intomasterfrom
qbd-iif-migration-changes

Conversation

@Hrishabh17
Copy link
Member

@Hrishabh17 Hrishabh17 commented Jan 17, 2025

Description

hide qbd iif from landing, disable export cta

Clickup

https://app.clickup.com/

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a new property to track QuickBooks Desktop (QBD) workspace migration status
    • Introduced conditional rendering for QBD IIF integration based on organization creation date
  • Improvements

    • Enhanced QBD dashboard export button control
    • Added storage-based management for export button availability
  • Bug Fixes

    • Refined QBD integration visibility conditions

@Hrishabh17 Hrishabh17 requested a review from ashwin1111 January 17, 2025 09:19
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2025

Walkthrough

This pull request introduces changes related to QuickBooks Desktop (QBD) integration and migration tracking. The modifications include adding a new migrated_to_qbd_direct boolean property to the QBDWorkspace interface, updating the landing page integration display logic, and implementing a storage mechanism to control the export button's state based on the workspace migration status.

Changes

File Change Summary
src/app/core/models/qbd/db/qbd-workspace.model.ts Added migrated_to_qbd_direct: boolean to QBDWorkspace interface
src/app/integrations/landing/landing.component.html Updated conditional rendering for QBD IIF integration
src/app/integrations/landing/landing.component.ts Added showQBDIIFIntegration property based on organization creation date
src/app/integrations/qbd/qbd-main/qbd-dashboard/qbd-dashboard.component.html Modified export button's disabled condition
src/app/integrations/qbd/qbd-main/qbd-dashboard/qbd-dashboard.component.ts Added disableQBDExportButton and StorageService integration
src/app/integrations/qbd/qbd.component.ts Added storage operation to set disableQBDExportButton based on workspace migration status

Sequence Diagram

sequenceDiagram
    participant Workspace
    participant LandingComponent
    participant StorageService
    participant QbdDashboardComponent

    Workspace->>LandingComponent: migrated_to_qbd_direct
    LandingComponent-->>LandingComponent: Determine showQBDIIFIntegration
    
    Workspace->>QbdComponent: migrated_to_qbd_direct
    QbdComponent->>StorageService: Set disableQBDExportButton
    
    StorageService-->>QbdDashboardComponent: Retrieve disableQBDExportButton
    QbdDashboardComponent-->>QbdDashboardComponent: Update export button state
Loading

Possibly related PRs

Suggested Labels

size/M, qa_deploy

Suggested Reviewers

  • ashwin1111
  • DhaaraniCIT
  • Hrishabh17

Poem

🐰 A rabbit's tale of migration's grace,
QBD Direct finds its rightful place!
Buttons disabled, logic refined,
Integration's path now intertwined.
Hop along, code's journey bright! 🚀

Finishing Touches

  • 📝 Generate Docstrings (Beta)

🪧 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/XS Extra Small PR label Jan 17, 2025
Copy link
Contributor

@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: 0

🔭 Outside diff range comments (1)
src/app/integrations/landing/landing.component.html (1)

QBD IIF visibility check is bypassed in landing-v2 component

The date-based visibility restriction for QBD IIF integration is only implemented in the landing component but missing in landing-v2. This creates an inconsistency where users could still access QBD IIF through the /landing_v2 route, bypassing the intended restriction.

  • src/app/integrations/landing-v2/landing-v2.component.html: Add the same date-based visibility check as implemented in the landing component
  • src/app/integrations/landing-v2/landing-v2.component.ts: Add the showQBDIIFIntegration property with the same date restriction logic
🔗 Analysis chain

Line range hint 62-67: LGTM! Verify the visibility logic across different organization states.

The conditional rendering for QBD IIF integration is correctly implemented. The change aligns with the PR objective to hide this integration option based on showQBDIIFIntegration.

Let's verify that the visibility logic works as expected across different organization states:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any direct references to QBD IIF integration that might bypass the visibility check

# Search for QBD IIF related constants or configurations
rg -l "QuickBooks Desktop.*IIF|QBD.*IIF" --type ts

# Check for any hardcoded routes or navigation to QBD IIF
rg -l "qbd.*iif|quickbooks.*desktop.*iif" --type ts

# Look for any other UI elements that might reference QBD IIF
ast-grep --pattern 'QuickBooks Desktop (IIF)'

Length of output: 815


Script:

#!/bin/bash
# Check both landing components implementation and usage
ast-grep --pattern 'showQBDIIFIntegration'

# Find where landing components are used/imported
rg -l "landing-v2.component|landing.component" --type ts

# Check component initialization
rg "showQBDIIFIntegration" -A 5 -B 5 --type ts

Length of output: 4844


Script:

#!/bin/bash
# Check routing configuration
rg -A 5 "path.*landing" src/app/integrations/integrations-routing.module.ts

# Check landing-v2 component implementation
cat src/app/integrations/landing-v2/landing-v2.component.ts

# Check module declarations
rg "declarations.*landing" src/app/integrations/integrations.module.ts

Length of output: 10366

🧹 Nitpick comments (2)
src/app/integrations/landing/landing.component.ts (1)

91-91: Consider extracting the cutoff date as a constant.

While the implementation is correct, the hard-coded date would be better maintained as a named constant at the class or module level.

+  private readonly QBD_IIF_CUTOFF_DATE = new Date('2025-01-17T00:00:00Z');
-  readonly showQBDIIFIntegration = new Date(this.org.created_at) < new Date('2025-01-17T00:00:00Z');
+  readonly showQBDIIFIntegration = new Date(this.org.created_at) < this.QBD_IIF_CUTOFF_DATE;
src/app/integrations/qbd/qbd-main/qbd-dashboard/qbd-dashboard.component.html (1)

Line range hint 18-24: LGTM! Consider adding a tooltip for better UX.

The disabled state implementation for the export button is correct. However, when the button is disabled due to disableQBDExportButton, users might not understand why.

Consider adding a tooltip to explain why the button is disabled:

-                        <button type="button" class="export-btn tw-float-right tw-flex tw-justify-end tw-items-center tw-text-white tw-text-500 tw-px-24-px tw-py-12-px tw-bg-mandatory-field-color tw-rounded-4-px" (click)="triggerExports()" [disabled]="exportInProgress || disableQBDExportButton" >
+                        <button type="button" class="export-btn tw-float-right tw-flex tw-justify-end tw-items-center tw-text-white tw-text-500 tw-px-24-px tw-py-12-px tw-bg-mandatory-field-color tw-rounded-4-px" (click)="triggerExports()" [disabled]="exportInProgress || disableQBDExportButton" [pTooltip]="disableQBDExportButton ? 'Export is disabled for migrated workspaces' : null">
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4e1aded and 490863a.

📒 Files selected for processing (6)
  • src/app/core/models/qbd/db/qbd-workspace.model.ts (1 hunks)
  • src/app/integrations/landing/landing.component.html (1 hunks)
  • src/app/integrations/landing/landing.component.ts (1 hunks)
  • src/app/integrations/qbd/qbd-main/qbd-dashboard/qbd-dashboard.component.html (1 hunks)
  • src/app/integrations/qbd/qbd-main/qbd-dashboard/qbd-dashboard.component.ts (3 hunks)
  • src/app/integrations/qbd/qbd.component.ts (1 hunks)
🔇 Additional comments (3)
src/app/core/models/qbd/db/qbd-workspace.model.ts (1)

8-8: LGTM! Clear and purposeful interface extension.

The new boolean property clearly indicates its purpose of tracking QBD Direct migration status.

src/app/integrations/qbd/qbd.component.ts (1)

69-69: LGTM! Proper persistence of migration status.

The migration flag is correctly stored for use by the dashboard component.

src/app/integrations/qbd/qbd-main/qbd-dashboard/qbd-dashboard.component.ts (1)

14-14: LGTM! Clean implementation of export button state management.

The changes properly implement the export button state management:

  • Safe default state (false)
  • Proper dependency injection
  • Retrieval during component initialization

Also applies to: 73-73, 81-81, 233-233

@github-actions
Copy link

Unit Test Coverage % values
Statements 33% ( 4125 / 12497 )
Branches 26.33% ( 1175 / 4462 )
Functions 25.59% ( 893 / 3489 )
Lines 33.19% ( 4059 / 12228 )

@Hrishabh17 Hrishabh17 added the staging_deploy Triggers deployment of active branch to Staging label Jan 17, 2025
@Hrishabh17 Hrishabh17 merged commit 5bf389c into master Jan 17, 2025
7 checks passed
Hrishabh17 added a commit that referenced this pull request Jan 20, 2025
* feat: hide qbd iif from landing, disable export cta

* fix lint
JustARatherRidiculouslyLongUsername added a commit that referenced this pull request Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra Small PR staging_deploy Triggers deployment of active branch to Staging

Development

Successfully merging this pull request may close these issues.

2 participants