From 8489bc375c7e77484ed737368a717e77beadae49 Mon Sep 17 00:00:00 2001 From: DwCay Date: Tue, 12 Jul 2022 19:21:39 +0300 Subject: [PATCH 1/4] =?UTF-8?q?=D0=98=D0=BD=D1=82=D0=B5=D0=B3=D1=80=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D1=8F=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86?= =?UTF-8?q?=D1=8B=20ValidationLog=20=D1=81=20=D1=81=D0=B5=D1=80=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/digitalId/Validate.jsx | 62 +------ src/pages/digitalId/ValidationLog.jsx | 167 +----------------- .../validationlog/ValidateRoadMap.jsx | 15 +- .../validationlog/ValidationSeasonItem.jsx | 10 +- src/store/store.js | 19 ++ src/store/validationLogStore.js | 39 ++++ 6 files changed, 79 insertions(+), 233 deletions(-) create mode 100644 src/store/validationLogStore.js diff --git a/src/pages/digitalId/Validate.jsx b/src/pages/digitalId/Validate.jsx index 6596aff..5153e85 100644 --- a/src/pages/digitalId/Validate.jsx +++ b/src/pages/digitalId/Validate.jsx @@ -1,70 +1,18 @@ import React, { useState } from 'react'; +import {observer} from "mobx-react-lite"; +import {validationLogStore} from "../../store/validationLogStore"; import Sidebar from '../../partials/Sidebar'; import Header from '../../partials/Header'; import ValidateTable from "../../partials/validate/ValidateTable"; import ValidatePanel from "../../partials/validate/ValidatePanel"; import ValidateRoadMap from "../../partials/validationlog/ValidateRoadMap"; import {Link} from "react-router-dom"; -import User06 from "../../images/user-28-06.jpg"; -import User08 from "../../images/user-28-08.jpg"; -import User09 from "../../images/user-28-09.jpg"; -import User05 from "../../images/user-28-05.jpg"; -function Validate () { +const Validate = observer(()=>{ const [sidebarOpen, setSidebarOpen] = useState(false); const [validatePanelOpen, setValidatePanelOpen] = useState(true); - const validateItems = [ - { - id: '40', - name: 'Today', - data: '7234ABC342342352345', - usersImges: [ - { - size: 24, - img: User06, - imgId: "343" - }, - { - size: 24, - img: User08, - imgId: "345" - }, - { - size: 24, - img: User09, - imgId: "321" - }, - { - size: 24, - img: User05, - imgId: "387" - }, - ], - items: [ - { - dataSeason: '7234ABC342342352345', - id: '555', - text: 'Second name for', - checked: true - }, - { - dataSeason: '7234ABC342342352345', - id: '534', - text: 'Gender name for', - checked: true - }, - { - dataSeason: '7234ABC342342352345', - id: '567', - text: 'Document ID name for', - checked: true - }, - ] - }, - ]; - return (
{/* Sidebar */} @@ -110,7 +58,7 @@ function Validate () {

Digital ID validation log ✨

- {validateItems.map(item => { + {validationLogStore.transactionData.map(item => { return })}
@@ -120,6 +68,6 @@ function Validate () { ) -} +}) export default Validate; diff --git a/src/pages/digitalId/ValidationLog.jsx b/src/pages/digitalId/ValidationLog.jsx index 75d24b2..8a17a68 100644 --- a/src/pages/digitalId/ValidationLog.jsx +++ b/src/pages/digitalId/ValidationLog.jsx @@ -1,115 +1,14 @@ -import React, { useState } from 'react'; +import React, {useState} from 'react'; import ValidateRoadMap from "../../partials/validationlog/ValidateRoadMap"; +import {validationLogStore} from "../../store/validationLogStore"; +import {observer} from "mobx-react-lite"; import Sidebar from '../../partials/Sidebar'; import Header from '../../partials/Header'; -import User05 from "../../images/user-28-05.jpg"; -import User08 from "../../images/user-28-08.jpg"; -import User09 from "../../images/user-28-09.jpg"; -import User06 from "../../images/user-28-06.jpg"; -import User03 from "../../images/user-28-03.jpg"; -import User01 from "../../images/user-28-01.jpg"; -function ValidationLog () { +const ValidationLog = observer(()=>{ const [sidebarOpen, setSidebarOpen] = useState(false); - const logItems = [ - { - id: '20', - name: 'Today', - data: '7234ABC342342352345', - usersImges: [ - { - size: 24, - img: User06, - imgId: "249" - }, - { - size: 24, - img: User08, - imgId: "212" - }, - { - size: 24, - img: User09, - imgId: "217" - }, - { - size: 24, - img: User05, - imgId: "276" - }, - ], - items: [ - { - dataSeason: '7234ABC342342352345', - id: '434', - text: 'Second name', - checked: true - }, - { - dataSeason: '7234ABC342342352345', - id: '476', - text: 'First name by', - checked: true - }, - { - dataSeason: '7234ABC342342352345', - id: '422', - text: 'Document name by', - checked: true - }, - ] - }, - { - id: '30', - name: 'Last Week', - data: '7234ABC342342352345', - usersImges: [ - { - size: 24, - img: User06, - imgId: "145" - }, - { - size: 24, - img: User08, - imgId: "182" - }, - { - size: 24, - img: User09, - imgId: "154" - }, - { - size: 24, - img: User05, - imgId: "114" - }, - ], - items: [ - { - dataSeason: '7234ABC342342352345', - id: '654', - text: 'Gender name by', - checked: true - }, - { - dataSeason: '7234ABC342342352345', - id: '617', - text: 'Second name Updated', - checked: false - }, - { - dataSeason: '7234ABC342342352345', - id: '643', - text: 'Gender name by', - checked: true - }, - ] - }, - ] - return (
{/* Sidebar */} @@ -129,61 +28,9 @@ function ValidationLog () {
{/* PostsID */} - {logItems.map(item => { - return + {validationLogStore.transactionData.map(item=>{ + return })} - {/* Post */} -
-
-
-

Even earlier

-
-
-
-
- {/* Avatars */} - -
·
-
-
- {/* List */} -
    - {/* List item */} -
  • -
    - - -

    Product V1 - Early Access

    -
    -
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
    -
  • - {/* List item */} -
  • -
    - -

    Web3 Compatibility

    -
    -
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
    -
  • -
-
-
-
@@ -191,6 +38,6 @@ function ValidationLog () { ) -} +}) export default ValidationLog; diff --git a/src/partials/validationlog/ValidateRoadMap.jsx b/src/partials/validationlog/ValidateRoadMap.jsx index bab0627..fdda6c0 100644 --- a/src/partials/validationlog/ValidateRoadMap.jsx +++ b/src/partials/validationlog/ValidateRoadMap.jsx @@ -1,7 +1,6 @@ import React from "react"; import ValidationSeasonItem from "./ValidationSeasonItem"; -import ValidationUsersImg from "./ValidationUsersImg"; function ValidateRoadMap({ season }) { @@ -9,25 +8,19 @@ function ValidateRoadMap({ season }) {
-

{season.name}

+

{''}

-
+
{/* Avatars */} -
- {season.usersImges.map(pic => { - return - })} -
-
·
{/* List */}
    {/* List item(s) */} - {season.items.map((item, index) => { - return + {season.assets.map((item, index) => { + return })}
diff --git a/src/partials/validationlog/ValidationSeasonItem.jsx b/src/partials/validationlog/ValidationSeasonItem.jsx index 430ca56..d8925d7 100644 --- a/src/partials/validationlog/ValidationSeasonItem.jsx +++ b/src/partials/validationlog/ValidationSeasonItem.jsx @@ -5,21 +5,21 @@ function ValidationSeasonItem({ length, item, index }) {
  • {length-1!==index && } -
    -
    {`0x${item.dataSeason}`}
    +
    {item.transaction_id}
    Transactions ID
    -
    {item.dataSeason}
    +
    {item.value}
    Validated data
    Explore -> diff --git a/src/store/store.js b/src/store/store.js index 92d8de7..c959a32 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -12,12 +12,15 @@ class Store { _userData = {} + _transactionInfo = {} + constructor() { makeAutoObservable(this); this.fetchNodeInfo() reaction(() => this.tokenKey, () => this.fetchNewAccountData()) + reaction(() => this.tokenKey, () => this.fetchTransactionInfo()) }; fetchNewAccountData() { @@ -35,6 +38,14 @@ class Store { .then(()=>this.fetchNewAccountData()) } + fetchTransactionInfo() { + fetchWrapper.getAuth(`http://3.125.47.101/api/account/transactions/b444b7ff3118cf2a30cbd54cfcdb8fd5d805017a?moduleID=1001&assetID=11`, { + networkIdentifier: this.nodeInfo.networkIdentifier, + lastBlockID: this.nodeInfo.lastBlockID + }) + .then((res)=>this.saveInfoTransaction(res)) + } + userDataFetchChange(res) { this._userData = res; } @@ -43,6 +54,10 @@ class Store { return this._userData } + get transactionInfo() { + return this._transactionInfo + } + savePassPhrase(phrase) { this._passPhrase = phrase } @@ -51,6 +66,10 @@ class Store { this._accountData = data; }; + saveInfoTransaction(transaction) { + this._transactionInfo = transaction + } + fetchNodeInfo() { getNodeInfo() .then((info) => this.fetchNodeInfoSuccess(info)) diff --git a/src/store/validationLogStore.js b/src/store/validationLogStore.js new file mode 100644 index 0000000..0cb820e --- /dev/null +++ b/src/store/validationLogStore.js @@ -0,0 +1,39 @@ +import {makeAutoObservable, reaction} from "mobx"; +import {registrationStore} from "./store"; + +const labelMap = { + firstname: 'First name', + secondname: 'Second name', + gender: "Gender", + birthdate: "Birthdate" +}; + +class ValidationLogStore { + _transactionData = []; + + constructor() { + makeAutoObservable(this) + + reaction(() => ({data: registrationStore.transactionInfo}), ({data}) => { + this._transactionData = data.data; + }) + } + + get transactionData() { + return this._transactionData.map(item=>{ + return { + id: item.id, + assets: item.asset.features.map(asset=>{ + return { + transaction_id: item.id, + address: item.asset.recipientAddress, + value: asset.value, + label: labelMap[asset.label], + } + }) + } + }) + } +} + +export const validationLogStore = new ValidationLogStore() From bc364d1b855d1acb8834c65781e63c9803c63aee Mon Sep 17 00:00:00 2001 From: DwCay Date: Wed, 13 Jul 2022 14:30:11 +0300 Subject: [PATCH 2/4] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BD=D0=B5=D0=B9=D0=BC=D0=B8=D0=BD=D0=B3=20?= =?UTF-8?q?=D0=B2=20store=20=D0=B8=20transactionsStore.=20=D0=92=D0=BE?= =?UTF-8?q?=D0=B7=D0=B2=D1=80=D0=B0=D1=89=D0=B5=D0=BD=D1=8B=20=D0=B8=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D0=BA=D0=B8=20=D1=8E=D0=B7=D0=B5=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86?= =?UTF-8?q?=D1=83=20ValidationLog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/digitalId/Validate.jsx | 4 +- src/pages/digitalId/ValidationLog.jsx | 4 +- .../validationlog/ValidateRoadMap.jsx | 11 +++- .../validationlog/ValidationUsersImg.jsx | 5 +- src/store/store.js | 16 +++--- src/store/transactionsStore.js | 51 +++++++++++++++++++ 6 files changed, 75 insertions(+), 16 deletions(-) create mode 100644 src/store/transactionsStore.js diff --git a/src/pages/digitalId/Validate.jsx b/src/pages/digitalId/Validate.jsx index 5153e85..36ead06 100644 --- a/src/pages/digitalId/Validate.jsx +++ b/src/pages/digitalId/Validate.jsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import {observer} from "mobx-react-lite"; -import {validationLogStore} from "../../store/validationLogStore"; +import {transactionsStore} from "../../store/transactionsStore"; import Sidebar from '../../partials/Sidebar'; import Header from '../../partials/Header'; import ValidateTable from "../../partials/validate/ValidateTable"; @@ -58,7 +58,7 @@ const Validate = observer(()=>{

    Digital ID validation log ✨

    - {validationLogStore.transactionData.map(item => { + {transactionsStore.transactionsData.map(item => { return })}
    diff --git a/src/pages/digitalId/ValidationLog.jsx b/src/pages/digitalId/ValidationLog.jsx index 8a17a68..a1190b2 100644 --- a/src/pages/digitalId/ValidationLog.jsx +++ b/src/pages/digitalId/ValidationLog.jsx @@ -1,7 +1,7 @@ import React, {useState} from 'react'; import ValidateRoadMap from "../../partials/validationlog/ValidateRoadMap"; -import {validationLogStore} from "../../store/validationLogStore"; +import {transactionsStore} from "../../store/transactionsStore"; import {observer} from "mobx-react-lite"; import Sidebar from '../../partials/Sidebar'; import Header from '../../partials/Header'; @@ -28,7 +28,7 @@ const ValidationLog = observer(()=>{
    {/* PostsID */} - {validationLogStore.transactionData.map(item=>{ + {transactionsStore.transactionsData.map(item=>{ return })}
    diff --git a/src/partials/validationlog/ValidateRoadMap.jsx b/src/partials/validationlog/ValidateRoadMap.jsx index fdda6c0..c086b80 100644 --- a/src/partials/validationlog/ValidateRoadMap.jsx +++ b/src/partials/validationlog/ValidateRoadMap.jsx @@ -1,6 +1,7 @@ import React from "react"; import ValidationSeasonItem from "./ValidationSeasonItem"; +import ValidationUsersImg from "./ValidationUsersImg"; function ValidateRoadMap({ season }) { @@ -14,13 +15,19 @@ function ValidateRoadMap({ season }) {
    {/* Avatars */} +
    + {season.users_images.map(pic => { + return + })} +
    +
    ·
    {/* List */}
      {/* List item(s) */} - {season.assets.map((item, index) => { - return + {season.transaction.map((item, index) => { + return })}
    diff --git a/src/partials/validationlog/ValidationUsersImg.jsx b/src/partials/validationlog/ValidationUsersImg.jsx index 7f6b941..4b29d26 100644 --- a/src/partials/validationlog/ValidationUsersImg.jsx +++ b/src/partials/validationlog/ValidationUsersImg.jsx @@ -1,9 +1,10 @@ import React from "react"; function ValidationUsersImg({ image }) { + return ( - - {image.img} + + {image.image} ); } diff --git a/src/store/store.js b/src/store/store.js index c959a32..c9a084e 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -12,7 +12,7 @@ class Store { _userData = {} - _transactionInfo = {} + _transactionsInfo = {} constructor() { makeAutoObservable(this); @@ -20,7 +20,7 @@ class Store { this.fetchNodeInfo() reaction(() => this.tokenKey, () => this.fetchNewAccountData()) - reaction(() => this.tokenKey, () => this.fetchTransactionInfo()) + reaction(() => this.tokenKey, () => this.fetchTransactionsInfo()) }; fetchNewAccountData() { @@ -38,12 +38,12 @@ class Store { .then(()=>this.fetchNewAccountData()) } - fetchTransactionInfo() { + fetchTransactionsInfo() { fetchWrapper.getAuth(`http://3.125.47.101/api/account/transactions/b444b7ff3118cf2a30cbd54cfcdb8fd5d805017a?moduleID=1001&assetID=11`, { networkIdentifier: this.nodeInfo.networkIdentifier, lastBlockID: this.nodeInfo.lastBlockID }) - .then((res)=>this.saveInfoTransaction(res)) + .then((res)=>this.saveInfoTransactions(res)) } userDataFetchChange(res) { @@ -54,8 +54,8 @@ class Store { return this._userData } - get transactionInfo() { - return this._transactionInfo + get transactionsInfo() { + return this._transactionsInfo } savePassPhrase(phrase) { @@ -66,8 +66,8 @@ class Store { this._accountData = data; }; - saveInfoTransaction(transaction) { - this._transactionInfo = transaction + saveInfoTransactions(transaction) { + this._transactionsInfo = transaction } fetchNodeInfo() { diff --git a/src/store/transactionsStore.js b/src/store/transactionsStore.js new file mode 100644 index 0000000..a14ad80 --- /dev/null +++ b/src/store/transactionsStore.js @@ -0,0 +1,51 @@ +import {makeAutoObservable, reaction} from "mobx"; +import {registrationStore} from "./store"; +import User05 from "../../src/images/user-28-05.jpg"; +import User08 from "../../src/images/user-28-08.jpg"; +import User09 from "../../src/images/user-28-09.jpg"; +import User06 from "../../src/images/user-28-06.jpg"; + +const labelMap = { + firstname: 'First name', + secondname: 'Second name', + gender: "Gender", + birthdate: "Birthdate" +}; + +const usersImages = [User08,User06,User05,User09]; + +class TransactionsStore { + _transactionsData = []; + + constructor() { + makeAutoObservable(this) + + reaction(() => ({data: registrationStore.transactionsInfo}), ({data}) => { + this._transactionsData = data.data; + }) + } + + get transactionsData() { + return this._transactionsData.map(item=>{ + return { + id: item.id, + users_images: usersImages.map(image=>{ + return { + image: image, + size: 24 + } + }), + transaction: item.asset.features.map(asset=>{ + return { + transaction_id: item.id, + address: item.asset.recipientAddress, + value: asset.value, + label: labelMap[asset.label], + } + }) + } + }) + } +} + +export const transactionsStore = new TransactionsStore() From 5eb4ee16c0f05c51a6e54efba29844f769090fcd Mon Sep 17 00:00:00 2001 From: DwCay Date: Wed, 13 Jul 2022 14:31:27 +0300 Subject: [PATCH 3/4] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=20Vali?= =?UTF-8?q?dationLogStore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/validationLogStore.js | 39 --------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 src/store/validationLogStore.js diff --git a/src/store/validationLogStore.js b/src/store/validationLogStore.js deleted file mode 100644 index 0cb820e..0000000 --- a/src/store/validationLogStore.js +++ /dev/null @@ -1,39 +0,0 @@ -import {makeAutoObservable, reaction} from "mobx"; -import {registrationStore} from "./store"; - -const labelMap = { - firstname: 'First name', - secondname: 'Second name', - gender: "Gender", - birthdate: "Birthdate" -}; - -class ValidationLogStore { - _transactionData = []; - - constructor() { - makeAutoObservable(this) - - reaction(() => ({data: registrationStore.transactionInfo}), ({data}) => { - this._transactionData = data.data; - }) - } - - get transactionData() { - return this._transactionData.map(item=>{ - return { - id: item.id, - assets: item.asset.features.map(asset=>{ - return { - transaction_id: item.id, - address: item.asset.recipientAddress, - value: asset.value, - label: labelMap[asset.label], - } - }) - } - }) - } -} - -export const validationLogStore = new ValidationLogStore() From 9820692cd9ddac1091837e2ad9b81ab851b656d2 Mon Sep 17 00:00:00 2001 From: DwCay Date: Wed, 13 Jul 2022 15:39:20 +0300 Subject: [PATCH 4/4] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=B0=D0=B4=D1=80=D0=B5=D1=81=D1=81=20=D0=B0=D0=BA?= =?UTF-8?q?=D0=BA=D0=B0=D1=83=D0=BD=D1=82=D0=B0=20=D1=81=D0=BE=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D1=88=D0=B8=D0=B2=D1=88=D0=B5=D0=B3=D0=BE=20=D1=82=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D0=B7=D0=B0=D0=BA=D1=86=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/store.js | 6 +++++- src/store/transactionsStore.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/store/store.js b/src/store/store.js index c9a084e..82b1c69 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -39,13 +39,17 @@ class Store { } fetchTransactionsInfo() { - fetchWrapper.getAuth(`http://3.125.47.101/api/account/transactions/b444b7ff3118cf2a30cbd54cfcdb8fd5d805017a?moduleID=1001&assetID=11`, { + fetchWrapper.getAuth(`http://3.125.47.101/api/account/transactions/${this.accountMadeTransaction}?moduleID=1001&assetID=11`, { networkIdentifier: this.nodeInfo.networkIdentifier, lastBlockID: this.nodeInfo.lastBlockID }) .then((res)=>this.saveInfoTransactions(res)) } + get accountMadeTransaction() { + return "b444b7ff3118cf2a30cbd54cfcdb8fd5d805017a" + } + userDataFetchChange(res) { this._userData = res; } diff --git a/src/store/transactionsStore.js b/src/store/transactionsStore.js index a14ad80..e2c6f9a 100644 --- a/src/store/transactionsStore.js +++ b/src/store/transactionsStore.js @@ -38,7 +38,7 @@ class TransactionsStore { transaction: item.asset.features.map(asset=>{ return { transaction_id: item.id, - address: item.asset.recipientAddress, + address: registrationStore.accountMadeTransaction, value: asset.value, label: labelMap[asset.label], }