Poll Defaults is a Discourse theme component that allows control over default poll behavior. The component was created in response to a meta discussion and was initially available for installation through a theme install button.
nathank created the component, which was well-received by users like wesochuck, who found it helpful in reducing mistakes on their forum.
However, the component was later reported to be broken nathank. Arkshine provided a potential fix, but noted some inconsistencies with the Ember upgrading guide.
The component is now obsolete, as its functionality has been incorporated into the Discourse core JammyDodger. To change the default poll setting to private, forum administrators can toggle the ‘poll default public’ site setting, as noted by Moin.
api.modifyClass("component:modal/poll-ui-builder", {
pluginId: 'poll-defaults',
didInsertElement() {
this._super(...arguments); // super.didInsertElement(...arguments); doesn't work (?)
if (settings.Public) {this.set('publicPoll', true)}
if (settings.Advanced) {this.set('showAdvanced', true)}
},
});
It works.
However, I’m perplexed with didInsertElement. poll-ui-builder is now a glimmer component. didInsertElement is not supposed to exist based on the ember upgrading guide.
I can see in core some usage. Maybe some specificity in Discourse?
Also, I’m not sure why super.didInsertElement doesn’t exist in this above code context.