Skip to content

Conversation

@d-beezee
Copy link
Member

@d-beezee d-beezee commented Oct 6, 2025

No description provided.

iacopolea and others added 30 commits September 3, 2025 12:39
…g in Controls component and update related tests
…apertura-della-modale

UN-1766 save plan configuration
…nings

feat: add @emotion/is-prop-valid dependency and update App component
…ties-mostra-rules-evaluation

Un 1767 modale submit activities mostra rules evaluation
iacopolea and others added 27 commits September 30, 2025 16:29
…-o-purchasable

Un 1806 template pre quotato o purchasable
fix: streamline userpilot initialization and simplify loaded state check
…-o-purchasable

fix: return Cta component in getCta function for better readability
feat: implement payment failure handling
feat: add DateInThePastAlertModal and integrate date validation in BuyButton
UN-1556 - rework: change button to icon button + tooltip
fix: add CheckoutItem tag to API slice and enhance endpoints
@d-beezee d-beezee requested a review from Copilot October 6, 2025 16:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This release introduces significant refactoring to plan status management, transforming the single "draft" status into multiple composed statuses like "PurchasableDraft", "UnquotedDraft", and "PrequotedDraft". The changes add support for direct payment flows, expert review warnings, and improved plan state handling throughout the application.

Key Changes:

  • Plan Status Refactoring: Replaces simple plan status with composed status system using planComposedStatus to handle complex plan states
  • Payment Flow Integration: Adds direct purchase functionality with checkout integration and payment state management
  • UI Component Updates: Extensively updates plan components to use new status system and test IDs instead of text-based selectors

Reviewed Changes

Copilot reviewed 94 out of 98 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/hooks/usePlan.ts New comprehensive plan hook with composed status logic
src/pages/Plan/summary/components/BuyButton.tsx Refactored buy button with date validation and payment integration
src/pages/Plan/Controls/index.tsx Updated controls to handle new plan states and payment flows
src/pages/Plan/modals/SendRequestModal.tsx Enhanced modal with purchasable plan rules evaluation
tests/fixtures/pages/Plan/index.ts Updated test fixtures with new browser module and improved readonly checks
Various module components Replaced text-based selectors with test IDs and tooltips for better testability

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

static getTitleFromPlan(plan: any) {
const titleModule = plan.config.modules.find(
(module) => module.type === 'title'
(module: any) => module.type === 'title'
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of any type is inconsistent with TypeScript best practices. Consider defining a proper interface for the module parameter or using a more specific type.

Copilot uses AI. Check for mistakes.
Comment on lines 58 to +59
const locationModule = plan.config.modules.find(
(module) => module.type === 'location'
(module: any) => module.type === 'location'
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of any type is inconsistent with TypeScript best practices. Consider defining a proper interface for the module parameter or using a more specific type.

Copilot uses AI. Check for mistakes.
// delete each item
await Promise.all(
tasks.map(async (task) => {
tasks.map(async (task: any) => {
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of any type is inconsistent with TypeScript best practices. Consider defining a proper interface for the task parameter or using a more specific type.

Copilot uses AI. Check for mistakes.
this.elements()
.module()
.locator('input[name="female-percentage-input"]'),
// data-qa remove-gender-module
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Comment contains 'data-qa' which appears to be a data attribute reference rather than a descriptive comment.

Suggested change
// data-qa remove-gender-module
// Button to remove the gender module

Copilot uses AI. Check for mistakes.
value={`${br.toLowerCase()}`}
name={`browser-${br.toLowerCase()}`}
disabled={getPlanStatus() === 'pending_review'}
disabled={getPlanStatus() !== 'draft'}
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition uses the old getPlanStatus() function while other parts of the codebase are being migrated to use planComposedStatus. Consider updating for consistency.

Copilot uses AI. Check for mistakes.
},

loaded: () => !!window.userpilot,
loaded: () => true,
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding the loaded function to always return true may cause issues if Userpilot isn't actually loaded. Consider implementing proper loaded state detection.

Suggested change
loaded: () => true,
loaded: () =>
typeof window !== 'undefined' &&
window.userpilot !== undefined &&
typeof window.userpilot.initialized === 'number' &&
window.userpilot.initialized > 0,

Copilot uses AI. Check for mistakes.
'mac.com',
'aol.com',
'protonmail.com',
'Proton: Privacy by default',
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entry appears to be a company name/slogan rather than a domain name like the other entries in the invalidDomains array. Consider reviewing if this should be 'proton.me' or similar domain.

Suggested change
'Proton: Privacy by default',
'proton.me',

Copilot uses AI. Check for mistakes.
@cannarocks cannarocks merged commit d9630af into master Oct 6, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants