Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Jul 6, 2022
2 parents b9658f5 + 518e960 commit 20fae4a
Show file tree
Hide file tree
Showing 23 changed files with 120 additions and 64 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v1
- uses: subosito/flutter-action@v1
with:
flutter-version: '3.0.0'
flutter-version: '3.0.4'
#channel: 'stable'
- name: Install Sentry
run: |
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
- uses: actions/checkout@v1
- uses: subosito/flutter-action@v1
with:
flutter-version: '3.0.0'
flutter-version: '3.0.4'
#channel: 'stable'
- name: Setup Flutter
run: |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Note: if you don't have an Invoice Ninja backend setup you can test the app with
```
cp android/build.gradle.foss android/build.gradle
cp lib/utils/oauth.dart.foss lib/utils/oauth.dart
cp lib/utils/review.dart.foss lib/utils/review.dart
cp lib/ui/app/upgrade_dialog.dart.foss lib/ui/app/upgrade_dialog.dart
cp android/app/src/main/AndroidManifest.foss.xml android/app/src/main/AndroidManifest.xml
cp pubspec.foss.yaml pubspec.yaml
Expand Down
4 changes: 2 additions & 2 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=false
android.enableR8=true
android.enableDexingArtifactTransform=false
android.enableDexingArtifactTransform=false
6 changes: 6 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ PODS:
- TOCropViewController (~> 2.6.1)
- image_picker_ios (0.0.1):
- Flutter
- in_app_review (0.2.0):
- Flutter
- local_auth (0.0.1):
- Flutter
- package_info (0.0.1):
Expand Down Expand Up @@ -104,6 +106,7 @@ DEPENDENCIES:
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- in_app_review (from `.symlinks/plugins/in_app_review/ios`)
- local_auth (from `.symlinks/plugins/local_auth/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
Expand Down Expand Up @@ -144,6 +147,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_cropper/ios"
image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios"
in_app_review:
:path: ".symlinks/plugins/in_app_review/ios"
local_auth:
:path: ".symlinks/plugins/local_auth/ios"
package_info:
Expand Down Expand Up @@ -183,6 +188,7 @@ SPEC CHECKSUMS:
GTMSessionFetcher: 5595ec75acf5be50814f81e9189490412bad82ba
image_cropper: 60c2789d1f1a78c873235d4319ca0c34a69f2d98
image_picker_ios: b786a5dcf033a8336a657191401bfdf12017dabb
in_app_review: 4a97249f7a2f539a0f294c2d9196b7fe35e49541
local_auth: 1740f55d7af0a2e2a8684ce225fe79d8931e808c
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
Expand Down
12 changes: 6 additions & 6 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 86;
CURRENT_PROJECT_VERSION = 87;
DEVELOPMENT_TEAM = NPC44Y2C98;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.86;
MARKETING_VERSION = 5.0.87;
PRODUCT_BUNDLE_IDENTIFIER = com.invoiceninja.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -502,15 +502,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 86;
CURRENT_PROJECT_VERSION = 87;
DEVELOPMENT_TEAM = NPC44Y2C98;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.86;
MARKETING_VERSION = 5.0.87;
PRODUCT_BUNDLE_IDENTIFIER = com.invoiceninja.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand All @@ -526,15 +526,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 86;
CURRENT_PROJECT_VERSION = 87;
DEVELOPMENT_TEAM = NPC44Y2C98;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.86;
MARKETING_VERSION = 5.0.87;
PRODUCT_BUNDLE_IDENTIFIER = com.invoiceninja.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down
10 changes: 6 additions & 4 deletions 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.86';
const String kClientVersion = '5.0.87';
const String kMinServerVersion = '5.0.4';

const String kAppName = 'Invoice Ninja';
Expand All @@ -25,12 +25,14 @@ const String kSourceCodeFrontend =
'https://github.com/invoiceninja/admin-portal';
const String kSourceCodeFrontendSDK = 'https://pub.dev/packages/invoiceninja';

const String kAppStoreId = 'com.invoiceninja.app';
const String kPlayStoreAppId = 'com.invoiceninja.app';
const String kAppStoreAppId = 'id1503970375';

