Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Results component doesn't render results #103

Open
selankon opened this issue Jul 18, 2023 · 1 comment
Open

Results component doesn't render results #103

selankon opened this issue Jul 18, 2023 · 1 comment
Assignees

Comments

@selankon
Copy link
Collaborator

selankon commented Jul 18, 2023

The chakra ui component of ElectionResult is not rendering properly the results for the current election mock.

Could be a component problem or a mock problem, research deeper to try to find the fix. Maybe is because is a weighted election?

Check ElectionResult https://github.com/vocdoni/ui-components/blob/main/packages/chakra-components/src/components/Election/Results.tsx

@selankon
Copy link
Collaborator Author

Using this mocked election doesn't work

const rawElection: IElectionInfoResponse = {
    electionId: "c5d2460186f76160b3c5c7dca349adba58d1a6f8a4024ae4c94a020800000000",
    organizationId: "6160b3c5c7dca349adba58d1a6f8a4024ae4c94a",
    status: ElectionStatus.RESULTS,
    startDate: "2023-06-06T08:03:07.576109833Z",
    endDate: "2023-06-06T18:04:03.122819665Z",
    voteCount: 10,
    finalResults: true,
    result: [
        ["0", "0", "10", "0"],
        ["0", "0", "0", "10"],
        ["10", "0", "0", "0"],
        ["0", "10", "0", "0"]
    ],
    census: {
        censusOrigin: CensusTypeEnum.OFF_CHAIN_TREE_WEIGHTED,
        censusRoot: "31755e98a4b7f6d0be2bb4071f05d45bbdb1c7871d37b1f93eb39d248d88ec9a",
        postRegisterCensusRoot: "",
        censusURL: "http://localhost:8080/census",
        // maxCensusSize: 12
    },
    metadataURL: "ipfs://bafybeid5fyvmt4fzpb4uz4mzxlrqjsj2uahwjkcy3zt2vi4glzu4ya5z2y",
    creationTime: "2023-06-06T08:02:49Z",
    voteMode: {
        serial: false,
        anonymous: false,
        encryptedVotes: false,
        uniqueValues: true,
        costFromWeight: false
    },
    electionMode: {
        autoStart: true,
        interruptible: true,
        dynamicCensus: false,
        encryptedMetaData: false,
        preRegister: false
    },
    tallyMode: {
        maxCount: 4,
        maxValue: 3,
        maxVoteOverwrites: 0,
        maxTotalCost: 0,
        costExponent: 10000
    },
    metadata: {
        title: {
            default: "Sort your 5 favorite blockchains 2023-06-06T18:02:53.562Z"
        },
        version: "1.1",
        description: {
            default: "Sort your 5 favorite blockchains"
        },
        media: {
            header: "https://source.unsplash.com/random",
            streamUri: "https://source.unsplash.com/random"
        },
        questions: [
            {
                choices: [
                    {
                        title: {
                            default: "Bitcoin"
                        },
                        value: 0
                    },
                    {
                        title: {
                            default: "Ethereum"
                        },
                        value: 1
                    },
                    {
                        title: {
                            default: "Monero"
                        },
                        value: 2
                    },
                    {
                        title: {
                            default: "Zcash"
                        },
                        value: 3
                    },
                    {
                        title: {
                            default: "Polkadot"
                        },
                        value: 4
                    }
                ],
                description: {
                    default: ""
                },
                title: {
                    default: "Favourite color"
                }
            }
        ],
        results: {
            aggregation: "discrete-counting",
            display: "multiple-question"
        }
    },
    electionCount: 0
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant