Commit Graph

39 Commits

Author SHA1 Message Date
7d94de6439 FIX: brings back castInteger as a safer migration path for sk2 (#8966) 2020-02-14 10:00:39 +01:00
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
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
875f0d8fd8 FEATURE: Tag synonyms
This feature adds the ability to define synonyms for tags, and the ability to merge one tag into another while keeping it as a synonym. For example, tags named "js" and "java-script" can be synonyms of "javascript". When searching and creating topics using synonyms, they will be mapped to the base tag.

Along with this change is a new UI found on each tag's page (for example, `/tags/javascript`) where more information about the tag can be shown. It will list the synonyms, which categories it's restricted to (if any), and which tag groups it belongs to (if tag group names are public on the `/tags` page by enabling the "tags listed by group" setting). Staff users will be able to manage tags in this UI, merge tags, and add/remove synonyms.
2019-12-04 13:33:51 -05:00
6275c05c0d DEV: Move computed to discourseComputed (#8312) 2019-11-07 15:38:28 -06:00
d93f753b17 apply prettier on gigantic find and replace (#7604) 2019-05-27 10:42:53 +02:00
bfea922167 DEV: global s/this.get\("(\w+)"\)/this.$1 (#7592) 2019-05-27 10:15:39 +02:00
049561ac49 FIX: introduces onSelectAny (regroup onSelect and onSelectNone) (#7594) 2019-05-24 13:11:33 +02:00
c093fa0376 PERF: reduces cpu/memory consumption of sk in some cases (#7525) 2019-05-10 17:12:10 +02:00
6c195640b9 FEATURE: adds an API to register topic footer buttons 2019-02-07 14:43:33 +01:00
e06a8980fb FIX: category-drop initial state was incorrect (#6743) 2018-12-10 14:05:00 +01:00
8da8f5d0f7 FIX: call onSelect plugin callbacks for noop rows (#6682) 2018-11-29 15:56:19 +01:00
9911a41f4c FIX: improves category/tag drops header shortcuts (#6610)
- wont appear when filtering
- can now be selected with keyboard
- fix bugs on click with safari/firefox
2018-11-15 15:21:40 +01:00
a713c0d366 FIX: ensures onSelect/onDeselect are called
This commit also add a FIX and a test for toolbar-popup-menu-options which had a behavior slightly specific.
2018-09-18 11:31:23 +02:00
2ff2c49908 Revert "FIX: ensures onSelect/onDeselect are called"
This reverts commit 52eed7329429abffefb7df7aac469e188a0ae298.
2018-09-17 22:14:41 +02:00
52eed73294 FIX: ensures onSelect/onDeselect are called 2018-09-17 10:36:14 +02:00
17087eff2a FIX: Reset tags on category change (#6363) 2018-09-05 17:18:52 +02:00
eb9b99e519 FIX: makes select-kit match searches with accents (filter and content) 2018-06-26 12:19:14 +02:00
03a7d532cf DEV: introduces prettier for es6 files 2018-06-15 17:03:24 +02:00
1be76d066c FIX: forces boolean when content is only "true" && "false" 2018-05-24 23:41:39 +02:00
f0fe16d824 FEATURE: implements minimum selection for select-kit 2018-04-05 16:45:19 +02:00
3287ac77e0 FIX: reverts combobox placeholder and introduces noneLabel
noneLabels works almost like none but instead of actually adding a row in the list, it will only change the text displayed in the header, when there's no selection.
2018-03-29 13:42:00 +02:00
d48542796e FIX: select-kit refactoring
- improve mini-tag-chooser keyboard behavior
- all multil select now respond to select all and left/right arrows
- improve events handling
- many minor tweaks
2018-03-22 11:29:55 +01:00
5e323139ae FIX: makes sure we recompute shouldDisplayCreateRow after request 2018-03-03 11:42:44 +01:00
ac701696b3 FEATURE: replaces tag-chooser/tag-group-chooser with select-kit component
These component were also the last using select2. As a consequence select2 is removed from Discourse in this commit.
2018-02-26 11:42:57 +01:00
6bfc25d895 FEATURE: new {{mini-tag-chooser}} replaces {{tag-chooser}} in composer 2018-02-13 17:23:12 +01:00
56834dbd98 FEATURE: select-kit api to modify collection header 2018-01-26 14:42:24 +01:00
3a290ee625 FEATURE: replaces category/tag dropdowns by select-kit 2018-01-24 11:48:20 +01:00
3ee7b18886 FIX: disable by default limitMatches 2018-01-11 09:54:39 +01:00
3ec2024466 select-kit refactoring
* improve events naming/handling
* do not explicitly check for true/Fasle
* make sure header is re-computed on toggle
2018-01-11 09:39:51 +01:00
c9921869f1 FIX: adds select-kit api to modify header computed content (#5476)
This api would allow to simply modify header text or icons, eg:

```
      api.modifySelectKit("select-kit")
        .modifyHeaderComputedContent((context, computedContent) => {
          computedContent.title = "Not so evil";
          return computedContent;
        });
```
2018-01-09 10:52:32 +01:00
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
dbadebacd1 FIX: allows select-kit to search by null value 2017-12-01 20:02:00 +01:00
49b1df40fc FIX: various issues when editing category permissions
This commit also adds multiple tests
2017-11-27 19:50:04 +01:00
96cdc4e66e FIX: makes allowInitialValueMutation more restrictive 2017-11-24 13:15:02 +01:00
fe94e7c453 FIX: more resilient allowInitiatlValueMutation implementation 2017-11-23 14:39:26 +01:00
acdfb3ed03 FIX: don’t convert an object using EachProxy to an array 2017-11-22 14:33:04 +01:00
b2b565c2fb select-kit initial plugin api implementation (0.8.13)
```
api.modifySelectKit("identifier-of-the-select-targeted")
  .modifyContent((context, existingContent) => {})
  .appendContent(() => {})
  .prependContent(() => {})
  .onSelect((context, val) => {});
```
2017-11-22 10:34:12 +01:00
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