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 3, 2024
2 parents db2b46b + 845bbbe commit 7a229b8
Show file tree
Hide file tree
Showing 10 changed files with 2,597 additions and 2,547 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
draft: false
prerelease: false
title: "Latest Release"
automatic_release_tag: "v5.0.171"
automatic_release_tag: "v5.0.172"
files: |
${{ github.workspace }}/artifacts/Invoice-Ninja-Archive
${{ github.workspace }}/artifacts/Invoice-Ninja-Hash
Expand Down
1 change: 1 addition & 0 deletions flatpak/com.invoiceninja.InvoiceNinja.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
</screenshots>
<content_rating type="oars-1.1"/>
<releases>
<release version="5.0.172" date="2024-12-03"/>
<release version="5.0.171" date="2024-09-29"/>
<release version="5.0.170" date="2024-09-25"/>
<release version="5.0.169" date="2024-09-25"/>
Expand Down
2 changes: 1 addition & 1 deletion lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Constants {
}

// TODO remove version once #46609 is fixed
const String kClientVersion = '5.0.171';
const String kClientVersion = '5.0.172';
const String kMinServerVersion = '5.0.4';

const String kAppName = 'Invoice Ninja';
Expand Down
2 changes: 2 additions & 0 deletions lib/data/models/entities.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,9 @@ abstract class ActivityEntity
':recurring_expense', vendor?.name ?? ''); // TODO implement
activity = activity.replaceAll(' ', ' ');

// Fix for extra notes value
activity = activity.replaceFirst(' - :notes', '');
activity = activity.replaceFirst(':notes', '');

return activity;
}
Expand Down
13 changes: 4 additions & 9 deletions lib/ui/settings/invoice_design.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ class _InvoiceDesignState extends State<InvoiceDesign>
final state = viewModel.state;
final settings = viewModel.settings;
final company = viewModel.company;
final isFiltered = state.uiState.settingsUIState.isFiltered;

final tabs = [
localization.generalSettings,
Expand Down Expand Up @@ -295,8 +294,7 @@ class _InvoiceDesignState extends State<InvoiceDesign>
b..defaultInvoiceDesignId = value!.id));
},
),
if (!isFiltered &&
_wasInvoiceDesignChanged &&
if (_wasInvoiceDesignChanged &&
state.userCompany.isAdmin)
Padding(
padding: const EdgeInsets.only(bottom: 8),
Expand Down Expand Up @@ -324,8 +322,7 @@ class _InvoiceDesignState extends State<InvoiceDesign>
b..defaultQuoteDesignId = value!.id));
},
),
if (!isFiltered &&
_wasQuoteDesignChanged &&
if (_wasQuoteDesignChanged &&
state.userCompany.isAdmin)
Padding(
padding: const EdgeInsets.only(bottom: 8),
Expand Down Expand Up @@ -353,8 +350,7 @@ class _InvoiceDesignState extends State<InvoiceDesign>
b..defaultCreditDesignId = value!.id));
},
),
if (!isFiltered &&
_wasCreditDesignChanged &&
if (_wasCreditDesignChanged &&
state.userCompany.isAdmin)
Padding(
padding: const EdgeInsets.only(bottom: 8),
Expand Down Expand Up @@ -385,8 +381,7 @@ class _InvoiceDesignState extends State<InvoiceDesign>
value!.id));
},
),
if (!isFiltered &&
_wasPurchaseOrderDesignChanged &&
if (_wasPurchaseOrderDesignChanged &&
state.userCompany.isAdmin)
Padding(
padding: const EdgeInsets.only(bottom: 8),
Expand Down
56 changes: 54 additions & 2 deletions lib/ui/settings/invoice_design_vm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,65 @@ class InvoiceDesignVM {
break;
case EntityType.group:
final completer = snackBarCompleter<GroupEntity>(
AppLocalization.of(context)!.savedSettings);
AppLocalization.of(context)!.savedSettings)
..future.then<Null>((_) {
final webClient = WebClient();
final credentials = state.credentials;
final url = '${credentials.url}/designs/set/default';
final settings = store.state.company.settings;
entityTypes.forEach((entityType) {
webClient
.post(
url,
credentials.token,
data: json.encode({
'entity': entityType.snakeCase,
'design_id': settings.getDesignId(entityType),
'settings_level': 'group_settings',
'group_settings_id': settingsUIState.group.id,
}),
)
.then((dynamic response) {
showToast(
AppLocalization.of(navigatorKey.currentContext!)!
.savedSettings);
}).catchError((dynamic error) {
showErrorDialog(message: '$error');
});
});
});
store.dispatch(SaveGroupRequest(
completer: completer, group: settingsUIState.group));
break;
case EntityType.client:
final completer = snackBarCompleter<ClientEntity>(
AppLocalization.of(context)!.savedSettings);
AppLocalization.of(context)!.savedSettings)
..future.then<Null>((_) {
final webClient = WebClient();
final credentials = state.credentials;
final url = '${credentials.url}/designs/set/default';
final settings = store.state.company.settings;
entityTypes.forEach((entityType) {
webClient
.post(
url,
credentials.token,
data: json.encode({
'entity': entityType.snakeCase,
'design_id': settings.getDesignId(entityType),
'settings_level': 'client',
'client_id': settingsUIState.client.id,
}),
)
.then((dynamic response) {
showToast(
AppLocalization.of(navigatorKey.currentContext!)!
.savedSettings);
}).catchError((dynamic error) {
showErrorDialog(message: '$error');
});
});
});
store.dispatch(SaveClientRequest(
completer: completer, client: settingsUIState.client));
break;
Expand Down
Loading

0 comments on commit 7a229b8

Please sign in to comment.