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 @@ -
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:67
    +
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:70
    @@ -499,8 +508,8 @@ -
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:285
    +
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:287
    @@ -538,8 +547,8 @@ -
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:200
    +
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:202
    @@ -608,8 +617,8 @@ -
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:204
    +
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:206
    @@ -678,8 +687,8 @@ -
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:281
    +
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:283
    @@ -760,8 +769,8 @@ -
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:243
    +
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:245
    @@ -799,8 +808,8 @@ -
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:256
    +
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:258
    @@ -840,8 +849,8 @@ -
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:89
    +
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:92
    @@ -879,8 +888,8 @@ -
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:269
    +
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:271
    @@ -920,8 +929,8 @@ -
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:222
    +
    Defined in src/app/pages/accounts/account-details/account-details.component.ts:224
    @@ -959,8 +968,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:214
    @@ -1025,8 +1034,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:210
    @@ -1272,6 +1281,33 @@ + + + + + + + + + + + + + + +
    + + + + area + + +
    + Type : string + +
    + +
    @@ -1288,7 +1324,7 @@ @@ -1299,6 +1335,33 @@ + +
    - Type : Array<AreaName> + Type : Array<string>
    + + + + + + + + + + + + +
    + + + + areaType + + +
    + Type : string + +
    + +
    @@ -1315,7 +1378,7 @@ @@ -1369,7 +1432,7 @@ @@ -1380,6 +1443,33 @@ + +
    - Type : Array<AreaType> + Type : Array<string>
    - Type : Array<Category> + Type : Array<string>
    + + + + + + + + + + + + +
    + + + + 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 { - - -
    -
    -
    -
    - -
    -
    - 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 c99a56d..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 -
  • diff --git a/docs/typedoc/modules/environments_environment.html b/docs/typedoc/modules/environments_environment.html index 9f526ae..b0cfd6d 100644 --- a/docs/typedoc/modules/environments_environment.html +++ b/docs/typedoc/modules/environments_environment.html @@ -83,7 +83,7 @@

    Const environment

    -
    environment: { bloxbergChainId: number; cicCacheUrl: string; cicMetaUrl: string; cicUssdUrl: string; logLevel: NgxLoggerLevel; loggingUrl: string; production: boolean; publicKeysUrl: string; registryAddress: string; serverLogLevel: NgxLoggerLevel; trustedDeclaratorAddress: string; web3Provider: string } = ...
    +
    environment: { bloxbergChainId: number; cicCacheUrl: string; cicMetaUrl: string; cicUssdUrl: string; dashboardUrl: string; logLevel: NgxLoggerLevel; loggingUrl: string; production: boolean; publicKeysUrl: string; registryAddress: string; serverLogLevel: NgxLoggerLevel; trustedDeclaratorAddress: string; web3Provider: string } = ...
    - +