feat: dismissible billable import alert#1771
feat: dismissible billable import alert#1771JustARatherRidiculouslyLongUsername merged 1 commit intomasterfrom
Conversation
WalkthroughA tooltip dismissal feature is implemented for the import billable fields. A new flag Changes
Sequence DiagramsequenceDiagram
participant User
participant Component as Export/Import<br/>Settings Component
participant Service as SiWorkspaceService
participant API as Backend API
participant Config as Feature Config
User->>Component: Clicks close icon on tooltip
Component->>Component: handleTooltipDismiss()
Component->>Service: updateFeatureConfigs({<br/>import_billable_tooltip_dismissed: true<br/>})
Service->>API: PATCH /feature_configs
API->>Config: Update import_billable_tooltip_dismissed
Config-->>API: Confirm update
API-->>Service: Return updated FeatureConfig
Service->>Component: Emit updated config
Component->>Component: Update local state & hide tooltip
Component-->>User: Tooltip dismissed
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
🔁 Code Duplication Report - Angular
📊 No significant change in code duplication. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/app/core/models/intacct/db/feature-config.model.ts (1)
10-12: Prefer derivingFeatureConfigUpdatefromFeatureConfigto avoid drift.This keeps the update contract in sync if the field is ever renamed.
DRY type definition
-export type FeatureConfigUpdate = { - import_billable_tooltip_dismissed: boolean; -}; +export type FeatureConfigUpdate = Pick<FeatureConfig, 'import_billable_tooltip_dismissed'>;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/app/core/models/intacct/db/feature-config.model.ts` around lines 10 - 12, Replace the hard-coded FeatureConfigUpdate type with a type derived from the existing FeatureConfig so the update shape stays in sync; specifically, change FeatureConfigUpdate to derive its property(ies) from FeatureConfig (e.g., using Pick or Partial on FeatureConfig for import_billable_tooltip_dismissed) and update references to use the new derived type name FeatureConfigUpdate to avoid future drift between FeatureConfig and the update type.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/app/core/services/si/si-core/si-workspace.service.ts`:
- Around line 83-88: getFeatureConfigs is cached without the workspaceId so it
returns stale data when StorageService's workspace changes; change the method
signature of SiWorkspaceService#getFeatureConfigs to accept workspaceId (e.g.,
getFeatureConfigs(workspaceId: string): Observable<FeatureConfig>), use that
workspaceId to build the request path
(`/workspaces/${workspaceId}/feature_configs/`), keep the `@Cacheable` decorator
so the cache key now includes the argument, and update all call sites to pass
the current workspace id (from StorageService.getWorkspaceId() or equivalent)
when invoking getFeatureConfigs; also update any tests or mocks that call this
method.
In
`@src/app/integrations/intacct/intacct-shared/intacct-export-settings/intacct-export-settings.component.ts`:
- Around line 675-678: The current handleTooltipDismiss method hides
importProjectBillableToPlatform optimistically while firing
workspaceService.updateFeatureConfigs({ import_billable_tooltip_dismissed: true
}).subscribe(); — change this so UI only flips after the PATCH succeeds (or if
you keep optimistic UI, revert on error). Concretely, update
handleTooltipDismiss to call workspaceService.updateFeatureConfigs(...) and in
the subscribe success callback set this.importProjectBillableToPlatform = false,
and in the error callback revert/notify (e.g., keep it true and show an error)
and ensure the request includes the same feature key
import_billable_tooltip_dismissed; handle unsubscribe or use take(1)/pipe
operators as needed to avoid leaks.
---
Nitpick comments:
In `@src/app/core/models/intacct/db/feature-config.model.ts`:
- Around line 10-12: Replace the hard-coded FeatureConfigUpdate type with a type
derived from the existing FeatureConfig so the update shape stays in sync;
specifically, change FeatureConfigUpdate to derive its property(ies) from
FeatureConfig (e.g., using Pick or Partial on FeatureConfig for
import_billable_tooltip_dismissed) and update references to use the new derived
type name FeatureConfigUpdate to avoid future drift between FeatureConfig and
the update type.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
src/app/core/models/intacct/db/feature-config.model.tssrc/app/core/services/si/si-core/si-workspace.service.tssrc/app/integrations/intacct/intacct-shared/intacct-export-settings/intacct-export-settings.component.htmlsrc/app/integrations/intacct/intacct-shared/intacct-export-settings/intacct-export-settings.component.tssrc/app/integrations/intacct/intacct-shared/intacct-import-settings/intacct-import-settings.component.htmlsrc/app/integrations/intacct/intacct-shared/intacct-import-settings/intacct-import-settings.component.tssrc/app/shared/components/configuration/configuration-info-label/configuration-info-label.component.html
...grations/intacct/intacct-shared/intacct-export-settings/intacct-export-settings.component.ts
Show resolved
Hide resolved
(cherry picked from commit a1ab4a4)
(cherry picked from commit a1ab4a4)
Description
Clickup
app.clickup.com
https://fylein.slack.com/archives/C0A6AA874T1/p1772098660797649
Summary by CodeRabbit
New Features
Style