Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Nov 14, 2023
2 parents 712d60b + 416e9d9 commit e0710db
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 23 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.139"
automatic_release_tag: "v5.0.140"
files: |
${{ github.workspace }}/artifacts/Invoice-Ninja-Archive
${{ github.workspace }}/artifacts/Invoice-Ninja-Hash
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.CALL_PHONE"/>

<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front" android:required="false"/>
<uses-feature android:name="android.hardware.READ_EXTERNAL_STORAGE" android:required="false"/>
<uses-feature android:name="android.hardware.READ_MEDIA_IMAGES" android:required="false"/>
<uses-feature android:name="android.hardware.CALL_PHONE" android:required="false"/>

</manifest>
2 changes: 2 additions & 0 deletions android/app/src/main/AndroidManifest.foss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.CALL_PHONE"/>

<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front" android:required="false"/>
<uses-feature android:name="android.hardware.READ_EXTERNAL_STORAGE" android:required="false"/>
<uses-feature android:name="android.hardware.READ_MEDIA_IMAGES" android:required="false"/>
<uses-feature android:name="android.hardware.CALL_PHONE" android:required="false"/>

<application
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.CALL_PHONE"/>

<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front" android:required="false"/>
<uses-feature android:name="android.hardware.READ_EXTERNAL_STORAGE" android:required="false"/>
<uses-feature android:name="android.hardware.READ_MEDIA_IMAGES" android:required="false"/>
<uses-feature android:name="android.hardware.CALL_PHONE" android:required="false"/>

<application
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.CALL_PHONE"/>

<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front" android:required="false"/>
<uses-feature android:name="android.hardware.READ_EXTERNAL_STORAGE" android:required="false"/>
<uses-feature android:name="android.hardware.READ_MEDIA_IMAGES" android:required="false"/>
<uses-feature android:name="android.hardware.CALL_PHONE" android:required="false"/>

</manifest>
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.140" date="2023-11-14"/>
<release version="5.0.139" date="2023-11-12"/>
<release version="5.0.138" date="2023-11-03"/>
<release version="5.0.137" date="2023-11-02"/>
Expand Down
2 changes: 1 addition & 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.139';
const String kClientVersion = '5.0.140';
const String kMinServerVersion = '5.0.4';

