diff --git a/docs/compodoc/classes/AccountIndex.html b/docs/compodoc/classes/AccountIndex.html index 9808103..f0cae83 100644 --- a/docs/compodoc/classes/AccountIndex.html +++ b/docs/compodoc/classes/AccountIndex.html @@ -8,7 +8,8 @@ - + +
@@ -42,7 +43,7 @@src/app/_eth/accountIndex.ts
+
Provides an instance of the accounts registry contract. Allows querying of accounts that have been registered as valid accounts in the network.
+This is our interface to the accounts registry contract.
--
+ + + contract + + + | +|
-
-
-
- contract
-
-
+ Type : any
+
|
|
- Type : any
-
+ Defined in src/app/_eth/accountIndex.ts:22
|
|
- Defined in src/app/_eth/accountIndex.ts:22
- |
- |
- The instance of the account registry contract. +
+ |
- The instance of the account registry contract. |
+
+ + + contractAddress + + + | +|
-
-
-
- contractAddress
-
-
+ Type : string
+
|
|
- Type : string
-
+ Defined in src/app/_eth/accountIndex.ts:24
|
|
- Defined in src/app/_eth/accountIndex.ts:24
- |
- |
- The deployed account registry contract's address. +
+ |
- The deployed account registry contract's address. |
+
+ + + signerAddress + + + | +|
-
-
-
- signerAddress
-
-
+ Type : string
+
|
|
- Type : string
-
+ Defined in src/app/_eth/accountIndex.ts:26
|
|
- Defined in src/app/_eth/accountIndex.ts:26
- |
- |
- The account address of the account that deployed the account registry contract. +
+ |
- The account address of the account that deployed the account registry contract. |
+
Registers an account to the accounts registry. Requires availability of the signer address.
-Prints "true" for registration of '0xc0ffee254729296a45a3885639AC7E10F9d54979':
+console.log(await addToAccountRegistry('0xc0ffee254729296a45a3885639AC7E10F9d54979'));
Prints "true" for registration of '0xc0ffee254729296a45a3885639AC7E10F9d54979':</p>
-<p>```typescript</p>
-<ul>
-<li>console.log(await addToAccountRegistry('0xc0ffee254729296a45a3885639AC7E10F9d54979'));</li>
-<li>```</li>
-</ul>
+<pre><code class="language-typescript">console.log(await addToAccountRegistry('0xc0ffee254729296a45a3885639AC7E10F9d54979'));
+</code></pre>
Checks whether a specific account address has been registered in the accounts registry. Returns "true" for available and "false" otherwise.
-Prints "true" or "false" depending on whether '0xc0ffee254729296a45a3885639AC7E10F9d54979' has been registered:
+console.log(await haveAccount('0xc0ffee254729296a45a3885639AC7E10F9d54979'));
Prints "true" or "false" depending on whether '0xc0ffee254729296a45a3885639AC7E10F9d54979' has been registered:</p>
-<p>```typescript</p>
-<ul>
-<li>console.log(await haveAccount('0xc0ffee254729296a45a3885639AC7E10F9d54979'));</li>
-<li>```</li>
-</ul>
+<pre><code class="language-typescript">console.log(await haveAccount('0xc0ffee254729296a45a3885639AC7E10F9d54979'));
+</code></pre>
Returns a specified number of the most recently registered accounts.
-Prints an array of accounts:
+console.log(await last(5));
Prints an array of accounts:</p>
-<p>```typescript</p>
-<ul>
-<li>console.log(await last(5));</li>
-<li>```</li>
-</ul>
+<pre><code class="language-typescript">console.log(await last(5));
+</code></pre>
Returns the total number of accounts that have been registered in the network.
-Prints the total number of registered accounts:
+console.log(await totalAccounts());
Prints the total number of registered accounts:</p>
-<p>```typescript</p>
-<ul>
-<li>console.log(await totalAccounts());</li>
-<li>```</li>
-</ul>
+<pre><code class="language-typescript">console.log(await totalAccounts());
+</code></pre>
setParamMap()
method to add the next paramMap
setParamMap()
method to add the next paramMap
+ + + Readonly + paramMap + + + | +|
-
-
-
- Readonly
- paramMap
-
-
+ Default value : this.subject.asObservable()
|
|
- Default value : this.subject.asObservable()
+ Defined in src/testing/activated-route-stub.ts:18
|
|
- Defined in src/testing/activated-route-stub.ts:18
- |
- |
- The mock paramMap observable +
+ |
- The mock paramMap observable |
+
+ + + Private + subject + + + | +
-
-
-
- Private
- subject
-
-
+ Default value : new ReplaySubject<ParamMap>()
|
- Default value : new ReplaySubject<ParamMap>()
+ Defined in src/testing/activated-route-stub.ts:11
|
- Defined in src/testing/activated-route-stub.ts:11
- |
-
setParamMap()
method to add the next paramMap
setParamMap()
method to add the next paramMap
Set the paramMap observables's next value
+Set the paramMap observables's next value
src/app/_helpers/custom-error-state-matcher.ts
+
src/app/_helpers/custom.validator.ts
+
src/app/_helpers/global-error-handler.ts
+
-
+ + + Public + status + + + | +|
-
-
-
- Public
- status
-
-
+ Type : number
+
|
|
- Type : number
-
+ Defined in src/app/_helpers/global-error-handler.ts:16
|
|
- Defined in src/app/_helpers/global-error-handler.ts:16
- |
- |
- The error's status code. +
+ |
- The error's status code. |
+
src/app/_pgp/pgp-key-store.ts
+
-
Provides a keyring for pgp keys.
+Provides a keyring for pgp keys.
@@ -94,86 +96,86 @@Remove all keys from the keyring.
+Remove all keys from the keyring.
Get all the encryption keys.
+Get all the encryption keys. +Current implementation doesn't include encryption keys. +This is included to appease the implemented Keystore interface.
src/app/_pgp/pgp-signer.ts
+
-
Provides functionality for signing and verifying signed messages.
+Provides functionality for signing and verifying signed messages.
@@ -93,28 +95,28 @@constructor(keyStore: MutableKeyStore)
+constructor(keyStore: MutableKeyStore)
+ + + algo + + + | +|
-
-
-
- algo
-
-
+ Type : string
+
+ |
+ |
+ Default value : 'sha256'
|
|
- Type : string
-
+ Defined in src/app/_pgp/pgp-signer.ts:60
|
|
- Default value : 'sha256'
- |
- |
- Defined in src/app/_pgp/pgp-signer.ts:60
- |
- |
- Encryption algorithm used +
+ |
- Encryption algorithm used |
+
+ + + dgst + + + | +|
-
-
-
- dgst
-
-
+ Type : string
+
|
|
- Type : string
-
+ Defined in src/app/_pgp/pgp-signer.ts:62
|
|
- Defined in src/app/_pgp/pgp-signer.ts:62
- |
- |
- Message digest +
+ |
- Message digest |
+
+ + + engine + + + | +|
-
-
-
- engine
-
-
+ Type : string
+
+ |
+ |
+ Default value : 'pgp'
|
|
- Type : string
-
+ Defined in src/app/_pgp/pgp-signer.ts:64
|
|
- Default value : 'pgp'
- |
- |
- Defined in src/app/_pgp/pgp-signer.ts:64
- |
- |
- Encryption engine used. +
+ |
- Encryption engine used. |
+
+ + + keyStore + + + | +|
-
-
-
- keyStore
-
-
+ Type : MutableKeyStore
+
|
|
- Type : MutableKeyStore
-
+ Defined in src/app/_pgp/pgp-signer.ts:66
|
|
- Defined in src/app/_pgp/pgp-signer.ts:66
- |
- |
- A keystore holding pgp keys. +
+ |
- A keystore holding pgp keys. |
+
+ + + loggingService + + + | +|
-
-
-
- loggingService
-
-
+ Type : LoggingService
+
|
|
- Type : LoggingService
-
+ Defined in src/app/_pgp/pgp-signer.ts:68
|
|
- Defined in src/app/_pgp/pgp-signer.ts:68
- |
- |
- A service that provides logging capabilities. +
+ |
- A service that provides logging capabilities. |
+
+ + + onsign + + + | +|
-
-
-
- onsign
-
-
+ Type : function
+
|
|
- Type : function
-
+ Defined in src/app/_pgp/pgp-signer.ts:70
|
|
- Defined in src/app/_pgp/pgp-signer.ts:70
- |
- |
- Event triggered on successful signing of message. +
+ |
- Event triggered on successful signing of message. |
+
+ + + onverify + + + | +|
-
-
-
- onverify
-
-
+ Type : function
+
|
|
- Type : function
-
+ Defined in src/app/_pgp/pgp-signer.ts:72
|
|
- Defined in src/app/_pgp/pgp-signer.ts:72
- |
- |
- Event triggered on successful verification of a signature. +
+ |
- Event triggered on successful verification of a signature. |
+
+ + + signature + + + | +|
-
-
-
- signature
-
-
+ Type : Signature
+
|
|
- Type : Signature
-
+ Defined in src/app/_pgp/pgp-signer.ts:74
|
|
- Defined in src/app/_pgp/pgp-signer.ts:74
- |
- |
- Generated signature +
+ |
- Generated signature |
+
prepare(material: Signable)
+ prepare(material: Signable)
verify(digest: string, signature: Signature)
+ verify(digest: string, signature: Signature)
src/app/_models/settings.ts
+
-
Settings class
+Settings class
@@ -87,16 +89,16 @@+ + + registry + + + | +|
-
-
-
- registry
-
-
+ Type : any
+
|
|
- Type : any
-
+ Defined in src/app/_models/settings.ts:4
|
|
- Defined in src/app/_models/settings.ts:4
- |
- |
- CIC Registry instance +
+ |
- CIC Registry instance |
+
+ + + scanFilter + + + | +|
-
-
-
- scanFilter
-
-
+ Type : any
+
|
|
- Type : any
-
+ Defined in src/app/_models/settings.ts:6
|
|
- Defined in src/app/_models/settings.ts:6
- |
- |
- A resource for searching through blocks on the blockchain network. +
+ |
- A resource for searching through blocks on the blockchain network. |
+
+ + + txHelper + + + | +|
-
-
-
- txHelper
-
-
+ Type : any
+
|
|
- Type : any
-
+ Defined in src/app/_models/settings.ts:8
|
|
- Defined in src/app/_models/settings.ts:8
- |
- |
- Transaction Helper instance +
+ |
- Transaction Helper instance |
+
+ + + w3 + + + | +||||
-
-
-
- w3
-
-
+ Type : W3
+
|
||||
- Type : W3
-
- |
- ||||
- Default value : {
+ |
Web3 Object
+src/app/_eth/token-registry.ts
+
Provides an instance of the token registry contract. Allows querying of tokens that have been registered as valid tokens in the network.
+This is our interface to the token registry contract.
--
+ + + contract + + + | +|
-
-
-
- contract
-
-
+ Type : any
+
|
|
- Type : any
-
+ Defined in src/app/_eth/token-registry.ts:22
|
|
- Defined in src/app/_eth/token-registry.ts:22
- |
- |
- The instance of the token registry contract. +
+ |
- The instance of the token registry contract. |
+
+ + + contractAddress + + + | +|
-
-
-
- contractAddress
-
-
+ Type : string
+
|
|
- Type : string
-
+ Defined in src/app/_eth/token-registry.ts:24
|
|
- Defined in src/app/_eth/token-registry.ts:24
- |
- |
- The deployed token registry contract's address. +
+ |
- The deployed token registry contract's address. |
+
+ + + signerAddress + + + | +|
-
-
-
- signerAddress
-
-
+ Type : string
+
|
|
- Type : string
-
+ Defined in src/app/_eth/token-registry.ts:26
|
|
- Defined in src/app/_eth/token-registry.ts:26
- |
- |
- The account address of the account that deployed the token registry contract. +
+ |
- The account address of the account that deployed the token registry contract. |
+
Returns the address of the token with a given identifier.
-Prints the address of the token with the identifier 'sarafu':
+console.log(await addressOf('sarafu'));
Prints the address of the token with the identifier 'sarafu':</p>
-<p>```typescript</p>
-<ul>
-<li>console.log(await addressOf('sarafu'));</li>
-<li>```</li>
-</ul>
+<pre><code class="language-typescript">console.log(await addressOf('sarafu'));
+</code></pre>
Returns the address of a token with the given serial in the token registry.
-Prints the address of the token with the serial '2':
+console.log(await entry(2));
Prints the address of the token with the serial '2':</p>
-<p>```typescript</p>
-<ul>
-<li>console.log(await entry(2));</li>
-<li>```</li>
-</ul>
+<pre><code class="language-typescript">console.log(await entry(2));
+</code></pre>
Returns the total number of tokens that have been registered in the network.
-Prints the total number of registered tokens:
+console.log(await totalTokens());
Prints the total number of registered tokens:</p>
-<p>```typescript</p>
-<ul>
-<li>console.log(await totalTokens());</li>
-<li>```</li>
-</ul>
+<pre><code class="language-typescript">console.log(await totalTokens());
+</code></pre>
@@ -108,9 +110,7 @@ | - - getBySymbol - + getBySymbol | @@ -224,9 +224,9 @@ - - - + + + diff --git a/docs/compodoc/classes/TransactionServiceStub.html b/docs/compodoc/classes/TransactionServiceStub.html index e3f4748..2e26372 100644 --- a/docs/compodoc/classes/TransactionServiceStub.html +++ b/docs/compodoc/classes/TransactionServiceStub.html @@ -8,7 +8,8 @@ - + + @@ -42,7 +43,7 @@
@@ -114,9 +116,7 @@ | - - getAllTransactions - + getAllTransactions | @@ -196,9 +196,7 @@- - setConversion - + setConversion | @@ -266,9 +264,7 @@- - setTransaction - + setTransaction | @@ -397,9 +393,9 @@ export class TransactionServiceStub { - - - + + + diff --git a/docs/compodoc/classes/UserServiceStub.html b/docs/compodoc/classes/UserServiceStub.html index 3dd2cbe..78335a6 100644 --- a/docs/compodoc/classes/UserServiceStub.html +++ b/docs/compodoc/classes/UserServiceStub.html @@ -8,7 +8,8 @@ - + + @@ -42,7 +43,7 @@
@@ -98,16 +100,16 @@ |
|
@@ -124,30 +126,29 @@
+ + + actions + + + | +||
-
-
-
- actions
-
-
+ Type : []
+
|
||
- Type : []
-
- |
- ||
- Default value : [
+ |
- - - - users - - |
- Type : []
-
+ Defined in src/testing/user-service-stub.ts:72
|
- Default value : [
+
+
+ |
+ + + users + + + | +
+ Type : []
+
+ |
+
+ Default value : [
{
id: 1,
name: 'John Doe',
@@ -259,17 +259,17 @@
gender: 'male',
},
]
+ |
+
+ Defined in src/testing/user-service-stub.ts:4
|
- Defined in src/testing/user-service-stub.ts:4
- |
-
constructor(formBuilder: FormBuilder, locationService: LocationService, transactionService: TransactionService, userService: UserService, route: ActivatedRoute, router: Router, tokenService: TokenService, loggingService: LoggingService, blockSyncService: BlockSyncService, cdr: ChangeDetectorRef, snackBar: MatSnackBar)
+constructor(formBuilder: FormBuilder, locationService: LocationService, transactionService: TransactionService, userService: UserService, route: ActivatedRoute, router: Router, tokenService: TokenService, loggingService: LoggingService, blockSyncService: BlockSyncService, cdr: ChangeDetectorRef, snackBar: MatSnackBar)
+ + + buildAccountsInfoForm + + + | +
+buildAccountsInfoForm()
+ |
+
+ + | +
+
+
+ Returns :
+ void
+
+ |
+
- - copyAddress - + copyAddress | @@ -508,8 +609,8 @@
- + | - - doTransactionFilter - + doTransactionFilter | @@ -547,8 +646,8 @@
- + | - - doUserFilter - + doUserFilter | @@ -617,8 +714,8 @@
- + | - - downloadCsv - + downloadCsv | @@ -687,8 +782,8 @@
- + | - - filterAccounts - + filterAccounts | @@ -769,8 +862,8 @@
- + | - - filterTransactions - + filterTransactions | @@ -808,8 +899,189 @@
- + + | +
+
+
+ Returns :
+ void
+
+ |
+
+ + + getKeyValue + + + | +||||||
+getKeyValue(obj: any)
+ |
+ ||||||
+ + | +||||||
+
+
+ Parameters :
+
+
+
+
+ Returns :
+ string
+
+
+
+
+ |
+
+ + + Async + loadAccount + + + | +
+
+ loadAccount()
+ |
+
+ + | +
+
+
+ Returns :
+ Promise<void>
+
+ |
+
+ + + loadSearchData + + + | +
+loadSearchData()
+ |
+
+ + | +
+
+
+ Returns :
+ void
+
+ |
+
+ + + ngAfterViewInit + + + | +
+ngAfterViewInit()
+ |
+
+ | - - Async - ngOnInit - + Async + ngOnInit | @@ -849,8 +1119,8 @@
- + |
+ + + populateAccountsInfoForm + + + | +||||||
+populateAccountsInfoForm(accountInfo: AccountDetails)
+ |
+ ||||||
+ + | +||||||
+
+
+ Parameters :
+
+
+
+
+ Returns :
+ void
+
+
+
+
+ |
+
+ + + populateDataTables + + + | +
+populateDataTables()
+ |
+
+ + | +
+
+
+ Returns :
+ void
+
+ |
+
+ + + queryLocationAndCategory + + + | +||||||
+queryLocationAndCategory(accountInfo: AccountDetails)
+ |
+ ||||||
+ + | +||||||
+
+
+ Parameters :
+
+
+
+
+ Returns :
+ void
+
+
+
+
+ |
+
+ + + viewHistory + + + | +||||
+viewHistory(history)
+ |
+ ||||
+ + | +||||
+
+
+ Parameters :
+
+
+
+
+ Returns :
+ void
+
+
+
+
+ |
+
- - viewTransaction - + viewTransaction | @@ -1034,8 +1533,8 @@||||||
- + |
+ + + account + + + | +
-
-
-
- account
-
-
+ Type : AccountDetails
+
|
- Type : AccountDetails
-
+
|
- - | -
+ + + accountAddress + + + | +
-
-
-
- accountAddress
-
-
+ Type : string
+
|
- Type : string
-
+
|
- - | -
+ + + accountInfoForm + + + | +
-
-
-
- accountInfoForm
-
-
+ Type : FormGroup
+
|
- Type : FormGroup
-
+
|
- - | -
+ + + accounts + + + | +
-
-
-
- accounts
-
-
+ Type : Array<AccountDetails>
+
+ |
+
+ Default value : []
|
- Type : Array<AccountDetails>
-
+
|
- Default value : []
- |
-
- - | -
+ + + accountsLoading + + + | +
-
-
-
- accountStatus
-
-
+ Type : boolean
+
+ |
+
+ Default value : true
|
- Type : any
-
+
|
- - | -
+ + + accountStatus + + + | +
-
-
-
- accountsType
-
-
+ Type : any
+
|
- Type : string
-
+
|
- Default value : 'all'
- |
-
- - | -
+ + + accountsType + + + | +
-
-
-
- accountTypes
-
-
+ Type : string
+
+ |
+
+ Default value : 'all'
|
- Type : Array<string>
-
+
|
- - | -
+ + + accountTypes + + + | +
-
-
-
- area
-
-
+ Type : Array<string>
+
|
- Type : string
-
+
|
- - | -
+ + + area + + + | +
-
-
-
- areaNames
-
-
+ Type : string
+
|
- Type : Array<string>
-
+
|
- - | -
+ + + areaNames + + + | +
-
-
-
- areaType
-
-
+ Type : Array<string>
+
|
- Type : string
-
+
|
- - | -
+ + + areaType + + + | +
-
-
-
- areaTypes
-
-
+ Type : string
+
|
- Type : Array<string>
-
+
|
- - | -
+ + + areaTypes + + + | +
-
-
-
- bloxbergLink
-
-
+ Type : Array<string>
+
|
- Type : string
-
+
|
- - | -
+ + + bloxbergLink + + + | +
-
-
-
- categories
-
-
+ Type : string
+
|
- Type : Array<string>
-
+
|
- - | -
+ + + categories + + + | +
-
-
-
- category
-
-
+ Type : Array<string>
+
|
- Type : string
-
+
|
- - | -
+ + + category + + + | +
-
-
-
- genders
-
-
+ Type : string
+
|
- Type : Array<string>
-
+
|
- - | -
+ + + genders + + + | +
-
-
-
- matcher
-
-
+ Type : Array<string>
+
|
- Type : CustomErrorStateMatcher
-
+
|
- Default value : new CustomErrorStateMatcher()
- |
-
- - | -
+ + + histories + + + | +
-
-
-
- submitted
-
-
+ Type : Array<any>
+
+ |
+
+ Default value : []
|
- Type : boolean
-
+
|
- Default value : false
- |
-
- - | -
+ + + history + + + | +
-
-
-
- tokenSymbol
-
-
+ Type : any
+
|
- Type : string
-
+
|
- - | -
+ + + historyDataSource + + + | +
-
-
-
- transaction
-
-
+ Type : MatTableDataSource<any>
+
|
- Type : any
-
+
|
- - | -
+ + + historyDefaultPageSize + + + | +
-
-
-
- transactions
-
-
+ Type : number
+
+ |
+
+ Default value : 5
|
- Type : Array<Transaction>
-
+
|
- - | -
+ + + historyLoading + + + | +
-
-
-
- transactionsDefaultPageSize
-
-
+ Type : boolean
+
+ |
+
+ Default value : true
|
- Type : number
-
+
|
- Default value : 10
- |
-
- - | -
+ + + historyTableSort + + + | +
-
-
-
- transactionsType
-
-
+ Type : MatSort
+
+ |
+
+ Decorators :
+ +
+ @ViewChild('HistoryTableSort', {static: true})
|
- Type : string
-
+
|
- Default value : 'all'
- |
-
- - | -
+ + + matcher + + + | +
-
-
-
- transactionsTypes
-
-
+ Type : CustomErrorStateMatcher
+
+ |
+
+ Default value : new CustomErrorStateMatcher()
|
- Type : Array<string>
-
+
|
- - | -
+ + + submitted + + + | +
-
-
-
- transactionTablePaginator
-
-
+ Type : boolean
+
+ |
+
+ Default value : false
|
- Type : MatPaginator
-
+
|
- Decorators :
- -
- @ViewChild('TransactionTablePaginator', {static: true})
- |
-
- - | -
+ + + tokenSymbol + + + | +
-
-
-
- transactionTableSort
-
-
+ Type : string
+
|
- Type : MatSort
-
+
|
- Decorators :
- -
- @ViewChild('TransactionTableSort', {static: true})
- |
-
- - | -
+ + + transaction + + + | +
-
-
-
- userDataSource
-
-
+ Type : any
+
|
- Type : MatTableDataSource<any>
-
+
|
- - | -
+ + + transactions + + + | +
-
-
-
- userDisplayedColumns
-
-
+ Type : Array<Transaction>
+
|
- Type : Array<string>
-
+
|
- Default value : ['name', 'phone', 'created', 'balance', 'location']
- |
-
- - | -
+ + + transactionsDataSource + + + | +
-
-
-
- usersDefaultPageSize
-
-
+ Type : MatTableDataSource<any>
+
|
- Type : number
-
+
|
- Default value : 10
- |
-
- - | -
+ + + transactionsDefaultPageSize + + + | +
-
-
-
- usersPageSizeOptions
-
-
+ Type : number
+
+ |
+
+ Default value : 10
|
- Type : Array<number>
-
+
|
- Default value : [10, 20, 50, 100]
- |
-
- - | -
+ + + transactionsLoading + + + | +
-
-
-
- userTableSort
-
-
+ Type : boolean
+
+ |
+
+ Default value : true
|
- Type : MatSort
-
+
|
+ + + transactionsType + + + | +
+ Type : string
+
+ |
+
+ Default value : 'all'
+ |
+
+ + | +
+ + + transactionsTypes + + + | +
+ Type : Array<string>
+
+ |
+
+ + | +
+ + + transactionTablePaginator + + + | +
+ Type : MatPaginator
+
+ |
+
+ Decorators :
+ +
+ @ViewChild('TransactionTablePaginator', {static: true})
+ |
+
+ + | +
+ + + transactionTableSort + + + | +
+ Type : MatSort
+
+ |
+
+ Decorators :
+ +
+ @ViewChild('TransactionTableSort', {static: true})
+ |
+
+ + | +
+ + + userDataSource + + + | +
+ Type : MatTableDataSource<any>
+
+ |
+
+ + | +
+ + + userDisplayedColumns + + + | +
+ Type : Array<string>
+
+ |
+
+ Default value : ['name', 'phone', 'created', 'balance', 'location']
+ |
+
+ + | +
+ + + usersDefaultPageSize + + + | +
+ Type : number
+
+ |
+
+ Default value : 10
+ |
+
+ + | +
+ + + usersPageSizeOptions + + + | +
+ Type : Array<number>
+
+ |
+
+ Default value : [10, 20, 50, 100]
+ |
+
+ + | +
+ + + userTablePaginator + + + | +
+ Type : MatPaginator
+
+ |
+
+ Decorators :
+ +
+ @ViewChild('UserTablePaginator', {static: true})
+ |
+
+ + | +
+ + + userTableSort + + + | +
+ Type : MatSort
+
+ |
+
+ Decorators :
+ +
+ @ViewChild('UserTableSort', {static: true})
+ |
+
+ + | +
import {
+ AfterViewInit,
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
@@ -2159,7 +2971,7 @@ import { AccountDetails, Transaction } from '@app/_models';
styleUrls: ['./account-details.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
-export class AccountDetailsComponent implements OnInit {
+export class AccountDetailsComponent implements OnInit, AfterViewInit {
transactionsDataSource: MatTableDataSource<any>;
transactionsDisplayedColumns: Array<string> = ['sender', 'recipient', 'value', 'created', 'type'];
transactionsDefaultPageSize: number = 10;
@@ -2174,6 +2986,20 @@ export class AccountDetailsComponent implements OnInit {
@ViewChild('UserTablePaginator', { static: true }) userTablePaginator: MatPaginator;
@ViewChild('UserTableSort', { static: true }) userTableSort: MatSort;
+ historyDataSource: MatTableDataSource<any>;
+ historyDisplayedColumns: Array<string> = [
+ 'actor',
+ 'signer',
+ 'message',
+ 'sequence',
+ 'dependencies',
+ 'timestamp',
+ ];
+ historyDefaultPageSize: number = 5;
+ historyPageSizeOptions: Array<number> = [5, 10, 20, 50, 100];
+ @ViewChild('HistoryTablePaginator', { static: true }) historyTablePaginator: MatPaginator;
+ @ViewChild('HistoryTableSort', { static: true }) historyTableSort: MatSort;
+
accountInfoForm: FormGroup;
account: AccountDetails;
accountAddress: string;
@@ -2196,6 +3022,11 @@ export class AccountDetailsComponent implements OnInit {
category: string;
area: string;
areaType: string;
+ accountsLoading: boolean = true;
+ transactionsLoading: boolean = true;
+ histories: Array<any> = [];
+ history: any;
+ historyLoading: boolean = true;
constructor(
private formBuilder: FormBuilder,
@@ -2218,108 +3049,13 @@ export class AccountDetailsComponent implements OnInit {
}
async ngOnInit(): Promise<void> {
- this.accountInfoForm = this.formBuilder.group({
- firstName: ['', Validators.required],
- lastName: ['', Validators.required],
- phoneNumber: ['', Validators.required],
- age: [''],
- type: ['', Validators.required],
- bio: ['', Validators.required],
- gender: ['', Validators.required],
- businessCategory: ['', Validators.required],
- userLocation: ['', Validators.required],
- location: ['', Validators.required],
- locationType: ['', Validators.required],
- });
- await this.blockSyncService.init();
- await this.tokenService.init();
- await this.transactionService.init();
- await this.userService.init();
+ this.buildAccountsInfoForm();
+ this.transactionService.resetTransactionsList();
await this.blockSyncService.blockSync(this.accountAddress);
this.userService.resetAccountsList();
- (await this.userService.getAccountByAddress(this.accountAddress, 100)).subscribe(
- async (res) => {
- if (res !== undefined) {
- 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],
- lastName: fullName.slice(1).join(' '),
- phoneNumber: this.account.vcard?.tel[0].value,
- age: this.account.age,
- type: this.account.type,
- bio: this.account.products,
- gender: this.account.gender,
- businessCategory: this.account.category || this.category || 'other',
- userLocation: this.account.location.area_name,
- 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)
- .pipe(first())
- .subscribe((response) => (this.accountStatus = response.status));
- } else {
- alert('Account not found!');
- }
- }
- );
- this.userService.accountsSubject.subscribe((accounts) => {
- this.userDataSource = new MatTableDataSource<any>(accounts);
- this.userDataSource.paginator = this.userTablePaginator;
- this.userDataSource.sort = this.userTableSort;
- this.accounts = accounts;
- this.cdr.detectChanges();
- });
-
- this.transactionService.transactionsSubject.subscribe((transactions) => {
- this.transactionsDataSource = new MatTableDataSource<any>(transactions);
- this.transactionsDataSource.paginator = this.transactionTablePaginator;
- this.transactionsDataSource.sort = this.transactionTableSort;
- this.transactions = transactions;
- this.cdr.detectChanges();
- });
- 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())
- .subscribe((res) => (this.accountTypes = res));
- this.userService
- .getTransactionTypes()
- .pipe(first())
- .subscribe((res) => (this.transactionsTypes = res));
- this.userService
- .getGenders()
- .pipe(first())
- .subscribe((res) => (this.genders = res));
+ await this.loadAccount();
+ this.populateDataTables();
+ this.loadSearchData();
this.tokenService.load.subscribe(async (status: boolean) => {
if (status) {
this.tokenSymbol = await this.tokenService.getTokenSymbol();
@@ -2327,6 +3063,21 @@ export class AccountDetailsComponent implements OnInit {
});
}
+ ngAfterViewInit(): void {
+ if (this.userDataSource) {
+ this.userDataSource.paginator = this.userTablePaginator;
+ this.userDataSource.sort = this.userTableSort;
+ }
+ if (this.transactionsDataSource) {
+ this.transactionsDataSource.paginator = this.transactionTablePaginator;
+ this.transactionsDataSource.sort = this.transactionTableSort;
+ }
+ if (this.historyDataSource) {
+ this.historyDataSource.paginator = this.historyTablePaginator;
+ this.historyDataSource.sort = this.historyTableSort;
+ }
+ }
+
doTransactionFilter(value: string): void {
this.transactionsDataSource.filter = value.trim().toLocaleLowerCase();
}
@@ -2339,6 +3090,10 @@ export class AccountDetailsComponent implements OnInit {
this.transaction = transaction;
}
+ viewHistory(history): void {
+ this.history = history;
+ }
+
viewAccount(account): void {
this.router.navigateByUrl(
`/accounts/${strip0x(account.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0])}`
@@ -2354,7 +3109,7 @@ export class AccountDetailsComponent implements OnInit {
if (this.accountInfoForm.invalid || !confirm(`Change user's profile information?`)) {
return;
}
- const accountKey = await this.userService.changeAccountInfo(
+ const status = await this.userService.changeAccountInfo(
this.accountAddress,
this.accountInfoFormStub.firstName.value + ', ' + this.accountInfoFormStub.lastName.value,
this.accountInfoFormStub.phoneNumber.value,
@@ -2365,8 +3120,12 @@ export class AccountDetailsComponent implements OnInit {
this.accountInfoFormStub.businessCategory.value,
this.accountInfoFormStub.userLocation.value,
this.accountInfoFormStub.location.value,
- this.accountInfoFormStub.locationType.value
+ this.accountInfoFormStub.locationType.value,
+ this.account.vcard?.tel[0].value
);
+ if (status) {
+ await this.loadAccount();
+ }
this.submitted = false;
}
@@ -2419,6 +3178,148 @@ export class AccountDetailsComponent implements OnInit {
});
}
}
+
+ getKeyValue(obj: any): string {
+ let str = '';
+ if (obj instanceof Object) {
+ for (const [key, value] of Object.entries(obj)) {
+ str += `${key}: ${value} `;
+ }
+ }
+ return str;
+ }
+
+ buildAccountsInfoForm(): void {
+ this.accountInfoForm = this.formBuilder.group({
+ firstName: ['', Validators.required],
+ lastName: ['', Validators.required],
+ phoneNumber: ['', Validators.required],
+ age: [''],
+ type: ['', Validators.required],
+ bio: ['', Validators.required],
+ gender: ['', Validators.required],
+ businessCategory: ['', Validators.required],
+ userLocation: ['', Validators.required],
+ location: ['', Validators.required],
+ locationType: ['', Validators.required],
+ });
+ }
+
+ populateAccountsInfoForm(accountInfo: AccountDetails): void {
+ const fullName = accountInfo.vcard?.fn[0].value.split(' ');
+ this.accountInfoForm.patchValue({
+ firstName: fullName[0].split(',')[0],
+ lastName: fullName.slice(1).join(' '),
+ phoneNumber: accountInfo.vcard?.tel[0].value,
+ age: accountInfo.age,
+ type: accountInfo.type,
+ bio: accountInfo.products,
+ gender: accountInfo.gender,
+ businessCategory: accountInfo.category || this.category || 'other',
+ userLocation: accountInfo.location.area_name,
+ location: accountInfo.location.area || this.area || 'other',
+ locationType: accountInfo.location.area_type || this.areaType || 'other',
+ });
+ }
+
+ populateDataTables(): void {
+ this.userService.accountsSubject.subscribe((accounts) => {
+ this.userDataSource = new MatTableDataSource<any>(accounts);
+ this.userDataSource.paginator = this.userTablePaginator;
+ this.userDataSource.sort = this.userTableSort;
+ this.accounts = accounts;
+ if (accounts.length > 0) {
+ this.accountsLoading = false;
+ }
+ this.cdr.detectChanges();
+ });
+
+ this.transactionService.transactionsSubject.subscribe((transactions) => {
+ this.transactionsDataSource = new MatTableDataSource<any>(transactions);
+ this.transactionsDataSource.paginator = this.transactionTablePaginator;
+ this.transactionsDataSource.sort = this.transactionTableSort;
+ this.transactions = transactions;
+ if (transactions.length > 0) {
+ this.transactionsLoading = false;
+ }
+ this.cdr.detectChanges();
+ });
+
+ this.userService.historySubject.subscribe(async (histories) => {
+ this.historyDataSource = new MatTableDataSource<any>(histories);
+ this.historyDataSource.paginator = this.historyTablePaginator;
+ this.historyDataSource.sort = this.historyTableSort;
+ this.histories = histories;
+ if (histories.length > 0) {
+ this.historyLoading = false;
+ }
+ this.cdr.detectChanges();
+ });
+ }
+
+ queryLocationAndCategory(accountInfo: AccountDetails): void {
+ this.locationService.areaNamesSubject.subscribe((response) => {
+ this.area = this.locationService.getAreaNameByLocation(
+ accountInfo.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(accountInfo.products[0], result);
+ this.cdr.detectChanges();
+ });
+ }
+
+ loadSearchData(): void {
+ 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())
+ .subscribe((res) => (this.accountTypes = res));
+ this.userService
+ .getTransactionTypes()
+ .pipe(first())
+ .subscribe((res) => (this.transactionsTypes = res));
+ this.userService
+ .getGenders()
+ .pipe(first())
+ .subscribe((res) => (this.genders = res));
+ }
+
+ async loadAccount(): Promise<void> {
+ (await this.userService.getAccountByAddress(this.accountAddress, 100, true)).subscribe(
+ async (res) => {
+ if (res !== undefined) {
+ this.account = res;
+ this.cdr.detectChanges();
+ this.queryLocationAndCategory(this.account);
+ this.populateAccountsInfoForm(this.account);
+ this.userService
+ .getAccountStatus(this.account.vcard?.tel[0].value)
+ .pipe(first())
+ .subscribe((response) => (this.accountStatus = response.status));
+ } else {
+ alert('Account not found!');
+ }
+ }
+ );
+ }
}
+
+ src/app/pages/accounts/account-history/account-history.component.ts
+
+
changeDetection | +ChangeDetectionStrategy.OnPush |
+
selector | +app-account-history |
+
styleUrls | +./account-history.component.scss |
+
templateUrl | +./account-history.component.html |
+
+ Methods+ |
+
+
|
+
+ Inputs+ |
+
+
|
+
+ Outputs+ |
+
+
|
+
+constructor()
+ |
+
+ + | +
+ + account + | +|
+ Type : any
+
+ |
+ |
+ + | +
+ + closeWindow + | +|
+ Type : EventEmitter<any>
+
+ |
+ |
+ + | +
+ + + close + + + | +
+close()
+ |
+
+ + | +
+
+
+ Returns :
+ void
+
+ |
+
+ + + ngOnChanges + + + | +||||||
+ngOnChanges(changes: SimpleChanges)
+ |
+ ||||||
+ + | +||||||
+
+
+ Parameters :
+
+
+
+
+ Returns :
+ void
+
+
+
+
+ |
+
+ + + ngOnInit + + + | +
+ngOnInit()
+ |
+
+ + | +
+
+
+ Returns :
+ void
+
+ |
+
import {
+ Component,
+ OnInit,
+ ChangeDetectionStrategy,
+ Input,
+ Output,
+ EventEmitter,
+ SimpleChanges,
+ OnChanges,
+} from '@angular/core';
+const vCard = require('vcard-parser');
+
+@Component({
+ selector: 'app-account-history',
+ templateUrl: './account-history.component.html',
+ styleUrls: ['./account-history.component.scss'],
+ changeDetection: ChangeDetectionStrategy.OnPush,
+})
+export class AccountHistoryComponent implements OnInit, OnChanges {
+ @Input() account;
+
+ @Output() closeWindow: EventEmitter<any> = new EventEmitter<any>();
+
+ constructor() {}
+
+ ngOnInit(): void {}
+
+ ngOnChanges(changes: SimpleChanges): void {
+ if (this.account) {
+ this.account.vcard = vCard.parse(atob(this.account.vcard));
+ }
+ }
+
+ close(): void {
+ this.account = null;
+ this.closeWindow.emit(this.account);
+ }
+}
+
+ <div *ngIf="account" class="mb-3 mt-1">
+ <div class="card text-center">
+ <mat-card-title class="card-header">
+ <div class="row">
+ ACCOUNT DETAILS
+ <button
+ mat-raised-button
+ type="button"
+ class="btn btn-outline-secondary ml-auto mr-2"
+ (click)="close()"
+ >
+ CLOSE
+ </button>
+ </div>
+ </mat-card-title>
+ <div class="card-body">
+ <div class="row">
+ <div class="col-md-6">
+ <ul class="list-group list-group-flush">
+ <li class="list-group-item">
+ <span>Name: {{ account?.vcard?.fn[0].value }}</span>
+ </li>
+ <li class="list-group-item">
+ <span>Phone Number: {{ account?.vcard?.tel[0].value }}</span>
+ </li>
+ <li class="list-group-item">
+ <span>Account Type: {{ account?.type }}</span>
+ </li>
+ <li class="list-group-item">
+ <span>Gender: {{ account?.gender }}</span>
+ </li>
+ <li class="list-group-item">
+ <span>Age: {{ account?.age }}</span>
+ </li>
+ </ul>
+ </div>
+ <div class="col-md-6">
+ <ul class="list-group list-group-flush">
+ <li class="list-group-item">
+ <span>Bio: {{ account?.products }}</span>
+ </li>
+ <li class="list-group-item">
+ <span>Business Category: {{ account?.category }}</span>
+ </li>
+ <li class="list-group-item">
+ <span>User Location: {{ account?.location?.area_name }}</span>
+ </li>
+ <li class="list-group-item">
+ <span>Location: {{ account?.location?.area }}</span>
+ </li>
+ <li class="list-group-item">
+ <span>Location Type: {{ account?.location?.area_type }}</span>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+
+ ./account-history.component.scss
+
+
constructor(formBuilder: FormBuilder, userService: UserService, router: Router)
+constructor(formBuilder: FormBuilder, userService: UserService, router: Router)
ngOnInit()
+ngOnInit()
Promise<void>
-
- - - - - Async - onAddressSearch - - - - | -
-
- onAddressSearch()
- |
-
- - | -
-
-
- Returns :
- Promise<void>
-
- |
-
- - - - onNameSearch - - - - | -
-onNameSearch()
- |
-
- + |
+ + + Async + onAddressSearch + + + | +
+
+ onAddressSearch()
+ |
+
+ + | +
+
+
+ Returns :
+ Promise<void>
+
+ |
+
- - Async - onPhoneSearch - + Async + onPhoneSearch | @@ -449,8 +390,8 @@||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- + |
+ + + addressSearchForm + + + | +
-
-
-
- addressSearchForm
-
-
+ Type : FormGroup
+
|
- Type : FormGroup
-
+
|
- - | -
+ + + addressSearchLoading + + + | +
-
-
-
- addressSearchLoading
-
-
+ Type : boolean
+
+ |
+
+ Default value : false
|
- Type : boolean
-
+
|
- Default value : false
- |
-
- - | -
+ + + addressSearchSubmitted + + + | +
-
-
-
- addressSearchSubmitted
-
-
+ Type : boolean
+
+ |
+
+ Default value : false
|
- Type : boolean
-
+
|
- Default value : false
- |
-
- - | -
+ + + matcher + + + | +
-
-
-
- matcher
-
-
+ Type : CustomErrorStateMatcher
+
+ |
+
+ Default value : new CustomErrorStateMatcher()
|
- Type : CustomErrorStateMatcher
-
+
|
- Default value : new CustomErrorStateMatcher()
- |
-
- - | -
+ + + phoneSearchForm + + + | +
-
-
-
- nameSearchForm
-
-
+ Type : FormGroup
+
|
- Type : FormGroup
-
+
|
- - | -
+ + + phoneSearchLoading + + + | +
-
-
-
- nameSearchLoading
-
-
+ Type : boolean
+
+ |
+
+ Default value : false
|
- Type : boolean
-
+
|
- Default value : false
- |
-
- - | -
+ + + phoneSearchSubmitted + + + | +
-
-
-
- nameSearchSubmitted
-
-
+ Type : boolean
+
+ |
+
+ Default value : false
|
- Type : boolean
-
+
|
- Default value : false
- |
-
- - | -
- - - - phoneSearchForm - - - | -
- Type : FormGroup
-
- |
-
- - | -
- - - - phoneSearchLoading - - - | -
- Type : boolean
-
- |
-
- Default value : false
- |
-
- - | -
- - - - phoneSearchSubmitted - - - | -
- Type : boolean
-
- |
-
- Default value : false
- |
-
- - | -
- - nameSearchFormStub - | -
- getnameSearchFormStub()
- |
-
- - | -
- + | ||||
- + |
|
@@ -176,24 +184,27 @@
|
@@ -213,12 +224,12 @@
||
-constructor(userService: UserService, loggingService: LoggingService, router: Router, tokenService: TokenService)
+constructor(loggingService: LoggingService, userService: UserService, router: Router, tokenService: TokenService)
|
||||
- + | ||||
userService | +loggingService |
- UserService
+ LoggingService
|
@@ -248,10 +259,10 @@ | |
loggingService | +userService |
- LoggingService
+ UserService
|
@@ -307,9 +318,7 @@ | - - doFilter - + doFilter | @@ -323,8 +332,8 @@
- + | - - downloadCsv - + downloadCsv | @@ -393,8 +400,8 @@|||
- + | - - filterAccounts - + filterAccounts | @@ -432,8 +437,45 @@|||
- + + | +||||
+
+
+ Returns :
+ void
+
+ |
+
+ + + ngAfterViewInit + + + | +|||
+ngAfterViewInit()
+ |
+ |||
+ | - - Async - ngOnInit - + Async + ngOnInit | @@ -473,8 +513,8 @@||
- + | - - refreshPaginator - + refreshPaginator | @@ -512,8 +550,8 @@||
- + | - - Async - viewAccount - + Async + viewAccount | @@ -553,8 +589,8 @@||
- + |
+ + + accounts + + + | +
-
-
-
- accounts
-
-
+ Type : Array<AccountDetails>
+
+ |
+
+ Default value : []
|
- Type : Array<AccountDetails>
-
+
|
- Default value : []
- |
-
- - | -
+ + + accountsType + + + | +
-
-
-
- accountsType
-
-
+ Type : string
+
+ |
+
+ Default value : 'all'
|
- Type : string
-
+
|
- Default value : 'all'
- |
-
- - | -
+ + + accountTypes + + + | +
-
-
-
- accountTypes
-
-
+ Type : Array<string>
+
|
- Type : Array<string>
-
+
|
- - | -
+ + + dataSource + + + | +
-
-
-
- dataSource
-
-
+ Type : MatTableDataSource<any>
+
|
- Type : MatTableDataSource<any>
-
+
|
- - | -
+ + + defaultPageSize + + + | +
-
-
-
- defaultPageSize
-
-
+ Type : number
+
+ |
+
+ Default value : 10
|
- Type : number
-
+
|
- Default value : 10
- |
-
- - | -
+ + + loading + + + | +
-
-
-
- pageSizeOptions
-
-
+ Type : boolean
+
+ |
+
+ Default value : true
|
- Type : Array<number>
-
+
|
- Default value : [10, 20, 50, 100]
- |
-
- - | -
+ + + sort + + + | +
-
-
-
- tokenSymbol
-
-
+ Type : MatSort
+
+ |
+
+ Decorators :
+ +
+ @ViewChild(MatSort)
|
- Type : string
-
+
|
- - | -
+ + + tokenSymbol + + + | +
+ Type : string
+
+ |
+
+ + | +
import { ChangeDetectionStrategy, Component, OnInit, ViewChild } from '@angular/core';
+ import {
+ AfterViewInit,
+ ChangeDetectionStrategy,
+ Component,
+ OnInit,
+ ViewChild,
+} from '@angular/core';
import { MatTableDataSource } from '@angular/material/table';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
@@ -940,7 +1003,7 @@ import { AccountDetails } from '@app/_models';
styleUrls: ['./accounts.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
-export class AccountsComponent implements OnInit {
+export class AccountsComponent implements OnInit, AfterViewInit {
dataSource: MatTableDataSource<any>;
accounts: Array<AccountDetails> = [];
displayedColumns: Array<string> = ['name', 'phone', 'created', 'balance', 'location'];
@@ -949,32 +1012,33 @@ export class AccountsComponent implements OnInit {
accountsType: string = 'all';
accountTypes: Array<string>;
tokenSymbol: string;
+ loading: boolean = true;
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
constructor(
- private userService: UserService,
private loggingService: LoggingService,
+ private userService: UserService,
private router: Router,
private tokenService: TokenService
) {}
async ngOnInit(): Promise<void> {
- await this.userService.init();
- await this.tokenService.init();
- try {
- // TODO it feels like this should be in the onInit handler
- await this.userService.loadAccounts(100);
- } catch (error) {
- this.loggingService.sendErrorLevelMessage('Failed to load accounts', this, { error });
- }
this.userService.accountsSubject.subscribe((accounts) => {
this.dataSource = new MatTableDataSource<any>(accounts);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
this.accounts = accounts;
+ if (accounts.length > 0) {
+ this.loading = false;
+ }
});
+ try {
+ await this.userService.loadAccounts(100);
+ } catch (error) {
+ this.loggingService.sendErrorLevelMessage('Failed to load accounts', this, { error });
+ }
this.userService
.getAccountTypes()
.pipe(first())
@@ -986,6 +1050,13 @@ export class AccountsComponent implements OnInit {
});
}
+ ngAfterViewInit(): void {
+ if (this.dataSource) {
+ this.dataSource.paginator = this.paginator;
+ this.dataSource.sort = this.sort;
+ }
+ }
+
doFilter(value: string): void {
this.dataSource.filter = value.trim().toLocaleLowerCase();
}
@@ -1089,6 +1160,11 @@ export class AccountsComponent implements OnInit {
<mat-icon matSuffix>search</mat-icon>
</mat-form-field>
+ <div *ngIf="loading">
+ <h2 class="text-center"><strong>Loading Accounts!</strong></h2>
+ <mat-progress-bar [mode]="'query'"></mat-progress-bar>
+ </div>
+
<mat-table
class="mat-elevation-z10"
[dataSource]="dataSource"
@@ -1181,8 +1257,8 @@ export class AccountsComponent implements OnInit {
@@ -1225,9 +1301,9 @@ export class AccountsComponent implements OnInit {
-
-
-
+
+
+
diff --git a/docs/compodoc/components/AdminComponent.html b/docs/compodoc/components/AdminComponent.html
index c25efbb..4167b2d 100644
--- a/docs/compodoc/components/AdminComponent.html
+++ b/docs/compodoc/components/AdminComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
- Components
- - AdminComponent
+ -
+ AdminComponent
@@ -66,6 +69,7 @@
+
Implements
@@ -134,22 +138,25 @@
-
- action
+ action
-
- actions
+ actions
-
- dataSource
+ dataSource
-
- displayedColumns
+ displayedColumns
-
- paginator
+ loading
-
- sort
+ paginator
+
+ -
+ sort
@@ -164,26 +171,25 @@
-
- approvalStatus
+ approvalStatus
-
- approveAction
+ approveAction
-
- disapproveAction
+ disapproveAction
-
- doFilter
+ doFilter
-
- downloadCsv
+ downloadCsv
-
- expandCollapse
+ expandCollapse
-
- Async
- ngOnInit
+ ngOnInit
@@ -203,12 +209,12 @@
-constructor(userService: UserService, loggingService: LoggingService)
+constructor(userService: UserService, loggingService: LoggingService)
- Defined in src/app/pages/admin/admin.component.ts:31
+ Defined in src/app/pages/admin/admin.component.ts:32
@@ -273,9 +279,7 @@
-
- approvalStatus
-
+ approvalStatus
@@ -289,8 +293,8 @@
- Defined in src/app/pages/admin/admin.component.ts:50
+ Defined in src/app/pages/admin/admin.component.ts:53
@@ -343,9 +347,7 @@
-
- approveAction
-
+ approveAction
@@ -359,8 +361,8 @@
- Defined in src/app/pages/admin/admin.component.ts:54
+ Defined in src/app/pages/admin/admin.component.ts:57
@@ -413,9 +415,7 @@
-
- disapproveAction
-
+ disapproveAction
@@ -429,8 +429,8 @@
- Defined in src/app/pages/admin/admin.component.ts:65
+ Defined in src/app/pages/admin/admin.component.ts:68
@@ -483,9 +483,7 @@
-
- doFilter
-
+ doFilter
@@ -499,8 +497,8 @@
- Defined in src/app/pages/admin/admin.component.ts:46
+ Defined in src/app/pages/admin/admin.component.ts:49
@@ -553,9 +551,7 @@
-
- downloadCsv
-
+ downloadCsv
@@ -569,8 +565,8 @@
- Defined in src/app/pages/admin/admin.component.ts:80
+ Defined in src/app/pages/admin/admin.component.ts:83
@@ -592,9 +588,7 @@
-
- expandCollapse
-
+ expandCollapse
@@ -608,8 +602,8 @@
- Defined in src/app/pages/admin/admin.component.ts:76
+ Defined in src/app/pages/admin/admin.component.ts:79
@@ -658,26 +652,22 @@
-
- Async
- ngOnInit
-
+ ngOnInit
-
- ngOnInit()
+ngOnInit()
- Defined in src/app/pages/admin/admin.component.ts:35
+ Defined in src/app/pages/admin/admin.component.ts:36
@@ -686,7 +676,7 @@
- Returns : Promise<void>
+ Returns : void
@@ -696,194 +686,219 @@
-
- Properties
-
-
-
+
+ Properties
+
+
+
+
+
+
+
+ action
+
+
+
+
-
-
-
- action
-
-
+ Type : Action
+
- Type : Action
-
+ Defined in src/app/pages/admin/admin.component.ts:27
-
-
- Defined in src/app/pages/admin/admin.component.ts:27
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ actions
+
+
+
+
-
-
-
- actions
-
-
+ Type : Array<Action>
+
- Type : Array<Action>
-
+ Defined in src/app/pages/admin/admin.component.ts:28
-
-
- Defined in src/app/pages/admin/admin.component.ts:28
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ dataSource
+
+
+
+
-
-
-
- dataSource
-
-
+ Type : MatTableDataSource<any>
+
- Type : MatTableDataSource<any>
-
+ Defined in src/app/pages/admin/admin.component.ts:25
-
-
- Defined in src/app/pages/admin/admin.component.ts:25
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ displayedColumns
+
+
+
+
-
-
-
- displayedColumns
-
-
+ Type : Array<string>
+
+
+
+
+
+ Default value : ['expand', 'user', 'role', 'action', 'status', 'approve']
- Type : Array<string>
-
+ Defined in src/app/pages/admin/admin.component.ts:26
-
-
- Default value : ['expand', 'user', 'role', 'action', 'status', 'approve']
-
-
-
-
- Defined in src/app/pages/admin/admin.component.ts:26
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ loading
+
+
+
+
-
-
-
- paginator
-
-
+ Type : boolean
+
+
+
+
+
+ Default value : true
- Type : MatPaginator
-
+ Defined in src/app/pages/admin/admin.component.ts:29
-
-
- Decorators :
-
-
- @ViewChild(MatPaginator)
-
-
-
-
-
- Defined in src/app/pages/admin/admin.component.ts:30
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ paginator
+
+
+
+
-
-
-
- sort
-
-
+ Type : MatPaginator
+
+
+
+
+
+ Decorators :
+
+
+ @ViewChild(MatPaginator)
+
- Type : MatSort
-
+ Defined in src/app/pages/admin/admin.component.ts:31
+
+
+
+
+
+
+
+
+
+
+ sort
+
+
+
+
+
+
+ Type : MatSort
+
+
+
+
+
+ Decorators :
+
+
+ @ViewChild(MatSort)
+
+
+
- Decorators :
-
-
- @ViewChild(MatSort)
-
+ Defined in src/app/pages/admin/admin.component.ts:32
-
-
- Defined in src/app/pages/admin/admin.component.ts:31
-
-
-
-
+
+
@@ -898,7 +913,7 @@ import { LoggingService, UserService } from '@app/_services';
import { animate, state, style, transition, trigger } from '@angular/animations';
import { first } from 'rxjs/operators';
import { exportCsv } from '@app/_helpers';
-import { Action } from '../../_models';
+import { Action } from '@app/_models';
@Component({
selector: 'app-admin',
@@ -918,20 +933,23 @@ export class AdminComponent implements OnInit {
displayedColumns: Array<string> = ['expand', 'user', 'role', 'action', 'status', 'approve'];
action: Action;
actions: Array<Action>;
+ loading: boolean = true;
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
constructor(private userService: UserService, private loggingService: LoggingService) {}
- async ngOnInit(): Promise<void> {
- await this.userService.init();
+ ngOnInit(): void {
this.userService.getActions();
this.userService.actionsSubject.subscribe((actions) => {
this.dataSource = new MatTableDataSource<any>(actions);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
this.actions = actions;
+ if (actions.length > 0) {
+ this.loading = false;
+ }
});
}
@@ -1022,6 +1040,11 @@ export class AdminComponent implements OnInit {
<mat-icon matSuffix>search</mat-icon>
</mat-form-field>
+ <div *ngIf="loading">
+ <h2 class="text-center"><strong>Loading Actions!</strong></h2>
+ <mat-progress-bar [mode]="'query'"></mat-progress-bar>
+ </div>
+
<mat-table class="mat-elevation-z10" [dataSource]="dataSource" multiTemplateDataRows>
<!-- Expand Column -->
<ng-container matColumnDef="expand">
@@ -1165,8 +1188,8 @@ export class AdminComponent implements OnInit {
@@ -1209,9 +1232,9 @@ export class AdminComponent implements OnInit {
-
-
-
+
+
+
diff --git a/docs/compodoc/components/AppComponent.html b/docs/compodoc/components/AppComponent.html
index 7aeaf1b..504e581 100644
--- a/docs/compodoc/components/AppComponent.html
+++ b/docs/compodoc/components/AppComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
- Components
- - AppComponent
+ -
+ AppComponent
@@ -66,6 +69,7 @@
+
Implements
@@ -134,16 +138,16 @@
-
- mediaQuery
+ accountDetailsRegex
-
- readyState
+ mediaQuery
-
- readyStateTarget
+ title
-
- title
+ url
@@ -159,10 +163,22 @@
-
Async
- ngOnInit
+ cicConvert
-
- onResize
+ Async
+ cicTransfer
+
+ -
+ Async
+ ngOnInit
+
+ -
+ onResize
+
+ -
+ Async
+ routeManagement
@@ -180,10 +196,10 @@
@@ -199,12 +215,12 @@
-constructor(authService: AuthService, transactionService: TransactionService, loggingService: LoggingService, errorDialogService: ErrorDialogService, swUpdate: SwUpdate)
+constructor(authService: AuthService, blockSyncService: BlockSyncService, errorDialogService: ErrorDialogService, loggingService: LoggingService, tokenService: TokenService, transactionService: TransactionService, userService: UserService, swUpdate: SwUpdate, router: Router)
- Defined in src/app/app.component.ts:21
+ Defined in src/app/app.component.ts:25
@@ -234,22 +250,10 @@
- transactionService
+ blockSyncService
- TransactionService
-
-
-
- No
-
-
-
-
- loggingService
-
-
- LoggingService
+ BlockSyncService
@@ -268,6 +272,54 @@
No
+
+
+ loggingService
+
+
+ LoggingService
+
+
+
+ No
+
+
+
+
+ tokenService
+
+
+ TokenService
+
+
+
+ No
+
+
+
+
+ transactionService
+
+
+ TransactionService
+
+
+
+ No
+
+
+
+
+ userService
+
+
+ UserService
+
+
+
+ No
+
+
swUpdate
@@ -281,6 +333,18 @@
+
+ router
+
+
+ Router
+
+
+
+ No
+
+
+
+ + + Async + cicConvert + + + | +||||||
+
+ cicConvert(event: CustomEvent)
+ |
+ ||||||
+ Decorators :
+ + @HostListener('window:cic_convert', ['$event'])
+ |
+ ||||||
+ Defined in src/app/app.component.ts:99
+ |
+ ||||||
+
+
+ Parameters :
+
+
+
+
+ Returns :
+ Promise<void>
+
+
+
+
+ |
+
+ + + Async + cicTransfer + + + | +||||||
+
+ cicTransfer(event: CustomEvent)
+ |
+ ||||||
+ Decorators :
+ + @HostListener('window:cic_transfer', ['$event'])
+ |
+ ||||||
+ Defined in src/app/app.component.ts:93
+ |
+ ||||||
+
+
+ Parameters :
+
+
+
+
+ Returns :
+ Promise<void>
+
+
+
+
+ |
+
- - Async - ngOnInit - + Async + ngOnInit | @@ -394,8 +606,8 @@
- Defined in src/app/app.component.ts:34
+ Defined in src/app/app.component.ts:42
|
- - onResize - + onResize | @@ -433,8 +643,8 @@
- Defined in src/app/app.component.ts:57
+ Defined in src/app/app.component.ts:68
|
+ + + Async + routeManagement + + + | +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+
+ routeManagement()
+ |
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+ Defined in src/app/app.component.ts:104
+ |
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+
+
+ Returns :
Promise<void>
+
|
+ + + accountDetailsRegex + + + | +
-
-
-
- mediaQuery
-
-
+ Type : string
+
+ |
+
+ Default value : '/accounts/[a-z,A-Z,0-9]{40}'
|
- Type : MediaQueryList
-
+ Defined in src/app/app.component.ts:25
|
- Default value : window.matchMedia('(max-width: 768px)')
- |
-
- Defined in src/app/app.component.ts:21
- |
-
+ + + mediaQuery + + + | +
-
-
-
- readyState
-
-
+ Type : MediaQueryList
+
+ |
+
+ Default value : window.matchMedia('(max-width: 768px)')
|
- Type : number
-
+ Defined in src/app/app.component.ts:23
|
- Default value : 0
- |
-
- Defined in src/app/app.component.ts:20
- |
-
+ + + title + + + | +
-
-
-
- readyStateTarget
-
-
+ Type : string
+
+ |
+
+ Default value : 'CICADA'
|
- Type : number
-
+ Defined in src/app/app.component.ts:22
|
- Default value : 3
- |
-
- Defined in src/app/app.component.ts:19
- |
-
+ + + url + + + | +
-
-
-
- title
-
-
+ Type : string
+
|
- Type : string
-
+ Defined in src/app/app.component.ts:24
|
- Default value : 'CICADA'
- |
-
- Defined in src/app/app.component.ts:18
- |
-
import { ChangeDetectionStrategy, Component, HostListener, OnInit } from '@angular/core';
import {
AuthService,
+ BlockSyncService,
ErrorDialogService,
LoggingService,
+ TokenService,
TransactionService,
+ UserService,
} from '@app/_services';
-import { catchError } from 'rxjs/operators';
import { SwUpdate } from '@angular/service-worker';
+import { NavigationEnd, Router } from '@angular/router';
+import { filter } from 'rxjs/operators';
@Component({
selector: 'app-root',
@@ -635,16 +879,20 @@ import { SwUpdate } from '@angular/service-worker';
})
export class AppComponent implements OnInit {
title = 'CICADA';
- readyStateTarget: number = 3;
- readyState: number = 0;
mediaQuery: MediaQueryList = window.matchMedia('(max-width: 768px)');
+ url: string;
+ accountDetailsRegex = '/accounts/[a-z,A-Z,0-9]{40}';
constructor(
private authService: AuthService,
- private transactionService: TransactionService,
- private loggingService: LoggingService,
+ private blockSyncService: BlockSyncService,
private errorDialogService: ErrorDialogService,
- private swUpdate: SwUpdate
+ private loggingService: LoggingService,
+ private tokenService: TokenService,
+ private transactionService: TransactionService,
+ private userService: UserService,
+ private swUpdate: SwUpdate,
+ private router: Router
) {
this.mediaQuery.addEventListener('change', this.onResize);
this.onResize(this.mediaQuery);
@@ -652,6 +900,8 @@ export class AppComponent implements OnInit {
async ngOnInit(): Promise<void> {
await this.authService.init();
+ await this.tokenService.init();
+ await this.userService.init();
await this.transactionService.init();
try {
const publicKeys = await this.authService.getPublicKeys();
@@ -670,6 +920,7 @@ export class AppComponent implements OnInit {
}
});
}
+ await this.routeManagement();
}
// Load resize
@@ -708,6 +959,33 @@ export class AppComponent implements OnInit {
const conversion: any = event.detail.tx;
await this.transactionService.setConversion(conversion, 100);
}
+
+ async routeManagement(): Promise<void> {
+ await this.router.events
+ .pipe(filter((e) => e instanceof NavigationEnd))
+ .forEach(async (routeInfo) => {
+ if (routeInfo instanceof NavigationEnd) {
+ this.url = routeInfo.url;
+ if (!this.url.match(this.accountDetailsRegex) || !this.url.includes('tx')) {
+ await this.blockSyncService.blockSync();
+ }
+ if (!this.url.includes('accounts')) {
+ try {
+ await this.userService.loadAccounts(100);
+ } catch (error) {
+ this.loggingService.sendErrorLevelMessage('Failed to load accounts', this, { error });
+ }
+ }
+ if (!this.url.includes('tokens')) {
+ this.tokenService.load.subscribe(async (status: boolean) => {
+ if (status) {
+ await this.tokenService.getTokens();
+ }
+ });
+ }
+ }
+ });
+ }
}
@@ -750,7 +1028,7 @@ export class AppComponent implements OnInit {
@@ -793,9 +1071,9 @@ export class AppComponent implements OnInit {
-
-
-
+
+
+
diff --git a/docs/compodoc/components/AuthComponent.html b/docs/compodoc/components/AuthComponent.html
index bce0b2b..7682596 100644
--- a/docs/compodoc/components/AuthComponent.html
+++ b/docs/compodoc/components/AuthComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
constructor(authService: AuthService, formBuilder: FormBuilder, router: Router, errorDialogService: ErrorDialogService)
+constructor(authService: AuthService, formBuilder: FormBuilder, router: Router, errorDialogService: ErrorDialogService)
ngOnInit()
+ngOnInit()
Promise<void>
+ Returns : void
+ + + keyForm + + + | +
-
-
-
- keyForm
-
-
+ Type : FormGroup
+
|
- Type : FormGroup
-
+ Defined in src/app/auth/auth.component.ts:15
|
- Defined in src/app/auth/auth.component.ts:16
- |
-
+ + + loading + + + | +
-
-
-
- loading
-
-
+ Type : boolean
+
+ |
+
+ Default value : false
|
- Type : boolean
-
+ Defined in src/app/auth/auth.component.ts:17
|
- Default value : false
- |
-
- Defined in src/app/auth/auth.component.ts:18
- |
-
+ + + matcher + + + | +
-
-
-
- matcher
-
-
+ Type : CustomErrorStateMatcher
+
+ |
+
+ Default value : new CustomErrorStateMatcher()
|
- Type : CustomErrorStateMatcher
-
+ Defined in src/app/auth/auth.component.ts:18
|
- Default value : new CustomErrorStateMatcher()
- |
-
- Defined in src/app/auth/auth.component.ts:19
- |
-
+ + + submitted + + + | +
-
-
-
- submitted
-
-
+ Type : boolean
+
+ |
+
+ Default value : false
|
- Type : boolean
-
+ Defined in src/app/auth/auth.component.ts:16
|
- Default value : false
- |
-
- Defined in src/app/auth/auth.component.ts:17
- |
-
constructor(formBuilder: FormBuilder, locationService: LocationService, userService: UserService)
+constructor(formBuilder: FormBuilder, locationService: LocationService, userService: UserService)
+ + + loadSearchData + + + | +
+loadSearchData()
+ |
+
+ + | +
+
+
+ Returns :
+ void
+
+ |
+
- - Async - ngOnInit - + ngOnInit | |||||||||||||||||||||||||||||
-
- ngOnInit()
+ngOnInit()
|
- Returns :
Promise<void>
+ Returns : void
|
@@ -328,9 +367,7 @@
- - onSubmit - + onSubmit | @@ -344,8 +381,8 @@|||||||||||||||||||||||||||
- + |
+ + + accountTypes + + + | +
-
-
-
- accountTypes
-
-
+ Type : Array<string>
+
|
- Type : Array<string>
-
+
|
- - | -
+ + + areaNames + + + | +
-
-
-
- areaNames
-
-
+ Type : Array<string>
+
|
- Type : Array<string>
-
+
|
- - | -
+ + + categories + + + | +
-
-
-
- categories
-
-
+ Type : Array<string>
+
|
- Type : Array<string>
-
+
|
- - | -
+ + + createForm + + + | +
-
-
-
- createForm
-
-
+ Type : FormGroup
+
|
- Type : FormGroup
-
+
|
- - | -
+ + + genders + + + | +
-
-
-
- genders
-
-
+ Type : Array<string>
+
|
- Type : Array<string>
-
+
|
- - | -
+ + + matcher + + + | +
-
-
-
- matcher
-
-
+ Type : CustomErrorStateMatcher
+
+ |
+
+ Default value : new CustomErrorStateMatcher()
|
- Type : CustomErrorStateMatcher
-
+
|
- Default value : new CustomErrorStateMatcher()
- |
-
- - | -
+ + + submitted + + + | +
-
-
-
- submitted
-
-
+ Type : boolean
+
+ |
+
+ Default value : false
|
- Type : boolean
-
+
|
- Default value : false
- |
-
- - | -
+ + + Public + data + + + | +
-
-
-
- Public
- data
-
-
+ Type : any
+
+ |
+
+ Decorators :
+ +
+ @Inject(MAT_DIALOG_DATA)
|
- Type : any
-
+
|
- Decorators :
- -
- @Inject(MAT_DIALOG_DATA)
- |
-
- - | -
+ + + currentYear + + + | +
-
-
-
- currentYear
-
-
+ Default value : new Date().getFullYear()
|
- Default value : new Date().getFullYear()
+ Defined in src/app/shared/footer/footer.component.ts:10
|
- Defined in src/app/shared/footer/footer.component.ts:10
- |
-
@@ -149,10 +153,10 @@ | @@ -177,7 +181,7 @@ | ||||||||||||||||||||||||||||
- + | - - handleNetworkChange - + handleNetworkChange | @@ -246,8 +248,8 @@||||||||||||||||||||||||||||
- + | - - ngOnInit - + ngOnInit | @@ -285,8 +285,8 @@||||||||||||||||||||||||||||
- + |
+ + + online + + + | +
-
-
-
- noInternetConnection
-
-
+ Type : boolean
+
+ |
+
+ Default value : navigator.onLine
|
- Type : boolean
-
+
|
- Default value : !navigator.onLine
- |
-
- - | -
import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
+import { checkOnlineStatus } from '@src/app/_helpers';
@Component({
selector: 'app-network-status',
@@ -355,22 +355,31 @@
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class NetworkStatusComponent implements OnInit {
- noInternetConnection: boolean = !navigator.onLine;
+ online: boolean = navigator.onLine;
constructor(private cdr: ChangeDetectorRef) {
this.handleNetworkChange();
}
- ngOnInit(): void {}
+ ngOnInit(): void {
+ window.addEventListener('online', (event: any) => {
+ this.online = true;
+ this.cdr.detectChanges();
+ });
+ window.addEventListener('offline', (event: any) => {
+ this.online = false;
+ this.cdr.detectChanges();
+ });
+ }
handleNetworkChange(): void {
- setTimeout(() => {
- if (!navigator.onLine !== this.noInternetConnection) {
- this.noInternetConnection = !navigator.onLine;
+ setTimeout(async () => {
+ if (this.online !== (await checkOnlineStatus())) {
+ this.online = await checkOnlineStatus();
this.cdr.detectChanges();
}
this.handleNetworkChange();
- }, 5000);
+ }, 3000);
}
}
@@ -379,7 +388,7 @@ export class NetworkStatusComponent implements OnInit {
<nav class="navbar navbar-dark background-dark">
<h1 class="navbar-brand">
- <div *ngIf="noInternetConnection; then offlineBlock; else onlineBlock"></div>
+ <div *ngIf="online; then onlineBlock; else offlineBlock"></div>
<ng-template #offlineBlock>
<strong style="color: red">OFFLINE </strong>
<img width="20rem" src="assets/images/no-wifi.svg" alt="Internet Disconnected" />
@@ -425,8 +434,8 @@ export class NetworkStatusComponent implements OnInit {
@@ -469,9 +478,9 @@ export class NetworkStatusComponent implements OnInit {
-
-
-
+
+
+
diff --git a/docs/compodoc/components/OrganizationComponent.html b/docs/compodoc/components/OrganizationComponent.html
index 6a17baf..3b88df3 100644
--- a/docs/compodoc/components/OrganizationComponent.html
+++ b/docs/compodoc/components/OrganizationComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
- Components
- - OrganizationComponent
+ -
+ OrganizationComponent
@@ -66,6 +69,7 @@
+
Implements
@@ -134,13 +138,13 @@
-
- matcher
+ matcher
-
- organizationForm
+ organizationForm
-
- submitted
+ submitted
@@ -155,10 +159,10 @@
@@ -177,7 +181,7 @@
@@ -250,9 +254,7 @@
-
- ngOnInit
-
+ ngOnInit
@@ -289,9 +291,7 @@
-
- onSubmit
-
+ onSubmit
@@ -325,100 +325,97 @@
-
- Properties
-
-
-
+
+ Properties
+
+
+
+
+
+
+
+ matcher
+
+
+
+
-
-
-
- matcher
-
-
+ Type : CustomErrorStateMatcher
+
+
+
+
+
+ Default value : new CustomErrorStateMatcher()
- Type : CustomErrorStateMatcher
-
+
-
-
- Default value : new CustomErrorStateMatcher()
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ organizationForm
+
+
+
+
-
-
-
- organizationForm
-
-
+ Type : FormGroup
+
- Type : FormGroup
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ submitted
+
+
+
+
-
-
-
- submitted
-
-
+ Type : boolean
+
+
+
+
+
+ Default value : false
- Type : boolean
-
+
-
-
- Default value : false
-
-
-
-
-
-
-
-
-
+
+
@@ -606,7 +603,7 @@ export class OrganizationComponent implements OnInit {
@@ -649,9 +646,9 @@ export class OrganizationComponent implements OnInit {
-
-
-
+
+
+
diff --git a/docs/compodoc/components/PagesComponent.html b/docs/compodoc/components/PagesComponent.html
index 8387e75..2e4170d 100644
--- a/docs/compodoc/components/PagesComponent.html
+++ b/docs/compodoc/components/PagesComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
- Components
- - PagesComponent
+ -
+ PagesComponent
@@ -68,6 +71,7 @@
+
Metadata
@@ -128,7 +132,7 @@
@@ -169,41 +173,40 @@
-
- Properties
-
-
-
+
+ Properties
+
+
+
+
+
+
+
+ url
+
+
+
+
-
-
-
- url
-
-
+ Type : string
+
+
+
+
+
+ Default value : environment.dashboardUrl
- Type : string
-
+ Defined in src/app/pages/pages.component.ts:11
-
-
- Default value : environment.dashboardUrl
-
-
-
-
- Defined in src/app/pages/pages.component.ts:11
-
-
-
-
+
+
@@ -302,7 +305,7 @@ export class PagesComponent {
@@ -345,9 +348,9 @@ export class PagesComponent {
-
-
-
+
+
+
diff --git a/docs/compodoc/components/SettingsComponent.html b/docs/compodoc/components/SettingsComponent.html
index 2542e02..9cd4347 100644
--- a/docs/compodoc/components/SettingsComponent.html
+++ b/docs/compodoc/components/SettingsComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
- Components
- - SettingsComponent
+ -
+ SettingsComponent
@@ -66,6 +69,7 @@
+
Implements
@@ -134,25 +138,25 @@
-
- dataSource
+ dataSource
-
- date
+ displayedColumns
-
- displayedColumns
+ loading
-
- paginator
+ paginator
-
- sort
+ sort
-
- trustedUsers
+ trustedUsers
-
- userInfo
+ userInfo
@@ -167,17 +171,16 @@
-
- doFilter
+ doFilter
-
- downloadCsv
+ downloadCsv
-
- logout
+ logout
-
- Async
- ngOnInit
+ ngOnInit
@@ -197,7 +200,7 @@
-constructor(authService: AuthService)
+constructor(authService: AuthService)
@@ -255,9 +258,7 @@
-
- doFilter
-
+ doFilter
@@ -271,8 +272,8 @@
-
+
@@ -325,9 +326,7 @@
-
- downloadCsv
-
+ downloadCsv
@@ -341,8 +340,8 @@
-
+
@@ -364,9 +363,7 @@
-
- logout
-
+ logout
@@ -380,8 +377,8 @@
-
+
@@ -403,18 +400,14 @@
-
- Async
- ngOnInit
-
+ ngOnInit
-
- ngOnInit()
+ngOnInit()
@@ -431,7 +424,7 @@
- Returns : Promise<void>
+ Returns : void
@@ -441,221 +434,219 @@
-
- Properties
-
-
-
+
+ Properties
+
+
+
+
+
+
+
+ dataSource
+
+
+
+
-
-
-
- dataSource
-
-
+ Type : MatTableDataSource<any>
+
- Type : MatTableDataSource<any>
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ displayedColumns
+
+
+
+
-
-
-
- date
-
-
+ Type : Array<string>
+
+
+
+
+
+ Default value : ['name', 'email', 'userId']
- Type : string
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ loading
+
+
+
+
-
-
-
- displayedColumns
-
-
+ Type : boolean
+
+
+
+
+
+ Default value : true
- Type : Array<string>
-
+
-
-
- Default value : ['name', 'email', 'userId']
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+ sort
+
+
+
+
-
-
-
- sort
-
-
+ Type : MatSort
+
+
+
+
+
+ Decorators :
+
+
+ @ViewChild(MatSort)
+
- Type : MatSort
-
+
-
-
- Decorators :
-
-
- @ViewChild(MatSort)
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ trustedUsers
+
+
+
+
-
-
-
- trustedUsers
-
-
+ Type : Array<Staff>
+
- Type : Array<Staff>
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ userInfo
+
+
+
+
-
-
-
- userInfo
-
-
+ Type : Staff
+
- Type : Staff
-
+
-
-
-
-
-
-
-
+
+
@@ -677,24 +668,26 @@ import { exportCsv } from '@app/_helpers';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SettingsComponent implements OnInit {
- date: string;
dataSource: MatTableDataSource<any>;
displayedColumns: Array<string> = ['name', 'email', 'userId'];
trustedUsers: Array<Staff>;
userInfo: Staff;
+ loading: boolean = true;
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
constructor(private authService: AuthService) {}
- async ngOnInit(): Promise<void> {
- await this.authService.init();
+ ngOnInit(): void {
this.authService.trustedUsersSubject.subscribe((users) => {
this.dataSource = new MatTableDataSource<any>(users);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
this.trustedUsers = users;
+ if (users.length > 0) {
+ this.loading = false;
+ }
});
this.userInfo = this.authService.getPrivateKeyInfo();
}
@@ -757,6 +750,7 @@ export class SettingsComponent implements OnInit {
</div>
</div>
</div>
+
<div class="col-12 mb-2">
<div class="card">
<mat-card-title class="card-header">
@@ -784,6 +778,12 @@ export class SettingsComponent implements OnInit {
/>
<mat-icon matSuffix>search</mat-icon>
</mat-form-field>
+
+ <div *ngIf="loading">
+ <h2 class="text-center"><strong>Loading Trusted Users!</strong></h2>
+ <mat-progress-bar [mode]="'query'"></mat-progress-bar>
+ </div>
+
<mat-table
class="mat-elevation-z10"
[dataSource]="dataSource"
@@ -862,8 +862,8 @@ export class SettingsComponent implements OnInit {
@@ -906,9 +906,9 @@ export class SettingsComponent implements OnInit {
-
-
-
+
+
+
diff --git a/docs/compodoc/components/SidebarComponent.html b/docs/compodoc/components/SidebarComponent.html
index c60b638..7e963a7 100644
--- a/docs/compodoc/components/SidebarComponent.html
+++ b/docs/compodoc/components/SidebarComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
- Components
- - SidebarComponent
+ -
+ SidebarComponent
@@ -66,6 +69,7 @@
+
Implements
@@ -135,7 +139,7 @@
@@ -183,9 +187,7 @@
-
- ngOnInit
-
+ ngOnInit
@@ -327,7 +329,7 @@ export class SidebarComponent implements OnInit {
@@ -370,9 +372,9 @@ export class SidebarComponent implements OnInit {
-
-
-
+
+
+
diff --git a/docs/compodoc/components/SidebarStubComponent.html b/docs/compodoc/components/SidebarStubComponent.html
index 0c01083..b1a5053 100644
--- a/docs/compodoc/components/SidebarStubComponent.html
+++ b/docs/compodoc/components/SidebarStubComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
- Components
- - SidebarStubComponent
+ -
+ SidebarStubComponent
@@ -62,6 +65,7 @@
+
Metadata
@@ -150,7 +154,7 @@ export class FooterStubComponent {}
@@ -193,9 +197,9 @@ export class FooterStubComponent {}
-
-
-
+
+
+
diff --git a/docs/compodoc/components/TokenDetailsComponent.html b/docs/compodoc/components/TokenDetailsComponent.html
index dc993be..88d75fc 100644
--- a/docs/compodoc/components/TokenDetailsComponent.html
+++ b/docs/compodoc/components/TokenDetailsComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
- Components
- - TokenDetailsComponent
+ -
+ TokenDetailsComponent
@@ -66,6 +69,7 @@
+
Implements
@@ -135,10 +139,10 @@
@@ -153,7 +157,7 @@
@@ -168,7 +172,7 @@
@@ -260,9 +264,7 @@
-
- close
-
+ close
@@ -299,9 +301,7 @@
-
- ngOnInit
-
+ ngOnInit
@@ -455,7 +455,7 @@ export class TokenDetailsComponent implements OnInit {
@@ -498,9 +498,9 @@ export class TokenDetailsComponent implements OnInit {
-
-
-
+
+
+
diff --git a/docs/compodoc/components/TokensComponent.html b/docs/compodoc/components/TokensComponent.html
index 3602cd7..9ab6b30 100644
--- a/docs/compodoc/components/TokensComponent.html
+++ b/docs/compodoc/components/TokensComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
- Components
- - TokensComponent
+ -
+ TokensComponent
@@ -66,11 +69,13 @@
+
Implements
@@ -134,22 +139,25 @@
-
- columnsToDisplay
+ columnsToDisplay
-
- dataSource
+ dataSource
-
- paginator
+ loading
-
- sort
+ paginator
-
- token
+ sort
-
- tokens
+ token
+
+ -
+ tokens
@@ -164,17 +172,19 @@
-
- doFilter
+ doFilter
-
- downloadCsv
+ downloadCsv
-
- Async
- ngOnInit
+ ngAfterViewInit
-
- viewToken
+ ngOnInit
+
+ -
+ viewToken
@@ -194,12 +204,12 @@
-constructor(tokenService: TokenService, loggingService: LoggingService, router: Router)
+constructor(tokenService: TokenService)
- Defined in src/app/pages/tokens/tokens.component.ts:22
+ Defined in src/app/pages/tokens/tokens.component.ts:28
@@ -228,30 +238,6 @@
-
- loggingService
-
-
- LoggingService
-
-
-
- No
-
-
-
-
- router
-
-
- Router
-
-
-
- No
-
-
-
@@ -276,9 +262,7 @@
-
- doFilter
-
+ doFilter
@@ -292,8 +276,8 @@
- Defined in src/app/pages/tokens/tokens.component.ts:46
+ Defined in src/app/pages/tokens/tokens.component.ts:56
@@ -346,9 +330,7 @@
-
- downloadCsv
-
+ downloadCsv
@@ -362,8 +344,45 @@
- Defined in src/app/pages/tokens/tokens.component.ts:54
+ Defined in src/app/pages/tokens/tokens.component.ts:64
+
+
+
+
+
+
+
+
+ Returns : void
+
+
+
+
+
+
+
+
+
+
+
+
+ ngAfterViewInit
+
+
+
+
+
+
+ngAfterViewInit()
+
+
+
+
+
+
+ Defined in src/app/pages/tokens/tokens.component.ts:49
@@ -385,26 +404,22 @@
-
- Async
- ngOnInit
-
+ ngOnInit
-
- ngOnInit()
+ngOnInit()
- Defined in src/app/pages/tokens/tokens.component.ts:30
+ Defined in src/app/pages/tokens/tokens.component.ts:32
@@ -413,7 +428,7 @@
- Returns : Promise<void>
+ Returns : void
@@ -426,9 +441,7 @@
-
- viewToken
-
+ viewToken
@@ -442,8 +455,8 @@
- Defined in src/app/pages/tokens/tokens.component.ts:50
+ Defined in src/app/pages/tokens/tokens.component.ts:60
@@ -489,206 +502,236 @@
-
- Properties
-
-
-
+
+ Properties
+
+
+
+
+
+
+
+ columnsToDisplay
+
+
+
+
-
-
-
- columnsToDisplay
-
-
+ Type : Array<string>
+
+
+
+
+
+ Default value : ['name', 'symbol', 'address', 'supply']
- Type : Array<string>
-
+ Defined in src/app/pages/tokens/tokens.component.ts:23
-
-
- Default value : ['name', 'symbol', 'address', 'supply']
-
-
-
-
- Defined in src/app/pages/tokens/tokens.component.ts:18
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ dataSource
+
+
+
+
-
-
-
- dataSource
-
-
+ Type : MatTableDataSource<any>
+
- Type : MatTableDataSource<any>
-
+ Defined in src/app/pages/tokens/tokens.component.ts:22
-
-
- Defined in src/app/pages/tokens/tokens.component.ts:17
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ loading
+
+
+
+
-
-
-
- paginator
-
-
+ Type : boolean
+
+
+
+
+
+ Default value : true
- Type : MatPaginator
-
+ Defined in src/app/pages/tokens/tokens.component.ts:28
-
-
- Decorators :
-
-
- @ViewChild(MatPaginator)
-
-
-
-
-
- Defined in src/app/pages/tokens/tokens.component.ts:19
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ paginator
+
+
+
+
-
-
-
- sort
-
-
+ Type : MatPaginator
+
+
+
+
+
+ Decorators :
+
+
+ @ViewChild(MatPaginator)
+
- Type : MatSort
-
+ Defined in src/app/pages/tokens/tokens.component.ts:24
-
-
- Decorators :
-
-
- @ViewChild(MatSort)
-
-
-
-
-
- Defined in src/app/pages/tokens/tokens.component.ts:20
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ sort
+
+
+
+
-
-
-
- token
-
-
+ Type : MatSort
+
+
+
+
+
+ Decorators :
+
+
+ @ViewChild(MatSort)
+
- Type : Token
-
+ Defined in src/app/pages/tokens/tokens.component.ts:25
-
-
- Defined in src/app/pages/tokens/tokens.component.ts:22
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ token
+
+
+
+
-
-
-
- tokens
-
-
+ Type : Token
+
- Type : Array<Token>
-
+ Defined in src/app/pages/tokens/tokens.component.ts:27
-
-
- Defined in src/app/pages/tokens/tokens.component.ts:21
-
-
-
-
+
+
+
+
+
+
+
+
+ tokens
+
+
+
+
+
+
+ Type : Array<Token>
+
+
+
+
+
+ Defined in src/app/pages/tokens/tokens.component.ts:26
+
+
+
+
+
+
- import { ChangeDetectionStrategy, Component, OnInit, ViewChild } from '@angular/core';
+ import {
+ AfterViewInit,
+ ChangeDetectionStrategy,
+ Component,
+ OnInit,
+ ViewChild,
+} from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
-import { LoggingService, TokenService } from '@app/_services';
+import { TokenService } from '@app/_services';
import { MatTableDataSource } from '@angular/material/table';
-import { Router } from '@angular/router';
import { exportCsv } from '@app/_helpers';
import { Token } from '@app/_models';
@@ -698,36 +741,41 @@ import { Token } from '@app/_models';
styleUrls: ['./tokens.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
-export class TokensComponent implements OnInit {
+export class TokensComponent implements OnInit, AfterViewInit {
dataSource: MatTableDataSource<any>;
columnsToDisplay: Array<string> = ['name', 'symbol', 'address', 'supply'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
tokens: Array<Token>;
token: Token;
+ loading: boolean = true;
- constructor(
- private tokenService: TokenService,
- private loggingService: LoggingService,
- private router: Router
- ) {}
+ constructor(private tokenService: TokenService) {}
- async ngOnInit(): Promise<void> {
- await this.tokenService.init();
+ ngOnInit(): void {
this.tokenService.load.subscribe(async (status: boolean) => {
if (status) {
await this.tokenService.getTokens();
}
});
this.tokenService.tokensSubject.subscribe((tokens) => {
- this.loggingService.sendInfoLevelMessage(tokens);
this.dataSource = new MatTableDataSource(tokens);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
this.tokens = tokens;
+ if (tokens.length > 0) {
+ this.loading = false;
+ }
});
}
+ ngAfterViewInit(): void {
+ if (this.dataSource) {
+ this.dataSource.paginator = this.paginator;
+ this.dataSource.sort = this.sort;
+ }
+ }
+
doFilter(value: string): void {
this.dataSource.filter = value.trim().toLocaleLowerCase();
}
@@ -791,6 +839,11 @@ export class TokensComponent implements OnInit {
<mat-icon matSuffix>search</mat-icon>
</mat-form-field>
+ <div *ngIf="loading">
+ <h2 class="text-center"><strong>Loading Tokens!</strong></h2>
+ <mat-progress-bar [mode]="'query'"></mat-progress-bar>
+ </div>
+
<mat-table
class="mat-elevation-z10 table-responsive"
[dataSource]="dataSource"
@@ -875,8 +928,8 @@ export class TokensComponent implements OnInit {
@@ -919,9 +972,9 @@ export class TokensComponent implements OnInit {
-
-
-
+
+
+
diff --git a/docs/compodoc/components/TopbarComponent.html b/docs/compodoc/components/TopbarComponent.html
index 74a138a..eb1ae0a 100644
--- a/docs/compodoc/components/TopbarComponent.html
+++ b/docs/compodoc/components/TopbarComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
- Components
- - TopbarComponent
+ -
+ TopbarComponent
@@ -66,6 +69,7 @@
+
Implements
@@ -135,7 +139,7 @@
@@ -183,9 +187,7 @@
-
- ngOnInit
-
+ ngOnInit
@@ -292,7 +294,7 @@ export class TopbarComponent implements OnInit {
@@ -335,9 +337,9 @@ export class TopbarComponent implements OnInit {
-
-
-
+
+
+
diff --git a/docs/compodoc/components/TopbarStubComponent.html b/docs/compodoc/components/TopbarStubComponent.html
index e23bf40..184b41d 100644
--- a/docs/compodoc/components/TopbarStubComponent.html
+++ b/docs/compodoc/components/TopbarStubComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
- Components
- - TopbarStubComponent
+ -
+ TopbarStubComponent
@@ -62,6 +65,7 @@
+
Metadata
@@ -150,7 +154,7 @@ export class FooterStubComponent {}
@@ -193,9 +197,9 @@ export class FooterStubComponent {}
-
-
-
+
+
+
diff --git a/docs/compodoc/components/TransactionDetailsComponent.html b/docs/compodoc/components/TransactionDetailsComponent.html
index 8833ebd..7f10b5f 100644
--- a/docs/compodoc/components/TransactionDetailsComponent.html
+++ b/docs/compodoc/components/TransactionDetailsComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
- Components
- - TransactionDetailsComponent
+ -
+ TransactionDetailsComponent
@@ -66,6 +69,7 @@
+
Implements
@@ -134,19 +138,19 @@
@@ -161,30 +165,29 @@
-
- close
+ close
-
- copyAddress
+ copyAddress
+
+ -
+ ngOnInit
-
Async
- ngOnInit
+ reverseTransaction
-
Async
- reverseTransaction
+ viewRecipient
-
Async
- viewRecipient
+ viewSender
-
Async
- viewSender
-
- -
- Async
- viewTrader
+ viewTrader
@@ -199,7 +202,7 @@
@@ -214,7 +217,7 @@
@@ -232,7 +235,7 @@
-constructor(router: Router, transactionService: TransactionService, snackBar: MatSnackBar, tokenService: TokenService)
+constructor(router: Router, transactionService: TransactionService, snackBar: MatSnackBar, tokenService: TokenService)
@@ -320,6 +323,12 @@
transaction
+
+
+
+ Type : any
+
+
@@ -366,9 +375,7 @@
-
- close
-
+ close
@@ -382,8 +389,8 @@
-
+
@@ -405,9 +412,7 @@
-
- copyAddress
-
+ copyAddress
@@ -421,8 +426,8 @@
-
+
@@ -475,18 +480,14 @@
-
- Async
- ngOnInit
-
+ ngOnInit
-
- ngOnInit()
+ngOnInit()
@@ -503,7 +504,7 @@
- Returns : Promise<void>
+ Returns : void
@@ -516,10 +517,8 @@
-
- Async
- reverseTransaction
-
+ Async
+ reverseTransaction
@@ -534,8 +533,8 @@
-
+
@@ -557,10 +556,8 @@
-
- Async
- viewRecipient
-
+ Async
+ viewRecipient
@@ -575,8 +572,8 @@
-
+
@@ -598,10 +595,8 @@
-
- Async
- viewSender
-
+ Async
+ viewSender
@@ -616,8 +611,8 @@
-
+
@@ -639,10 +634,8 @@
-
- Async
- viewTrader
-
+ Async
+ viewTrader
@@ -657,8 +650,8 @@
-
+
@@ -677,144 +670,139 @@
-
- Properties
-
-
-
+
+ Properties
+
+
+
+
+
+
+
+ recipientBloxbergLink
+
+
+
+
-
-
-
- recipientBloxbergLink
-
-
+ Type : string
+
- Type : string
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ senderBloxbergLink
+
+
+
+
-
-
-
- senderBloxbergLink
-
-
+ Type : string
+
- Type : string
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ tokenName
+
+
+
+
-
-
-
- tokenName
-
-
+ Type : string
+
- Type : string
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ tokenSymbol
+
+
+
+
-
-
-
- tokenSymbol
-
-
+ Type : string
+
- Type : string
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ traderBloxbergLink
+
+
+
+
-
-
-
- traderBloxbergLink
-
-
+ Type : string
+
- Type : string
-
+
-
-
-
-
-
-
-
+
+
@@ -859,9 +847,7 @@ export class TransactionDetailsComponent implements OnInit {
private tokenService: TokenService
) {}
- async ngOnInit(): Promise<void> {
- await this.transactionService.init();
- await this.tokenService.init();
+ ngOnInit(): void {
if (this.transaction?.type === 'conversion') {
this.traderBloxbergLink =
'https://blockexplorer.bloxberg.org/address/' + this.transaction?.trader + '/transactions';
@@ -1020,7 +1006,22 @@ export class TransactionDetailsComponent implements OnInit {
<span>Index: {{ transaction.tx.txIndex }}</span>
</li>
<li class="list-group-item">
- <span>Hash: {{ transaction.tx.txHash }}</span>
+ <span>
+ Hash:
+ <a
+ href="https://blockexplorer.bloxberg.org/tx/{{ transaction.tx.txHash }}"
+ target="_blank"
+ >
+ {{ transaction.tx.txHash }}
+ </a>
+ <img
+ src="assets/images/checklist.svg"
+ class="ml-2"
+ height="20rem"
+ (click)="copyAddress(transaction.tx.txHash)"
+ alt="Copy"
+ />
+ </span>
</li>
<li class="list-group-item">
<span>Success: {{ transaction.tx.success }}</span>
@@ -1185,8 +1186,8 @@ export class TransactionDetailsComponent implements OnInit {
@@ -1229,9 +1230,9 @@ export class TransactionDetailsComponent implements OnInit {
-
-
-
+
+
+
diff --git a/docs/compodoc/components/TransactionsComponent.html b/docs/compodoc/components/TransactionsComponent.html
index 8884283..4dd5ec9 100644
--- a/docs/compodoc/components/TransactionsComponent.html
+++ b/docs/compodoc/components/TransactionsComponent.html
@@ -8,7 +8,8 @@
-
+
+
@@ -35,7 +36,9 @@
- Components
- - TransactionsComponent
+ -
+ TransactionsComponent
@@ -66,6 +69,7 @@
+
Implements
@@ -135,37 +139,40 @@
-
- defaultPageSize
+ defaultPageSize
-
- pageSizeOptions
+ loading
-
- paginator
+ pageSizeOptions
-
- sort
+ paginator
-
- tokenSymbol
+ sort
-
- transaction
+ tokenSymbol
-
- transactionDataSource
+ transaction
-
- transactionDisplayedColumns
+ transactionDataSource
-
- transactions
+ transactionDisplayedColumns
-
- transactionsType
+ transactions
-
- transactionsTypes
+ transactionsType
+
+ -
+ transactionsTypes
@@ -180,23 +187,23 @@
-
- doFilter
+ doFilter
-
- downloadCsv
+ downloadCsv
-
- filterTransactions
+ filterTransactions
-
- ngAfterViewInit
+ ngAfterViewInit
-
Async
- ngOnInit
+ ngOnInit
-
- viewTransaction
+ viewTransaction
@@ -216,12 +223,12 @@
-constructor(blockSyncService: BlockSyncService, transactionService: TransactionService, userService: UserService, tokenService: TokenService)
+constructor(blockSyncService: BlockSyncService, transactionService: TransactionService, userService: UserService, tokenService: TokenService)
-
+
@@ -310,9 +317,7 @@
-
- doFilter
-
+ doFilter
@@ -391,9 +396,7 @@
-
- downloadCsv
-
+ downloadCsv
@@ -407,8 +410,8 @@
-
+
@@ -430,9 +433,7 @@
-
- filterTransactions
-
+ filterTransactions
@@ -469,9 +470,7 @@
-
- ngAfterViewInit
-
+ ngAfterViewInit
@@ -508,10 +507,8 @@
-
- Async
- ngOnInit
-
+ Async
+ ngOnInit
@@ -526,8 +523,8 @@
-
+
@@ -549,9 +546,7 @@
-
- viewTransaction
-
+ viewTransaction
@@ -612,344 +607,364 @@
-
- Properties
-
-
-
+
+ Properties
+
+
+
+
+
+
+
+ defaultPageSize
+
+
+
+
-
-
-
- defaultPageSize
-
-
+ Type : number
+
+
+
+
+
+ Default value : 10
- Type : number
-
+
-
-
- Default value : 10
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ loading
+
+
+
+
-
-
-
- pageSizeOptions
-
-
+ Type : boolean
+
+
+
+
+
+ Default value : true
- Type : Array<number>
-
+
-
-
- Default value : [10, 20, 50, 100]
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
-
+
+
+
+
+
+
+
+
+ sort
+
+
+
+
-
-
-
- tokenSymbol
-
-
+ Type : MatSort
+
+
+
+
+
+ Decorators :
+
+
+ @ViewChild(MatSort)
+
- Type : string
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ tokenSymbol
+
+
+
+
-
-
-
- transaction
-
-
+ Type : string
+
- Type : Transaction
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ transaction
+
+
+
+
-
-
-
- transactionDataSource
-
-
+ Type : Transaction
+
- Type : MatTableDataSource<any>
-
+
-
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+ transactionDisplayedColumns
+
+
+
+
-
-
-
- transactions
-
-
+ Type : Array<string>
+
+
+
+
+
+ Default value : ['sender', 'recipient', 'value', 'created', 'type']
- Type : Array<Transaction>
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ transactions
+
+
+
+
-
-
-
- transactionsType
-
-
+ Type : Array<Transaction>
+
- Type : string
-
+
-
-
- Default value : 'all'
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ transactionsType
+
+
+
+
-
-
-
- transactionsTypes
-
-
+ Type : string
+
+
+
+
+
+ Default value : 'all'
- Type : Array<string>
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ transactionsTypes
+
+
+
+
+
+
+ Type : Array<string>
+
+
+
+
+
+
+
+
+
+
+
+
@@ -987,6 +1002,7 @@ export class TransactionsComponent implements OnInit, AfterViewInit {
transactionsType: string = 'all';
transactionsTypes: Array<string>;
tokenSymbol: string;
+ loading: boolean = true;
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
@@ -999,17 +1015,16 @@ export class TransactionsComponent implements OnInit, AfterViewInit {
) {}
async ngOnInit(): Promise<void> {
+ await this.blockSyncService.blockSync();
this.transactionService.transactionsSubject.subscribe((transactions) => {
this.transactionDataSource = new MatTableDataSource<any>(transactions);
this.transactionDataSource.paginator = this.paginator;
this.transactionDataSource.sort = this.sort;
this.transactions = transactions;
+ if (transactions.length > 0) {
+ this.loading = false;
+ }
});
- await this.blockSyncService.init();
- await this.tokenService.init();
- await this.transactionService.init();
- await this.userService.init();
- await this.blockSyncService.blockSync();
this.userService
.getTransactionTypes()
.pipe(first())
@@ -1043,8 +1058,10 @@ export class TransactionsComponent implements OnInit, AfterViewInit {
}
ngAfterViewInit(): void {
- this.transactionDataSource.paginator = this.paginator;
- this.transactionDataSource.sort = this.sort;
+ if (this.transactionDataSource) {
+ this.transactionDataSource.paginator = this.paginator;
+ this.transactionDataSource.sort = this.sort;
+ }
}
downloadCsv(): void {
@@ -1120,6 +1137,11 @@ export class TransactionsComponent implements OnInit, AfterViewInit {
<mat-icon matSuffix>search</mat-icon>
</mat-form-field>
+ <div *ngIf="loading">
+ <h2 class="text-center"><strong>Loading Transactions!</strong></h2>
+ <mat-progress-bar [mode]="'query'"></mat-progress-bar>
+ </div>
+
<table
mat-table
class="mat-elevation-z10"
@@ -1226,8 +1248,8 @@ export class TransactionsComponent implements OnInit, AfterViewInit {
@@ -1270,9 +1292,9 @@ export class TransactionsComponent implements OnInit, AfterViewInit {
-
-
-
+
+
+
diff --git a/docs/compodoc/coverage.html b/docs/compodoc/coverage.html
index 0743652..61b07c3 100644
--- a/docs/compodoc/coverage.html
+++ b/docs/compodoc/coverage.html
@@ -8,7 +8,8 @@
-
+
+
@@ -163,7 +164,7 @@
- src/app/_helpers/array-sum.ts
+ src/app/_helpers/array-sum.ts
function
arraySum
@@ -175,7 +176,7 @@
- src/app/_helpers/clipboard-copy.ts
+ src/app/_helpers/clipboard-copy.ts
function
copyToClipboard
@@ -211,7 +212,7 @@
- src/app/_helpers/export-csv.ts
+ src/app/_helpers/export-csv.ts
function
exportCsv
@@ -247,7 +248,7 @@
- src/app/_helpers/global-error-handler.ts
+ src/app/_helpers/global-error-handler.ts
function
rejectBody
@@ -259,7 +260,7 @@
- src/app/_helpers/http-getter.ts
+ src/app/_helpers/http-getter.ts
function
HttpGetter
@@ -376,10 +377,34 @@
(1/1)
+
+
+
+ src/app/_helpers/online-status.ts
+
+ function
+ checkOnlineStatus
+
+ 0 %
+ (0/1)
+
+
+
+
+
+ src/app/_helpers/online-status.ts
+
+ variable
+ apiUrls
+
+ 0 %
+ (0/1)
+
+
- src/app/_helpers/read-csv.ts
+ src/app/_helpers/read-csv.ts
function
parseData
@@ -391,7 +416,7 @@
- src/app/_helpers/read-csv.ts
+ src/app/_helpers/read-csv.ts
function
readCsv
@@ -415,7 +440,7 @@
- src/app/_helpers/schema-validation.ts
+ src/app/_helpers/schema-validation.ts
function
personValidation
@@ -427,7 +452,7 @@
- src/app/_helpers/schema-validation.ts
+ src/app/_helpers/schema-validation.ts
function
vcardValidation
@@ -439,7 +464,7 @@
- src/app/_helpers/sync.ts
+ src/app/_helpers/sync.ts
function
updateSyncable
@@ -448,6 +473,30 @@
(0/1)
+
+
+
+ src/app/_helpers/to-hex.ts
+
+ function
+ asciiToHex
+
+ 0 %
+ (0/1)
+
+
+
+
+
+ src/app/_interceptors/connection.interceptor.ts
+
+ interceptor
+ ConnectionInterceptor
+
+ 100 %
+ (3/3)
+
+
@@ -757,7 +806,7 @@
BlockSyncService
0 %
- (0/10)
+ (0/9)
@@ -805,7 +854,7 @@
LoggingService
0 %
- (0/11)
+ (0/9)
@@ -817,7 +866,7 @@
RegistryService
0 %
- (0/5)
+ (0/8)
@@ -841,7 +890,7 @@
TransactionService
0 %
- (0/17)
+ (0/16)
@@ -865,7 +914,7 @@
UserService
0 %
- (0/38)
+ (0/42)
@@ -892,6 +941,42 @@
(0/4)
+
+
+
+ src/app/_workers/fetch-accounts.worker.ts
+
+ function
+ getAccountByAddress
+
+ 0 %
+ (0/1)
+
+
+
+
+
+ src/app/_workers/fetch-accounts.worker.ts
+
+ variable
+ headers
+
+ 0 %
+ (0/1)
+
+
+
+
+
+ src/app/_workers/fetch-accounts.worker.ts
+
+ variable
+ options
+
+ 0 %
+ (0/1)
+
+
@@ -901,7 +986,7 @@
AppComponent
0 %
- (0/10)
+ (0/13)
@@ -937,7 +1022,31 @@
AccountDetailsComponent
0 %
- (0/47)
+ (0/67)
+
+
+
+
+
+ src/app/pages/accounts/account-history/account-history.component.ts
+
+ component
+ AccountHistoryComponent
+
+ 0 %
+ (0/7)
+
+
+
+
+
+ src/app/pages/accounts/account-history/account-history.component.ts
+
+ variable
+ vCard
+
+ 0 %
+ (0/1)
@@ -949,7 +1058,7 @@
AccountSearchComponent
0 %
- (0/16)
+ (0/12)
@@ -961,7 +1070,7 @@
AccountsComponent
0 %
- (0/18)
+ (0/20)
@@ -973,7 +1082,7 @@
CreateAccountComponent
0 %
- (0/11)
+ (0/12)
@@ -985,7 +1094,7 @@
AdminComponent
0 %
- (0/15)
+ (0/16)
@@ -1045,7 +1154,7 @@
TokensComponent
0 %
- (0/12)
+ (0/14)
@@ -1069,7 +1178,7 @@
TransactionsComponent
0 %
- (0/19)
+ (0/20)
@@ -1108,6 +1217,18 @@
(0/1)
+
+
+
+ src/app/shared/_pipes/signature-user.pipe.ts
+
+ pipe
+ SignatureUserPipe
+
+ 0 %
+ (0/1)
+
+
@@ -1249,7 +1370,7 @@
RouterLinkDirectiveStub
0 %
- (0/4)
+ (0/5)
@@ -1356,9 +1477,9 @@
-
-
-
+
+
+
diff --git a/docs/compodoc/dependencies.html b/docs/compodoc/dependencies.html
index 968b58f..f580d53 100644
--- a/docs/compodoc/dependencies.html
+++ b/docs/compodoc/dependencies.html
@@ -8,7 +8,8 @@
-
+
+
@@ -129,9 +130,9 @@
-
-
-
+
+
+
diff --git a/docs/compodoc/directives/MenuSelectionDirective.html b/docs/compodoc/directives/MenuSelectionDirective.html
index 1836cab..ec18bca 100644
--- a/docs/compodoc/directives/MenuSelectionDirective.html
+++ b/docs/compodoc/directives/MenuSelectionDirective.html
@@ -8,7 +8,8 @@
-
+
+
@@ -37,7 +38,7 @@
- Directives
- - MenuSelectionDirective
+ - MenuSelectionDirective
@@ -58,11 +59,12 @@
src/app/shared/_directives/menu-selection.directive.ts
+
Description
-
Toggle availability of sidebar on menu item selection.
+ Toggle availability of sidebar on menu item selection.
@@ -96,7 +98,7 @@
@@ -201,9 +203,7 @@
-
- onMenuSelect
-
+ onMenuSelect
@@ -225,7 +225,7 @@
- Toggle the availability of the sidebar.
+ Toggle the availability of the sidebar.
@@ -321,9 +321,9 @@ export class MenuSelectionDirective {
-
-
-
+
+
+
diff --git a/docs/compodoc/directives/MenuToggleDirective.html b/docs/compodoc/directives/MenuToggleDirective.html
index 6842fe4..303699b 100644
--- a/docs/compodoc/directives/MenuToggleDirective.html
+++ b/docs/compodoc/directives/MenuToggleDirective.html
@@ -8,7 +8,8 @@
-
+
+
@@ -37,7 +38,7 @@
- Directives
- - MenuToggleDirective
+ - MenuToggleDirective
@@ -58,11 +59,12 @@
src/app/shared/_directives/menu-toggle.directive.ts
+
Description
-
Toggle availability of sidebar on menu toggle click.
+ Toggle availability of sidebar on menu toggle click.
@@ -96,7 +98,7 @@
@@ -201,9 +203,7 @@
-
- onMenuToggle
-
+ onMenuToggle
@@ -225,7 +225,7 @@
- Toggle the availability of the sidebar.
+ Toggle the availability of the sidebar.
@@ -312,9 +312,9 @@ export class MenuToggleDirective {
-
-
-
+
+
+
diff --git a/docs/compodoc/directives/PasswordToggleDirective.html b/docs/compodoc/directives/PasswordToggleDirective.html
index e832772..3a1b386 100644
--- a/docs/compodoc/directives/PasswordToggleDirective.html
+++ b/docs/compodoc/directives/PasswordToggleDirective.html
@@ -8,7 +8,8 @@
-
+
+
@@ -37,7 +38,7 @@
- Directives
- - PasswordToggleDirective
+ - PasswordToggleDirective
@@ -58,11 +59,12 @@
src/app/auth/_directives/password-toggle.directive.ts
+
Description
-
Toggle password form field input visibility
+ Toggle password form field input visibility
@@ -96,7 +98,7 @@
@@ -111,10 +113,10 @@
@@ -226,7 +228,7 @@
- The password form field icon id
+ The password form field icon id
@@ -253,7 +255,7 @@
- The password form field id
+ The password form field id
@@ -274,9 +276,7 @@
-
- togglePasswordVisibility
-
+ togglePasswordVisibility
@@ -298,7 +298,7 @@
- Toggle the visibility of the password input field value and accompanying icon.
+ Toggle the visibility of the password input field value and accompanying icon.
@@ -401,9 +401,9 @@ export class PasswordToggleDirective {
-
-
-
+
+
+
diff --git a/docs/compodoc/directives/RouterLinkDirectiveStub.html b/docs/compodoc/directives/RouterLinkDirectiveStub.html
index 15171d6..eb18c95 100644
--- a/docs/compodoc/directives/RouterLinkDirectiveStub.html
+++ b/docs/compodoc/directives/RouterLinkDirectiveStub.html
@@ -8,7 +8,8 @@
-
+
+
@@ -37,7 +38,7 @@
- Directives
- - RouterLinkDirectiveStub
+ - RouterLinkDirectiveStub
@@ -61,6 +62,7 @@
+
Metadata
@@ -88,12 +90,26 @@
+
+
+ Methods
+
+
+
+
+
+ -
+ onClick
+
+
+
+
@@ -104,7 +120,7 @@
-
- routerLink
+ routerLink
@@ -121,7 +137,7 @@
@@ -172,11 +188,6 @@
-
-
-click()
-
-
@@ -190,44 +201,92 @@
-
-
- Properties
-
-
-
+
+ Methods
+
+
+
+
+
+
+
+ onClick
+
+
+
+
+
+
+onClick()
+
+
+
+
+
+ Decorators :
+
+ @HostListener('click')
+
+
+
+
+
+ Defined in src/testing/router-link-directive-stub.ts:13
+
+
+
+
+
+
+
+
+ Returns : void
+
+
+
+
+
+
+
+
+
+
+ Properties
+
+
+
+
+
+
+
+ navigatedTo
+
+
+
+
-
-
-
- navigatedTo
-
-
+ Type : any
+
+
+
+
+
+ Default value : null
- Type : any
-
+ Defined in src/testing/router-link-directive-stub.ts:10
-
-
- Default value : null
-
-
-
-
- Defined in src/testing/router-link-directive-stub.ts:10
-
-
-
-
+
+
@@ -291,9 +350,9 @@ export class RouterLinkDirectiveStub {
-
-
-
+
+
+
diff --git a/docs/compodoc/graph/dependencies.svg b/docs/compodoc/graph/dependencies.svg
index f007e08..c97a1bf 100644
--- a/docs/compodoc/graph/dependencies.svg
+++ b/docs/compodoc/graph/dependencies.svg
@@ -4,813 +4,877 @@
-