Skip to content

Add confirmation step before deleting topic - #293

Merged
dcollie2 merged 2 commits into
mainfrom
271-add-confirmation-message-after-deleting-topic
Jul 23, 2025
Merged

dcollie2 merged 2 commits into
mainfrom
271-add-confirmation-message-after-deleting-topic

Conversation

@Oli0li

@Oli0li Oli0li commented Jul 21, 2025

Copy link
Copy Markdown
Collaborator

What Issue Does This PR Cover, If Any?

Resolves #271

What Changed? And Why Did It Change?

It:

  • adds a confirmation step before deleting a Topic, using the same pattern as what we have for Tags
  • adds flash messages for successful operations on Topics and Languages (we already had those flash messages for Regions, Tags and Users)

How Has This Been Tested?

With RSpec and by hand

Please Provide Screenshots

Confirm.before.deleting.topic.mp4

Additional Comments

N/A

Oli0li added 2 commits July 21, 2025 12:47
I followed the same pattern as we have when destroying a tag.
While looking into adding a confirmation step before destroying a topic,
I noticed that we display successful flash messages for Tags, Regions
and Users but not for Topics and Languages, so I added those for
consistency and clearer user feedback.

Topics::Mutator.new(topic: @topic).destroy
redirect_to topics_path
if params[:confirmed]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we use native confirmation dialog boxes in browser?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I did it this way because that's how we do it for Tags (you can see a video here in the PR that introduced it). Should I leave it like this using Turbo stream or change to a browser dialog box for both Tags and Topics?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we check here if it possible to do just simply with dialog box?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's circle back to this once we're past the launch. We can refactor if necessary.

@dcollie2
dcollie2 merged commit 76f1c1c into main Jul 23, 2025
@dcollie2
dcollie2 deleted the 271-add-confirmation-message-after-deleting-topic branch July 23, 2025 22:00
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.

Topic deletion

3 participants