feat: hide qbd iif from landing, disable export cta#1153
Conversation
WalkthroughThis pull request introduces changes related to QuickBooks Desktop (QBD) integration and migration tracking. The modifications include adding a new Changes
Sequence DiagramsequenceDiagram
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
Possibly related PRs
Suggested Labels
Suggested Reviewers
Poem
Finishing Touches
🪧 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.
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 componentsrc/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 tsLength 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.tsLength 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
📒 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
|
* feat: hide qbd iif from landing, disable export cta * fix lint
Description
hide qbd iif from landing, disable export cta
Clickup
https://app.clickup.com/
Summary by CodeRabbit
Release Notes
New Features
Improvements
Bug Fixes