DEV: linting

This commit is contained in:
jjaffeux 2020-09-22 17:12:39 +02:00
parent 8a5b3201b9
commit 3ed54c273a
4 changed files with 61 additions and 43 deletions

View File

@ -75,7 +75,9 @@ export default Ember.Controller.extend({
@discourseComputed("isSearching", "model") @discourseComputed("isSearching", "model")
searchCount(isSearching, model) { searchCount(isSearching, model) {
if (isSearching) return model.search_count; if (isSearching) {
return model.search_count;
}
}, },
emptySearchResults: Ember.computed.equal("searchCount", 0), emptySearchResults: Ember.computed.equal("searchCount", 0),
@ -194,8 +196,11 @@ export default Ember.Controller.extend({
this.set("orderColumn", "activity"); this.set("orderColumn", "activity");
} }
if (!ascending && order) this.set("ascending", true); if (!ascending && order) {
else this.set("ascending", ""); this.set("ascending", true);
} else {
this.set("ascending", "");
}
this.send("refreshModel"); this.send("refreshModel");
}, },

View File

@ -8,14 +8,27 @@ function getTopic(id) {
export default { export default {
list(params) { list(params) {
let filters = []; let filters = [];
if (params.filterCategories) if (params.filterCategories) {
filters.push(`category=${params.filterCategories}`); filters.push(`category=${params.filterCategories}`);
if (params.filterTags) filters.push(`tags=${params.filterTags}`); }
if (params.filterSolved) filters.push(`solved=${params.filterSolved}`); if (params.filterTags) {
if (params.searchTerm) filters.push(`search=${params.searchTerm}`); filters.push(`tags=${params.filterTags}`);
if (params.ascending) filters.push("ascending=true"); }
if (params.orderColumn) filters.push(`order=${params.orderColumn}`); if (params.filterSolved) {
if (params.page) filters.push(`page=${params.page}`); filters.push(`solved=${params.filterSolved}`);
}
if (params.searchTerm) {
filters.push(`search=${params.searchTerm}`);
}
if (params.ascending) {
filters.push("ascending=true");
}
if (params.orderColumn) {
filters.push(`order=${params.orderColumn}`);
}
if (params.page) {
filters.push(`page=${params.page}`);
}
let promise = ajax(`/docs.json?${filters.join("&")}`); let promise = ajax(`/docs.json?${filters.join("&")}`);

View File

@ -2,6 +2,6 @@
"author": "Discourse", "author": "Discourse",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"eslint-config-discourse": "latest" "eslint-config-discourse": "^1.1.4"
} }
} }

View File

@ -161,9 +161,9 @@
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
acorn-jsx@^5.2.0: acorn-jsx@^5.2.0:
version "5.2.0" version "5.3.1"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b"
integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ== integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==
acorn@^7.1.1: acorn@^7.1.1:
version "7.4.0" version "7.4.0"
@ -171,9 +171,9 @@ acorn@^7.1.1:
integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w== integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==
ajv@^6.10.0, ajv@^6.10.2: ajv@^6.10.0, ajv@^6.10.2:
version "6.12.4" version "6.12.5"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.4.tgz#0614facc4522127fa713445c6bfd3ebd376e2234" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.5.tgz#19b0e8bae8f476e5ba666300387775fb1a00a4da"
integrity sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ== integrity sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==
dependencies: dependencies:
fast-deep-equal "^3.1.1" fast-deep-equal "^3.1.1"
fast-json-stable-stringify "^2.0.0" fast-json-stable-stringify "^2.0.0"
@ -405,11 +405,11 @@ debug@^2.6.8:
ms "2.0.0" ms "2.0.0"
debug@^4.0.1, debug@^4.1.0: debug@^4.0.1, debug@^4.1.0:
version "4.1.1" version "4.2.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1"
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==
dependencies: dependencies:
ms "^2.1.1" ms "2.1.2"
decamelize@^1.2.0: decamelize@^1.2.0:
version "1.2.0" version "1.2.0"
@ -453,9 +453,9 @@ ember-template-lint-plugin-discourse@latest:
integrity sha512-BMd5QyUCTRFgIYXlzS0yO5nfg3U4oZ/UpFEYw7KuZ/zPbTSP17g22KfbCydi4ByaP5lw3jn3Fu/dIKQ9aCuoJQ== integrity sha512-BMd5QyUCTRFgIYXlzS0yO5nfg3U4oZ/UpFEYw7KuZ/zPbTSP17g22KfbCydi4ByaP5lw3jn3Fu/dIKQ9aCuoJQ==
ember-template-lint@^2.11.0: ember-template-lint@^2.11.0:
version "2.11.0" version "2.12.1"
resolved "https://registry.yarnpkg.com/ember-template-lint/-/ember-template-lint-2.11.0.tgz#90a074bd7ef86df07dca622c70debe7bce375ff2" resolved "https://registry.yarnpkg.com/ember-template-lint/-/ember-template-lint-2.12.1.tgz#718b6141b2001ca6e74764f7f59d8554a86473f4"
integrity sha512-GFjrhD73vgmSgk15dfT8xwPJdUh8WzmOR2FPdN26KGbB7bB1mJREf5QD+ddgXzi0o6oFGq6A0xhowpy0RwuNIQ== integrity sha512-LbnDoHRXGPPNPACvSAatkZVPY9jBFlobdf7I7kdvSD8/W9c2/XDDejAVhHnbWFhPn+U12bA7Lgt505Vq6D7hLw==
dependencies: dependencies:
chalk "^4.0.0" chalk "^4.0.0"
ember-template-recast "^4.1.5" ember-template-recast "^4.1.5"
@ -498,10 +498,10 @@ escape-string-regexp@^1.0.5:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
eslint-config-discourse@latest: eslint-config-discourse@^1.1.4:
version "1.1.3" version "1.1.4"
resolved "https://registry.yarnpkg.com/eslint-config-discourse/-/eslint-config-discourse-1.1.3.tgz#38b85e810cad72280073d659565bf25611331ac3" resolved "https://registry.yarnpkg.com/eslint-config-discourse/-/eslint-config-discourse-1.1.4.tgz#cff9f93f17dfcefe4852bb417f747c28444b4bd7"
integrity sha512-n6ZRuFPMVn+jHpszZhNQwFRsIG1mRq5LrFdbN/WNDW7ohk+iyYyLkwB8btJFms5CcfHLsiiey92EAh3oNavrpw== integrity sha512-4Yilkkmdkz/LdEiQCbng6evI2w33HDs9lXgiae0DutjTboqs/TauQXySusxHagKr9GFtefPOxovzNKwD2s1ggw==
dependencies: dependencies:
babel-eslint "^10.1.0" babel-eslint "^10.1.0"
ember-template-lint "^2.11.0" ember-template-lint "^2.11.0"
@ -555,11 +555,11 @@ eslint-plugin-node@^8.0.0:
semver "^5.5.0" semver "^5.5.0"
eslint-scope@^5.0.0: eslint-scope@^5.0.0:
version "5.1.0" version "5.1.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
integrity sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w== integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==
dependencies: dependencies:
esrecurse "^4.1.0" esrecurse "^4.3.0"
estraverse "^4.1.1" estraverse "^4.1.1"
eslint-utils@^1.3.1, eslint-utils@^1.4.2, eslint-utils@^1.4.3: eslint-utils@^1.3.1, eslint-utils@^1.4.2, eslint-utils@^1.4.3:
@ -638,7 +638,7 @@ esquery@^1.0.1:
dependencies: dependencies:
estraverse "^5.1.0" estraverse "^5.1.0"
esrecurse@^4.1.0: esrecurse@^4.3.0:
version "4.3.0" version "4.3.0"
resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921"
integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==
@ -1052,7 +1052,7 @@ ms@2.0.0:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
ms@^2.1.1: ms@2.1.2:
version "2.1.2" version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
@ -1205,9 +1205,9 @@ prelude-ls@~1.1.2:
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
prettier@^2.1.1: prettier@^2.1.1:
version "2.1.1" version "2.1.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.1.tgz#d9485dd5e499daa6cb547023b87a6cf51bee37d6" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5"
integrity sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw== integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==
progress@^2.0.0: progress@^2.0.0:
version "2.0.3" version "2.0.3"
@ -1289,9 +1289,9 @@ run-parallel@^1.1.9:
integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==
rxjs@^6.6.0: rxjs@^6.6.0:
version "6.6.2" version "6.6.3"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.2.tgz#8096a7ac03f2cc4fe5860ef6e572810d9e01c0d2" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552"
integrity sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg== integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==
dependencies: dependencies:
tslib "^1.9.0" tslib "^1.9.0"
@ -1493,9 +1493,9 @@ type-fest@^0.8.1:
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==
uglify-js@^3.1.4: uglify-js@^3.1.4:
version "3.10.3" version "3.10.4"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.10.3.tgz#f0d2f99736c14de46d2d24649ba328be3e71c3bf" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.10.4.tgz#dd680f5687bc0d7a93b14a3482d16db6eba2bfbb"
integrity sha512-Lh00i69Uf6G74mvYpHCI9KVVXLcHW/xu79YTvH7Mkc9zyKUeSPz0owW0dguj0Scavns3ZOh3wY63J0Zb97Za2g== integrity sha512-kBFT3U4Dcj4/pJ52vfjCSfyLyvG9VYYuGYPmrPvAxRw/i7xHiT4VvCev+uiEMcEEiu6UNB6KgWmGtSUYIWScbw==
uri-js@^4.2.2: uri-js@^4.2.2:
version "4.4.0" version "4.4.0"