# Feature SSI-131 - Deletion dialog with danger zone for deleting items in a hierarchy

Project: Stream Storage Integrations
Status: closed
URL: https://community.openproject.org/work_packages/SSI-131

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | 15.3.0 |
| Votes |  |
| List | a11y report 2025 |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Use cases

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module | Frontend components and Primer design system / Danger zone |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups | https://www.figma.com/design/oTMDTvcwrx35qExTkkSKBn/Custom-fields?node-id=1009-18543&t=IoahotLc4eOZxCao-0 |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable | Eric Schubert |
| Product manager |  |
| Feature Lead |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As** an admin  
**I want to** have a danger dialog on the spot with consent when deleting hierarchy items  
**so that** I do not accidentally destroy data irreversibly 

**Acceptance criteria**

  - If the user wants to delete any hierarchy item, a danger dialog must be shown
    
      - styling according to [wireframes](https://www.figma.com/design/oTMDTvcwrx35qExTkkSKBn/Custom-fields?node-id=1009-18543&t=IoahotLc4eOZxCao-0)

  - The user must consent to the action before being able to continue deletion.

### ~~UPDATE 2024-10-29~~ 

  - ~~this component should be a general one, i.e. reusable within the product.~~

  - ~~we need to specify it in opf/primer\_view\_components~~

  - ~~it needs to be able to define the text and the confirmation link, e.g.:~~

**Done separately in <mention class="mention" data-id="58680" data-type="work_package" data-text="###58680">###58680</mention>**

``` ruby
  render(OpPrimer::PermanentDeletionDialog.new(id: DIALOG_ID)) do |dialog|
    dialog.with_bold_text do
      "Are you sure you want to delete this item from the current hierarchy level?"
    end

    dialog.with_description do
      "This action cannot be undone. Deleting this hierarchy item will also delete all its children."
    end

    dialog.with_deletion_url(data: { turbo: true }) do
      custom_field_item_path(custom_field_id: @custom_field.id, id: @hierarchy_item.id)
    end
  end
```
