Skip to content
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

Feature tp adding confirmation dialogue #945

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

Ameer-Alaswad
Copy link
Contributor

@Ameer-Alaswad Ameer-Alaswad commented Jul 27, 2024

What Github issue does this PR relate to? Insert link.

ticket 903

What should the reviewer know?

Overview:

This update enhances the FormDraggableAccordion component with improved modal functionality for deletion confirmation.

Details:

  • Introduced an optional entryCategory prop to the FormDraggableAccordion component. This prop can be used to specify the type of entry (e.g., 'professional' or 'education').
  • Updated the component to show a contextual modal when the remove icon is clicked. The modal's headline and message now vary based on the value of entryCategory.
  • Added functions openDeleteModal and closeDeleteModal to manage the state of the modal.
  • Included the LightModal component to confirm deletion, using the entryCategory to determine the appropriate text.
  • Ensured backward compatibility with the existing props and logic by making entryCategory optional.

screen-capture (3)

Summary by CodeRabbit

  • New Features

    • Introduced new props for categorizing form sections as "education" and "professional" in jobseeker profiles.
    • Added a confirmation modal for deletion actions in the FormDraggableAccordion component, enhancing user experience with clear prompts based on the entry category.
  • Bug Fixes

    • Improved handling of modal visibility and functionality for deletion confirmation, preventing accidental data loss.

…ssional or education) && Display contextual modal with relevant messages based on entryCategory && Implemented open and close modal functions && Integrated LightModal component for deletion confirmation
Copy link

coderabbitai bot commented Jul 27, 2024

Walkthrough

The recent updates enhance the job seeker profile components by adding an entryCategory prop to differentiate between "education" and "professional experience." This improvement provides better context within the forms. Additionally, a confirmation modal for deletions has been introduced, prompting users to confirm their actions before finalizing them. Overall, these modifications contribute to a more organized and interactive user experience, reducing the risk of accidental deletions.

Changes

Files Change Summary
apps/redi-talent-pool/src/components/organisms/jobseeker-profile-editables/EditableEducation.tsx
apps/redi-talent-pool/src/components/organisms/jobseeker-profile-editables/EditableProfessionalExperience.tsx
Added entryCategory prop to categorize form sections as "education" and "professional experience." Implemented confirmation modals for deletions.
libs/shared-atomic-design-components/src/lib/atoms/FormDraggableAccordion.tsx Introduced a confirmation modal for entry deletions, along with a new optional entryCategory prop for customization.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EditableEducation
    participant EditableProfessionalExperience
    participant FormDraggableAccordion

    User->>EditableEducation: Fill education form
    EditableEducation-->>User: Submit with entryCategory="education"

    User->>EditableProfessionalExperience: Fill professional experience form
    EditableProfessionalExperience-->>User: Submit with entryCategory="professional"

    User->>FormDraggableAccordion: Click delete icon
    FormDraggableAccordion-->>User: Open delete confirmation modal
    User->>FormDraggableAccordion: Confirm deletion
    FormDraggableAccordion-->>User: Entry deleted
Loading

Possibly related issues

Poem

🐇 In fields of code where changes bloom,
New props and modals chase away the gloom.
With "education" and "professional" in sight,
Confirm your deletions, make the interface bright!
Hoppy updates bring joy to the day,
Let's celebrate progress in a sprightly way! 🌼


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b14d067 and f4ffee4.

Files selected for processing (3)
  • apps/redi-talent-pool/src/components/organisms/jobseeker-profile-editables/EditableEducation.tsx (1 hunks)
  • apps/redi-talent-pool/src/components/organisms/jobseeker-profile-editables/EditableProfessionalExperience.tsx (1 hunks)
  • libs/shared-atomic-design-components/src/lib/atoms/FormDraggableAccordion.tsx (4 hunks)
Additional comments not posted (8)
libs/shared-atomic-design-components/src/lib/atoms/FormDraggableAccordion.tsx (6)

9-9: Import statement for LightModal is correct.

The import statement for LightModal is necessary for the new modal functionality.


