localization, assign data-base, tenant domain, plan and subscription and data-base connection screen added
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
<modal
|
||||
[open]="open()"
|
||||
[title]="modalTitle()"
|
||||
size="md"
|
||||
size="sm"
|
||||
[submitAction]="mode() === 'create' ? 'save' : 'update'"
|
||||
[submitLabel]="mode() === 'create' ? 'Save' : 'Update'"
|
||||
[loadingLabel]="mode() === 'create' ? 'Saving...' : 'Updating...'"
|
||||
|
||||
-8
@@ -10,14 +10,6 @@
|
||||
<ng-template appDataTableToolbar>
|
||||
<form [formGroup]="filterForm" (ngSubmit)="onApplyFilter()" autocomplete="off"
|
||||
class="flex flex-wrap items-end gap-3 w-full">
|
||||
<div class="w-64 min-w-[200px]">
|
||||
<app-autocomplete formControlName="organizationId" inputId="exchange-rate-org-filter" variant="floating"
|
||||
size="sm" label="Organization" placeholder="Search organization" [searchFn]="searchOrganizations"
|
||||
[displayWith]="displayOrg" [valueWith]="orgValue" [selectedItem]="selectedOrgLookup()" [minSearchLength]="0"
|
||||
[debounceTime]="300" [limit]="20" [clearable]="true" [hideValidation]="true" wrapperClass="!mb-0 w-full"
|
||||
(itemSelected)="onOrgSelected($event)" />
|
||||
</div>
|
||||
|
||||
<div class="w-64 min-w-[200px]">
|
||||
<app-form-input formControlName="rateType" inputId="exchange-rate-type-filter" variant="floating" type="text"
|
||||
label="Rate Type" placeholder="e.g. spot, forward" [hideValidation]="true" />
|
||||
|
||||
+1
-29
@@ -5,12 +5,10 @@ import { DatePipe, DecimalPipe } from '@angular/common';
|
||||
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
import { NotificationService } from '../../../../../core/services/common/notification.service';
|
||||
import { ExchangeRateDto, ExchangeRateFilterParams } from '../../models/exchange-rate.model';
|
||||
import { ExchangeRateDto } from '../../models/exchange-rate.model';
|
||||
import { ExchangeRateService } from '../../data-access/exchange-rate.service';
|
||||
import { CurrencyService } from '../../../currencies/data-access/currency.service';
|
||||
import { CurrencyLookupDto } from '../../../currencies/models/currency.model';
|
||||
import { OrganizationService } from '../../../../organizations/pages/organization-list/data-access/organization.service';
|
||||
import { OrganizationLookupDto } from '../../../../organizations/pages/organization-list/models/organization.model';
|
||||
|
||||
import { DataTable, DataTableToolbarDirective, DataTableCellDirective } from '../../../../../shared/components/data-table/data-table';
|
||||
import { DataTableStore } from '../../../../../shared/components/data-table/data-table.store';
|
||||
@@ -20,12 +18,6 @@ import {
|
||||
DataTableColumn,
|
||||
DataTableRecord
|
||||
} from '../../../../../shared/components/data-table/data-table.types';
|
||||
import { Autocomplete } from '../../../../../shared/components/form/autocomplete/autocomplete';
|
||||
import {
|
||||
AutocompleteDisplayFn,
|
||||
AutocompleteSearchFn,
|
||||
AutocompleteValueFn
|
||||
} from '../../../../../shared/components/form/autocomplete/autocomplete.types';
|
||||
import { FormInput } from '../../../../../shared/components/form/form-input/form-input';
|
||||
import { Button } from '../../../../../shared/components/button/button';
|
||||
import { ConfirmDialog } from '../../../../../shared/components/confirm-dialog/confirm-dialog';
|
||||
@@ -59,7 +51,6 @@ export interface ExchangeRateTableRow extends DataTableRecord {
|
||||
DataTable,
|
||||
DataTableToolbarDirective,
|
||||
DataTableCellDirective,
|
||||
Autocomplete,
|
||||
FormInput,
|
||||
Button,
|
||||
ConfirmDialog,
|
||||
@@ -76,7 +67,6 @@ export class ExchangeRateList implements OnInit {
|
||||
private readonly formBuilder = inject(FormBuilder);
|
||||
private readonly exchangeRateApi = inject(ExchangeRateService);
|
||||
private readonly currencyService = inject(CurrencyService);
|
||||
private readonly orgService = inject(OrganizationService);
|
||||
private readonly notification = inject(NotificationService);
|
||||
readonly tableStore = inject(DataTableStore<ExchangeRateDto, ExchangeRateTableRow>);
|
||||
|
||||
@@ -89,12 +79,10 @@ export class ExchangeRateList implements OnInit {
|
||||
readonly closeConfirmDialog = viewChild('closeDialog', { read: ConfirmDialog });
|
||||
|
||||
readonly showFilters = signal(false);
|
||||
readonly selectedOrgLookup = signal<OrganizationLookupDto | null>(null);
|
||||
readonly currencyCodeMap = signal<Record<string, string>>({});
|
||||
private readonly pendingCurrencyFetchIds = new Set<string>();
|
||||
|
||||
readonly filterForm = this.formBuilder.group({
|
||||
organizationId: [''],
|
||||
rateType: ['']
|
||||
});
|
||||
|
||||
@@ -127,11 +115,9 @@ export class ExchangeRateList implements OnInit {
|
||||
|
||||
this.tableStore.initialize({
|
||||
fetcher: query => {
|
||||
const orgId = this.filterForm.controls.organizationId.value;
|
||||
const rType = this.filterForm.controls.rateType.value;
|
||||
const fullQuery = {
|
||||
...query,
|
||||
...(orgId ? { organizationId: orgId } : {}),
|
||||
...(rType ? { rateType: rType } : {})
|
||||
};
|
||||
return this.exchangeRateApi.getExchangeRateDataTable(fullQuery);
|
||||
@@ -180,18 +166,6 @@ export class ExchangeRateList implements OnInit {
|
||||
return id ? id.substring(0, 8) + '...' : '-';
|
||||
}
|
||||
|
||||
readonly searchOrganizations: AutocompleteSearchFn<OrganizationLookupDto> = (term, limit) => {
|
||||
return this.orgService.autocomplete(term, limit || 20);
|
||||
};
|
||||
|
||||
readonly displayOrg: AutocompleteDisplayFn<OrganizationLookupDto> = org => org?.name ?? '';
|
||||
readonly orgValue: AutocompleteValueFn<OrganizationLookupDto, string> = org => org?.id ?? '';
|
||||
|
||||
onOrgSelected(org: OrganizationLookupDto | null): void {
|
||||
this.selectedOrgLookup.set(org);
|
||||
this.filterForm.patchValue({ organizationId: org?.id ?? '' });
|
||||
}
|
||||
|
||||
onToggleFilters(): void {
|
||||
this.showFilters.update(v => !v);
|
||||
}
|
||||
@@ -201,9 +175,7 @@ export class ExchangeRateList implements OnInit {
|
||||
}
|
||||
|
||||
onResetFilter(): void {
|
||||
this.selectedOrgLookup.set(null);
|
||||
this.filterForm.reset({
|
||||
organizationId: '',
|
||||
rateType: ''
|
||||
});
|
||||
this.tableStore.refresh();
|
||||
|
||||
Reference in New Issue
Block a user