Merge branch 'master' into ft/add-codeql

This commit is contained in:
Rinat Arsaev 2022-01-12 14:32:24 +03:00 committed by GitHub
commit d5a4149a00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 24 deletions

18
renovate.json Normal file
View File

@ -0,0 +1,18 @@
{
"extends": [
"config:base"
],
"packageRules": [
{
"matchPackagePatterns": [
"*"
],
"matchUpdateTypes": [
"minor",
"patch"
],
"groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch"
}
]
}

View File

@ -1,14 +0,0 @@
export interface CurrencySource {
source: string;
currency: string;
}
export const CURRENCIES: CurrencySource[] = [
{ source: '3', currency: 'RUB' },
{ source: '5', currency: 'UAH' },
{ source: 'eskin1', currency: 'USD' },
{ source: 'eskin2', currency: 'EUR' },
{ source: 'eskin3', currency: 'KZT' },
{ source: 'eskin5', currency: 'BYN' },
{ source: '667c1494-a334-4cd4-b350-712917fc6f8e', currency: 'UZS' },
];

View File

@ -6,7 +6,7 @@ import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { AppAuthGuardService, DepositRole } from '@cc/app/shared/services';
import { CURRENCIES } from '../constants/currencies';
import { ConfigService } from '../../../core/config.service';
import { CreateDepositService } from './services/create-deposit/create-deposit.service';
@UntilDestroy()
@ -19,7 +19,7 @@ import { CreateDepositService } from './services/create-deposit/create-deposit.s
export class CreateDepositDialogComponent implements OnInit {
form: FormGroup;
currencies = CURRENCIES;
currencies = this.configService.config.constants.currencies;
depositCreated$ = this.createDepositService.depositCreated$;
isLoading$ = this.createDepositService.isLoading$;
@ -31,7 +31,8 @@ export class CreateDepositDialogComponent implements OnInit {
private createDepositService: CreateDepositService,
private snackBar: MatSnackBar,
private dialogRef: MatDialogRef<CreateDepositDialogComponent>,
private authGuardService: AppAuthGuardService
private authGuardService: AppAuthGuardService,
private configService: ConfigService
) {}
ngOnInit() {

View File

@ -13,11 +13,11 @@ import { createDepositStopPollingCondition } from '@cc/app/shared/utils';
import { poll } from '@cc/utils/poll';
import { toMinor } from '@cc/utils/to-minor';
import { ConfigService } from '../../../../../core/config.service';
import { FistfulAdminService } from '../../../../../thrift-services/fistful/fistful-admin.service';
import { FistfulStatisticsService } from '../../../../../thrift-services/fistful/fistful-stat.service';
import { DepositParams } from '../../../../../thrift-services/fistful/gen-model/fistful_admin';
import { StatDeposit } from '../../../../../thrift-services/fistful/gen-model/fistful_stat';
import { CURRENCIES } from '../../../constants/currencies';
import { SearchParams } from '../../../types/search-params';
@Injectable()
@ -81,7 +81,8 @@ export class CreateDepositService {
private fistfulStatisticsService: FistfulStatisticsService,
private keycloakService: KeycloakService,
private fb: FormBuilder,
private idGenerator: UserInfoBasedIdGeneratorService
private idGenerator: UserInfoBasedIdGeneratorService,
private configService: ConfigService
) {}
createDeposit() {
@ -92,7 +93,7 @@ export class CreateDepositService {
return this.fb.group({
destination: ['', Validators.required],
amount: ['', [Validators.required, Validators.pattern(/^\d+([,.]\d{1,2})?$/)]],
currency: [CURRENCIES[0], Validators.required],
currency: [this.configService.config.constants.currencies[0], Validators.required],
});
}

View File

@ -8,7 +8,7 @@ import {
} from '@angular/core';
import { MAT_DATE_FORMATS } from '@angular/material/core';
import { CURRENCIES } from '../constants/currencies';
import { ConfigService } from '../../../core/config.service';
import { SearchParams } from '../types/search-params';
import { SearchFiltersService } from './services/search-filters/search-filters.service';
@ -39,11 +39,14 @@ export class SearchFiltersComponent implements OnInit {
depositStatuses = ['Pending', 'Succeeded', 'Failed'];
currencies = CURRENCIES;
currencies = this.configService.config.constants.currencies;
form = this.searchFiltersService.form;
constructor(private searchFiltersService: SearchFiltersService) {
constructor(
private searchFiltersService: SearchFiltersService,
private configService: ConfigService
) {
this.searchFiltersService.searchParamsChanges$.subscribe((params) =>
this.valueChanges.emit(params)
);

View File

@ -1,4 +1,7 @@
{
"papiEndpoint": "",
"fileStorageEndpoint": ""
"fileStorageEndpoint": "",
"constants": {
"currencies": []
}
}