gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-wallet-webex] branch master updated: show tip in his


From: gnunet
Subject: [GNUnet-SVN] [taler-wallet-webex] branch master updated: show tip in history
Date: Tue, 12 Dec 2017 15:38:06 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-webex.

The following commit(s) were added to refs/heads/master by this push:
     new 1bcc5022 show tip in history
1bcc5022 is described below

commit 1bcc5022c27fff2c28c38b3db12ac353cc7d3481
Author: Florian Dold <address@hidden>
AuthorDate: Tue Dec 12 15:38:03 2017 +0100

    show tip in history
---
 src/i18n/de.po                  | 16 +++++++++++++---
 src/i18n/en-US.po               | 13 ++++++++++---
 src/i18n/fr.po                  | 13 ++++++++++---
 src/i18n/it.po                  | 13 ++++++++++---
 src/i18n/strings.ts             | 12 ++++++++++++
 src/i18n/taler-wallet-webex.pot | 13 ++++++++++---
 src/types.ts                    |  2 ++
 src/wallet.ts                   | 18 +++++++++++++++++-
 src/webex/pages/popup.tsx       | 12 ++++++++++++
 9 files changed, 96 insertions(+), 16 deletions(-)

diff --git a/src/i18n/de.po b/src/i18n/de.po
index cafa23d4..49b7ada8 100644
--- a/src/i18n/de.po
+++ b/src/i18n/de.po
@@ -255,17 +255,27 @@ msgstr "Reserve (%1$s) mit %2$s bei %3$s erzeugt"
 msgid "Merchant%1$sgave a refund over%2$s.\n"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:405
+#: src/webex/pages/popup.tsx:408
+#, fuzzy, c-format
+msgid ""
+"Merchant%1$sgave a%2$sof%3$s.\n"
+"%4$s%5$s"
+msgstr ""
+"%1$s\n"
+"               möchte einen Vertrag über %2$s\n"
+"               mit Ihnen abschließen."
+
+#: src/webex/pages/popup.tsx:417
 #, c-format
 msgid "Unknown event (%1$s)"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:448
+#: src/webex/pages/popup.tsx:460
 #, c-format
 msgid "Error: could not retrieve event history"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:473
+#: src/webex/pages/popup.tsx:485
 #, c-format
 msgid "Your wallet has no events recorded."
 msgstr "Ihre Geldbörse verzeichnet keine Vorkommnisse."
diff --git a/src/i18n/en-US.po b/src/i18n/en-US.po
index 559b8f8c..e42d81fb 100644
--- a/src/i18n/en-US.po
+++ b/src/i18n/en-US.po
@@ -252,17 +252,24 @@ msgstr ""
 msgid "Merchant%1$sgave a refund over%2$s.\n"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:405
+#: src/webex/pages/popup.tsx:408
+#, c-format
+msgid ""
+"Merchant%1$sgave a%2$sof%3$s.\n"
+"%4$s%5$s"
+msgstr ""
+
+#: src/webex/pages/popup.tsx:417
 #, c-format
 msgid "Unknown event (%1$s)"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:448
+#: src/webex/pages/popup.tsx:460
 #, c-format
 msgid "Error: could not retrieve event history"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:473
+#: src/webex/pages/popup.tsx:485
 #, c-format
 msgid "Your wallet has no events recorded."
 msgstr ""
diff --git a/src/i18n/fr.po b/src/i18n/fr.po
index 6e31237d..6b126178 100644
--- a/src/i18n/fr.po
+++ b/src/i18n/fr.po
@@ -252,17 +252,24 @@ msgstr ""
 msgid "Merchant%1$sgave a refund over%2$s.\n"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:405
+#: src/webex/pages/popup.tsx:408
+#, c-format
+msgid ""
+"Merchant%1$sgave a%2$sof%3$s.\n"
+"%4$s%5$s"
+msgstr ""
+
+#: src/webex/pages/popup.tsx:417
 #, c-format
 msgid "Unknown event (%1$s)"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:448
+#: src/webex/pages/popup.tsx:460
 #, c-format
 msgid "Error: could not retrieve event history"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:473
+#: src/webex/pages/popup.tsx:485
 #, c-format
 msgid "Your wallet has no events recorded."
 msgstr ""
diff --git a/src/i18n/it.po b/src/i18n/it.po
index 6e31237d..6b126178 100644
--- a/src/i18n/it.po
+++ b/src/i18n/it.po
@@ -252,17 +252,24 @@ msgstr ""
 msgid "Merchant%1$sgave a refund over%2$s.\n"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:405
+#: src/webex/pages/popup.tsx:408
+#, c-format
+msgid ""
+"Merchant%1$sgave a%2$sof%3$s.\n"
+"%4$s%5$s"
+msgstr ""
+
+#: src/webex/pages/popup.tsx:417
 #, c-format
 msgid "Unknown event (%1$s)"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:448
+#: src/webex/pages/popup.tsx:460
 #, c-format
 msgid "Error: could not retrieve event history"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:473
+#: src/webex/pages/popup.tsx:485
 #, c-format
 msgid "Your wallet has no events recorded."
 msgstr ""
