Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Nov 17, 2023
2 parents 2f70218 + 5b2e3af commit 8b8956c
Show file tree
Hide file tree
Showing 16 changed files with 212 additions and 206 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.140"
automatic_release_tag: "v5.0.141"
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.141" date="2023-11-17"/>
<release version="5.0.140" date="2023-11-14"/>
<release version="5.0.139" date="2023-11-12"/>
<release version="5.0.138" date="2023-11-03"/>
Expand Down
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.140';
const String kClientVersion = '5.0.141';
const String kMinServerVersion = '5.0.4';

const String kAppName = 'Invoice Ninja';
Expand Down
15 changes: 15 additions & 0 deletions lib/data/models/settings_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ abstract class SettingsEntity
clientSettings?.defaultPurchaseOrderDesignId ??
groupSettings?.defaultPurchaseOrderDesignId ??
companySettings?.defaultPurchaseOrderDesignId,
defaultStatementDesignId: clientSettings?.defaultStatementDesignId ??
groupSettings?.defaultStatementDesignId ??
companySettings?.defaultStatementDesignId,
defaultDeliveryNoteDesignId:
clientSettings?.defaultDeliveryNoteDesignId ??
groupSettings?.defaultDeliveryNoteDesignId ??
companySettings?.defaultDeliveryNoteDesignId,
defaultPaymentReceiptDesignId:
clientSettings?.defaultPaymentReceiptDesignId ??
groupSettings?.defaultPaymentReceiptDesignId ??
companySettings?.defaultPaymentReceiptDesignId,
defaultPaymentRefundDesignId:
clientSettings?.defaultPaymentRefundDesignId ??
groupSettings?.defaultPaymentRefundDesignId ??
companySettings?.defaultPaymentRefundDesignId,
defaultInvoiceTerms: clientSettings?.defaultInvoiceTerms ??
groupSettings?.defaultInvoiceTerms ??
companySettings?.defaultInvoiceTerms,
Expand Down
5 changes: 5 additions & 0 deletions lib/redux/app/app_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,11 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
bool get isUpdateAvailable =>
isSelfHosted && account.isUpdateAvailable && userCompany.isAdmin;

bool get isUsingPostmark => [
if (isHosted) SettingsEntity.EMAIL_SENDING_METHOD_DEFAULT,
SettingsEntity.EMAIL_SENDING_METHOD_POSTMARK,
].contains(company.settings.emailSendingMethod);

bool get isUserConfirmed {
if (isSelfHosted) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/app/entities/entity_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class _EntityListTileState extends State<EntityListTile> {
formatDate(entity.date, context);
} else if (entity is ExpenseEntity) {
defaultSubtitle =
formatNumber(entity.amount, context, clientId: entity.clientId)! +
formatNumber(entity.amount, context, currencyId: entity.currencyId)! +
' • ' +
formatDate(entity.date, context);
} else if (entity is TransactionEntity) {
Expand Down
10 changes: 1 addition & 9 deletions lib/ui/app/portal_links.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,9 @@ class PortalLinks extends StatelessWidget {
viewLinkWithHash += '&client_hash=${client!.clientHash}';
}

var copyLinkWithHash = copyLink;
if (!copyLink.contains('?')) {
copyLinkWithHash += '?';
}
if (client != null) {
copyLinkWithHash += '&client_hash=${client!.clientHash}';
}

final viewLinkPressed = () => launchUrl(Uri.parse(viewLinkWithHash));
final copyLinkPressed = () {
Clipboard.setData(ClipboardData(text: copyLinkWithHash));
Clipboard.setData(ClipboardData(text: copyLink));
showToast(localization!.copiedToClipboard.replaceFirst(':value ', ''));
};

Expand Down
1 change: 1 addition & 0 deletions lib/ui/auth/login_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ class _LoginState extends State<LoginView> {
val.isEmpty || val.trim().isEmpty
? localization.pleaseEnterYourEmail
: null,
autofillHints: [AutofillHints.username],
),
if (_loginType == LOGIN_TYPE_EMAIL &&
!_recoverPassword)
Expand Down
47 changes: 26 additions & 21 deletions lib/ui/dashboard/dashboard_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -267,27 +267,32 @@ class _DashboardScreenState extends State<DashboardScreen>
child: IconButton(
tooltip: localization!.enableReactApp,
onPressed: () async {
final credentials = state.credentials;
final account = state.account
.rebuild((b) => b..setReactAsDefaultAP = true);
final url = '${credentials.url}/accounts/${account.id}';
final data = serializers.serializeWith(
AccountEntity.serializer, account);

store.dispatch(StartSaving());
WebClient()
.put(
url,
credentials.token,
data: json.encode(data),
)
.then((dynamic _) {
store.dispatch(StopSaving());
WebUtils.reloadBrowser();
}).catchError((Object error) {
store.dispatch(StopSaving());
showErrorDialog(message: error as String?);
});
confirmCallback(
context: context,
message: localization.enableReactApp,
callback: (_) {
final credentials = state.credentials;
final account = state.account
.rebuild((b) => b..setReactAsDefaultAP = true);
final url = '${credentials.url}/accounts/${account.id}';
final data = serializers.serializeWith(
AccountEntity.serializer, account);

store.dispatch(StartSaving());
WebClient()
.put(
url,
credentials.token,
data: json.encode(data),
)
.then((dynamic _) {
store.dispatch(StopSaving());
WebUtils.reloadBrowser();
}).catchError((Object error) {
store.dispatch(StopSaving());
showErrorDialog(message: error as String?);
});
});
},
icon: Icon(MdiIcons.react),
),
Expand Down
Loading

0 comments on commit 8b8956c

Please sign in to comment.