From a59c45dfc07616564b6504d7e87c364fe5154d55 Mon Sep 17 00:00:00 2001 From: "kim.tran" Date: Tue, 23 Apr 2024 08:58:45 +0200 Subject: [PATCH 1/3] fix: show additional actions column when additionalActions length > 0 --- .../src/lib/components/data-table/data-table.component.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html index 1cd964a1..7c2099c1 100644 --- a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html +++ b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html @@ -1,5 +1,5 @@ - + - + - {{ emptyResultsMessage || ("OCX_DATA_TABLE.EMPTY_RESULT" | translate) }} + {{ emptyResultsMessage || ("OCX_DATA_TABLE.EMPTY_RESULT" | translate) }} From 517c0bf4f635c9b2a8cdb80827fac28205c7461a Mon Sep 17 00:00:00 2001 From: "kim.tran" Date: Tue, 23 Apr 2024 09:47:32 +0200 Subject: [PATCH 2/3] feat: add httpRetryStrategy utils for repeating calls max 3 times if error --- .../lib/utils/http-retry-strategy.utils.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 libs/accelerator/src/lib/utils/http-retry-strategy.utils.ts diff --git a/libs/accelerator/src/lib/utils/http-retry-strategy.utils.ts b/libs/accelerator/src/lib/utils/http-retry-strategy.utils.ts new file mode 100644 index 00000000..2499bdfd --- /dev/null +++ b/libs/accelerator/src/lib/utils/http-retry-strategy.utils.ts @@ -0,0 +1,23 @@ +import { Observable, mergeMap, throwError, timer } from 'rxjs' + +export const httpRetryStrategy = + ({ + maxRetryAttempts = 3, + scalingDuration = 1000, + excludedStatusCodes = [], + }: { + maxRetryAttempts?: number + scalingDuration?: number + excludedStatusCodes?: number[] + } = {}) => + (attempts: Observable) => { + return attempts.pipe( + mergeMap((error, i) => { + const retryAttempt = i + 1 + if (retryAttempt > maxRetryAttempts || excludedStatusCodes.find((e) => e === error.status)) { + return throwError(() => error) + } + return timer(retryAttempt * scalingDuration) + }) + ) + } From bdcb08af9ab6f071afce8b21d91991bef50ee6e9 Mon Sep 17 00:00:00 2001 From: "kim.tran" Date: Tue, 23 Apr 2024 18:35:58 +0200 Subject: [PATCH 3/3] fix: remove utils, using retry of rxjs instead --- .../lib/utils/http-retry-strategy.utils.ts | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 libs/accelerator/src/lib/utils/http-retry-strategy.utils.ts diff --git a/libs/accelerator/src/lib/utils/http-retry-strategy.utils.ts b/libs/accelerator/src/lib/utils/http-retry-strategy.utils.ts deleted file mode 100644 index 2499bdfd..00000000 --- a/libs/accelerator/src/lib/utils/http-retry-strategy.utils.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Observable, mergeMap, throwError, timer } from 'rxjs' - -export const httpRetryStrategy = - ({ - maxRetryAttempts = 3, - scalingDuration = 1000, - excludedStatusCodes = [], - }: { - maxRetryAttempts?: number - scalingDuration?: number - excludedStatusCodes?: number[] - } = {}) => - (attempts: Observable) => { - return attempts.pipe( - mergeMap((error, i) => { - const retryAttempt = i + 1 - if (retryAttempt > maxRetryAttempts || excludedStatusCodes.find((e) => e === error.status)) { - return throwError(() => error) - } - return timer(retryAttempt * scalingDuration) - }) - ) - }