From 9507cdf4efb089fd4b1437e3e1194fdf8b898339 Mon Sep 17 00:00:00 2001 From: Miguel Alatzar Date: Wed, 9 Oct 2019 13:43:32 -0700 Subject: [PATCH 1/6] Fix failing snapshot test and package-lock.json (#3401) --- .../channel_info_header.test.js.snap | 6 +- package-lock.json | 233 ++++++++---------- 2 files changed, 110 insertions(+), 129 deletions(-) diff --git a/app/screens/channel_info/__snapshots__/channel_info_header.test.js.snap b/app/screens/channel_info/__snapshots__/channel_info_header.test.js.snap index d48b33ee5..e8f47346b 100644 --- a/app/screens/channel_info/__snapshots__/channel_info_header.test.js.snap +++ b/app/screens/channel_info/__snapshots__/channel_info_header.test.js.snap @@ -1057,10 +1057,11 @@ exports[`channel_info_header should match snapshot when DM and hasGuests but its "color": "#2389d7", }, "mention": Object { - "color": "#2389d7", + "color": "#166de0", }, "mention_highlight": Object { "backgroundColor": "#ffe577", + "color": "#166de0", }, "strong": Object { "fontWeight": "bold", @@ -1204,10 +1205,11 @@ exports[`channel_info_header should match snapshot when DM and hasGuests but its "color": "#2389d7", }, "mention": Object { - "color": "#2389d7", + "color": "#166de0", }, "mention_highlight": Object { "backgroundColor": "#ffe577", + "color": "#166de0", }, "strong": Object { "fontWeight": "bold", diff --git a/package-lock.json b/package-lock.json index 84eb7af0e..2020b0fa4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4835,7 +4835,7 @@ }, "array-equal": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", "dev": true }, @@ -6137,7 +6137,7 @@ }, "css-select": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", "dev": true, "requires": { @@ -6947,7 +6947,7 @@ } }, "eslint-config-mattermost": { - "version": "github:mattermost/eslint-config-mattermost#3ee77526c9c963877f3141b9c9090a236392bf82", + "version": "github:mattermost/eslint-config-mattermost#8f9eb1414bf9ebfb509359bddddfad9788ca3c3c", "from": "github:mattermost/eslint-config-mattermost", "dev": true }, @@ -7510,7 +7510,7 @@ }, "external-editor": { "version": "2.2.0", - "resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", "requires": { "chardet": "^0.4.0", @@ -8489,25 +8489,24 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": false, - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "optional": true + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, "aproba": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "optional": true, "requires": { @@ -8517,15 +8516,13 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": false, - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "optional": true + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "brace-expansion": { "version": "1.1.11", - "resolved": false, + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -8533,37 +8530,34 @@ }, "chownr": { "version": "1.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": false, - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "optional": true + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "concat-map": { "version": "0.0.1", - "resolved": false, - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "optional": true + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "console-control-strings": { "version": "1.1.0", - "resolved": false, - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "optional": true + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, "core-util-is": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "optional": true }, "debug": { "version": "4.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "optional": true, "requires": { @@ -8572,25 +8566,25 @@ }, "deep-extend": { "version": "0.6.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "optional": true }, "delegates": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "optional": true, "requires": { @@ -8599,13 +8593,13 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "optional": true }, "gauge": { "version": "2.7.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "optional": true, "requires": { @@ -8621,7 +8615,7 @@ }, "glob": { "version": "7.1.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "optional": true, "requires": { @@ -8635,13 +8629,13 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "optional": true }, "iconv-lite": { "version": "0.4.24", - "resolved": false, + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "optional": true, "requires": { @@ -8650,7 +8644,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "optional": true, "requires": { @@ -8659,7 +8653,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": false, + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "optional": true, "requires": { @@ -8669,51 +8663,46 @@ }, "inherits": { "version": "2.0.3", - "resolved": false, - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "optional": true + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { "version": "1.3.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "optional": true, "requires": { "number-is-nan": "^1.0.0" } }, "isarray": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "resolved": false, - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "optional": true + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "minipass": { "version": "2.3.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -8721,7 +8710,7 @@ }, "minizlib": { "version": "1.2.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "optional": true, "requires": { @@ -8730,22 +8719,21 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "optional": true, "requires": { "minimist": "0.0.8" } }, "ms": { "version": "2.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "optional": true }, "needle": { "version": "2.3.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.0.tgz", "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "optional": true, "requires": { @@ -8756,7 +8744,7 @@ }, "node-pre-gyp": { "version": "0.12.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz", "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", "optional": true, "requires": { @@ -8774,7 +8762,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "optional": true, "requires": { @@ -8784,13 +8772,13 @@ }, "npm-bundled": { "version": "1.0.6", - "resolved": false, + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "optional": true }, "npm-packlist": { "version": "1.4.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz", "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "optional": true, "requires": { @@ -8800,7 +8788,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "optional": true, "requires": { @@ -8812,40 +8800,38 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": false, - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "optional": true + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "object-assign": { "version": "4.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "optional": true }, "once": { "version": "1.4.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "optional": true, "requires": { "wrappy": "1" } }, "os-homedir": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "optional": true }, "osenv": { "version": "0.1.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "optional": true, "requires": { @@ -8855,19 +8841,19 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "optional": true }, "rc": { "version": "1.2.8", - "resolved": false, + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "optional": true, "requires": { @@ -8879,7 +8865,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "optional": true } @@ -8887,7 +8873,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": false, + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "optional": true, "requires": { @@ -8902,7 +8888,7 @@ }, "rimraf": { "version": "2.6.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "optional": true, "requires": { @@ -8911,45 +8897,43 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": false, - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "optional": true + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safer-buffer": { "version": "2.1.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "optional": true }, "sax": { "version": "1.2.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "optional": true }, "semver": { "version": "5.7.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "optional": true }, "string-width": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -8958,7 +8942,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "optional": true, "requires": { @@ -8967,22 +8951,21 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "optional": true, "requires": { "ansi-regex": "^2.0.0" } }, "strip-json-comments": { "version": "2.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "optional": true }, "tar": { "version": "4.4.8", - "resolved": false, + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "optional": true, "requires": { @@ -8997,13 +8980,13 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "optional": true }, "wide-align": { "version": "1.1.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "optional": true, "requires": { @@ -9012,15 +8995,13 @@ }, "wrappy": { "version": "1.0.2", - "resolved": false, - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "optional": true + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "yallist": { "version": "3.0.3", - "resolved": false, - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "optional": true + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" } } }, @@ -13969,7 +13950,7 @@ }, "lodash.isempty": { "version": "4.4.0", - "resolved": "http://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", + "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", "integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=" }, "lodash.isequal": { @@ -14690,7 +14671,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "mixin-deep": { @@ -14714,7 +14695,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -14722,13 +14703,13 @@ "dependencies": { "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" } } }, "mmjstool": { - "version": "github:mattermost/mattermost-utilities#b55348242168df75da500fd813d4105c44eaea08", + "version": "github:mattermost/mattermost-utilities#ce99d7a9e82128a02fd36e44720a4aef2653810d", "from": "github:mattermost/mattermost-utilities", "dev": true, "requires": { @@ -15270,7 +15251,7 @@ }, "find-up": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { @@ -15300,7 +15281,7 @@ }, "locate-path": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { @@ -15347,7 +15328,7 @@ }, "p-locate": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { @@ -15368,7 +15349,7 @@ }, "resolve-from": { "version": "4.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, @@ -15417,7 +15398,7 @@ }, "y18n": { "version": "4.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, @@ -15654,7 +15635,7 @@ "dependencies": { "minimist": { "version": "0.0.10", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" }, "wordwrap": { @@ -15722,7 +15703,7 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, "output-file-sync": { @@ -15966,7 +15947,7 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { @@ -17209,7 +17190,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { "core-util-is": "~1.0.0", @@ -17244,8 +17225,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true, - "optional": true + "dev": true }, "braces": { "version": "2.3.2", @@ -17508,8 +17488,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true, - "optional": true + "dev": true }, "micromatch": { "version": "3.1.10", @@ -18024,7 +18003,7 @@ "prop-types": { "version": "15.6.2", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz", - "integrity": "sha1-BdXKd7RFPphdYPx/+MhZCUpJcQI=", + "integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==", "requires": { "loose-envify": "^1.3.1", "object-assign": "^4.1.1" @@ -18083,7 +18062,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "requires": { "ret": "~0.1.10" @@ -18413,7 +18392,7 @@ "dependencies": { "async": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/async/-/async-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/async/-/async-2.0.0.tgz", "integrity": "sha1-0JAK04WvE4BFQKEJxCFm4657K50=", "dev": true, "requires": { @@ -18531,7 +18510,7 @@ }, "serialize-error": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", "integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=" }, "serve-static": { @@ -18841,7 +18820,7 @@ }, "inquirer": { "version": "5.2.0", - "resolved": "http://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", "dev": true, "requires": { @@ -19271,7 +19250,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { "ansi-regex": "^2.0.0" @@ -19284,7 +19263,7 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, "strip-json-comments": { @@ -19533,7 +19512,7 @@ }, "through": { "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, "through2": { @@ -20325,7 +20304,7 @@ }, "wrap-ansi": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "requires": { "string-width": "^1.0.1", From d4c682bdddfbe82eece7b6bdf53c0f55fad0da85 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 10 Oct 2019 08:48:38 +0300 Subject: [PATCH 2/6] MM-17157 Only send notification receipt if server url and session token are set (#3375) --- app/store/store.js | 10 +++ ios/MattermostShare/ShareViewController.swift | 2 +- .../UploadAttachments/StoreManager.m | 20 +++-- .../UploadAttachments/UploadSession.swift | 88 ++++++++++--------- 4 files changed, 73 insertions(+), 47 deletions(-) diff --git a/app/store/store.js b/app/store/store.js index be1155865..5ab6f2af1 100644 --- a/app/store/store.js +++ b/app/store/store.js @@ -166,8 +166,18 @@ export default function configureAppStore(initialState) { profilesInChannel[channelId] = Array.from(profilesInChannel[channelId]); }); + let url; + if (state.entities.users.currentUserId) { + url = state.entities.general.credentials.url || state.views.selectServer.serverUrl; + } + const entities = { ...state.entities, + general: { + credentials: { + url, + }, + }, channels: { ...state.entities.channels, channelsInTeam, diff --git a/ios/MattermostShare/ShareViewController.swift b/ios/MattermostShare/ShareViewController.swift index 9ac1a1f30..f23892a6d 100644 --- a/ios/MattermostShare/ShareViewController.swift +++ b/ios/MattermostShare/ShareViewController.swift @@ -83,7 +83,7 @@ class ShareViewController: SLComposeServiceViewController { extractDataFromContext() - if sessionToken == nil { + if sessionToken == nil || serverURL == nil { showErrorMessage(title: "", message: "Authentication required: Please first login using the app.", VC: self) } } diff --git a/ios/UploadAttachments/UploadAttachments/StoreManager.m b/ios/UploadAttachments/UploadAttachments/StoreManager.m index bdaddae1b..02fc2bdd8 100644 --- a/ios/UploadAttachments/UploadAttachments/StoreManager.m +++ b/ios/UploadAttachments/UploadAttachments/StoreManager.m @@ -144,19 +144,29 @@ } -(NSString *)getServerUrl { - NSDictionary *general = [self.entities objectForKey:@"general"]; - NSDictionary *credentials = [general objectForKey:@"credentials"]; + NSDictionary *general = [self.entities objectForKey:@"general"]; + NSDictionary *credentials = [general objectForKey:@"credentials"]; - return [credentials objectForKey:@"url"]; + if (credentials) { + return [credentials objectForKey:@"url"]; + } + + return nil; } -(NSString *)getToken { NSDictionary *options = @{ @"accessGroup": APP_GROUP_ID }; - NSDictionary *credentials = [self.keychain getInternetCredentialsForServer:[self getServerUrl] withOptions:options]; + NSString* serverUrl = [self getServerUrl]; + + if (serverUrl) { + NSDictionary *credentials = [self.keychain getInternetCredentialsForServer:[self getServerUrl] withOptions:options]; - return [credentials objectForKey:@"password"]; + return [credentials objectForKey:@"password"]; + } + + return nil; } -(UInt64)scanValueFromConfig:(NSDictionary *)config key:(NSString *)key { diff --git a/ios/UploadAttachments/UploadAttachments/UploadSession.swift b/ios/UploadAttachments/UploadAttachments/UploadSession.swift index 585303e27..d0dcd858e 100644 --- a/ios/UploadAttachments/UploadAttachments/UploadSession.swift +++ b/ios/UploadAttachments/UploadAttachments/UploadSession.swift @@ -16,33 +16,36 @@ import os.log let _ = store.getEntities(true) let serverURL = store.getServerUrl() let sessionToken = store.getToken() - let urlString = "\(serverURL!)/api/v4/posts" - guard let uploadSessionData = UploadSessionManager.shared.getUploadSessionData(identifier: identifier) else {return} - guard let url = URL(string: urlString) else {return} - - if uploadSessionData.message != "" || uploadSessionData.fileIds.count > 0 { - let jsonObject: [String: Any] = [ - "channel_id": uploadSessionData.channelId as Any, - "message": uploadSessionData.message as Any, - "file_ids": uploadSessionData.fileIds - ] - if !JSONSerialization.isValidJSONObject(jsonObject) {return} + if (serverURL != nil && sessionToken != nil) { + let urlString = "\(serverURL!)/api/v4/posts" - var request = URLRequest(url: url) - request.httpMethod = "POST" - request.setValue("Bearer \(sessionToken!)", forHTTPHeaderField: "Authorization") - request.setValue("application/json; charset=utf-8", forHTTPHeaderField: "Content-Type") - request.httpBody = try? JSONSerialization.data(withJSONObject: jsonObject, options: .prettyPrinted) + guard let uploadSessionData = UploadSessionManager.shared.getUploadSessionData(identifier: identifier) else {return} + guard let url = URL(string: urlString) else {return} - if #available(iOS 12.0, *) { - os_log(OSLogType.default, "Mattermost will post identifier=%{public}@", identifier) + if uploadSessionData.message != "" || uploadSessionData.fileIds.count > 0 { + let jsonObject: [String: Any] = [ + "channel_id": uploadSessionData.channelId as Any, + "message": uploadSessionData.message as Any, + "file_ids": uploadSessionData.fileIds + ] + if !JSONSerialization.isValidJSONObject(jsonObject) {return} + + var request = URLRequest(url: url) + request.httpMethod = "POST" + request.setValue("Bearer \(sessionToken!)", forHTTPHeaderField: "Authorization") + request.setValue("application/json; charset=utf-8", forHTTPHeaderField: "Content-Type") + request.httpBody = try? JSONSerialization.data(withJSONObject: jsonObject, options: .prettyPrinted) + + if #available(iOS 12.0, *) { + os_log(OSLogType.default, "Mattermost will post identifier=%{public}@", identifier) + } + + URLSession(configuration: .ephemeral).dataTask(with: request).resume() + + UploadSessionManager.shared.removeUploadSessionData(identifier: identifier) + UploadSessionManager.shared.clearTempDirectory() } - - URLSession(configuration: .ephemeral).dataTask(with: request).resume() - - UploadSessionManager.shared.removeUploadSessionData(identifier: identifier) - UploadSessionManager.shared.clearTempDirectory() } } @@ -131,24 +134,27 @@ import os.log if (entities != nil) { let serverURL = store.getServerUrl() let sessionToken = store.getToken() - let urlString = "\(serverURL!)/api/v4/notifications/ack" - - let jsonObject: [String: Any] = [ - "id": notificationId as Any, - "received_at": receivedAt, - "platform": "ios", - "type": type as Any - ] - - if !JSONSerialization.isValidJSONObject(jsonObject) {return} - - guard let url = URL(string: urlString) else {return} - var request = URLRequest(url: url) - request.httpMethod = "POST" - request.setValue("Bearer \(sessionToken!)", forHTTPHeaderField: "Authorization") - request.setValue("application/json; charset=utf-8", forHTTPHeaderField: "Content-Type") - request.httpBody = try? JSONSerialization.data(withJSONObject: jsonObject, options: .prettyPrinted) - URLSession(configuration: .ephemeral).dataTask(with: request).resume() + + if (serverURL != nil && sessionToken != nil) { + let urlString = "\(serverURL!)/api/v4/notifications/ack" + + let jsonObject: [String: Any] = [ + "id": notificationId as Any, + "received_at": receivedAt, + "platform": "ios", + "type": type as Any + ] + + if !JSONSerialization.isValidJSONObject(jsonObject) {return} + + guard let url = URL(string: urlString) else {return} + var request = URLRequest(url: url) + request.httpMethod = "POST" + request.setValue("Bearer \(sessionToken!)", forHTTPHeaderField: "Authorization") + request.setValue("application/json; charset=utf-8", forHTTPHeaderField: "Content-Type") + request.httpBody = try? JSONSerialization.data(withJSONObject: jsonObject, options: .prettyPrinted) + URLSession(configuration: .ephemeral).dataTask(with: request).resume() + } } } } From 9fa06c45d63935571ef165faeb49425319708ba4 Mon Sep 17 00:00:00 2001 From: Miguel Alatzar Date: Thu, 10 Oct 2019 20:31:54 -0700 Subject: [PATCH 3/6] [MM-17381] Await dismissModal before calling showSearchModal (#3362) * Add unit tests * Await dismissModal --- .../__snapshots__/flagged_posts.test.js.snap | 46 +++++++++++++ app/screens/flagged_posts/flagged_posts.js | 2 +- .../flagged_posts/flagged_posts.test.js | 66 +++++++++++++++++++ .../recent_mentions.test.js.snap | 46 +++++++++++++ .../recent_mentions/recent_mentions.js | 2 +- .../recent_mentions/recent_mentions.test.js | 66 +++++++++++++++++++ 6 files changed, 226 insertions(+), 2 deletions(-) create mode 100644 app/screens/flagged_posts/__snapshots__/flagged_posts.test.js.snap create mode 100644 app/screens/flagged_posts/flagged_posts.test.js create mode 100644 app/screens/recent_mentions/__snapshots__/recent_mentions.test.js.snap create mode 100644 app/screens/recent_mentions/recent_mentions.test.js diff --git a/app/screens/flagged_posts/__snapshots__/flagged_posts.test.js.snap b/app/screens/flagged_posts/__snapshots__/flagged_posts.test.js.snap new file mode 100644 index 000000000..e6c7cbacd --- /dev/null +++ b/app/screens/flagged_posts/__snapshots__/flagged_posts.test.js.snap @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`FlaggedPosts should match snapshot 1`] = ` + + + + +`; diff --git a/app/screens/flagged_posts/flagged_posts.js b/app/screens/flagged_posts/flagged_posts.js index b648ecb86..468bb5d3e 100644 --- a/app/screens/flagged_posts/flagged_posts.js +++ b/app/screens/flagged_posts/flagged_posts.js @@ -101,7 +101,7 @@ export default class FlaggedPosts extends PureComponent { }; handleHashtagPress = async (hashtag) => { - dismissModal(); + await dismissModal(); showSearchModal('#' + hashtag); }; diff --git a/app/screens/flagged_posts/flagged_posts.test.js b/app/screens/flagged_posts/flagged_posts.test.js new file mode 100644 index 000000000..586e73749 --- /dev/null +++ b/app/screens/flagged_posts/flagged_posts.test.js @@ -0,0 +1,66 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import React from 'react'; + +import Preferences from 'mattermost-redux/constants/preferences'; + +import * as NavigationActions from 'app/actions/navigation'; +import {shallowWithIntl} from 'test/intl-test-helper'; + +import FlaggedPosts from './flagged_posts'; + +jest.mock('rn-placeholder', () => ({ + ImageContent: () => {}, +})); + +describe('FlaggedPosts', () => { + const baseProps = { + actions: { + clearSearch: jest.fn(), + loadChannelsByTeamName: jest.fn(), + loadThreadIfNecessary: jest.fn(), + getFlaggedPosts: jest.fn(), + selectFocusedPostId: jest.fn(), + selectPost: jest.fn(), + }, + theme: Preferences.THEMES.default, + }; + + test('should match snapshot', () => { + const wrapper = shallowWithIntl( + + ); + + expect(wrapper.getElement()).toMatchSnapshot(); + }); + + test('should call showSearchModal after awaiting dismissModal on handleHashtagPress', async () => { + const error = new Error('foo'); + const dismissModal = jest.spyOn(NavigationActions, 'dismissModal'); + const showSearchModal = jest.spyOn(NavigationActions, 'showSearchModal'); + + const hashtag = 'test'; + const wrapper = shallowWithIntl( + + ); + + dismissModal.mockImplementation(async () => { + throw error; + }); + let caughtError; + try { + await wrapper.instance().handleHashtagPress(hashtag); + } catch (e) { + caughtError = e; + } + expect(caughtError).toBe(error); + expect(dismissModal).toHaveBeenCalled(); + expect(showSearchModal).not.toHaveBeenCalled(); + + dismissModal.mockImplementation(async () => (Promise.resolve())); + await wrapper.instance().handleHashtagPress(hashtag); + expect(dismissModal).toHaveBeenCalled(); + expect(showSearchModal).toHaveBeenCalledWith(`#${hashtag}`); + }); +}); diff --git a/app/screens/recent_mentions/__snapshots__/recent_mentions.test.js.snap b/app/screens/recent_mentions/__snapshots__/recent_mentions.test.js.snap new file mode 100644 index 000000000..33c35a8e9 --- /dev/null +++ b/app/screens/recent_mentions/__snapshots__/recent_mentions.test.js.snap @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`RecentMentions should match snapshot 1`] = ` + + + + +`; diff --git a/app/screens/recent_mentions/recent_mentions.js b/app/screens/recent_mentions/recent_mentions.js index b146861d2..7e43b89f9 100644 --- a/app/screens/recent_mentions/recent_mentions.js +++ b/app/screens/recent_mentions/recent_mentions.js @@ -95,7 +95,7 @@ export default class RecentMentions extends PureComponent { }; handleHashtagPress = async (hashtag) => { - dismissModal(); + await dismissModal(); showSearchModal('#' + hashtag); }; diff --git a/app/screens/recent_mentions/recent_mentions.test.js b/app/screens/recent_mentions/recent_mentions.test.js new file mode 100644 index 000000000..418f9f24a --- /dev/null +++ b/app/screens/recent_mentions/recent_mentions.test.js @@ -0,0 +1,66 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import React from 'react'; + +import Preferences from 'mattermost-redux/constants/preferences'; + +import * as NavigationActions from 'app/actions/navigation'; +import {shallowWithIntl} from 'test/intl-test-helper'; + +import RecentMentions from './recent_mentions'; + +jest.mock('rn-placeholder', () => ({ + ImageContent: () => {}, +})); + +describe('RecentMentions', () => { + const baseProps = { + actions: { + clearSearch: jest.fn(), + loadChannelsByTeamName: jest.fn(), + loadThreadIfNecessary: jest.fn(), + getRecentMentions: jest.fn(), + selectFocusedPostId: jest.fn(), + selectPost: jest.fn(), + }, + theme: Preferences.THEMES.default, + }; + + test('should match snapshot', () => { + const wrapper = shallowWithIntl( + + ); + + expect(wrapper.getElement()).toMatchSnapshot(); + }); + + test('should call showSearchModal after awaiting dismissModal on handleHashtagPress', async () => { + const error = new Error('foo'); + const dismissModal = jest.spyOn(NavigationActions, 'dismissModal'); + const showSearchModal = jest.spyOn(NavigationActions, 'showSearchModal'); + + const hashtag = 'test'; + const wrapper = shallowWithIntl( + + ); + + dismissModal.mockImplementation(async () => { + throw error; + }); + let caughtError; + try { + await wrapper.instance().handleHashtagPress(hashtag); + } catch (e) { + caughtError = e; + } + expect(caughtError).toBe(error); + expect(dismissModal).toHaveBeenCalled(); + expect(showSearchModal).not.toHaveBeenCalled(); + + dismissModal.mockImplementation(async () => (Promise.resolve())); + await wrapper.instance().handleHashtagPress(hashtag); + expect(dismissModal).toHaveBeenCalled(); + expect(showSearchModal).toHaveBeenCalledWith(`#${hashtag}`); + }); +}); From d48610407a6505a894fc1901ba3620280923474a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Fri, 11 Oct 2019 15:24:45 +0200 Subject: [PATCH 4/6] Not show the guest badge for system messages (#3393) --- app/components/post_header/post_header.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/post_header/post_header.js b/app/components/post_header/post_header.js index 591aecebc..fdfa461de 100644 --- a/app/components/post_header/post_header.js +++ b/app/components/post_header/post_header.js @@ -205,7 +205,7 @@ export default class PostHeader extends PureComponent { }; renderTag = () => { - const {fromAutoResponder, fromWebHook, isBot, isGuest, theme} = this.props; + const {fromAutoResponder, fromWebHook, isBot, isSystemMessage, isGuest, theme} = this.props; const style = getStyleSheet(theme); if (fromWebHook || isBot) { @@ -215,6 +215,8 @@ export default class PostHeader extends PureComponent { theme={theme} /> ); + } else if (isSystemMessage) { + return null; } else if (isGuest) { return ( Date: Fri, 11 Oct 2019 09:28:09 -0400 Subject: [PATCH 5/6] Revert accidentally merged changes from mark-as-unread branch (#3405) * Revert "Update mattermost-redux" This reverts commit 04b3897ecb2b4107d54f955525ddec0b9fa5f74e. * Revert "[MM-17068] Add set post as unread option to menu (#3202)" This reverts commit c7a29eea6a18f9fd918b62bfc843e52fdb56badd. --- app/reducers/views/channel.js | 5 - .../__snapshots__/post_options.test.js.snap | 150 +++--------------- app/screens/post_options/index.js | 3 - app/screens/post_options/post_option.js | 2 - app/screens/post_options/post_options.js | 55 +++---- app/screens/post_options/post_options.test.js | 2 - assets/base/i18n/en.json | 1 - assets/base/images/post_menu/bookmark.png | Bin 669 -> 0 bytes assets/base/images/post_menu/bookmark@2x.png | Bin 840 -> 0 bytes assets/base/images/post_menu/bookmark@3x.png | Bin 1023 -> 0 bytes package-lock.json | 10 +- package.json | 2 +- packager/moduleNames.js | 1 - 13 files changed, 52 insertions(+), 179 deletions(-) delete mode 100755 assets/base/images/post_menu/bookmark.png delete mode 100755 assets/base/images/post_menu/bookmark@2x.png delete mode 100755 assets/base/images/post_menu/bookmark@3x.png diff --git a/app/reducers/views/channel.js b/app/reducers/views/channel.js index f9c771fbb..3ffce2343 100644 --- a/app/reducers/views/channel.js +++ b/app/reducers/views/channel.js @@ -348,11 +348,6 @@ function lastChannelViewTime(state = {}, action) { return state; } - case ChannelTypes.POST_UNREAD_SUCCESS: { - const data = action.data; - return {...state, [data.channelId]: data.lastViewedAt}; - } - default: return state; } diff --git a/app/screens/post_options/__snapshots__/post_options.test.js.snap b/app/screens/post_options/__snapshots__/post_options.test.js.snap index 596d208c3..7139754cc 100644 --- a/app/screens/post_options/__snapshots__/post_options.test.js.snap +++ b/app/screens/post_options/__snapshots__/post_options.test.js.snap @@ -10,8 +10,8 @@ exports[`PostOptions should match snapshot, no option for system message to user > - - - { - const {post, isLandscape, theme} = this.props; - const {formatMessage} = this.context.intl; + getMyPostOptions = () => { + const actions = [ + this.getEditOption(), + this.getReplyOption(), + this.getFlagOption(), + this.getPinOption(), + this.getAddReactionOption(), + this.getCopyPermalink(), + this.getCopyText(), + this.getDeleteOption(), + ]; - if (!isSystemMessage(post)) { - return ( - - ); - } - return null; + return actions.filter((a) => a !== null); }; - getPostOptions = () => { + getOthersPostOptions = () => { const actions = [ this.getReplyOption(), - this.getAddReactionOption(), - this.getMarkAsUnreadOption(), - this.getCopyPermalink(), this.getFlagOption(), - this.getCopyText(), + this.getAddReactionOption(), this.getPinOption(), + this.getCopyPermalink(), + this.getCopyText(), this.getEditOption(), this.getDeleteOption(), ]; @@ -262,6 +254,12 @@ export default class PostOptions extends PureComponent { return actions.filter((a) => a !== null); }; + getPostOptions = () => { + const {isMyPost} = this.props; + + return isMyPost ? this.getMyPostOptions() : this.getOthersPostOptions(); + }; + handleAddReaction = () => { const {theme} = this.props; const {formatMessage} = this.context.intl; @@ -326,15 +324,6 @@ export default class PostOptions extends PureComponent { }); }; - handleMarkUnread = () => { - const {actions, post, currentUserId} = this.props; - - this.closeWithAnimation(); - requestAnimationFrame(() => { - actions.setUnreadPost(currentUserId, post.id); - }); - } - handlePostDelete = () => { const {formatMessage} = this.context.intl; const {actions, post} = this.props; diff --git a/app/screens/post_options/post_options.test.js b/app/screens/post_options/post_options.test.js index d2e7e9a0a..6be5ab8e1 100644 --- a/app/screens/post_options/post_options.test.js +++ b/app/screens/post_options/post_options.test.js @@ -26,7 +26,6 @@ describe('PostOptions', () => { removePost: jest.fn(), unflagPost: jest.fn(), unpinPost: jest.fn(), - setUnreadPost: jest.fn(), }; const post = { @@ -47,7 +46,6 @@ describe('PostOptions', () => { canEditUntil: -1, channelIsReadOnly: false, currentTeamUrl: 'http://localhost:8065/team-name', - currentUserId: 'user1', deviceHeight: 600, hasBeenDeleted: false, isFlagged: false, diff --git a/assets/base/i18n/en.json b/assets/base/i18n/en.json index a99e0da2e..057487627 100644 --- a/assets/base/i18n/en.json +++ b/assets/base/i18n/en.json @@ -360,7 +360,6 @@ "mobile.post_info.add_reaction": "Add Reaction", "mobile.post_info.copy_text": "Copy Text", "mobile.post_info.flag": "Flag", - "mobile.post_info.mark_unread": "Mark post as unread", "mobile.post_info.pin": "Pin to Channel", "mobile.post_info.reply": "Reply", "mobile.post_info.unflag": "Unflag", diff --git a/assets/base/images/post_menu/bookmark.png b/assets/base/images/post_menu/bookmark.png deleted file mode 100755 index df28ccf585023660d36c68fbc856b8e87798703f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 669 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1mUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5lweBoc6VW5Skx99p8++E9*{(|oHa#_AOTwPVt>)LW zjJSfBY<9etw|IPF@}^Dh)75^-`df!=OS;x$y1nSD!Gr*VZ^D|(R&~Ul-WJo4K7R|3 z^0!+H9(!H8s-wB<*F~!f%bz@z($0_KS^e&f`MQ{pync}tUlJ^~KXwT7OgI-{>-Z`B zjd9^^E~dieaZ$D{3uiwt&+_o(_z-wJ&#d;+;+MTImL;q4mj7MqwSNDX|H7tu zQi~Ex@{6n#g0oXgk~0)c&GifwG%Sn_EG#q?bQLm6N(zdt^!1CuvU)&`3g4VIy#pGi t0yC^6vm_^#K>-dt{e$&Alk@ZRL-TmdLD diff --git a/assets/base/images/post_menu/bookmark@2x.png b/assets/base/images/post_menu/bookmark@2x.png deleted file mode 100755 index 7f1db30044eff1ac0edf28f247dfb121135eecf5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 840 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}tmUKs7M+SzC{oH>NS%G|oWRD45dJguM!v-tY$DUh!@P+6=(yLU`q0KcVS>y)vIg-4nJ$S8pEE{@e4Ktc8rPhVH|#~d;O+`4DBxh-K}VBF{F;usQf`0doQ+AN6@2kN!? zvQ^_(Z}G~FWLIx#E(+xP$0jabB=A&?ed&`WGBHz>PC34nf3SsJ^X8Us{5O(3Cr#CRAZI(GrT2g0w*hCom zNz3jAEo8`y`}#bHM=-HTwf0!sd(L??lUr9!(qziG^D17UH`Gcpb)L-WC!w>R%+ug( zF&FdMZSnN1CR0aY&xbQMicP;(Bp#cyU{Zddx%HQiM=ULE``lV2rt=g(^j%!#G1Vfs zu<2gNhrpvdUcR4@I=#pI{d=xt)-tvFPj@q1=lGaOzvcR_CZ6qQ{X6^WB7wDHYU1c{^%=>4QPF#5JNM zC9x#cD!C{XNHG{07+UHYSm+vAgczDx85&xdm}(msSQ!}X_gDf-g$NC~`6-!cmAEyW z6P4Kp)ZhrRp|~vFDmgzlH#M(>LBTyWFSRJKB)`Z?Avim=BsoLD)LhR{LBqn>z`{aP zL02K8q@tJHDlo%JGD~t&85H2a(?3|>GdVv`KQs^MkCfv5 S-YuX6&EVYAW?~aSX}0_jbnFY+*-<_W8NG zxjyz6%mfx5)93njVZVdRhgWMW1Ya+#dgZ$Ef#Vhpr3w+BjoaJ~>UiWR zU|aFZQ>dHGYqrT+-(#nP%yw^n{qEeGuv0eGC;iIQ{L{+r{oR;gAi=}ttfG_on&GBI z^3@-$9!?o^Jbx+i=Wg_wXj!Ui{tSy+B+;*4{3 z?+RHOw7lo#|31OQ{vzE{cA;aM1)oEwr`^tXN(W1iHGE@HU(#xG{*7zolOM^%?`gfTuOBDdtxb{aWivLMo1! zAO9)woMDCG(KYinO@ErYME#F+mHF?o4>FAl4w`0`@)eMa^sz6RI6 zbrqi<#%{VVveUzV#mj9gjLx1v`L0hzxS84HdT;ZDcYkvDQ@q7g>nsZ01$|w5i z;j|as@{Uew(|~E9S<&(z)6_>f;#))G9s|>)YKdz^NlIc#s#S7PDv)9@GBC8%HL%b% zvIsFWvobWaGBMRQFt9Q(*zd6flz9*ua`RI%(<*UmI43Hz4XD8pWJ7UTx>a(1Zftzq`@LI0`H;cW)z4*}Q$iB}!wQcy diff --git a/package-lock.json b/package-lock.json index 2020b0fa4..830ce926c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14133,8 +14133,8 @@ "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==" }, "mattermost-redux": { - "version": "github:mattermost/mattermost-redux#dc5f8c1f30cbc6a25d4304f2923f5b78e674099d", - "from": "github:mattermost/mattermost-redux#dc5f8c1f30cbc6a25d4304f2923f5b78e674099d", + "version": "github:mattermost/mattermost-redux#3bb89a5450b94da564d3a286fefb5945a1c3fca8", + "from": "github:mattermost/mattermost-redux#3bb89a5450b94da564d3a286fefb5945a1c3fca8", "requires": { "deep-equal": "1.0.1", "eslint-plugin-header": "3.0.0", @@ -14147,7 +14147,7 @@ "redux": "4.0.4", "redux-action-buffer": "1.2.0", "redux-batched-actions": "0.4.1", - "redux-offline": "git+https://github.com/enahum/redux-offline.git#885024de96b6ec73650c340c8928066585c413df", + "redux-offline": "git+https://github.com/enahum/redux-offline.git#4bd85e7e3b279a2b11fb4d587808d583d2b5e7b5", "redux-persist": "4.9.1", "redux-thunk": "2.3.0", "reselect": "4.0.0", @@ -17575,8 +17575,8 @@ } }, "redux-offline": { - "version": "git+https://github.com/enahum/redux-offline.git#885024de96b6ec73650c340c8928066585c413df", - "from": "git+https://github.com/enahum/redux-offline.git#885024de96b6ec73650c340c8928066585c413df", + "version": "git+https://github.com/enahum/redux-offline.git#4bd85e7e3b279a2b11fb4d587808d583d2b5e7b5", + "from": "git+https://github.com/enahum/redux-offline.git#4bd85e7e3b279a2b11fb4d587808d583d2b5e7b5", "requires": { "@react-native-community/netinfo": "^4.1.3", "redux-persist": "^4.5.0" diff --git a/package.json b/package.json index 7ef0ff97c..be2be758d 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "intl": "1.2.5", "jail-monkey": "2.2.0", "jsc-android": "241213.2.0", - "mattermost-redux": "github:mattermost/mattermost-redux#dc5f8c1f30cbc6a25d4304f2923f5b78e674099d", + "mattermost-redux": "github:mattermost/mattermost-redux#3bb89a5450b94da564d3a286fefb5945a1c3fca8", "mime-db": "1.40.0", "moment-timezone": "0.5.25", "prop-types": "15.7.2", diff --git a/packager/moduleNames.js b/packager/moduleNames.js index a7c0e11a1..9a92fb941 100644 --- a/packager/moduleNames.js +++ b/packager/moduleNames.js @@ -303,7 +303,6 @@ module.exports = [ 'dist/assets/images/icons/word.png', 'dist/assets/images/post_header/flag.png', 'dist/assets/images/post_header/pin.png', - 'dist/assets/images/post_header/bookmark.png', 'dist/assets/images/profile.jpg', 'dist/assets/images/status/away.png', 'dist/assets/images/status/dnd.png', From 1b168611749aac65dd78df546b3d96f5cf8b521d Mon Sep 17 00:00:00 2001 From: Michael Kochell Date: Fri, 11 Oct 2019 08:25:47 -0600 Subject: [PATCH 6/6] [MM-19243] Disable reactions on read only channel (#3404) --- app/components/reactions/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/components/reactions/index.js b/app/components/reactions/index.js index e778343b6..2ea6fe1a5 100644 --- a/app/components/reactions/index.js +++ b/app/components/reactions/index.js @@ -11,7 +11,7 @@ import {hasNewPermissions} from 'mattermost-redux/selectors/entities/general'; import Permissions from 'mattermost-redux/constants/permissions'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; -import {getChannel} from 'mattermost-redux/selectors/entities/channels'; +import {getChannel, isChannelReadOnlyById} from 'mattermost-redux/selectors/entities/channels'; import {addReaction} from 'app/actions/views/emoji'; @@ -25,10 +25,11 @@ function makeMapStateToProps() { const channel = getChannel(state, channelId) || {}; const teamId = channel.team_id; const channelIsArchived = channel.delete_at !== 0; + const channelIsReadOnly = isChannelReadOnlyById(state, channelId); let canAddReaction = true; let canRemoveReaction = true; - if (channelIsArchived) { + if (channelIsArchived || channelIsReadOnly) { canAddReaction = false; canRemoveReaction = false; } else if (hasNewPermissions(state)) {