Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions src/apps/work/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export const CHALLENGE_STATUS = {
NEW: 'NEW',
} as const

export const CHALLENGE_APPROVAL_STATUS = {
APPROVED: 'APPROVED',
PENDING_APPROVAL: 'PENDING_APPROVAL',
REJECTED: 'REJECTED',
} as const

export const PAGE_SIZE = 10

export const PAGINATION_PER_PAGE_OPTIONS: ReadonlyArray<number> = [5, 10, 20, 25, 50]
Expand Down
3 changes: 3 additions & 0 deletions src/apps/work/src/lib/models/Challenge.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export interface ChallengeTerm {

export interface Challenge {
id: string
approvalApprovedBy?: string
approvalRejectionReason?: string
approvalStatus?: string
assignedMemberId?: string
attachments?: Attachment[]
billing?: {
Expand Down
15 changes: 15 additions & 0 deletions src/apps/work/src/lib/utils/challenge-editor.utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable complexity */
import {
DESIGN_WORK_TYPES,
PHASE_DURATION_MAX_HOURS,
Expand All @@ -8,6 +9,7 @@ import {
SKILLS_OPTIONAL_BILLING_ACCOUNT_IDS,
} from '../constants/challenge-editor.constants'
import {
CHALLENGE_APPROVAL_STATUS,
CHALLENGE_STATUS,
} from '../constants'
import {
Expand Down Expand Up @@ -1002,13 +1004,19 @@ export function transformChallengeToFormData(
const isTask = normalizeOptionalBoolean(challenge?.task?.isTask) || false
const status = normalizeOptionalString(challenge?.status)
?.toUpperCase()
const approvalStatus = normalizeOptionalString(challenge?.approvalStatus)
?.toUpperCase()
const billing = normalizeBillingInfo(challenge?.billing)
const normalizedPrizeSets = normalizePrizeSets(challenge?.prizeSets)
const prizeSetsForForm = challenge?.id && status !== CHALLENGE_STATUS.NEW
? normalizedPrizeSets
: ensurePlacementPrizeSet(normalizedPrizeSets)

return {
approvalApprovedBy: normalizeStringValue(challenge?.approvalApprovedBy) || undefined,
approvalRejectionReason: normalizeStringValue(challenge?.approvalRejectionReason) || undefined,
approvalStatus: approvalStatus
|| CHALLENGE_APPROVAL_STATUS.PENDING_APPROVAL,
assignedMemberId: getChallengeAssignedMemberSelectorValue(challenge),
attachments: normalizeAttachments(challenge?.attachments),
billing,
Expand Down Expand Up @@ -1074,6 +1082,8 @@ export function transformFormDataToChallenge(
const reviewType = normalizeReviewType(formData.legacy?.reviewType) || REVIEW_TYPES.INTERNAL
const status = normalizeOptionalString(formData.status)
?.toUpperCase()
const approvalStatus = normalizeOptionalString(formData.approvalStatus)
?.toUpperCase()
const billing = normalizeBillingInfo(formData.billing)
const prizeSets = formData.funChallenge === true
? []
Expand All @@ -1084,6 +1094,11 @@ export function transformFormDataToChallenge(
)

const challenge: Partial<Challenge> = {
approvalApprovedBy: normalizeOptionalString(formData.approvalApprovedBy)
|| undefined,
approvalRejectionReason: normalizeOptionalString(formData.approvalRejectionReason)
|| undefined,
approvalStatus: approvalStatus || CHALLENGE_APPROVAL_STATUS.PENDING_APPROVAL,
assignedMemberId: normalizeMemberSelectorValue(formData.assignedMemberId),
billing,
challengeFee: normalizeOptionalNumber(formData.challengeFee),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,11 @@ function renderLaunchModal(params: RenderLaunchModalParams): JSX.Element | undef
confirmText={params.isLaunching
? 'Launching...'
: 'Launch'}
message={`Are you ready to launch challenge ${params.challengeName}?`}
message={
`Are you ready to launch challenge ${params.challengeName}?

Prizes and copilot fees are locked after launch. Contact the Project Manager for any updates post-launch.`
}
onCancel={params.onLaunchCancel}
onConfirm={params.onLaunchConfirmClick}
title='Launch Challenge'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,56 @@
width: 100%;
}

.approvalSection {
border: 1px solid $black-20;
border-radius: 8px;
display: flex;
flex-direction: column;
gap: 10px;
max-width: 100%;
padding: 14px;
}

.approvalStatusRow {
align-items: center;
display: flex;
gap: 8px;
}

.approvalStatusLabel {
color: $black-80;
font-size: 14px;
font-weight: 700;
}

.approvalStatusValue {
color: $black-100;
font-size: 14px;
font-weight: 600;
}

.approvalReason {
color: $black-80;
font-size: 13px;
line-height: 1.4;
}

.rejectionReasonInput {
border: 1px solid $black-20;
border-radius: 6px;
font-family: inherit;
font-size: 13px;
min-height: 72px;
padding: 8px 10px;
resize: vertical;
}

.approvalActions {
display: flex;
flex-wrap: wrap;
gap: 10px;
}

@media (min-width: 1024px) {
.submissionSettingsGrid {
grid-template-columns: repeat(2, minmax(0, 1fr));
Expand Down
Loading
Loading