From 01f65f624b3a3760a09d625238f1746a1281fc1f Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Mon, 2 Jun 2025 12:28:33 +0300 Subject: [PATCH] UI: Improved rate limits text and added validation for duplicate time --- .../rate-limits-list.component.html | 36 ++++----- .../rate-limits-list.component.scss | 2 +- .../rate-limits/rate-limits-list.component.ts | 75 +++++++++++-------- .../tenant/rate-limits/rate-limits.models.ts | 18 ++--- .../assets/locale/locale.constant-ar_AE.json | 1 - .../assets/locale/locale.constant-da_DK.json | 3 +- .../assets/locale/locale.constant-de_DE.json | 3 +- .../assets/locale/locale.constant-en_US.json | 3 +- .../assets/locale/locale.constant-es_ES.json | 3 +- .../assets/locale/locale.constant-fr_FR.json | 3 +- .../assets/locale/locale.constant-it_IT.json | 3 +- .../assets/locale/locale.constant-lt_LT.json | 1 - .../assets/locale/locale.constant-nl_BE.json | 1 - .../assets/locale/locale.constant-pl_PL.json | 1 - .../assets/locale/locale.constant-zh_CN.json | 1 - .../assets/locale/locale.constant-zh_TW.json | 1 - 16 files changed, 81 insertions(+), 74 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-list.component.html b/ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-list.component.html index 238baaf835..93fe799f09 100644 --- a/ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-list.component.html +++ b/ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-list.component.html @@ -17,31 +17,33 @@ -->
-
- tenant-profile.rate-limits.but-less-than -
+ @if($index > 0) { +
tenant-profile.rate-limits.and-also-less-than
+ }
- + tenant-profile.rate-limits.number-of-messages - - {{ 'tenant-profile.rate-limits.number-of-messages-required' | translate }} - - - {{ 'tenant-profile.rate-limits.number-of-messages-min' | translate }} - + + @if (rateLimit.get('value').hasError('required')) { + tenant-profile.rate-limits.number-of-messages-required + } @else if(rateLimit.get('value').hasError('min')) { + tenant-profile.rate-limits.number-of-messages-min + } - + tenant-profile.rate-limits.per-seconds - - {{ 'tenant-profile.rate-limits.per-seconds-required' | translate }} - - - {{ 'tenant-profile.rate-limits.per-seconds-min' | translate }} - + + @if (rateLimit.get('time').hasError('required')) { + tenant-profile.rate-limits.per-seconds-required + } @else if (rateLimit.get('time').hasError('min')) { + tenant-profile.rate-limits.per-seconds-min + } @else if (rateLimit.get('time').hasError('duplicateTime')) { + tenant-profile.rate-limits.per-seconds-duplicate + }