diff --git a/docs/compodoc/components/AccountDetailsComponent.html b/docs/compodoc/components/AccountDetailsComponent.html index 6f92731..8cc051c 100644 --- a/docs/compodoc/components/AccountDetailsComponent.html +++ b/docs/compodoc/components/AccountDetailsComponent.html @@ -508,8 +508,8 @@ -
Defined in src/app/pages/accounts/account-details/account-details.component.ts:293
+
Defined in src/app/pages/accounts/account-details/account-details.component.ts:287
@@ -547,8 +547,8 @@ -
Defined in src/app/pages/accounts/account-details/account-details.component.ts:208
+
Defined in src/app/pages/accounts/account-details/account-details.component.ts:202
@@ -617,8 +617,8 @@ -
Defined in src/app/pages/accounts/account-details/account-details.component.ts:212
+
Defined in src/app/pages/accounts/account-details/account-details.component.ts:206
@@ -687,8 +687,8 @@ -
Defined in src/app/pages/accounts/account-details/account-details.component.ts:289
+
Defined in src/app/pages/accounts/account-details/account-details.component.ts:283
@@ -769,8 +769,8 @@ -
Defined in src/app/pages/accounts/account-details/account-details.component.ts:251
+
Defined in src/app/pages/accounts/account-details/account-details.component.ts:245
@@ -808,8 +808,8 @@ -
Defined in src/app/pages/accounts/account-details/account-details.component.ts:264
+
Defined in src/app/pages/accounts/account-details/account-details.component.ts:258
@@ -888,8 +888,8 @@ -
Defined in src/app/pages/accounts/account-details/account-details.component.ts:277
+
Defined in src/app/pages/accounts/account-details/account-details.component.ts:271
@@ -929,8 +929,8 @@ -
Defined in src/app/pages/accounts/account-details/account-details.component.ts:230
+
Defined in src/app/pages/accounts/account-details/account-details.component.ts:224
@@ -968,8 +968,8 @@ -
Defined in src/app/pages/accounts/account-details/account-details.component.ts:220
+
Defined in src/app/pages/accounts/account-details/account-details.component.ts:214
@@ -1034,8 +1034,8 @@ -
Defined in src/app/pages/accounts/account-details/account-details.component.ts:216
+
Defined in src/app/pages/accounts/account-details/account-details.component.ts:210
@@ -1324,7 +1324,7 @@ - Type : Array<AreaName> + Type : Array<string> @@ -1378,7 +1378,7 @@ - Type : Array<AreaType> + Type : Array<string> @@ -1432,7 +1432,7 @@ - Type : Array<Category> + Type : Array<string> @@ -2115,7 +2115,7 @@ -
Defined in src/app/pages/accounts/account-details/account-details.component.ts:226
+
Defined in src/app/pages/accounts/account-details/account-details.component.ts:220
@@ -2151,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', @@ -2180,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'; @@ -2243,27 +2243,21 @@ export class AccountDetailsComponent implements OnInit { this.account = res; this.cdr.detectChanges(); this.loggingService.sendInfoLevelMessage(this.account); - this.locationService - .getAreaNameByLocation(this.account.location.area_name) - .pipe(first()) - .subscribe((response) => { - this.area = response; - this.cdr.detectChanges(); - this.locationService - .getAreaTypeByArea(this.area) - .pipe(first()) - .subscribe((result) => { - this.areaType = result; - this.cdr.detectChanges(); - }); - }); - this.userService - .getCategoryByProduct(this.account.products[0]) - .pipe(first()) - .subscribe((response) => { - this.category = response; + 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], @@ -2302,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()) @@ -2545,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> @@ -2582,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> @@ -2619,6 +2577,42 @@ 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> @@ -3023,7 +3017,7 @@ export class AccountDetailsComponent implements OnInit { - - -
-
-
-
- -
-
- Options -
-
- All -
    -
  • Public
  • -
  • Public/Protected
  • -
  • All
  • -
-
- - - - -
-
- Menu -
-
-
-
-
-
- -

Interface AreaName

-
-
-
-
-
-
-
-
-
-
exports
-
-
-
-
-
-

Hierarchy

-
    -
  • - AreaName -
  • -
-
-
-

Index

-
-
-
-

Properties

- -
-
-
-
-
-

Properties

-
- -

locations

-
locations: string[]
- -
-
-

Locations that map to that area name.

-
-
-
-
- -

name

-
name: string
- -
-
-

Name of area

-
-
-
-
-
- -
-
- -
-

Generated using TypeDoc

-
-
- - - \ No newline at end of file diff --git a/docs/typedoc/interfaces/app__models_mappings.areatype.html b/docs/typedoc/interfaces/app__models_mappings.areatype.html deleted file mode 100644 index 6e5c2d1..0000000 --- a/docs/typedoc/interfaces/app__models_mappings.areatype.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - AreaType | CICADA - - - - - - -
-
-
-
- -
-
- Options -
-
- All -
    -
  • Public
  • -
  • Public/Protected
  • -
  • All
  • -
-
- - - - -
-
- Menu -
-
-
-
-
-
- -

Interface AreaType

-
-
-
-
-
-
-
-
-
-
exports
-
-
-
-
-
-

Hierarchy

-
    -
  • - AreaType -
  • -
-
-
-

Index

-
-
-
-

Properties

- -
-
-
-
-
-

Properties

-
- -

area

-
area: string[]
- -
-
-

Areas that map to that area type.

-
-
-
-
- -

name

-
name: string
- -
-
-

Type of area

-
-
-
-
-
- -
-
- -
-

Generated using TypeDoc

-
-
- - - \ No newline at end of file diff --git a/docs/typedoc/interfaces/app__models_mappings.category.html b/docs/typedoc/interfaces/app__models_mappings.category.html deleted file mode 100644 index 7327680..0000000 --- a/docs/typedoc/interfaces/app__models_mappings.category.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - Category | CICADA - - - - - - -
-
-
-
- -
-
- Options -
-
- All -
    -
  • Public
  • -
  • Public/Protected
  • -
  • All
  • -
-
- - - - -
-
- Menu -
-
-
-
-
-
- -

Interface Category

-
-
-
-
-
-
-
-
-
-
exports
-
-
-
-
-
-

Hierarchy

-
    -
  • - Category -
  • -
-
-
-

Index

-
-
-
-

Properties

- -
-
-
-
-
-

Properties

-
- -

name

-
name: string
- -
-
-

Business category

-
-
-
-
- -

products

-
products: string[]
- -
-
-

Products that map to that category.

-
-
-
-
-
- -
-
- -
-

Generated using TypeDoc

-
-
- - - \ No newline at end of file diff --git a/docs/typedoc/modules/app__helpers_mock_backend.html b/docs/typedoc/modules/app__helpers_mock_backend.html index e87c3b0..ddb72bb 100644 --- a/docs/typedoc/modules/app__helpers_mock_backend.html +++ b/docs/typedoc/modules/app__helpers_mock_backend.html @@ -92,7 +92,7 @@
MockBackendProvider: { multi: boolean; provide: InjectionToken<HttpInterceptor[]>; useClass: typeof MockBackendInterceptor } = ...
diff --git a/docs/typedoc/modules/app__models.html b/docs/typedoc/modules/app__models.html index ed68eb9..e9e9e59 100644 --- a/docs/typedoc/modules/app__models.html +++ b/docs/typedoc/modules/app__models.html @@ -74,9 +74,6 @@
@@ -98,15 +95,6 @@
  • Action
  • -
  • - AreaName -
  • -
  • - AreaType -
  • -
  • - Category -