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
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@
z-index: 20;
}

.cancelMenuStart {
left: 0;
right: auto;
}

.cancelMenuItem {
background: transparent;
border: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,8 @@ describe('ChallengeEditorPage', () => {
})
expect(cancelStatusOption)
.toBeTruthy()
expect(cancelStatusOption.parentElement?.className)
.toContain('cancelMenuStart')
expect(screen.getByText('Challenge Editor Form'))
.toBeTruthy()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
useNavigate,
useParams,
} from 'react-router-dom'
import classNames from 'classnames'

import { PageWrapper } from '~/apps/review/src/lib'
import {
Expand Down Expand Up @@ -472,6 +473,7 @@ function getChallengesListPath(projectId?: string): string {
interface CancelChallengeActionProps {
challengeId: string
challengeName: string
menuAlign?: 'end' | 'start'
onCancelled: () => void
}

Expand Down Expand Up @@ -584,7 +586,11 @@ const CancelChallengeAction: FC<CancelChallengeActionProps> = (
/>
{showCancelMenu
? (
<div className={styles.cancelMenu}>
<div
className={classNames(styles.cancelMenu, {
[styles.cancelMenuStart]: props.menuAlign === 'start',
})}
>
{CANCEL_CHALLENGE_STATUSES.map(status => (
<button
key={status}
Expand Down Expand Up @@ -1517,6 +1523,7 @@ export const ChallengeEditorPage: FC = () => {
<CancelChallengeAction
challengeId={challengeActionParams.challengeId}
challengeName={challengeActionParams.challengeName}
menuAlign='start'
onCancelled={challengeActionParams.onChallengeUpdated}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ The form uses `challengeBasicInfoSchema` from `src/apps/work/src/lib/schemas/cha
- After the initial create request succeeds on the `/projects/:projectId/challenges/new` route, the
page header immediately treats that record as an existing `NEW` challenge so the status pill and
`Delete` action are available before the route transitions to the regular edit page.
- `Cancel` is shown on the details tab for existing `DRAFT` challenges on both view and edit routes, and for `ACTIVE` challenges while editing. Eligible edit routes use the same cancellation-status menu and confirmation flow in the header and footer; new or non-cancellable forms retain the footer action that returns to the challenge list.
- `Cancel` is shown on the details tab for existing `DRAFT` challenges on both view and edit routes, and for `ACTIVE` challenges while editing. Eligible edit routes use the same cancellation-status menu and confirmation flow in the header and footer; the footer menu opens toward the form so every status remains inside the viewport. New or non-cancellable forms retain the footer action that returns to the challenge list.
- `Mark Complete` is shown on the details tab for existing `ACTIVE` task challenges in both view and edit routes when exactly one assignee can be resolved from the challenge submitter resources. It mirrors the legacy work-manager flow by confirming the task prize and assignee, patching the challenge to `COMPLETED`, and saving that assignee as the sole winner. The button remains hidden for copilots assigned to their own task, and it reuses the same shared large secondary styling as `Cancel`.
- `Delete` is shown for ordinary challenges in `NEW` status. Persisted challenges with exact
`is_test_challenge=true` metadata can also be deleted from edit or read-only view routes after
Expand Down
Loading