const String kMicrosoftAppStoreId = '9n3f2bbcfdr6';
const String kAppleStoreUrl =
'https://apps.apple.com/us/app/invoice-ninja-v5/id1503970375';
'https://apps.apple.com/us/app/invoice-ninja-v5/$kAppStoreAppId';
const String kGoogleStoreUrl =
'https://play.google.com/store/apps/details?id=$kAppStoreId';
'https://play.google.com/store/apps/details?id=$kPlayStoreAppId';
const String kGoogleFDroidUrl =
'https://f-droid.org/packages/com.invoiceninja.app';
const String kMacOSUrl = 'https://apps.apple.com/app/id1503970375';
Expand Down
12 changes: 7 additions & 5 deletions lib/ui/app/app_title_bar.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'package:flutter/material.dart';
//import 'package:bitsdojo_window/bitsdojo_window.dart';
//import 'package:flutter_redux/flutter_redux.dart';
//import 'package:invoiceninja_flutter/redux/app/app_state.dart';
//import 'package:invoiceninja_flutter/utils/platforms.dart';
//import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
/*
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
*/

class AppTitleBar extends StatelessWidget {
const AppTitleBar({Key key}) : super(key: key);
Expand Down
20 changes: 11 additions & 9 deletions lib/ui/app/invoice/invoice_email_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,17 @@ class _InvoiceEmailViewState extends State<InvoiceEmailView>
padding: const EdgeInsets.only(bottom: 10),
child: IconMessage(
localization.customEmailsDisabledHelp,
trailing: TextButton(
child: Text(
localization.upgrade.toUpperCase(),
style: TextStyle(
color: Colors.white,
),
),
onPressed: () => launch(state.userCompany.ninjaPortalUrl),
),
trailing: isApple()
? null
: TextButton(
child: Text(
localization.upgrade.toUpperCase(),
style: TextStyle(
color: Colors.white,
),
),
onPressed: () => launch(state.userCompany.ninjaPortalUrl),
),
),
),
ColoredBox(
Expand Down
8 changes: 2 additions & 6 deletions lib/ui/app/menu_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:in_app_review/in_app_review.dart';

// Package imports:
import 'package:flutter_redux/flutter_redux.dart';
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
import 'package:invoiceninja_flutter/redux/auth/auth_actions.dart';
import 'package:invoiceninja_flutter/redux/settings/settings_actions.dart';
import 'package:invoiceninja_flutter/utils/review.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:pointer_interceptor/pointer_interceptor.dart';
import 'package:redux/redux.dart';
Expand Down Expand Up @@ -1379,11 +1379,7 @@ void _showAbout(BuildContext context) async {
if (kIsWeb || isLinux()) {
launch(getRateAppURL(context));
} else {
final InAppReview inAppReview = InAppReview.instance;
inAppReview.openStoreListing(
appStoreId: kAppStoreId,
microsoftStoreId: kMicrosoftAppStoreId,
);
AppReview.openStoreListing();
}
},
),
Expand Down
17 changes: 7 additions & 10 deletions lib/ui/app/review_app.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:invoiceninja_flutter/constants.dart';
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
import 'package:invoiceninja_flutter/ui/app/menu_drawer.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
import 'package:invoiceninja_flutter/utils/review.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:in_app_review/in_app_review.dart';

