Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Hotfix - Remove old legacy.track#224

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
luizrrodrigues wants to merge6 commits intointegration-v5-challenge-api
base:integration-v5-challenge-api
Choose a base branch
Loading
fromissue-4757
Open
Show file tree
Hide file tree
Changes fromall 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
2 changes: 1 addition & 1 deletionpackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,7 +31,7 @@
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
"test": "npm run lint && npm run jest"
},
"version": "1000.19.44",
"version": "1000.19.45",
"dependencies": {
"auth0-js": "^6.8.4",
"config": "^3.2.0",
Expand Down
6 changes: 4 additions & 2 deletionssrc/reducers/challenge.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,8 @@ import { fireErrorMessage } from '../utils/errors';

import mySubmissionsManagement from './my-submissions-management';

import { COMPETITION_TRACKS } from '../utils/tc';

/**
* Handles CHALLENGE/GET_DETAILS_INIT action.
* @param {Object} state
Expand DownExpand Up@@ -467,9 +469,9 @@ export function factory(options = {}) {
tokens.tokenV2,
)).then((res) => {
const challengeDetails = _.get(res, 'payload', {});
const track = _.get(challengeDetails, 'legacy.track', '');
const track = _.get(challengeDetails, 'track', '');
let checkpointsPromise = null;
if (track ==='DESIGN') {
if (track ===COMPETITION_TRACKS.DESIGN) {
const p = _.get(challengeDetails, 'phases', [])
.filter(x => x.name === 'Checkpoint Review');
if (p.length && !p[0].isOpen) {
Expand Down
6 changes: 3 additions & 3 deletionssrc/services/challenges.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -59,7 +59,7 @@ export function normalizeChallenge(challenge, username) {
}
const prizes = (challenge.prizeSets[0] && challenge.prizeSets[0].prizes) || [];
_.defaults(challenge, {
communities: new Set([COMPETITION_TRACKS[challenge.legacy.track]]),
communities: new Set([COMPETITION_TRACKS[challenge.track]]),
groups,
registrationOpen,
submissionEndTimestamp,
Expand DownExpand Up@@ -636,7 +636,7 @@ class ChallengesService {
let contentType;
let url;

if (track ==='DESIGN') {
if (track ===COMPETITION_TRACKS.DESIGN) {
({ api } = this.private);
contentType = 'application/json';
url = '/submissions/'; // The submission info is contained entirely in the JSON body
Expand All@@ -654,7 +654,7 @@ class ChallengesService {
}, onProgress).then((res) => {
const jres = JSON.parse(res);
// Return result for Develop submission
if (track ==='DEVELOP') {
if (track ===COMPETITION_TRACKS.DEVELOP) {
return jres;
}
// Design Submission requires an extra "Processing" POST
Expand Down
8 changes: 5 additions & 3 deletionssrc/services/members.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@
/* global XMLHttpRequest */
import _ from 'lodash';
import qs from 'qs';
import { decodeToken } from 'tc-accounts';
import logger from '../utils/logger';
import { getApiResponsePayload } from '../utils/tc';
import { getApi } from './api';
Expand DownExpand Up@@ -329,7 +330,8 @@ class MembersService {
* @param {Array} challengeId the challenge id
*/
async getChallengeResources(challengeId) {
const url = `/resources?challengeId=${challengeId}`;
const user = decodeToken(this.private.tokenV3);
const url = `/resources?challengeId=${challengeId}&memberId=${user.userId}`;
let res = null;

try {
Expand All@@ -346,14 +348,14 @@ class MembersService {
* @param {Array} memberId the member id
*/
async getUserResources(memberId) {
const url = `/resources/${memberId}/challenges`;
const url = `/challenges?status=Active&memberId=${memberId}`;
const res = await this.private.apiV5.get(url);
const challenges = await res.json();
const roles = await this.getResourceRoles();
const calls = [];

challenges.forEach(async (ch) => {
calls.push(this.getChallengeResources(ch));
calls.push(this.getChallengeResources(ch.id));
});

return Promise.all(calls).then((resources) => {
Expand Down
2 changes: 1 addition & 1 deletionsrc/utils/challenge/filter.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -89,7 +89,7 @@ function filterByRegistrationOpen(challenge, state) {
if (!registrationPhase || !registrationPhase.isOpen) {
return false;
}
if (challenge.track ==='DESIGN') {
if (challenge.track ===COMPETITION_TRACKS.DESIGN) {
const checkpointPhase = challengePhases.find(item => item.name === 'Checkpoint Submission')[0];
return !checkpointPhase || !checkpointPhase.isOpen;
}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp