Skip to content

Commit 5984f34

Browse files
authored
Merge branch 'dev' into WEB-1203-fix-blank-currency-filter-results
2 parents 285cd48 + cdc53f3 commit 5984f34

14 files changed

Lines changed: 34 additions & 13 deletions

File tree

‎src/app/organization/currencies/manage-currencies/manage-currencies.component.ts‎

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { TranslateService } from '@ngx-translate/core';
3131
import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dialog.component';
3232

3333
/** Custom Services */
34+
import { AlertService } from 'app/core/alert/alert.service';
3435
import { OrganizationService } from '../../organization.service';
3536
import { PopoverService } from '../../../configuration-wizard/popover/popover.service';
3637
import { ConfigurationWizardService } from '../../../configuration-wizard/configuration-wizard.service';
@@ -66,6 +67,7 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnChang
6667
private route = inject(ActivatedRoute);
6768
private formBuilder = inject(FormBuilder);
6869
private organizationservice = inject(OrganizationService);
70+
private alertService = inject(AlertService);
6971
dialog = inject(MatDialog);
7072
private router = inject(Router);
7173
private translateService = inject(TranslateService);
@@ -157,20 +159,26 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnChang
157159
addCurrency() {
158160
const newCurrency = this.currencyForm.value.currency;
159161
const selectedCurrencyCodes: any[] = this.selectedCurrencies.map((currency) => currency.code);
160-
if (!selectedCurrencyCodes.includes(newCurrency.code)) {
161-
selectedCurrencyCodes.push(newCurrency.code);
162-
this.organizationservice
163-
.updateCurrencies(selectedCurrencyCodes)
164-
.pipe(take(1))
165-
.subscribe((response: any) => {
166-
this.selectedCurrencies.push(newCurrency);
167-
this.formRef.resetForm();
168-
if (this.configurationWizardService.showCurrencyForm) {
169-
this.configurationWizardService.showCurrencyForm = false;
170-
this.openDialog();
171-
}
172-
});
162+
if (selectedCurrencyCodes.includes(newCurrency.code)) {
163+
this.alertService.alert({
164+
type: 'error',
165+
message: this.translateService.instant('labels.text.This currency has already been added')
166+
});
167+
this.formRef.resetForm();
168+
return;
173169
}
170+
selectedCurrencyCodes.push(newCurrency.code);
171+
this.organizationservice
172+
.updateCurrencies(selectedCurrencyCodes)
173+
.pipe(take(1))
174+
.subscribe((response: any) => {
175+
this.selectedCurrencies.push(newCurrency);
176+
this.formRef.resetForm();
177+
if (this.configurationWizardService.showCurrencyForm) {
178+
this.configurationWizardService.showCurrencyForm = false;
179+
this.openDialog();
180+
}
181+
});
174182
}
175183

176184
/**

‎src/assets/translations/cs-CS.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4695,6 +4695,7 @@
46954695
"The usage of stronger passwords": "Definujte standardy pro vynucení používání silnějších hesel",
46964696
"These are predefined postings": "Jedná se o předdefinované příspěvky",
46974697
"This allows you to manage funds associated with loans.": "To vám umožní spravovat finanční prostředky spojené s půjčkami.",
4698+
"This currency has already been added": "Tato měna již byla přidána",
46984699
"This option allows you to create new loan product.": "Tato možnost umožňuje vytvořit nový úvěrový produkt.",
46994700
"This option allows you to create new recurring product.": "Tato možnost umožňuje vytvořit nový opakující se produkt.",
47004701
"This option allows you to create new savings product.": "Tato možnost umožňuje vytvořit nový spořicí produkt.",

‎src/assets/translations/de-DE.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4695,6 +4695,7 @@
46954695
"The usage of stronger passwords": "Definieren Sie Standards zur Durchsetzung der Verwendung stärkerer Passwörter",
46964696
"These are predefined postings": "Dabei handelt es sich um vordefinierte Buchungen",
46974697
"This allows you to manage funds associated with loans.": "Auf diese Weise können Sie die mit Krediten verbundenen Mittel verwalten.",
4698+
"This currency has already been added": "Diese Währung wurde bereits hinzugefügt",
46984699
"This option allows you to create new loan product.": "Mit dieser Option können Sie ein neues Kreditprodukt erstellen.",
46994700
"This option allows you to create new recurring product.": "Mit dieser Option können Sie ein neues wiederkehrendes Produkt erstellen.",
47004701
"This option allows you to create new savings product.": "Mit dieser Option können Sie ein neues Sparprodukt erstellen.",

‎src/assets/translations/en-US.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4896,6 +4896,7 @@
48964896
"The usage of stronger passwords": "Define standards for enforcing the usage of stronger passwords",
48974897
"These are predefined postings": "These are predefined postings",
48984898
"This allows you to manage funds associated with loans.": "This allows you to manage funds associated with loans.",
4899+
"This currency has already been added": "This currency has already been added",
48994900
"This option allows you to create new loan product.": "This option allows you to create a new loan product.",
49004901
"This option allows you to create new recurring product.": "This option allows you to create a new recurring product.",
49014902
"This option allows you to create new savings product.": "This option allows you to create a new savings product.",

‎src/assets/translations/es-CL.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4710,6 +4710,7 @@
47104710
"The usage of stronger passwords": "Definir estándares para hacer cumplir el uso de contraseñas más seguras",
47114711
"These are predefined postings": "Estas son publicaciones predefinidas",
47124712
"This allows you to manage funds associated with loans.": "Esto le permite administrar fondos asociados con Créditos.",
4713+
"This currency has already been added": "Esta moneda ya fue agregada",
47134714
"This option allows you to create new loan product.": "Esta opción le permite crear un nuevo producto de Crédito.",
47144715
"This option allows you to create new recurring product.": "Esta opción le permite crear un nuevo producto recurrente.",
47154716
"This option allows you to create new savings product.": "Esta opción le permite crear un nuevo producto de ahorro.",

‎src/assets/translations/es-MX.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4734,6 +4734,7 @@
47344734
"The usage of stronger passwords": "Definir estándares para hacer cumplir el uso de contraseñas más seguras",
47354735
"These are predefined postings": "Estas son publicaciones predefinidas",
47364736
"This allows you to manage funds associated with loans.": "Esto le permite administrar fondos asociados con Créditos.",
4737+
"This currency has already been added": "Esta moneda ya ha sido agregada",
47374738
"This option allows you to create new loan product.": "Esta opción le permite crear un nuevo producto de Crédito.",
47384739
"This option allows you to create new recurring product.": "Esta opción le permite crear un nuevo producto recurrente.",
47394740
"This option allows you to create new savings product.": "Esta opción le permite crear un nuevo producto de ahorro.",

‎src/assets/translations/fr-FR.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4697,6 +4697,7 @@
46974697
"The usage of stronger passwords": "Définir des normes pour imposer l'utilisation de mots de passe plus forts",
46984698
"These are predefined postings": "Ce sont des publications prédéfinies",
46994699
"This allows you to manage funds associated with loans.": "Cela vous permet de gérer les fonds associés aux prêts.",
4700+
"This currency has already been added": "Cette devise a déjà été ajoutée",
47004701
"This option allows you to create new loan product.": "Cette option vous permet de créer un nouveau produit de prêt.",
47014702
"This option allows you to create new recurring product.": "Cette option vous permet de créer un nouveau produit récurrent.",
47024703
"This option allows you to create new savings product.": "Cette option vous permet de créer un nouveau produit d'épargne.",

‎src/assets/translations/it-IT.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4693,6 +4693,7 @@
46934693
"The usage of stronger passwords": "Definire standard per imporre l'uso di password più forti",
46944694
"These are predefined postings": "Questi sono messaggi predefiniti",
46954695
"This allows you to manage funds associated with loans.": "Ciò consente di gestire i fondi associati ai prestiti.",
4696+
"This currency has already been added": "Questa valuta è già stata aggiunta",
46964697
"This option allows you to create new loan product.": "Questa opzione ti consente di creare un nuovo prodotto di prestito.",
46974698
"This option allows you to create new recurring product.": "Questa opzione ti consente di creare un nuovo prodotto ricorrente.",
46984699
"This option allows you to create new savings product.": "Questa opzione ti consente di creare un nuovo prodotto di risparmio.",

‎src/assets/translations/ko-KO.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4693,6 +4693,7 @@
46934693
"The usage of stronger passwords": "더 강력한 비밀번호 사용을 시행하기 위한 표준 정의",
46944694
"These are predefined postings": "사전 정의된 게시물입니다.",
46954695
"This allows you to manage funds associated with loans.": "이를 통해 대출과 관련된 자금을 관리할 수 있습니다.",
4696+
"This currency has already been added": "이 통화는 이미 추가되었습니다",
46964697
"This option allows you to create new loan product.": "이 옵션을 사용하면 새로운 대출 상품을 생성할 수 있습니다.",
46974698
"This option allows you to create new recurring product.": "이 옵션을 사용하면 새로운 반복 제품을 생성할 수 있습니다.",
46984699
"This option allows you to create new savings product.": "이 옵션을 사용하면 새로운 저축 상품을 만들 수 있습니다.",

‎src/assets/translations/lt-LT.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4693,6 +4693,7 @@
46934693
"The usage of stronger passwords": "Apibrėžkite stipresnių slaptažodžių naudojimo standartus",
46944694
"These are predefined postings": "Tai yra iš anksto nustatyti skelbimai",
46954695
"This allows you to manage funds associated with loans.": "Tai leidžia valdyti su paskolomis susijusias lėšas.",
4696+
"This currency has already been added": "Ši valiuta jau pridėta",
46964697
"This option allows you to create new loan product.": "Ši parinktis leidžia sukurti naują paskolos produktą.",
46974698
"This option allows you to create new recurring product.": "Ši parinktis leidžia sukurti naują pasikartojantį produktą.",
46984699
"This option allows you to create new savings product.": "Ši parinktis leidžia sukurti naują taupymo produktą.",

0 commit comments

Comments
 (0)