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 5, 2022
2 parents a564235 + 531388f commit b9658f5
Show file tree
Hide file tree
Showing 19 changed files with 338 additions and 71 deletions.
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 = 85;
CURRENT_PROJECT_VERSION = 86;
DEVELOPMENT_TEAM = NPC44Y2C98;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.85;
MARKETING_VERSION = 5.0.86;
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 = 85;
CURRENT_PROJECT_VERSION = 86;
DEVELOPMENT_TEAM = NPC44Y2C98;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.85;
MARKETING_VERSION = 5.0.86;
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 = 85;
CURRENT_PROJECT_VERSION = 86;
DEVELOPMENT_TEAM = NPC44Y2C98;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.85;
MARKETING_VERSION = 5.0.86;
PRODUCT_BUNDLE_IDENTIFIER = com.invoiceninja.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down
6 changes: 4 additions & 2 deletions lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ 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 kMicrosoftAppStoreId = '9n3f2bbcfdr6';
const String kAppleStoreUrl =
'https://apps.apple.com/us/app/invoice-ninja-v5/id1503970375';
const String kGoogleStoreUrl =
'https://play.google.com/store/apps/details?id=com.invoiceninja.app';
'https://play.google.com/store/apps/details?id=$kAppStoreId';
const String kGoogleFDroidUrl =
'https://f-droid.org/packages/com.invoiceninja.app';
const String kMacOSUrl = 'https://apps.apple.com/app/id1503970375';
const String kLinuxUrl = 'https://snapcraft.io/invoiceninja';
const String kWindowsUrl =
'https://www.microsoft.com/en-us/p/invoice-ninja/9n3f2bbcfdr6';
'https://www.microsoft.com/en-us/p/invoice-ninja/$kMicrosoftAppStoreId';

const String kSlackUrl = 'http://slack.invoiceninja.com';
const String kGitHubUrl = 'https://github.com/invoiceninja';
Expand Down
3 changes: 3 additions & 0 deletions lib/data/models/company_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,9 @@ abstract class CompanyEntity extends Object
return true;
}

int get daysActive =>
DateTime.now().difference(convertTimestampToDate(createdAt)).inDays;

String get currencyId => settings.currencyId ?? kDefaultCurrencyId;

bool get supportsQrIban => settings.countryId == kCountrySwitzerland;
Expand Down
1 change: 1 addition & 0 deletions lib/data/models/invoice_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class InvoiceFields {
static const String dueDate = 'due_date';
static const String nextSendDate = 'next_send_date';
static const String lastSentDate = 'last_sent_date';
static const String lastSentTemplate = 'last_sent_template';
static const String terms = 'terms';
static const String footer = 'footer';
static const String partial = 'partial_due';
Expand Down
2 changes: 2 additions & 0 deletions lib/redux/app/app_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ class DismissNativeWarningPermanently implements PersistUI, PersistPrefs {}

class DismissGatewayWarningPermanently implements PersistUI, PersistPrefs {}

class DismissReviewAppPermanently implements PersistUI, PersistPrefs {}

class ViewMainScreen {
ViewMainScreen({this.addDelay = false});

Expand Down
7 changes: 7 additions & 0 deletions lib/redux/ui/pref_reducer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ PrefState prefReducer(
hideDesktopWarningReducer(state.hideDesktopWarning, action)
..hideGatewayWarning =
hideGatewayWarningReducer(state.hideGatewayWarning, action)
..hideReviewApp = hideReviewAppReducer(state.hideReviewApp, action)
..textScaleFactor = textScaleFactorReducer(state.textScaleFactor, action)
..isMenuVisible = menuVisibleReducer(state.isMenuVisible, action)
..isHistoryVisible = historyVisibleReducer(state.isHistoryVisible, action)
Expand Down Expand Up @@ -242,6 +243,12 @@ Reducer<bool> hideGatewayWarningReducer = combineReducers([
}),
]);

Reducer<bool> hideReviewAppReducer = combineReducers([
TypedReducer<bool, DismissReviewAppPermanently>((filter, action) {
return true;
}),
]);

Reducer<int> filterClearedAtReducer = combineReducers([
TypedReducer<int, FilterCompany>((filterClearedAt, action) {
return action.filter == null
Expand Down
4 changes: 4 additions & 0 deletions lib/redux/ui/pref_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ abstract class PrefState implements Built<PrefState, PrefStateBuilder> {
tapSelectedToEdit: false,
hideDesktopWarning: false,
hideGatewayWarning: false,
hideReviewApp: false,
showKanban: false,
showPdfPreview: true,
persistData: false,
Expand Down Expand Up @@ -148,6 +149,8 @@ abstract class PrefState implements Built<PrefState, PrefStateBuilder> {

bool get hideGatewayWarning;

bool get hideReviewApp;

bool get editAfterSaving;

double get textScaleFactor;
Expand Down Expand Up @@ -229,6 +232,7 @@ abstract class PrefState implements Built<PrefState, PrefStateBuilder> {
..isFilterVisible = false
..hideDesktopWarning = false
..hideGatewayWarning = false
..hideReviewApp = false
..tapSelectedToEdit = false
..persistData = false
..persistUI = true
Expand Down
53 changes: 37 additions & 16 deletions lib/redux/ui/pref_state.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 13 additions & 7 deletions lib/ui/app/menu_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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';
Expand Down Expand Up @@ -41,7 +42,6 @@ import 'package:invoiceninja_flutter/ui/app/scrollable_listview.dart';
import 'package:invoiceninja_flutter/ui/system/update_dialog.dart';
import 'package:invoiceninja_flutter/utils/colors.dart';
import 'package:invoiceninja_flutter/utils/dialogs.dart';
import 'package:invoiceninja_flutter/utils/formatting.dart';
import 'package:invoiceninja_flutter/utils/icons.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
Expand Down Expand Up @@ -1166,10 +1166,6 @@ void _showAbout(BuildContext context) async {
height: 40.0,
);

final daysActive = DateTime.now()
.difference(convertTimestampToDate(state.company.createdAt))
.inDays;

showDialog<Null>(
context: context,
builder: (BuildContext context) {
Expand Down Expand Up @@ -1374,12 +1370,22 @@ void _showAbout(BuildContext context) async {
onPressed: () => _showUpdate(context),
),
],
if (daysActive > 30)
if (state.company.daysActive > 30)
AppButton(
label: localization.reviewApp.toUpperCase(),
iconData: Icons.star,
color: Colors.purple,
onPressed: () => launch(getRateAppURL(context)),
onPressed: () {
if (kIsWeb || isLinux()) {
launch(getRateAppURL(context));
} else {
final InAppReview inAppReview = InAppReview.instance;
inAppReview.openStoreListing(
appStoreId: kAppStoreId,
microsoftStoreId: kMicrosoftAppStoreId,
);
}
},
),
SizedBox(height: 22),
Wrap(
Expand Down
Loading

0 comments on commit b9658f5

Please sign in to comment.