Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #524 from bunqCommunity/master
Browse files Browse the repository at this point in the history
Release 0.9.8
  • Loading branch information
Crecket authored May 24, 2019
2 parents 0dafda4 + 6d3bc89 commit e097fd0
Show file tree
Hide file tree
Showing 40 changed files with 633 additions and 291 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[![Download counter](https://img.shields.io/github/downloads/bunqCommunity/bunqDesktop/total.svg) ](https://github.com/bunqCommunity/bunqDesktop/releases)
[![build status for master branch](https://api.travis-ci.org/bunqCommunity/bunqDesktop.svg?branch=master) ](https://travis-ci.org/bunqCommunity/bunqDesktop)
[![MIT License](https://img.shields.io/npm/l/all-contributors-cli.svg?style=flat-square)](https://github.com/bunqCommunity/bunqDesktop/blob/master/LICENSE)
[![Wiki](https://img.shields.io/badge/wiki-guides-orange.svg)](https://wiki.bunqdesk.top/)

#### The unofficial, free and open source desktop application for the bunq API.

Expand Down
Binary file modified app/images/256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/images/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/images/512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/images/Logo_Colors_RGB@4x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/images/bunq-maestro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/bunq-mastercard-credit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/images/bunq-mastercard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/images/bunq-nfc-mobile-card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/images/logo@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/images/logo@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/images/logo@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/images/logoTemplate@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/images/logoTemplate@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/images/logoTemplate@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions bunqdesktop.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>bunqdesktop</id>
<version>0.9.7</version>
<version>0.9.8</version>
<!-- <packageSourceUrl>Where is this Chocolatey package located (think GitHub)? packageSourceUrl is highly recommended for the community feed</packageSourceUrl>-->
<!-- owners is a poor name for maintainers of the package. It sticks around by this name for compatibility reasons. It basically means you. -->
<owners>bunqCommunity</owners>
Expand All @@ -25,7 +25,7 @@
<summary>The unofficial, free and open source desktop application for the bunq API</summary>
<description>A desktop implementation for bunq's API. This app does everything within the application so you don't have to worry about sharing your API key with anyone else!</description>

<releaseNotes>https://github.com/bunqCommunity/bunqDesktop/releases/tag/0.9.7</releaseNotes>
<releaseNotes>https://github.com/bunqCommunity/bunqDesktop/releases/tag/0.9.8</releaseNotes>
</metadata>
<files>
<!-- this section controls what actually gets packaged into the Chocolatey package -->
Expand Down
2 changes: 1 addition & 1 deletion chocolatey/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$name = 'bunqDesktop'
$installerType = 'exe'
$url = 'https://github.com/bunqCommunity/bunqDesktop/releases/download/0.9.7/bunqDesktop-0.9.7.exe'
$url = 'https://github.com/bunqCommunity/bunqDesktop/releases/download/0.9.8/bunqDesktop-0.9.8.exe'
$silentArgs = '/silent'

Install-ChocolateyPackage $name $installerType $silentArgs $url
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The unofficial, free and open source desktop application for the bunq API",
"productName": "bunqDesktop",
"homepage": "https://bunqdesk.top/",
"version": "0.9.7",
"version": "0.9.8",
"author": {
"name": "bunqCommunity",
"email": "bunqcommunity@gmail.com"
Expand Down Expand Up @@ -187,7 +187,7 @@
"csv-parse": "^4.0.1",
"date-fns": "^2.0.0-alpha.16",
"dotenv": "^6.1.0",
"electron": "^4.0.7",
"electron": "4.2.2",
"electron-builder": "^20.38.5",
"electron-reload": "^1.4.0",
"email-validator": "^1.1.1",
Expand Down Expand Up @@ -255,7 +255,7 @@
"universal-analytics": "^0.4.15",
"vcf": "^2.0.1",
"webpack": "4.19.0",
"webpack-bundle-analyzer": "^2.13.1",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.1.0",
"worker-loader": "^2.0.0"
}
Expand Down
9 changes: 9 additions & 0 deletions src/helpers/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ export default (window, log) => {
consentWindow.webContents.on("will-navigate", function(event, receivedUrl) {
handleUrl(receivedUrl);
});
consentWindow.webContents.on("will-redirect", function(event, receivedUrl) {
handleUrl(receivedUrl);
});

consentWindow.webContents.on("did-get-redirect-request", function(event, oldUrl, newUrl) {
handleUrl(newUrl);
Expand Down Expand Up @@ -147,6 +150,9 @@ export default (window, log) => {
consentWindow.webContents.on("will-navigate", function(event, receivedUrl) {
handleUrl(receivedUrl);
});
consentWindow.webContents.on("will-redirect", function(event, receivedUrl) {
handleUrl(receivedUrl);
});

consentWindow.webContents.on("did-get-redirect-request", function(event, oldUrl, newUrl) {
handleUrl(newUrl);
Expand Down Expand Up @@ -193,6 +199,9 @@ export default (window, log) => {
consentWindow.webContents.on("will-navigate", function(event, receivedUrl) {
handleUrl(receivedUrl);
});
consentWindow.webContents.on("will-redirect", function(event, receivedUrl) {
handleUrl(receivedUrl);
});

consentWindow.webContents.on("did-get-redirect-request", function(event, oldUrl, newUrl) {
handleUrl(newUrl);
Expand Down
7 changes: 4 additions & 3 deletions src/react/Actions/cards.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import BunqErrorHandler from "../Functions/BunqErrorHandler";
import Card from "../Models/Card";

export function cardsSetInfo(cards, user_id) {
return {
Expand Down Expand Up @@ -27,7 +28,9 @@ export function cardsUpdate(user_id) {
window.BunqDesktopClient.BunqJSClient.api.card
.list(user_id)
.then(cards => {
dispatch(cardsSetInfo(cards, user_id));
const wrappedCards = cards.map(card => new Card(card));

dispatch(cardsSetInfo(wrappedCards, user_id));
dispatch(cardsNotLoading());
})
.catch(error => {
Expand All @@ -40,8 +43,6 @@ export function cardsUpdate(user_id) {
export function cardsAssignAccounts(user_id, card_id, assignemnts) {
const failedMessage = window.t("We failed to assign the accounts to this card");

console.log(user_id, card_id, assignemnts);

return dispatch => {
dispatch(cardsLoading());
window.BunqDesktopClient.BunqJSClient.api.card
Expand Down
14 changes: 7 additions & 7 deletions src/react/Actions/contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import fs from "../ImportWrappers/fs";

export const STORED_CONTACTS = "BUNQDESKTOP_STORED_CONTACTS";

export function contactsSetInfoType(contacts, type, BunqJSClient = false) {
export function contactsSetInfoType(contacts, type) {
return {
type: "CONTACTS_SET_INFO_TYPE",
payload: {
BunqJSClient,
type: type,
contacts: contacts
}
Expand All @@ -29,9 +28,10 @@ export function contactsSetInfo(contacts, BunqJSClient = false) {
};
}

export function loadStoredContacts(BunqJSClient) {
export function loadStoredContacts() {
return dispatch => {
BunqJSClient.Session.loadEncryptedData(STORED_CONTACTS)
const BunqDesktopClient = window.BunqDesktopClient;
BunqDesktopClient.storeDecrypt(STORED_CONTACTS)
.then(data => {
if (data && data.items) {
// turn plain objects into Model objects
Expand Down Expand Up @@ -121,7 +121,7 @@ export function contactInfoUpdateGoogle(BunqJSClient, accessToken) {
}

// set the contacts
dispatch(contactsSetInfoType(collectedEntries, "GoogleContacts", BunqJSClient));
dispatch(contactsSetInfoType(collectedEntries, "GoogleContacts"));
dispatch(contactsNotLoading());
})
.catch(error => {
Expand Down Expand Up @@ -201,7 +201,7 @@ export function contactInfoUpdateOffice365(BunqJSClient, accessToken) {
}

// set the contacts
dispatch(contactsSetInfoType(collectedEntries, "Office365", BunqJSClient));
dispatch(contactsSetInfoType(collectedEntries, "Office365"));
dispatch(contactsNotLoading());
})
.catch(error => {
Expand Down Expand Up @@ -283,7 +283,7 @@ export function contactInfoUpdateApple(BunqJSClient, files) {
});

// set the contacts
dispatch(contactsSetInfoType(collectedEntries, "AppleContacts", BunqJSClient));
dispatch(contactsSetInfoType(collectedEntries, "AppleContacts"));
dispatch(contactsNotLoading());
};
}
Expand Down
23 changes: 23 additions & 0 deletions src/react/Components/BunqMeTabList.jsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
import React from "react";
import { connect } from "react-redux";
import Link from "react-router-dom/Link";
import List from "@material-ui/core/List";
import ListSubheader from "@material-ui/core/ListSubheader";
import ListItemSecondaryAction from "@material-ui/core/ListItemSecondaryAction";
import LinearProgress from "@material-ui/core/LinearProgress";
import Divider from "@material-ui/core/Divider";
import Chip from "@material-ui/core/Chip";
import Avatar from "@material-ui/core/Avatar";
import IconButton from "@material-ui/core/IconButton";

import Visible from "@material-ui/icons/Visibility";
import VisibleOff from "@material-ui/icons/VisibilityOff";
import UrlIcon from "@material-ui/icons/Link";

import BunqMeTabListItem from "./ListItems/BunqMeTabListItem";

import { openSnackbar } from "../Actions/snackbar";
import { bunqMeTabPut } from "../Actions/bunq_me_tab";

const styles = {
list: {
textAlign: "left"
},
chip: {
cursor: "pointer",
marginRight: 8
}
};

Expand All @@ -36,6 +46,7 @@ class BunqMeTabList extends React.Component {
};

render() {
const { t } = this.props;
const loadingContent = this.props.bunqMeTabsLoading ? <LinearProgress /> : <Divider />;

const bunqMeTabs = this.props.bunqMeTabs.map(bunqMeTab => {
Expand All @@ -61,6 +72,18 @@ class BunqMeTabList extends React.Component {
<ListSubheader>
bunq.me requests - {bunqMeTabs.length}
<ListItemSecondaryAction>
<Chip
style={styles.chip}
avatar={
<Avatar>
<UrlIcon />
</Avatar>
}
component={Link}
label={t("bunqme links")}
to="/bunqme-personal"
/>

<IconButton
aria-label="Display or hide expired and cancelled bunqme requests"
onClick={this.toggleTabVisibility}
Expand Down
12 changes: 6 additions & 6 deletions src/react/Components/FilterComponents/CardSelection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ class CardSelection extends React.Component {
const { t, cards, selectedCardIds, toggleCardIds } = this.props;

const selectedCardChipItems = selectedCardIds.map((cardId, key) => {
let card = cards.find(card => card.CardDebit.id === cardId);
let card = cards.find(card => card.id === cardId);

// ensure card exists
if (!card) return null;
card = card.CardDebit;
const { cardImage, cardType } = getCardTypeImage(card.type);
card = card;
const { cardImage, cardType } = getCardTypeImage(card.type, card.cardType);

// display big chip or smaller icon
return (
Expand All @@ -101,20 +101,20 @@ class CardSelection extends React.Component {

const cardMenuItems = Object.keys(cards)
.filter(cardIndex => {
const card = cards[cardIndex].CardDebit;
const card = cards[cardIndex];
if (card && card.status !== "ACTIVE") {
return false;
}
return true;
})
.map((cardIndex, key) => {
const card = cards[cardIndex].CardDebit;
const card = cards[cardIndex];

// don't display already selected items
if (selectedCardIds.includes(card.id)) {
return null;
}
const { cardImage, cardType } = getCardTypeImage(card.type);
const { cardImage, cardType } = getCardTypeImage(card.type, card.cardType);

return (
<MenuItem key={key} onClick={this.addCardId(card.id)}>
Expand Down
1 change: 1 addition & 0 deletions src/react/Components/MoneyAmountLabel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class MoneyAmountLabel extends React.Component {
color: theme.palette.masterCardAction.authorized,
...style
};
case "REVERSED":
case "BLOCKED":
return {
color: theme.palette.masterCardAction.blocked,
Expand Down
38 changes: 35 additions & 3 deletions src/react/Functions/EventStatusTexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export const paymentTypeParser = (paymentType, t) => {
};

export const masterCardActionText = (masterCardAction, t) => {
const reversedText = t("The payment was reversed");

switch (masterCardAction.authorisation_status) {
case "AUTHORISED":
return `${t("Sent payment with ")}${masterCardActionParser(masterCardAction, t)}`;
Expand All @@ -103,32 +105,62 @@ export const masterCardActionText = (masterCardAction, t) => {
}
return t("Payment was refunded");
case "REVERSED":
return t("The payment was reversed");
const authorisationTypeText = masterCardActionAuthorisationType(masterCardAction.authorisation_type, t);
if (authorisationTypeText) {
return `${reversedText}: ${authorisationTypeText}`;
}
return reversedText;
default:
return `${t("The payment currently has the status ")}${masterCardAction.authorisation_status} - ${
masterCardAction.authorisation_type
}`;
}
};

export const masterCardActionAuthorisationType = (authorisationType, t) => {
const authorisationPayment = t("Authorisation payment");

switch (authorisationType) {
case "ACCOUNT_STATUS":
case "NORMAL_AUTHORISATION":
return authorisationPayment;
default:
return "";
}
};

export const masterCardActionParser = (masterCardAction, t) => {
const defaultMessage = t("Card payment");
const paymentText = t("Payment");
const refundText = t("Refund");
const reversedText = t("Reversed");
const authorisationPayment = t("Authorisation");
const atmText = t("ATM Withdrawal");

let secondaryText = paymentText;
if (masterCardAction.authorisation_status === "CLEARING_REFUND") {
secondaryText = refundText;
} else if (masterCardAction.authorisation_status === "REVERSED") {
if (
masterCardAction.authorisation_type === "NORMAL_AUTHORISATION" ||
masterCardAction.authorisation_type === "ACCOUNT_STATUS"
) {
secondaryText = authorisationPayment;
} else {
secondaryText = reversedText;
}
}

if (masterCardAction.pan_entry_mode_user === "ATM") {
return atmText;
}

if (masterCardAction.label_card) {
if (masterCardAction.wallet_provider_id === "103") {
return "Apple Pay " + secondaryText;
switch (masterCardAction.wallet_provider_id) {
case "103":
return "Apple Pay " + secondaryText;
case "216":
return "Google Pay " + secondaryText;
}

switch (masterCardAction.label_card.type) {
Expand Down
8 changes: 8 additions & 0 deletions src/react/Functions/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ export const isObject = a => {
return !!a && a.constructor === Object;
};

/**
* Returns first key of Object list to get type
* @param object
*/
export const getObjectType = object => {
return Object.keys(object)[0];
};

// list of keys which should be anonymized
export const anonymizeKeys = [
"card_authorisation_id_response",
Expand Down
5 changes: 4 additions & 1 deletion src/react/Locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@
"Attempting to load your API key": "Attempting to load your API key",
"Attention!": "Attention!",
"Authenticate": "Authenticate",
"Authorisation": "Authorisation",
"Authorisation Status": "Authorisation Status",
"Authorisation Type": "Authorisation Type",
"Authorisation payment": "Authorisation payment",
"Automatically switch theme based on the time": "Automatically switch theme based on the time",
"Available": "Available",
"Available merchants": "Available merchants",
Expand Down Expand Up @@ -433,6 +435,7 @@
"Restart the application to start without Google Analytics!": "Restart the application to start without Google Analytics!",
"Restart the application to view these changes!": "Restart the application to view these changes!",
"Return to dashboard": "Return to dashboard",
"Reversed": "Reversed",
"Rule Dashboard": "Rule Dashboard",
"Rule Editor": "Rule Editor",
"Rules": "Rules",
Expand Down Expand Up @@ -694,4 +697,4 @@
"weeks": "weeks",
"year": "year",
"years": "years"
}
}
Loading

0 comments on commit e097fd0

Please sign in to comment.