diff --git a/src/i18n/strings.ts b/src/i18n/strings.ts
index e2bd80a8..d18368ad 100644
--- a/src/i18n/strings.ts
+++ b/src/i18n/strings.ts
@@ -144,6 +144,9 @@ strings['de'] = {
       "Merchant%1$sgave a refund over%2$s.\n": [
         ""
       ],
+      "Merchant%1$sgave a%2$sof%3$s.\n%4$s%5$s": [
+        "%1$s\n               möchte einen Vertrag über %2$s\n               
mit Ihnen abschließen."
+      ],
       "Unknown event (%1$s)": [
         ""
       ],
@@ -330,6 +333,9 @@ strings['en-US'] = {
       "Merchant%1$sgave a refund over%2$s.\n": [
         ""
       ],
+      "Merchant%1$sgave a%2$sof%3$s.\n%4$s%5$s": [
+        ""
+      ],
       "Unknown event (%1$s)": [
         ""
       ],
@@ -516,6 +522,9 @@ strings['fr'] = {
       "Merchant%1$sgave a refund over%2$s.\n": [
         ""
       ],
+      "Merchant%1$sgave a%2$sof%3$s.\n%4$s%5$s": [
+        ""
+      ],
       "Unknown event (%1$s)": [
         ""
       ],
@@ -702,6 +711,9 @@ strings['it'] = {
       "Merchant%1$sgave a refund over%2$s.\n": [
         ""
       ],
+      "Merchant%1$sgave a%2$sof%3$s.\n%4$s%5$s": [
+        ""
+      ],
       "Unknown event (%1$s)": [
         ""
       ],
diff --git a/src/i18n/taler-wallet-webex.pot b/src/i18n/taler-wallet-webex.pot
index 6e31237d..6b126178 100644
--- a/src/i18n/taler-wallet-webex.pot
+++ b/src/i18n/taler-wallet-webex.pot
@@ -252,17 +252,24 @@ msgstr ""
 msgid "Merchant%1$sgave a refund over%2$s.\n"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:405
+#: src/webex/pages/popup.tsx:408
+#, c-format
+msgid ""
+"Merchant%1$sgave a%2$sof%3$s.\n"
+"%4$s%5$s"
+msgstr ""
+
+#: src/webex/pages/popup.tsx:417
 #, c-format
 msgid "Unknown event (%1$s)"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:448
+#: src/webex/pages/popup.tsx:460
 #, c-format
 msgid "Error: could not retrieve event history"
 msgstr ""
 
-#: src/webex/pages/popup.tsx:473
+#: src/webex/pages/popup.tsx:485
 #, c-format
 msgid "Your wallet has no events recorded."
 msgstr ""
diff --git a/src/types.ts b/src/types.ts
index 69ed6444..85753725 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -1948,6 +1948,8 @@ export interface TipRecord {
    * URL to go to once the tip has been accepted.
    */
   nextUrl: string;
+
+  timestamp: number;
 }
 
 
diff --git a/src/wallet.ts b/src/wallet.ts
index a597fd5b..5b658de8 100644
--- a/src/wallet.ts
+++ b/src/wallet.ts
@@ -329,7 +329,7 @@ export const WALLET_PROTOCOL_VERSION = "2:0:0";
  * In the future we might consider adding migration functions for
  * each version increment.
  */
-export const WALLET_DB_VERSION = 22;
+export const WALLET_DB_VERSION = 23;
 
 const builtinCurrencies: CurrencyRecord[] = [
   {
@@ -2356,6 +2356,20 @@ export class Wallet {
       }
     }
 
+    const tips: TipRecord[] = await 
this.q().iter<TipRecord>(Stores.tips).toArray();
+    for (const tip of tips) {
+      history.push({
+        detail: {
+          merchantDomain: tip.merchantDomain,
+          amount: tip.amount,
+          reservePub: tip.accepted,
+          tipId: tip.tipId,
+        },
+        timestamp: tip.timestamp,
+        type: "tip",
+      });
+    }
+
     history.sort((h1, h2) => Math.sign(h1.timestamp - h2.timestamp));
 
     return {history};
@@ -2869,6 +2883,7 @@ export class Wallet {
       const denomsForWithdraw = await 
this.getVerifiedWithdrawDenomList(exchangeUrl, amount);
       const planchets = await Promise.all(denomsForWithdraw.map(d => 
this.cryptoApi.createTipPlanchet(d)));
       const coinPubs: string[] = planchets.map(x => x.coinPub);
+      const now = (new Date()).getTime();
       tipRecord = {
         accepted: false,
         amount,
@@ -2878,6 +2893,7 @@ export class Wallet {
         merchantDomain,
         nextUrl,
         planchets,
+        timestamp: now,
         tipId,
       };
       await this.q().put(Stores.tips, tipRecord).finish();
diff --git a/src/webex/pages/popup.tsx b/src/webex/pages/popup.tsx
index 82f3edda..389be3b5 100644
--- a/src/webex/pages/popup.tsx
+++ b/src/webex/pages/popup.tsx
@@ -401,6 +401,18 @@ function formatHistoryItem(historyItem: HistoryRecord) {
         </i18n.Translate>
       );
     }
+    case "tip": {
+      const tipPageUrl = new 
URI(chrome.extension.getURL("/src/webex/pages/tip.html"));
+      const params = { tip_id: d.tipId, merchant_domain: d.merchantDomain };
+      const url = tipPageUrl.query(params).href();
+      return (
+        <i18n.Translate wrap="p">
+          Merchant <span>{d.merchantDomain}</span> gave a <a href={url} 
onClick={openTab(url)}> tip</a> of <span>{renderAmount(d.amount)}</span>.
+          <span> </span>
+          {d.accepted ? null : <span>You did not accepted the tip yet.</span> }
+        </i18n.Translate>
+      );
+    }
     default:
       return (<p>{i18n.str`Unknown event (${historyItem.type})`}</p>);
   }

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]