remove cost

This commit is contained in:
Sebastian 2022-06-03 15:54:52 -03:00
parent 8e9bca396e
commit 075903d4dd
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1
9 changed files with 1 additions and 45 deletions

View File

@ -45,7 +45,6 @@ export const OneUnsolvedPolicy = createExample(TestedComponent, {
policies: [[{ uuid: "1" }]], policies: [[{ uuid: "1" }]],
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "just go for it", instructions: "just go for it",
type: "question", type: "question",
uuid: "1", uuid: "1",
@ -60,19 +59,16 @@ export const SomePoliciesOneSolved = createExample(TestedComponent, {
policies: [[{ uuid: "1" }, { uuid: "2" }], [{ uuid: "uuid-3" }]], policies: [[{ uuid: "1" }, { uuid: "2" }], [{ uuid: "uuid-3" }]],
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "this question cost 1 USD", instructions: "this question cost 1 USD",
type: "question", type: "question",
uuid: "1", uuid: "1",
}, },
{ {
cost: "USD:0",
instructions: "answering this question is free", instructions: "answering this question is free",
type: "question", type: "question",
uuid: "2", uuid: "2",
}, },
{ {
cost: "USD:1",
instructions: "this question is already answered", instructions: "this question is already answered",
type: "question", type: "question",
uuid: "uuid-3", uuid: "uuid-3",
@ -92,7 +88,6 @@ export const OneBadConfiguredPolicy = createExample(TestedComponent, {
policies: [[{ uuid: "1" }, { uuid: "2" }]], policies: [[{ uuid: "1" }, { uuid: "2" }]],
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "this policy has a missing uuid (the other auth method)", instructions: "this policy has a missing uuid (the other auth method)",
type: "totp", type: "totp",
uuid: "1", uuid: "1",
@ -118,51 +113,43 @@ export const OnePolicyWithAllTheChallenges = createExample(TestedComponent, {
], ],
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "Does P equals NP?", instructions: "Does P equals NP?",
type: "question", type: "question",
uuid: "1", uuid: "1",
}, },
{ {
cost: "USD:1",
instructions: "SMS to 555-555", instructions: "SMS to 555-555",
type: "sms", type: "sms",
uuid: "2", uuid: "2",
}, },
{ {
cost: "USD:1",
instructions: "Email to qwe@asd.com", instructions: "Email to qwe@asd.com",
type: "email", type: "email",
uuid: "3", uuid: "3",
}, },
{ {
cost: "USD:1",
instructions: 'Enter 8 digits code for "Anastasis"', instructions: 'Enter 8 digits code for "Anastasis"',
type: "totp", type: "totp",
uuid: "4", uuid: "4",
}, },
{ {
// //
cost: "USD:0",
instructions: "Wire transfer from ASDXCVQWE123123 with holder Florian", instructions: "Wire transfer from ASDXCVQWE123123 with holder Florian",
type: "iban", type: "iban",
uuid: "5", uuid: "5",
}, },
{ {
cost: "USD:1",
instructions: "Join a video call", instructions: "Join a video call",
type: "video", //Enter 8 digits code for "Anastasis" type: "video", //Enter 8 digits code for "Anastasis"
uuid: "7", uuid: "7",
}, },
{}, {},
{ {
cost: "USD:1",
instructions: "Letter to address in postal code DE123123", instructions: "Letter to address in postal code DE123123",
type: "post", //Enter 8 digits code for "Anastasis" type: "post", //Enter 8 digits code for "Anastasis"
uuid: "8", uuid: "8",
}, },
{ {
cost: "USD:1",
instructions: "instruction for an unknown type of challenge", instructions: "instruction for an unknown type of challenge",
type: "new-type-of-challenge", type: "new-type-of-challenge",
uuid: "6", uuid: "6",
@ -192,55 +179,46 @@ export const OnePolicyWithAllTheChallengesInDifferentState = createExample(
], ],
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: 'in state "solved"', instructions: 'in state "solved"',
type: "question", type: "question",
uuid: "uuid-1", uuid: "uuid-1",
}, },
{ {
cost: "USD:1",
instructions: 'in state "message"', instructions: 'in state "message"',
type: "question", type: "question",
uuid: "uuid-2", uuid: "uuid-2",
}, },
{ {
cost: "USD:1",
instructions: 'in state "auth iban"', instructions: 'in state "auth iban"',
type: "question", type: "question",
uuid: "uuid-3", uuid: "uuid-3",
}, },
{ {
cost: "USD:1",
instructions: 'in state "payment "', instructions: 'in state "payment "',
type: "question", type: "question",
uuid: "uuid-4", uuid: "uuid-4",
}, },
{ {
cost: "USD:1",
instructions: 'in state "rate limit"', instructions: 'in state "rate limit"',
type: "question", type: "question",
uuid: "uuid-5", uuid: "uuid-5",
}, },
{ {
cost: "USD:1",
instructions: 'in state "redirect"', instructions: 'in state "redirect"',
type: "question", type: "question",
uuid: "uuid-6", uuid: "uuid-6",
}, },
{ {
cost: "USD:1",
instructions: 'in state "server failure"', instructions: 'in state "server failure"',
type: "question", type: "question",
uuid: "uuid-7", uuid: "uuid-7",
}, },
{ {
cost: "USD:1",
instructions: 'in state "truth unknown"', instructions: 'in state "truth unknown"',
type: "question", type: "question",
uuid: "uuid-8", uuid: "uuid-8",
}, },
{ {
cost: "USD:1",
instructions: 'in state "unsupported"', instructions: 'in state "unsupported"',
type: "question", type: "question",
uuid: "uuid-9", uuid: "uuid-9",

View File

@ -66,14 +66,12 @@ export function ChallengeOverviewScreen(): VNode {
[uuid: string]: { [uuid: string]: {
type: string; type: string;
instructions: string; instructions: string;
cost: string;
feedback: ChallengeFeedback | undefined; feedback: ChallengeFeedback | undefined;
}; };
} = {}; } = {};
for (const ch of knownChallengesArray) { for (const ch of knownChallengesArray) {
knownChallengesMap[ch.uuid] = { knownChallengesMap[ch.uuid] = {
type: ch.type, type: ch.type,
cost: ch.cost,
instructions: ch.instructions, instructions: ch.instructions,
feedback: challengeFeedback[ch.uuid], feedback: challengeFeedback[ch.uuid],
}; };
@ -123,7 +121,6 @@ export function ChallengeOverviewScreen(): VNode {
)} )}
{policiesWithInfo.map((policy, policy_index) => { {policiesWithInfo.map((policy, policy_index) => {
const tableBody = policy.challenges.map(({ info, uuid }) => { const tableBody = policy.challenges.map(({ info, uuid }) => {
const isFree = !info.cost || info.cost.endsWith(":0");
const method = authMethods[info.type as KnownAuthMethods]; const method = authMethods[info.type as KnownAuthMethods];
if (!method) { if (!method) {

View File

@ -19,11 +19,7 @@
* @author Sebastian Javier Marchano (sebasjm) * @author Sebastian Javier Marchano (sebasjm)
*/ */
import { import { ReducerState } from "@gnu-taler/anastasis-core";
ChallengeFeedbackStatus,
RecoveryStates,
ReducerState,
} from "@gnu-taler/anastasis-core";
import { createExample, reducerStatesExample } from "../../utils"; import { createExample, reducerStatesExample } from "../../utils";
import { SolveScreen as TestedComponent } from "./SolveScreen"; import { SolveScreen as TestedComponent } from "./SolveScreen";
@ -49,7 +45,6 @@ export const NotSupportedChallenge = createExample(TestedComponent, {
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "does P equals NP?", instructions: "does P equals NP?",
type: "chall-type", type: "chall-type",
uuid: "ASDASDSAD!1", uuid: "ASDASDSAD!1",
@ -65,7 +60,6 @@ export const MismatchedChallengeId = createExample(TestedComponent, {
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "does P equals NP?", instructions: "does P equals NP?",
type: "chall-type", type: "chall-type",
uuid: "ASDASDSAD!1", uuid: "ASDASDSAD!1",

View File

@ -47,7 +47,6 @@ export const WithoutFeedback = createExample(
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "Email to me@domain.com", instructions: "Email to me@domain.com",
type: "question", type: "question",
uuid: "uuid-1", uuid: "uuid-1",
@ -69,7 +68,6 @@ export const PaymentFeedback = createExample(
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "Email to me@domain.com", instructions: "Email to me@domain.com",
type: "question", type: "question",
uuid: "uuid-1", uuid: "uuid-1",

View File

@ -47,7 +47,6 @@ export const WithoutFeedback = createExample(
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "does P equals NP?", instructions: "does P equals NP?",
type: "question", type: "question",
uuid: "uuid-1", uuid: "uuid-1",

View File

@ -47,7 +47,6 @@ export const WithoutFeedback = createExample(
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "does P equals NP?", instructions: "does P equals NP?",
type: "question", type: "question",
uuid: "uuid-1", uuid: "uuid-1",

View File

@ -48,7 +48,6 @@ export const WithoutFeedback = createExample(
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "does P equals NP?", instructions: "does P equals NP?",
type: "question", type: "question",
uuid: "uuid-1", uuid: "uuid-1",
@ -70,7 +69,6 @@ export const ServerFailureFeedback = createExample(
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "does P equal NP?", instructions: "does P equal NP?",
type: "question", type: "question",
uuid: "ASDASDSAD!1", uuid: "ASDASDSAD!1",
@ -96,7 +94,6 @@ export const MessageRateLimitExceededFeedback = createExample(
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "does P equals NP?", instructions: "does P equals NP?",
type: "question", type: "question",
uuid: "ASDASDSAD!1", uuid: "ASDASDSAD!1",
@ -118,7 +115,6 @@ export const UnsupportedFeedback = createExample(TestedComponent[type].solve, {
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "does P equals NP?", instructions: "does P equals NP?",
type: "question", type: "question",
uuid: "ASDASDSAD!1", uuid: "ASDASDSAD!1",
@ -141,7 +137,6 @@ export const TruthUnknownFeedback = createExample(TestedComponent[type].solve, {
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "does P equals NP?", instructions: "does P equals NP?",
type: "question", type: "question",
uuid: "ASDASDSAD!1", uuid: "ASDASDSAD!1",
@ -171,7 +166,6 @@ export const AuthIbanFeedback = createExample(TestedComponent[type].solve, {
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "does P equals NP?", instructions: "does P equals NP?",
type: "question", type: "question",
uuid: "ASDASDSAD!1", uuid: "ASDASDSAD!1",
@ -190,7 +184,6 @@ export const PaymentFeedback = createExample(TestedComponent[type].solve, {
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "does P equals NP?", instructions: "does P equals NP?",
type: "question", type: "question",
uuid: "ASDASDSAD!1", uuid: "ASDASDSAD!1",

View File

@ -47,7 +47,6 @@ export const WithoutFeedback = createExample(
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "SMS to +54 11 2233 4455", instructions: "SMS to +54 11 2233 4455",
type: "question", type: "question",
uuid: "AHCC4ZJ3Z1AF8TWBKGVGEKCQ3R7HXHJ51MJ45NHNZMHYZTKJ9NW0", uuid: "AHCC4ZJ3Z1AF8TWBKGVGEKCQ3R7HXHJ51MJ45NHNZMHYZTKJ9NW0",

View File

@ -47,7 +47,6 @@ export const WithoutFeedback = createExample(
recovery_information: { recovery_information: {
challenges: [ challenges: [
{ {
cost: "USD:1",
instructions: "does P equals NP?", instructions: "does P equals NP?",
type: "question", type: "question",
uuid: "uuid-1", uuid: "uuid-1",