Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Mar 27, 2023
2 parents 267843e + b67dc86 commit 9269d2b
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 230 deletions.
49 changes: 1 addition & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,51 +101,4 @@ jobs:
cp ../build/web/main.dart.js.map ./public/main.foss.dart.js.map
git add .
git commit -m 'Admin Portal - Selfhosted'
git push
# build-next:
# name: Build Web - NEXT
# needs: build-main
# env:
# commit_secret: ${{secrets.commit_secret}}
# commit_email: ${{secrets.commit_email}}
# commit_name: ${{secrets.commit_name}}
# api_secret: ${{secrets.api_secret}}
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v1
# - uses: subosito/flutter-action@v1
# with:
# flutter-version: '3.3.0'
# - name: Setup Flutter
# run: |
# flutter doctor -v
# cp pubspec.next.yaml pubspec.yaml
# rm pubspec.lock
# flutter pub get
# flutter config --enable-web
# - name: Prepare App
# run: |
# cp lib/.env.dart.example lib/.env.dart
# sed -i 's/secret/${{secrets.api_secret}}/g' lib/.env.dart
# echo "const FLUTTER_VERSION = const <String, String>" > lib/flutter_version.dart
# flutter --version --machine >> lib/flutter_version.dart
# echo ";" >> lib/flutter_version.dart
# - name: Build Hosted App
# run: |
# flutter build web
#
# sed -i '/index.html/d' build/web/flutter_service_worker.js
#
# git config --global user.email ${{secrets.commit_email}}
# git config --global user.name ${{secrets.commit_name}}
#
# git clone https://${{secrets.commit_secret}}@github.com/invoiceninja/invoiceninja.git
# cd invoiceninja
#
# git checkout v5-develop
# cp ../build/web/main.dart.js ./public/main.next.dart.js
# git add .
# git commit -m 'Admin Portal - Next'
# git push
# cd ..
git push
12 changes: 6 additions & 6 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CURRENT_PROJECT_VERSION = 111;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = NPC44Y2C98;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand All @@ -373,7 +373,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.111;
MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)";
PRODUCT_BUNDLE_IDENTIFIER = com.invoiceninja.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -497,7 +497,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CURRENT_PROJECT_VERSION = 111;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = NPC44Y2C98;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand All @@ -506,7 +506,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.111;
MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)";
PRODUCT_BUNDLE_IDENTIFIER = com.invoiceninja.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand All @@ -524,7 +524,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CURRENT_PROJECT_VERSION = 111;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = NPC44Y2C98;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand All @@ -533,7 +533,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.111;
MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)";
PRODUCT_BUNDLE_IDENTIFIER = com.invoiceninja.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down
6 changes: 3 additions & 3 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.111';
const String kClientVersion = '5.0.112';
const String kMinServerVersion = '5.0.4';

const String kAppName = 'Invoice Ninja';
Expand All @@ -31,7 +31,7 @@ const String kSourceCodeFrontendSDK = 'https://pub.dev/packages/invoiceninja';
const String kPlayStoreAppId = 'com.invoiceninja.app';
const String kAppStoreAppId = 'id1503970375';

const String kMicrosoftAppStoreId = '9n3f2bbcfdr6';
const String kMicrosoftAppStoreId = '9N3F2BBCFDR6';
const String kAppleStoreUrl =
'https://apps.apple.com/us/app/invoice-ninja-v5/$kAppStoreAppId';
const String kGoogleStoreUrl =
Expand All @@ -41,7 +41,7 @@ const String kGoogleFDroidUrl =
const String kMacOSUrl = 'https://apps.apple.com/app/id1503970375';
const String kLinuxUrl = 'https://snapcraft.io/invoiceninja';
const String kWindowsUrl =
'https://apps.microsoft.com/store/detail/invoice-ninja/9N3F2BBCFDR6';
'https://apps.microsoft.com/store/detail/invoice-ninja/$kMicrosoftAppStoreId';

const String kSlackUrl = 'http://slack.invoiceninja.com';
const String kGitHubUrl = 'https://github.com/invoiceninja';
Expand Down
11 changes: 8 additions & 3 deletions lib/data/models/invoice_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:invoiceninja_flutter/redux/app/app_state.dart';
import 'package:invoiceninja_flutter/redux/client/client_selectors.dart';
import 'package:invoiceninja_flutter/utils/formatting.dart';
import 'package:invoiceninja_flutter/utils/money.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
import 'package:invoiceninja_flutter/utils/strings.dart';

part 'invoice_model.g.dart';
Expand Down Expand Up @@ -1029,16 +1030,20 @@ abstract class InvoiceEntity extends Object
actions.add(EntityAction.stop);
}

