Skip to content

Shreevaths: add confirmation modal - #5761

Open
shree-vaths wants to merge 1 commit into
developmentfrom
Shreevaths-Job-Confirmation-Dialouge
Open

shree-vaths wants to merge 1 commit into
developmentfrom
Shreevaths-Job-Confirmation-Dialouge

Conversation

@shree-vaths

@shree-vaths shree-vaths commented Nov 2, 2026 •

Copy link
Copy Markdown

Description

https://docs.google.com/document/d/1zifX1otZPl-VJLQk0sZqZbQFginRytlQ2vKHeQAh_Lo/edit?tab=t.0#bookmark=id.pgmlhzb20e7t

Screenshot 2026-11-02 at 5 00 06 PM

Main changes explained:

  • Updated JobFormBuilder.jsx

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. Clear site data/cache
  4. log as admin user
  5. go to dashboard→ https://localhost:5173/jobformbuilder
  6. Try to delete any form field and check the modal confirmation

Screenshots or videos of changes:

Screenshot 2026-10-25 at 7 54 03 PM

@netlify

netlify Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit f2fcd7d
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6ae9159ed3618ece60b295be
😎 Deploy Preview https://deploy-preview-5761--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

@vidiyala99 vidiyala99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested f2fcd7d on /jobformbuilder in light and dark mode at 1400 px, with the backend on development. My test account doesn't have Manage Job Forms, so I added manageJobForms to the logged-in user in the browser's Redux state only. Every write request was intercepted in the browser and answered with a mock 200, so nothing was deleted on dev.

Works as described:

  • Confirmation (screenshot 1): clicking × on question 3 opens "Delete question?" and shows the question text ("Phone / WhatsApp"). No DELETE request is sent while the modal is open.
  • Cancel and Escape: both close the modal, and all 15 questions stay in the same order. I used a real Escape key press, not a synthetic event.
  • Confirm: "Delete question" removes only that question (15 to 14, and question 1 "Full Name" stays first). It sends exactly one DELETE /api/jobforms/<id>/questions/2.
  • Double-click: I double-clicked "Delete question" with real mouse input. It still sent only one DELETE and removed only the selected question.
  • Dark mode (screenshot 2): white text and a white × on #1b2a41, readable.
  • Lint, tests and SonarCloud pass.

Non-blocking:

  • #5763 conflicts with this PR. #5763 (same author) edits the same parts of JobFormbuilder.jsx (the state block, deleteField, and the end of the JSX) and makes deletes local until Save Form. Whichever merges second needs a rebase. After #5763, the modal's "This change is saved immediately." would be wrong, and this PR's test that expects axios.delete would fail. #5764 also rewrites deleteField.
  • If the server DELETE fails, the question has already disappeared from the list and the only feedback is a console.error. That's how development behaves too, but the new "saved immediately" text makes it more misleading.

Approving.

Image Image

This branch has not been deployed

No deployments
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.

3 participants