Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New UI for the transaction form page, allowing inversed/reversed transactions to track refunds and debts #186

Merged
merged 25 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift click to select a range
6406421
feat(ux/ui): Change the transaction form UX
enrique-lozano Jul 22, 2024
83ca3ce
refactor: Rename `TransactionType` enum
enrique-lozano Jul 22, 2024
148ab42
fix: Reduce currency font size also on negative amounts
enrique-lozano Jul 22, 2024
61b9e91
feat: Add tr. type to the transactions table in DB
enrique-lozano Jul 23, 2024
c10f523
fix: Adjust graphs to accept reversed transactions
enrique-lozano Jul 23, 2024
c246e89
fix: Regenerate database queries
enrique-lozano Jul 23, 2024
2d97d00
feat: Add indicator for reversed transactions
enrique-lozano Jul 23, 2024
d7dfb3f
Merge branch 'develop' into feat/allow-positive-expenses
enrique-lozano Jul 24, 2024
1d06fbc
fix: Sign when changing the transaction type
enrique-lozano Jul 24, 2024
4cfb56e
feat: Disable the status selector on future transactions
enrique-lozano Jul 24, 2024
6cd6ea7
fix: Transfer form validations
enrique-lozano Jul 24, 2024
d17b3a4
feat: Hide negative toggle button on transfers
enrique-lozano Jul 24, 2024
9f1ccdf
feat(literals): Change note textarea placeholder
enrique-lozano Jul 24, 2024
4d33135
fix: Use account currency
enrique-lozano Jul 24, 2024
a0b9afc
fix: Prevent transaction form to resize on keyboard
enrique-lozano Jul 24, 2024
4af5c46
fix: Status selector scrolling issues
enrique-lozano Jul 24, 2024
a610d8e
Merge branch 'develop' into feat/allow-positive-expenses
enrique-lozano Jul 25, 2024
0a9bf03
fix(ux/ui): Description textarea color
enrique-lozano Jul 25, 2024
6134d1c
Merge branch 'develop' into feat/allow-positive-expenses
enrique-lozano Aug 1, 2024
8120682
fix: Category picker only displaying multi-type items
enrique-lozano Aug 1, 2024
db12db6
Merge branch 'develop' into feat/allow-positive-expenses
enrique-lozano Aug 2, 2024
1396732
feat: Improve tag selection in the transaction form
enrique-lozano Aug 2, 2024
9f91ef1
feat: Reversed transaction descriptions and indicators
enrique-lozano Aug 2, 2024
05f4d8e
feat: Improve brand blue color on dark mode
enrique-lozano Aug 3, 2024
6b09675
feat: Value in destiny modal
enrique-lozano Aug 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Improve tag selection in the transaction form
  • Loading branch information
enrique-lozano committed Aug 2, 2024
commit 139673293544b9718338b793d67ba0b97bda273e
98 changes: 38 additions & 60 deletions lib/app/transactions/form/dialogs/transaction_more_info.modal.dart
Original file line number Diff line number Diff line change
@@ -1,12 1,11 @@
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:flutter/material.dart';
import 'package:monekin/app/tags/tags_selector.modal.dart';
import 'package:monekin/core/extensions/color.extensions.dart';
import 'package:monekin/core/extensions/lists.extensions.dart';
import 'package:monekin/core/models/tags/tag.dart';
import 'package:monekin/core/presentation/app_colors.dart';
import 'package:monekin/core/presentation/widgets/bottomSheetFooter.dart';
import 'package:monekin/core/presentation/widgets/modal_container.dart';
import 'package:monekin/core/presentation/widgets/transaction_filter/tags_filter/tags_filter_container.dart';
import 'package:monekin/i18n/translations.g.dart';