const String kAppName = 'Invoice Ninja';
Expand Down
3 changes: 1 addition & 2 deletions lib/redux/credit/credit_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,7 @@ Future handleCreditAction(BuildContext context, List<BaseEntity> credits,
case EntityAction.download:
store.dispatch(StartLoading());
await WebClient()
.get(credit.invitationEInvoiceDownloadLink, state.token,
rawResponse: true)
.get(credit.invitationDownloadLink, state.token, rawResponse: true)
.then((response) {
store.dispatch(StopLoading());
saveDownloadedFile(response.bodyBytes,
Expand Down
2 changes: 1 addition & 1 deletion lib/redux/purchase_order/purchase_order_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ void handlePurchaseOrderAction(BuildContext? context,
break;
case EntityAction.download:
await WebClient()
.get(purchaseOrder.invitationEInvoiceDownloadLink, state.token,
.get(purchaseOrder.invitationDownloadLink, state.token,
rawResponse: true)
.then((response) {
store.dispatch(StopLoading());
Expand Down
10 changes: 5 additions & 5 deletions lib/ui/app/document_grid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,18 @@ class _DocumentGridState extends State<DocumentGrid> {
final status = await Permission.camera.request();
if (status == PermissionStatus.granted) {
final multipartFiles = <MultipartFile>[];
final images = await ImagePicker().pickMultiImage();
for (var index = 0; index < images.length; index++) {
final image = images[index];
final image = await ImagePicker()
.pickImage(source: ImageSource.camera);
if (image != null) {
final croppedFile = (await ImageCropper()
.cropImage(sourcePath: image.path))!;
final bytes = await croppedFile.readAsBytes();
final multipartFile = MultipartFile.fromBytes(
'documents[$index]', bytes,
'documents[0]', bytes,
filename: image.path.split('/').last);
multipartFiles.add(multipartFile);
widget.onUploadDocument(multipartFiles, _isPrivate);
}
widget.onUploadDocument(multipartFiles, _isPrivate);
} else {
openAppSettings();
}
Expand Down
16 changes: 12 additions & 4 deletions lib/utils/files.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:io';
import 'dart:io' as file;

// Flutter imports:
import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/foundation.dart';

// Package imports:
Expand Down Expand Up @@ -39,11 +40,18 @@ Future<List<MultipartFile>?> pickFiles({
allowMultiple: allowMultiple,
);
} else {
final permission = await (fileType == FileType.image && Platform.isIOS
? Permission.photos.request()
: Permission.storage.request());
final androidInfo = await DeviceInfoPlugin().androidInfo;
PermissionStatus status;

if (permission == PermissionStatus.granted) {
if (Platform.isIOS && fileType == FileType.image) {
status = await Permission.photos.request();
} else if (Platform.isAndroid && androidInfo.version.sdkInt >= 33) {
status = await Permission.photos.request();
} else {
status = await Permission.storage.request();
}

if (status == PermissionStatus.granted) {
return _pickFiles(
fileIndex: fileIndex,
fileType: fileType,
Expand Down
2 changes: 2 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import FlutterMacOS
import Foundation

import desktop_drop
import device_info_plus
import file_selector_macos
import in_app_purchase_storekit
import in_app_review
Expand All @@ -26,6 +27,7 @@ import window_manager

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DesktopDropPlugin.register(with: registry.registrar(forPlugin: "DesktopDropPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
InAppPurchasePlugin.register(with: registry.registrar(forPlugin: "InAppPurchasePlugin"))
InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin"))
Expand Down
5 changes: 3 additions & 2 deletions 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.139+139
version: 5.0.140+140
homepage: https://invoiceninja.com
documentation: https://invoiceninja.github.io
publish_to: none
Expand Down Expand Up @@ -44,7 +44,7 @@ dependencies:
git:
url: https://github.com/theyakka/qr.flutter.git
local_auth: ^2.1.5
sentry_flutter: ^7.10.1
sentry_flutter: ^7.12.0
image_picker: ^1.0.4
flutter_colorpicker: ^1.0.3
flutter_json_viewer: ^1.0.1
Expand Down Expand Up @@ -89,6 +89,7 @@ dependencies:
# idb_shim: ^1.11.1+1
collection: ^1.15.0-nullsafety.4
filesystem_picker: ^4.0.0
device_info_plus: ^9.1.0

dependency_overrides:
intl: any
Expand Down
32 changes: 28 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.4.4"
device_info_plus:
dependency: "direct main"
description:
name: device_info_plus
sha256: "7035152271ff67b072a211152846e9f1259cf1be41e34cd3e0b5463d2d6b8419"
url: "https://pub.dev"
source: hosted
version: "9.1.0"
device_info_plus_platform_interface:
dependency: transitive
description:
name: device_info_plus_platform_interface
sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64
url: "https://pub.dev"
source: hosted
version: "7.0.0"
diacritic:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1309,18 +1325,18 @@ packages:
dependency: transitive
description:
name: sentry
sha256: "830667eadc0398fea3a3424ed1b74568e2db603a42758d0922e2f2974ce55a60"
sha256: "9cfd325611ab54b57d5e26957466823f05bea9d6cfcc8d48f11817b8bcedf0d1"
url: "https://pub.dev"
source: hosted
version: "7.10.1"
version: "7.12.0"
sentry_flutter:
dependency: "direct main"
description:
name: sentry_flutter
sha256: "6730f41b304c6fb0fa590dacccaf73ba11082fc64b274cfe8a79776f2b95309c"
sha256: "0cd7d622cb63c94fd1b2f87ab508e158b950bd281e2a80f327ebf73bb217eaf3"
url: "https://pub.dev"
source: hosted
version: "7.10.1"
version: "7.12.0"
share_plus:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1862,6 +1878,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.0.9"
win32_registry:
dependency: transitive
description:
name: win32_registry
sha256: "41fd8a189940d8696b1b810efb9abcf60827b6cbfab90b0c43e8439e3a39d85a"
url: "https://pub.dev"
source: hosted
version: "1.1.2"
window_manager:
dependency: "direct main"
description:
Expand Down
5 changes: 3 additions & 2 deletions 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.139+139
version: 5.0.140+140
homepage: https://invoiceninja.com
documentation: https://invoiceninja.github.io
publish_to: none
Expand Down Expand Up @@ -50,7 +50,7 @@ dependencies:
git:
url: https://github.com/theyakka/qr.flutter.git
local_auth: ^2.1.5
sentry_flutter: ^7.10.1
sentry_flutter: ^7.12.0
image_picker: ^1.0.4
flutter_colorpicker: ^1.0.3
flutter_json_viewer: ^1.0.1
Expand Down Expand Up @@ -95,6 +95,7 @@ dependencies:
# idb_shim: ^1.11.1+1
collection: ^1.15.0-nullsafety.4
filesystem_picker: ^4.0.0
device_info_plus: ^9.1.0

dependency_overrides:
intl: any
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.139'
version: '5.0.140'
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 e0710db

Please sign in to comment.