Commit Graph

112 Commits

Author SHA1 Message Date
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
Mark VanLandingham 44612f900e
FIX: Remove 'staff_only' results option for non-staff (#8565) 2019-12-17 13:43:15 -08:00
Mark VanLandingham a3157f0e38
FIX: The build; ran prettier (#8412) 2019-11-25 12:12:44 -06:00
Mark VanLandingham b92a8131c0
FEATURE: Pie chart option for poll results (#8352) 2019-11-25 11:51:01 -06:00
Penar Musaraj 20f5a062f4 Fix Prettier in poll plugin 2019-11-15 11:01:22 -05:00
Kris 4338515a85 fix poll test 2019-10-16 21:53:37 -04: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
Joffrey JAFFEUX c1d2fb115c
DEV: prevents staff computed property to be overridden (#7931) 2019-07-24 22:01:08 +02:00
Robin Ward a8793d0d9a REFACTOR: Test Memory Usage Fixes (#7769)
* Calling `Discourse.reset()` creates a new container
We should run our de-initializers only after acceptance tests,
since initializers are not run outside of acceptance tests anyway,
and the container at this point can be passed properly to the
`teardown()` method.

* Remove `Discourse.reset` from tests
This would cause a new container to be created which leaks many objects.

* `updateCurrentUser` is more accurate than `replaceCurrentUser`
2019-06-14 14:54:20 +02:00
Joffrey JAFFEUX b339d67401
DEV: refactors select-kit helper to prevent it to leak into global state (#7708) 2019-06-06 10:47:10 +02:00
Bianca Nenciu 3cf922a58a FIX: URL to user profile in poll results. (#7315) 2019-04-03 22:17:05 +02:00
Régis Hanol 6b006c383b FIX: polls acceptance tests 2019-02-27 19:16:24 +01:00
Joffrey JAFFEUX 5952a6c0ad
DEV: uses find() helper instead of this.$() in js tests (#7062) 2019-02-25 16:04:55 +01:00
Régis Hanol 671ff4243f
FIX: discourse-poll-option test wasn't working 2019-01-24 14:55:36 +01:00
Bianca Nenciu d589c66f3e FIX: Fix URL to user profile. (#6881) 2019-01-23 18:27:21 +01:00
Régis Hanol b478984f60 make eslint happy 2018-12-31 12:38:45 +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
Bianca Nenciu 285ff3bfbd FIX: Show every voter only once. (#6746)
Each voter is represented by an object and Set does not properly check for equality.
2018-12-11 14:00:28 +01:00
Penar Musaraj 03deda2147
Upgrade to FontAwesome 5 (take two) (#6673)
* Add missing icons to set

* Revert FA5 revert

 This reverts commit 42572ff

* use new SVG syntax in locales

* Noscript page changes (remove login button, center "powered by" footer text)

* Cast wider net for SVG icons in settings

- include any _icon setting for SVG registry (offers better support for plugin settings)

- let themes store multiple pipe-delimited icons in a setting

- also replaces broken onebox image icon with SVG reference in cooked post processor

* interpolate icons in locales

* Fix composer whisper icon alignment

* Add support for stacked icons

* SECURITY: enforce hostname to match discourse hostname

This ensures that the hostname rails uses for various helpers always matches
the Discourse hostname

* load SVG sprite with pre-initializers

* FIX: enable caching on SVG sprites

* PERF: use JSONP for SVG sprites so they are served from CDN

This avoids needing to deal with CORS for loading of the SVG

Note, added the svg- prefix to the filename so we can quickly tell in
dev tools what the file is

* Add missing SVG sprite JSONP script to CSP

* Upgrade to FA 5.5.0

* Add support for all FA4.7 icons

- adds complete frontend and backend for renamed FA4.7 icons

- improves performance of SvgSprite.bundle and SvgSprite.all_icons

* Fix group avatar flair preview

- adds an endpoint at /svg-sprites/search/:keyword

- adds frontend ajax call that pulls icon in avatar flair preview even when it is not in subset

* Remove FA 4.7 font files
2018-11-26 16:49:57 -05:00
Régis Hanol 4459665dee
REFACTOR: use tables instead of custom fields for polls (#6359)
Co-authored-by: Guo Xiang Tan <tgx_world@hotmail.com>
2018-11-19 14:50:00 +01:00
Sam 42572ff138 Revert font awesome 5 changes
We are still pushing ahead on this 100% just need a bit longer to prepare
all plugins
2018-11-08 16:12:18 +11:00
Penar Musaraj 005e1ecb9b
FEATURE: Update Font Awesome to v5.4.1 and SVGs (#6557)
* First take on subsetting svg icons

* FontAwesome 5 svg subset WIP

* Include icons from plugins/badges into svg sprite subset

* add svg icon support to themes

* Add spec for SvgSprite

* Misc. SVG icon fixes

* Use FA5 svgs in local-dates plugin

* CSS adjustments, fix SVG icons in group flair

* Use SVG icons in poll plugin

* Add SVG icons to /wizard
2018-11-07 13:05:43 -05:00
Maja Komel 04baddf731 DEV: migrate tests to async/await 2018-07-30 12:21:05 +02:00
Joffrey JAFFEUX 60ff0e9b8c
missing prettified files 2018-06-15 18:42:20 +02:00
Guo Xiang Tan 4319273cf5 UX: Split up group form into smaller sections. 2018-04-09 15:14:50 +08:00
Joffrey JAFFEUX 315b9d796d
select-kit refactoring
* better test helper
* more reliable tests
* more consistent use of data-value/data-name/title/aria-label everywhere: header and rows
2017-12-22 13:08:12 +01:00
Joffrey JAFFEUX c1c31b99ce
Replaces toolbar popup-menu with select-kit 2017-12-13 10:49:32 +01:00
Joffrey JAFFEUX 316d814130
FIX: staff should always be allowed to create polls if they are enabled 2017-12-05 00:03:56 +01:00
Joffrey JAFFEUX 76bc173d47
FEATURE: adds poll_allow_staff_to_create
This setting will bypass poll_minimum_trust_level_to_create if set to true
2017-12-04 18:12:17 +01:00
Joffrey JAFFEUX 63bab32816 FEATURE: introduces minimum trust level for polls (#5391)
* FEATURE: introduces minimum trust level for polls

This commit makes `poll_enabled` less misleading and introduces `poll_minimum_trust_level_to_create`. If poll are enabled they will always be cooked, and if you have the required trust level you can create polls. As a side effect, it also fixes a bug where rebaking a post created by staff member when `poll_enabled=false` would end up not cooking it.

It also adds more tests to ensure settings are respected.

* admins should be whitelisted

* checks for admin in post validation

* test for >= instead of == trust level
2017-12-04 14:47:11 +01:00
Eric Berry ab22c8cad4 FIX: Infinite loop when poll step is zero (#5380)
* Fix infinite loop when poll step is zero

* Add test for step minimum and for breaking test

* Remove trailing spaces (eslint)

* Remove extra space (eslint)

* Removed test call .twice
2017-11-30 17:04:41 +01:00
Joffrey JAFFEUX 9208909b26 tweak icon-library generation 2017-11-23 18:24:26 +01:00
Joffrey JAFFEUX 39f3dbd945
Introduces select-kit
* renames `select-box-kit` into `select-kit`
* introduces `single-select` and `multi-select` as base components
* introduces {{search-advanced-category-chooser}} as a better component for selecting category in advanced search
* improves events handling in select-kit
* recreates color selection inputs using {{multi-select}} and a custom {{selected-color}} component
* replaces category-selector by a component using select-kit and based on multi-select
* improves positioning of wrapper
* removes the need for offscreen, and instead use `select-kit-header` as a base focus point for all select-kit based components
* introduces a formal plugin api for select-kit based components
* introduces a formal pattern for loading and updating select-kit based components:

```
computeValue()
computeContent()
mutateValue()
```
2017-11-21 11:53:09 +01:00
David Taylor ea032d8372 Improve source code linting for continuous integration (#5017)
* Add rubocop linting to docker:test rake task

* Add eslint JS listing to plugin files, and add SKIP_LINT variable

* Fix failing ‘polls’ plugin eslint

Using eslint-disable-line, as is done in core qunit tests such as `acceptance/group-logs-test.js.es6`

* Add plugin test eslint to travis config

* Merge some eslint lines
2017-08-02 11:33:29 +09:00
Robin Ward 5b590b9637 REFACTOR: Replace some `fa-*` uses with helpers 2017-07-27 14:55:41 -04:00
Robin Ward cc525b1a8d Upgrade QUnit to latest version 2017-06-15 10:12:07 -04:00
Rafael dos Santos Silva 3eb125c39b FIX: Fix poll builder qunit tests 2017-04-05 18:07:50 -03:00
Robin Ward e089515dab FIX: Don't try to load avatars in test mode 2017-02-17 16:21:35 -05:00
Guo Xiang Tan 8bd8f07ce0 FIX: Public polls should not make a request per option. 2017-01-31 17:27:43 +08:00
Guo Xiang Tan 288e5faf6b FIX: Sort needs to be stable. 2016-12-22 11:45:41 +08:00
Robin Ward e03d5e2140 Reapply Ember 2.10 for good this time!
This reverts commit ddd299f4aa.
2016-12-19 11:19:10 -05:00
Robin Ward ddd299f4aa Revert "Revert "Revert Ember 2.10+ for a short while""
This reverts commit 76bbc481cb.
2016-12-16 10:29:30 -05:00
Robin Ward 76bbc481cb Revert "Revert Ember 2.10+ for a short while"
This reverts commit 21682fd60b.
2016-12-16 09:52:29 -05:00
Robin Ward 21682fd60b Revert Ember 2.10+ for a short while 2016-12-15 16:43:38 -05:00
Robin Ward 28699e66d8 Revert "REVERT: Ember 2.10 -- it's not building properly"
This reverts commit 600541c623.
2016-12-15 10:28:15 -05:00
Robin Ward 600541c623 REVERT: Ember 2.10 -- it's not building properly 2016-12-12 16:19:05 -05:00
Robin Ward 765e5e9186 Upgrade to Ember 2.9 2016-12-12 14:44:29 -05:00
Robin Ward f07443b488 Migrate Discourse Polls to use vdom instead of embedded ember 2016-12-09 10:42:56 -05:00
Guo Xiang Tan 6b4ef86ac4 Add acceptance test for rendering polls. 2016-12-01 10:58:00 +08:00
Robin Ward 28061316ad Migrate poll plugin to use components 2016-11-21 14:49:46 -05:00
Robin Ward 6a1c05a268 Upgrade ember-qunit 2016-11-08 14:29:50 -05:00
Guo Xiang Tan d970f4d3d8 Fix incorrect test. 2016-07-29 17:05:00 +08:00
Guo Xiang Tan e336e56153 FIX: Incorrect sort for poll results. 2016-07-29 14:42:55 +08:00
Guo Xiang Tan 32c962cfd8 UX: Remove button styles on polls. 2016-07-29 11:09:23 +08:00
Guo Xiang Tan a7f2b2ded6 FEATURE: Allow poll results to be sorted. 2016-07-29 10:37:27 +08:00
Robin Ward 8141e1d9bc FIX: details fixes with extra formatting 2016-07-19 15:14:55 -04:00
Loic Dachary f152900969 FIX: poll builder should ignore empty lines
Although pollOptionsCount skips empty lines, pollOutput inserts empty
lines. Skip them instead.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-07-14 09:27:43 +02:00
Guo Xiang Tan 01c563ca85
FIX: Use internal value for poll builder. 2016-06-20 12:40:44 +08:00
Guo Xiang Tan 4df224bb79
FIX: Trim whitespaces and do a global replace. 2016-06-16 16:35:23 +08:00
Guo Xiang Tan 8d46727d67
FEATURE: Poll UI Builder. 2016-06-15 11:14:24 +08:00