FIX: improves locale support in tag-drop (#7418)

This commit is contained in:
Joffrey JAFFEUX 2019-04-23 17:53:59 +02:00 committed by GitHub
parent d4e788c136
commit c99faa6b25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 13 deletions

View File

@ -11,7 +11,6 @@ export default ComboBoxComponent.extend(TagsMixin, {
verticalOffset: 3,
value: Ember.computed.alias("tagId"),
headerComponent: "tag-drop/tag-drop-header",
rowComponent: "tag-drop/tag-drop-row",
allowAutoSelectFirst: false,
tagName: "li",
showFilterByTag: Ember.computed.alias("siteSettings.show_filter_by_tag"),
@ -136,7 +135,10 @@ export default ComboBoxComponent.extend(TagsMixin, {
_transformJson(context, json) {
let results = json.results;
results = results.sort((a, b) => a.id > b.id);
return results;
return results.map(r => {
return { id: r.id, name: r.text };
});
},
actions: {

View File

@ -1,8 +0,0 @@
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
export default SelectKitRowComponent.extend({
layoutName: "select-kit/templates/components/tag-drop/tag-drop-row",
classNames: "tag-drop-row",
tagId: Ember.computed.alias("computedContent.value")
});

View File

@ -24,13 +24,13 @@ componentTest("default", {
if (params.queryParams.q === "rég") {
return response({
"results": [
{ "id": "régis", "name": "régis", "count": 2, "pm_count": 0 }
{ "id": "régis", "text": "régis", "count": 2, "pm_count": 0 }
]
});
}else if (params.queryParams.q === "dav") {
return response({
"results": [
{ "id": "David", "name": "David", "count": 2, "pm_count": 0 }
{ "id": "David", "text": "David", "count": 2, "pm_count": 0 }
]
});
}