From 4cbc3d7664c727f3f2d52ad501c9c4ca35635889 Mon Sep 17 00:00:00 2001 From: Natalie <78037386+CuriousMagpie@users.noreply.github.com> Date: Tue, 16 Jan 2024 15:22:03 -0500 Subject: [PATCH] Slur swear blocker challenges redux (#15089) * update packages on local/origin repo * feat(challenges): add banned words & slur blocker to challenges * feat(challenges): slur blocker work * feat(challenges): slur blocker * feat(challenges): more slur blocker * feat(challenges): even more slur blocker * feat(challenges): swear and slur blocker * feat(challenges): update behavior based on public/private groups * feat(profiles): slur/swear blocker * feat(profiles): slur/swear blocker * feat(profiles/PMs): slur/swear blocker upgrade * feat(slur/swear): working on it * feat(profiles/challenges): work on profile block & slack report * feat(slur/swear blocker): work on Profiles * feat(slur blocker): refactoring code * feat(slur blocker): more refactoring * feat(slur blocker): arghhhhhh * fix(profiles): improve profanity check logic * fix(slack): update Slack notification to include authorEmail and remove undefined * feat(s/s blocker): work on challenges * feat(s/s blocker): challenge update * feat(s/s blocker): slack notifs refinements * feat(s/s blocker): refine slack notifs & disallow use of challenges POST API route if user is chatRevoked:true in db * update package.json and package-lock.json * attempt to disable create challenge button for muted users * another attempt to disable create challenge * block muted users from creating challenges * CSS button fun * fix CSS button * refactor(css): move button style to global Also, disable Clone button if user is chat revoked * fix(lint): remove unused fn * fix(challenges): handle null slur check * fix(groups): throw notFound earlier * fix(challenges): CSS and logic updates * fix(lint): remove whitespace * fix(challenges): don't disable create buttons * fix(slack): restore broken profile flag fields * chore(cleanup): remove comments and whitespace * chore(cleanup): one more white space --------- Co-authored-by: SabreCat --- package-lock.json | 20 +++--- package.json | 2 +- website/client/package-lock.json | 2 +- website/client/src/assets/scss/button.scss | 45 +++---------- .../components/challenges/challengeDetail.vue | 20 ++---- .../components/challenges/challengeModal.vue | 10 +-- .../components/challenges/findChallenges.vue | 21 +++--- .../components/challenges/myChallenges.vue | 17 +++-- website/client/src/components/groups/chat.vue | 1 + website/common/locales/en/challenge.json | 3 +- website/common/locales/en/groups.json | 3 + .../server/controllers/api-v3/challenges.js | 67 ++++++++++++++++++- website/server/libs/slack.js | 37 ++++++++++ website/server/libs/user/validation.js | 4 +- 14 files changed, 166 insertions(+), 86 deletions(-) diff --git a/package-lock.json b/package-lock.json index bfd138e615..c0d3404dff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2542,7 +2542,7 @@ "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=" }, "@types/jsonwebtoken": { "version": "8.5.9", @@ -4825,7 +4825,7 @@ "bin-pack": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bin-pack/-/bin-pack-1.0.2.tgz", - "integrity": "sha512-aOk0SxEon5LF9cMxQFViSKb4qccG6rs7XKyMXIb1J8f8LA2acTIWnHdT0IOTe4gYBbqgjdbuTZ5f+UP+vlh4Mw==" + "integrity": "sha1-wqAU7b8L7XCjKSBi7UZXe5YSBnk=" }, "bin-version": { "version": "3.1.0", @@ -10261,7 +10261,7 @@ "ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=" + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" }, "image-size": { "version": "1.0.2", @@ -11691,7 +11691,7 @@ "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, "lodash.includes": { @@ -12777,7 +12777,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" } } }, @@ -13144,7 +13144,7 @@ "nopt": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", "requires": { "abbrev": "1" } @@ -14209,7 +14209,7 @@ "pause": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", - "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" + "integrity": "sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg==" }, "pause-stream": { "version": "0.0.11", @@ -15363,7 +15363,7 @@ "secure-keys": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/secure-keys/-/secure-keys-1.0.0.tgz", - "integrity": "sha1-8MgtmKOxOah3aogIBQuCRDEIf8o=" + "integrity": "sha512-nZi59hW3Sl5P3+wOO89eHBAAGwmCPd2aE1+dLZV5MO+ItQctIvAqihzaAXIQhvtH4KJPxM080HsnqltR2y8cWg==" }, "seek-bzip": { "version": "1.0.5", @@ -15755,7 +15755,7 @@ "sliced": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", - "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" + "integrity": "sha512-VZBmZP8WU3sMOZm1bdgTadsQbcscK0UM8oKxKVBs4XAhUo2Xxzm/OFMGBkPusxw9xL3Uy8LrzEqGqJhclsr0yA==" }, "snapdragon": { "version": "0.8.2", @@ -16445,7 +16445,7 @@ "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==" + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" }, "strip-bom-stream": { "version": "1.0.0", diff --git a/package.json b/package.json index 8ba2962ce4..382de76f9f 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "client:unit": "cd website/client && npm run test:unit", "start": "gulp nodemon", "debug": "gulp nodemon --inspect", - "mongo:dev": "run-rs -v 4.1.1 -l ubuntu1804 --keep --dbpath mongodb-data --number 1 --quiet", + "mongo:dev": "run-rs -v 5.0.23 -l ubuntu1804 --keep --dbpath mongodb-data --number 1 --quiet", "postinstall": "git config --global url.\"https://\".insteadOf git:// && gulp build && cd website/client && npm install", "apidoc": "gulp apidoc" }, diff --git a/website/client/package-lock.json b/website/client/package-lock.json index fede38631d..7c76d89290 100644 --- a/website/client/package-lock.json +++ b/website/client/package-lock.json @@ -18076,7 +18076,7 @@ "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==" + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" }, "strip-eof": { "version": "1.0.0", diff --git a/website/client/src/assets/scss/button.scss b/website/client/src/assets/scss/button.scss index 5af924ae93..c45f9a8396 100644 --- a/website/client/src/assets/scss/button.scss +++ b/website/client/src/assets/scss/button.scss @@ -28,7 +28,15 @@ &:disabled, &.disabled { cursor: default; + color: $gray-50; opacity: 0.75; + box-shadow: 0 1px 3px 0 rgba(26, 24, 29, 0.12), 0 1px 2px 0 rgba(26, 24, 29, 0.24); + background-color: $gray-700; + border: 1px solid transparent; + + .svg { + color: $gray-300; + } } &.with-icon { @@ -77,16 +85,6 @@ } } - &:disabled, &.disabled { - background: $gray-700; - border: 1px solid transparent; - cursor: default; - color: $gray-50; - - --icon-color: #{$gray-300}; - } - - &.with-icon { .svg-icon.color { color: var(--icon-color); @@ -134,19 +132,12 @@ border: 1px solid transparent; --icon-color: #{$purple-300}; + .svg { + color: $purple-300; + } } } - &:disabled, &.disabled { - color: $gray-50; - background: $white; - border: 1px solid transparent; - cursor: default; - opacity: 0.75; - - --icon-color: #{$gray-300}; - } - &.with-icon { .svg-icon.color { color: var(--icon-color); @@ -181,13 +172,6 @@ background: $maroon-100; border: 1px solid transparent; } - - &:disabled, &.disabled { - background: $maroon-100; - border: 1px solid transparent; - cursor: default; - opacity: 0.75; - } } .btn-success { @@ -213,13 +197,6 @@ background: $green-50; border: 1px solid transparent; } - - &:disabled, &.disabled { - background: $green-50; - border: 1px solid transparent; - cursor: default; - opacity: 0.75; - } } .btn-info { diff --git a/website/client/src/components/challenges/challengeDetail.vue b/website/client/src/components/challenges/challengeDetail.vue index 2ef521ebda..12de0133b8 100644 --- a/website/client/src/components/challenges/challengeDetail.vue +++ b/website/client/src/components/challenges/challengeDetail.vue @@ -189,8 +189,9 @@
-