Skip to content

Commit 6c15cf2

Browse files
committed
Add featured_link to topic attrs saved by topic field
1 parent ecd5355 commit 6c15cf2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

assets/javascripts/discourse/components/custom-wizard-topic-selector.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,16 @@ export default MultiSelectComponent.extend({
5959
actions: {
6060
onChange(value, items) {
6161
const content = items.map((t) => {
62-
return {
62+
let attrs = {
6363
id: t.id,
6464
title: t.title,
6565
fancy_title: t.fancy_title,
6666
url: t.url,
6767
};
68+
if (t.featured_link) {
69+
attrs.featured_link = t.featured_link;
70+
}
71+
return attrs;
6872
});
6973
this.setProperties({ value, content });
7074
this.onChange(value, content);

plugin.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22
# name: discourse-custom-wizard
33
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
4-
# version: 2.11.5
4+
# version: 2.11.6
55
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Marcos Gutierrez
66
# url: https://github.com/paviliondev/discourse-custom-wizard
77
# contact_emails: [email protected]
@@ -242,4 +242,10 @@
242242
)
243243
end
244244
end
245+
246+
add_to_serializer(
247+
:search_topic_list_item,
248+
:featured_link,
249+
include_condition: -> { SiteSetting.custom_wizard_enabled && object.featured_link.present? },
250+
) { object.featured_link }
245251
end

0 commit comments

Comments
 (0)