diff --git a/package-lock.json b/package-lock.json index 4587399a2da..5a99b467e51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -64,7 +64,7 @@ "devDependencies": { "@nextcloud/babel-config": "^1.0.0", "@nextcloud/browserslist-config": "^2.1.0", - "@nextcloud/eslint-config": "^5.1.0", + "@nextcloud/eslint-config": "^6.1.0", "@nextcloud/stylelint-config": "^1.0.0-beta.0", "@nextcloud/webpack-vue-config": "^4.1.0", "@vue/cli-plugin-unit-jest": "^4.5.13", @@ -2694,6 +2694,21 @@ "node": ">=10.0.0" } }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.10.7", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.10.7.tgz", + "integrity": "sha512-aNKZEoMESDzOBjKxCWrFuG50mcpMeKVBnBNko4+IZZ5t9zXYs8GT1KB0ZaOq1YUsKumDRc6YII/TQm309MJ0KQ==", + "dev": true, + "peer": true, + "dependencies": { + "comment-parser": "1.2.3", + "esquery": "^1.4.0", + "jsdoc-type-pratt-parser": "1.1.1" + }, + "engines": { + "node": "^12.20 || ^14.14.0 || ^16" + } + }, "node_modules/@eslint/eslintrc": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", @@ -3457,9 +3472,9 @@ } }, "node_modules/@nextcloud/eslint-config": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@nextcloud/eslint-config/-/eslint-config-5.1.0.tgz", - "integrity": "sha512-NNSKvgkV6dSGD77ty7OARdO2YwL+fAvxkegXJK1UaTI9nSDsiPAHyYwaYrkOUmrVygpprzqsdnTofeKIq1JepQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@nextcloud/eslint-config/-/eslint-config-6.1.0.tgz", + "integrity": "sha512-vQFzM+AAUcUqTbg6obtCs7TMyT9TNmL5PCQqjwx+QYTBi3lA7osD60Gf2kqbhN3pKhal8FNwxHorwvaaqZRC8Q==", "dev": true, "peerDependencies": { "@babel/core": "^7.13.10", @@ -3468,10 +3483,10 @@ "eslint": "^7.13.0", "eslint-config-standard": "^16.0.1", "eslint-plugin-import": "^2.22.1", + "eslint-plugin-jsdoc": "^36.0.4", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-vue": "^7.1.0", - "eslint-webpack-plugin": "^2.2.0", + "eslint-plugin-promise": "^5.1.0", + "eslint-plugin-vue": "^7.15.0", "webpack": "^5.4.0" } }, @@ -8871,6 +8886,16 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==" }, + "node_modules/comment-parser": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.3.tgz", + "integrity": "sha512-vnqDwBSXSsdAkGS5NjwMIPelE47q+UkEgWKHvCDNhVIIaQSUFY6sNnEYGzdoPGMdpV+7KR3ZkRd7oyWIjtuvJg==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.20 || ^14.14.0 || ^16" + } + }, "node_modules/common-tags": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", @@ -9863,14 +9888,19 @@ "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==" }, "node_modules/debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dependencies": { "ms": "2.1.2" }, "engines": { "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/debug/node_modules/ms": { @@ -11226,6 +11256,66 @@ "node": ">=4" } }, + "node_modules/eslint-plugin-jsdoc": { + "version": "36.0.7", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-36.0.7.tgz", + "integrity": "sha512-x73l/WCRQ1qCjLq46Ca7csuGd5o3y3vbJIa3cktg11tdf3UZleBdIXKN9Cf0xjs3tXYPEy2SoNXowT8ydnjNDQ==", + "dev": true, + "peer": true, + "dependencies": { + "@es-joy/jsdoccomment": "0.10.7", + "comment-parser": "1.2.3", + "debug": "^4.3.2", + "esquery": "^1.4.0", + "jsdoc-type-pratt-parser": "^1.1.1", + "lodash": "^4.17.21", + "regextras": "^0.8.0", + "semver": "^7.3.5", + "spdx-expression-parse": "^3.0.1" + }, + "engines": { + "node": "^12.20 || ^14.14.0 || ^16" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "peer": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "peer": true + }, "node_modules/eslint-plugin-node": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", @@ -11265,26 +11355,29 @@ } }, "node_modules/eslint-plugin-promise": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.3.1.tgz", - "integrity": "sha512-bY2sGqyptzFBDLh/GMbAxfdJC+b0f23ME63FOE4+Jao0oZ3E1LEwFtWJX/1pGMJLiTtrSSern2CRM/g+dfc0eQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-5.1.0.tgz", + "integrity": "sha512-NGmI6BH5L12pl7ScQHbg7tvtk4wPxxj8yPHH47NvSmMtFneC077PSeY3huFj06ZWZvtbfxSPt3RuOQD5XcR4ng==", "dev": true, "peer": true, "engines": { - "node": ">=6" + "node": "^10.12.0 || >=12.0.0" + }, + "peerDependencies": { + "eslint": "^7.0.0" } }, "node_modules/eslint-plugin-vue": { - "version": "7.11.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.11.1.tgz", - "integrity": "sha512-lbw3vkEAGqYjqd1HpPFWHXtYaS8mILTJ5KOpJfRxO3Fo7o0wCf1zD7vSOasbm6nTA9xIgvZQ4VcyGIzQXxznHw==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.16.0.tgz", + "integrity": "sha512-0E2dVvVC7I2Xm1HXyx+ZwPj9CNX4NJjs4K4r+GVsHWyt5Pew3JLD4fI7A91b2jeL0TXE7LlszrwLSTJU9eqehw==", "dev": true, "peer": true, "dependencies": { "eslint-utils": "^2.1.0", "natural-compare": "^1.4.0", - "semver": "^7.3.2", - "vue-eslint-parser": "^7.6.0" + "semver": "^6.3.0", + "vue-eslint-parser": "^7.10.0" }, "engines": { "node": ">=8.10" @@ -11293,42 +11386,16 @@ "eslint": "^6.2.0 || ^7.0.0" } }, - "node_modules/eslint-plugin-vue/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "peer": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint-plugin-vue/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "peer": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" } }, - "node_modules/eslint-plugin-vue/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true, - "peer": true - }, "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -15870,6 +15937,16 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-1.1.1.tgz", + "integrity": "sha512-uelRmpghNwPBuZScwgBG/OzodaFk5RbO5xaivBdsAY70icWfShwZ7PCMO0x1zSkOa8T1FzHThmrdoyg/0AwV5g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/jsdom": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", @@ -19847,6 +19924,16 @@ "node": ">=4" } }, + "node_modules/regextras": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.8.0.tgz", + "integrity": "sha512-k519uI04Z3SaY0fLX843MRXnDeG2+vHOFsyhiPZvNLe7r8rD2YNRjq4BQLZZ0oAr2NrtvZlICsXysGNFPGa3CQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.1.14" + } + }, "node_modules/regjsgen": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", @@ -21432,9 +21519,9 @@ "dev": true }, "node_modules/spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "dependencies": { "spdx-exceptions": "^2.1.0", @@ -22208,19 +22295,6 @@ "dev": true, "peer": true }, - "node_modules/stylelint/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "peer": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - } - }, "node_modules/stylelint/node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -22452,13 +22526,6 @@ "node": ">=8.6" } }, - "node_modules/stylelint/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true, - "peer": true - }, "node_modules/stylelint/node_modules/normalize-package-data": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.2.tgz", @@ -24187,18 +24254,19 @@ } }, "node_modules/vue-eslint-parser": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.6.0.tgz", - "integrity": "sha512-QXxqH8ZevBrtiZMZK0LpwaMfevQi9UL7lY6Kcp+ogWHC88AuwUPwwCIzkOUc1LR4XsYAt/F9yHXAB/QoD17QXA==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.10.0.tgz", + "integrity": "sha512-7tc/ewS9Vq9Bn741pvpg8op2fWJPH3k32aL+jcIcWGCTzh/zXSdh7pZ5FV3W2aJancP9+ftPAv292zY5T5IPCg==", "dev": true, "peer": true, "dependencies": { "debug": "^4.1.1", - "eslint-scope": "^5.0.0", + "eslint-scope": "^5.1.1", "eslint-visitor-keys": "^1.1.0", "espree": "^6.2.1", "esquery": "^1.4.0", - "lodash": "^4.17.15" + "lodash": "^4.17.21", + "semver": "^6.3.0" }, "engines": { "node": ">=8.10" @@ -24238,6 +24306,16 @@ "node": ">=6.0.0" } }, + "node_modules/vue-eslint-parser/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/vue-fragment": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/vue-fragment/-/vue-fragment-1.5.2.tgz", @@ -28816,6 +28894,18 @@ "dev": true, "peer": true }, + "@es-joy/jsdoccomment": { + "version": "0.10.7", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.10.7.tgz", + "integrity": "sha512-aNKZEoMESDzOBjKxCWrFuG50mcpMeKVBnBNko4+IZZ5t9zXYs8GT1KB0ZaOq1YUsKumDRc6YII/TQm309MJ0KQ==", + "dev": true, + "peer": true, + "requires": { + "comment-parser": "1.2.3", + "esquery": "^1.4.0", + "jsdoc-type-pratt-parser": "1.1.1" + } + }, "@eslint/eslintrc": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", @@ -29466,9 +29556,9 @@ } }, "@nextcloud/eslint-config": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@nextcloud/eslint-config/-/eslint-config-5.1.0.tgz", - "integrity": "sha512-NNSKvgkV6dSGD77ty7OARdO2YwL+fAvxkegXJK1UaTI9nSDsiPAHyYwaYrkOUmrVygpprzqsdnTofeKIq1JepQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@nextcloud/eslint-config/-/eslint-config-6.1.0.tgz", + "integrity": "sha512-vQFzM+AAUcUqTbg6obtCs7TMyT9TNmL5PCQqjwx+QYTBi3lA7osD60Gf2kqbhN3pKhal8FNwxHorwvaaqZRC8Q==", "dev": true, "requires": {} }, @@ -34113,6 +34203,13 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==" }, + "comment-parser": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.3.tgz", + "integrity": "sha512-vnqDwBSXSsdAkGS5NjwMIPelE47q+UkEgWKHvCDNhVIIaQSUFY6sNnEYGzdoPGMdpV+7KR3ZkRd7oyWIjtuvJg==", + "dev": true, + "peer": true + }, "common-tags": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", @@ -34946,9 +35043,9 @@ "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==" }, "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "requires": { "ms": "2.1.2" }, @@ -36310,6 +36407,53 @@ } } }, + "eslint-plugin-jsdoc": { + "version": "36.0.7", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-36.0.7.tgz", + "integrity": "sha512-x73l/WCRQ1qCjLq46Ca7csuGd5o3y3vbJIa3cktg11tdf3UZleBdIXKN9Cf0xjs3tXYPEy2SoNXowT8ydnjNDQ==", + "dev": true, + "peer": true, + "requires": { + "@es-joy/jsdoccomment": "0.10.7", + "comment-parser": "1.2.3", + "debug": "^4.3.2", + "esquery": "^1.4.0", + "jsdoc-type-pratt-parser": "^1.1.1", + "lodash": "^4.17.21", + "regextras": "^0.8.0", + "semver": "^7.3.5", + "spdx-expression-parse": "^3.0.1" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "peer": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "peer": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "peer": true + } + } + }, "eslint-plugin-node": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", @@ -36342,49 +36486,30 @@ } }, "eslint-plugin-promise": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.3.1.tgz", - "integrity": "sha512-bY2sGqyptzFBDLh/GMbAxfdJC+b0f23ME63FOE4+Jao0oZ3E1LEwFtWJX/1pGMJLiTtrSSern2CRM/g+dfc0eQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-5.1.0.tgz", + "integrity": "sha512-NGmI6BH5L12pl7ScQHbg7tvtk4wPxxj8yPHH47NvSmMtFneC077PSeY3huFj06ZWZvtbfxSPt3RuOQD5XcR4ng==", "dev": true, - "peer": true + "peer": true, + "requires": {} }, "eslint-plugin-vue": { - "version": "7.11.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.11.1.tgz", - "integrity": "sha512-lbw3vkEAGqYjqd1HpPFWHXtYaS8mILTJ5KOpJfRxO3Fo7o0wCf1zD7vSOasbm6nTA9xIgvZQ4VcyGIzQXxznHw==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.16.0.tgz", + "integrity": "sha512-0E2dVvVC7I2Xm1HXyx+ZwPj9CNX4NJjs4K4r+GVsHWyt5Pew3JLD4fI7A91b2jeL0TXE7LlszrwLSTJU9eqehw==", "dev": true, "peer": true, "requires": { "eslint-utils": "^2.1.0", "natural-compare": "^1.4.0", - "semver": "^7.3.2", - "vue-eslint-parser": "^7.6.0" + "semver": "^6.3.0", + "vue-eslint-parser": "^7.10.0" }, "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "peer": true, - "requires": { - "yallist": "^4.0.0" - } - }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "peer": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "peer": true } @@ -39845,6 +39970,13 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true }, + "jsdoc-type-pratt-parser": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-1.1.1.tgz", + "integrity": "sha512-uelRmpghNwPBuZScwgBG/OzodaFk5RbO5xaivBdsAY70icWfShwZ7PCMO0x1zSkOa8T1FzHThmrdoyg/0AwV5g==", + "dev": true, + "peer": true + }, "jsdom": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", @@ -43260,6 +43392,13 @@ "unicode-match-property-value-ecmascript": "^1.2.0" } }, + "regextras": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.8.0.tgz", + "integrity": "sha512-k519uI04Z3SaY0fLX843MRXnDeG2+vHOFsyhiPZvNLe7r8rD2YNRjq4BQLZZ0oAr2NrtvZlICsXysGNFPGa3CQ==", + "dev": true, + "peer": true + }, "regjsgen": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", @@ -44577,9 +44716,9 @@ "dev": true }, "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -45180,16 +45319,6 @@ "dev": true, "peer": true }, - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "peer": true, - "requires": { - "ms": "2.1.2" - } - }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -45372,13 +45501,6 @@ } } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true, - "peer": true - }, "normalize-package-data": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.2.tgz", @@ -46876,18 +46998,19 @@ } }, "vue-eslint-parser": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.6.0.tgz", - "integrity": "sha512-QXxqH8ZevBrtiZMZK0LpwaMfevQi9UL7lY6Kcp+ogWHC88AuwUPwwCIzkOUc1LR4XsYAt/F9yHXAB/QoD17QXA==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.10.0.tgz", + "integrity": "sha512-7tc/ewS9Vq9Bn741pvpg8op2fWJPH3k32aL+jcIcWGCTzh/zXSdh7pZ5FV3W2aJancP9+ftPAv292zY5T5IPCg==", "dev": true, "peer": true, "requires": { "debug": "^4.1.1", - "eslint-scope": "^5.0.0", + "eslint-scope": "^5.1.1", "eslint-visitor-keys": "^1.1.0", "espree": "^6.2.1", "esquery": "^1.4.0", - "lodash": "^4.17.15" + "lodash": "^4.17.21", + "semver": "^6.3.0" }, "dependencies": { "acorn": { @@ -46908,6 +47031,13 @@ "acorn-jsx": "^5.2.0", "eslint-visitor-keys": "^1.1.0" } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "peer": true } } }, diff --git a/package.json b/package.json index 8db52c07f8e..904d9fb9f7b 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "devDependencies": { "@nextcloud/babel-config": "^1.0.0", "@nextcloud/browserslist-config": "^2.1.0", - "@nextcloud/eslint-config": "^5.1.0", + "@nextcloud/eslint-config": "^6.1.0", "@nextcloud/stylelint-config": "^1.0.0-beta.0", "@nextcloud/webpack-vue-config": "^4.1.0", "@vue/cli-plugin-unit-jest": "^4.5.13", diff --git a/src/App.vue b/src/App.vue index db7554d2a62..2aab31fc11f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -120,7 +120,8 @@ export default { /** * Keeps a list for all last message ids - * @returns {object} Map with token => lastMessageId + * + * @return {object} Map with token => lastMessageId */ lastMessageMap() { const conversationList = this.$store.getters.conversationsList @@ -151,7 +152,7 @@ export default { }, /** - * @returns {boolean} Returns true, if + * @return {boolean} Returns true, if * - a conversation is newly added to lastMessageMap * - a conversation has a different last message id then previously */ @@ -170,7 +171,8 @@ export default { /** * The current conversation token - * @returns {string} The token. + * + * @return {string} The token. */ token() { return this.$store.getters.getToken() @@ -178,7 +180,8 @@ export default { /** * The current conversation - * @returns {object} The conversation object. + * + * @return {object} The conversation object. */ currentConversation() { return this.$store.getters.conversation(this.token) @@ -186,7 +189,8 @@ export default { /** * Computes whether the current conversation is one to one - * @returns {boolean} The result + * + * @return {boolean} The result */ isOneToOne() { return this.currentConversation?.type === CONVERSATION.TYPE.ONE_TO_ONE @@ -214,17 +218,17 @@ export default { beforeDestroy() { if (!getCurrentUser()) { - EventBus.$off('shouldRefreshConversations', this.debounceRefreshCurrentConversation) + EventBus.$off('should-refresh-conversations', this.debounceRefreshCurrentConversation) } document.removeEventListener('visibilitychange', this.changeWindowVisibility) }, beforeMount() { if (!getCurrentUser()) { - EventBus.$once('joinedConversation', () => { + EventBus.$once('joined-conversation', () => { this.fixmeDelayedSetupOfGuestUsers() }) - EventBus.$on('shouldRefreshConversations', this.debounceRefreshCurrentConversation) + EventBus.$on('should-refresh-conversations', this.debounceRefreshCurrentConversation) } if (this.$route.name === 'conversation') { @@ -251,7 +255,7 @@ export default { } }) - EventBus.$on('conversationsReceived', (params) => { + EventBus.$on('conversations-received', (params) => { if (this.$route.name === 'conversation' && !this.$store.getters.conversation(this.token)) { if (!params.singleConversation) { @@ -270,7 +274,7 @@ export default { * component each time a new batch of conversations is received and processed in * the store. */ - EventBus.$once('conversationsReceived', () => { + EventBus.$once('conversations-received', () => { if (this.$route.name === 'conversation') { // Adjust the page title once the conversation list is loaded this.setPageTitle(this.getConversationName(this.token), false) @@ -309,14 +313,14 @@ export default { * Fires a global event that tells the whole app that the route has changed. The event * carries the from and to objects as payload */ - EventBus.$emit('routeChange', { from, to }) + EventBus.$emit('route-change', { from, to }) next() } /** * Global before guard, this is called whenever a navigation is triggered. - */ + */ Router.beforeEach((to, from, next) => { if (this.warnLeaving && !to.params?.skipLeaveWarning) { OC.dialogs.confirmDestructive( @@ -403,6 +407,7 @@ export default { /** * Set the page title to the conversation name + * * @param {string} title Prefix for the page title e.g. conversation name * @param {boolean} showAsterix Prefix for the page title e.g. conversation name */ @@ -438,8 +443,9 @@ export default { /** * Get a conversation's name. + * * @param {string} token The conversation's token - * @returns {string} The conversation's name + * @return {string} The conversation's name */ getConversationName(token) { if (!this.$store.getters.conversation(token)) { @@ -462,7 +468,7 @@ export default { * Emits a global event that is used in App.vue to update the page title once the * ( if the current route is a conversation and once the conversations are received) */ - EventBus.$emit('conversationsReceived', { + EventBus.$emit('conversations-received', { singleConversation: true, }) } catch (exception) { diff --git a/src/FilesSidebarCallViewApp.vue b/src/FilesSidebarCallViewApp.vue index a2972cb5d48..7cae59b7e12 100644 --- a/src/FilesSidebarCallViewApp.vue +++ b/src/FilesSidebarCallViewApp.vue @@ -90,7 +90,7 @@ export default { * Note that false is returned too when the sidebar is closed, even if * the conversation is active in the current file. * - * @returns {Boolean} true if the sidebar is opened in the file, false + * @return {boolean} true if the sidebar is opened in the file, false * otherwise. */ isInFile() { @@ -130,7 +130,7 @@ export default { * when the FileInfo has been set and it does not match the current * conversation. * - * @param {Object} fileInfo the watched FileInfo + * @param {object} fileInfo the watched FileInfo */ fileInfo(fileInfo) { if (!fileInfo) { diff --git a/src/FilesSidebarTabApp.vue b/src/FilesSidebarTabApp.vue index 47c958e1f40..77ab24996f4 100644 --- a/src/FilesSidebarTabApp.vue +++ b/src/FilesSidebarTabApp.vue @@ -200,10 +200,10 @@ export default { // "inCall" flag (which is locally updated when joining and leaving // a call) is currently used. if (loadState('spreed', 'signaling_mode') !== 'internal') { - EventBus.$on('shouldRefreshConversations', OCA.Talk.fetchCurrentConversationWrapper) - EventBus.$on('Signaling::participantListChanged', OCA.Talk.fetchCurrentConversationWrapper) + EventBus.$on('should-refresh-conversations', OCA.Talk.fetchCurrentConversationWrapper) + EventBus.$on('signaling-participant-list-changed', OCA.Talk.fetchCurrentConversationWrapper) } else { - // The "shouldRefreshConversations" event is triggered only when + // The "should-refresh-conversations" event is triggered only when // the external signaling server is used; when the internal // signaling server is used periodic polling has to be used // instead. @@ -212,8 +212,8 @@ export default { }, leaveConversation() { - EventBus.$off('shouldRefreshConversations', OCA.Talk.fetchCurrentConversationWrapper) - EventBus.$off('Signaling::participantListChanged', OCA.Talk.fetchCurrentConversationWrapper) + EventBus.$off('should-refresh-conversations', OCA.Talk.fetchCurrentConversationWrapper) + EventBus.$off('signaling-participant-list-changed', OCA.Talk.fetchCurrentConversationWrapper) window.clearInterval(OCA.Talk.fetchCurrentConversationIntervalId) // TODO: move to store under a special action ? diff --git a/src/PublicShareAuthSidebar.vue b/src/PublicShareAuthSidebar.vue index 1db9a79f6aa..4a06205f3ea 100644 --- a/src/PublicShareAuthSidebar.vue +++ b/src/PublicShareAuthSidebar.vue @@ -137,10 +137,10 @@ export default { // "inCall" flag (which is locally updated when joining and leaving // a call) is currently used. if (loadState('spreed', 'signaling_mode') !== 'internal') { - EventBus.$on('shouldRefreshConversations', this.fetchCurrentConversation) - EventBus.$on('Signaling::participantListChanged', this.fetchCurrentConversation) + EventBus.$on('should-refresh-conversations', this.fetchCurrentConversation) + EventBus.$on('signaling-participant-list-changed', this.fetchCurrentConversation) } else { - // The "shouldRefreshConversations" event is triggered only when + // The "should-refresh-conversations" event is triggered only when // the external signaling server is used; when the internal // signaling server is used periodic polling has to be used // instead. diff --git a/src/PublicShareSidebar.vue b/src/PublicShareSidebar.vue index 490e9a0833e..4d0e0e0cc3e 100644 --- a/src/PublicShareSidebar.vue +++ b/src/PublicShareSidebar.vue @@ -155,10 +155,10 @@ export default { // "inCall" flag (which is locally updated when joining and leaving // a call) is currently used. if (loadState('spreed', 'signaling_mode') !== 'internal') { - EventBus.$on('shouldRefreshConversations', this.fetchCurrentConversation) - EventBus.$on('Signaling::participantListChanged', this.fetchCurrentConversation) + EventBus.$on('should-refresh-conversations', this.fetchCurrentConversation) + EventBus.$on('signaling-participant-list-changed', this.fetchCurrentConversation) } else { - // The "shouldRefreshConversations" event is triggered only when + // The "should-refresh-conversations" event is triggered only when // the external signaling server is used; when the internal // signaling server is used periodic polling has to be used // instead. diff --git a/src/collections.js b/src/collections.js index 77839fcfdf4..a07561a48d9 100644 --- a/src/collections.js +++ b/src/collections.js @@ -3,7 +3,7 @@ * * @author Julius Härtl * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/components/AdminSettings/SignalingServer.vue b/src/components/AdminSettings/SignalingServer.vue index 46f5f607b8e..0e30a303d9e 100644 --- a/src/components/AdminSettings/SignalingServer.vue +++ b/src/components/AdminSettings/SignalingServer.vue @@ -118,7 +118,7 @@ export default { methods: { removeServer() { - this.$emit('removeServer', this.index) + this.$emit('remove-server', this.index) }, updateServer(event) { this.$emit('update:server', event.target.value) diff --git a/src/components/AdminSettings/SignalingServers.vue b/src/components/AdminSettings/SignalingServers.vue index 6a3d0acd0df..0105341ea63 100644 --- a/src/components/AdminSettings/SignalingServers.vue +++ b/src/components/AdminSettings/SignalingServers.vue @@ -65,7 +65,7 @@ :verify.sync="servers[index].verify" :index="index" :loading="loading" - @removeServer="removeServer" + @remove-server="removeServer" @update:server="debounceUpdateServers" @update:verify="debounceUpdateServers" /> diff --git a/src/components/AdminSettings/StunServer.vue b/src/components/AdminSettings/StunServer.vue index e302504fc8d..51867a57fc9 100644 --- a/src/components/AdminSettings/StunServer.vue +++ b/src/components/AdminSettings/StunServer.vue @@ -88,7 +88,7 @@ export default { methods: { removeServer() { - this.$emit('removeServer', this.index) + this.$emit('remove-server', this.index) }, update(event) { this.$emit('update:server', event.target.value) diff --git a/src/components/AdminSettings/StunServers.vue b/src/components/AdminSettings/StunServers.vue index 186d9f577a4..31d2106a168 100644 --- a/src/components/AdminSettings/StunServers.vue +++ b/src/components/AdminSettings/StunServers.vue @@ -46,7 +46,7 @@ :server.sync="servers[index]" :index="index" :loading="loading" - @removeServer="removeServer" + @remove-server="removeServer" @update:server="debounceUpdateServers" /> diff --git a/src/components/AdminSettings/TurnServer.vue b/src/components/AdminSettings/TurnServer.vue index 09ffd99ebc7..2b7cfb9ef0a 100644 --- a/src/components/AdminSettings/TurnServer.vue +++ b/src/components/AdminSettings/TurnServer.vue @@ -300,7 +300,7 @@ export default { }, removeServer() { - this.$emit('removeServer', this.index) + this.$emit('remove-server', this.index) }, updateSchemes(event) { this.$emit('update:schemes', event.target.value) diff --git a/src/components/AdminSettings/TurnServers.vue b/src/components/AdminSettings/TurnServers.vue index 4074ad51088..2dc9c6c66a4 100644 --- a/src/components/AdminSettings/TurnServers.vue +++ b/src/components/AdminSettings/TurnServers.vue @@ -47,7 +47,7 @@ :protocols.sync="servers[index].protocols" :index="index" :loading="loading" - @removeServer="removeServer" + @remove-server="removeServer" @update:schemes="debounceUpdateServers" @update:server="debounceUpdateServers" @update:secret="debounceUpdateServers" diff --git a/src/components/CallView/CallView.vue b/src/components/CallView/CallView.vue index 9606f814cea..423eb4ec2b3 100644 --- a/src/components/CallView/CallView.vue +++ b/src/components/CallView/CallView.vue @@ -398,14 +398,14 @@ export default { this.updateDataFromCallParticipantModels(this.callParticipantModels) }, mounted() { - EventBus.$on('refreshPeerList', this.debounceFetchPeers) + EventBus.$on('refresh-peer-list', this.debounceFetchPeers) callParticipantCollection.on('remove', this._lowerHandWhenParticipantLeaves) subscribe('talk:video:toggled', this.handleToggleVideo) }, beforeDestroy() { - EventBus.$off('refreshPeerList', this.debounceFetchPeers) + EventBus.$off('refresh-peer-list', this.debounceFetchPeers) callParticipantCollection.off('remove', this._lowerHandWhenParticipantLeaves) diff --git a/src/components/CallView/shared/Video.vue b/src/components/CallView/shared/Video.vue index 94b8f9710d7..13ae60444c5 100644 --- a/src/components/CallView/shared/Video.vue +++ b/src/components/CallView/shared/Video.vue @@ -226,7 +226,7 @@ export default { peerData() { let peerData = this.$store.getters.getPeer(this.$store.getters.getToken(), this.peerId) if (!peerData.actorId) { - EventBus.$emit('refreshPeerList') + EventBus.$emit('refresh-peer-list') peerData = { actorType: '', actorId: '', diff --git a/src/components/CallView/shared/VideoBackground.vue b/src/components/CallView/shared/VideoBackground.vue index 4be58f58d0c..9667e35a723 100644 --- a/src/components/CallView/shared/VideoBackground.vue +++ b/src/components/CallView/shared/VideoBackground.vue @@ -40,6 +40,9 @@ import { getBuilder } from '@nextcloud/browser-storage' const browserStorage = getBuilder('nextcloud').persist().build() // note: this info is shared with the Avatar component +/** + * @param userId + */ function getUserHasAvatar(userId) { const flag = browserStorage.getItem('user-has-avatar.' + userId) if (typeof flag === 'string') { @@ -48,6 +51,10 @@ function getUserHasAvatar(userId) { return null } +/** + * @param userId + * @param flag + */ function setUserHasAvatar(userId, flag) { browserStorage.setItem('user-has-avatar.' + userId, flag) } diff --git a/src/components/ChatView.vue b/src/components/ChatView.vue index 08fc75886fa..fc5e1661029 100644 --- a/src/components/ChatView.vue +++ b/src/components/ChatView.vue @@ -48,7 +48,7 @@ :is-chat-scrolled-to-bottom="isChatScrolledToBottom" :token="token" :is-visible="isVisible" - @setChatScrolledToBottom="setScrollStatus" /> + @set-chat-scrolled-to-bottom="setScrollStatus" /> diff --git a/src/components/ConversationSettings/NotificationsSettings.vue b/src/components/ConversationSettings/NotificationsSettings.vue index 52cd072787e..2accbbeffe1 100644 --- a/src/components/ConversationSettings/NotificationsSettings.vue +++ b/src/components/ConversationSettings/NotificationsSettings.vue @@ -133,6 +133,7 @@ export default { methods: { /** * Set the notification level for the conversation + * * @param {int} notificationLevel The notification level to set. */ async setNotificationLevel(notificationLevel) { diff --git a/src/components/Description/Description.vue b/src/components/Description/Description.vue index 1d709c6b2ff..3b7021b8a83 100644 --- a/src/components/Description/Description.vue +++ b/src/components/Description/Description.vue @@ -219,7 +219,7 @@ export default { // Remove leading/trailing whitespaces. this.descriptionText = this.descriptionText.replace(/\r\n|\n|\r/gm, '\n').trim() // Submit description - this.$emit('submit:description', this.descriptionText) + this.$emit('submit-description', this.descriptionText) /** * Change the richcontenteditable key in order to trigger a re-render * without this all the trimmed new lines and whitespaces would diff --git a/src/components/LeftSidebar/ConversationsList/Conversation.spec.js b/src/components/LeftSidebar/ConversationsList/Conversation.spec.js index 9a6b410901c..7c52ed820ca 100644 --- a/src/components/LeftSidebar/ConversationsList/Conversation.spec.js +++ b/src/components/LeftSidebar/ConversationsList/Conversation.spec.js @@ -96,6 +96,11 @@ describe('Conversation.vue', () => { }) describe('displayed subtitle', () => { + /** + * @param item + * @param expectedText + * @param isSearchResult + */ function testConversationLabel(item, expectedText, isSearchResult = false) { const wrapper = mount(Conversation, { localVue, @@ -268,6 +273,11 @@ describe('Conversation.vue', () => { }) describe('unread messages counter', () => { + /** + * @param item + * @param expectedCounterText + * @param expectedHighlighted + */ function testCounter(item, expectedCounterText, expectedHighlighted) { const wrapper = mount(Conversation, { localVue, @@ -331,6 +341,10 @@ describe('Conversation.vue', () => { $router = { push: jest.fn() } }) + /** + * @param wrapper + * @param text + */ function findActionButton(wrapper, text) { const actionButtons = wrapper.findAllComponents(ActionButton) const items = actionButtons.filter(actionButton => { @@ -342,6 +356,9 @@ describe('Conversation.vue', () => { return items.at(0) } + /** + * @param actionName + */ function shallowMountAndGetAction(actionName) { const wrapper = shallowMount(Conversation, { localVue, @@ -364,7 +381,7 @@ describe('Conversation.vue', () => { return findActionButton(el, actionName) } - test('forwards click event on list item', async() => { + test('forwards click event on list item', async () => { const wrapper = mount(Conversation, { localVue, store, @@ -386,6 +403,10 @@ describe('Conversation.vue', () => { }) describe('notification level', () => { + /** + * @param actionName + * @param level + */ async function testSetNotificationLevel(actionName, level) { const setNotificationLevelAction = jest.fn().mockResolvedValueOnce() testStoreConfig.modules.conversationsStore.actions.setNotificationLevel = setNotificationLevelAction @@ -398,21 +419,21 @@ describe('Conversation.vue', () => { expect(setNotificationLevelAction).toHaveBeenCalledWith(expect.anything(), { token: TOKEN, notificationLevel: level }) } - test('sets notification to all messages', async() => { + test('sets notification to all messages', async () => { await testSetNotificationLevel('All messages', 1) }) - test('sets notification to at-mentions only', async() => { + test('sets notification to at-mentions only', async () => { await testSetNotificationLevel('@-mentions only', 2) }) - test('sets notification to off', async() => { + test('sets notification to off', async () => { await testSetNotificationLevel('Off', 3) }) }) describe('leaving conversation', () => { - test('leaves conversation', async() => { + test('leaves conversation', async () => { const actionHandler = jest.fn() testStoreConfig.modules.participantsStore.actions.removeCurrentUserFromConversation = actionHandler @@ -424,14 +445,14 @@ describe('Conversation.vue', () => { expect(actionHandler).toHaveBeenCalledWith(expect.anything(), { token: TOKEN }) }) - test('hides "leave conversation" action when not allowed', async() => { + test('hides "leave conversation" action when not allowed', async () => { item.canLeaveConversation = false const action = shallowMountAndGetAction('Leave conversation') expect(action.exists()).toBe(false) }) - test('errors with notification when a new moderator is required before leaving', async() => { + test('errors with notification when a new moderator is required before leaving', async () => { const actionHandler = jest.fn().mockRejectedValueOnce({ response: { status: 400, @@ -450,7 +471,7 @@ describe('Conversation.vue', () => { }) describe('deleting conversation', () => { - test('deletes conversation when confirmed', async() => { + test('deletes conversation when confirmed', async () => { const actionHandler = jest.fn().mockResolvedValueOnce() const updateTokenAction = jest.fn() testStoreConfig.modules.conversationsStore.actions.deleteConversationFromServer = actionHandler @@ -474,7 +495,7 @@ describe('Conversation.vue', () => { expect(updateTokenAction).not.toHaveBeenCalled() }) - test('does not delete conversation when not confirmed', async() => { + test('does not delete conversation when not confirmed', async () => { const actionHandler = jest.fn().mockResolvedValueOnce() const updateTokenAction = jest.fn() testStoreConfig.modules.conversationsStore.actions.deleteConversationFromServer = actionHandler @@ -498,7 +519,7 @@ describe('Conversation.vue', () => { expect(updateTokenAction).not.toHaveBeenCalled() }) - test('hides "delete conversation" action when not allowed', async() => { + test('hides "delete conversation" action when not allowed', async () => { item.canDeleteConversation = false const action = shallowMountAndGetAction('Delete conversation') @@ -506,7 +527,7 @@ describe('Conversation.vue', () => { }) }) - test('copies link conversation', async() => { + test('copies link conversation', async () => { const copyTextMock = jest.fn().mockResolvedValueOnce() const wrapper = shallowMount(Conversation, { localVue, @@ -536,7 +557,7 @@ describe('Conversation.vue', () => { expect(copyTextMock).toHaveBeenCalledWith('http://localhost/nc-webroot/call/XXTOKENXX') expect(showSuccess).toHaveBeenCalled() }) - test('sets favorite', async() => { + test('sets favorite', async () => { const toggleFavoriteAction = jest.fn().mockResolvedValueOnce() testStoreConfig.modules.conversationsStore.actions.toggleFavorite = toggleFavoriteAction @@ -565,7 +586,7 @@ describe('Conversation.vue', () => { expect(toggleFavoriteAction).toHaveBeenCalledWith(expect.anything(), item) }) - test('unsets favorite', async() => { + test('unsets favorite', async () => { const toggleFavoriteAction = jest.fn().mockResolvedValueOnce() testStoreConfig.modules.conversationsStore.actions.toggleFavorite = toggleFavoriteAction @@ -595,7 +616,7 @@ describe('Conversation.vue', () => { expect(toggleFavoriteAction).toHaveBeenCalledWith(expect.anything(), item) }) - test('marks conversation as read', async() => { + test('marks conversation as read', async () => { const clearLastReadMessageAction = jest.fn().mockResolvedValueOnce() testStoreConfig.modules.conversationsStore.actions.clearLastReadMessage = clearLastReadMessageAction diff --git a/src/components/LeftSidebar/ConversationsList/Conversation.vue b/src/components/LeftSidebar/ConversationsList/Conversation.vue index 4f4e792766d..a26177fb114 100644 --- a/src/components/LeftSidebar/ConversationsList/Conversation.vue +++ b/src/components/LeftSidebar/ConversationsList/Conversation.vue @@ -281,7 +281,8 @@ export default { * This is a simplified version of the last chat message. * Parameters are parsed without markup (just replaced with the name), * e.g. no avatars on mentions. - * @returns {string} A simple message to show below the conversation name + * + * @return {string} A simple message to show below the conversation name */ simpleLastChatMessage() { if (!Object.keys(this.lastChatMessage).length) { @@ -300,7 +301,7 @@ export default { }, /** - * @returns {string} Part of the name until the first space + * @return {string} Part of the name until the first space */ shortLastChatMessageAuthor() { if (!Object.keys(this.lastChatMessage).length @@ -390,6 +391,7 @@ export default { /** * Set the notification level for the conversation + * * @param {int} level The notification level to set. */ async setNotificationLevel(level) { diff --git a/src/components/LeftSidebar/ConversationsList/ConversationsList.vue b/src/components/LeftSidebar/ConversationsList/ConversationsList.vue index 1ad5fb000bb..1a60148d618 100644 --- a/src/components/LeftSidebar/ConversationsList/ConversationsList.vue +++ b/src/components/LeftSidebar/ConversationsList/ConversationsList.vue @@ -73,14 +73,14 @@ export default { }, mounted() { - EventBus.$on('routeChange', this.onRouteChange) - EventBus.$once('joinedConversation', ({ token }) => { + EventBus.$on('route-change', this.onRouteChange) + EventBus.$once('joined-conversation', ({ token }) => { this.scrollToConversation(token) }) }, beforeDestroy() { - EventBus.$off('routeChange', this.onRouteChange) + EventBus.$off('route-change', this.onRouteChange) }, methods: { diff --git a/src/components/LeftSidebar/LeftSidebar.spec.js b/src/components/LeftSidebar/LeftSidebar.spec.js index 99ff951273e..c9123c72f2e 100644 --- a/src/components/LeftSidebar/LeftSidebar.spec.js +++ b/src/components/LeftSidebar/LeftSidebar.spec.js @@ -35,6 +35,9 @@ describe('LeftSidebar.vue', () => { let addConversationAction let createOneToOneConversationAction + /** + * + */ function mountComponent() { return mount(LeftSidebar, { localVue, @@ -117,9 +120,9 @@ describe('LeftSidebar.vue', () => { conversationsListMock.mockImplementation(() => cloneDeep(conversationsList)) }) - test('fetches and renders conversation list initially', async() => { + test('fetches and renders conversation list initially', async () => { const conversationsReceivedEvent = jest.fn() - EventBus.$once('conversationsReceived', conversationsReceivedEvent) + EventBus.$once('conversations-received', conversationsReceivedEvent) fetchConversationsAction.mockResolvedValueOnce() const wrapper = mountComponent() @@ -152,7 +155,7 @@ describe('LeftSidebar.vue', () => { }) }) - test('re-fetches conversations every 30 seconds', async() => { + test('re-fetches conversations every 30 seconds', async () => { const wrapper = mountComponent() expect(fetchConversationsAction).toHaveBeenCalled() @@ -174,7 +177,7 @@ describe('LeftSidebar.vue', () => { expect(fetchConversationsAction).toHaveBeenCalled() }) - test('re-fetches conversations when receiving bus event', async() => { + test('re-fetches conversations when receiving bus event', async () => { const wrapper = mountComponent() expect(fetchConversationsAction).toHaveBeenCalled() @@ -187,7 +190,7 @@ describe('LeftSidebar.vue', () => { expect(fetchConversationsAction).not.toHaveBeenCalled() - EventBus.$emit('shouldRefreshConversations') + EventBus.$emit('should-refresh-conversations') // note: debounce was short-circuited so no delay needed expect(fetchConversationsAction).toHaveBeenCalled() @@ -275,6 +278,12 @@ describe('LeftSidebar.vue', () => { fetchConversationsAction.mockResolvedValue() }) + /** + * @param searchTerm + * @param possibleResults + * @param listedResults + * @param loadStateSettingsOverride + */ async function testSearch(searchTerm, possibleResults, listedResults, loadStateSettingsOverride) { searchPossibleConversations.mockResolvedValueOnce({ data: { @@ -318,7 +327,7 @@ describe('LeftSidebar.vue', () => { } describe('displaying search results', () => { - test('displays search results when search is active', async() => { + test('displays search results when search is active', async () => { const wrapper = await testSearch( 'search', [...usersResults, ...groupsResults, ...circlesResults], @@ -364,7 +373,7 @@ describe('LeftSidebar.vue', () => { expect(optionsEls.at(1).props('items')).toStrictEqual([groupsResults[0], groupsResults[1]]) expect(optionsEls.at(2).props('items')).toStrictEqual([circlesResults[0], circlesResults[1]]) }) - test('only shows user search results when cannot create conversations', async() => { + test('only shows user search results when cannot create conversations', async () => { const wrapper = await testSearch( 'search', [...usersResults, ...groupsResults, ...circlesResults], @@ -406,7 +415,7 @@ describe('LeftSidebar.vue', () => { expect(optionsEls.at(0).props('items')).toStrictEqual([usersResults[1], usersResults[2]]) expect(optionsEls.length).toBe(1) }) - test('does not show circles results when circles are disabled', async() => { + test('does not show circles results when circles are disabled', async () => { const wrapper = await testSearch( 'search', [...usersResults, ...groupsResults], @@ -453,6 +462,13 @@ describe('LeftSidebar.vue', () => { }) describe('not found caption', () => { + /** + * @param searchTerm + * @param possibleResults + * @param listedResults + * @param loadStateSettingsOverride + * @param expectedCaption + */ async function testSearchNotFound(searchTerm, possibleResults, listedResults, loadStateSettingsOverride, expectedCaption) { const wrapper = await testSearch(searchTerm, possibleResults, listedResults, loadStateSettingsOverride) @@ -482,7 +498,7 @@ describe('LeftSidebar.vue', () => { return wrapper } - test('displays all types in caption when nothing was found', async() => { + test('displays all types in caption when nothing was found', async () => { await testSearchNotFound( 'search', [], @@ -495,7 +511,7 @@ describe('LeftSidebar.vue', () => { ) }) - test('displays all types in caption when only listed conversations were found', async() => { + test('displays all types in caption when only listed conversations were found', async () => { await testSearchNotFound( 'search', [], @@ -508,7 +524,7 @@ describe('LeftSidebar.vue', () => { ) }) - test('displays all types minus circles when nothing was found but circles is disabled', async() => { + test('displays all types minus circles when nothing was found but circles is disabled', async () => { await testSearchNotFound( 'search', [], @@ -521,7 +537,7 @@ describe('LeftSidebar.vue', () => { ) }) - test('displays caption for users and groups not found', async() => { + test('displays caption for users and groups not found', async () => { await testSearchNotFound( 'search', [...circlesResults], @@ -533,7 +549,7 @@ describe('LeftSidebar.vue', () => { 'Users and groups' ) }) - test('displays caption for users not found', async() => { + test('displays caption for users not found', async () => { await testSearchNotFound( 'search', [...circlesResults, ...groupsResults], @@ -545,7 +561,7 @@ describe('LeftSidebar.vue', () => { 'Users' ) }) - test('displays caption for groups not found', async() => { + test('displays caption for groups not found', async () => { await testSearchNotFound( 'search', [...usersResults, ...circlesResults], @@ -557,7 +573,7 @@ describe('LeftSidebar.vue', () => { 'Groups' ) }) - test('displays caption for groups and circles not found', async() => { + test('displays caption for groups and circles not found', async () => { await testSearchNotFound( 'search', [...usersResults], @@ -569,7 +585,7 @@ describe('LeftSidebar.vue', () => { 'Groups and circles' ) }) - test('displays caption for users and circles not found', async() => { + test('displays caption for users and circles not found', async () => { await testSearchNotFound( 'search', [...groupsResults], @@ -584,7 +600,7 @@ describe('LeftSidebar.vue', () => { }) describe('clicking search results', () => { - test('joins listed conversation from search result', async() => { + test('joins listed conversation from search result', async () => { const wrapper = await testSearch('search', [], listedResults) const appNavEl = wrapper.findComponent({ name: 'AppNavigation' }) @@ -597,7 +613,7 @@ describe('LeftSidebar.vue', () => { expect(wrapper.vm.$route.name).toBe('conversation') expect(wrapper.vm.$route.params).toStrictEqual({ token: 'listed-token-2' }) }) - test('creates one to one conversation from user search result', async() => { + test('creates one to one conversation from user search result', async () => { createOneToOneConversationAction.mockResolvedValue({ id: 9999, token: 'new-conversation', @@ -614,9 +630,9 @@ describe('LeftSidebar.vue', () => { expect(wrapper.vm.$route.name).toBe('conversation') expect(wrapper.vm.$route.params).toStrictEqual({ token: 'new-conversation' }) }) - test('shows group conversation dialog when clicking search result', async() => { + test('shows group conversation dialog when clicking search result', async () => { const eventHandler = jest.fn() - EventBus.$once('NewGroupConversationDialog', eventHandler) + EventBus.$once('new-group-conversation-dialog', eventHandler) const wrapper = await testSearch('search', [...groupsResults], []) @@ -631,9 +647,9 @@ describe('LeftSidebar.vue', () => { expect(createOneToOneConversationAction).not.toHaveBeenCalled() expect(addConversationAction).not.toHaveBeenCalled() }) - test('shows circles conversation dialog when clicking search result', async() => { + test('shows circles conversation dialog when clicking search result', async () => { const eventHandler = jest.fn() - EventBus.$once('NewGroupConversationDialog', eventHandler) + EventBus.$once('new-group-conversation-dialog', eventHandler) const wrapper = await testSearch('search', [...circlesResults], []) @@ -647,7 +663,7 @@ describe('LeftSidebar.vue', () => { // nothing created yet expect(createOneToOneConversationAction).not.toHaveBeenCalled() }) - test('clears search results when joining user chat', async() => { + test('clears search results when joining user chat', async () => { createOneToOneConversationAction.mockResolvedValue({ id: 9999, token: 'new-conversation', @@ -669,7 +685,7 @@ describe('LeftSidebar.vue', () => { expect(searchBoxEl.exists()).toBe(true) expect(input.element.value).toBe('') }) - test('does not clear search results when clicking group chat', async() => { + test('does not clear search results when clicking group chat', async () => { const wrapper = await testSearch('search', [...groupsResults], []) const appNavEl = wrapper.findComponent({ name: 'AppNavigation' }) @@ -710,7 +726,7 @@ describe('LeftSidebar.vue', () => { }) }) - test('shows settings when clicking the settings button', async() => { + test('shows settings when clicking the settings button', async () => { conversationsListMock.mockImplementation(() => []) const eventHandler = jest.fn() subscribe('show-settings', eventHandler) diff --git a/src/components/LeftSidebar/LeftSidebar.vue b/src/components/LeftSidebar/LeftSidebar.vue index 69131e761f4..fc12b24fcd2 100644 --- a/src/components/LeftSidebar/LeftSidebar.vue +++ b/src/components/LeftSidebar/LeftSidebar.vue @@ -259,13 +259,13 @@ export default { } }, 30000) - EventBus.$on('shouldRefreshConversations', this.debounceFetchConversations) + EventBus.$on('should-refresh-conversations', this.debounceFetchConversations) this.mountArrowNavigation() }, beforeDestroy() { - EventBus.$off('shouldRefreshConversations', this.debounceFetchConversations) + EventBus.$off('should-refresh-conversations', this.debounceFetchConversations) this.cancelSearchPossibleConversations() this.cancelSearchPossibleConversations = null @@ -358,7 +358,7 @@ export default { * Create a new conversation with the selected user * or bring up the dialog to create a new group/circle conversation * - * @param {Object} item The autocomplete suggestion to start a conversation with + * @param {object} item The autocomplete suggestion to start a conversation with * @param {string} item.id The ID of the target * @param {string} item.label The displayname of the target * @param {string} item.source The source of the target (e.g. users, groups, circle) @@ -368,19 +368,19 @@ export default { // Create one-to-one conversation directly const conversation = await this.$store.dispatch('createOneToOneConversation', item.id) this.abortSearch() - EventBus.$once('joinedConversation', ({ token }) => { + EventBus.$once('joined-conversation', ({ token }) => { this.$refs.conversationsList.scrollToConversation(token) }) this.$router.push({ name: 'conversation', params: { token: conversation.token } }).catch(err => console.debug(`Error while pushing the new conversation's route: ${err}`)) } else { // For other types we start the conversation creation dialog - EventBus.$emit('NewGroupConversationDialog', item) + EventBus.$emit('new-group-conversation-dialog', item) } }, async joinListedConversation(conversation) { this.abortSearch() - EventBus.$once('joinedConversation', ({ token }) => { + EventBus.$once('joined-conversation', ({ token }) => { this.$refs.conversationsList.scrollToConversation(token) }) // add as temporary item that will refresh after the joining process is complete @@ -410,7 +410,7 @@ export default { handleClickSearchResult(selectedConversationToken) { if (this.searchText !== '') { - EventBus.$once('joinedConversation', ({ token }) => { + EventBus.$once('joined-conversation', ({ token }) => { this.$refs.conversationsList.scrollToConversation(token) }) } @@ -446,7 +446,7 @@ export default { * Emits a global event that is used in App.vue to update the page title once the * ( if the current route is a conversation and once the conversations are received) */ - EventBus.$emit('conversationsReceived', { + EventBus.$emit('conversations-received', { singleConversation: false, }) this.isFetchingConversations = false diff --git a/src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue b/src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue index df32e225c8b..dea7bd78def 100644 --- a/src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue +++ b/src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue @@ -48,7 +48,7 @@ v-if="page === 0"> + @click-enter="handleEnter" /> @@ -205,11 +205,11 @@ export default { }, mounted() { - EventBus.$on('NewGroupConversationDialog', this.showModalForItem) + EventBus.$on('new-group-conversation-dialog', this.showModalForItem) }, destroyed() { - EventBus.$off('NewGroupConversationDialog', this.showModalForItem) + EventBus.$off('new-group-conversation-dialog', this.showModalForItem) }, methods: { @@ -226,9 +226,11 @@ export default { this.showModal() }, - /** Reinitialise the component to it's initial state. This is necessary + /** + * Reinitialise the component to it's initial state. This is necessary * because once the component is mounted it's data would persist even if - * the modal closes */ + * the modal closes + */ closeModal() { this.modal = false this.page = 0 @@ -251,8 +253,10 @@ export default { handleClickBack() { this.page = 0 }, - /** Handles the creation of the group conversation, adds the seleced - * participants to it and routes to it */ + /** + * Handles the creation of the group conversation, adds the seleced + * participants to it and routes to it + */ async handleCreateConversation() { this.page = 2 @@ -320,16 +324,20 @@ export default { this.closeModal() } }, - /** Creates a new private conversation, adds it to the store and sets - * the local token value to the newly created conversation's token */ + /** + * Creates a new private conversation, adds it to the store and sets + * the local token value to the newly created conversation's token + */ async createPrivateConversation() { const response = await createPrivateConversation(this.conversationName) const conversation = response.data.ocs.data this.$store.dispatch('addConversation', conversation) this.token = conversation.token }, - /** Creates a new public conversation, adds it to the store and sets - * the local token value to the newly created conversation's token */ + /** + * Creates a new public conversation, adds it to the store and sets + * the local token value to the newly created conversation's token + */ async createPublicConversation() { const response = await createPublicConversation(this.conversationName) const conversation = response.data.ocs.data diff --git a/src/components/LeftSidebar/NewGroupConversation/SetContacts/SetContacts.vue b/src/components/LeftSidebar/NewGroupConversation/SetContacts/SetContacts.vue index dfd8f38be08..9b9e163efeb 100644 --- a/src/components/LeftSidebar/NewGroupConversation/SetContacts/SetContacts.vue +++ b/src/components/LeftSidebar/NewGroupConversation/SetContacts/SetContacts.vue @@ -49,7 +49,7 @@ :scrollable="true" :display-search-hint="displaySearchHint" :selectable="true" - @clickSearchHint="focusInput" /> + @click-search-hint="focusInput" /> @@ -97,8 +97,9 @@ export default { /** * Search hint at the bottom of the participants list, displayed only if * the user is not searching - * @returns {boolean} - **/ + * + * @return {boolean} + */ displaySearchHint() { return !this.contactsLoading && this.searchText === '' }, diff --git a/src/components/LeftSidebar/NewGroupConversation/SetConversationName/SetConversationName.vue b/src/components/LeftSidebar/NewGroupConversation/SetConversationName/SetConversationName.vue index cb2272b5f4b..e3108b1a258 100644 --- a/src/components/LeftSidebar/NewGroupConversation/SetConversationName/SetConversationName.vue +++ b/src/components/LeftSidebar/NewGroupConversation/SetConversationName/SetConversationName.vue @@ -56,7 +56,7 @@ export default { }, // Forward the keydown event to the parent handleKeydown() { - this.$emit('clickEnter') + this.$emit('click-enter') }, }, diff --git a/src/components/LeftSidebar/NewGroupConversation/SetConversationType/SetConversationType.vue b/src/components/LeftSidebar/NewGroupConversation/SetConversationType/SetConversationType.vue index 95315138331..efc8fcd8664 100644 --- a/src/components/LeftSidebar/NewGroupConversation/SetConversationType/SetConversationType.vue +++ b/src/components/LeftSidebar/NewGroupConversation/SetConversationType/SetConversationType.vue @@ -43,7 +43,9 @@ export default { }, }, methods: { - /** Emits the input event with the checked bulean as a value + /** + * Emits the input event with the checked bulean as a value + * * @param {object} event The checkbox click event object. */ handleInput(event) { diff --git a/src/components/LeftSidebar/SearchBox/SearchBox.vue b/src/components/LeftSidebar/SearchBox/SearchBox.vue index 50c2d10e18d..14e2d0aac47 100644 --- a/src/components/LeftSidebar/SearchBox/SearchBox.vue +++ b/src/components/LeftSidebar/SearchBox/SearchBox.vue @@ -85,10 +85,10 @@ export default { /** * Listen to routeChange global events and focus on the input */ - EventBus.$on('routeChange', this.focusInputIfRoot) + EventBus.$on('route-change', this.focusInputIfRoot) }, beforeDestroy() { - EventBus.$off('routeChange', this.focusInputIfRoot) + EventBus.$off('route-change', this.focusInputIfRoot) }, methods: { // Focus the input field of the searchbox component. diff --git a/src/components/MessagesList/MessagesGroup/Message/Message.spec.js b/src/components/MessagesList/MessagesGroup/Message/Message.spec.js index 0d85477593b..39c54f4f2c7 100644 --- a/src/components/MessagesList/MessagesGroup/Message/Message.spec.js +++ b/src/components/MessagesList/MessagesGroup/Message/Message.spec.js @@ -86,7 +86,7 @@ describe('Message.vue', () => { store = new Vuex.Store(testStoreConfig) }) - test('renders rich text message', async() => { + test('renders rich text message', async () => { const wrapper = shallowMount(Message, { localVue, store, @@ -97,7 +97,7 @@ describe('Message.vue', () => { expect(message.attributes('text')).toBe('test message') }) - test('renders emoji as single plain text', async() => { + test('renders emoji as single plain text', async () => { messageProps.isSingleEmoji = true messageProps.message = '🌧️' const wrapper = shallowMount(Message, { @@ -268,6 +268,11 @@ describe('Message.vue', () => { }) describe('rich objects', () => { + /** + * @param message + * @param messageParameters + * @param expectedRichParameters + */ function renderRichObject(message, messageParameters, expectedRichParameters) { messageProps.message = message messageProps.messageParameters = messageParameters @@ -480,7 +485,7 @@ describe('Message.vue', () => { store = new Vuex.Store(testStoreConfig) }) - test('renders author if first message', async() => { + test('renders author if first message', async () => { messageProps.isFirstMessage = true const wrapper = shallowMount(Message, { localVue, @@ -492,7 +497,7 @@ describe('Message.vue', () => { expect(displayName.text()).toBe('user-display-name-1') }) - test('does not render author if not first message', async() => { + test('does not render author if not first message', async () => { messageProps.isFirstMessage = false const wrapper = shallowMount(Message, { localVue, @@ -512,7 +517,7 @@ describe('Message.vue', () => { store = new Vuex.Store(testStoreConfig) }) - test('does not render actions for system messages are available', async() => { + test('does not render actions for system messages are available', async () => { messageProps.systemMessage = 'this is a system message' const wrapper = shallowMount(Message, { @@ -527,7 +532,7 @@ describe('Message.vue', () => { expect(actionsEl.exists()).toBe(false) }) - test('does not render actions for temporary messages', async() => { + test('does not render actions for temporary messages', async () => { messageProps.isTemporary = true const wrapper = shallowMount(Message, { @@ -542,7 +547,7 @@ describe('Message.vue', () => { expect(actionsEl.exists()).toBe(false) }) - test('actions become visible on mouse over', async() => { + test('actions become visible on mouse over', async () => { messageProps.sendingFailure = 'timeout' const wrapper = shallowMount(Message, { localVue, @@ -573,7 +578,7 @@ describe('Message.vue', () => { }) describe('reply action', () => { - test('replies to message', async() => { + test('replies to message', async () => { const replyAction = jest.fn() testStoreConfig.modules.quoteReplyStore.actions.addMessageToBeReplied = replyAction store = new Vuex.Store(testStoreConfig) @@ -607,7 +612,7 @@ describe('Message.vue', () => { }) }) - test('hides reply button when not replyable', async() => { + test('hides reply button when not replyable', async () => { messageProps.isReplyable = false store = new Vuex.Store(testStoreConfig) @@ -626,7 +631,7 @@ describe('Message.vue', () => { }) describe('private reply action', () => { - test('creates a new conversation when replying to message privately', async() => { + test('creates a new conversation when replying to message privately', async () => { const routerPushMock = jest.fn().mockResolvedValue() const createOneToOneConversation = jest.fn() testStoreConfig.modules.conversationsStore.actions.createOneToOneConversation = createOneToOneConversation @@ -667,6 +672,9 @@ describe('Message.vue', () => { }) }) + /** + * @param visible + */ function testPrivateReplyActionVisible(visible) { store = new Vuex.Store(testStoreConfig) @@ -683,25 +691,25 @@ describe('Message.vue', () => { expect(actionButton.exists()).toBe(visible) } - test('hides private reply action for own messages', async() => { + test('hides private reply action for own messages', async () => { // using default message props which have the // actor id set to the current user testPrivateReplyActionVisible(false) }) - test('hides private reply action for one to one conversation type', async() => { + test('hides private reply action for one to one conversation type', async () => { messageProps.actorId = 'another-user' conversationProps.type = CONVERSATION.TYPE.ONE_TO_ONE testPrivateReplyActionVisible(false) }) - test('hides private reply action for guest messages', async() => { + test('hides private reply action for guest messages', async () => { messageProps.actorId = 'guest-user' messageProps.actorType = ATTENDEE.ACTOR_TYPE.GUESTS testPrivateReplyActionVisible(false) }) - test('hides private reply action when current user is a guest', async() => { + test('hides private reply action when current user is a guest', async () => { messageProps.actorId = 'another-user' getActorTypeMock.mockClear().mockReturnValue(() => ATTENDEE.ACTOR_TYPE.GUESTS) testPrivateReplyActionVisible(false) @@ -709,7 +717,7 @@ describe('Message.vue', () => { }) describe('delete action', () => { - test('deletes message', async() => { + test('deletes message', async () => { let resolveDeleteMessage const deleteMessage = jest.fn().mockReturnValue(new Promise((resolve, reject) => { resolveDeleteMessage = resolve })) testStoreConfig.modules.messagesStore.actions.deleteMessage = deleteMessage @@ -755,6 +763,11 @@ describe('Message.vue', () => { expect(wrapper.find('.icon-loading-small').exists()).toBe(false) }) + /** + * @param visible + * @param mockDate + * @param participantType + */ function testDeleteMessageVisible(visible, mockDate, participantType = PARTICIPANT.TYPE.USER) { store = new Vuex.Store(testStoreConfig) @@ -836,7 +849,7 @@ describe('Message.vue', () => { }) }) - test('marks message as unread', async() => { + test('marks message as unread', async () => { const updateLastReadMessageAction = jest.fn().mockResolvedValueOnce() const fetchConversationAction = jest.fn().mockResolvedValueOnce() testStoreConfig.modules.conversationsStore.actions.updateLastReadMessage = updateLastReadMessageAction @@ -888,7 +901,7 @@ describe('Message.vue', () => { }) }) - test('copies message link', async() => { + test('copies message link', async () => { const copyTextMock = jest.fn() // appears even with more restrictive conditions @@ -926,7 +939,7 @@ describe('Message.vue', () => { expect(copyTextMock).toHaveBeenCalledWith('http://localhost/nc-webroot/call/XXTOKENXX#message_123') }) - test('renders clickable custom actions', async() => { + test('renders clickable custom actions', async () => { const handler = jest.fn() const handler2 = jest.fn() const actionsGetterMock = jest.fn().mockReturnValue([{ @@ -977,7 +990,7 @@ describe('Message.vue', () => { store = new Vuex.Store(testStoreConfig) }) - test('lets user retry sending a timed out message', async() => { + test('lets user retry sending a timed out message', async () => { messageProps.sendingFailure = 'timeout' const wrapper = shallowMount(Message, { localVue, @@ -998,7 +1011,7 @@ describe('Message.vue', () => { expect(reloadButtonIcon.exists()).toBe(true) const retryEvent = jest.fn() - EventBus.$on('retryMessage', retryEvent) + EventBus.$on('retry-message', retryEvent) await reloadButtonIcon.trigger('click') diff --git a/src/components/MessagesList/MessagesGroup/Message/Message.vue b/src/components/MessagesList/MessagesGroup/Message/Message.vue index dedf9cc6edf..e9e6196d819 100644 --- a/src/components/MessagesList/MessagesGroup/Message/Message.vue +++ b/src/components/MessagesList/MessagesGroup/Message/Message.vue @@ -665,7 +665,7 @@ export default { watch: { showJoinCallButton() { - EventBus.$emit('scrollChatToBottom') + EventBus.$emit('scroll-chat-to-bottom') }, }, @@ -705,8 +705,8 @@ export default { }, handleRetry() { if (this.sendingErrorCanRetry) { - EventBus.$emit('retryMessage', this.id) - EventBus.$emit('focusChatInput') + EventBus.$emit('retry-message', this.id) + EventBus.$emit('focus-chat-input') } }, handleReply() { @@ -722,7 +722,7 @@ export default { messageParameters: this.messageParameters, token: this.token, }) - EventBus.$emit('focusChatInput') + EventBus.$emit('focus-chat-input') }, async handleDelete() { this.isDeleting = true diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.spec.js b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.spec.js index b0bf9ba9987..cee2cb2ca04 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.spec.js +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.spec.js @@ -57,12 +57,15 @@ describe('FilePreview.vue', () => { window.devicePixelRatio = oldPixelRatio }) + /** + * @param url + */ function parseRelativeUrl(url) { return new URL('https://localhost' + url) } describe('file preview rendering', () => { - test('renders file preview', async() => { + test('renders file preview', async () => { const wrapper = shallowMount(FilePreview, { localVue, store, @@ -82,7 +85,7 @@ describe('FilePreview.vue', () => { expect(wrapper.find('.loading').exists()).toBe(false) }) - test('renders file preview for guests', async() => { + test('renders file preview for guests', async () => { propsData.link = 'https://localhost/nc-webroot/s/xtokenx' getUserIdMock.mockClear().mockReturnValue(null) @@ -105,7 +108,7 @@ describe('FilePreview.vue', () => { expect(wrapper.find('.loading').exists()).toBe(false) }) - test('calculates preview size based on window pixel ratio', async() => { + test('calculates preview size based on window pixel ratio', async () => { window.devicePixelRatio = 1.5 const wrapper = shallowMount(FilePreview, { @@ -121,7 +124,7 @@ describe('FilePreview.vue', () => { expect(imageUrl.searchParams.get('y')).toBe('576') }) - test('renders small previews when requested', async() => { + test('renders small previews when requested', async () => { propsData.smallPreview = true const wrapper = shallowMount(FilePreview, { @@ -146,7 +149,7 @@ describe('FilePreview.vue', () => { store = new Vuex.Store(testStoreConfig) }) - test('renders progress bar while uploading', async() => { + test('renders progress bar while uploading', async () => { propsData.id = 'temp-123' propsData.index = 'index-1' propsData.uploadId = 1000 @@ -185,7 +188,7 @@ describe('FilePreview.vue', () => { expect(wrapper.find('.loading').exists()).toBe(true) }) - test('renders default mime icon on load error', async() => { + test('renders default mime icon on load error', async () => { const wrapper = shallowMount(FilePreview, { localVue, store, @@ -199,7 +202,7 @@ describe('FilePreview.vue', () => { expect(imageUrl).toBe(imagePath('core', 'filetypes/file')) }) - test('renders generic mime type icon for unknown mime types', async() => { + test('renders generic mime type icon for unknown mime types', async () => { propsData.previewAvailable = 'no' OC.MimeType.getIconUrl.mockReturnValueOnce(imagePath('core', 'image/jpeg')) @@ -239,7 +242,7 @@ describe('FilePreview.vue', () => { return null }) }) - test('directly renders small GIF files', async() => { + test('directly renders small GIF files', async () => { propsData.size = 128 const wrapper = shallowMount(FilePreview, { @@ -255,7 +258,7 @@ describe('FilePreview.vue', () => { .toBe(generateRemoteUrl('dav/files/current-user-id') + '/path/to/test%20%2520.gif') }) - test('directly renders small GIF files (absolute path)', async() => { + test('directly renders small GIF files (absolute path)', async () => { propsData.size = 128 propsData.path = '/path/to/test %20.gif' @@ -272,7 +275,7 @@ describe('FilePreview.vue', () => { .toBe(generateRemoteUrl('dav/files/current-user-id') + '/path/to/test%20%2520.gif') }) - test('directly renders small GIF files for guests', async() => { + test('directly renders small GIF files for guests', async () => { propsData.size = 128 propsData.link = 'https://localhost/nc-webroot/s/xtokenx' getUserIdMock.mockClear().mockReturnValue(null) @@ -290,7 +293,7 @@ describe('FilePreview.vue', () => { .toBe(propsData.link + '/download/test%20%2520.gif') }) - test('renders static preview for big GIF files', async() => { + test('renders static preview for big GIF files', async () => { // bigger than max from capability propsData.size = 2048 @@ -345,7 +348,7 @@ describe('FilePreview.vue', () => { } }) - test('opens viewer when clicking if viewer available', async() => { + test('opens viewer when clicking if viewer available', async () => { OCA.Viewer = { open: jest.fn(), availableHandlers: [{ @@ -377,7 +380,7 @@ describe('FilePreview.vue', () => { expect(OCA.Files.Sidebar.state.file).toBe('/path/to/test.jpg') }) - test('does not open viewer when clicking if no mime handler available', async() => { + test('does not open viewer when clicking if no mime handler available', async () => { OCA.Viewer = { open: jest.fn(), availableHandlers: [{ @@ -398,7 +401,7 @@ describe('FilePreview.vue', () => { expect(OCA.Viewer.open).not.toHaveBeenCalled() }) - test('does not open viewer when clicking if viewer is not available', async() => { + test('does not open viewer when clicking if viewer is not available', async () => { delete OCA.Viewer const wrapper = shallowMount(FilePreview, { localVue, @@ -427,6 +430,9 @@ describe('FilePreview.vue', () => { } }) + /** + * @param visible + */ async function testPlayButtonVisible(visible) { const wrapper = shallowMount(FilePreview, { localVue, @@ -440,11 +446,11 @@ describe('FilePreview.vue', () => { expect(buttonEl.exists()).toBe(visible) } - test('renders play icon for video previews', async() => { + test('renders play icon for video previews', async () => { await testPlayButtonVisible(true) }) - test('does not render play icon for direct renders', async() => { + test('does not render play icon for direct renders', async () => { // gif is directly rendered propsData.mimetype = 'image/gif' propsData.name = 'test.gif' @@ -453,7 +459,7 @@ describe('FilePreview.vue', () => { await testPlayButtonVisible(false) }) - test('render play icon gif previews with big size', async() => { + test('render play icon gif previews with big size', async () => { // gif is directly rendered propsData.mimetype = 'image/gif' propsData.name = 'test.gif' @@ -463,12 +469,12 @@ describe('FilePreview.vue', () => { await testPlayButtonVisible(true) }) - test('does not render play icon for small previews', async() => { + test('does not render play icon for small previews', async () => { propsData.smallPreview = true await testPlayButtonVisible(false) }) - test('does not render play icon for failed videos', async() => { + test('does not render play icon for failed videos', async () => { const wrapper = shallowMount(FilePreview, { localVue, store, @@ -481,12 +487,12 @@ describe('FilePreview.vue', () => { expect(buttonEl.exists()).toBe(false) }) - test('does not render play icon if viewer not available', async() => { + test('does not render play icon if viewer not available', async () => { delete OCA.Viewer await testPlayButtonVisible(false) }) - test('does not render play icon for non-videos', async() => { + test('does not render play icon for non-videos', async () => { // viewer supported, but not a video propsData.mimetype = 'image/png' propsData.name = 'test.png' @@ -501,7 +507,7 @@ describe('FilePreview.vue', () => { beforeEach(() => { propsData.isUploadEditor = true }) - test('emits event when clicking remove button when inside upload editor', async() => { + test('emits event when clicking remove button when inside upload editor', async () => { const wrapper = shallowMount(FilePreview, { localVue, store, diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/Forwarder.vue b/src/components/MessagesList/MessagesGroup/Message/MessagePart/Forwarder.vue index ffd8daea6a3..e62a1539c92 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/Forwarder.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/Forwarder.vue @@ -103,7 +103,8 @@ export default { /** * Object containing all the mentions in the message that will be forwarded - * @returns {Object} mentions. + * + * @return {object} mentions. */ mentions() { const mentions = {} diff --git a/src/components/MessagesList/MessagesGroup/MessagesGroup.vue b/src/components/MessagesList/MessagesGroup/MessagesGroup.vue index 9c77b34e8c3..64492cdc826 100644 --- a/src/components/MessagesList/MessagesGroup/MessagesGroup.vue +++ b/src/components/MessagesList/MessagesGroup/MessagesGroup.vue @@ -112,28 +112,32 @@ export default { computed: { /** * The message actor type. - * @returns {string} + * + * @return {string} */ actorType() { return this.messages[0].actorType }, /** * The message actor id. - * @returns {string} + * + * @return {string} */ actorId() { return this.messages[0].actorId }, /** * The message date. - * @returns {string} + * + * @return {string} */ dateSeparator() { return this.messages[0].dateSeparator || '' }, /** * The message actor display name. - * @returns {string} + * + * @return {string} */ actorDisplayName() { const displayName = this.messages[0].actorDisplayName.trim() @@ -150,7 +154,8 @@ export default { }, /** * Whether the given message is a system message - * @returns {bool} + * + * @return {bool} */ isSystemMessage() { return this.messages[0].systemMessage.length !== 0 diff --git a/src/components/MessagesList/MessagesList.spec.js b/src/components/MessagesList/MessagesList.spec.js index d9f0f2fa5ef..22d6a3e53ee 100644 --- a/src/components/MessagesList/MessagesList.spec.js +++ b/src/components/MessagesList/MessagesList.spec.js @@ -286,6 +286,9 @@ describe('MessagesList.vue', () => { expect(messagesListMock).toHaveBeenCalledWith(TOKEN) }) + /** + * @param messages + */ function testNotGrouped(messages) { messagesListMock.mockReturnValue(messages) diff --git a/src/components/MessagesList/MessagesList.vue b/src/components/MessagesList/MessagesList.vue index cfafc4a07f9..229e7719b61 100644 --- a/src/components/MessagesList/MessagesList.vue +++ b/src/components/MessagesList/MessagesList.vue @@ -147,7 +147,7 @@ export default { /** * Finds the first visual unread message element * - * @returns {object} DOM element of the first unread message + * @return {object} DOM element of the first unread message */ unreadMessageElement() { let el = document.getElementById('message_' + this.visualLastReadMessageId) @@ -162,7 +162,7 @@ export default { * Gets the messages array. We need this because the DynamicScroller needs an array to * loop through. * - * @returns {array} + * @return {Array} */ messagesList() { return this.$store.getters.messagesList(this.token) @@ -172,7 +172,7 @@ export default { * corresponds to the id of the message, and makes it easy and efficient to access the * individual message object. * - * @returns {object} + * @return {object} */ messages() { // FIXME: remove if unused ? @@ -180,7 +180,8 @@ export default { }, /** * Creates an array of messages grouped in nested arrays by same autor. - * @returns {array} + * + * @return {Array} */ messagesGroupedByAuthor() { const groups = [] @@ -211,7 +212,8 @@ export default { * When isSticky is true, as new messages are appended to the list, the div .scroller * automatically scrolls down to the last message, if it's false, new messages are * appended but the scrolling position is not altered. - * @returns {boolean} + * + * @return {boolean} */ isSticky() { return this.isChatScrolledToBottom @@ -221,7 +223,7 @@ export default { * Returns whether the current participant is a participant of the * current conversation or not. * - * @returns {Boolean} true if it is already a participant, false + * @return {boolean} true if it is already a participant, false * otherwise. */ isParticipant() { @@ -273,10 +275,10 @@ export default { mounted() { this.viewId = uniqueId('messagesList') this.scrollToBottom() - EventBus.$on('scrollChatToBottom', this.handleScrollChatToBottomEvent) - EventBus.$on('smoothScrollChatToBottom', this.smoothScrollToBottom) - EventBus.$on('focusMessage', this.focusMessage) - EventBus.$on('routeChange', this.onRouteChange) + EventBus.$on('scroll-chat-to-bottom', this.handleScrollChatToBottomEvent) + EventBus.$on('smooth-scroll-chat-to-bottom', this.smoothScrollToBottom) + EventBus.$on('focus-message', this.focusMessage) + EventBus.$on('route-change', this.onRouteChange) subscribe('networkOffline', this.handleNetworkOffline) subscribe('networkOnline', this.handleNetworkOnline) window.addEventListener('focus', this.onWindowFocus) @@ -284,10 +286,10 @@ export default { beforeDestroy() { window.removeEventListener('focus', this.onWindowFocus) - EventBus.$off('scrollChatToBottom', this.handleScrollChatToBottomEvent) - EventBus.$off('smoothScrollChatToBottom', this.smoothScrollToBottom) - EventBus.$off('focusMessage', this.focusMessage) - EventBus.$off('routeChange', this.onRouteChange) + EventBus.$off('scroll-chat-to-bottom', this.handleScrollChatToBottomEvent) + EventBus.$off('smooth-scroll-chat-to-bottom', this.smoothScrollToBottom) + EventBus.$off('focus-message', this.focusMessage) + EventBus.$off('route-change', this.onRouteChange) this.$store.dispatch('cancelLookForNewMessages', { requestId: this.chatIdentifier }) this.destroying = true @@ -314,7 +316,7 @@ export default { * @param {string} message2.actorDisplayName Actor display name of previous message * @param {string} message2.systemMessage System message content of the previous message * @param {int} message2.timestamp Timestamp of the second message - * @returns {boolean} Boolean if the messages should be grouped or not + * @return {boolean} Boolean if the messages should be grouped or not */ messagesShouldBeGrouped(message1, message2) { if (!message2) { @@ -354,7 +356,7 @@ export default { * @param {null|object} message2 The previous message * @param {string} message2.id The ID of the second message * @param {int} message2.timestamp Timestamp of the second message - * @returns {boolean} Boolean if the messages have the same date + * @return {boolean} Boolean if the messages have the same date */ messagesHaveDifferentDate(message1, message2) { return !message2 // There is no previous message @@ -367,7 +369,7 @@ export default { * @param {object} message The message object * @param {string} message.id The ID of the message * @param {int} message.timestamp Timestamp of the message - * @returns {string} Translated string of ", ", "<3 days ago>, " + * @return {string} Translated string of ", ", "<3 days ago>, " */ generateDateSeparator(message) { const date = this.getDateOfMessage(message) @@ -402,7 +404,7 @@ export default { * @param {object} message The message object * @param {string} message.id The ID of the message * @param {int} message.timestamp Timestamp of the message - * @returns {object} MomentJS object + * @return {object} MomentJS object */ getDateOfMessage(message) { if (message.id.toString().startsWith('temp-')) { @@ -512,6 +514,7 @@ export default { /** * Get messages history. + * * @param {boolean} includeLastKnown Include or exclude the last known message in the response */ async getOldMessages(includeLastKnown) { @@ -535,6 +538,7 @@ export default { /** * Creates a long polling request for a new message. + * * @param {boolean} scrollToBottom Whether we should try to automatically scroll to the bottom */ async getNewMessages(scrollToBottom = true) { @@ -634,7 +638,7 @@ export default { * the bottom of the viewport. * * @param {object} messageEl message element after which to start searching - * @returns {object} DOM element for the last visible message + * @return {object} DOM element for the last visible message */ findFirstVisibleMessage(messageEl) { let el = messageEl @@ -789,7 +793,7 @@ export default { * @param {string} messageId message id * @param {boolean} smooth true to smooth scroll, false to jump directly * @param {boolean} highlightAnimation true to highlight and set focus to the message - * @returns {bool} true if element was found, false otherwise + * @return {bool} true if element was found, false otherwise */ focusMessage(messageId, smooth = true, highlightAnimation = true) { const element = document.getElementById(`message_${messageId}`) @@ -799,7 +803,7 @@ export default { return false } - this.$nextTick(async() => { + this.$nextTick(async () => { // FIXME: this doesn't wait for the smooth scroll to end await element.scrollIntoView({ behavior: smooth ? 'smooth' : 'auto', @@ -821,7 +825,8 @@ export default { /** * gets the last known message id. - * @returns {string} The last known message id. + * + * @return {string} The last known message id. */ getLastKnownMessageId() { let i = this.messagesList.length - 1 @@ -836,7 +841,8 @@ export default { }, /** * gets the first message's id. - * @returns {string} + * + * @return {string} */ getFirstKnownMessageId() { return this.messagesList[0].id.toString() @@ -874,7 +880,7 @@ export default { }, setChatScrolledToBottom(boolean) { - this.$emit('setChatScrolledToBottom', boolean) + this.$emit('set-chat-scrolled-to-bottom', boolean) if (boolean) { // mark as read if marker was seen // we have to do this early because unfocussing the window will remove the stickiness diff --git a/src/components/NewMessageForm/AdvancedInput/AdvancedInput.vue b/src/components/NewMessageForm/AdvancedInput/AdvancedInput.vue index eae9624c54f..b76317a0c88 100644 --- a/src/components/NewMessageForm/AdvancedInput/AdvancedInput.vue +++ b/src/components/NewMessageForm/AdvancedInput/AdvancedInput.vue @@ -107,7 +107,7 @@ import debounce from 'debounce' * vue-at component or not. * * @param {CSSStyleSheet} sheet the style sheet to check. - * @returns {Boolean} True if it is the style sheet from vue-at, false + * @return {boolean} True if it is the style sheet from vue-at, false * otherwise. */ function isDefaultAtWhoStyleSheet(sheet) { @@ -240,13 +240,13 @@ export default { /** * Listen to routeChange global events and focus on the */ - EventBus.$on('focusChatInput', this.focusInput) + EventBus.$on('focus-chat-input', this.focusInput) this.atWhoPanelExtraClasses = 'talk candidate-mentions' }, beforeDestroy() { - EventBus.$off('focusChatInput', this.focusInput) + EventBus.$off('focus-chat-input', this.focusInput) }, methods: { @@ -281,7 +281,8 @@ export default { * The vue-at library only searches in the display name by default. * But luckily our server responds already only with matching items, * so we just filter none and show them all. - * @returns {boolean} True as we never filter anything out + * + * @return {boolean} True as we never filter anything out */ atFilter() { return true @@ -347,7 +348,7 @@ export default { * Sets the autocomplete mention candidates based on the matched text * after the "@". * - * @param {String} chunk the matched text to look candidate mentions for. + * @param {string} chunk the matched text to look candidate mentions for. */ handleAtEvent: debounce(function(chunk) { this.queryPossibleMentions(chunk) diff --git a/src/components/NewMessageForm/AudioRecorder/AudioRecorder.vue b/src/components/NewMessageForm/AudioRecorder/AudioRecorder.vue index 9f68592d8f8..d40d0ed96f4 100644 --- a/src/components/NewMessageForm/AudioRecorder/AudioRecorder.vue +++ b/src/components/NewMessageForm/AudioRecorder/AudioRecorder.vue @@ -279,7 +279,7 @@ export default { // Convert blob to file const audioFile = new File([this.blob], fileName) audioFile.localURL = window.URL.createObjectURL(this.blob) - this.$emit('audioFile', audioFile) + this.$emit('audio-file', audioFile) this.$emit('recording', false) } this.resetComponentData() diff --git a/src/components/NewMessageForm/NewMessageForm.vue b/src/components/NewMessageForm/NewMessageForm.vue index d506e6c6029..2a1933d9357 100644 --- a/src/components/NewMessageForm/NewMessageForm.vue +++ b/src/components/NewMessageForm/NewMessageForm.vue @@ -108,7 +108,7 @@ v-if="!hasText && canUploadFiles" :disabled="disabled" @recording="handleRecording" - @audioFile="handleAudioFile" /> + @audio-file="handleAudioFile" />