part 'transaction_more_info.modal.g.dart';
Expand Down Expand Up @@ -97,71 96,50 @@ class _TransactionMoreInfoModalState extends State<_TransactionMoreInfoModal> {
leading: const Icon(Icons.location_on_outlined),
trailing: const Icon(
Icons.arrow_forward_ios_rounded,
size: 14,
size: 16,
),
title: const Text('Location'),
subtitle: const Text('-22.7832933, 2.8992929'),
onTap: () {},
),
const Divider(),
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: StatefulBuilder(builder: (context, setState) {
return TagsFilterContainer(
headerLabelStyle: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(fontWeight: FontWeight.w700),
headerSpacing: 8,
child: Wrap(
spacing: 6,
runSpacing: 0,
children: [
...List.generate(moreInfoData.tags.length,
(index) {
final tag = moreInfoData.tags[index];

return FilterChip(
label: Text(
tag.name,
style: TextStyle(color: tag.colorData),
),
selected: true,
onSelected: (value) => setState(() {
moreInfoData.tags.removeWhere(
(element) => element.id == tag.id);
}),
showCheckmark: false,
selectedColor: tag.colorData.lighten(0.8),
avatar: tag.displayIcon(),
);
}),
ActionChip(
label: Text(t.tags.add),
avatar: const Icon(Icons.add),
onPressed: () => showTagListModal(context,
modal: TagSelector(
allowEmptySubmit: true,
includeNullTag: false,
selectedTags: moreInfoData.tags,
)).then(
(value) {
if (value != null) {
setState(() {
moreInfoData = moreInfoData.copyWith(
tags: value.nonNulls.toList(),
);
});
}
},
),
),
],
),
);
}),
ListTile(
leading: Icon(Tag.icon),
trailing: const Icon(
Icons.arrow_forward_ios_rounded,
size: 16,
),
title: Text(t.tags.display(n: 2)),
subtitle: Text(
moreInfoData.tags.isEmpty
? t.transaction.form.no_tags
: moreInfoData.tags
.map((t) => t.name)
.printFormatted(),
style: TextStyle(
fontStyle: moreInfoData.tags.isEmpty
? FontStyle.italic
: FontStyle.normal,
),
),
onTap: () {
showTagListModal(context,
modal: TagSelector(
allowEmptySubmit: true,
includeNullTag: false,
selectedTags: moreInfoData.tags,
)).then((value) {
if (value != null) {
setState(() {
moreInfoData = moreInfoData.copyWith(
tags: value.nonNulls.toList(),
);
});
}
});
},
),
const Divider(),
],
),
),
Expand Down
1 change: 1 addition & 0 deletions lib/i18n/strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 315,7 @@
"title.short": "Title",
"value": "Value of the transaction",
"tap-to-see-more": "Tap to see more details",
"no-tags": "-- No tags --",
"description": "Description",
"description-info": "Tap here to enter a more detailed description about this transaction",
"exchange-to-preferred-title": "Exchnage rate to {{ currency }}",
Expand Down
1 change: 1 addition & 0 deletions lib/i18n/strings_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 320,7 @@
},
"title": "Título de la transacción",
"title.short": "Título",
"no-tags": "-- Sin etiquetas --",
"value": "Valor de la transacción",
"tap-to-see-more": "Toca para ver más detalles",
"description": "Descripción",
Expand Down
1 change: 1 addition & 0 deletions lib/i18n/strings_uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 317,7 @@
"title.short": "Назва",
"value": "Сума транзакції",
"tap-to-see-more": "Натисніть, щоб побачити більше деталей",
"no-tags": "-- Немає тегів --",
"description": "Опис",
"description-info": "Натисніть тут, щоб ввести детальніший опис цієї транзакції",
"exchange-to-preferred-title": "Обмінний курс на {{ currency }}",
Expand Down
1 change: 1 addition & 0 deletions lib/i18n/strings_zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 315,7 @@
"title.short": "資質",
"value": "交易價值",
"tap-to-see-more": "點擊查看更多詳細資訊",
"no-tags": "-- 无标签 --",
"description": "描述",
"description-info": "點擊此處輸入有關此交易的更詳細描述",
"exchange-to-preferred-title": "匯率為{{currency}}",
Expand Down
12 changes: 10 additions & 2 deletions lib/i18n/translations.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 4,9 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 4
/// Strings: 2117 (529 per locale)
/// Strings: 2121 (530 per locale)
///
/// Built on 2024-08-01 at 22:10 UTC
/// Built on 2024-08-02 at 17:13 UTC

