From 4ec0f6022b1eb282511ca5511dabbae66af9508e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 3 Mar 2020 09:43:14 +0100 Subject: Correctly fold long messages by default Signed-off-by: Joas Schilling --- src/Components/Notification.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Components/Notification.vue b/src/Components/Notification.vue index 62f3235..8c799a3 100644 --- a/src/Components/Notification.vue +++ b/src/Components/Notification.vue @@ -129,10 +129,7 @@ export default { data() { return { - showFullMessage: { - type: Boolean, - default: false - } + showFullMessage: false, } }, -- cgit v1.2.3 From 0babe4e4ad027490d7be50cdea81ee2e98e28740 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 3 Mar 2020 09:43:27 +0100 Subject: Correctly strecht the notification to the full length Signed-off-by: Joas Schilling --- css/styles.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/css/styles.scss b/css/styles.scss index 1d3568c..a7ba964 100644 --- a/css/styles.scss +++ b/css/styles.scss @@ -75,7 +75,6 @@ .notification { padding-bottom: 12px; - max-height: 500px; &:not(:last-child) { border-bottom: 1px solid var(--color-border); -- cgit v1.2.3 From b04ea4787de150f5d4d9bc00beeafb18a3e390ba Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 4 Mar 2020 10:44:03 +0100 Subject: Add nextcloud eslint Signed-off-by: Joas Schilling --- .eslintignore | 2 + .eslintrc.js | 95 ++------------------------------- package-lock.json | 157 +++++++++++++++++++++++++++++++++--------------------- package.json | 8 +-- 4 files changed, 107 insertions(+), 155 deletions(-) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..a5e23db --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +/js/* +/tests/* diff --git a/.eslintrc.js b/.eslintrc.js index de2b77c..dc62876 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,98 +1,11 @@ module.exports = { - root: true, - env: { - browser: true, - es6: true, - node: true - }, - globals: { - oc_config: true, - oca_contacts: true, - moment: true, - escapeHTML: true, - n: true, - t: true, - OC: true, - OCA: true, - OCP: true, - Vue: true, - $: true // FIXME should remove jQuery dependency - }, - parserOptions: { - parser: 'babel-eslint', - ecmaVersion: 6 - }, extends: [ - 'eslint:recommended', - 'plugin:import/errors', - 'plugin:import/warnings', - 'plugin:node/recommended', - 'plugin:vue/essential', - 'plugin:vue/recommended', - 'standard' + 'nextcloud' ], - settings: { - 'import/resolver': { - webpack: { - config: 'src/webpack.common.js' - }, - node: { - paths: ['src'], - extensions: ['.js', '.vue'] - } - } + globals: { + '$': true }, - plugins: ['vue', 'node'], rules: { - 'no-control-regex': 0, - // space before function () - 'space-before-function-paren': ['error', 'never'], - // curly braces always space - 'object-curly-spacing': ['error', 'always'], - // stay consistent with array brackets - 'array-bracket-newline': ['error', 'consistent'], - // 1tbs brace style - 'brace-style': 'error', - // tabs only - indent: ['error', 'tab'], - 'no-tabs': 0, - 'vue/html-indent': ['error', 'tab'], - // only debug console - 'no-console': ['error', { allow: ['error', 'warn', 'info', 'debug'] }], - // classes blocks - 'padded-blocks': ['error', { classes: 'always' }], - // always have the operator in front - 'operator-linebreak': ['error', 'before'], - // ternary on multiline - 'multiline-ternary': ['error', 'always-multiline'], - // force proper JSDocs - 'valid-jsdoc': [2, { - prefer: { - return: 'returns' - }, - requireReturn: false, - requireReturnDescription: false - }], - // es6 import/export and require - 'node/no-unpublished-require': ['off'], - 'node/no-unsupported-features/es-syntax': ['off'], - // kebab case components for vuejs - 'vue/component-name-in-template-casing': ['error', 'kebab-case'], - // space before self-closing elements - 'vue/html-closing-bracket-spacing': 'error', - // no ending html tag on a new line - 'vue/html-closing-bracket-newline': ['error', { multiline: 'never' }], - // code spacing with attributes - 'vue/max-attributes-per-line': ['error', { - singleline: 3, - multiline: { - max: 3, - allowFirstLine: true - } - }], - 'node/no-missing-import': ['error', { - tryExtensions: ['.js', '.vue'] - }], - 'vue/no-v-html': ['off'] + 'no-control-regex': 1 } } diff --git a/package-lock.json b/package-lock.json index ff6fc6f..6e48a97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2302,13 +2302,14 @@ "dev": true }, "array-includes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.0.tgz", - "integrity": "sha512-ONOEQoKrvXPKk7Su92Co0YMqYO32FfqJTzkKU9u2UpIXyYZIzLSvpdg4AwvSw4mSUW0czu6inK+zby6Oj6gDjQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", + "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.0" + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" } }, "array-unique": { @@ -3556,22 +3557,22 @@ } }, "es-abstract": { - "version": "1.17.0-next.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0-next.1.tgz", - "integrity": "sha512-7MmGr03N7Rnuid6+wyhD9sHNE2n4tFSwExnU2lQl3lIo2ShXWGePY80zYaoMOmILWv57H0amMjZGHNzzGG70Rw==", + "version": "1.17.4", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.4.tgz", + "integrity": "sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", "object-inspect": "^1.7.0", "object-keys": "^1.1.1", "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.0", - "string.prototype.trimright": "^2.1.0" + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" }, "dependencies": { "has-symbols": { @@ -3764,6 +3765,12 @@ } } }, + "eslint-config-nextcloud": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/eslint-config-nextcloud/-/eslint-config-nextcloud-0.1.1.tgz", + "integrity": "sha512-/1VAkt7Y/m63eZfBiYkSzZMwQtmz0DFXuJnLebrzIY1GtpIj/Y3c//j4ZDiH5o0vbdn9laIc2Mb/01DIjzvt3g==", + "dev": true + }, "eslint-config-standard": { "version": "14.1.0", "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.0.tgz", @@ -3771,13 +3778,13 @@ "dev": true }, "eslint-import-resolver-node": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", - "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.3.tgz", + "integrity": "sha512-b8crLDo0M5RSe5YG8Pu2DYBj71tSB6OvXkfzwbJU2w7y8P4/yo0MyF8jU26IEuEuHF2K5/gcAJE3LhQGqBBbVg==", "dev": true, "requires": { "debug": "^2.6.9", - "resolve": "^1.5.0" + "resolve": "^1.13.1" }, "dependencies": { "debug": { @@ -3788,6 +3795,15 @@ "requires": { "ms": "2.0.0" } + }, + "resolve": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", + "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } } } }, @@ -3934,9 +3950,9 @@ } }, "eslint-module-utils": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.5.0.tgz", - "integrity": "sha512-kCo8pZaNz2dsAW7nCUjuVoI11EBXXpIzfNxmaoLhXoRDOnqXLC4iSGVRdZPhOitfbdEfMEfKOiENaK6wDPZEGw==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.5.2.tgz", + "integrity": "sha512-LGScZ/JSlqGKiT8OC+cYRxseMjyqt6QO54nl281CK93unD89ijSeRV6An8Ci/2nvWVKe8K/Tqdm75RQoIOCr+Q==", "dev": true, "requires": { "debug": "^2.6.9", @@ -4025,9 +4041,9 @@ } }, "eslint-plugin-import": { - "version": "2.19.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.19.1.tgz", - "integrity": "sha512-x68131aKoCZlCae7rDXKSAQmbT5DQuManyXo2sK6fJJ0aK5CWAkv6A6HJZGgqC8IhjQxYPgo6/IY4Oz8AFsbBw==", + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.20.1.tgz", + "integrity": "sha512-qQHgFOTjguR+LnYRoToeZWT62XM55MBVXObHM6SKFd1VzDcX/vqT1kAz8ssqigh5eMj8qXcRoXXGZpPP6RfdCw==", "dev": true, "requires": { "array-includes": "^3.0.3", @@ -4064,9 +4080,9 @@ } }, "resolve": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz", - "integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==", + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", + "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -4074,6 +4090,15 @@ } } }, + "eslint-plugin-nextcloud": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-nextcloud/-/eslint-plugin-nextcloud-0.3.0.tgz", + "integrity": "sha512-LUD2qdirGL0BRt4uaMDGxen17mWVq9JwuGDt7P7Celz7bzdu0X48RrS8mhXn9e0w78+nYN5kPoULG2Bw04r4HA==", + "dev": true, + "requires": { + "requireindex": "~1.2.0" + } + }, "eslint-plugin-node": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.0.0.tgz", @@ -5859,9 +5884,9 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", "dev": true }, "is-data-descriptor": { @@ -5883,9 +5908,9 @@ } }, "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, "is-descriptor": { @@ -5971,12 +5996,12 @@ "dev": true }, "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", "dev": true, "requires": { - "has": "^1.0.1" + "has": "^1.0.3" } }, "is-stream": { @@ -5985,6 +6010,12 @@ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, "is-symbol": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", @@ -6358,14 +6389,6 @@ "map-age-cleaner": "^0.1.1", "mimic-fn": "^2.0.0", "p-is-promise": "^2.0.0" - }, - "dependencies": { - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - } } }, "memory-fs": { @@ -7736,6 +7759,12 @@ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, + "requireindex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", + "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==", + "dev": true + }, "resolve": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", @@ -8539,9 +8568,9 @@ } }, "string.prototype.trimleft": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", - "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", "dev": true, "requires": { "define-properties": "^1.1.3", @@ -8549,9 +8578,9 @@ } }, "string.prototype.trimright": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", - "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", "dev": true, "requires": { "define-properties": "^1.1.3", @@ -8680,9 +8709,9 @@ } }, "terser": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.1.tgz", - "integrity": "sha512-w0f2OWFD7ka3zwetgVAhNMeyzEbj39ht2Tb0qKflw9PmW9Qbo5tjTh01QJLkhO9t9RDDQYvk+WXqpECI2C6i2A==", + "version": "4.6.6", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.6.tgz", + "integrity": "sha512-4lYPyeNmstjIIESr/ysHg2vUPRGf2tzF9z2yYwnowXVuVzLEamPN1Gfrz7f8I9uEPuHcbFlW4PLIAsJoxXyJ1g==", "dev": true, "requires": { "commander": "^2.20.0", @@ -9232,9 +9261,9 @@ } }, "webpack": { - "version": "4.41.5", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.41.5.tgz", - "integrity": "sha512-wp0Co4vpyumnp3KlkmpM5LWuzvZYayDwM2n17EHFr4qxBBbRokC7DJawPJC7TfSFZ9HZ6GsdH40EBj4UV0nmpw==", + "version": "4.42.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.42.0.tgz", + "integrity": "sha512-EzJRHvwQyBiYrYqhyjW9AqM90dE4+s1/XtCfn7uWg6cS72zH+2VPFAlsnW0+W0cDi0XRjNKUMoJtpSi50+Ph6w==", "dev": true, "requires": { "@webassemblyjs/ast": "1.8.5", @@ -9274,6 +9303,12 @@ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, "eslint-scope": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", @@ -9294,13 +9329,13 @@ } }, "loader-utils": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", - "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", "dev": true, "requires": { "big.js": "^5.2.2", - "emojis-list": "^2.0.0", + "emojis-list": "^3.0.0", "json5": "^1.0.1" } }, @@ -9330,9 +9365,9 @@ } }, "webpack-cli": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.10.tgz", - "integrity": "sha512-u1dgND9+MXaEt74sJR4PR7qkPxXUSQ0RXYq8x1L6Jg1MYVEmGPrH6Ah6C4arD4r0J1P5HKjRqpab36k0eIzPqg==", + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.11.tgz", + "integrity": "sha512-dXlfuml7xvAFwYUPsrtQAA9e4DOe58gnzSxhgrO/ZM/gyXTBowrsYeubyN4mqGhYdpXMFNyQ6emjJS9M7OBd4g==", "dev": true, "requires": { "chalk": "2.4.2", diff --git a/package.json b/package.json index eecba98..c656e0d 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,12 @@ "babel-loader": "^8.0.6", "css-loader": "^3.4.1", "eslint": "^6.8.0", + "eslint-config-nextcloud": "^0.1.1", "eslint-config-standard": "^14.1.0", "eslint-import-resolver-webpack": "^0.12.0", "eslint-loader": "^3.0.3", - "eslint-plugin-import": "^2.19.1", + "eslint-plugin-import": "^2.20.1", + "eslint-plugin-nextcloud": "^0.3.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", @@ -43,8 +45,8 @@ "sass-loader": "^7.3.1", "vue-loader": "^15.8.3", "vue-template-compiler": "^2.6.11", - "webpack": "^4.41.5", - "webpack-cli": "^3.3.10", + "webpack": "^4.42.0", + "webpack-cli": "^3.3.11", "webpack-merge": "^4.2.2" } } -- cgit v1.2.3 From f57bf2763ee4cffdfeef39d27511fe85ba073812 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 5 Mar 2020 10:25:41 +0100 Subject: Fix eslint Signed-off-by: Joas Schilling --- .eslintrc.js | 1 + src/App.vue | 44 ++++++++++++++++++------------- src/Components/Action.vue | 27 ++++++++++--------- src/Components/Notification.vue | 58 ++++++++++++++++++++--------------------- src/Init.js | 45 ++++++++++++++++++++++++++++++++ src/init.js | 45 -------------------------------- src/richObjectStringParser.js | 8 +++--- src/webpack.common.js | 32 +++++++++++------------ src/webpack.dev.js | 4 +-- src/webpack.prod.js | 2 +- 10 files changed, 139 insertions(+), 127 deletions(-) create mode 100644 src/Init.js delete mode 100644 src/init.js diff --git a/.eslintrc.js b/.eslintrc.js index dc62876..f9f2bcb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,6 +3,7 @@ module.exports = { 'nextcloud' ], globals: { + 'moment': true, '$': true }, rules: { diff --git a/src/App.vue b/src/App.vue index 0a1102d..75e2018 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,17 +1,25 @@ @@ -34,97 +34,97 @@ export default { name: 'Notification', components: { - Action + Action, }, props: { notificationId: { type: Number, default: -1, - required: true + required: true, }, datetime: { type: String, default: '', - required: true + required: true, }, app: { type: String, default: '', - required: true + required: true, }, icon: { type: String, default: '', - required: true + required: true, }, link: { type: String, default: '', - required: true + required: true, }, user: { type: String, default: '', - required: true + required: true, }, message: { type: String, default: '', - required: true + required: true, }, messageRich: { type: String, default: '', - required: true + required: true, }, messageRichParameters: { type: [Object, Array], default() { return {} }, - required: true + required: true, }, subject: { type: String, default: '', - required: true + required: true, }, subjectRich: { type: String, default: '', - required: true + required: true, }, subjectRichParameters: { type: [Object, Array], default() { return {} }, - required: true + required: true, }, objectType: { type: String, default: '', - required: true + required: true, }, objectId: { type: String, default: '', - required: true + required: true, }, actions: { type: Array, default() { return [] }, - required: true + required: true, }, index: { type: Number, default: -1, - required: true - } + required: true, + }, }, data() { @@ -170,14 +170,14 @@ export default { } return escapeHTML(this.message).replace(new RegExp('\n', 'g'), '
') - } + }, }, mounted: function() { this._$el = $(this.$el) this._$el.find('.avatar').each(function() { - var element = $(this) + const element = $(this) if (element.data('user-display-name')) { element.avatar(element.data('user'), 21, undefined, false, undefined, element.data('user-display-name')) } else { @@ -186,16 +186,16 @@ export default { }) this._$el.find('.avatar-name-wrapper').each(function() { - var element = $(this) - var avatar = element.find('.avatar') - var label = element.find('strong') + const element = $(this) + const avatar = element.find('.avatar') + const label = element.find('strong') $.merge(avatar, label).contactsMenu(element.data('user'), 0, element) }) this._$el.find('.has-tooltip').tooltip({ // container: this.$container.find('.notification-wrapper'), - placement: 'bottom' + placement: 'bottom', }) // Parents: TransitionGroup > NotificationsList @@ -250,12 +250,12 @@ export default { * @see https://developer.mozilla.org/en/docs/Web/API/notification */ _createWebNotification: function() { - var n = new Notification(this.subject, { + const n = new Notification(this.subject, { title: this.subject, lang: OC.getLocale(), body: this.message, icon: this.icon, - tag: this.notificationId + tag: this.notificationId, }) if (this.link) { @@ -266,7 +266,7 @@ export default { } setTimeout(n.close.bind(n), 5000) - } - } + }, + }, } diff --git a/src/Init.js b/src/Init.js new file mode 100644 index 0000000..c2e1900 --- /dev/null +++ b/src/Init.js @@ -0,0 +1,45 @@ +/** + * @copyright Copyright (c) 2018 Joas Schilling + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +import Vue from 'vue' +import App from './App' + +Vue.prototype.t = t +Vue.prototype.n = n +Vue.prototype.OC = OC +Vue.prototype.OCA = OCA + +const searchBox = document.getElementsByClassName('searchbox') +const notificationsBell = document.createElement('div') +notificationsBell.setAttribute('id', 'notifications') + +Array.prototype.map.call(searchBox, (el) => { + if (el.nodeName !== 'FORM') { + return + } + + el.insertAdjacentHTML('afterend', notificationsBell.outerHTML) +}) + +export default new Vue({ + el: '#notifications', + name: 'Init', + render: h => h(App), +}) diff --git a/src/init.js b/src/init.js deleted file mode 100644 index 4184c6c..0000000 --- a/src/init.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @copyright Copyright (c) 2018 Joas Schilling - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -import Vue from 'vue' -import App from './App' - -Vue.prototype.t = t -Vue.prototype.n = n -Vue.prototype.OC = OC -Vue.prototype.OCA = OCA - -const searchBox = document.getElementsByClassName('searchbox') -const notificationsBell = document.createElement('div') -notificationsBell.setAttribute('id', 'notifications') - -Array.prototype.map.call(searchBox, (el) => { - if (el.nodeName !== 'FORM') { - return - } - - el.insertAdjacentHTML('afterend', notificationsBell.outerHTML) -}) - -export default new Vue({ - el: '#notifications', - name: 'NotificationsRoot', - render: h => h(App) -}) diff --git a/src/richObjectStringParser.js b/src/richObjectStringParser.js index 71bb7dd..47983f9 100644 --- a/src/richObjectStringParser.js +++ b/src/richObjectStringParser.js @@ -26,7 +26,7 @@ export default { parseMessage: function(message, parameters) { message = escapeHTML(message) const regex = /\{([a-z\-_0-9]+)\}/gi - var matches = message.match(regex) + const matches = message.match(regex) if (!matches) { return message @@ -40,7 +40,7 @@ export default { return } - var parsed = this.parseParameter(parameters[parameter]) + const parsed = this.parseParameter(parameters[parameter]) message = message.replace('{' + parameter + '}', parsed) }) @@ -92,7 +92,7 @@ export default { parameter.path = parameter.path.substring(firstSlashPosition === 0 ? 1 : 0, lastSlashPosition) return this.fileTemplate(Object.assign({}, parameter, { - title: parameter.path.length === 0 ? '' : t('notifications', 'in {path}', parameter) + title: parameter.path.length === 0 ? '' : t('notifications', 'in {path}', parameter), })) - } + }, } diff --git a/src/webpack.common.js b/src/webpack.common.js index 5f4c433..d015414 100644 --- a/src/webpack.common.js +++ b/src/webpack.common.js @@ -2,57 +2,57 @@ const path = require('path') const { VueLoaderPlugin } = require('vue-loader') module.exports = { - entry: path.join(__dirname, 'init.js'), + entry: path.join(__dirname, 'Init.js'), output: { path: path.resolve(__dirname, '../js'), publicPath: '/js/', - filename: 'notifications.js' + filename: 'notifications.js', }, module: { rules: [ { test: /\.css$/, - use: ['vue-style-loader', 'css-loader'] + use: ['vue-style-loader', 'css-loader'], }, { test: /\.vue$/, loader: 'vue-loader', options: { - hotReload: false // disables Hot Reload - } + hotReload: false, // disables Hot Reload + }, }, { test: /\.js$/, loader: 'babel-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { enforce: 'pre', test: /\.(js|vue)$/, loader: 'eslint-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /\.(png|jpg|gif|svg)$/, loader: 'file-loader', options: { - name: '[name].[ext]?[hash]' - } + name: '[name].[ext]?[hash]', + }, }, { test: /\.handlebars/, loader: 'handlebars-loader', query: { - extensions: '.handlebars' - } - } - ] + extensions: '.handlebars', + }, + }, + ], }, plugins: [new VueLoaderPlugin()], resolve: { alias: { - vue$: 'vue/dist/vue.esm.js' + vue$: 'vue/dist/vue.esm.js', }, - extensions: ['*', '.js', '.vue', '.json'] - } + extensions: ['*', '.js', '.vue', '.json'], + }, } diff --git a/src/webpack.dev.js b/src/webpack.dev.js index ee9d649..153d330 100644 --- a/src/webpack.dev.js +++ b/src/webpack.dev.js @@ -6,7 +6,7 @@ module.exports = merge(common, { devServer: { historyApiFallback: true, noInfo: true, - overlay: true + overlay: true, }, - devtool: '#cheap-source-map' + devtool: '#cheap-source-map', }) diff --git a/src/webpack.prod.js b/src/webpack.prod.js index 7e63371..07cb994 100644 --- a/src/webpack.prod.js +++ b/src/webpack.prod.js @@ -3,5 +3,5 @@ const common = require('./webpack.common.js') module.exports = merge(common, { mode: 'production', - devtool: '#source-map' + devtool: '#source-map', }) -- cgit v1.2.3