actions.add(EntityAction.updatePrices);
actions.add(EntityAction.increasePrices);
if (supportsLatestFeatures()) {
actions.add(EntityAction.updatePrices);
actions.add(EntityAction.increasePrices);
}
} else {
if (!isCancelledOrReversed) {
if (multiselect) {
actions.add(EntityAction.bulkSendEmail);
} else {
actions.add(EntityAction.sendEmail);
if (isUnpaid) {
actions.add(EntityAction.schedule);
if (supportsLatestFeatures()) {
actions.add(EntityAction.schedule);
}
}
}
}
Expand Down
25 changes: 13 additions & 12 deletions lib/ui/settings/invoice_design.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1071,18 +1071,19 @@ class _InvoiceDesignState extends State<InvoiceDesign>
),
),
),
FormCard(
isLast: true,
child: SwitchListTile(
title: Text(localization.shareInvoiceQuoteColumns),
value: settings.shareInvoiceQuoteColumns ?? true,
activeColor: Theme.of(context).colorScheme.secondary,
onChanged: (value) {
viewModel.onSettingsChanged(settings.rebuild(
(b) => b..shareInvoiceQuoteColumns = value));
},
),
)
if (supportsLatestFeatures())
FormCard(
isLast: true,
child: SwitchListTile(
title: Text(localization.shareInvoiceQuoteColumns),
value: settings.shareInvoiceQuoteColumns ?? true,
activeColor: Theme.of(context).colorScheme.secondary,
onChanged: (value) {
viewModel.onSettingsChanged(settings.rebuild(
(b) => b..shareInvoiceQuoteColumns = value));
},
),
)
],
),
if (settings.shareInvoiceQuoteColumns == false)
Expand Down
16 changes: 9 additions & 7 deletions lib/ui/settings/payment_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart';
import 'package:invoiceninja_flutter/ui/settings/payment_settings_vm.dart';
import 'package:invoiceninja_flutter/utils/formatting.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';

class PaymentSettings extends StatefulWidget {
const PaymentSettings({
Expand Down Expand Up @@ -246,13 +247,14 @@ class _PaymentSettingsState extends State<PaymentSettings> {
decimal: true, signed: true),
),
),
BoolDropdownButton(
label: localization.clientInitiatedPayments,
value: settings.clientInitiatedPayments,
helpLabel: localization.clientInitiatedPaymentsHelp,
onChanged: (value) => viewModel.onSettingsChanged(
settings.rebuild((b) => b..clientInitiatedPayments = value)),
),
if (supportsLatestFeatures())
BoolDropdownButton(
label: localization.clientInitiatedPayments,
value: settings.clientInitiatedPayments,
helpLabel: localization.clientInitiatedPaymentsHelp,
onChanged: (value) => viewModel.onSettingsChanged(settings
.rebuild((b) => b..clientInitiatedPayments = value)),
),
if (settings.clientInitiatedPayments == true)
Padding(
padding: const EdgeInsets.only(top: 16),
Expand Down
35 changes: 19 additions & 16 deletions lib/ui/settings/task_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:invoiceninja_flutter/ui/settings/task_settings_vm.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';

class TaskSettings extends StatefulWidget {
const TaskSettings({
Expand Down Expand Up @@ -123,22 +124,24 @@ class _TaskSettingsState extends State<TaskSettings> {
onChanged: (value) => viewModel.onCompanyChanged(
company.rebuild((b) => b..showTaskEndDate = value)),
),
SwitchListTile(
activeColor: Theme.of(context).colorScheme.secondary,
title: Text(localization.showTaskItemDescription),
value: settings.showTaskItemDescription,
subtitle: Text(localization.showTaskItemDescriptionHelp),
onChanged: (value) => viewModel.onSettingsChanged(settings
.rebuild((b) => b..showTaskItemDescription = value)),
),
SwitchListTile(
activeColor: Theme.of(context).colorScheme.secondary,
title: Text(localization.allowBillableTaskItems),
value: settings.allowBillableTaskItems,
subtitle: Text(localization.allowBillableTaskItemsHelp),
onChanged: (value) => viewModel.onSettingsChanged(
settings.rebuild((b) => b..allowBillableTaskItems = value)),
),
if (supportsLatestFeatures()) ...[
SwitchListTile(
activeColor: Theme.of(context).colorScheme.secondary,
title: Text(localization.showTaskItemDescription),
value: settings.showTaskItemDescription,
subtitle: Text(localization.showTaskItemDescriptionHelp),
onChanged: (value) => viewModel.onSettingsChanged(settings
.rebuild((b) => b..showTaskItemDescription = value)),
),
SwitchListTile(
activeColor: Theme.of(context).colorScheme.secondary,
title: Text(localization.allowBillableTaskItems),
value: settings.allowBillableTaskItems,
subtitle: Text(localization.allowBillableTaskItemsHelp),
onChanged: (value) => viewModel.onSettingsChanged(settings
.rebuild((b) => b..allowBillableTaskItems = value)),
),
],
]
]),
if (!viewModel.state.settingsUIState.isFiltered)
Expand Down
6 changes: 2 additions & 4 deletions lib/utils/platforms.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ bool supportsAppleOAuth() => kIsWeb || isApple();
// TODO remove this function
bool supportsMicrosoftOAuth() => kIsWeb;

/*
bool supportsSchedules() {
bool supportsLatestFeatures() {
final store = StoreProvider.of<AppState>(navigatorKey.currentContext);
final state = store.state;

Expand All @@ -60,9 +59,8 @@ bool supportsSchedules() {
return true;
}

return Version.parse(state.account.currentVersion) >= Version.parse('5.5.74');
return Version.parse(state.account.currentVersion) >= Version.parse('5.5.99');
}
*/

bool supportsInAppPurchase() {
final store = StoreProvider.of<AppState>(navigatorKey.currentContext);
Expand Down
12 changes: 6 additions & 6 deletions macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 111;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = NPC44Y2C98;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
Expand All @@ -431,7 +431,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 5.0.111;
MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
Expand Down Expand Up @@ -554,7 +554,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 111;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = NPC44Y2C98;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
Expand All @@ -563,7 +563,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 5.0.111;
MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -580,7 +580,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 111;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = NPC44Y2C98;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
Expand All @@ -589,7 +589,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 5.0.111;
MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
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.111+111
version: 5.0.112+112
homepage: https://invoiceninja.com
documentation: https://invoiceninja.github.io
publish_to: none
Expand Down
Loading

0 comments on commit 9269d2b

Please sign in to comment.