Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Dec 3, 2023
2 parents efb83a5 + 0b3c1e8 commit f8ab5f1
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
draft: false
prerelease: false
title: "Latest Release"
automatic_release_tag: "v5.0.144"
automatic_release_tag: "v5.0.145"
files: |
${{ github.workspace }}/artifacts/Invoice-Ninja-Archive
${{ github.workspace }}/artifacts/Invoice-Ninja-Hash
Expand Down
1 change: 1 addition & 0 deletions flatpak/com.invoiceninja.InvoiceNinja.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
</screenshots>
<content_rating type="oars-1.1"/>
<releases>
<release version="5.0.145" date="2023-12-03"/>
<release version="5.0.144" date="2023-12-01"/>
<release version="5.0.143" date="2023-11-30"/>
<release version="5.0.142" date="2023-11-28"/>
Expand Down
3 changes: 2 additions & 1 deletion lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Constants {
}

// TODO remove version once #46609 is fixed
const String kClientVersion = '5.0.144';
const String kClientVersion = '5.0.145';
const String kMinServerVersion = '5.0.4';

const String kAppName = 'Invoice Ninja';
Expand Down Expand Up @@ -487,6 +487,7 @@ const String kGatewayStripe = 'd14dd26a37cecc30fdd65700bfb55b23';
const String kGatewayStripeConnect = 'd14dd26a47cecc30fdd65700bfb67b34';
const String kGatewayAuthorizeNet = '3b6621f970ab18887c4f6dca78d3f8bb';
const String kGatewayCheckoutCom = '3758e7f7c6f4cecf0f4f348b9a00f456';
const String kGatewayPayPalREST = '80af24a6a691230bbec33e930ab40665';
const String kGatewayPayPalExpress = '38f2c48af60c7dd69e04248cbb24c36e';
const String kGatewayPayPalPlatform = '80af24a6a691230bbec33e930ab40666';
const String kGatewayWePay = '8fdeed552015b3c7b44ed6c8ebd9e992';
Expand Down
38 changes: 31 additions & 7 deletions lib/redux/static/static_selectors.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Package imports:
import 'package:built_collection/built_collection.dart';
import 'package:invoiceninja_flutter/constants.dart';
import 'package:memoize/memoize.dart';

// Project imports:
Expand Down Expand Up @@ -127,13 +128,36 @@ List<String?> sizeList(BuiltMap<String, SizeEntity> sizeMap) {
return list;
}

var memoizedGatewayList = memo1(
(BuiltMap<String, GatewayEntity> gatewayMap) => gatewayList(gatewayMap));

List<String?> gatewayList(BuiltMap<String, GatewayEntity> gatewayMap) {
final list = gatewayMap.keys
.where((gatewayId) => gatewayMap[gatewayId]!.isVisible)
.toList();
var memoizedGatewayList = memo2(
(BuiltMap<String, GatewayEntity> gatewayMap, bool isHosted) =>
gatewayList(gatewayMap, isHosted));

List<String?> gatewayList(
BuiltMap<String, GatewayEntity> gatewayMap, bool isHosted) {
final list = gatewayMap.keys.where((gatewayId) {
final gateway = gatewayMap[gatewayId]!;

if (!gateway.isVisible) {
return false;
}

if (isHosted) {
if ([
kGatewayPayPalExpress,
kGatewayPayPalREST,
].contains(gateway.id)) {
return false;
}
} else {
if ([
kGatewayPayPalPlatform,
].contains(gateway.id)) {
return false;
}
}

return true;
}).toList();

list.sort((idA, idB) =>
gatewayMap[idA]!.sortOrder.compareTo(gatewayMap[idB]!.sortOrder));
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/company_gateway/edit/company_gateway_edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ class _CompanyGatewayEditState extends State<CompanyGatewayEdit>
EntityDropdown(
autofocus: true,
entityType: EntityType.gateway,
entityList:
memoizedGatewayList(state.staticState.gatewayMap),
entityList: memoizedGatewayList(
state.staticState.gatewayMap, state.isHosted),
labelText: localization.provider,
entityId: companyGateway.gatewayId,
onSelected: (SelectableEntity? gateway) {
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/i18n.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
static final Map<String, Map<String, String>> _localizedValues = {
'en': {
// STARTER: lang key - do not remove comment
'payment_type_credit': 'Payment Type Credit',
'payment_type_debit': 'Payment Type Debit',
'send_emails_to': 'Send Emails To',
'primary_contact': 'Primary Contact',
'all_contacts': 'All Contacts',
Expand Down
2 changes: 1 addition & 1 deletion pubspec.foss.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: invoiceninja_flutter
description: Client for Invoice Ninja
version: 5.0.144+144
version: 5.0.145+145
homepage: https://invoiceninja.com
documentation: https://invoiceninja.github.io
publish_to: none
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: invoiceninja_flutter
description: Client for Invoice Ninja
version: 5.0.144+144
version: 5.0.145+145
homepage: https://invoiceninja.com
documentation: https://invoiceninja.github.io
publish_to: none
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: invoiceninja
version: '5.0.144'
version: '5.0.145'
summary: Create invoices, accept payments, track expenses & time tasks
description: "### Note: if the app fails to run using `snap run invoiceninja` it may help to run `/snap/invoiceninja/current/bin/invoiceninja` instead
Expand Down

0 comments on commit f8ab5f1

Please sign in to comment.