class ReviewApp extends StatefulWidget {
const ReviewApp({Key key}) : super(key: key);
Expand All @@ -21,8 +20,6 @@ class ReviewApp extends StatefulWidget {
class _ReviewAppState extends State<ReviewApp> {
bool _likesTheApp;

final InAppReview inAppReview = InAppReview.instance;

@override
Widget build(BuildContext context) {
final localization = AppLocalization.of(context);
Expand Down Expand Up @@ -59,15 +56,15 @@ class _ReviewAppState extends State<ReviewApp> {
});
} else {
if (_likesTheApp == true) {
if (await inAppReview.isAvailable()) {
inAppReview.requestReview();
// TODO remove this code: https://github.com/britannio/in_app_review/issues/56
if (isAndroid()) {
AppReview.openStoreListing();
} else if (await AppReview.isAvailable()) {
AppReview.requestReview();
} else if (kIsWeb || isLinux()) {
launch(getRateAppURL(context));
} else {
inAppReview.openStoreListing(
appStoreId: kAppStoreId,
microsoftStoreId: kMicrosoftAppStoreId,
);
AppReview.openStoreListing();
}
} else {
showDialog<void>(
Expand Down
4 changes: 3 additions & 1 deletion lib/ui/client/view/client_view_fullwidth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:invoiceninja_flutter/ui/client/view/client_view_system_logs.dart
import 'package:invoiceninja_flutter/ui/client/view/client_view_vm.dart';
import 'package:invoiceninja_flutter/utils/formatting.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:invoiceninja_flutter/utils/strings.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:url_launcher/url_launcher.dart';

Expand Down Expand Up @@ -121,7 +122,8 @@ class _ClientViewFullwidthState extends State<ClientViewFullwidth>
child: CopyToClipboard(
value: client.website,
child: IconText(
icon: MdiIcons.earth, text: client.website),
icon: MdiIcons.earth,
text: trimUrl(client.website)),
),
),
SizedBox(height: 4),
Expand Down
10 changes: 6 additions & 4 deletions lib/ui/reports/reports_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,12 @@ class ReportsScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
HelpText(localization.upgradeToViewReports),
AppButton(
label: localization.upgrade.toUpperCase(),
onPressed: () => launch(state.userCompany.ninjaPortalUrl),
)
if (!isApple())
AppButton(
label: localization.upgrade.toUpperCase(),
onPressed: () =>
launch(state.userCompany.ninjaPortalUrl),
)
],
),
)
Expand Down
2 changes: 2 additions & 0 deletions lib/ui/settings/settings_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,8 @@ class SettingsSearch extends StatelessWidget {
[
'long_press_multiselect',
'biometric_authentication',
'enable_flexible_search',
'enable_tooltips',
'show_pdf_preview',
'refresh_data',
],
Expand Down
5 changes: 3 additions & 2 deletions lib/ui/vendor/view/vendor_view_fullwidth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:invoiceninja_flutter/ui/app/screen_imports.dart';
import 'package:invoiceninja_flutter/ui/vendor/view/vendor_view_documents.dart';
import 'package:invoiceninja_flutter/utils/formatting.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:invoiceninja_flutter/utils/strings.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:url_launcher/url_launcher.dart';

Expand Down Expand Up @@ -113,8 +114,8 @@ class _VendorViewFullwidthState extends State<VendorViewFullwidth>
padding: const EdgeInsets.symmetric(vertical: 4),
child: CopyToClipboard(
value: vendor.website,
child:
IconText(icon: MdiIcons.earth, text: vendor.website),
child: IconText(
icon: MdiIcons.earth, text: trimUrl(vendor.website)),
),
),
SizedBox(height: 4),
Expand Down
15 changes: 15 additions & 0 deletions lib/utils/review.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:in_app_review/in_app_review.dart';
import 'package:invoiceninja_flutter/constants.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';

class AppReview {
static final InAppReview inAppReview = InAppReview.instance;

static Future<bool> isAvailable() async => await inAppReview.isAvailable();

static void requestReview() => inAppReview.requestReview();

static void openStoreListing() => inAppReview.openStoreListing(
appStoreId: isAndroid() ? kPlayStoreAppId : kAppStoreAppId,
microsoftStoreId: kMicrosoftAppStoreId);
}
12 changes: 12 additions & 0 deletions lib/utils/review.dart.foss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:invoiceninja_flutter/main_app.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
import 'package:url_launcher/url_launcher.dart';

class AppReview {
static Future<bool> isAvailable() async => false;

static void requestReview() => null;

static void openStoreListing() =>
launch(getRateAppURL(navigatorKey.currentContext));
}
10 changes: 10 additions & 0 deletions lib/utils/strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,13 @@ int secondToLastIndexOf(String string, String pattern) {

return string.lastIndexOf(pattern);
}

String trimUrl(String url) {
url = url.replaceFirst('http://', '').replaceFirst('https://', '');

if (url.startsWith('www.')) {
url = url.replaceFirst('www.', '');
}

return url;
}
Loading

0 comments on commit 20fae4a

Please sign in to comment.