aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-08-30 13:22:29 -0300
committerSebastian <sebasjm@gmail.com>2023-08-30 13:40:08 -0300
commit79973a63dd31c0d84b677a2a1511b1dffc6218b8 (patch)
tree92535e4cfdc43af739ae4f974dfb5455a812ee59
parent7895728308b9669d7987c8f4833f9b1b77e99d5a (diff)
tos change, not so sure
-rw-r--r--packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx57
-rw-r--r--packages/taler-wallet-webextension/src/cta/Withdraw/state.ts20
-rw-r--r--packages/taler-wallet-webextension/src/cta/Withdraw/test.ts4
-rw-r--r--packages/taler-wallet-webextension/src/wallet/DestinationSelection/test.ts5
-rw-r--r--packages/taler-wallet-webextension/src/wallet/Settings.tsx12
5 files changed, 41 insertions, 57 deletions
diff --git a/packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx b/packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx
index e52add756..214c4d792 100644
--- a/packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx
+++ b/packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx
@@ -69,28 +69,28 @@ export function ShowButtonsNonAcceptedTosView({
terms,
}: State.ShowButtonsNotAccepted): VNode {
const { i18n } = useTranslationContext();
- const ableToReviewTermsOfService =
- showingTermsOfService.button.onClick !== undefined;
+ // const ableToReviewTermsOfService =
+ // showingTermsOfService.button.onClick !== undefined;
- if (!ableToReviewTermsOfService) {
- return (
- <Fragment>
- {terms.status === ExchangeTosStatus.NotFound && (
- <section style={{ justifyContent: "space-around", display: "flex" }}>
- <WarningText>
- <i18n.Translate>
- Exchange doesn&apos;t have terms of service
- </i18n.Translate>
- </WarningText>
- </section>
- )}
- </Fragment>
- );
- }
+ // if (!ableToReviewTermsOfService) {
+ // return (
+ // <Fragment>
+ // {terms.status === ExchangeTosStatus.Pending && (
+ // <section style={{ justifyContent: "space-around", display: "flex" }}>
+ // <WarningText>
+ // <i18n.Translate>
+ // Exchange doesn&apos;t have terms of service
+ // </i18n.Translate>
+ // </WarningText>
+ // </section>
+ // )}
+ // </Fragment>
+ // );
+ // }
return (
<Fragment>
- {terms.status === ExchangeTosStatus.NotFound && (
+ {/* {terms.status === ExchangeTosStatus.NotFound && (
<section style={{ justifyContent: "space-around", display: "flex" }}>
<WarningText>
<i18n.Translate>
@@ -98,8 +98,8 @@ export function ShowButtonsNonAcceptedTosView({
</i18n.Translate>
</WarningText>
</section>
- )}
- {terms.status === "new" && (
+ )} */}
+ {terms.status === ExchangeTosStatus.Pending && (
<section style={{ justifyContent: "space-around", display: "flex" }}>
<Button
variant="contained"
@@ -110,19 +110,6 @@ export function ShowButtonsNonAcceptedTosView({
</Button>
</section>
)}
- {terms.status === "changed" && (
- <section style={{ justifyContent: "space-around", display: "flex" }}>
- <Button
- variant="contained"
- color="success"
- onClick={showingTermsOfService.button.onClick}
- >
- <i18n.Translate>
- Review new version of terms of service
- </i18n.Translate>
- </Button>
- </section>
- )}
</Fragment>
);
}
@@ -138,7 +125,7 @@ export function ShowTosContentView({
return (
<Fragment>
- {terms.status !== ExchangeTosStatus.NotFound && !terms.content && (
+ {!terms.content && (
<section style={{ justifyContent: "space-around", display: "flex" }}>
<WarningBox>
<i18n.Translate>
@@ -194,7 +181,7 @@ export function ShowTosContentView({
</LinkSuccess>
</section>
)}
- {termsAccepted && terms.status !== ExchangeTosStatus.NotFound && (
+ {termsAccepted && terms.status !== ExchangeTosStatus.Proposed && (
<section style={{ justifyContent: "space-around", display: "flex" }}>
<CheckboxOutlined
name="terms"
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts
index 46a72ac87..72cabe5a4 100644
--- a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts
+++ b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts
@@ -141,8 +141,8 @@ export function useComponentStateFromParams({
confirm: {
onClick: isValid
? pushAlertOnError(async () => {
- onAmountChanged(Amounts.stringify(amount));
- })
+ onAmountChanged(Amounts.stringify(amount));
+ })
: undefined,
},
amount: {
@@ -304,8 +304,8 @@ function exchangeSelectionState(
const [ageRestricted, setAgeRestricted] = useState(0);
const currentExchange = selectedExchange.selected;
const tosNeedToBeAccepted =
- currentExchange.tosStatus == ExchangeTosStatus.New ||
- currentExchange.tosStatus == ExchangeTosStatus.Changed;
+ currentExchange.tosStatus == ExchangeTosStatus.Pending ||
+ currentExchange.tosStatus == ExchangeTosStatus.Proposed;
/**
* With the exchange and amount, ask the wallet the information
@@ -393,12 +393,12 @@ function exchangeSelectionState(
//TODO: calculate based on exchange info
const ageRestriction = ageRestrictionEnabled
? {
- list: ageRestrictionOptions,
- value: String(ageRestricted),
- onChange: pushAlertOnError(async (v: string) =>
- setAgeRestricted(parseInt(v, 10)),
- ),
- }
+ list: ageRestrictionOptions,
+ value: String(ageRestricted),
+ onChange: pushAlertOnError(async (v: string) =>
+ setAgeRestricted(parseInt(v, 10)),
+ ),
+ }
: undefined;
return {
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts
index c7af160e4..ab3b2e316 100644
--- a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts
+++ b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts
@@ -37,7 +37,7 @@ const exchanges: ExchangeListItem[] = [
exchangeBaseUrl: "http://exchange.demo.taler.net",
paytoUris: [],
tosStatus: ExchangeTosStatus.Accepted,
- exchangeStatus: ExchangeEntryStatus.Ok,
+ exchangeStatus: ExchangeEntryStatus.Used,
permanent: true,
auditors: [
{
@@ -202,7 +202,7 @@ describe("Withdraw CTA states", () => {
const exchangeWithNewTos = exchanges.map((e) => ({
...e,
- tosStatus: ExchangeTosStatus.New,
+ tosStatus: ExchangeTosStatus.Proposed,
}));
handler.addWalletCallResponse(
diff --git a/packages/taler-wallet-webextension/src/wallet/DestinationSelection/test.ts b/packages/taler-wallet-webextension/src/wallet/DestinationSelection/test.ts
index 99b5ec176..7ef475805 100644
--- a/packages/taler-wallet-webextension/src/wallet/DestinationSelection/test.ts
+++ b/packages/taler-wallet-webextension/src/wallet/DestinationSelection/test.ts
@@ -24,6 +24,7 @@ import {
ExchangeEntryStatus,
ExchangeListItem,
ExchangeTosStatus,
+ ExchangeUpdateStatus,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { expect } from "chai";
@@ -36,9 +37,9 @@ const exchangeArs: ExchangeListItem = {
currency: "ARS",
exchangeBaseUrl: "http://",
tosStatus: ExchangeTosStatus.Accepted,
- exchangeStatus: ExchangeEntryStatus.Ok,
+ exchangeEntryStatus: ExchangeEntryStatus.Used,
+ exchangeUpdateStatus: ExchangeUpdateStatus.Initial,
paytoUris: [],
- permanent: true,
ageRestrictionOptions: [],
};
diff --git a/packages/taler-wallet-webextension/src/wallet/Settings.tsx b/packages/taler-wallet-webextension/src/wallet/Settings.tsx
index 071d2a594..0aa46d615 100644
--- a/packages/taler-wallet-webextension/src/wallet/Settings.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Settings.tsx
@@ -163,20 +163,16 @@ export function SettingsView({
<i18n.Translate>ok</i18n.Translate>
</SuccessText>
);
- case ExchangeTosStatus.Changed:
+ case ExchangeTosStatus.Pending:
return (
<WarningText>
- <i18n.Translate>changed</i18n.Translate>
+ <i18n.Translate>pending</i18n.Translate>
</WarningText>
);
- case ExchangeTosStatus.New:
- case ExchangeTosStatus.NotFound:
+ case ExchangeTosStatus.Proposed:
return (
- <DestructiveText>
- <i18n.Translate>not accepted</i18n.Translate>
- </DestructiveText>
+ <i18n.Translate>proposed</i18n.Translate>
);
- case ExchangeTosStatus.Unknown:
default:
return (
<DestructiveText>