Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Jan 16, 2022
2 parents c47ef4c + fd4abea commit 0b79442
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 26 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.70';
const String kClientVersion = '5.0.71';
const String kMinServerVersion = '5.0.4';

const String kAppName = 'Invoice Ninja';
Expand Down
7 changes: 4 additions & 3 deletions lib/data/file_storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:flutter/foundation.dart';

// Package imports:
import 'package:archive/archive.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
import 'package:shared_preferences/shared_preferences.dart';

//import 'package:idb_shim/idb.dart';
Expand All @@ -28,10 +29,10 @@ class FileStorage {
Future<File> _getLocalFile() async {
final dir = await getDirectory();

if (kIsWeb || Platform.isAndroid || Platform.isIOS) {
return File('${dir.path}/invoiceninja__$tag.json');
} else {
if (isWindows() || isLinux()) {
return File('${dir.path}/invoiceninja/$tag.json');
} else {
return File('${dir.path}/invoiceninja__$tag.json');
}
}

Expand Down
5 changes: 0 additions & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,6 @@ void main({bool isTesting = false}) async {
doWhenWindowReady(() {
final win = appWindow;
win.title = 'Invoice Ninja';
//const initialSize = Size(600, 450);
//win.minSize = initialSize;
//win.size = initialSize;
//win.alignment = Alignment.center;
//win.maximize();
win.show();
});
}
Expand Down
3 changes: 2 additions & 1 deletion lib/ui/app/main_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_redux/flutter_redux.dart';
import 'package:invoiceninja_flutter/ui/app/app_title_bar.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
import 'package:redux/redux.dart';

// Project imports:
Expand Down Expand Up @@ -295,7 +296,7 @@ class MainScreen extends StatelessWidget {
policy: ReadingOrderTraversalPolicy(),
child: Column(
children: [
AppTitleBar(),
if (isDesktopOS()) AppTitleBar(),
Expanded(
child: ChangeLayoutBanner(
appLayout: prefState.appLayout,
Expand Down
22 changes: 18 additions & 4 deletions lib/ui/app/menu_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,15 @@ class MenuDrawer extends StatelessWidget {
onSelected: (String companyId) {
if (companyId == 'logout') {
viewModel.onLogoutTap(context);
} else if (!state.isLoaded || state.isLoading || state.isSaving) {
} else if (state.isLoading) {
showMessageDialog(
context: context, message: localization.waitForLoading);
return;
} else if (state.isSaving) {
showMessageDialog(
context: context, message: localization.waitForSaving);
return;
} else if (!state.isLoaded) {
showMessageDialog(
context: context, message: localization.waitForData);
return;
Expand Down Expand Up @@ -221,9 +229,15 @@ class MenuDrawer extends StatelessWidget {
onChanged: (dynamic value) {
if (value == 'logout' && !state.isLoading && !state.isSaving) {
viewModel.onLogoutTap(context);
} else if (!state.isLoaded ||
state.isLoading ||
state.isSaving) {
} else if (state.isLoading) {
showMessageDialog(
context: context, message: localization.waitForLoading);
return;
} else if (state.isSaving) {
showMessageDialog(
context: context, message: localization.waitForSaving);
return;
} else if (!state.isLoaded) {
showMessageDialog(
context: context, message: localization.waitForData);
return;
Expand Down
10 changes: 10 additions & 0 deletions lib/utils/i18n.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
static final Map<String, Map<String, String>> _localizedValues = {
'en': {
// STARTER: lang key - do not remove comment
'wait_for_loading': 'Data loading - please wait for it to complete',
'wait_for_saving': 'Data saving - please wait for it to complete',
'html_preview_warning':
'Note: changes made here are only previewed, they must be applied in the tabs above to be saved',
'remaining': 'Remaining',
Expand Down Expand Up @@ -70925,6 +70927,14 @@ mixin LocalizationsProvider on LocaleCodeAware {
_localizedValues[localeCode]['html_preview_warning'] ??
_localizedValues['en']['html_preview_warning'];

String get waitForLoading =>
_localizedValues[localeCode]['wait_for_loading'] ??
_localizedValues['en']['wait_for_loading'];

String get waitForSaving =>
_localizedValues[localeCode]['wait_for_saving'] ??
_localizedValues['en']['wait_for_saving'];

// STARTER: lang field - do not remove comment

String lookup(String key) {
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 @@ -420,13 +420,13 @@
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 68;
CURRENT_PROJECT_VERSION = 70;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 5.0.68;
MARKETING_VERSION = 5.0.71;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
Expand Down Expand Up @@ -548,13 +548,13 @@
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 68;
CURRENT_PROJECT_VERSION = 70;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 5.0.68;
MARKETING_VERSION = 5.0.71;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -570,13 +570,13 @@
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 68;
CURRENT_PROJECT_VERSION = 70;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 5.0.68;
MARKETING_VERSION = 5.0.71;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
Expand Down
4 changes: 2 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.70+70
version: 5.0.71+71
homepage: https://invoiceninja.com
documentation: https://invoiceninja.github.io
publish_to: none
Expand Down Expand Up @@ -90,7 +90,7 @@ msix_config:
display_name: Invoice Ninja
publisher_display_name: Invoice Ninja
identity_name: InvoiceNinja.InvoiceNinja
msix_version: 5.0.70.0
msix_version: 5.0.71.0
publisher: CN=2B7AA393-06A0-46F5-AF85-1917142440C3
architecture: x64
capabilities: 'internetClient'
Expand Down
4 changes: 2 additions & 2 deletions pubspec.next.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.70+70
version: 5.0.71+71
homepage: https://invoiceninja.com
documentation: https://invoiceninja.github.io
publish_to: none
Expand Down Expand Up @@ -90,7 +90,7 @@ msix_config:
display_name: Invoice Ninja
publisher_display_name: Invoice Ninja
identity_name: InvoiceNinja.InvoiceNinja
msix_version: 5.0.70.0
msix_version: 5.0.71.0
publisher: CN=2B7AA393-06A0-46F5-AF85-1917142440C3
architecture: x64
capabilities: 'internetClient'
Expand Down
4 changes: 2 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.70+70
version: 5.0.71+71
homepage: https://invoiceninja.com
documentation: https://invoiceninja.github.io
publish_to: none
Expand Down Expand Up @@ -90,7 +90,7 @@ msix_config:
display_name: Invoice Ninja
publisher_display_name: Invoice Ninja
identity_name: InvoiceNinja.InvoiceNinja
msix_version: 5.0.70.0
msix_version: 5.0.71.0
publisher: CN=2B7AA393-06A0-46F5-AF85-1917142440C3
architecture: x64
capabilities: 'internetClient'
Expand Down

0 comments on commit 0b79442

Please sign in to comment.