Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated sprig for dev testing using events #6750

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 35 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 7 additions & 1 deletion src/shared/containers/SubmissionPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to use the sdk, you can do sprig.track('onUploadSubmission').

You might also consider adding the user info to the events.

https://github.com/topcoder-platform/platform-ui/blob/TCA-790_assessments/src-ts/lib/functions/survey-functions/survey.functions.ts

submit(tokenV3, tokenV2, challengeId, body, isMM(challenge) ? 'DEVELOP' : track);
}

Expand Down