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

feat: switch delete to edit button on logic page #7887

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

KenLSM
Copy link
Contributor

@KenLSM KenLSM commented Nov 14, 2024

Problem

Destructive actions should be hidden below the fold; this is a baseline practice in UX

Closes FRM-1906

Solution

  1. Replaced <TrashIcon /> with <PencilIcon />
  2. Fixed issue where deletion is still possible when editing another logic.

Breaking Changes

  • No - this PR is backwards compatible

Before & After Screenshots

Header Header Header
InactiveLogicBlock when nothing active Screenshot 2024-11-14 at 1 19 05 PM Screenshot 2024-11-15 at 3 01 02 PM
InactiveLogicBlock when one is active Screenshot 2024-11-14 at 1 19 02 PM

Tests

Regression

Edit logic can be triggered

  • Add a "number field" and a "text field"
  • Create a logic with "number field" as logic predicate, and show "text field" as outcome
  • Press "Save changes"
  • Ensure that the <PencilIcon /> can be clicked
  • Ensure that clicking on areas that are not part of <PencilIcon /> does not enter edit mode

Editing another input should not be allowed if already in edit mode

  • Create another logic with "number field" as logic predicate, and show "text field" as outcome
  • Press "Save changes"
  • Click on <PencilIcon /> to enter edit mode
  • Ensure that clicking on another logic step does not enter edit mode and onhover cursor is represented with "not-allowed"

Copy link

linear bot commented Nov 14, 2024

@KenLSM KenLSM requested a review from scottheng96 November 14, 2024 05:25
@datadog-opengovsg
Copy link

datadog-opengovsg bot commented Nov 14, 2024

Datadog Report

Branch report: feat/change-delete-to-edit-logic
Commit report: 2e9d2c7
Test service: formsg

✅ 0 Failed, 1259 Passed, 1 Skipped, 1m 47.02s Total duration (4m 13.51s time saved)

@KenLSM KenLSM force-pushed the feat/change-delete-to-edit-logic branch from edf7b5b to 64c6559 Compare November 14, 2024 07:34
@KenLSM KenLSM force-pushed the feat/change-delete-to-edit-logic branch from 64c6559 to 2e9d2c7 Compare November 14, 2024 08:45
@KenLSM KenLSM merged commit 428d7aa into develop Nov 18, 2024
17 of 19 checks passed
@KenLSM KenLSM deleted the feat/change-delete-to-edit-logic branch November 18, 2024 09:32
@kevin9foong kevin9foong mentioned this pull request Nov 19, 2024
14 tasks
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.

2 participants