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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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