From 48c157176135d3e502761515023a751a1bbf3c33 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 26 May 2024 19:04:21 +0300 Subject: [PATCH 1/4] Fix re-connect bank action --- .../bank_account/bank_account_actions.dart | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/lib/redux/bank_account/bank_account_actions.dart b/lib/redux/bank_account/bank_account_actions.dart index c1ad7b8137..612160328b 100644 --- a/lib/redux/bank_account/bank_account_actions.dart +++ b/lib/redux/bank_account/bank_account_actions.dart @@ -1,11 +1,15 @@ import 'dart:async'; +import 'dart:convert'; import 'package:built_collection/built_collection.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_redux/flutter_redux.dart'; import 'package:invoiceninja_flutter/data/models/models.dart'; +import 'package:invoiceninja_flutter/data/web_client.dart'; import 'package:invoiceninja_flutter/redux/app/app_actions.dart'; import 'package:invoiceninja_flutter/redux/app/app_state.dart'; import 'package:invoiceninja_flutter/utils/completers.dart'; +import 'package:invoiceninja_flutter/utils/dialogs.dart'; +import 'package:invoiceninja_flutter/utils/formatting.dart'; import 'package:invoiceninja_flutter/utils/localization.dart'; import 'package:invoiceninja_flutter/ui/app/entities/entity_actions_dialog.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -317,10 +321,36 @@ void handleBankAccountAction(BuildContext? context, } break; case EntityAction.reconnect: - final url = state.credentials.url + - '/nordigen/connect/' + - bankAccount.nordigenInstitutionId; - launchUrl(Uri.parse(url)); + final credentials = state.credentials; + final url = '${credentials.url}/one_time_token'; + const integrationType = BankAccountEntity.INTEGRATION_TYPE_YODLEE; + + store.dispatch(StartSaving()); + WebClient() + .post(url, credentials.token, + data: jsonEncode({ + 'context': + integrationType == BankAccountEntity.INTEGRATION_TYPE_YODLEE + ? {'return_url': ''} + : 'nordigen', + })) + .then((dynamic response) { + store.dispatch(StopSaving()); + + String connectUrl = cleanApiUrl(credentials.url); + if (integrationType == BankAccountEntity.INTEGRATION_TYPE_YODLEE) { + connectUrl += '/yodlee/onboard/${response['hash']}'; + } else { + connectUrl += + '/nordigen/connect/${response['hash']}?institution_id=' + + bankAccount.nordigenInstitutionId; + } + + launchUrl(Uri.parse(connectUrl)); + }).catchError((dynamic error) { + store.dispatch(StopSaving()); + showErrorDialog(message: '$error'); + }); break; case EntityAction.more: showEntityActionsDialog( From 23f185b06126e03e3808b3a30edd53478b184454 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 26 May 2024 19:27:28 +0300 Subject: [PATCH 2/4] Update flutter version file --- lib/flutter_version.dart | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/flutter_version.dart b/lib/flutter_version.dart index 7e2b177d5d..8464c4ab72 100644 --- a/lib/flutter_version.dart +++ b/lib/flutter_version.dart @@ -1,11 +1,12 @@ const FLUTTER_VERSION = const { - 'frameworkVersion': '3.3.4', + 'frameworkVersion': '3.19.6', 'channel': 'stable', - 'repositoryUrl': 'git@github.com:flutter/flutter.git', - 'frameworkRevision': 'eb6d86ee27deecba4a83536aa20f366a6044895c', - 'frameworkCommitDate': '2022-10-04 22:31:45 -0700', - 'engineRevision': 'c08d7d5efc9aa6eb3c30cfb3be6dc09bca5e7631', - 'dartSdkVersion': '2.18.2', - 'devToolsVersion': '2.15.0', + 'repositoryUrl': 'https://github.com/flutter/flutter.git', + 'frameworkRevision': '54e66469a933b60ddf175f858f82eaeb97e48c8d', + 'frameworkCommitDate': '2024-04-17 13:08:03 -0700', + 'engineRevision': 'c4cd48e186460b32d44585ce3c103271ab676355', + 'dartSdkVersion': '3.3.4', + 'devToolsVersion': '2.31.1', + 'flutterVersion': '3.19.6', 'flutterRoot': 'C:\\Users\\hillel\\Documents\\flutter' }; From 0573fd2efa2a4d1e9fecd06c80ad99c581b45812 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 26 May 2024 19:30:23 +0300 Subject: [PATCH 3/4] Update version file when bumping version --- bump_version.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bump_version.sh b/bump_version.sh index d2e49108a0..eb034905f3 100644 --- a/bump_version.sh +++ b/bump_version.sh @@ -11,4 +11,11 @@ sed -i -e "s/version: 5.0.$current_version+$current_version/version: 5.0.$new_ve sed -i -e "s/v5.0.$current_version/v5.0.$new_vesion/g" ./.github/workflows/flatpak.yml sed -i -e 's//\n /g' ./flatpak/com.invoiceninja.InvoiceNinja.metainfo.xml sed -i -e "s/kClientVersion = '5.0.$current_version'/kClientVersion = '5.0.$new_vesion'/g" ./lib/constants.dart -sed -i -e "s/version: '5.0.$current_version'/version: '5.0.$new_vesion'/g" ./snap/snapcraft.yaml \ No newline at end of file +sed -i -e "s/version: '5.0.$current_version'/version: '5.0.$new_vesion'/g" ./snap/snapcraft.yaml + +rm lib/flutter_version.dart +echo "const FLUTTER_VERSION = const " > lib/flutter_version.dart +flutter --version --machine >> lib/flutter_version.dart +echo ";" >> lib/flutter_version.dart +sed -i "y/\"/'/" lib/flutter_version.dart +flutter dartfmt lib \ No newline at end of file From 02b7268f363b229714feeaf6a5f298b1c110cc8f Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 26 May 2024 19:32:29 +0300 Subject: [PATCH 4/4] Format code --- bump_version.sh | 2 +- .../repositories/bank_account_repository.dart | 6 +++--- lib/data/repositories/client_repository.dart | 13 ++++++------- .../repositories/company_gateway_repository.dart | 10 +++++----- lib/data/repositories/design_repository.dart | 8 ++++---- lib/data/repositories/document_repository.dart | 8 ++++---- .../expense_category_repository.dart | 6 +++--- lib/data/repositories/expense_repository.dart | 8 ++++---- lib/data/repositories/group_repository.dart | 8 ++++---- .../repositories/payment_term_repository.dart | 6 +++--- lib/data/repositories/product_repository.dart | 8 ++++---- .../recurring_expense_repository.dart | 6 +++--- .../recurring_invoice_repository.dart | 6 +++--- lib/data/repositories/schedule_repository.dart | 6 +++--- lib/data/repositories/settings_repository.dart | 16 ++++++++-------- .../repositories/static/static_repository.dart | 2 +- .../repositories/subscription_repository.dart | 6 +++--- lib/data/repositories/task_repository.dart | 10 +++++----- .../repositories/task_status_repository.dart | 6 +++--- lib/data/repositories/tax_rate_repository.dart | 10 +++++----- lib/data/repositories/token_repository.dart | 6 +++--- .../repositories/transaction_repository.dart | 14 +++++++------- .../transaction_rule_repository.dart | 6 +++--- lib/data/repositories/user_repository.dart | 12 ++++++------ lib/data/repositories/vendor_repository.dart | 8 ++++---- lib/data/repositories/webhook_repository.dart | 6 +++--- lib/ui/settings/company_details.dart | 2 +- lib/utils/i18n.dart | 1 - 28 files changed, 102 insertions(+), 104 deletions(-) diff --git a/bump_version.sh b/bump_version.sh index eb034905f3..db5c8f8765 100644 --- a/bump_version.sh +++ b/bump_version.sh @@ -18,4 +18,4 @@ echo "const FLUTTER_VERSION = const " > lib/flutter_version.dart flutter --version --machine >> lib/flutter_version.dart echo ";" >> lib/flutter_version.dart sed -i "y/\"/'/" lib/flutter_version.dart -flutter dartfmt lib \ No newline at end of file +dart dartfmt lib \ No newline at end of file diff --git a/lib/data/repositories/bank_account_repository.dart b/lib/data/repositories/bank_account_repository.dart index fa25c8e256..83230ffd86 100644 --- a/lib/data/repositories/bank_account_repository.dart +++ b/lib/data/repositories/bank_account_repository.dart @@ -26,7 +26,7 @@ class BankAccountRepository { } Future> loadList(Credentials credentials) async { - final String url = credentials.url+ '/bank_integrations?'; + final String url = credentials.url + '/bank_integrations?'; final dynamic response = await webClient.get(url, credentials.token); final BankAccountListResponse bankAccountResponse = serializers @@ -41,7 +41,7 @@ class BankAccountRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/bank_integrations/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -60,7 +60,7 @@ class BankAccountRepository { if (bankAccount.isNew) { response = await webClient.post( - credentials.url+ '/bank_integrations', credentials.token, + credentials.url + '/bank_integrations', credentials.token, data: json.encode(data)); } else { final url = '${credentials.url}/bank_integrations/${bankAccount.id}'; diff --git a/lib/data/repositories/client_repository.dart b/lib/data/repositories/client_repository.dart index dc6aff3e11..358081a3e1 100644 --- a/lib/data/repositories/client_repository.dart +++ b/lib/data/repositories/client_repository.dart @@ -41,7 +41,7 @@ class ClientRepository { Future> loadList( Credentials credentials, int page) async { final String url = - credentials.url+ '/clients?per_page=$kMaxRecordsPerPage&page=$page'; + credentials.url + '/clients?per_page=$kMaxRecordsPerPage&page=$page'; final dynamic response = await webClient.get(url, credentials.token); @@ -60,7 +60,7 @@ class ClientRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/clients/bulk?per_page=$kMaxEntitiesPerBulkAction&include=gateway_tokens,activities,ledger,system_logs,documents'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -77,7 +77,7 @@ class ClientRepository { required String? password, required String? idToken, }) async { - final url = credentials.url+ '/clients/$clientId/purge'; + final url = credentials.url + '/clients/$clientId/purge'; await webClient.post(url, credentials.token, password: password, idToken: idToken); @@ -92,8 +92,7 @@ class ClientRepository { required String? password, required String? idToken, }) async { - final url = - credentials.url+ '/clients/$mergeIntoClientId/$clientId/merge'; + final url = credentials.url + '/clients/$mergeIntoClientId/$clientId/merge'; final dynamic response = await webClient.post(url, credentials.token, password: password, idToken: idToken); @@ -112,12 +111,12 @@ class ClientRepository { if (client.isNew) { response = await webClient.post( - credentials.url+ + credentials.url + '/clients?include=gateway_tokens,activities,ledger,system_logs,documents', credentials.token, data: json.encode(data)); } else { - final url = credentials.url+ + final url = credentials.url + '/clients/${client.id}?include=gateway_tokens,activities,ledger,system_logs,documents'; response = await webClient.put(url, credentials.token, data: json.encode(data)); diff --git a/lib/data/repositories/company_gateway_repository.dart b/lib/data/repositories/company_gateway_repository.dart index 8e5d70cafa..a2b31026ec 100644 --- a/lib/data/repositories/company_gateway_repository.dart +++ b/lib/data/repositories/company_gateway_repository.dart @@ -35,7 +35,7 @@ class CompanyGatewayRepository { Future> loadList( Credentials credentials) async { - final url = credentials.url+ '/company_gateways'; + final url = credentials.url + '/company_gateways'; final dynamic response = await webClient.get(url, credentials.token); @@ -51,7 +51,7 @@ class CompanyGatewayRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/company_gateways/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -64,7 +64,7 @@ class CompanyGatewayRepository { Future disconnect(Credentials credentials, String id, String? password, String? idToken) async { - final url = credentials.url+ '/stripe/disconnect/$id'; + final url = credentials.url + '/stripe/disconnect/$id'; await webClient.post( url, credentials.token, @@ -81,10 +81,10 @@ class CompanyGatewayRepository { if (companyGateway.isNew) { response = await webClient.post( - credentials.url+ '/company_gateways', credentials.token, + credentials.url + '/company_gateways', credentials.token, data: json.encode(data)); } else { - final url = credentials.url+ '/company_gateways/${companyGateway.id}'; + final url = credentials.url + '/company_gateways/${companyGateway.id}'; response = await webClient.put(url, credentials.token, data: json.encode(data)); } diff --git a/lib/data/repositories/design_repository.dart b/lib/data/repositories/design_repository.dart index af1bb19b40..de19c209c8 100644 --- a/lib/data/repositories/design_repository.dart +++ b/lib/data/repositories/design_repository.dart @@ -31,7 +31,7 @@ class DesignRepository { } Future> loadList(Credentials credentials) async { - final url = credentials.url+ '/designs?'; + final url = credentials.url + '/designs?'; final dynamic response = await webClient.get(url, credentials.token); @@ -48,7 +48,7 @@ class DesignRepository { } final url = - credentials.url+ '/designs/bulk?per_page=$kMaxEntitiesPerBulkAction'; + credentials.url + '/designs/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -65,10 +65,10 @@ class DesignRepository { if (design.isNew) { response = await webClient.post( - credentials.url+ '/designs', credentials.token, + credentials.url + '/designs', credentials.token, data: json.encode(data)); } else { - final url = credentials.url+ '/designs/${design.id}'; + final url = credentials.url + '/designs/${design.id}'; response = await webClient.put(url, credentials.token, data: json.encode(data)); } diff --git a/lib/data/repositories/document_repository.dart b/lib/data/repositories/document_repository.dart index c5531a4fe0..520fd2fbc6 100644 --- a/lib/data/repositories/document_repository.dart +++ b/lib/data/repositories/document_repository.dart @@ -42,7 +42,7 @@ class DocumentRepository { } Future> loadList(Credentials credentials) async { - final url = credentials.url+ '/documents?'; + final url = credentials.url + '/documents?'; final dynamic response = await webClient.get(url, credentials.token); @@ -57,7 +57,7 @@ class DocumentRepository { final data = serializers.serializeWith(DocumentEntity.serializer, document); dynamic response; - final url = credentials.url+ '/documents/${document.id}'; + final url = credentials.url + '/documents/${document.id}'; response = await webClient.put(url, credentials.token, data: json.encode(data)); @@ -74,8 +74,8 @@ class DocumentRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ - '/documents/bulk?per_page=$kMaxEntitiesPerBulkAction'; + final url = + credentials.url + '/documents/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); diff --git a/lib/data/repositories/expense_category_repository.dart b/lib/data/repositories/expense_category_repository.dart index a012e35aab..cd7c2b360b 100644 --- a/lib/data/repositories/expense_category_repository.dart +++ b/lib/data/repositories/expense_category_repository.dart @@ -32,7 +32,7 @@ class ExpenseCategoryRepository { Future> loadList( Credentials credentials) async { - final String url = credentials.url+ '/expense_categories?'; + final String url = credentials.url + '/expense_categories?'; final dynamic response = await webClient.get(url, credentials.token); final ExpenseCategoryListResponse expenseCategoryResponse = serializers @@ -47,7 +47,7 @@ class ExpenseCategoryRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/expense_categories/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -66,7 +66,7 @@ class ExpenseCategoryRepository { if (expenseCategory.isNew) { response = await webClient.post( - credentials.url+ '/expense_categories', credentials.token, + credentials.url + '/expense_categories', credentials.token, data: json.encode(data)); } else { final url = '${credentials.url}/expense_categories/${expenseCategory.id}'; diff --git a/lib/data/repositories/expense_repository.dart b/lib/data/repositories/expense_repository.dart index 0790644d7d..51a9547eb8 100644 --- a/lib/data/repositories/expense_repository.dart +++ b/lib/data/repositories/expense_repository.dart @@ -38,7 +38,7 @@ class ExpenseRepository { Future> loadList(Credentials credentials, int page, int createdAt, bool filterDeleted) async { - final url = credentials.url+ + final url = credentials.url + '/expenses?per_page=$kMaxRecordsPerPage&page=$page&created_at=$createdAt'; /* Server is incorrect if client isn't set @@ -63,7 +63,7 @@ class ExpenseRepository { } final url = - credentials.url+ '/expenses/bulk?per_page=$kMaxEntitiesPerBulkAction'; + credentials.url + '/expenses/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -80,10 +80,10 @@ class ExpenseRepository { if (expense.isNew) { response = await webClient.post( - credentials.url+ '/expenses', credentials.token, + credentials.url + '/expenses', credentials.token, data: json.encode(data)); } else { - final url = credentials.url+ '/expenses/${expense.id}'; + final url = credentials.url + '/expenses/${expense.id}'; response = await webClient.put(url, credentials.token, data: json.encode(data)); } diff --git a/lib/data/repositories/group_repository.dart b/lib/data/repositories/group_repository.dart index 88a66103d6..ebfbb35df6 100644 --- a/lib/data/repositories/group_repository.dart +++ b/lib/data/repositories/group_repository.dart @@ -33,7 +33,7 @@ class GroupRepository { } Future> loadList(Credentials credentials) async { - final url = credentials.url+ '/group_settings?'; + final url = credentials.url + '/group_settings?'; final dynamic response = await webClient.get(url, credentials.token); @@ -49,7 +49,7 @@ class GroupRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/group_settings/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -67,10 +67,10 @@ class GroupRepository { if (group.isNew) { response = await webClient.post( - credentials.url+ '/group_settings', credentials.token, + credentials.url + '/group_settings', credentials.token, data: json.encode(data)); } else { - final url = credentials.url+ '/group_settings/${group.id}'; + final url = credentials.url + '/group_settings/${group.id}'; response = await webClient.put(url, credentials.token, data: json.encode(data)); } diff --git a/lib/data/repositories/payment_term_repository.dart b/lib/data/repositories/payment_term_repository.dart index e3c8735524..71bf14b760 100644 --- a/lib/data/repositories/payment_term_repository.dart +++ b/lib/data/repositories/payment_term_repository.dart @@ -32,7 +32,7 @@ class PaymentTermRepository { } Future> loadList(Credentials credentials) async { - final url = credentials.url+ '/payment_terms?'; + final url = credentials.url + '/payment_terms?'; final dynamic response = await webClient.get(url, credentials.token); @@ -48,7 +48,7 @@ class PaymentTermRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/payment_terms/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -67,7 +67,7 @@ class PaymentTermRepository { if (paymentTerm.isNew) { response = await webClient.post( - credentials.url+ '/payment_terms', credentials.token, + credentials.url + '/payment_terms', credentials.token, data: json.encode(data)); } else { final url = '${credentials.url}/payment_terms/${paymentTerm.id}'; diff --git a/lib/data/repositories/product_repository.dart b/lib/data/repositories/product_repository.dart index f71fb7024d..0d33363d10 100644 --- a/lib/data/repositories/product_repository.dart +++ b/lib/data/repositories/product_repository.dart @@ -40,7 +40,7 @@ class ProductRepository { Future> loadList( Credentials credentials, int page) async { final url = - credentials.url+ '/products?per_page=$kMaxRecordsPerPage&page=$page'; + credentials.url + '/products?per_page=$kMaxRecordsPerPage&page=$page'; final dynamic response = await webClient.get(url, credentials.token); @@ -62,7 +62,7 @@ class ProductRepository { } final url = - credentials.url+ '/products/bulk?per_page=$kMaxEntitiesPerBulkAction'; + credentials.url + '/products/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post( url, credentials.token, @@ -89,10 +89,10 @@ class ProductRepository { if (product.isNew) { response = await webClient.post( - credentials.url+ '/products', credentials.token, + credentials.url + '/products', credentials.token, data: json.encode(data)); } else { - var url = credentials.url+ '/products/${product.id}'; + var url = credentials.url + '/products/${product.id}'; if (changedStock) { url += '?update_in_stock_quantity=true'; } diff --git a/lib/data/repositories/recurring_expense_repository.dart b/lib/data/repositories/recurring_expense_repository.dart index 44792a34d4..f787814236 100644 --- a/lib/data/repositories/recurring_expense_repository.dart +++ b/lib/data/repositories/recurring_expense_repository.dart @@ -33,7 +33,7 @@ class RecurringExpenseRepository { } Future> loadList(Credentials credentials) async { - final String url = credentials.url+ '/recurring_expenses?'; + final String url = credentials.url + '/recurring_expenses?'; final dynamic response = await webClient.get(url, credentials.token); final ExpenseListResponse recurringExpenseResponse = @@ -48,7 +48,7 @@ class RecurringExpenseRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/recurring_expenses/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -68,7 +68,7 @@ class RecurringExpenseRepository { String url; if (recurringExpense.isNew) { - url = credentials.url+ '/recurring_expenses?show_dates=true'; + url = credentials.url + '/recurring_expenses?show_dates=true'; } else { url = '${credentials.url}/recurring_expenses/${recurringExpense.id}?show_dates=true'; diff --git a/lib/data/repositories/recurring_invoice_repository.dart b/lib/data/repositories/recurring_invoice_repository.dart index 110249f261..453e582398 100644 --- a/lib/data/repositories/recurring_invoice_repository.dart +++ b/lib/data/repositories/recurring_invoice_repository.dart @@ -34,7 +34,7 @@ class RecurringInvoiceRepository { Future> loadList( Credentials credentials, int page, bool filterDeleted) async { - String url = credentials.url+ + String url = credentials.url + '/recurring_invoices?per_page=$kMaxRecordsPerPage&page=$page'; if (filterDeleted) { @@ -56,7 +56,7 @@ class RecurringInvoiceRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/recurring_invoices/bulk?per_page=$kMaxEntitiesPerBulkAction'; final params = {'ids': ids, 'action': action.toApiParam()}; if (data != null) { @@ -83,7 +83,7 @@ class RecurringInvoiceRepository { String url; if (recurringInvoice.isNew) { - url = credentials.url+ + url = credentials.url + '/recurring_invoices?include=activities,history&show_dates=true'; } else { url = diff --git a/lib/data/repositories/schedule_repository.dart b/lib/data/repositories/schedule_repository.dart index 1c7e7847b3..23d61da709 100644 --- a/lib/data/repositories/schedule_repository.dart +++ b/lib/data/repositories/schedule_repository.dart @@ -26,7 +26,7 @@ class ScheduleRepository { } Future> loadList(Credentials credentials) async { - final String url = credentials.url+ '/task_schedulers?'; + final String url = credentials.url + '/task_schedulers?'; final dynamic response = await webClient.get(url, credentials.token); final ScheduleListResponse scheduleResponse = @@ -41,7 +41,7 @@ class ScheduleRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/task_schedulers/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -59,7 +59,7 @@ class ScheduleRepository { if (schedule.isNew) { response = await webClient.post( - credentials.url+ '/task_schedulers', credentials.token, + credentials.url + '/task_schedulers', credentials.token, data: json.encode(data)); } else { final url = '${credentials.url}/task_schedulers/${schedule.id}'; diff --git a/lib/data/repositories/settings_repository.dart b/lib/data/repositories/settings_repository.dart index eba8ea1f32..5f0bea7638 100644 --- a/lib/data/repositories/settings_repository.dart +++ b/lib/data/repositories/settings_repository.dart @@ -24,7 +24,7 @@ class SettingsRepository { final data = serializers.serializeWith(CompanyEntity.serializer, company); dynamic response; - final url = credentials.url+ '/companies/${company.id}'; + final url = credentials.url + '/companies/${company.id}'; response = await webClient.put( url, credentials.token, @@ -41,7 +41,7 @@ class SettingsRepository { CompanyEntity company, MultipartFile eInvoiceCertificate) async { dynamic response; - final url = credentials.url+ '/companies/${company.id}'; + final url = credentials.url + '/companies/${company.id}'; final fields = { '_method': 'put', }; @@ -68,7 +68,7 @@ class SettingsRepository { final data = serializers.serializeWith(UserEntity.serializer, user); dynamic response; - final url = credentials.url+ '/users/${user.id}?include=company_user'; + final url = credentials.url + '/users/${user.id}?include=company_user'; response = await webClient.put( url, credentials.token, @@ -92,7 +92,7 @@ class SettingsRepository { ) async { dynamic response; - final url = credentials.url+ '/connected_account?include=company_user'; + final url = credentials.url + '/connected_account?include=company_user'; response = await webClient.post( url, credentials.token, @@ -120,7 +120,7 @@ class SettingsRepository { ) async { dynamic response; - final url = credentials.url+ + final url = credentials.url + '/users/${user.id}/disconnect_oauth?include=company_user'; response = await webClient.post( url, @@ -143,7 +143,7 @@ class SettingsRepository { ) async { dynamic response; - final url = credentials.url+ + final url = credentials.url + '/users/$userId/disconnect_mailer?include=company_user'; response = await webClient.post( url, @@ -166,7 +166,7 @@ class SettingsRepository { dynamic response; final url = - credentials.url+ '/connected_account/gmail?include=company_user'; + credentials.url + '/connected_account/gmail?include=company_user'; response = await webClient.post( url, credentials.token, @@ -191,7 +191,7 @@ class SettingsRepository { final data = serializers.serializeWith(UserEntity.serializer, user); dynamic response; - final url = credentials.url+ '/company_users/${user.id}'; + final url = credentials.url + '/company_users/${user.id}'; response = await webClient.put( url, credentials.token, diff --git a/lib/data/repositories/static/static_repository.dart b/lib/data/repositories/static/static_repository.dart index 4133a346ce..038b72fcc2 100644 --- a/lib/data/repositories/static/static_repository.dart +++ b/lib/data/repositories/static/static_repository.dart @@ -18,7 +18,7 @@ class StaticRepository { Future loadList(Credentials credentials) async { final dynamic response = - await webClient.get(credentials.url+ '/static', credentials.token); + await webClient.get(credentials.url + '/static', credentials.token); final StaticDataItemResponse staticDataResponse = serializers .deserializeWith(StaticDataItemResponse.serializer, response)!; diff --git a/lib/data/repositories/subscription_repository.dart b/lib/data/repositories/subscription_repository.dart index 20741bfb68..e2484a37c0 100644 --- a/lib/data/repositories/subscription_repository.dart +++ b/lib/data/repositories/subscription_repository.dart @@ -32,7 +32,7 @@ class SubscriptionRepository { Future> loadList( Credentials credentials) async { - final String url = credentials.url+ '/subscriptions?'; + final String url = credentials.url + '/subscriptions?'; final dynamic response = await webClient.get(url, credentials.token); final SubscriptionListResponse subscriptionResponse = serializers @@ -47,7 +47,7 @@ class SubscriptionRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/subscriptions/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -66,7 +66,7 @@ class SubscriptionRepository { if (subscription.isNew) { response = await webClient.post( - credentials.url+ '/subscriptions', credentials.token, + credentials.url + '/subscriptions', credentials.token, data: json.encode(data)); } else { final url = '${credentials.url}/subscriptions/${subscription.id}'; diff --git a/lib/data/repositories/task_repository.dart b/lib/data/repositories/task_repository.dart index 9ba235462c..78a2a815ab 100644 --- a/lib/data/repositories/task_repository.dart +++ b/lib/data/repositories/task_repository.dart @@ -37,7 +37,7 @@ class TaskRepository { Future> loadList(Credentials credentials, int page, int createdAt, bool filterDeleted) async { - final url = credentials.url+ + final url = credentials.url + '/tasks?per_page=$kMaxRecordsPerPage&page=$page&created_at=$createdAt'; /* Server is incorrect if client isn't set @@ -62,7 +62,7 @@ class TaskRepository { } final url = - credentials.url+ '/tasks/bulk?per_page=$kMaxEntitiesPerBulkAction'; + credentials.url + '/tasks/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -74,7 +74,7 @@ class TaskRepository { Future sortTasks(Credentials credentials, List? statusIds, Map>? taskIds) async { - final url = credentials.url+ '/tasks/sort'; + final url = credentials.url + '/tasks/sort'; await webClient.post(url, credentials.token, data: json.encode({'status_ids': statusIds, 'task_ids': taskIds})); @@ -90,9 +90,9 @@ class TaskRepository { String url; if (task.isNew) { - url = credentials.url+ '/tasks?'; + url = credentials.url + '/tasks?'; } else { - url = credentials.url+ '/tasks/${task.id}?'; + url = credentials.url + '/tasks/${task.id}?'; } if ([ diff --git a/lib/data/repositories/task_status_repository.dart b/lib/data/repositories/task_status_repository.dart index 34195bcc4d..e73916b92c 100644 --- a/lib/data/repositories/task_status_repository.dart +++ b/lib/data/repositories/task_status_repository.dart @@ -31,7 +31,7 @@ class TaskStatusRepository { } Future> loadList(Credentials credentials) async { - final String url = credentials.url+ '/task_statuses?'; + final String url = credentials.url + '/task_statuses?'; final dynamic response = await webClient.get(url, credentials.token); final TaskStatusListResponse taskStatusResponse = serializers @@ -46,7 +46,7 @@ class TaskStatusRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/task_statuses/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -65,7 +65,7 @@ class TaskStatusRepository { if (taskStatus.isNew) { response = await webClient.post( - credentials.url+ '/task_statuses', credentials.token, + credentials.url + '/task_statuses', credentials.token, data: json.encode(data)); } else { final url = '${credentials.url}/task_statuses/${taskStatus.id}'; diff --git a/lib/data/repositories/tax_rate_repository.dart b/lib/data/repositories/tax_rate_repository.dart index b7c1a342e2..bafa290579 100644 --- a/lib/data/repositories/tax_rate_repository.dart +++ b/lib/data/repositories/tax_rate_repository.dart @@ -31,7 +31,7 @@ class TaxRateRepository { } Future> loadList(Credentials credentials) async { - final url = credentials.url+ '/tax_rates?'; + final url = credentials.url + '/tax_rates?'; final dynamic response = await webClient.get(url, credentials.token); @@ -47,8 +47,8 @@ class TaxRateRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ - '/tax_rates/bulk?per_page=$kMaxEntitiesPerBulkAction'; + final url = + credentials.url + '/tax_rates/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -65,10 +65,10 @@ class TaxRateRepository { if (taxRate.isNew) { response = await webClient.post( - credentials.url+ '/tax_rates', credentials.token, + credentials.url + '/tax_rates', credentials.token, data: json.encode(data)); } else { - final url = credentials.url+ '/tax_rates/${taxRate.id}'; + final url = credentials.url + '/tax_rates/${taxRate.id}'; response = await webClient.put(url, credentials.token, data: json.encode(data)); } diff --git a/lib/data/repositories/token_repository.dart b/lib/data/repositories/token_repository.dart index d7c0e0b7bd..d8418992ef 100644 --- a/lib/data/repositories/token_repository.dart +++ b/lib/data/repositories/token_repository.dart @@ -31,7 +31,7 @@ class TokenRepository { } Future> loadList(Credentials credentials) async { - final url = credentials.url+ '/tokens?'; + final url = credentials.url + '/tokens?'; final dynamic response = await webClient.get(url, credentials.token); @@ -48,7 +48,7 @@ class TokenRepository { } final url = - credentials.url+ '/tokens/bulk?per_page=$kMaxEntitiesPerBulkAction'; + credentials.url + '/tokens/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -69,7 +69,7 @@ class TokenRepository { if (token.isNew) { response = await webClient.post( - credentials.url+ '/tokens', + credentials.url + '/tokens', credentials.token, data: json.encode(data), password: password, diff --git a/lib/data/repositories/transaction_repository.dart b/lib/data/repositories/transaction_repository.dart index da4ba7ba0e..ae4dbe5f41 100644 --- a/lib/data/repositories/transaction_repository.dart +++ b/lib/data/repositories/transaction_repository.dart @@ -27,7 +27,7 @@ class TransactionRepository { Future> loadList( Credentials credentials, int page, int createdAt) async { - final String url = credentials.url+ + final String url = credentials.url + '/bank_transactions?per_page=$kMaxRecordsPerPage&page=$page&created_at=$createdAt'; final dynamic response = await webClient.get(url, credentials.token); @@ -43,7 +43,7 @@ class TransactionRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/bank_transactions/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -56,7 +56,7 @@ class TransactionRepository { Future convertToPayment(Credentials credentials, String? transactionId, List invoiceIds) async { - final url = credentials.url+ '/bank_transactions/match'; + final url = credentials.url + '/bank_transactions/match'; final dynamic response = await webClient.post( url, credentials.token, @@ -84,7 +84,7 @@ class TransactionRepository { String vendorId, String categoryId, ) async { - final url = credentials.url+ '/bank_transactions/match'; + final url = credentials.url + '/bank_transactions/match'; final dynamic response = await webClient.post( url, credentials.token, @@ -109,7 +109,7 @@ class TransactionRepository { Future linkToPayment( Credentials credentials, String? transactionId, String paymentId) async { - final url = credentials.url+ '/bank_transactions/match'; + final url = credentials.url + '/bank_transactions/match'; final dynamic response = await webClient.post( url, credentials.token, @@ -133,7 +133,7 @@ class TransactionRepository { Future linkToExpense( Credentials credentials, String? transactionId, String expenseId) async { - final url = credentials.url+ '/bank_transactions/match'; + final url = credentials.url + '/bank_transactions/match'; final dynamic response = await webClient.post( url, credentials.token, @@ -163,7 +163,7 @@ class TransactionRepository { if (transaction.isNew) { response = await webClient.post( - credentials.url+ '/bank_transactions', credentials.token, + credentials.url + '/bank_transactions', credentials.token, data: json.encode(data)); } else { final url = '${credentials.url}/bank_transactions/${transaction.id}'; diff --git a/lib/data/repositories/transaction_rule_repository.dart b/lib/data/repositories/transaction_rule_repository.dart index 76f75d340c..8697fdfdfa 100644 --- a/lib/data/repositories/transaction_rule_repository.dart +++ b/lib/data/repositories/transaction_rule_repository.dart @@ -28,7 +28,7 @@ class TransactionRuleRepository { Future> loadList( Credentials credentials) async { - final String url = credentials.url+ '/bnak_transaction_rules?'; + final String url = credentials.url + '/bnak_transaction_rules?'; final dynamic response = await webClient.get(url, credentials.token); final TransactionRuleListResponse transactionRuleResponse = serializers @@ -43,7 +43,7 @@ class TransactionRuleRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/bank_transaction_rules/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -62,7 +62,7 @@ class TransactionRuleRepository { if (transactionRule.isNew) { response = await webClient.post( - credentials.url+ '/bank_transaction_rules', credentials.token, + credentials.url + '/bank_transaction_rules', credentials.token, data: json.encode(data)); } else { final url = diff --git a/lib/data/repositories/user_repository.dart b/lib/data/repositories/user_repository.dart index a6418e1131..3f291f5101 100644 --- a/lib/data/repositories/user_repository.dart +++ b/lib/data/repositories/user_repository.dart @@ -31,7 +31,7 @@ class UserRepository { } Future> loadList(Credentials credentials) async { - final url = credentials.url+ '/users?include=company_user'; + final url = credentials.url + '/users?include=company_user'; final dynamic response = await webClient.get(url, credentials.token); @@ -52,7 +52,7 @@ class UserRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/users/bulk?per_page=$kMaxEntitiesPerBulkAction&include=company_user'; final dynamic response = await webClient.post( url, @@ -74,7 +74,7 @@ class UserRepository { String? password, String? idToken, ) async { - final url = credentials.url+ '/users/$userId/detach_from_company'; + final url = credentials.url + '/users/$userId/detach_from_company'; final dynamic response = await webClient.delete( url, credentials.token, @@ -94,7 +94,7 @@ class UserRepository { String? password, String? idToken, ) async { - final url = credentials.url+ '/users/$userId/invite'; + final url = credentials.url + '/users/$userId/invite'; final dynamic response = await webClient.post( url, credentials.token, @@ -124,14 +124,14 @@ class UserRepository { if (user.isNew) { response = await webClient.post( - credentials.url+ '/users?include=company_user', + credentials.url + '/users?include=company_user', credentials.token, data: json.encode(data), password: password, idToken: idToken, ); } else { - final url = credentials.url+ '/users/${user.id}?include=company_user'; + final url = credentials.url + '/users/${user.id}?include=company_user'; response = await webClient.put( url, credentials.token, diff --git a/lib/data/repositories/vendor_repository.dart b/lib/data/repositories/vendor_repository.dart index 503592e7b5..20ea0f8d34 100644 --- a/lib/data/repositories/vendor_repository.dart +++ b/lib/data/repositories/vendor_repository.dart @@ -40,7 +40,7 @@ class VendorRepository { Future> loadList( Credentials credentials, int page) async { final String url = - credentials.url+ '/vendors?per_page=$kMaxRecordsPerPage&page=$page'; + credentials.url + '/vendors?per_page=$kMaxRecordsPerPage&page=$page'; final dynamic response = await webClient.get(url, credentials.token); @@ -57,7 +57,7 @@ class VendorRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = credentials.url+ + final url = credentials.url + '/vendors/bulk?per_page=$kMaxEntitiesPerBulkAction&include=activities'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -75,10 +75,10 @@ class VendorRepository { if (vendor.isNew) { response = await webClient.post( - credentials.url+ '/vendors?include=activities', credentials.token, + credentials.url + '/vendors?include=activities', credentials.token, data: json.encode(data)); } else { - final url = credentials.url+ '/vendors/${vendor.id}?include=activities'; + final url = credentials.url + '/vendors/${vendor.id}?include=activities'; response = await webClient.put(url, credentials.token, data: json.encode(data)); } diff --git a/lib/data/repositories/webhook_repository.dart b/lib/data/repositories/webhook_repository.dart index 64f4117023..c4a959f65d 100644 --- a/lib/data/repositories/webhook_repository.dart +++ b/lib/data/repositories/webhook_repository.dart @@ -31,7 +31,7 @@ class WebhookRepository { } Future> loadList(Credentials credentials) async { - final url = credentials.url+ '/webhooks?'; + final url = credentials.url + '/webhooks?'; final dynamic response = await webClient.get(url, credentials.token); @@ -48,7 +48,7 @@ class WebhookRepository { } final url = - credentials.url+ '/webhooks/bulk?per_page=$kMaxEntitiesPerBulkAction'; + credentials.url + '/webhooks/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); @@ -65,7 +65,7 @@ class WebhookRepository { if (webhook.isNew) { response = await webClient.post( - credentials.url+ '/webhooks', credentials.token, + credentials.url + '/webhooks', credentials.token, data: json.encode(data)); } else { final url = '${credentials.url}/webhooks/${webhook.id}'; diff --git a/lib/ui/settings/company_details.dart b/lib/ui/settings/company_details.dart index a22a9ac11f..b61b9a7c60 100644 --- a/lib/ui/settings/company_details.dart +++ b/lib/ui/settings/company_details.dart @@ -576,7 +576,7 @@ class _CompanyDetailsState extends State child: (state.isHosted && kIsWeb) ? CachedImage( width: double.infinity, - url: state.credentials.url+ + url: state.credentials.url + '/companies/' + company.id + '/logo', diff --git a/lib/utils/i18n.dart b/lib/utils/i18n.dart index a458414ef2..5ef026c468 100644 --- a/lib/utils/i18n.dart +++ b/lib/utils/i18n.dart @@ -115515,7 +115515,6 @@ mixin LocalizationsProvider on LocaleCodeAware { _localizedValues[localeCode]!['disconnected'] ?? _localizedValues['en']!['disconnected']!; - // STARTER: lang field - do not remove comment String lookup(String? key, {String? overrideLocaleCode}) {