diff --git a/client/app/admin/accounting-documents/services/accounting-document.service.ts b/client/app/admin/accounting-documents/services/accounting-document.service.ts index 36f5300a8..d9db7e62d 100644 --- a/client/app/admin/accounting-documents/services/accounting-document.service.ts +++ b/client/app/admin/accounting-documents/services/accounting-document.service.ts @@ -8,7 +8,7 @@ import { DeleteAccountingDocument, DeleteAccountingDocumentVariables, } from '../../../shared/generated-types'; -import {NaturalAbstractModelService} from '@ecodev/natural'; +import {NaturalAbstractModelService, NaturalDebounceService} from '@ecodev/natural'; @Injectable({ providedIn: 'root', @@ -25,9 +25,10 @@ export class AccountingDocumentService extends NaturalAbstractModelService< DeleteAccountingDocument, DeleteAccountingDocumentVariables > { - public constructor(apollo: Apollo) { + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { super( apollo, + naturalDebounceService, 'accountingDocument', null, null, diff --git a/client/app/admin/accounts/services/account.service.ts b/client/app/admin/accounts/services/account.service.ts index b2411de22..c037450f9 100644 --- a/client/app/admin/accounts/services/account.service.ts +++ b/client/app/admin/accounts/services/account.service.ts @@ -43,6 +43,7 @@ import { NaturalAbstractModelService, NaturalQueryVariablesManager, unique, + NaturalDebounceService, } from '@ecodev/natural'; import {Observable} from 'rxjs'; import {map} from 'rxjs/operators'; @@ -63,8 +64,17 @@ export class AccountService extends NaturalAbstractModelService< DeleteAccounts, DeleteAccountsVariables > { - public constructor(apollo: Apollo) { - super(apollo, 'account', accountQuery, accountsQuery, createAccount, updateAccount, deleteAccounts); + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { + super( + apollo, + naturalDebounceService, + 'account', + accountQuery, + accountsQuery, + createAccount, + updateAccount, + deleteAccounts, + ); } protected getDefaultForServer(): AccountInput { diff --git a/client/app/admin/bookable-metadata/bookable-metadata.service.ts b/client/app/admin/bookable-metadata/bookable-metadata.service.ts index 97ee558d7..f4546a040 100644 --- a/client/app/admin/bookable-metadata/bookable-metadata.service.ts +++ b/client/app/admin/bookable-metadata/bookable-metadata.service.ts @@ -7,7 +7,7 @@ import { updateBookableMetadataMutation, } from './bookable-metadata.queries'; import {Validators} from '@angular/forms'; -import {FormValidators, NaturalAbstractModelService} from '@ecodev/natural'; +import {FormValidators, NaturalAbstractModelService, NaturalDebounceService} from '@ecodev/natural'; import { BookableMetadataInput, BookableMetadatas, @@ -33,9 +33,10 @@ export class BookableMetadataService extends NaturalAbstractModelService< DeleteBookableMetadatas, DeleteBookableMetadatasVariables > { - public constructor(apollo: Apollo) { + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { super( apollo, + naturalDebounceService, 'bookableMetadata', null, bookableMetadatasQuery, diff --git a/client/app/admin/bookableTags/services/bookableTag.service.ts b/client/app/admin/bookableTags/services/bookableTag.service.ts index 4c47ecabd..c214b7538 100644 --- a/client/app/admin/bookableTags/services/bookableTag.service.ts +++ b/client/app/admin/bookableTags/services/bookableTag.service.ts @@ -1,6 +1,12 @@ import {Apollo} from 'apollo-angular'; import {Injectable} from '@angular/core'; -import {FormAsyncValidators, FormValidators, NaturalAbstractModelService, unique} from '@ecodev/natural'; +import { + FormAsyncValidators, + FormValidators, + NaturalAbstractModelService, + NaturalDebounceService, + unique, +} from '@ecodev/natural'; import { bookableTagQuery, bookableTagsQuery, @@ -39,9 +45,10 @@ export class BookableTagService extends NaturalAbstractModelService< DeleteBookableTags, DeleteBookableTagsVariables > { - public constructor(apollo: Apollo) { + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { super( apollo, + naturalDebounceService, 'bookableTag', bookableTagQuery, bookableTagsQuery, diff --git a/client/app/admin/bookables/services/bookable.service.ts b/client/app/admin/bookables/services/bookable.service.ts index a1ceff6d3..ecdc3b01a 100644 --- a/client/app/admin/bookables/services/bookable.service.ts +++ b/client/app/admin/bookables/services/bookable.service.ts @@ -34,6 +34,7 @@ import { NaturalAbstractModelService, NaturalQueryVariablesManager, unique, + NaturalDebounceService, } from '@ecodev/natural'; import {BookableTagService} from '../../bookableTags/services/bookableTag.service'; @@ -99,8 +100,21 @@ export class BookableService extends NaturalAbstractModelService< filter: {groups: [{conditions: [{bookingType: {in: {values: [BookingType.application]}}}]}]}, }; - public constructor(apollo: Apollo, private readonly bookingService: BookingService) { - super(apollo, 'bookable', bookableQuery, bookablesQuery, createBookable, updateBookable, deleteBookables); + public constructor( + apollo: Apollo, + naturalDebounceService: NaturalDebounceService, + private readonly bookingService: BookingService, + ) { + super( + apollo, + naturalDebounceService, + 'bookable', + bookableQuery, + bookablesQuery, + createBookable, + updateBookable, + deleteBookables, + ); } public static getFiltersByTagId(tagId: string): BookablesVariables { diff --git a/client/app/admin/bookables/services/image.service.ts b/client/app/admin/bookables/services/image.service.ts index 96b5e1305..ee9e2a140 100644 --- a/client/app/admin/bookables/services/image.service.ts +++ b/client/app/admin/bookables/services/image.service.ts @@ -2,7 +2,7 @@ import {Apollo, gql} from 'apollo-angular'; import {Injectable} from '@angular/core'; import {userMetaFragment} from '../../../shared/queries/fragments'; import {CreateImage, CreateImageVariables, ImageInput} from '../../../shared/generated-types'; -import {NaturalAbstractModelService} from '@ecodev/natural'; +import {NaturalAbstractModelService, NaturalDebounceService} from '@ecodev/natural'; export const createImageMutation = gql` mutation CreateImage($input: ImageInput!) { @@ -31,8 +31,8 @@ export class ImageService extends NaturalAbstractModelService< any, any > { - public constructor(apollo: Apollo) { - super(apollo, 'image', null, null, createImageMutation, null, null); + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { + super(apollo, naturalDebounceService, 'image', null, null, createImageMutation, null, null); } protected getDefaultForServer(): ImageInput { diff --git a/client/app/admin/bookables/services/usage-bookable.service.ts b/client/app/admin/bookables/services/usage-bookable.service.ts index fad709197..707365718 100644 --- a/client/app/admin/bookables/services/usage-bookable.service.ts +++ b/client/app/admin/bookables/services/usage-bookable.service.ts @@ -16,7 +16,7 @@ import { UsageBookablesVariables, } from '../../../shared/generated-types'; import {BookingService} from '../../bookings/services/booking.service'; -import {NaturalAbstractModelService} from '@ecodev/natural'; +import {NaturalAbstractModelService, NaturalDebounceService} from '@ecodev/natural'; import {Observable, of} from 'rxjs'; @Injectable({ @@ -34,8 +34,21 @@ export class UsageBookableService extends NaturalAbstractModelService< DeleteBookables, DeleteBookablesVariables > { - public constructor(apollo: Apollo, protected readonly bookingService: BookingService) { - super(apollo, 'bookable', bookableQuery, usageBookablesQuery, createBookable, updateBookable, deleteBookables); + public constructor( + apollo: Apollo, + naturalDebounceService: NaturalDebounceService, + protected readonly bookingService: BookingService, + ) { + super( + apollo, + naturalDebounceService, + 'bookable', + bookableQuery, + usageBookablesQuery, + createBookable, + updateBookable, + deleteBookables, + ); } public getPartialVariablesForAll(): Observable> { diff --git a/client/app/admin/bookings/services/PricedBooking.service.ts b/client/app/admin/bookings/services/PricedBooking.service.ts index 4fa3576de..d538f5052 100644 --- a/client/app/admin/bookings/services/PricedBooking.service.ts +++ b/client/app/admin/bookings/services/PricedBooking.service.ts @@ -2,7 +2,7 @@ import {Apollo} from 'apollo-angular'; import {Injectable} from '@angular/core'; import {pricedBookingsQuery} from './booking.queries'; import {Bookings, BookingsVariables} from '../../../shared/generated-types'; -import {NaturalAbstractModelService} from '@ecodev/natural'; +import {NaturalAbstractModelService, NaturalDebounceService} from '@ecodev/natural'; @Injectable({ providedIn: 'root', @@ -19,7 +19,7 @@ export class PricedBookingService extends NaturalAbstractModelService< any, any > { - public constructor(apollo: Apollo) { - super(apollo, 'booking', null, pricedBookingsQuery, null, null, null); + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { + super(apollo, naturalDebounceService, 'booking', null, pricedBookingsQuery, null, null, null); } } diff --git a/client/app/admin/bookings/services/booking-with-owner.service.ts b/client/app/admin/bookings/services/booking-with-owner.service.ts index 6da1c0d41..23a61cd27 100644 --- a/client/app/admin/bookings/services/booking-with-owner.service.ts +++ b/client/app/admin/bookings/services/booking-with-owner.service.ts @@ -19,7 +19,7 @@ import { UpdateBooking, UpdateBookingVariables, } from '../../../shared/generated-types'; -import {NaturalAbstractModelService} from '@ecodev/natural'; +import {NaturalAbstractModelService, NaturalDebounceService} from '@ecodev/natural'; import {Observable, of} from 'rxjs'; import {BookingService} from './booking.service'; @@ -38,9 +38,14 @@ export class BookingWithOwnerService extends NaturalAbstractModelService< DeleteBookings, DeleteBookingsVariables > { - public constructor(apollo: Apollo, private readonly bookingService: BookingService) { + public constructor( + apollo: Apollo, + naturalDebounceService: NaturalDebounceService, + private readonly bookingService: BookingService, + ) { super( apollo, + naturalDebounceService, 'booking', bookingQuery, bookingsWithOwnerBalanceQuery, diff --git a/client/app/admin/bookings/services/booking.service.ts b/client/app/admin/bookings/services/booking.service.ts index ae16ad473..908eba938 100644 --- a/client/app/admin/bookings/services/booking.service.ts +++ b/client/app/admin/bookings/services/booking.service.ts @@ -36,7 +36,13 @@ import {Validators} from '@angular/forms'; import {forkJoin, Observable, of} from 'rxjs'; import {map} from 'rxjs/operators'; import {BookingResolve} from '../booking'; -import {formatIsoDateTime, FormValidators, NaturalAbstractModelService, NaturalEnumService} from '@ecodev/natural'; +import { + formatIsoDateTime, + FormValidators, + NaturalAbstractModelService, + NaturalEnumService, + NaturalDebounceService, +} from '@ecodev/natural'; import {BookableTagService} from '../../bookableTags/services/bookableTag.service'; @Injectable({ @@ -178,8 +184,21 @@ export class BookingService extends NaturalAbstractModelService< }; } - public constructor(apollo: Apollo, private readonly enumService: NaturalEnumService) { - super(apollo, 'booking', bookingQuery, bookingsQuery, createBooking, updateBooking, deleteBookings); + public constructor( + apollo: Apollo, + naturalDebounceService: NaturalDebounceService, + private readonly enumService: NaturalEnumService, + ) { + super( + apollo, + naturalDebounceService, + 'booking', + bookingQuery, + bookingsQuery, + createBooking, + updateBooking, + deleteBookings, + ); } protected getDefaultForServer(): BookingInput { diff --git a/client/app/admin/expenseClaim/services/expenseClaim.service.ts b/client/app/admin/expenseClaim/services/expenseClaim.service.ts index ce50823db..6ded2d861 100644 --- a/client/app/admin/expenseClaim/services/expenseClaim.service.ts +++ b/client/app/admin/expenseClaim/services/expenseClaim.service.ts @@ -4,6 +4,7 @@ import { FormValidators, money, NaturalAbstractModelService, + NaturalDebounceService, NaturalQueryVariablesManager, SortingOrder, } from '@ecodev/natural'; @@ -49,9 +50,10 @@ export class ExpenseClaimService extends NaturalAbstractModelService< DeleteExpenseClaims, DeleteExpenseClaimsVariables > { - public constructor(apollo: Apollo) { + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { super( apollo, + naturalDebounceService, 'expenseClaim', expenseClaimQuery, expenseClaimsQuery, diff --git a/client/app/admin/licenses/services/license.service.ts b/client/app/admin/licenses/services/license.service.ts index 76bb18700..544f87107 100644 --- a/client/app/admin/licenses/services/license.service.ts +++ b/client/app/admin/licenses/services/license.service.ts @@ -1,6 +1,12 @@ import {Apollo} from 'apollo-angular'; import {Injectable} from '@angular/core'; -import {FormAsyncValidators, FormValidators, NaturalAbstractModelService, unique} from '@ecodev/natural'; +import { + FormAsyncValidators, + FormValidators, + NaturalAbstractModelService, + unique, + NaturalDebounceService, +} from '@ecodev/natural'; import {createLicense, deleteLicenses, licenseQuery, licensesQuery, updateLicense} from './license.queries'; import { CreateLicense, @@ -33,8 +39,17 @@ export class LicenseService extends NaturalAbstractModelService< DeleteLicenses, DeleteLicensesVariables > { - public constructor(apollo: Apollo) { - super(apollo, 'license', licenseQuery, licensesQuery, createLicense, updateLicense, deleteLicenses); + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { + super( + apollo, + naturalDebounceService, + 'license', + licenseQuery, + licensesQuery, + createLicense, + updateLicense, + deleteLicenses, + ); } protected getDefaultForServer(): LicenseInput { diff --git a/client/app/admin/logs/services/log.service.ts b/client/app/admin/logs/services/log.service.ts index 8c606644b..bafbe7ecb 100644 --- a/client/app/admin/logs/services/log.service.ts +++ b/client/app/admin/logs/services/log.service.ts @@ -1,6 +1,6 @@ import {Apollo} from 'apollo-angular'; import {Injectable} from '@angular/core'; -import {NaturalAbstractModelService} from '@ecodev/natural'; +import {NaturalAbstractModelService, NaturalDebounceService} from '@ecodev/natural'; import {Logs, LogsVariables} from '../../../shared/generated-types'; import {logsQuery} from './log.queries'; import {Observable, of} from 'rxjs'; @@ -20,8 +20,8 @@ export class LogService extends NaturalAbstractModelService< never, never > { - public constructor(apollo: Apollo) { - super(apollo, 'log', null, logsQuery, null, null, null); + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { + super(apollo, naturalDebounceService, 'log', null, logsQuery, null, null, null); } public getPartialVariablesForAll(): Observable> { diff --git a/client/app/admin/transactionTags/services/transactionTag.service.ts b/client/app/admin/transactionTags/services/transactionTag.service.ts index 2c8785b61..7b5aed770 100644 --- a/client/app/admin/transactionTags/services/transactionTag.service.ts +++ b/client/app/admin/transactionTags/services/transactionTag.service.ts @@ -1,6 +1,6 @@ import {Apollo} from 'apollo-angular'; import {Injectable} from '@angular/core'; -import {FormValidators, NaturalAbstractModelService} from '@ecodev/natural'; +import {FormValidators, NaturalAbstractModelService, NaturalDebounceService} from '@ecodev/natural'; import { createTransactionTag, deleteTransactionTags, @@ -38,9 +38,10 @@ export class TransactionTagService extends NaturalAbstractModelService< any, any > { - public constructor(apollo: Apollo) { + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { super( apollo, + naturalDebounceService, 'transactionTag', transactionTagQuery, transactionTagsQuery, diff --git a/client/app/admin/transactions/services/transaction.service.ts b/client/app/admin/transactions/services/transaction.service.ts index a35a26142..e124e8e8f 100644 --- a/client/app/admin/transactions/services/transaction.service.ts +++ b/client/app/admin/transactions/services/transaction.service.ts @@ -1,7 +1,13 @@ import {Apollo} from 'apollo-angular'; import {Injectable} from '@angular/core'; import {Validators} from '@angular/forms'; -import {formatIsoDateTime, FormValidators, Literal, NaturalAbstractModelService} from '@ecodev/natural'; +import { + formatIsoDateTime, + FormValidators, + Literal, + NaturalAbstractModelService, + NaturalDebounceService, +} from '@ecodev/natural'; import { Accounts_accounts_items, CreateTransaction, @@ -47,11 +53,13 @@ export class TransactionService extends NaturalAbstractModelService< public constructor( apollo: Apollo, + naturalDebounceService: NaturalDebounceService, private readonly transactionLineService: TransactionLineService, private accountService: AccountService, ) { super( apollo, + naturalDebounceService, 'transaction', transactionQuery, transactionsQuery, diff --git a/client/app/admin/transactions/services/transactionLine.service.ts b/client/app/admin/transactions/services/transactionLine.service.ts index 0b95c7d0d..70654516f 100644 --- a/client/app/admin/transactions/services/transactionLine.service.ts +++ b/client/app/admin/transactions/services/transactionLine.service.ts @@ -8,6 +8,7 @@ import { NaturalQueryVariablesManager, NaturalSearchSelections, toNavigationParameters, + NaturalDebounceService, } from '@ecodev/natural'; import { exportTransactionLines, @@ -58,8 +59,17 @@ export class TransactionLineService extends NaturalAbstractModelService< null, never > { - public constructor(apollo: Apollo) { - super(apollo, 'transactionLine', transactionLineQuery, transactionLinesQuery, null, null, null); + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { + super( + apollo, + naturalDebounceService, + 'transactionLine', + transactionLineQuery, + transactionLinesQuery, + null, + null, + null, + ); } public static getVariablesForExport(): TransactionLinesVariables { diff --git a/client/app/admin/userTags/services/userTag.service.ts b/client/app/admin/userTags/services/userTag.service.ts index 15263a11b..fb1558152 100644 --- a/client/app/admin/userTags/services/userTag.service.ts +++ b/client/app/admin/userTags/services/userTag.service.ts @@ -1,6 +1,12 @@ import {Apollo} from 'apollo-angular'; import {Injectable} from '@angular/core'; -import {FormAsyncValidators, FormValidators, NaturalAbstractModelService, unique} from '@ecodev/natural'; +import { + FormAsyncValidators, + FormValidators, + NaturalAbstractModelService, + unique, + NaturalDebounceService, +} from '@ecodev/natural'; import {createUserTag, deleteUserTags, updateUserTag, userTagQuery, userTagsQuery} from './userTag.queries'; import { CreateUserTag, @@ -33,8 +39,17 @@ export class UserTagService extends NaturalAbstractModelService< DeleteUserTags, DeleteUserTagsVariables > { - public constructor(apollo: Apollo) { - super(apollo, 'userTag', userTagQuery, userTagsQuery, createUserTag, updateUserTag, deleteUserTags); + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { + super( + apollo, + naturalDebounceService, + 'userTag', + userTagQuery, + userTagsQuery, + createUserTag, + updateUserTag, + deleteUserTags, + ); } protected getDefaultForServer(): UserTagInput { diff --git a/client/app/admin/users/services/user.service.ts b/client/app/admin/users/services/user.service.ts index 659772953..56a1e8c7e 100644 --- a/client/app/admin/users/services/user.service.ts +++ b/client/app/admin/users/services/user.service.ts @@ -10,12 +10,13 @@ import { Literal, LOCAL_STORAGE, NaturalAbstractModelService, + NaturalDebounceService, NaturalQueryVariablesManager, NaturalStorage, unique, } from '@ecodev/natural'; import {fromEvent, Observable, of, Subject} from 'rxjs'; -import {map, takeUntil} from 'rxjs/operators'; +import {map, switchMap, takeUntil} from 'rxjs/operators'; import { createUser, currentUserForProfileQuery, @@ -40,7 +41,6 @@ import { CurrentUserForProfile, CurrentUserForProfile_viewer, LeaveFamily, - UserLeaveFamily, LeaveFamilyVariables, LogicalOperator, Login, @@ -61,6 +61,7 @@ import { UserByToken, UserByTokenVariables, UserInput, + UserLeaveFamily, UserLoginAvailable, UserLoginAvailableVariables, UserPartialInput, @@ -120,13 +121,14 @@ export class UserService public constructor( apollo: Apollo, + naturalDebounceService: NaturalDebounceService, protected readonly router: Router, protected readonly bookingService: BookingService, private readonly permissionsService: PermissionsService, protected readonly pricedBookingService: PricedBookingService, @Inject(LOCAL_STORAGE) private readonly storage: NaturalStorage, ) { - super(apollo, 'user', userQuery, usersQuery, createUser, updateUser, null); + super(apollo, naturalDebounceService, 'user', userQuery, usersQuery, createUser, updateUser, null); this.keepViewerSyncedAcrossBrowserTabs(); } @@ -350,23 +352,28 @@ export class UserService public logout(): Observable { const subject = new Subject(); - this.router.navigate(['/login'], {queryParams: {logout: true}}).then(() => { - this.apollo - .mutate({ - mutation: logoutMutation, - }) - .subscribe(result => { - const v = result.data!.logout; - this.cacheViewer(null); - - // Broadcast logout to other browser tabs - this.storage.setItem(this.storageKey, ''); - - this.apollo.client.resetStore().then(() => { - subject.next(v); - }); + this.naturalDebounceService + .flush() + .pipe( + switchMap(() => this.router.navigate(['/login'], {queryParams: {logout: true}})), + switchMap(() => + this.apollo.mutate({ + mutation: logoutMutation, + }), + ), + ) + .subscribe(result => { + const v = result.data!.logout; + this.cacheViewer(null); + + // Broadcast logout to other browser tabs + this.storage.setItem(this.storageKey, ''); + + this.apollo.client.resetStore().then(() => { + subject.next(v); + subject.complete(); }); - }); + }); return subject; } diff --git a/client/app/profile/components/family-member/family-user.service.ts b/client/app/profile/components/family-member/family-user.service.ts index ffb829cff..9abc64231 100644 --- a/client/app/profile/components/family-member/family-user.service.ts +++ b/client/app/profile/components/family-member/family-user.service.ts @@ -4,8 +4,8 @@ import {UserService} from '../../../admin/users/services/user.service'; import {Router} from '@angular/router'; import {BookingService} from '../../../admin/bookings/services/booking.service'; import {PermissionsService} from '../../../shared/services/permissions.service'; -import {Relationship, UserRole, UserStatus} from '../../../shared/generated-types'; -import {FormValidators, Literal, LOCAL_STORAGE, NaturalStorage} from '@ecodev/natural'; +import {Relationship, UserRole} from '../../../shared/generated-types'; +import {FormValidators, Literal, LOCAL_STORAGE, NaturalDebounceService, NaturalStorage} from '@ecodev/natural'; import {PricedBookingService} from '../../../admin/bookings/services/PricedBooking.service'; @Injectable({ @@ -14,13 +14,22 @@ import {PricedBookingService} from '../../../admin/bookings/services/PricedBooki export class FamilyUserService extends UserService { public constructor( apollo: Apollo, + naturalDebounceService: NaturalDebounceService, router: Router, bookingService: BookingService, permissionsService: PermissionsService, pricedBookingService: PricedBookingService, @Inject(LOCAL_STORAGE) storage: NaturalStorage, ) { - super(apollo, router, bookingService, permissionsService, pricedBookingService, storage); + super( + apollo, + naturalDebounceService, + router, + bookingService, + permissionsService, + pricedBookingService, + storage, + ); } protected getDefaultForClient(): Literal { diff --git a/client/app/safety/safety-booking.service.ts b/client/app/safety/safety-booking.service.ts index c0ca98a84..e6f82d7e6 100644 --- a/client/app/safety/safety-booking.service.ts +++ b/client/app/safety/safety-booking.service.ts @@ -1,7 +1,7 @@ import {Apollo, gql} from 'apollo-angular'; import {Injectable} from '@angular/core'; import {bookableMetaFragment} from '../admin/bookables/services/bookable.queries'; -import {NaturalAbstractModelService} from '@ecodev/natural'; +import {NaturalAbstractModelService, NaturalDebounceService} from '@ecodev/natural'; import {SafetyBookings_bookings, SafetyBookingsVariables} from '../shared/generated-types'; const safetyBookings = gql` @@ -54,7 +54,7 @@ export class SafetyBookingService extends NaturalAbstractModelService< never, never > { - public constructor(apollo: Apollo) { - super(apollo, 'booking', null, safetyBookings, null, null, null); + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { + super(apollo, naturalDebounceService, 'booking', null, safetyBookings, null, null, null); } } diff --git a/client/app/shared/components/address/country.service.ts b/client/app/shared/components/address/country.service.ts index 5a88ada7b..7d120ebb7 100644 --- a/client/app/shared/components/address/country.service.ts +++ b/client/app/shared/components/address/country.service.ts @@ -2,7 +2,7 @@ import {Apollo} from 'apollo-angular'; import {Injectable} from '@angular/core'; import {countriesQuery, countryQuery} from './country.queries'; import {Countries, CountriesVariables, Country, CountryVariables} from '../../generated-types'; -import {NaturalAbstractModelService} from '@ecodev/natural'; +import {NaturalAbstractModelService, NaturalDebounceService} from '@ecodev/natural'; @Injectable({ providedIn: 'root', @@ -19,7 +19,7 @@ export class CountryService extends NaturalAbstractModelService< never, never > { - public constructor(apollo: Apollo) { - super(apollo, 'country', countryQuery, countriesQuery, null, null, null); + public constructor(apollo: Apollo, naturalDebounceService: NaturalDebounceService) { + super(apollo, naturalDebounceService, 'country', countryQuery, countriesQuery, null, null, null); } } diff --git a/client/vanilla/vanilla.module.ts b/client/vanilla/vanilla.module.ts index 44e1fdf27..3fb0e5ab2 100644 --- a/client/vanilla/vanilla.module.ts +++ b/client/vanilla/vanilla.module.ts @@ -41,6 +41,7 @@ import {cacheConfig} from '../app/shared/config/apolloDefaultOptions'; export class VanillaModule implements DoBootstrap { public constructor( apollo: Apollo, + naturalDebounceService: NaturalDebounceService, userService: UserService, bookableService: BookableService, bookingService: BookingService, diff --git a/package.json b/package.json index f8b8b9344..0279a516e 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ "@angular/router": "^14.1.1", "@apollo/client": "^3.6.9", "@ecodev/fab-speed-dial": "^11.0.0", - "@ecodev/natural": "^44.0.6", - "@ecodev/natural-editor": "^44.0.6", + "@ecodev/natural": "^45.0.0", + "@ecodev/natural-editor": "^45.0.0", "@graphql-tools/mock": "^8.7.1", "angular-particle-effect-button": "^0.0.50", "apollo": "^2.34.0", diff --git a/yarn.lock b/yarn.lock index 0a4d37ac7..5e2424d7c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1497,10 +1497,10 @@ dependencies: tslib "^2.3.1" -"@ecodev/natural-editor@^44.0.6": - version "44.0.6" - resolved "https://registry.yarnpkg.com/@ecodev/natural-editor/-/natural-editor-44.0.6.tgz#c52571a37bacdc2b5264e6e2989781d23982a9d9" - integrity sha512-8l+tOwvNXiHVEp3uIRv3qXGojqLERRQDU+m6LsDZIyEB7Av0JV/jc8XPgbFwYGUU+blEx6OQuKNXujlb877jMw== +"@ecodev/natural-editor@^45.0.0": + version "45.0.0" + resolved "https://registry.yarnpkg.com/@ecodev/natural-editor/-/natural-editor-45.0.0.tgz#3e72b7a7df4245a0162b1f948e8f3b495fd3940e" + integrity sha512-49SWESz6ko+0WTR2hFDt4wK2w3nWlLqgYhIgvffUXWWb91uS/OPr3l+ifGwx2MpSxVTh1XuCdk1XDoZ7rHUwjg== dependencies: "@types/prosemirror-commands" "^1.0.4" "@types/prosemirror-dropcursor" "^1.0.3" @@ -1529,10 +1529,10 @@ prosemirror-view "^1.23.5" tslib "^2.3.0" -"@ecodev/natural@^44.0.6": - version "44.0.6" - resolved "https://registry.yarnpkg.com/@ecodev/natural/-/natural-44.0.6.tgz#5787533c4e3c61291307fad068219647fb829986" - integrity sha512-aKPjyOJzbR4jsZ4t7Id9FTCC0hScboraSUJHvhuQjFMHcPFYj/9Z6/KGIVqCF8VWvyQHGzTAXI+VdezwO7gqig== +"@ecodev/natural@^45.0.0": + version "45.0.0" + resolved "https://registry.yarnpkg.com/@ecodev/natural/-/natural-45.0.0.tgz#fb992a25f3f410e597de80e4a8dc44a2f6e6f388" + integrity sha512-66gGcsNqkeg1vVXtZVvf7UJr3yyNlqUr6i1K3DudWD7qHV1iC6EE6cwrILkCKPv8TOHCSp6Hs5BRaQqHud/9kQ== dependencies: tslib "^2.3.1"