mirror of
https://github.com/discourse/discourse-data-explorer.git
synced 2025-06-27 01:52:15 +00:00
FIX: edit button not working (#379)
After this PR <a> link stopped working correctly page started doing a full reload. <Button> component behaves correctly. https://github.com/discourse/discourse-data-explorer/pull/376
This commit is contained in:
parent
85b485e1bf
commit
6727e32874
@ -59,15 +59,13 @@ export default RouteTemplate(
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<h1>
|
<h1>
|
||||||
{{@controller.model.name}}
|
<span>{{@controller.model.name}}</span>
|
||||||
{{#unless @controller.editDisabled}}
|
{{#unless @controller.editDisabled}}
|
||||||
<a
|
<DButton
|
||||||
href
|
@action={{@controller.editName}}
|
||||||
{{on "click" @controller.editName}}
|
@icon="pencil"
|
||||||
class="edit-query-name"
|
class="edit-query-name btn-transparent"
|
||||||
>
|
/>
|
||||||
{{icon "pencil"}}
|
|
||||||
</a>
|
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
@ -215,7 +215,7 @@ table.group-reports {
|
|||||||
margin: 0 0.5em 0 0;
|
margin: 0 0.5em 0 0;
|
||||||
color: var(--primary);
|
color: var(--primary);
|
||||||
|
|
||||||
a {
|
button .d-icon {
|
||||||
color: currentcolor;
|
color: currentcolor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,16 @@ RSpec.describe "Explorer", type: :system, js: true do
|
|||||||
|
|
||||||
expect(page).to have_field("limit", with: 42)
|
expect(page).to have_field("limit", with: 42)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "allows to edit custom name" do
|
||||||
|
visit("/admin/plugins/explorer/queries/#{query_1.id}")
|
||||||
|
find(".query-run .btn-primary").click
|
||||||
|
find(".edit-query-name").click
|
||||||
|
find(".name-text-field input").fill_in(with: "My custom name edited")
|
||||||
|
find(".btn-primary").click
|
||||||
|
find("button span", text: "Save Changes and Run").click
|
||||||
|
expect(page.find(".name h1")).to have_content("My custom name edited")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with the old url format" do
|
context "with the old url format" do
|
||||||
|
@ -320,7 +320,7 @@ acceptance("Data Explorer Plugin | Run Query", function (needs) {
|
|||||||
await visit("/admin/plugins/explorer/queries/2");
|
await visit("/admin/plugins/explorer/queries/2");
|
||||||
|
|
||||||
assert
|
assert
|
||||||
.dom("div.name h1")
|
.dom("div.name h1 span")
|
||||||
.hasText("What about 0?", "the query name was rendered");
|
.hasText("What about 0?", "the query name was rendered");
|
||||||
|
|
||||||
assert
|
assert
|
||||||
|
Loading…
x
Reference in New Issue
Block a user