// coverage:ignore-file
// ignore_for_file: type=lint
Expand Down Expand Up @@ -813,6 813,7 @@ class _TranslationsTransactionFormEn {
String get title_short => 'Title';
String get value => 'Value of the transaction';
String get tap_to_see_more => 'Tap to see more details';
String get no_tags => '-- No tags --';
String get description => 'Description';
String get description_info => 'Tap here to enter a more detailed description about this transaction';
String exchange_to_preferred_title({required Object currency}) => 'Exchnage rate to ${currency}';
Expand Down Expand Up @@ -2062,6 2063,7 @@ class _TranslationsTransactionFormEs implements _TranslationsTransactionFormEn {
@override late final _TranslationsTransactionFormValidatorsEs validators = _TranslationsTransactionFormValidatorsEs._(_root);
@override String get title => 'Título de la transacción';
@override String get title_short => 'Título';
@override String get no_tags => '-- Sin etiquetas --';
@override String get value => 'Valor de la transacción';
@override String get tap_to_see_more => 'Toca para ver más detalles';
@override String get description => 'Descripción';
Expand Down Expand Up @@ -3316,6 3318,7 @@ class _TranslationsTransactionFormUk implements _TranslationsTransactionFormEn {
@override String get title_short => 'Назва';
@override String get value => 'Сума транзакції';
@override String get tap_to_see_more => 'Натисніть, щоб побачити більше деталей';
@override String get no_tags => '-- Немає тегів --';
@override String get description => 'Опис';
@override String get description_info => 'Натисніть тут, щоб ввести детальніший опис цієї транзакції';
@override String exchange_to_preferred_title({required Object currency}) => 'Обмінний курс на ${currency}';
Expand Down Expand Up @@ -4567,6 4570,7 @@ class _TranslationsTransactionFormZhTw implements _TranslationsTransactionFormEn
@override String get title_short => '資質';
@override String get value => '交易價值';
@override String get tap_to_see_more => '點擊查看更多詳細資訊';
@override String get no_tags => '-- 无标签 --';
@override String get description => '描述';
@override String get description_info => '點擊此處輸入有關此交易的更詳細描述';
@override String exchange_to_preferred_title({required Object currency}) => '匯率為${currency}';
Expand Down Expand Up @@ -5448,6 5452,7 @@ extension on Translations {
case 'transaction.form.title_short': return 'Title';
case 'transaction.form.value': return 'Value of the transaction';
case 'transaction.form.tap_to_see_more': return 'Tap to see more details';
case 'transaction.form.no_tags': return '-- No tags --';
case 'transaction.form.description': return 'Description';
case 'transaction.form.description_info': return 'Tap here to enter a more detailed description about this transaction';
case 'transaction.form.exchange_to_preferred_title': return ({required Object currency}) => 'Exchnage rate to ${currency}';
Expand Down Expand Up @@ -6056,6 6061,7 @@ extension on _TranslationsEs {
case 'transaction.form.validators.transfer_between_same_accounts': return 'Las cuentas de origen y destino no pueden coincidir';
case 'transaction.form.title': return 'Título de la transacción';
case 'transaction.form.title_short': return 'Título';
case 'transaction.form.no_tags': return '-- Sin etiquetas --';
case 'transaction.form.value': return 'Valor de la transacción';
case 'transaction.form.tap_to_see_more': return 'Toca para ver más detalles';
case 'transaction.form.description': return 'Descripción';
Expand Down Expand Up @@ -6667,6 6673,7 @@ extension on _TranslationsUk {
case 'transaction.form.title_short': return 'Назва';
case 'transaction.form.value': return 'Сума транзакції';
case 'transaction.form.tap_to_see_more': return 'Натисніть, щоб побачити більше деталей';
case 'transaction.form.no_tags': return '-- Немає тегів --';
case 'transaction.form.description': return 'Опис';
case 'transaction.form.description_info': return 'Натисніть тут, щоб ввести детальніший опис цієї транзакції';
case 'transaction.form.exchange_to_preferred_title': return ({required Object currency}) => 'Обмінний курс на ${currency}';
Expand Down Expand Up @@ -7276,6 7283,7 @@ extension on _TranslationsZhTw {
case 'transaction.form.title_short': return '資質';
case 'transaction.form.value': return '交易價值';
case 'transaction.form.tap_to_see_more': return '點擊查看更多詳細資訊';
case 'transaction.form.no_tags': return '-- 无标签 --';
case 'transaction.form.description': return '描述';
case 'transaction.form.description_info': return '點擊此處輸入有關此交易的更詳細描述';
case 'transaction.form.exchange_to_preferred_title': return ({required Object currency}) => '匯率為${currency}';
Expand Down