-
Notifications
You must be signed in to change notification settings - Fork 0
fix: QBD landing page #1104
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: QBD landing page #1104
Conversation
WalkthroughThe pull request modifies the HTML template and TypeScript logic of the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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: 1
🧹 Outside diff range and nitpick comments (2)
src/app/shared/components/helper/app-landing-page-header/app-landing-page-header.component.html (2)
45-45: Simplify QBD-specific icon conditionSimilar to the button condition, the icon condition should use the enum constant and could be simplified.
Consider moving this logic to a component method:
-<app-svg-icon *ngIf="(appName === AppName.QBD || appName.includes('QuickBooks Desktop - Direct Integration')) && brandingFeatureConfig.isIconsInsideButtonAllowed" +<app-svg-icon *ngIf="isQBDApp() && brandingFeatureConfig.isIconsInsideButtonAllowed"Add this method to your component:
isQBDApp(): boolean { return this.appName === AppName.QBD || this.appName === AppName.QBD_DIRECT; }
44-44: Add type safety and documentation for buttonTextThe buttonText property lacks type safety and documentation. This could lead to maintenance issues.
Add proper typing and documentation in the component:
/** Text to display on the connection button */ @Input() buttonText!: string;Consider creating a type for the button states:
type ConnectionButtonState = 'Connect' | 'Connecting' | 'Connected' | 'Disconnect' | 'Disconnecting';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
src/app/shared/components/helper/app-landing-page-header/app-landing-page-header.component.html(1 hunks)src/app/shared/components/helper/app-landing-page-header/app-landing-page-header.component.ts(1 hunks)
🔇 Additional comments (1)
src/app/shared/components/helper/app-landing-page-header/app-landing-page-header.component.ts (1)
93-93:
Replace string literal with enum constant for type safety
The use of a hardcoded string literal 'QuickBooks Desktop - Direct Integration' is error-prone and inconsistent with the codebase's pattern of using the AppName enum. String comparisons are more susceptible to typos and harder to maintain.
Consider refactoring to use the enum:
-if (this.appName === AppName.TRAVELPERK || this.appName === AppName.BUSINESS_CENTRAL || this.appName === AppName.BAMBOO_HR || this.appName === AppName.XERO || this.appName.includes('QuickBooks Desktop - Direct Integration')) {
+if (this.appName === AppName.TRAVELPERK || this.appName === AppName.BUSINESS_CENTRAL || this.appName === AppName.BAMBOO_HR || this.appName === AppName.XERO || this.appName === AppName.QBD_DIRECT) {Let's verify the enum usage across the codebase:
| {{ isConnectionInProgress ? 'Disconnecting' : 'Disconnect' }} | ||
| </button> | ||
| <button *ngIf="!isIntegrationConnected && (appName === AppName.QBD || appName === AppName.NETSUITE || appName === AppName.INTACCT || appName === AppName.SAGE300 || appName === AppName.BUSINESS_CENTRAL || appName.includes(AppName.QBD_DIRECT))" pButton type="button" class="p-button-raised" (click)="connect()"> | ||
| <button *ngIf="!isIntegrationConnected && (appName === AppName.QBD || appName === AppName.NETSUITE || appName === AppName.INTACCT || appName === AppName.SAGE300 || appName === AppName.BUSINESS_CENTRAL || appName.includes('QuickBooks Desktop - Direct Integration'))" pButton type="button" class="p-button-raised" (click)="connect()"> |
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.
🛠️ Refactor suggestion
Simplify complex conditional and use enum constants
The *ngIf condition is overly complex and uses string literals. This makes the template harder to read and maintain.
Consider moving the condition to a component method:
-<button *ngIf="!isIntegrationConnected && (appName === AppName.QBD || appName === AppName.NETSUITE || appName === AppName.INTACCT || appName === AppName.SAGE300 || appName === AppName.BUSINESS_CENTRAL || appName.includes('QuickBooks Desktop - Direct Integration'))"
+<button *ngIf="!isIntegrationConnected && shouldShowConnectButton()" Add this method to your component:
shouldShowConnectButton(): boolean {
return [
AppName.QBD,
AppName.NETSUITE,
AppName.INTACCT,
AppName.SAGE300,
AppName.BUSINESS_CENTRAL,
AppName.QBD_DIRECT
].includes(this.appName as AppName);
}
Description
Please add PR description here, add screenshots if needed
Clickup
https://app.clickup.com/
Summary by CodeRabbit
New Features
Bug Fixes