Commit Graph

243 Commits

Author SHA1 Message Date
Joffrey JAFFEUX
029d091ea8
FIX: displays poll's close date in local time (#9656) 2020-05-06 22:18:47 +02:00
Gerhard Schlager
7177b9d771 UX: Translating poll chart types wasn't possible 2020-04-28 14:29:42 +02:00
Kane York
330102fd20 FEATURE: Show votes in an "on voted" poll to the creator
This required properly plumbing the guardian into the serializer.

Notably, the default state in the client was not changed - if you haven't voted in
the poll, you need to click the button to view the results instead of the results
being immediately visible on page load.

Implements https://meta.discourse.org/t/-/138108
2020-03-20 13:36:42 -07:00
Bianca Nenciu
5e4cf244a5
FIX: Show time input in poll builder (#9128) 2020-03-16 13:25:45 +01:00
Jarek Radosz
48ba65f406
DEV: Clean up Ember imports (#8979)
Includes:
* Import `computed` helpers
* Import `@ember/application`
* Import `isBlank` from `@ember/utils`
* Import `A` from `@ember/array`
* Import `EmberArray` from `@ember/array`
* Import `ArrayProxy` from `@ember/array/proxy`
* Import `warn` from `@ember/debug`
* Import `EmberObject` from `@ember/object`
* Import `Application` from `@ember/application`
* Import `EmberRouter` from `@ember/routing/router`
* Import `isPresent` from `@ember/utils`
* Import `computed` from `@ember/object`
* Import `guidFor` from `@ember/object`
* Import `isArray` from `@ember/array`
* Import `TextField` from `@ember/component`
* Import `TextArea` from `@ember/component`
* Import `Promise` from `rsvp`
* Import `Evented` from `@ember/object/evented`
* Replace deprecated `ember-addons/ember-computed-decorators` imports
2020-03-06 23:49:28 +01:00
Mark VanLandingham
763a065df9
FIX: Correctly format select options for group poll by fields (#9131) 2020-03-06 12:58:59 -06:00
Joffrey JAFFEUX
a4fc6ccc12
UX: prevents jumpyness when displaying poll voters (#9054) 2020-02-27 11:09:54 +01:00
Dan Ungureanu
59db2811b0
FIX: Disable poll options if user groups do not allow them (#8987) 2020-02-18 12:13:19 +02:00
Joffrey JAFFEUX
72b6f908f4
UX: minor tweaks to poll builder UI (#8985) 2020-02-17 11:02:44 -05:00
Joffrey JAFFEUX
2c7d32e783
FIX: prevents everyone group to show as group option for polls (#8957) 2020-02-14 14:11:34 +01:00
Mark VanLandingham
0772a4338b
FIX: Remove pie draw animation (#8940) 2020-02-12 07:09:40 -08:00
Mark VanLandingham
daaa0a657f
FIX: Render HTML for pie chart options (#8912) 2020-02-11 10:02:54 -06:00
Joffrey JAFFEUX
8ca9ad887d
FIX: replaces fake null value by clearable option (#8875) 2020-02-06 08:30:26 +01:00
Mark VanLandingham
5d97286fa7
FEATURE: Allow single option polls (#8853) 2020-02-05 08:03:27 -06:00
Joffrey JAFFEUX
0431942f3d
DEV: select-kit 2 (#7998)
This new iteration of select-kit focuses on following best principales and disallowing mutations inside select-kit components. A best effort has been made to avoid breaking changes, however if you content was a flat array, eg: ["foo", "bar"] You will need to set valueProperty=null and nameProperty=null on the component.

Also almost every component should have an `onChange` handler now to decide what to do with the updated data. **select-kit will not mutate your data by itself anymore**
2020-02-03 14:22:14 +01:00
Bianca Nenciu
07222af7ab
FEATURE: Add 'groups' option to polls (#8469)
This options can be used to restrict polls to certain groups.
2020-01-28 14:30:04 +02:00
Jarek Radosz
fe588cc7f8
DEV: Fix function prototype deprecations (#8681)
* DEV: Fix the function prototype observers deprecation

DEPRECATION: Function prototype extensions have been deprecated, please migrate from function(){}.observes('foo') to observer('foo', function() {}). [deprecation id: function-prototype-extensions.observes] See https://deprecations.emberjs.com/v3.x/#toc_function-prototype-extensions-observes for more details.

* DEV: Fix the function prototype event listeners deprecation

DEPRECATION: Function prototype extensions have been deprecated, please migrate from function(){}.on('foo') to on('foo', function() {}). [deprecation id: function-prototype-extensions.on] See https://deprecations.emberjs.com/v3.x/#toc_function-prototype-extensions-on for more details.

* DEV: Simplify `default as` imports

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2020-01-16 18:56:53 +01:00
Mark VanLandingham
44612f900e
FIX: Remove 'staff_only' results option for non-staff (#8565) 2019-12-17 13:43:15 -08:00
Rafael dos Santos Silva
dbee72e92b FIX: Export poll UI should only show for admins 2019-12-05 17:03:06 -03:00
Mark VanLandingham
118fef2353
FIX: Hide pie legend when results are grouped (#8445) 2019-12-02 13:59:52 -06:00
Mark VanLandingham
87a298a59b
FIX: Poll pie container was too large (#8444) 2019-12-02 11:51:06 -06:00
Joffrey JAFFEUX
0807751390
REFACTOR: poll-pie-chart widget (#8415)
This commit mostly get rid of the later() call and encapsulate all pie chart display logic inside discourse-poll-pie-canvas widget instead of sharing it between discourse-poll-pie-chart and discourse-poll-pie-canvas
2019-11-27 00:10:43 +01:00
Mark VanLandingham
b92a8131c0
FEATURE: Pie chart option for poll results (#8352) 2019-11-25 11:51:01 -06:00
Rafael dos Santos Silva
fd0025a735
FEATURE: Add export poll button (#8370)
This PR aims to make poll results easily exportable to staff in a CSV format, so they can be analyzed in external software.

It also makes the export data easily customizable by allowing users to leverage any data explorer query to generate the report. By default, we use a query that ships with data explorer, but user can change the ID in settings or use 0 to disable this feature.

One potential upgrade is using the recent work that allows arbitrary group to run data explorer and allow all the groups with access to the configured query to also export polls, but that can be added later.

Co-Authored-By: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2019-11-22 16:06:39 -03:00
Robin Ward
f518065654 FIX: computed is part of @ember/object not @ember/object/computed 2019-11-13 11:58:09 -05:00
Jarek Radosz
5d4b240453
DEV: Provide radix argument to parseInt (#8281)
* DEV: Provide radix 10 argument to parseInt

* DEV: Provide radix 16 argument to parseInt

* DEV: Remove unnecessary parseInt calls

* Fix year formatting

parseInt was used here to convert decimals to ints
2019-11-12 10:47:42 +01:00
Robin Ward
e39d89ecd9 REFACTOR: Remove InputValidation which was simply an Ember.Object 2019-11-11 15:48:56 -05:00
Bianca Nenciu
690db4fd36
FIX: Show poll voters in Oneboxed posts. (#7768) 2019-10-24 14:00:25 +03:00
Robin Ward
6287eccb35 REFACTOR: Remove Ember.Controller in favor of import 2019-10-23 13:06:54 -04:00
Kris
b005377d0a UX: add newline after closing poll tag for poll builder 2019-10-16 21:40:42 -04:00
Sam Saffron
096f932ef2 Lint files
Both needed some prettier tlc
2019-08-16 13:06:51 +10:00
Blake Erickson
69498a58e9
FEATURE: Staff only poll results (#7984)
* FEATURE: Staff only poll results

These changes allow only staff to see the results of a poll.

Non-staff users will be shown a screen like this:

1b8bd76013.png

The "Votes are public" message has been removed from the info section,
and the button to show the votes has been replaced with a message
stating the results will only be shown to staff.

* Update PR based on feedback

* Update plugins/poll/app/models/poll.rb

make sure we return a boolean

Co-Authored-By: Régis Hanol <regis@hanol.fr>
2019-08-15 12:27:18 -06:00
Jarek Radosz
6a65e5312b FEATURE: Add a preview to the poll builder (#7988)
* FEATURE: Add a preview to the poll builder

* Use selectKit helper in the poll preview test

* Extract the mobile-specific poll builder form CSS
2019-08-13 09:49:40 -04:00
Penar Musaraj
78500fb770 UX: Improve layout of poll builder modal 2019-08-07 15:00:03 -04:00
Robin Ward
c322cccd53 FIX: Memory Leaks when decorating posts (#7749)
* Remove long-deprecated method

* FIX: Memory Leaks when decorating posts

Previously we'd keep creating mixins dynamically when decorating the
same class.

This code changes the API to recommend an `id` parameter for each
decorator which will avoid leaks. All plugins should be updated to
include this parameter, although if they don't in the meantime it'll
just mean a warning in the console (and a continued leak.)
2019-06-11 17:21:23 +02:00
Joffrey JAFFEUX
b98b994fe7
apply prettier on plugins (#7605) 2019-05-27 11:06:11 +02:00
Joffrey JAFFEUX
bfea922167
DEV: global s/this.get\("(\w+)"\)/this.$1 (#7592) 2019-05-27 10:15:39 +02:00
Joffrey JAFFEUX
1d784c7a18
FEATURE: adds support for dates in polls (#7450) 2019-04-29 10:01:19 +02:00
Bianca Nenciu
3cf922a58a FIX: URL to user profile in poll results. (#7315) 2019-04-03 22:17:05 +02:00
Kris
be5e889b1b UX: Poll style fix, button classes 2019-03-06 20:27:40 -05:00
Régis Hanol
0a708ba064 FIX: preload poll voters 2019-02-27 17:00:21 +01:00
Sam
79841cf7dd FEATURE: add missing autocomplete suppressions
Following 1f4ace4f add a couple more autocomplete suppressions (in polls
and invite ui)
2019-02-21 16:37:26 +11:00
Joe
a342d2f150 UX: reduces white-space in polls (#6956)
* reduces white-space in polls and uses font-size variables
2019-02-05 10:47:22 +01:00
Régis Hanol
cba6bdaf52 UX: use solid circle to indicate selected option in polls 2019-01-24 12:25:37 +01:00
Bianca Nenciu
d589c66f3e FIX: Fix URL to user profile. (#6881) 2019-01-23 18:27:21 +01:00
Joffrey JAFFEUX
80d42b4ea2
icons deprecations fixes (#6920) 2019-01-22 12:02:02 +01:00
Joffrey JAFFEUX
502b1316d0
DEV: s/this._super()/this._super(...arguments) (#6908) 2019-01-19 10:05:51 +01:00
Joffrey JAFFEUX
1a3655b787
DEV: s/Em/Ember (#6874) 2019-01-11 17:54:23 +01:00
Joffrey JAFFEUX
f9648de897
DEV: upgrades from Ember 2.13 to Ember 3.5.1 (#6808)
Co-Authored-By: Bianca Nenciu <nbianca@users.noreply.github.com>
Co-Authored-By: David Taylor <david@taylorhq.com>
2019-01-10 11:06:01 +01:00
Bianca Nenciu
e49bcebb35 FIX: Validate poll arguments. (#6740)
* FIX: Validate number poll.
* FEATURE: Poll's min can be 0.
* FIX: Fix URL to user profile.
2018-12-31 10:48:30 +01:00