From b50483bf5303ed4bcabffac67863a8c4ad7a7e63 Mon Sep 17 00:00:00 2001 From: Adam Meikle Date: Thu, 8 Dec 2022 15:03:03 -0500 Subject: [PATCH 1/3] added sprig to onsubmit event --- package-lock.json | 65 +++++++++++++----------- package.json | 1 + src/shared/containers/SubmissionPage.jsx | 8 ++- 3 files changed, 43 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index ec92a7db4e..9b9faf6296 100644 --- a/package-lock.json +++ b/package-lock.json @@ -703,14 +703,14 @@ "dev": true }, "@babel/register": { - "version": "7.16.9", - "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.16.9.tgz", - "integrity": "sha512-jJ72wcghdRIlENfvALcyODhNoGE5j75cYHdC+aQMh6cU/P86tiiXTp9XYZct1UxUMo/4+BgQRyNZEGx0KWGS+g==", + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.18.9.tgz", + "integrity": "sha512-ZlbnXDcNYHMR25ITwwNKT88JiaukkdVj/nG7r3wnuXkOTHc60Uy05PwMCPre0hSkY68E6zK3xz+vUJSP2jWmcw==", "requires": { "clone-deep": "4.0.1", "find-cache-dir": "2.1.0", "make-dir": "2.1.0", - "pirates": "4.0.4", + "pirates": "4.0.5", "source-map-support": "0.5.21" }, "dependencies": { @@ -1466,6 +1466,11 @@ "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==" }, + "@sprig-technologies/sprig-browser": { + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/@sprig-technologies/sprig-browser/-/sprig-browser-2.20.1.tgz", + "integrity": "sha512-Qkt1yEhSz9FIXpDMjMzWklscF0HmKCmLebYDvVpJxqbEeYzCEQjzeD4WW5RTpvCgyuwzXT0At4Xx9UijCWAS8Q==" + }, "@tanem/svg-injector": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@tanem/svg-injector/-/svg-injector-1.2.1.tgz", @@ -2431,14 +2436,14 @@ "integrity": "sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg==" }, "auth0-js": { - "version": "9.18.1", - "resolved": "https://registry.npmjs.org/auth0-js/-/auth0-js-9.18.1.tgz", - "integrity": "sha512-inGWJ11k7+si/B0LJjip8GUQXhfVWN/Ne3IOtmnTJTKDpiXiq+lDFz6y04jaFyOEmvpmn7Gp6SmawTGtoFVJQw==", + "version": "9.19.2", + "resolved": "https://registry.npmjs.org/auth0-js/-/auth0-js-9.19.2.tgz", + "integrity": "sha512-4IPAbD0E/vYl+eN3rAoA9/4zq8Yg0tbsCQL/fKJsjh0l2rKNu0GWortNcRxmS62nHPt9LXKdMtTKU0x2UQVWsQ==", "requires": { "base64-js": "1.5.1", "idtoken-verifier": "2.2.2", "js-cookie": "2.2.1", - "qs": "6.10.3", + "qs": "6.11.0", "superagent": "5.3.1", "url-join": "4.0.1", "winchan": "0.2.2" @@ -2450,9 +2455,9 @@ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" }, "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { "ms": "2.1.2" } @@ -2476,14 +2481,14 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==" + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==" }, "qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "requires": { "side-channel": "1.0.4" } @@ -2499,9 +2504,9 @@ } }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "requires": { "lru-cache": "6.0.0" } @@ -2513,7 +2518,7 @@ "requires": { "call-bind": "1.0.2", "get-intrinsic": "1.1.1", - "object-inspect": "1.12.0" + "object-inspect": "1.12.2" } }, "superagent": { @@ -2523,15 +2528,15 @@ "requires": { "component-emitter": "1.3.0", "cookiejar": "2.1.2", - "debug": "4.3.3", + "debug": "4.3.4", "fast-safe-stringify": "2.1.1", "form-data": "3.0.0", "formidable": "1.2.2", "methods": "1.1.2", "mime": "2.6.0", - "qs": "6.10.3", + "qs": "6.11.0", "readable-stream": "3.6.0", - "semver": "7.3.5" + "semver": "7.3.8" } }, "yallist": { @@ -15327,7 +15332,7 @@ "resolved": "https://registry.npmjs.org/topcoder-react-utils/-/topcoder-react-utils-0.7.9.tgz", "integrity": "sha512-bH5t7lVTezl3rh2S1pguMWhUlJb39gOLLkCG9jwLCsMKTzri+LsOvpRJ6dOvYZPzA7GdmCgQNeGAoctiqAGb4g==", "requires": { - "@babel/register": "7.16.9", + "@babel/register": "7.18.9", "@babel/runtime": "7.9.6", "body-parser": "1.19.0", "command-line-args": "5.1.1", @@ -15428,7 +15433,7 @@ "resolved": "https://registry.npmjs.org/topcoder-react-utils/-/topcoder-react-utils-0.7.9.tgz", "integrity": "sha512-bH5t7lVTezl3rh2S1pguMWhUlJb39gOLLkCG9jwLCsMKTzri+LsOvpRJ6dOvYZPzA7GdmCgQNeGAoctiqAGb4g==", "requires": { - "@babel/register": "7.16.9", + "@babel/register": "7.18.9", "@babel/runtime": "7.9.6", "body-parser": "1.19.0", "command-line-args": "5.1.1", @@ -16571,9 +16576,9 @@ } }, "pirates": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.4.tgz", - "integrity": "sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw==" + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", + "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==" }, "pixelmatch": { "version": "4.0.2", @@ -23293,7 +23298,7 @@ "tc-core-library-js": { "version": "github:appirio-tech/tc-core-library-js#f45352974dafe5a10c86fc50bdd59ef399b50c65", "requires": { - "auth0-js": "9.18.1", + "auth0-js": "9.19.2", "axios": "0.19.2", "bunyan": "1.8.15", "jsonwebtoken": "8.5.1", diff --git a/package.json b/package.json index 30b2efa674..6dbd7ebe2e 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "dependencies": { "@hapi/joi": "^16.1.4", "@optimizely/react-sdk": "^2.5.0", + "@sprig-technologies/sprig-browser": "^2.20.1", "@topcoder-platform/tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.4", "aos": "^2.3.4", "atob": "^2.1.1", diff --git a/src/shared/containers/SubmissionPage.jsx b/src/shared/containers/SubmissionPage.jsx index 80579b39ab..dc0521f684 100644 --- a/src/shared/containers/SubmissionPage.jsx +++ b/src/shared/containers/SubmissionPage.jsx @@ -18,6 +18,11 @@ import { connect } from 'react-redux'; import SubmissionsPage from 'components/SubmissionPage'; import AccessDenied, { CAUSE as ACCESS_DENIED_REASON } from 'components/tc-communities/AccessDenied'; import LoadingIndicator from 'components/LoadingIndicator'; +import { sprig } from '@sprig-technologies/sprig-browser'; + +export const Sprig = sprig.configure({ + environmentId: 'bUcousVQ0-yF', +}); /** * SubmissionsPage Container @@ -64,7 +69,8 @@ class SubmissionsPageContainer extends React.Component { challenge, track, } = this.props; - + // When the user is waiting for their submission to upload, the survey should appear + Sprig('track', 'onUploadSubmission'); submit(tokenV3, tokenV2, challengeId, body, isMM(challenge) ? 'DEVELOP' : track); } From a9074b9be5935622fde337ea928ba202a8c5355e Mon Sep 17 00:00:00 2001 From: Adam Meikle Date: Thu, 8 Dec 2022 15:06:52 -0500 Subject: [PATCH 2/3] fixed trailing space --- src/shared/containers/SubmissionPage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/containers/SubmissionPage.jsx b/src/shared/containers/SubmissionPage.jsx index dc0521f684..f272bd97b3 100644 --- a/src/shared/containers/SubmissionPage.jsx +++ b/src/shared/containers/SubmissionPage.jsx @@ -70,7 +70,7 @@ class SubmissionsPageContainer extends React.Component { track, } = this.props; // When the user is waiting for their submission to upload, the survey should appear - Sprig('track', 'onUploadSubmission'); + Sprig('track', 'onUploadSubmission'); submit(tokenV3, tokenV2, challengeId, body, isMM(challenge) ? 'DEVELOP' : track); } From 361d53cca1058a77c5b62344d454991e44c422b5 Mon Sep 17 00:00:00 2001 From: Luiz Ricardo Rodrigues Date: Thu, 8 Dec 2022 18:57:32 -0300 Subject: [PATCH 3/3] ci: deploy PROD_3279_2_add_sprig_on_submit to Dev env --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 959e467625..f58488e445 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -349,7 +349,7 @@ workflows: filters: branches: only: - - TCA-539_tca-certifications-update-badges + - PROD_3279_2_add_sprig_on_submit # This is alternate dev env for parallel testing - "build-test": context : org-global