Skip to content
Draft
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 @@ -222,7 +222,7 @@ export const CeremonyStep: React.FC<CeremonyStepProps> = ({
<WizardStyles.NextButton
color="info"
onClick={goNext}
disabled={isNextDisabled && !status.public_key}
disabled={isNextDisabled}
>
<ArrowForwardIosIcon />
{t("common.label.next")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {DownloadStep} from "./DownloadStep"
import {WizardStyles} from "@/components/styles/WizardStyles"
import {CheckStep} from "./CheckStep"
import {EElectionEventCeremoniesPolicy} from "@sequentech/ui-core"
import {canTrusteeProceedToDownload} from "./trusteeWizardState"

export const isTrusteeParticipating = (
ceremony: Sequent_Backend_Keys_Ceremony,
Expand Down Expand Up @@ -124,6 +125,7 @@ export const TrusteeWizard: React.FC<TrusteeWizardProps> = ({
EElectionEventCeremoniesPolicy.AUTOMATED_CEREMONIES &&
currentCeremony?.settings?.policy === EElectionEventCeremoniesPolicy.AUTOMATED_CEREMONIES

const canProceedToDownload = canTrusteeProceedToDownload(trusteeParticipating, keysGenerated)
return (
<WizardStyles.WizardWrapper>
<BreadCrumbSteps
Expand Down Expand Up @@ -175,11 +177,11 @@ export const TrusteeWizard: React.FC<TrusteeWizardProps> = ({
electionEvent={electionEvent}
goBack={goBack}
goNext={
currentStep === WizardStep.Not_Generated
currentStep === WizardStep.Not_Generated && trusteeParticipating
? () => setCurrentStep(WizardStep.Start)
: undefined
}
isNextDisabled={checkKeysGenerated() || isAutomaticCeremony}
isNextDisabled={!canProceedToDownload || isAutomaticCeremony}
message={
checkKeysGenerated() ? (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-FileCopyrightText: 2026 Sequent Tech Inc <legal@sequentech.io>
//
// SPDX-License-Identifier: AGPL-3.0-only

import {canTrusteeProceedToDownload} from "./trusteeWizardState"

describe("canTrusteeProceedToDownload", () => {
it("allows an invited trustee to proceed after key generation", () => {
expect(canTrusteeProceedToDownload(true, true)).toBe(true)
})

it("blocks an invited trustee while keys are not generated", () => {
expect(canTrusteeProceedToDownload(true, false)).toBe(false)
})

it("blocks a trustee who is not participating", () => {
expect(canTrusteeProceedToDownload(false, true)).toBe(false)
expect(canTrusteeProceedToDownload(false, false)).toBe(false)
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-FileCopyrightText: 2026 Sequent Tech Inc <legal@sequentech.io>
//
// SPDX-License-Identifier: AGPL-3.0-only

export const canTrusteeProceedToDownload = (
trusteeParticipating: boolean,
keysGenerated: boolean
): boolean => trusteeParticipating && keysGenerated
Loading