Skip to content

A platform for community discussion. Free, open, simple.

UX: Improve bulk invite modal for events (#43763)

Martin Brennan4f539dd19f86
diff --git a/plugins/discourse-events/jobs/regular/discourse_post_event/bulk_invite.rb b/plugins/discourse-events/app/jobs/regular/discourse_post_event_bulk_invite.rb
similarity index 100%
rename from plugins/discourse-events/jobs/regular/discourse_post_event/bulk_invite.rb
rename to plugins/discourse-events/app/jobs/regular/discourse_post_event_bulk_invite.rb
diff --git a/plugins/discourse-events/assets/javascripts/discourse/components/modal/post-event-bulk-invite.gjs b/plugins/discourse-events/assets/javascripts/discourse/components/modal/post-event-bulk-invite.gjs
index b2726163782..dd08ec48ba6 100644
--- a/plugins/discourse-events/assets/javascripts/discourse/components/modal/post-event-bulk-invite.gjs
+++ b/plugins/discourse-events/assets/javascripts/discourse/components/modal/post-event-bulk-invite.gjs
@@ -135,6 +135,7 @@ export default class PostEventBulkInvite extends Component {
}}</h3>
<Form
+ class="bulk-invites-form"
@data={{this.data}}
@onRegisterApi={{this.registerApi}}
@onSubmit={{this.sendBulkInvites}}
@@ -217,14 +218,15 @@ export default class PostEventBulkInvite extends Component {
</form.Collection>
<form.Actions class="bulk-invite-actions">
- <form.Submit
- class="send-bulk-invites"
- @label="discourse_post_event.bulk_invite_modal.send_bulk_invites"
- />
<form.Button
class="add-bulk-invite"
@action={{fn this.addInvite form.addItemToCollection}}
@icon="plus"
+ @label="discourse_post_event.bulk_invite_modal.add_attendee"
+ />
+ <form.Submit
+ class="send-bulk-invites"
+ @label="discourse_post_event.bulk_invite_modal.send_bulk_invites"
/>
</form.Actions>
</Form>
diff --git a/plugins/discourse-events/assets/stylesheets/common/discourse-post-event-bulk-invite-modal.scss b/plugins/discourse-events/assets/stylesheets/common/discourse-post-event-bulk-invite-modal.scss
index 1be40983941..ce145bbeb93 100644
--- a/plugins/discourse-events/assets/stylesheets/common/discourse-post-event-bulk-invite-modal.scss
+++ b/plugins/discourse-events/assets/stylesheets/common/discourse-post-event-bulk-invite-modal.scss
@@ -3,9 +3,13 @@
margin: 0 0 1em 0;
}
+ .bulk-invites-form {
+ gap: 0.5em;
+ }
+
.bulk-invite-row {
display: flex;
- align-items: center;
+ align-items: flex-start;
gap: 0.5em;
padding: 0.25em 0;
@@ -20,6 +24,10 @@
width: 100%;
margin: 0;
}
+
+ .form-kit__container-content {
+ width: 100%;
+ }
}
.remove-bulk-invite {
@@ -30,8 +38,13 @@
.bulk-invites {
margin-bottom: 2em;
- .add-bulk-invite {
- margin-left: auto;
+ .send-bulk-invites {
+ margin-right: auto;
+ }
+
+ .bulk-invite-actions {
+ flex-direction: column;
+ align-items: stretch;
}
}
diff --git a/plugins/discourse-events/config/locales/client.en.yml b/plugins/discourse-events/config/locales/client.en.yml
index 6b22d2c09ad..3786081c4df 100644
--- a/plugins/discourse-events/config/locales/client.en.yml
+++ b/plugins/discourse-events/config/locales/client.en.yml
@@ -393,7 +393,7 @@ en:
all_hosts:
one: "%{count} host"
other: "%{count} hosts"
- bulk_invite: "Bulk Invite"
+ bulk_invite: "Bulk invite"
close_event: "Close event"
open_event: "Open event"
destroy_event: "Destroy event"
@@ -406,7 +406,7 @@ en:
bulk_invite_modal:
confirm: "confirm"
text: "Upload CSV file"
- title: "Bulk Invite"
+ title: "Bulk invite"
success: "File uploaded successfully, you will be notified via message when the process is complete."
error: "Sorry, file should be CSV format."
confirmation_message: "You’re about to notify everyone in the uploaded file."
@@ -414,6 +414,7 @@ en:
description_private: "Private events only accept group names for bulk invites."
download_sample_csv: "Download a sample CSV file"
send_bulk_invites: "Send invites"
+ add_attendee: "Add attendee"
group_selector_placeholder: "Choose a group..."
user_selector_placeholder: "Choose user..."
attendance_label: "Attendance"
diff --git a/plugins/discourse-events/plugin.rb b/plugins/discourse-events/plugin.rb
index 374b35ddbe7..4a0025aff24 100644
--- a/plugins/discourse-events/plugin.rb
+++ b/plugins/discourse-events/plugin.rb
@@ -287,7 +287,7 @@ after_initialize do
# DISCOURSE POST EVENT
- require_relative "jobs/regular/discourse_post_event/bulk_invite"
+ require_relative "app/jobs/regular/discourse_post_event_bulk_invite"
require_relative "jobs/regular/discourse_post_event/bump_topic"
require_relative "jobs/regular/discourse_post_event/send_reminder"
require_relative "jobs/regular/discourse_post_event/warm_livestream_onebox"
diff --git a/plugins/discourse-events/spec/requests/events_controller_spec.rb b/plugins/discourse-events/spec/requests/events_controller_spec.rb
index d5d7e175d0d..0e6ef97da3e 100644
--- a/plugins/discourse-events/spec/requests/events_controller_spec.rb
+++ b/plugins/discourse-events/spec/requests/events_controller_spec.rb
@@ -678,7 +678,8 @@ module DiscourseEvents::Events
{ "identifier" => "sam", "attendance" => "interested" },
{ "identifier" => "the_foo_bar_group", "attendance" => "not_going" },
],
- }
+ },
+ as: :json
end
expect(response.status).to eq(200)