17-17: Addition of entryCategory prop is correct.

The entryCategory prop has been added to the Props interface to support the new modal functionality.


26-26: Usage of entryCategory prop in function parameters is correct.

The entryCategory prop has been added to the function parameters to support the new modal functionality.


29-35: State management for delete confirmation modal is correct.

The state management for the delete confirmation modal is well-implemented and necessary for the new functionality.


46-53: Rendering logic for modal's content is correct.

The rendering logic for the modal's content is well-implemented and necessary for the new functionality.


72-82: Integration of modal with the component is correct.

The integration of the modal with the component enhances the user experience by providing a confirmation step before deletion.

apps/redi-talent-pool/src/components/organisms/jobseeker-profile-editables/EditableEducation.tsx (1)

399-399: Addition of entryCategory prop is correct.

The entryCategory prop with the value "education" has been added to the JobseekerFormSectionEducation component to support the new modal functionality.

apps/redi-talent-pool/src/components/organisms/jobseeker-profile-editables/EditableProfessionalExperience.tsx (1)

397-397: Addition of entryCategory prop is correct.

The entryCategory prop with the value "professional" has been added to the JobseekerFormSectionProfessionalExperience component to support the new modal functionality.

…r reflect its purpose and ensure consistency.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f4ffee4 and a3bd4ad.

Files selected for processing (1)
  • libs/shared-atomic-design-components/src/lib/atoms/FormDraggableAccordion.tsx (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • libs/shared-atomic-design-components/src/lib/atoms/FormDraggableAccordion.tsx

@astkhikatredi
Copy link
Contributor

Dear @helloanil, this is a kind reminder

@helloanil helloanil merged commit 39f8fbe into master Aug 6, 2024
2 checks passed
@helloanil helloanil deleted the Feature-TP-adding-confirmation-dialogue branch August 6, 2024 14:48
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a3bd4ad and 6a3931a.

Files selected for processing (3)
  • apps/redi-talent-pool/src/components/organisms/jobseeker-profile-editables/EditableEducation.tsx (5 hunks)
  • apps/redi-talent-pool/src/components/organisms/jobseeker-profile-editables/EditableProfessionalExperience.tsx (5 hunks)
  • libs/shared-atomic-design-components/src/lib/atoms/FormDraggableAccordion.tsx (3 hunks)
Additional comments not posted (9)
libs/shared-atomic-design-components/src/lib/atoms/FormDraggableAccordion.tsx (3)

16-16: The addition of the entryCategory property looks good.

The entryCategory property enhances the flexibility of the component.


37-44: The usage of entryCategory to set modal messages looks good.

The conditional logic for modalHeadline and modalMessage based on entryCategory is clear and enhances the user experience.


25-25: The usage of entryCategory in the JSX looks good.

Passing entryCategory as a prop ensures that the correct modal messages are displayed.

apps/redi-talent-pool/src/components/organisms/jobseeker-profile-editables/EditableEducation.tsx (3)

164-166: The addition of the educationIdToRemove state variable looks good.

This state variable is necessary for managing the modal state.


370-370: The modification to the onRemove function looks good.

Setting educationIdToRemove to the ID of the entry being removed is necessary for triggering the modal.


498-506: The addition of the LightModal for deletion confirmation looks good.

This addition enhances the user experience by preventing accidental deletions.

apps/redi-talent-pool/src/components/organisms/jobseeker-profile-editables/EditableProfessionalExperience.tsx (3)

179-181: The addition of the experienceIdToRemove state variable looks good.

This state variable is necessary for managing the modal state.


368-368: The modification to the onRemove function looks good.

Setting experienceIdToRemove to the ID of the entry being removed is necessary for triggering the modal.


495-503: The addition of the LightModal for deletion confirmation looks good.

This addition enhances the user experience by preventing accidental deletions.

@ericbolikowski
Copy link
Contributor

Hey, I just pushed b7f7a05 to master to remove some dead code this PR introduced (neither modalHeadline nor modalMessage were being used):

CleanShot 2024-08-07 at 10 58 24@2x

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.

4 participants