FIX: consistent delete button for admin permalinks page

The delete button should always be available when there are no more options.
This commit is contained in:
Krzysztof Kotlarek 2025-01-06 14:01:56 +11:00
parent 407fa69778
commit 1e8cfdcc79
4 changed files with 5 additions and 51 deletions

View File

@ -70,26 +70,11 @@
@routeModels={{pl}} @routeModels={{pl}}
@label="admin.config_areas.permalinks.edit" @label="admin.config_areas.permalinks.edit"
/> />
<DButton
<DMenu @action={{fn this.destroyRecord pl}}
@identifier="permalink-menu" class="btn-default btn-small admin-permalink-item__delete"
@title={{i18n "admin.permalinks.more_options"}} @label="admin.config_areas.permalinks.delete"
@icon="ellipsis-vertical" />
@onRegisterApi={{this.onRegisterApi}}
>
<:content>
<DropdownMenu as |dropdown|>
<dropdown.item>
<DButton
@action={{fn this.destroyRecord pl}}
@icon="trash-can"
class="btn-transparent admin-permalink-item__delete"
@label="admin.config_areas.permalinks.delete"
/>
</dropdown.item>
</DropdownMenu>
</:content>
</DMenu>
</div> </div>
</td> </td>
</tr> </tr>

View File

@ -817,17 +817,6 @@
padding-left: 18px; padding-left: 18px;
} }
.admin-permalink-item {
&__delete.btn,
&__delete.btn:hover {
border-top: 1px solid var(--primary-low);
color: var(--danger);
svg {
color: var(--danger);
}
}
}
// embedding // embedding
.embeddable-hosts { .embeddable-hosts {
margin-bottom: 2em; margin-bottom: 2em;
@ -897,19 +886,6 @@
} }
} }
.admin-embedding {
.admin-embeddable-host-item__delete {
&:hover {
svg.d-icon {
color: var(--primary-medium);
}
}
svg.d-icon {
color: var(--primary-low-mid);
}
}
}
.user-fields { .user-fields {
h2 { h2 {
margin-bottom: 1em; margin-bottom: 1em;

View File

@ -7383,7 +7383,6 @@ en:
no_permalinks: "You don't have any permalinks yet." no_permalinks: "You don't have any permalinks yet."
add: "Add permalink" add: "Add permalink"
back: "Back to Permalinks" back: "Back to Permalinks"
more_options: "More options"
copy_success: "Permalink copied to clipboard" copy_success: "Permalink copied to clipboard"
nav: nav:
settings: "Settings" settings: "Settings"

View File

@ -25,7 +25,6 @@ module PageObjects
end end
def click_delete_permalink(url) def click_delete_permalink(url)
open_permalink_menu(url)
find(".admin-permalink-item__delete").click find(".admin-permalink-item__delete").click
find(".dialog-footer .btn-primary").click find(".dialog-footer .btn-primary").click
expect(page).to have_no_css(".dialog-body") expect(page).to have_no_css(".dialog-body")
@ -41,11 +40,6 @@ module PageObjects
has_no_css?(".admin-permalink-item__url") has_no_css?(".admin-permalink-item__url")
end end
def open_permalink_menu(url)
find("tr.#{url} .permalink-menu-trigger").click
self
end
def has_closed_permalink_menu? def has_closed_permalink_menu?
has_no_css?(".permalink-menu-content") has_no_css?(".permalink-menu-content")
end end