Browse Source

Merge branch 'main' into abort_signal_timeout

pull/4153/head
Thomas Kaul 8 months ago
committed by GitHub
parent
commit
60213ae9db
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 3
      apps/api/src/main.ts
  3. 86
      apps/client/src/app/components/user-account-membership/user-account-membership.component.ts
  4. 2
      package-lock.json
  5. 2
      package.json

2
CHANGELOG.md

@ -14,8 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Improved support for automatic deletion of unused asset profiles when deleting activities - Improved support for automatic deletion of unused asset profiles when deleting activities
- Migrated the coupon redemption to the notification service for prompt dialogs
- Refactored `got` calls to use `AbortSignal.timeout()` without `AbortController()` - Refactored `got` calls to use `AbortSignal.timeout()` without `AbortController()`
- Improved the language localization for German (`de`) - Improved the language localization for German (`de`)
- Eliminated `body-parser` in favor of using `@nestjs/platform-express`
- Upgraded the _Stripe_ dependencies - Upgraded the _Stripe_ dependencies
- Upgraded `angular` from version `18.2.8` to `19.0.5` - Upgraded `angular` from version `18.2.8` to `19.0.5`
- Upgraded `husky` from version `9.1.6` to `9.1.7` - Upgraded `husky` from version `9.1.6` to `9.1.7`

3
apps/api/src/main.ts

@ -7,7 +7,6 @@ import {
import { ConfigService } from '@nestjs/config'; import { ConfigService } from '@nestjs/config';
import { NestFactory } from '@nestjs/core'; import { NestFactory } from '@nestjs/core';
import type { NestExpressApplication } from '@nestjs/platform-express'; import type { NestExpressApplication } from '@nestjs/platform-express';
import { json } from 'body-parser';
import helmet from 'helmet'; import helmet from 'helmet';
import { AppModule } from './app/app.module'; import { AppModule } from './app/app.module';
@ -48,7 +47,7 @@ async function bootstrap() {
); );
// Support 10mb csv/json files for importing activities // Support 10mb csv/json files for importing activities
app.use(json({ limit: '10mb' })); app.useBodyParser('json', { limit: '10mb' });
if (configService.get<string>('ENABLE_FEATURE_SUBSCRIPTION') === 'true') { if (configService.get<string>('ENABLE_FEATURE_SUBSCRIPTION') === 'true') {
app.use( app.use(

86
apps/client/src/app/components/user-account-membership/user-account-membership.component.ts

@ -164,50 +164,54 @@ export class UserAccountMembershipComponent implements OnDestroy {
} }
public onRedeemCoupon() { public onRedeemCoupon() {
let couponCode = prompt($localize`Please enter your coupon code:`); this.notificationService.prompt({
couponCode = couponCode?.trim(); confirmFn: (value) => {
const couponCode = value?.trim();
if (couponCode) {
this.dataService if (couponCode) {
.redeemCoupon(couponCode) this.dataService
.pipe( .redeemCoupon(couponCode)
catchError(() => { .pipe(
this.snackBar.open( catchError(() => {
'😞 ' + $localize`Could not redeem coupon code`, this.snackBar.open(
undefined, '😞 ' + $localize`Could not redeem coupon code`,
{ undefined,
duration: ms('3 seconds') {
} duration: ms('3 seconds')
); }
);
return EMPTY;
}), return EMPTY;
takeUntil(this.unsubscribeSubject) }),
) takeUntil(this.unsubscribeSubject)
.subscribe(() => { )
this.snackBarRef = this.snackBar.open(
'✅ ' + $localize`Coupon code has been redeemed`,
$localize`Reload`,
{
duration: 3000
}
);
this.snackBarRef
.afterDismissed()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => { .subscribe(() => {
window.location.reload(); this.snackBarRef = this.snackBar.open(
}); '✅ ' + $localize`Coupon code has been redeemed`,
$localize`Reload`,
{
duration: 3000
}
);
this.snackBarRef this.snackBarRef
.onAction() .afterDismissed()
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => { .subscribe(() => {
window.location.reload(); window.location.reload();
});
this.snackBarRef
.onAction()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
window.location.reload();
});
}); });
}); }
} },
title: $localize`Please enter your coupon code.`
});
} }
public ngOnDestroy() { public ngOnDestroy() {

2
package-lock.json

@ -46,7 +46,6 @@
"@stripe/stripe-js": "5.4.0", "@stripe/stripe-js": "5.4.0",
"alphavantage": "2.2.0", "alphavantage": "2.2.0",
"big.js": "6.2.2", "big.js": "6.2.2",
"body-parser": "1.20.2",
"bootstrap": "4.6.0", "bootstrap": "4.6.0",
"bull": "4.16.2", "bull": "4.16.2",
"cache-manager": "5.7.6", "cache-manager": "5.7.6",
@ -127,7 +126,6 @@
"@storybook/core-server": "8.4.7", "@storybook/core-server": "8.4.7",
"@trivago/prettier-plugin-sort-imports": "4.3.0", "@trivago/prettier-plugin-sort-imports": "4.3.0",
"@types/big.js": "6.2.2", "@types/big.js": "6.2.2",
"@types/body-parser": "1.19.5",
"@types/cache-manager": "4.0.6", "@types/cache-manager": "4.0.6",
"@types/color": "3.0.6", "@types/color": "3.0.6",
"@types/google-spreadsheet": "3.1.5", "@types/google-spreadsheet": "3.1.5",

2
package.json

@ -92,7 +92,6 @@
"@stripe/stripe-js": "5.4.0", "@stripe/stripe-js": "5.4.0",
"alphavantage": "2.2.0", "alphavantage": "2.2.0",
"big.js": "6.2.2", "big.js": "6.2.2",
"body-parser": "1.20.2",
"bootstrap": "4.6.0", "bootstrap": "4.6.0",
"bull": "4.16.2", "bull": "4.16.2",
"cache-manager": "5.7.6", "cache-manager": "5.7.6",
@ -173,7 +172,6 @@
"@storybook/core-server": "8.4.7", "@storybook/core-server": "8.4.7",
"@trivago/prettier-plugin-sort-imports": "4.3.0", "@trivago/prettier-plugin-sort-imports": "4.3.0",
"@types/big.js": "6.2.2", "@types/big.js": "6.2.2",
"@types/body-parser": "1.19.5",
"@types/cache-manager": "4.0.6", "@types/cache-manager": "4.0.6",
"@types/color": "3.0.6", "@types/color": "3.0.6",
"@types/google-spreadsheet": "3.1.5", "@types/google-spreadsheet": "3.1.5",

Loading…
Cancel
Save