Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Dec 11, 2022
2 parents 597d971 + c2376fb commit 0f136b4
Show file tree
Hide file tree
Showing 13 changed files with 168 additions and 163 deletions.
12 changes: 6 additions & 6 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,15 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CURRENT_PROJECT_VERSION = 102;
CURRENT_PROJECT_VERSION = 103;
DEVELOPMENT_TEAM = NPC44Y2C98;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.102;
MARKETING_VERSION = 5.0.103;
PRODUCT_BUNDLE_IDENTIFIER = com.invoiceninja.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -512,15 +512,15 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CURRENT_PROJECT_VERSION = 102;
CURRENT_PROJECT_VERSION = 103;
DEVELOPMENT_TEAM = NPC44Y2C98;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.102;
MARKETING_VERSION = 5.0.103;
PRODUCT_BUNDLE_IDENTIFIER = com.invoiceninja.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand All @@ -538,15 +538,15 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CURRENT_PROJECT_VERSION = 102;
CURRENT_PROJECT_VERSION = 103;
DEVELOPMENT_TEAM = NPC44Y2C98;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 5.0.102;
MARKETING_VERSION = 5.0.103;
PRODUCT_BUNDLE_IDENTIFIER = com.invoiceninja.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down
4 changes: 3 additions & 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.102';
const String kClientVersion = '5.0.103';
const String kMinServerVersion = '5.0.4';

const String kAppName = 'Invoice Ninja';
Expand Down Expand Up @@ -304,6 +304,7 @@ const String kGatewayTypeACSS = '19';
const String kGatewayTypeBECS = '20';
const String kGatewayTypeInstantBankPay = '21';
const String kGatewayTypeFPX = '22';
const String kGatewayTypeKlarna = '23';

