diff --git a/docs/compodoc/components/AccountDetailsComponent.html b/docs/compodoc/components/AccountDetailsComponent.html
index b3005e2..afa072d 100644
--- a/docs/compodoc/components/AccountDetailsComponent.html
+++ b/docs/compodoc/components/AccountDetailsComponent.html
@@ -154,9 +154,15 @@
accountTypes
+
+ area
+
areaNames
+
+ areaType
+
areaTypes
@@ -166,6 +172,9 @@
categories
+
+ category
+
genders
@@ -310,7 +319,7 @@
-
+
|
@@ -499,8 +508,8 @@
-
+
|
@@ -538,8 +547,8 @@
-
+
|
@@ -608,8 +617,8 @@
-
+
|
@@ -678,8 +687,8 @@
-
+
|
@@ -760,8 +769,8 @@
-
+
|
@@ -799,8 +808,8 @@
-
+
|
@@ -840,8 +849,8 @@
-
+
|
@@ -879,8 +888,8 @@
-
+
|
@@ -920,8 +929,8 @@
-
+
|
@@ -959,8 +968,8 @@
-
+
|
@@ -1025,8 +1034,8 @@
-
+
|
@@ -1272,6 +1281,33 @@
+
+
+
+
+
+
+
+
+
+ area
+
+
+ |
+
+
+
+ Type : string
+
+ |
+
+
+
+
+ |
+
+
+
@@ -1288,7 +1324,7 @@
- Type : Array<AreaName>
+ Type : Array<string>
|
@@ -1299,6 +1335,33 @@
+
+
+
+
+
+
+
+
+
+ areaType
+
+
+ |
+
+
+
+ Type : string
+
+ |
+
+
+
+
+ |
+
+
+
@@ -1315,7 +1378,7 @@
- Type : Array<AreaType>
+ Type : Array<string>
|
@@ -1369,7 +1432,7 @@
- Type : Array<Category>
+ Type : Array<string>
|
@@ -1380,6 +1443,33 @@
+
+
+
+
+
+
+
+
+
+ category
+
+
+ |
+
+
+
+ Type : string
+
+ |
+
+
+
+
+ |
+
+
+
@@ -2025,7 +2115,7 @@
-
+
|
@@ -2061,7 +2151,7 @@ import { copyToClipboard, CustomErrorStateMatcher, exportCsv } from '@app/_
import { MatSnackBar } from '@angular/material/snack-bar';
import { add0x, strip0x } from '@src/assets/js/ethtx/dist/hex';
import { environment } from '@src/environments/environment';
-import { AccountDetails, AreaName, AreaType, Category, Transaction } from '@app/_models';
+import { AccountDetails, Transaction } from '@app/_models';
@Component({
selector: 'app-account-details',
@@ -2090,9 +2180,9 @@ export class AccountDetailsComponent implements OnInit {
accountStatus: any;
accounts: Array<AccountDetails> = [];
accountsType: string = 'all';
- categories: Array<Category>;
- areaNames: Array<AreaName>;
- areaTypes: Array<AreaType>;
+ categories: Array<string>;
+ areaNames: Array<string>;
+ areaTypes: Array<string>;
transaction: any;
transactions: Array<Transaction>;
transactionsType: string = 'all';
@@ -2103,6 +2193,9 @@ export class AccountDetailsComponent implements OnInit {
submitted: boolean = false;
bloxbergLink: string;
tokenSymbol: string;
+ category: string;
+ area: string;
+ areaType: string;
constructor(
private formBuilder: FormBuilder,
@@ -2129,7 +2222,7 @@ export class AccountDetailsComponent implements OnInit {
firstName: ['', Validators.required],
lastName: ['', Validators.required],
phoneNumber: ['', Validators.required],
- age: ['', Validators.required],
+ age: [''],
type: ['', Validators.required],
bio: ['', Validators.required],
gender: ['', Validators.required],
@@ -2150,6 +2243,21 @@ export class AccountDetailsComponent implements OnInit {
this.account = res;
this.cdr.detectChanges();
this.loggingService.sendInfoLevelMessage(this.account);
+ this.locationService.areaNamesSubject.subscribe((response) => {
+ this.area = this.locationService.getAreaNameByLocation(
+ this.account.location.area_name,
+ response
+ );
+ this.cdr.detectChanges();
+ this.locationService.areaTypesSubject.subscribe((result) => {
+ this.areaType = this.locationService.getAreaTypeByArea(this.area, result);
+ this.cdr.detectChanges();
+ });
+ });
+ this.userService.categoriesSubject.subscribe((result) => {
+ this.category = this.userService.getCategoryByProduct(this.account.products[0], result);
+ this.cdr.detectChanges();
+ });
const fullName = this.account.vcard?.fn[0].value.split(' ');
this.accountInfoForm.patchValue({
firstName: fullName[0].split(',')[0],
@@ -2159,26 +2267,10 @@ export class AccountDetailsComponent implements OnInit {
type: this.account.type,
bio: this.account.products,
gender: this.account.gender,
- businessCategory:
- this.account.category ||
- this.userService.getCategoryByProduct(this.account.products[0]),
+ businessCategory: this.account.category || this.category || 'other',
userLocation: this.account.location.area_name,
- location:
- this.account.location.area ||
- this.locationService
- .getAreaNameByLocation(this.account.location.area_name)
- .pipe(first())
- .subscribe((response) => {
- return response;
- }),
- locationType:
- this.account.location.area_type ||
- this.locationService
- .getAreaTypeByArea(this.accountInfoFormStub.location.value)
- .pipe(first())
- .subscribe((response) => {
- return response;
- }),
+ location: this.account.location.area || this.area || 'other',
+ locationType: this.account.location.area_type || this.areaType || 'other',
});
this.userService
.getAccountStatus(this.account.vcard?.tel[0].value)
@@ -2204,18 +2296,18 @@ export class AccountDetailsComponent implements OnInit {
this.transactions = transactions;
this.cdr.detectChanges();
});
- this.userService
- .getCategories()
- .pipe(first())
- .subscribe((res) => (this.categories = res));
- this.locationService
- .getAreaNames()
- .pipe(first())
- .subscribe((res) => (this.areaNames = res));
- this.locationService
- .getAreaTypes()
- .pipe(first())
- .subscribe((res) => (this.areaTypes = res));
+ this.userService.getCategories();
+ this.userService.categoriesSubject.subscribe((res) => {
+ this.categories = Object.keys(res);
+ });
+ this.locationService.getAreaNames();
+ this.locationService.areaNamesSubject.subscribe((res) => {
+ this.areaNames = Object.keys(res);
+ });
+ this.locationService.getAreaTypes();
+ this.locationService.areaTypesSubject.subscribe((res) => {
+ this.areaTypes = Object.keys(res);
+ });
this.userService
.getAccountTypes()
.pipe(first())
@@ -2299,7 +2391,7 @@ export class AccountDetailsComponent implements OnInit {
});
} else {
this.transactionsDataSource.data = this.transactions.filter(
- (transaction) => transaction.type === this.transactionsType
+ (transaction) => transaction.type + 's' === this.transactionsType
);
}
}
@@ -2447,24 +2539,6 @@ export class AccountDetailsComponent implements OnInit {
</mat-form-field>
</div>
- <div class="col-md-6 col-lg-4">
- <mat-form-field appearance="outline">
- <mat-label>Age: </mat-label>
- <input
- matInput
- type="text"
- id="age"
- placeholder="{{ account?.age }}"
- value="{{ account?.age }}"
- formControlName="age"
- [errorStateMatcher]="matcher"
- />
- <mat-error *ngIf="submitted && accountInfoFormStub.age.errors"
- >Age is required.</mat-error
- >
- </mat-form-field>
- </div>
-
<div class="col-md-6 col-lg-4">
<mat-form-field appearance="outline">
<mat-label> ACCOUNT TYPE: </mat-label>
@@ -2484,24 +2558,6 @@ export class AccountDetailsComponent implements OnInit {
</mat-form-field>
</div>
- <div class="col-md-6 col-lg-4">
- <mat-form-field appearance="outline">
- <mat-label>Bio: </mat-label>
- <input
- matInput
- type="text"
- id="bio"
- placeholder="{{ account?.products }}"
- value="{{ account?.products }}"
- formControlName="bio"
- [errorStateMatcher]="matcher"
- />
- <mat-error *ngIf="submitted && accountInfoFormStub.bio.errors"
- >Bio is required.</mat-error
- >
- </mat-form-field>
- </div>
-
<div class="col-md-6 col-lg-4">
<mat-form-field appearance="outline">
<mat-label> GENDER: </mat-label>
@@ -2521,12 +2577,48 @@ export class AccountDetailsComponent implements OnInit {
</mat-form-field>
</div>
+ <div class="col-md-6 col-lg-4">
+ <mat-form-field appearance="outline">
+ <mat-label>Age: </mat-label>
+ <input
+ matInput
+ type="text"
+ id="age"
+ placeholder="{{ account?.age }}"
+ value="{{ account?.age }}"
+ formControlName="age"
+ [errorStateMatcher]="matcher"
+ />
+ <mat-error *ngIf="submitted && accountInfoFormStub.age.errors"
+ >Age is required.</mat-error
+ >
+ </mat-form-field>
+ </div>
+
+ <div class="col-md-6 col-lg-4">
+ <mat-form-field appearance="outline">
+ <mat-label>Bio: </mat-label>
+ <input
+ matInput
+ type="text"
+ id="bio"
+ placeholder="{{ account?.products }}"
+ value="{{ account?.products }}"
+ formControlName="bio"
+ [errorStateMatcher]="matcher"
+ />
+ <mat-error *ngIf="submitted && accountInfoFormStub.bio.errors"
+ >Bio is required.</mat-error
+ >
+ </mat-form-field>
+ </div>
+
<div class="col-md-6 col-lg-4">
<mat-form-field appearance="outline">
<mat-label> BUSINESS CATEGORY: </mat-label>
<mat-select
id="businessCategory"
- [(value)]="account.category"
+ [(value)]="category"
formControlName="businessCategory"
[errorStateMatcher]="matcher"
>
@@ -2563,7 +2655,7 @@ export class AccountDetailsComponent implements OnInit {
<mat-label> LOCATION: </mat-label>
<mat-select
id="location"
- [(value)]="account.location.area"
+ [(value)]="area"
formControlName="location"
[errorStateMatcher]="matcher"
>
@@ -2582,7 +2674,7 @@ export class AccountDetailsComponent implements OnInit {
<mat-label> LOCATION TYPE: </mat-label>
<mat-select
id="locationType"
- [(value)]="account.location.area_type"
+ [(value)]="areaType"
formControlName="locationType"
[errorStateMatcher]="matcher"
>
@@ -2925,7 +3017,7 @@ export class AccountDetailsComponent implements OnInit {
-
-
-
-
-
-
-
-
-
-
-
-
- - Preparing search index...
- - The search index is not available
-
-
CICADA
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Properties
-
-
- locations
- locations: string[]
-
-
-
-
-
- name
- name: string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-- exports
-
-
-