How to use the topcoder-react-lib.actions.challenge function in topcoder-react-lib

To help you get started, we’ve selected a few topcoder-react-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github topcoder-platform / community-app / src / shared / containers / challenge-detail / index.jsx View on Github external
loadChallengeDetails: (tokens, challengeId) => {
      const a = actions.challenge;
      dispatch(a.getDetailsInit(challengeId));
      dispatch(a.getDetailsDone(challengeId, tokens.tokenV3, tokens.tokenV2))
        .then((res) => {
          const ch = res.payload;
          if (ch.track === 'DESIGN') {
            const p = ch.allPhases
              .filter(x => x.phaseType === 'Checkpoint Review');
            if (p.length && p[0].phaseStatus === 'Closed') {
              dispatch(a.fetchCheckpointsInit());
              dispatch(a.fetchCheckpointsDone(tokens.tokenV2, challengeId));
            } else dispatch(a.dropCheckpoints());
          } else dispatch(a.dropCheckpoints());
          if (ch.status === 'COMPLETED') {
            dispatch(a.loadResultsInit(challengeId));
            dispatch(a.loadResultsDone(tokens, challengeId, ch.track.toLowerCase()));
          } else dispatch(a.dropResults());
github topcoder-platform / community-app / src / shared / containers / SubmissionManagement / index.jsx View on Github external
loadMySubmissions: (tokens, challengeId) => {
    const a = actions.challenge;
    dispatch(a.getSubmissionsInit(challengeId));
    dispatch(a.getSubmissionsDone(challengeId, tokens.tokenV2));
  },
});
github topcoder-platform / community-app / src / shared / containers / challenge-detail / index.jsx View on Github external
registerForChallenge: (auth, challengeId) => {
      const a = actions.challenge;
      dispatch(a.registerInit());
      dispatch(a.registerDone(auth, challengeId));
    },
    reloadChallengeDetails: (tokens, challengeId) => {
github topcoder-platform / community-app / src / shared / containers / Settings.jsx View on Github external
const loadHeaderData = ({ handle, tokenV3 }) => {
    dispatch(profileActions.loadProfile(handle));
    dispatch(profileActions.getAchievementsInit());
    dispatch(actions.challenge.getActiveChallengesCountInit());
    dispatch(profileActions.getAchievementsDone(handle));
    dispatch(actions.challenge.getActiveChallengesCountDone(handle, tokenV3));
  };
github topcoder-platform / community-app / src / shared / containers / Dashboard / index.jsx View on Github external
unregisterFromChallenge: (auth, challengeId) => {
      const a = actions.challenge;
      dispatch(a.unregisterInit());
      dispatch(a.unregisterDone(auth, challengeId));
    },
  };
github topcoder-platform / community-app / src / shared / containers / Settings.jsx View on Github external
const loadHeaderData = ({ handle, tokenV3 }) => {
    dispatch(profileActions.loadProfile(handle));
    dispatch(profileActions.getAchievementsInit());
    dispatch(actions.challenge.getActiveChallengesCountInit());
    dispatch(profileActions.getAchievementsDone(handle));
    dispatch(actions.challenge.getActiveChallengesCountDone(handle, tokenV3));
  };
github topcoder-platform / community-app / src / shared / containers / SubmissionManagement / index.jsx View on Github external
loadChallengeDetails: (tokens, challengeId) => {
    const a = actions.challenge;
    dispatch(a.getDetailsInit(challengeId));
    dispatch(a.getDetailsDone(challengeId, tokens.tokenV3, tokens.tokenV2));
  },
github topcoder-platform / community-app / src / shared / actions / challenge.js View on Github external
CHALLENGE_FORUM: 'challenge_forum',
};

/**
 * Toggles checkpoint feedback. If second argument is provided, it
 * will just open / close the checkpoint depending on its value being
 * true or false.
 * @param {Number} id
 * @param {Boolean} open
 * @return {Object}
 */
function toggleCheckpointFeedback(id, open) {
  return { id, open };
}

export default _.merge({ challenge: actions.challenge }, createActions({
  CHALLENGE: {
    SELECT_TAB: _.identity,
    TOGGLE_CHECKPOINT_FEEDBACK: toggleCheckpointFeedback,
  },
}));