Skip to content

Commit bdac00a

Browse files
authoredDec 14, 2022
Merge pull request #6752 from topcoder-platform/PROD_3279_sprig_challenge_survey
Prod 3279 sprig challenge survey
2 parents 6dbbb6c + ae06609 commit bdac00a

File tree

4 files changed

+46
-30
lines changed

4 files changed

+46
-30
lines changed
 

‎config/default.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,4 +471,6 @@ module.exports = {
471471
FETCHING_PENDING_APPROVAL_EVENTS_INTERVAL: 5 * 60 * 1000, // 5 minutes
472472
FORUM_LINK: 'https://discussions.topcoder.com/discussion/24281/add-your-memory-to-the-topcoder-timeline-wall',
473473
},
474+
/* development id - makes surveys have warning about environment */
475+
SPRIG_ENVIRONMENT_ID: 'bUcousVQ0-yF',
474476
};

‎package-lock.json

Lines changed: 35 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"dependencies": {
3939
"@hapi/joi": "^16.1.4",
4040
"@optimizely/react-sdk": "^2.5.0",
41+
"@sprig-technologies/sprig-browser": "^2.20.1",
4142
"@topcoder-platform/tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.4",
4243
"aos": "^2.3.4",
4344
"atob": "^2.1.1",

‎src/shared/containers/SubmissionPage.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99
import actions from 'actions/page/submission';
1010
import { actions as api } from 'topcoder-react-lib';
11+
import { config } from 'topcoder-react-utils';
1112
import { isMM } from 'utils/challenge';
1213
import communityActions from 'actions/tc-communities';
1314
import { PrimaryButton } from 'topcoder-react-ui-kit';
@@ -18,6 +19,11 @@ import { connect } from 'react-redux';
1819
import SubmissionsPage from 'components/SubmissionPage';
1920
import AccessDenied, { CAUSE as ACCESS_DENIED_REASON } from 'components/tc-communities/AccessDenied';
2021
import LoadingIndicator from 'components/LoadingIndicator';
22+
import { sprig } from '@sprig-technologies/sprig-browser';
23+
24+
export const Sprig = sprig.configure({
25+
environmentId: config.SPRIG_ENVIRONMENT_ID,
26+
});
2127

2228
/**
2329
* SubmissionsPage Container
@@ -65,6 +71,8 @@ class SubmissionsPageContainer extends React.Component {
6571
track,
6672
} = this.props;
6773

74+
// On final upload, the survey should appear
75+
Sprig('track', 'onUploadSubmission');
6876
submit(tokenV3, tokenV2, challengeId, body, isMM(challenge) ? 'DEVELOP' : track);
6977
}
7078

0 commit comments

Comments
 (0)
Please sign in to comment.