-
Notifications
You must be signed in to change notification settings - Fork 6
Contact Profiles: Added option to deactivate profile #156
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
Conversation
## Walkthrough
A new "Deactivate Profile" option was introduced to the contact profile flow, affecting both the available profile actions and the UI rendering logic. The flow editor's configuration was updated to include the "profile" filter. The ContactProfileRouter now conditionally displays a message when deactivating a profile. The helper function was updated to find profile options dynamically from a consolidated object.
## Changes
| File(s) | Change Summary |
|--------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| public/index.html | Added `'profile'` to the flow editor's `filters` array in the configuration object. |
| src/components/flow/routers/contactprofile/ContactProfileRouterForm.tsx | Added "Deactivate Profile" option to selectable profile actions; removed `profileOptionsWithName`; removed blank line in `renderEdit`. |
| src/components/flow/routers/contactprofile/ContactProfileRouter.tsx | Added a conditional branch to render a message when `profile_type` is "Deactivate Profile". |
| src/components/flow/routers/contactprofile/helpers.ts | Removed import of `profileOptionsWithName`; updated `nodeToState` to find profile option by name within `profileOptions`. |
| package.json | Updated version number from "1.26.3-26" to "1.26.3-27". |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant User
participant ContactProfileRouterForm
participant ContactProfileRouter
User->>ContactProfileRouterForm: Selects a profile action (including "Deactivate Profile")
ContactProfileRouterForm->>ContactProfileRouter: Passes selected profile_type and value
alt profile_type == "Deactivate Profile"
ContactProfileRouter->>User: Displays "Deactivating profile: <value>"
else profile_type == "Switch Profile" or "Update Name"
ContactProfileRouter->>User: Displays corresponding UI
endPoem
|
src/components/flow/routers/contactprofile/ContactProfileRouterForm.tsx
Outdated
Show resolved
Hide resolved
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/flow/routers/contactprofile/ContactProfileRouterForm.tsx(1 hunks)src/components/flow/routers/contactprofile/helpers.ts(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/flow/routers/contactprofile/ContactProfileRouterForm.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/components/flow/routers/contactprofile/helpers.ts (1)
src/components/flow/routers/contactprofile/ContactProfileRouterForm.tsx (1)
profileOptions(23-27)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Tests (12.x)
- GitHub Check: Coverage
🔇 Additional comments (2)
src/components/flow/routers/contactprofile/helpers.ts (2)
9-9: Good refactoring to consolidate profile options.The removal of
profileOptionsWithNameimport aligns with the consolidation of profile options into a singleprofileOptionsobject, reducing code duplication.
28-28: Assignment depends on null-safe lookup above.This assignment is correct, but ensure the
optionvariable is never undefined to prevent downstream issues in UI components that expect a valid option object.
target issue is glific/glific-frontend#3311
Summary by CodeRabbit