const kGatewayTypes = {
kGatewayTypeCreditCard: 'credit_card',
Expand All @@ -328,6 +329,7 @@ const kGatewayTypes = {
kGatewayTypeBECS: 'becs',
kGatewayTypeInstantBankPay: 'instant_bank_pay',
kGatewayTypeFPX: 'fpx',
kGatewayTypeKlarna: 'klarna',
};

const String kNotificationChannelEmail = 'email';
Expand Down
8 changes: 7 additions & 1 deletion lib/ui/app/copy_to_clipboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,16 @@ class CopyToClipboard extends StatelessWidget {
final localization = AppLocalization.of(context);
final onTap = () {
Clipboard.setData(ClipboardData(text: value));

var valueStr = value.replaceAll('\n', ' ');
if (value.length > 20) {
valueStr = value.substring(0, 20) + '...';
}

showToast(
localization.copiedToClipboard.replaceFirst(
':value',
value.replaceAll('\n', ' '),
'"$valueStr"',
),
);
};
Expand Down
14 changes: 9 additions & 5 deletions lib/ui/app/icon_message.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Flutter imports:
import 'package:flutter/material.dart';
import 'package:invoiceninja_flutter/ui/app/copy_to_clipboard.dart';

class IconMessage extends StatelessWidget {
const IconMessage(
Expand Down Expand Up @@ -29,11 +30,14 @@ class IconMessage extends StatelessWidget {
),
SizedBox(width: 16),
Expanded(
child: Text(
text,
maxLines: null,
style: TextStyle(
color: Colors.white,
child: CopyToClipboard(
value: text,
child: Text(
text,
maxLines: null,
style: TextStyle(
color: Colors.white,
),
),
),
),
Expand Down
188 changes: 90 additions & 98 deletions lib/ui/transaction/view/transaction_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1123,110 +1123,102 @@ class _MatchWithdrawalsState extends State<_MatchWithdrawals> {
),
),
ListDivider(),
Expanded(
child: Column(
children: [
Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.only(
left: 22, top: 12, right: 10, bottom: 12),
child: SearchText(
filterController: _categoryFilterController,
focusNode: _categoryFocusNode,
onChanged: (value) {
setState(() {
updateCategoryList();
});
},
onCleared: () {
setState(() {
_categoryFilterController.text = '';
updateCategoryList();
});
},
placeholder: localization.searchCategories
.replaceFirst(':count ', '')),
),
),
IconButton(
onPressed: () {
final completer =
snackBarCompleter<ExpenseCategoryEntity>(
context,
localization.createdExpenseCategory);
createEntity(
context: context,
entity: ExpenseCategoryEntity(
state: viewModel.state),
force: true,
completer: completer,
cancelCompleter: Completer<Null>()
..future.then((_) {
store.dispatch(UpdateCurrentRoute(
TransactionScreen.route));
}));
completer.future
.then((SelectableEntity category) {
store.dispatch(SaveTransactionSuccess(
transaction.rebuild((b) =>
b..pendingCategoryId = category.id)));
store.dispatch(UpdateCurrentRoute(
TransactionScreen.route));
Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.only(
left: 22, top: 12, right: 10, bottom: 12),
child: SearchText(
filterController: _categoryFilterController,
focusNode: _categoryFocusNode,
onChanged: (value) {
setState(() {
updateCategoryList();
});
},
icon: Icon(Icons.add),
),
SizedBox(width: 8),
],
),
ListDivider(),
Expanded(
child: Scrollbar(
thumbVisibility: true,
controller: _categoryScrollController,
child: ListView.separated(
controller: _categoryScrollController,
separatorBuilder: (context, index) => ListDivider(),
itemCount: _categories.length,
itemBuilder: (BuildContext context, int index) {
final category = _categories[index];
return ExpenseCategoryListItem(
expenseCategory: category,
showCheck: true,
isChecked: _selectedCategory?.id == category.id,
onTap: () => setState(() {
if (_selectedCategory?.id == category.id) {
_selectedCategory = null;
} else {
_selectedCategory = category;
}
updateCategoryList();
store.dispatch(SaveTransactionSuccess(
transaction.rebuild((b) => b
..pendingCategoryId =
_selectedCategory?.id)));
}),
);
onCleared: () {
setState(() {
_categoryFilterController.text = '';
updateCategoryList();
});
},
),
),
placeholder: localization.searchCategories
.replaceFirst(':count ', '')),
),
if (transaction.category.isNotEmpty &&
_selectedCategory == null)
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16, vertical: 12),
child: Text(
'${localization.defaultCategory}: ${transaction.category}',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey),
),
),
],
),
IconButton(
onPressed: () {
final completer =
snackBarCompleter<ExpenseCategoryEntity>(
context, localization.createdExpenseCategory);
createEntity(
context: context,
entity:
ExpenseCategoryEntity(state: viewModel.state),
force: true,
completer: completer,
cancelCompleter: Completer<Null>()
..future.then((_) {
store.dispatch(UpdateCurrentRoute(
TransactionScreen.route));
}));
completer.future.then((SelectableEntity category) {
store.dispatch(SaveTransactionSuccess(
transaction.rebuild(
(b) => b..pendingCategoryId = category.id)));
store.dispatch(
UpdateCurrentRoute(TransactionScreen.route));
});
},
icon: Icon(Icons.add),
),
SizedBox(width: 8),
],
),
ListDivider(),
Expanded(
child: Scrollbar(
thumbVisibility: true,
controller: _categoryScrollController,
child: ListView.separated(
controller: _categoryScrollController,
separatorBuilder: (context, index) => ListDivider(),
itemCount: _categories.length,
itemBuilder: (BuildContext context, int index) {
final category = _categories[index];
return ExpenseCategoryListItem(
expenseCategory: category,
showCheck: true,
isChecked: _selectedCategory?.id == category.id,
onTap: () => setState(() {
if (_selectedCategory?.id == category.id) {
_selectedCategory = null;
} else {
_selectedCategory = category;
}
updateCategoryList();
store.dispatch(SaveTransactionSuccess(
transaction.rebuild((b) => b
..pendingCategoryId =
_selectedCategory?.id)));
}),
);
},
),
),
),
if (transaction.category.isNotEmpty &&
_selectedCategory == null)
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16, vertical: 12),
child: Text(
'${localization.defaultCategory}: ${transaction.category}',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey),
),
),
],
),
),
Expand Down
Loading

0 comments on commit 0f136b4

Please sign in to comment.