Skip to content

Commit 7f0a4fc

Browse files
committed
Support for upload type for PM-5516
1 parent abf00e7 commit 7f0a4fc

13 files changed

Lines changed: 541 additions & 22 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ Refer to the verification document `Verification.md`
312312
- Manage attachments: `POST /v6/challenges/{id}/attachments`, `DELETE /v6/challenges/{id}/attachments/{attachmentId}`. See `work-manager/src/services/challenges.js`.
313313
- Default reviewers: `GET /v6/challenge/default-reviewers?typeId&trackId`. See `work-manager/src/services/challenges.js`.
314314
- Challenge metadata: `GET /v6/challenge-types`, `GET /v6/challenge-tracks`, `GET /v6/challenge-phases`, `GET /v6/challenge-timelines`. See `work-manager/src/services/challenges.js` and config under `work-manager/config/constants/*`.
315+
- Challenge `metadata` may include `submission_type` to override the community-app submission flow:
316+
`zip` shows the standard Topcoder zip upload page, and `url` shows the Topgear URL upload page.
317+
When omitted, consumers should keep their existing default behavior.
315318
- API base configuration points to v6 in dev/local and v5 in prod (for compatibility):
316319
- Dev: `work-manager/config/constants/development.js`.
317320
- Local: `work-manager/config/constants/local.js`.

app-routes.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ function hasInteractiveRoles(authUser) {
2828
* Read the scope claim from an auth user.
2929
*
3030
* The shared authenticator normally copies Auth0's `scope` string into
31-
* `scopes`, but this also handles callers already carrying either shape.
31+
* `scopes`, but this also handles callers already carrying either shape or
32+
* Auth0 RBAC `permissions`.
3233
*
3334
* @param {Object} authUser the decoded auth user from the authenticator
3435
* @returns {Array|String|undefined} scopes from the token
@@ -39,6 +40,7 @@ function getAuthUserScopes(authUser) {
3940
}
4041
return (
4142
authUser.scopes ||
43+
authUser.permissions ||
4244
_.find(authUser, (value, key) => {
4345
return key.indexOf("scope") !== -1;
4446
})

docs/swagger.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,10 +2585,10 @@ definitions:
25852585
properties:
25862586
name:
25872587
type: string
2588-
description: The sample metadata type
2588+
description: Metadata name. Use submission_type to override the challenge submission flow.
25892589
value:
25902590
type: string
2591-
description: The sample metadata value
2591+
description: Metadata value. For submission_type, supported values are zip and url.
25922592
required:
25932593
- name
25942594
- value
@@ -2871,10 +2871,10 @@ definitions:
28712871
properties:
28722872
name:
28732873
type: string
2874-
description: The sample metadata type
2874+
description: Metadata name. Use submission_type to override the challenge submission flow.
28752875
value:
28762876
type: string
2877-
description: The sample metadata value
2877+
description: Metadata value. For submission_type, supported values are zip and url.
28782878
required:
28792879
- name
28802880
- value
@@ -3042,10 +3042,10 @@ definitions:
30423042
properties:
30433043
name:
30443044
type: string
3045-
description: The sample metadata type
3045+
description: Metadata name. Use submission_type to override the challenge submission flow.
30463046
value:
30473047
type: string
3048-
description: The sample metadata value
3048+
description: Metadata value. For submission_type, supported values are zip and url.
30493049
required:
30503050
- name
30513051
- value
@@ -3258,10 +3258,10 @@ definitions:
32583258
properties:
32593259
name:
32603260
type: string
3261-
description: The sample metadata type
3261+
description: Metadata name. Use submission_type to override the challenge submission flow.
32623262
value:
32633263
type: string
3264-
description: The sample metadata value
3264+
description: Metadata value. For submission_type, supported values are zip and url.
32653265
required:
32663266
- name
32673267
- value

packages/challenge-prisma-client/edge.js

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

packages/challenge-prisma-client/index-browser.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ exports.Prisma.ChallengeScalarFieldEnum = {
152152
endDate: 'endDate',
153153
legacyId: 'legacyId',
154154
status: 'status',
155+
approvalStatus: 'approvalStatus',
156+
approvalRejectionReason: 'approvalRejectionReason',
157+
approvalApprovedBy: 'approvalApprovedBy',
155158
createdAt: 'createdAt',
156159
createdBy: 'createdBy',
157160
updatedAt: 'updatedAt',
@@ -520,6 +523,8 @@ exports.Prisma.ChallengeOrderByRelevanceFieldEnum = {
520523
tags: 'tags',
521524
groups: 'groups',
522525
taskMemberId: 'taskMemberId',
526+
approvalRejectionReason: 'approvalRejectionReason',
527+
approvalApprovedBy: 'approvalApprovedBy',
523528
createdBy: 'createdBy',
524529
updatedBy: 'updatedBy'
525530
};
@@ -772,6 +777,12 @@ exports.ChallengeStatusEnum = exports.$Enums.ChallengeStatusEnum = {
772777
CANCELLED_PAYMENT_FAILED: 'CANCELLED_PAYMENT_FAILED'
773778
};
774779

780+
exports.ChallengeApprovalStatusEnum = exports.$Enums.ChallengeApprovalStatusEnum = {
781+
PENDING_APPROVAL: 'PENDING_APPROVAL',
782+
APPROVED: 'APPROVED',
783+
REJECTED: 'REJECTED'
784+
};
785+
775786
exports.ChallengeTrackEnum = exports.$Enums.ChallengeTrackEnum = {
776787
DESIGN: 'DESIGN',
777788
DATA_SCIENCE: 'DATA_SCIENCE',

0 commit comments

Comments
 (0)