Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed May 24, 2023
2 parents 68279df + 50b61d3 commit d2e2d37
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 16 deletions.
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.117';
const String kClientVersion = '5.0.118';
const String kMinServerVersion = '5.0.4';

const String kAppName = 'Invoice Ninja';
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/settings/email_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ class _EmailSettingsState extends State<EmailSettings> {
onChanged: (value) => viewModel.onSettingsChanged(
settings.rebuild((b) => b..ublEmailAttachment = value)),
),
if (supportsLatestFeatures())
if (supportsLatestFeatures(null))
BoolDropdownButton(
label: localization.enableEInvoice,
value: settings.enableEInvoice,
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/settings/settings_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ class SettingsSearch extends StatelessWidget {
[
'tax_settings',
'inclusive_taxes',
if (supportsLatestFeatures()) 'calculate_taxes#2023-04-26',
if (supportsLatestFeatures('5.6.0')) 'calculate_taxes#2023-04-26',
],
],
kSettingsTaxRates: [
Expand Down Expand Up @@ -623,7 +623,7 @@ class SettingsSearch extends StatelessWidget {
'mailgun#2023-01-11',
'email_alignment#2023-01-17',
'show_email_footer#2023-01-17',
if (supportsLatestFeatures()) 'enable_e_invoice#2023-04-27,'
if (supportsLatestFeatures(null)) 'enable_e_invoice#2023-04-27,'
],
],
kSettingsTemplatesAndReminders: [
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/settings/tax_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class _TaxSettingsState extends State<TaxSettings> {
onPressed: () => viewModel.onConfigureRatesPressed(context),
),
),
if (supportsLatestFeatures())
if (supportsLatestFeatures('5.6.0'))
FormCard(
isLast: true,
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down
7 changes: 4 additions & 3 deletions lib/ui/task_status/task_status_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ class _TaskStatusListState extends State<TaskStatusList> {
if (newIndex > widget.viewModel.taskStatusList.length) {
newIndex = widget.viewModel.taskStatusList.length;
}
if (oldIndex < newIndex) {
newIndex--;
}

//if (oldIndex < newIndex) {
// newIndex--;
//}

widget.viewModel.onSortChanged(oldIndex, newIndex);
},
Expand Down
2 changes: 0 additions & 2 deletions lib/ui/task_status/task_status_list_item.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Flutter imports:
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

// Package imports:
Expand Down Expand Up @@ -81,7 +80,6 @@ class TaskStatusListItem extends StatelessWidget {
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (!kReleaseMode) Text('Sort: ${taskStatus.statusOrder}'),
subtitle != null && subtitle.isNotEmpty
? Text(
subtitle,
Expand Down
13 changes: 10 additions & 3 deletions lib/utils/platforms.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,23 @@ bool supportsAppleOAuth() => kIsWeb || isApple();
// TODO remove this function
bool supportsMicrosoftOAuth() => kIsWeb;

bool supportsLatestFeatures() {
bool supportsLatestFeatures(String version) {
final store = StoreProvider.of<AppState>(navigatorKey.currentContext);
final state = store.state;

if (!kReleaseMode || state.isStaging) {
return true;
}

return Version.parse(state.account.currentVersion) >=
Version.parse('5.5.118');
if (state.isSelfHosted) {
return true;
}

if (version == null) {
return false;
}

return Version.parse(state.account.currentVersion) >= Version.parse(version);
}

bool supportsInAppPurchase() {
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.117+117
version: 5.0.118+118
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.117+117
version: 5.0.118+118
homepage: https://invoiceninja.com
documentation: https://invoiceninja.github.io
publish_to: none
Expand Down
3 changes: 2 additions & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: invoiceninja
version: '5.0.117
version: '5.0.118'
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 Expand Up @@ -31,6 +31,7 @@ apps:
plugs:
- network
- home
- desktop

parts:
invoiceninja:
Expand Down

0 comments on commit d2e2d37

Please sign in to comment.