Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: ensures ctrl+enter from textarea saves #566

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ export default class EditTopicAssignments extends Component {
<template>
<DModal class="assign" @title={{this.title}} @closeModal={{@closeModal}}>
<:body>
<TopicAssignments @assignments={{this.assignments}} />
<TopicAssignments
@assignments={{this.assignments}}
@onSubmit={{this.submit}}
/>
</:body>
<:footer>
<DButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</div>
<Assignment
@assignment={{this.selectedAssignment}}
@onSubmit={{this.submit}}
@onSubmit={{this.args.onSubmit}}

Check failure on line 44 in assets/javascripts/discourse/components/topic-assignments.gjs

View workflow job for this annotation

GitHub Actions / ci / linting

Component templates should avoid "this.args.onSubmit" usage, try "@onsubmit" instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@onSubmit={{this.args.onSubmit}}
@onSubmit={{@onSubmit}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yes shit, we don't have linting here 🙃

@showValidationErrors={{false}}
/>
</template>
Expand Down
14 changes: 14 additions & 0 deletions spec/system/assign_topic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@
expect(page).to have_no_css("#topic .assigned-to")
end

it "can submit form with shortcut from texatea" do
visit "/t/#{topic.id}"

topic_page.click_assign_topic
assign_modal.assignee = staff_user

find("body").send_keys(:tab)
find("body").send_keys(:control, :enter)

expect(assign_modal).to be_closed
expect(topic_page).to have_assigned(user: staff_user, at_post: 2)
expect(find("#topic .assigned-to")).to have_content(staff_user.username)
end

context "when assigns are not public" do
before { SiteSetting.assigns_public = false }

Expand Down
Loading