Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit d478aad

Browse files
committed
FIX: edit button not working
After this PR <a> link stopped working correctly page started doing a full reload. <Button> component behaves correctly. #376
1 parent 85b485e commit d478aad

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

assets/javascripts/discourse/templates/admin/plugins-explorer-queries-details.gjs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,11 @@ export default RouteTemplate(
6161
<h1>
6262
{{@controller.model.name}}
6363
{{#unless @controller.editDisabled}}
64-
<a
65-
href
66-
{{on "click" @controller.editName}}
67-
class="edit-query-name"
68-
>
69-
{{icon "pencil"}}
70-
</a>
64+
<DButton
65+
@action={{@controller.editName}}
66+
@icon="pencil"
67+
class="edit-query-name btn-transparent"
68+
/>
7169
{{/unless}}
7270
</h1>
7371
</div>

assets/stylesheets/explorer.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ table.group-reports {
215215
margin: 0 0.5em 0 0;
216216
color: var(--primary);
217217

218-
a {
218+
button .d-icon {
219219
color: currentcolor;
220220
}
221221
}

spec/system/explorer_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727

2828
expect(page).to have_field("limit", with: 42)
2929
end
30+
31+
it "allows to edit custom name" do
32+
visit("/admin/plugins/explorer/queries/#{query_1.id}")
33+
find(".query-run .btn-primary").click
34+
find(".edit-query-name").click
35+
find(".name-text-field input").fill_in(with: "My custom name edited")
36+
find(".btn-primary").click
37+
find("button span", text: "Save Changes and Run").click
38+
end
3039
end
3140

3241
context "with the old url format" do

0 commit comments

Comments
 (0)