Compare commits
375 Commits
Author | SHA1 | Date |
---|---|---|
Matthias Kretschmann | de77f693d9 | |
Trent McConaghy | ad08e3bb53 | |
Matthias Kretschmann | 97b3e55bc1 | |
dependabot[bot] | 0948e18c41 | |
Matthias Kretschmann | 15dcc2e31a | |
Matthias Kretschmann | 2e34c0df81 | |
Matthias Kretschmann | cf1038a7fd | |
dependabot[bot] | 3b0a366217 | |
dependabot[bot] | b63a693ed6 | |
Matthias Kretschmann | 468c0204d4 | |
dependabot[bot] | 31185f9c64 | |
Matthias Kretschmann | a4cd995669 | |
Matthias Kretschmann | c3cd566efd | |
dependabot[bot] | ca1e84e3e0 | |
dependabot[bot] | 23a11e39ca | |
dependabot[bot] | f4e0a38520 | |
Matthias Kretschmann | 8699cd7ce9 | |
Matthias Kretschmann | 1bae3ae85a | |
Matthias Kretschmann | 932f6ee1e4 | |
Matthias Kretschmann | d3b35c302f | |
Matthias Kretschmann | b0acdb3473 | |
Matthias Kretschmann | 87dc14f6d9 | |
Matthias Kretschmann | d1d4ab72c6 | |
dependabot[bot] | 626432c6c9 | |
dependabot[bot] | 5b95d0253c | |
dependabot[bot] | 8850b76cf8 | |
dependabot[bot] | 72c513c338 | |
dependabot[bot] | 06f8b88140 | |
dependabot[bot] | 3ce14e8e7b | |
dependabot[bot] | 04598e296e | |
Matthias Kretschmann | 473b0b6e9d | |
Matthias Kretschmann | cb8c7fdaab | |
Matthias Kretschmann | 624ee063b0 | |
Matthias Kretschmann | 6a94339ab6 | |
Matthias Kretschmann | 08803802fa | |
Matthias Kretschmann | b771931e74 | |
Matthias Kretschmann | f5622b92f6 | |
dependabot[bot] | 4696012f06 | |
dependabot[bot] | d8f6c976bf | |
dependabot[bot] | 54ad4798fc | |
dependabot[bot] | 0eee025656 | |
dependabot[bot] | 5a4e272c95 | |
dependabot[bot] | c0ac535814 | |
dependabot[bot] | ba31f967f2 | |
Matthias Kretschmann | 61d0c7328c | |
dependabot[bot] | 8be3572945 | |
Matthias Kretschmann | 19e3b55193 | |
Matthias Kretschmann | c4d71aab53 | |
Matthias Kretschmann | fbe61b006b | |
Matthias Kretschmann | 34e20186c3 | |
dependabot[bot] | f553fcd7e0 | |
dependabot[bot] | 9ade7d25db | |
dependabot[bot] | c8706698ed | |
dependabot[bot] | ea99c045bd | |
Matthias Kretschmann | 75039762e7 | |
dependabot-preview[bot] | bca6d3d0df | |
dependabot-preview[bot] | 016086c727 | |
dependabot-preview[bot] | 735e2c5882 | |
dependabot-preview[bot] | d1a1d5430d | |
dependabot-preview[bot] | 546483b8d0 | |
dependabot-preview[bot] | b4da9f3ebc | |
dependabot-preview[bot] | 75586154d8 | |
dependabot-preview[bot] | 49f76033db | |
dependabot-preview[bot] | 957f9836c4 | |
dependabot-preview[bot] | 1684bf844f | |
dependabot-preview[bot] | 6518b01622 | |
dependabot-preview[bot] | 413ed7e13f | |
dependabot-preview[bot] | be5a32797c | |
dependabot-preview[bot] | d285b1106f | |
dependabot-preview[bot] | d5582e14ce | |
dependabot-preview[bot] | ab7a519c78 | |
dependabot-preview[bot] | cc392edf04 | |
dependabot-preview[bot] | 744bfd67fc | |
dependabot-preview[bot] | cf24217330 | |
dependabot-preview[bot] | fed35cf79b | |
dependabot-preview[bot] | 062a030fb5 | |
dependabot-preview[bot] | bdfe3854d6 | |
dependabot-preview[bot] | 7f8e363840 | |
dependabot-preview[bot] | 772df475cd | |
dependabot-preview[bot] | 12a81c8001 | |
dependabot-preview[bot] | 3f5a4aa4f6 | |
dependabot-preview[bot] | 1aa2afb005 | |
dependabot-preview[bot] | f88d9d556d | |
dependabot-preview[bot] | ee20f6541c | |
dependabot-preview[bot] | e35c3015d5 | |
dependabot-preview[bot] | 99097d91cc | |
dependabot-preview[bot] | 3af9ee9efa | |
dependabot-preview[bot] | 7ba39430c9 | |
dependabot-preview[bot] | 809deeb3a8 | |
dependabot-preview[bot] | 119a1ee672 | |
dependabot-preview[bot] | bacf948f53 | |
dependabot-preview[bot] | 4660175c50 | |
Matthias Kretschmann | 380b57388c | |
Alex Coseru | 197d3a950d | |
alexcos20 | bbeef61afd | |
alexcos20 | 8831c46e39 | |
Matthias Kretschmann | c0effd449f | |
Matthias Kretschmann | 91821e88d4 | |
dependabot-preview[bot] | 6f05baff3a | |
dependabot-preview[bot] | 0abc740ed8 | |
dependabot-preview[bot] | 5eb2b3fde0 | |
dependabot-preview[bot] | a38ecc255d | |
dependabot-preview[bot] | 7e59a1807c | |
dependabot-preview[bot] | 1f9a358451 | |
dependabot-preview[bot] | 006948360f | |
dependabot-preview[bot] | bdab45c565 | |
dependabot-preview[bot] | 62a64f8539 | |
dependabot-preview[bot] | b3fa56c2b2 | |
Matthias Kretschmann | 55d9592565 | |
mihaisc | 5015d26cea | |
mihaisc | a6b0ca4be6 | |
dependabot-preview[bot] | 3c8cbcc22b | |
dependabot-preview[bot] | 3aa79cd7dc | |
dependabot-preview[bot] | 0f55b73dc5 | |
dependabot-preview[bot] | daf39e8ed2 | |
dependabot-preview[bot] | ef013c0d10 | |
dependabot-preview[bot] | 7184a7bb66 | |
mihaisc | 28b213d2fc | |
mihaisc | 55bf9f314f | |
dependabot-preview[bot] | 51b1dd228f | |
dependabot-preview[bot] | 3511bafdf3 | |
Matthias Kretschmann | b93f005154 | |
dependabot-preview[bot] | 7cba1cd148 | |
dependabot-preview[bot] | 876d7c22d3 | |
dependabot-preview[bot] | 87bcba5af7 | |
Matthias Kretschmann | d058fc815d | |
Matthias Kretschmann | d916f0df1e | |
Matthias Kretschmann | 2884015678 | |
Matthias Kretschmann | 7d09350967 | |
Matthias Kretschmann | fe37382833 | |
dependabot-preview[bot] | 0d3bdc7a2c | |
Matthias Kretschmann | 00e2d8acb5 | |
Matthias Kretschmann | b7408a3c9b | |
Matthias Kretschmann | 4ddd607499 | |
Matthias Kretschmann | 5d9fee0e69 | |
dependabot-preview[bot] | 780d9db16e | |
Matthias Kretschmann | 7905a1f8a9 | |
Alex Coseru | 17cdb87b8d | |
dependabot-preview[bot] | 4b3130e0e9 | |
dependabot-preview[bot] | 1014ab02cf | |
dependabot-preview[bot] | cb68e7ef3d | |
dependabot-preview[bot] | cc3bc599b4 | |
dependabot-preview[bot] | 3ce29a59b9 | |
dependabot-preview[bot] | 73ba7d4cdd | |
dependabot-preview[bot] | f431b66a41 | |
dependabot-preview[bot] | 5d1377fa24 | |
dependabot-preview[bot] | cd81fa3d9a | |
dependabot-preview[bot] | c69797cb02 | |
dependabot-preview[bot] | 6d834fb6a6 | |
dependabot-preview[bot] | 0dda840f92 | |
dependabot-preview[bot] | 41600c2f30 | |
alexcos20 | 54f437a6e6 | |
dependabot-preview[bot] | 456e9a6607 | |
dependabot-preview[bot] | 8a48afb535 | |
dependabot-preview[bot] | 0dfaf4c069 | |
dependabot-preview[bot] | 23f956092a | |
dependabot-preview[bot] | 8bed302e9e | |
alexcos20 | f6be84e76f | |
dependabot-preview[bot] | 8284a407f8 | |
dependabot-preview[bot] | 074250e544 | |
dependabot-preview[bot] | 445c86f60d | |
dependabot-preview[bot] | 97fda45977 | |
dependabot-preview[bot] | b97205a0c2 | |
dependabot-preview[bot] | c0e15d5695 | |
dependabot-preview[bot] | 401d8349e6 | |
dependabot-preview[bot] | 9c93c92e10 | |
dependabot-preview[bot] | 8505c1efd0 | |
Matthias Kretschmann | 7b02cbe52f | |
dependabot-preview[bot] | a34c37f212 | |
dependabot-preview[bot] | 98c459241f | |
dependabot-preview[bot] | 6a6688b2e0 | |
dependabot-preview[bot] | d4cb1f78bd | |
Matthias Kretschmann | 13780d6a82 | |
dependabot-preview[bot] | dba1f8f878 | |
dependabot-preview[bot] | 6e12b3f1be | |
dependabot-preview[bot] | 04f5db99f0 | |
dependabot-preview[bot] | ca6ee70da8 | |
dependabot-preview[bot] | 274a9507e3 | |
dependabot-preview[bot] | 2dafe64a00 | |
dependabot-preview[bot] | e8bab5749b | |
Matthias Kretschmann | 3f5def552e | |
dependabot-preview[bot] | 7df95c69ab | |
dependabot-preview[bot] | 024b873614 | |
dependabot-preview[bot] | 9c16ad30e1 | |
dependabot-preview[bot] | 8fb906b168 | |
dependabot-preview[bot] | 20cc62b2fa | |
alexcos20 | 99fa2e965b | |
dependabot-preview[bot] | c82f31dc2d | |
dependabot-preview[bot] | d11dc641cf | |
dependabot-preview[bot] | 8e547f9b9d | |
dependabot-preview[bot] | 112f2ba00c | |
dependabot-preview[bot] | d5ff3c1df2 | |
dependabot-preview[bot] | f7d4a5a994 | |
dependabot-preview[bot] | abab1b1ffb | |
dependabot-preview[bot] | c1296ed172 | |
dependabot-preview[bot] | c00911c886 | |
dependabot-preview[bot] | c539db7141 | |
dependabot-preview[bot] | af5dd6339a | |
dependabot-preview[bot] | f70612300d | |
dependabot-preview[bot] | cd9364167d | |
dependabot-preview[bot] | 24316aa19d | |
dependabot-preview[bot] | dd6f1537c9 | |
Matthias Kretschmann | c642fa0ee7 | |
dependabot-preview[bot] | 8e06fc63e3 | |
dependabot-preview[bot] | c64adf2400 | |
dependabot-preview[bot] | 32a8086753 | |
dependabot-preview[bot] | d2e250149d | |
dependabot-preview[bot] | d5c26544ef | |
dependabot-preview[bot] | 93db50886e | |
dependabot-preview[bot] | 5e6b56112f | |
dependabot-preview[bot] | 812812d413 | |
dependabot-preview[bot] | 0d69433ad2 | |
dependabot-preview[bot] | 874ae1d058 | |
dependabot-preview[bot] | 1193b62607 | |
dependabot-preview[bot] | 1d5a17142e | |
dependabot-preview[bot] | 78f3358672 | |
Matthias Kretschmann | c34797e9d8 | |
Matthias Kretschmann | aef84642af | |
dependabot-preview[bot] | dbc8baf5ca | |
Matthias Kretschmann | 366c49537e | |
Matthias Kretschmann | 59aa6e3cc8 | |
dependabot-preview[bot] | 881c924afd | |
dependabot-preview[bot] | 41968bf4b6 | |
dependabot-preview[bot] | 906a141504 | |
alexcos20 | 38691369d4 | |
alexcos20 | 23aced5f9c | |
alexcos20 | 3f7e8f9f18 | |
alexcos20 | e7cd6105bf | |
mihaisc | aff63caf9a | |
mihaisc | b5eb2e2ddf | |
mihaisc | 553535c578 | |
mihaisc | 1b20b12cce | |
mihaisc | d234717a6a | |
Matthias Kretschmann | f63077181e | |
Matthias Kretschmann | 5f8b3d7b69 | |
Matthias Kretschmann | 192c54134a | |
Matthias Kretschmann | b7c6543fbe | |
Matthias Kretschmann | 94fa7701eb | |
Matthias Kretschmann | 5ced0c4dc8 | |
dependabot[bot] | f5728e732b | |
Matthias Kretschmann | 6bacf8936d | |
Matthias Kretschmann | 1e0f549e8f | |
dependabot[bot] | 70ba8ded20 | |
dependabot[bot] | a0df037d37 | |
Matthias Kretschmann | f143a59b0b | |
Matthias Kretschmann | 456ad15ddf | |
Matthias Kretschmann | c669089d3b | |
Matthias Kretschmann | e81c196d40 | |
Matthias Kretschmann | 57f2022f37 | |
Matthias Kretschmann | ba2de2e69c | |
Matthias Kretschmann | 3e814b98a7 | |
Matthias Kretschmann | a54bcc1afb | |
Matthias Kretschmann | 65b72e597d | |
Matthias Kretschmann | 004f946d99 | |
Matthias Kretschmann | 8089a7aa3e | |
Matthias Kretschmann | 9cbedb8f87 | |
Matthias Kretschmann | b9f83021c7 | |
Matthias Kretschmann | 44d0c25e0b | |
Matthias Kretschmann | ebdbb04bd9 | |
Matthias Kretschmann | 37296c502e | |
Matthias Kretschmann | d80530c315 | |
Matthias Kretschmann | c5ea3b7c8a | |
Matthias Kretschmann | 77e2dd49c5 | |
Matthias Kretschmann | 5ba5cd9e20 | |
Matthias Kretschmann | e9e5dd9049 | |
Matthias Kretschmann | c98fc44d35 | |
Matthias Kretschmann | 1355be96c8 | |
Matthias Kretschmann | 3d9ed9d1c3 | |
Matthias Kretschmann | f8dfaa438c | |
Matthias Kretschmann | 70a3339f8b | |
Matthias Kretschmann | 1b07944e02 | |
Matthias Kretschmann | 7f9daa0d82 | |
Matthias Kretschmann | 3df046bbea | |
Matthias Kretschmann | a8c695e16f | |
Matthias Kretschmann | ed2812d6f4 | |
Matthias Kretschmann | 2868076da2 | |
Matthias Kretschmann | b652d243d4 | |
Matthias Kretschmann | c0a79b3188 | |
Matthias Kretschmann | 670f717b37 | |
Matthias Kretschmann | dcc5642aa2 | |
Matthias Kretschmann | 50d077a887 | |
Matthias Kretschmann | 5800027cbf | |
Matthias Kretschmann | f7a5de7b5c | |
Matthias Kretschmann | 954c6d2d46 | |
Matthias Kretschmann | 8c3262c1d9 | |
Matthias Kretschmann | b4248b7693 | |
Matthias Kretschmann | 831e3d1aa1 | |
Matthias Kretschmann | 7eea449a5d | |
Matthias Kretschmann | 417abf8988 | |
Matthias Kretschmann | ed33f690f9 | |
Matthias Kretschmann | 6282dbb5fc | |
Matthias Kretschmann | ac5c66f0e9 | |
Matthias Kretschmann | 985803d43e | |
Matthias Kretschmann | c3c8ca5368 | |
Matthias Kretschmann | a81838c8e7 | |
Matthias Kretschmann | b02cda043c | |
Matthias Kretschmann | 8ca727fffc | |
Matthias Kretschmann | c8a46a5316 | |
Matthias Kretschmann | 345bbb0dfb | |
Matthias Kretschmann | afd4ec991f | |
Matthias Kretschmann | 826cb07953 | |
Matthias Kretschmann | ccdef8143e | |
Matthias Kretschmann | 4741e1260d | |
Matthias Kretschmann | 7d60a85885 | |
Matthias Kretschmann | 7c88cb4fea | |
Matthias Kretschmann | da9237ea46 | |
Matthias Kretschmann | 532dee9845 | |
Matthias Kretschmann | ced3f716da | |
Matthias Kretschmann | 9daa49a085 | |
Matthias Kretschmann | e417c8299a | |
Matthias Kretschmann | aec1f78257 | |
Matthias Kretschmann | fe4f2233f0 | |
Matthias Kretschmann | 3fb7358b77 | |
Matthias Kretschmann | f14413e34f | |
Matthias Kretschmann | 1bf47ce128 | |
Matthias Kretschmann | ae34031e9f | |
Alex Coseru | a8cde6499b | |
Matthias Kretschmann | 4319115e00 | |
Matthias Kretschmann | 77deaf063e | |
Matthias Kretschmann | 28c1d2e331 | |
Matthias Kretschmann | 70b3f8c8bd | |
Matthias Kretschmann | 9226bf2799 | |
Matthias Kretschmann | 78d4c8b874 | |
Matthias Kretschmann | 8aadcb9d97 | |
Matthias Kretschmann | e06c337ba1 | |
Matthias Kretschmann | 54a4ba5c68 | |
Matthias Kretschmann | 4fb47c063b | |
Matthias Kretschmann | 59ede97931 | |
Matthias Kretschmann | 74cb19f5ef | |
Matthias Kretschmann | 4ead855731 | |
Matthias Kretschmann | af8df224cb | |
Matthias Kretschmann | dc0f5c803d | |
Matthias Kretschmann | aef52f61c0 | |
Matthias Kretschmann | 4920bae0fa | |
Matthias Kretschmann | 8b31257837 | |
Matthias Kretschmann | e3be76fb95 | |
Matthias Kretschmann | c63325bdf2 | |
Matthias Kretschmann | 60a570892b | |
Matthias Kretschmann | 483cc35de3 | |
Matthias Kretschmann | 1813207772 | |
Matthias Kretschmann | 752498d6b3 | |
Matthias Kretschmann | c6f5f8561c | |
Matthias Kretschmann | ba3704dcce | |
Matthias Kretschmann | 6d4b6b77c2 | |
Matthias Kretschmann | 302986d63b | |
Matthias Kretschmann | 84eff3f3b4 | |
Matthias Kretschmann | 8b612ea4a2 | |
Matthias Kretschmann | 725215b6ee | |
Matthias Kretschmann | 3d1d81ffe9 | |
Matthias Kretschmann | be7020bceb | |
Matthias Kretschmann | e512ed4471 | |
Matthias Kretschmann | da357b82c2 | |
Matthias Kretschmann | 2f741d300e | |
Matthias Kretschmann | 839140d906 | |
Matthias Kretschmann | a2a6720fd8 | |
Matthias Kretschmann | a258f6b94b | |
Matthias Kretschmann | 955608202d | |
Matthias Kretschmann | a2f075171c | |
Matthias Kretschmann | 8127174fbd | |
Matthias Kretschmann | 6db965b79a | |
Matthias Kretschmann | 5002effbfe | |
Matthias Kretschmann | b6d255bbad | |
Matthias Kretschmann | 9c38c82496 | |
Matthias Kretschmann | 3b889725f1 | |
Matthias Kretschmann | 1c59d49d5d | |
Matthias Kretschmann | 414dcd455a | |
Matthias Kretschmann | 85ffae37d1 | |
Matthias Kretschmann | 475cade27f | |
Matthias Kretschmann | 10b662343f | |
Alex Coseru | 2c99d6f9e6 | |
Alex Coseru | 5d880778ba | |
Matthias Kretschmann | e007ab2090 | |
Matthias Kretschmann | 5b0c3486dd | |
Matthias Kretschmann | cf783e66b8 | |
Matthias Kretschmann | a7209f690d |
|
@ -1,12 +0,0 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{json,yml,yaml,md}]
|
||||
indent_size = 2
|
|
@ -11,10 +11,11 @@
|
|||
"extends": [
|
||||
"oceanprotocol",
|
||||
"oceanprotocol/react",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:prettier/recommended",
|
||||
"prettier/react",
|
||||
"prettier/standard",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier/@typescript-eslint",
|
||||
"plugin:cypress/recommended"
|
||||
],
|
||||
|
@ -30,12 +31,13 @@
|
|||
"env": {
|
||||
"es6": true,
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"jest": true,
|
||||
"cypress/globals": true
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "16.8"
|
||||
"version": "16.10"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: "/server"
|
||||
schedule:
|
||||
interval: weekly
|
||||
time: '03:00'
|
||||
timezone: Europe/Berlin
|
||||
- package-ecosystem: npm
|
||||
directory: "/client"
|
||||
schedule:
|
||||
interval: weekly
|
||||
time: '03:00'
|
||||
timezone: Europe/Berlin
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
time: '03:00'
|
||||
timezone: Europe/Berlin
|
|
@ -26,4 +26,5 @@ yarn-error.log*
|
|||
cypress/screenshots
|
||||
cypress/videos
|
||||
cypress/fixtures/did.txt
|
||||
cypress/fixtures/did-ipfs.txt
|
||||
artifacts
|
||||
|
|
14
.prettierrc
14
.prettierrc
|
@ -1,5 +1,15 @@
|
|||
{
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none"
|
||||
}
|
||||
"trailingComma": "none",
|
||||
"tabWidth": 4,
|
||||
"endOfLine": "lf",
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.{json,yml,yaml,md}"],
|
||||
"options": {
|
||||
"tabWidth": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
11
.stylelintrc
11
.stylelintrc
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"extends": [
|
||||
"stylelint-config-bigchaindb",
|
||||
"stylelint-config-css-modules",
|
||||
"./node_modules/prettier-stylelint/config.js"
|
||||
],
|
||||
"syntax": "scss",
|
||||
"rules": {
|
||||
"no-descending-specificity": null
|
||||
}
|
||||
}
|
32
.travis.yml
32
.travis.yml
|
@ -2,7 +2,7 @@ dist: xenial
|
|||
sudo: required
|
||||
language: node_js
|
||||
node_js:
|
||||
- '11'
|
||||
- '12'
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
@ -26,17 +26,22 @@ env:
|
|||
- REACT_APP_SECRET_STORE_URI="http://localhost:12001"
|
||||
- REACT_APP_FAUCET_URI="http://localhost:3001"
|
||||
- REACT_APP_BRIZO_ADDRESS="0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0"
|
||||
|
||||
# IPFS client & server config
|
||||
- REACT_APP_IPFS_GATEWAY_URI="https://ipfs.oceanprotocol.com"
|
||||
- REACT_APP_IPFS_NODE_URI="https://ipfs.oceanprotocol.com:443"
|
||||
- IPFS_GATEWAY_URI="https://ipfs.oceanprotocol.com"
|
||||
|
||||
# start Barge with these versions
|
||||
- BRIZO_VERSION=v0.4.2
|
||||
- AQUARIUS_VERSION=v0.3.8
|
||||
- KEEPER_VERSION=v0.11.1
|
||||
- EVENTS_HANDLER_VERSION=v0.1.2
|
||||
- BRIZO_VERSION=v0.9.3
|
||||
- AQUARIUS_VERSION=v1.0.7
|
||||
- KEEPER_VERSION=v0.13.2
|
||||
- EVENTS_HANDLER_VERSION=v0.4.5
|
||||
- KEEPER_OWNER_ROLE_ADDRESS="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260"
|
||||
- FAUCET_TIMESPAN=0
|
||||
|
||||
before_install:
|
||||
- npm install -g npm
|
||||
- npm install -g codacy-coverage
|
||||
# Fixes an issue where the max file watch count is exceeded, triggering ENOSPC
|
||||
# https://stackoverflow.com/questions/22475849/node-js-error-enospc#32600959
|
||||
- echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
|
||||
|
@ -55,18 +60,15 @@ script:
|
|||
# executing `npm test` scripts individually here, so first one failing will exit the build
|
||||
- npm run lint || travis_terminate 1
|
||||
- ./scripts/keeper.sh
|
||||
- ./scripts/test.sh || travis_terminate 1
|
||||
- ./scripts/coverage.sh
|
||||
- ./scripts/test.sh
|
||||
# Pipe the coverage data to Code Climate
|
||||
- ./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.client.json client/coverage/lcov.info
|
||||
- ./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.server.json server/coverage/lcov.info
|
||||
- ./cc-test-reporter sum-coverage coverage/codeclimate.*.json -p 2
|
||||
- if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter upload-coverage; fi
|
||||
- npm run test:e2e || travis_terminate 1
|
||||
- ./scripts/build.sh
|
||||
|
||||
# Pipe the coverage data to Code Climate
|
||||
after_script:
|
||||
- ./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.client.json client/coverage/lcov.info # Format client coverage
|
||||
- ./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.server.json server/coverage/lcov.info # Format server coverage
|
||||
- ./cc-test-reporter sum-coverage coverage/codeclimate.*.json -p 2 # Sum both coverage parts into coverage/codeclimate.json
|
||||
- if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter upload-coverage; fi # Upload coverage/codeclimate.json
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
|
|
240
CHANGELOG.md
240
CHANGELOG.md
|
@ -4,6 +4,188 @@ All notable changes to this project will be documented in this file. Dates are d
|
|||
|
||||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||
|
||||
#### [v2.4.1](https://github.com/oceanprotocol/commons/compare/v2.4.0...v2.4.1)
|
||||
|
||||
> 19 May 2020
|
||||
|
||||
- fix history [`#282`](https://github.com/oceanprotocol/commons/pull/282)
|
||||
|
||||
#### [v2.4.0](https://github.com/oceanprotocol/commons/compare/v2.3.1...v2.4.0)
|
||||
|
||||
> 19 May 2020
|
||||
|
||||
- Feature/compute [`#225`](https://github.com/oceanprotocol/commons/pull/225)
|
||||
- remove stylelint & codacy [`#270`](https://github.com/oceanprotocol/commons/pull/270)
|
||||
- Bump typescript from 3.8.3 to 3.9.2 in /client [`#256`](https://github.com/oceanprotocol/commons/pull/256)
|
||||
- Bump @sindresorhus/slugify from 0.11.0 to 1.0.0 in /client [`#255`](https://github.com/oceanprotocol/commons/pull/255)
|
||||
- Bump cypress from 4.2.0 to 4.5.0 [`#250`](https://github.com/oceanprotocol/commons/pull/250)
|
||||
- Bump @types/jest from 25.1.4 to 25.2.2 in /client [`#240`](https://github.com/oceanprotocol/commons/pull/240)
|
||||
- Bump @typescript-eslint/eslint-plugin from 2.24.0 to 2.33.0 [`#231`](https://github.com/oceanprotocol/commons/pull/231)
|
||||
- Bump start-server-and-test from 1.10.10 to 1.11.0 [`#228`](https://github.com/oceanprotocol/commons/pull/228)
|
||||
- [Security] Bump handlebars from 4.5.3 to 4.7.6 [`#227`](https://github.com/oceanprotocol/commons/pull/227)
|
||||
- Bump release-it from 13.1.1 to 13.6.0 [`#226`](https://github.com/oceanprotocol/commons/pull/226)
|
||||
- bump to squid-js v2.2.0 [`91821e8`](https://github.com/oceanprotocol/commons/commit/91821e88d4e4ff1bb6814338b3d9fee4746fd9a8)
|
||||
- Release 2.4.0 [`c0effd4`](https://github.com/oceanprotocol/commons/commit/c0effd449f7cc01cf043ab924bb8040d0db55b9b)
|
||||
- Merge pull request #281 from oceanprotocol/dependabot/npm_and_yarn/client/react-router-dom-5.2.0 [`6f05baf`](https://github.com/oceanprotocol/commons/commit/6f05baff3af9fa7490100b79b2978ed56ece02f4)
|
||||
|
||||
#### [v2.3.1](https://github.com/oceanprotocol/commons/compare/v2.3.0...v2.3.1)
|
||||
|
||||
> 20 March 2020
|
||||
|
||||
- package updates [`#223`](https://github.com/oceanprotocol/commons/pull/223)
|
||||
- Bump acorn from 5.7.3 to 5.7.4 in /server [`#222`](https://github.com/oceanprotocol/commons/pull/222)
|
||||
- Bump acorn from 5.7.3 to 5.7.4 in /client [`#221`](https://github.com/oceanprotocol/commons/pull/221)
|
||||
- Bump acorn from 7.1.0 to 7.1.1 [`#220`](https://github.com/oceanprotocol/commons/pull/220)
|
||||
- more package updates [`192c541`](https://github.com/oceanprotocol/commons/commit/192c54134ab7e26b85ee09ad94de01cfa8efc514)
|
||||
- Release 2.3.1 [`f630771`](https://github.com/oceanprotocol/commons/commit/f63077181e8094546d68ee66dc8f6d3bd33c5df6)
|
||||
- lint fixes [`b7c6543`](https://github.com/oceanprotocol/commons/commit/b7c6543fbefb6b5b701d3e879bcbd79e09255a7b)
|
||||
|
||||
#### [v2.3.0](https://github.com/oceanprotocol/commons/compare/v2.2.0...v2.3.0)
|
||||
|
||||
> 20 February 2020
|
||||
|
||||
- bump to squid.js v2 beta [`#218`](https://github.com/oceanprotocol/commons/pull/218)
|
||||
- Release 2.3.0 [`f143a59`](https://github.com/oceanprotocol/commons/commit/f143a59b0b3f911bffdc9535ad4fe9cfd345864d)
|
||||
- update ocean.assets methods [`c669089`](https://github.com/oceanprotocol/commons/commit/c669089d3b2be3d304e1ef8ed1b6827c0cb75ec8)
|
||||
|
||||
#### [v2.2.0](https://github.com/oceanprotocol/commons/compare/v2.1.0...v2.2.0)
|
||||
|
||||
> 1 February 2020
|
||||
|
||||
- bump to react-scripts v3.3 [`#209`](https://github.com/oceanprotocol/commons/pull/209)
|
||||
- package updates [`65b72e5`](https://github.com/oceanprotocol/commons/commit/65b72e597d16f8660f74b0b3a491aba723488a56)
|
||||
- fix Travis [`3e814b9`](https://github.com/oceanprotocol/commons/commit/3e814b98a7f990cfee6b910f57eb02cdd1a767f1)
|
||||
- package updates [`8089a7a`](https://github.com/oceanprotocol/commons/commit/8089a7aa3e4504e1defb3a6809e4d8b4c2a823fb)
|
||||
|
||||
#### [v2.1.0](https://github.com/oceanprotocol/commons/compare/v2.1.0-beta.0...v2.1.0)
|
||||
|
||||
> 23 January 2020
|
||||
|
||||
- Fix search code duplication [`#216`](https://github.com/oceanprotocol/commons/pull/216)
|
||||
- bump to keeper-contracts v0.13 [`#210`](https://github.com/oceanprotocol/commons/pull/210)
|
||||
- more additionalInformation checks [`#213`](https://github.com/oceanprotocol/commons/pull/213)
|
||||
- remove editorconfig [`#211`](https://github.com/oceanprotocol/commons/pull/211)
|
||||
- bump to keeper-contracts v0.13.0 [`5ba5cd9`](https://github.com/oceanprotocol/commons/commit/5ba5cd9e20f7bc7ad7aebeb4b9c54f0aea549786)
|
||||
- fix code duplication [`c5ea3b7`](https://github.com/oceanprotocol/commons/commit/c5ea3b7c8a989b7c9239cc4292de53680b36c06b)
|
||||
- bump all components [`37296c5`](https://github.com/oceanprotocol/commons/commit/37296c502e24a1e0aedc021bfa666dd33dce323d)
|
||||
|
||||
#### [v2.1.0-beta.0](https://github.com/oceanprotocol/commons/compare/v2.0.1...v2.1.0-beta.0)
|
||||
|
||||
> 17 December 2019
|
||||
|
||||
- bump to keeper-contracts v0.13.0 [`c4219bf`](https://github.com/oceanprotocol/commons/commit/c4219bf1a839e88024c3b7a87f95833b40769d58)
|
||||
- Release 2.1.0-beta.0 [`64eb7ab`](https://github.com/oceanprotocol/commons/commit/64eb7ab3f2dbd3f5b9736cab67bad4f960c914ff)
|
||||
|
||||
#### [v2.0.1](https://github.com/oceanprotocol/commons/compare/v2.0.0...v2.0.1)
|
||||
|
||||
> 7 January 2020
|
||||
|
||||
- more additionalInformation checks [`#213`](https://github.com/oceanprotocol/commons/pull/213)
|
||||
- remove editorconfig [`#211`](https://github.com/oceanprotocol/commons/pull/211)
|
||||
- remove editorconfig, define all styling in prettierrc [`f8dfaa4`](https://github.com/oceanprotocol/commons/commit/f8dfaa438c42e9d6c25ae9ac096129da95e431c3)
|
||||
- Release 2.0.1 [`e9e5dd9`](https://github.com/oceanprotocol/commons/commit/e9e5dd9049bd60041d1483f102fdd6749b5a9b70)
|
||||
|
||||
#### [v2.0.0](https://github.com/oceanprotocol/commons/compare/v2.0.0-beta.3...v2.0.0)
|
||||
|
||||
> 9 December 2019
|
||||
|
||||
- Migrate to new v2 DDO structure [`#207`](https://github.com/oceanprotocol/commons/pull/207)
|
||||
- bump dependencies [`a8c695e`](https://github.com/oceanprotocol/commons/commit/a8c695e16f07b603250aa0eae5aa64d6275072b6)
|
||||
- test and package fixes [`3df046b`](https://github.com/oceanprotocol/commons/commit/3df046bbea14c0d0b4817976b8496c5af365bc0d)
|
||||
- Release 2.0.0 [`70a3339`](https://github.com/oceanprotocol/commons/commit/70a3339f8b0fdbabad1475659639f145ec68ed6c)
|
||||
|
||||
#### [v2.0.0-beta.3](https://github.com/oceanprotocol/commons/compare/v2.0.0-beta.2...v2.0.0-beta.3)
|
||||
|
||||
> 22 November 2019
|
||||
|
||||
- bump web3 packages [`8c3262c`](https://github.com/oceanprotocol/commons/commit/8c3262c1d91727dcb514ff049d8db5f48e812fed)
|
||||
- bump packages [`5800027`](https://github.com/oceanprotocol/commons/commit/5800027cbf4461cb274ce182e3350e3a1c4b708c)
|
||||
- update to new DDO structure [`985803d`](https://github.com/oceanprotocol/commons/commit/985803d43e4a3d729d90196f260b128bf2e37f63)
|
||||
|
||||
#### [v2.0.0-beta.2](https://github.com/oceanprotocol/commons/compare/v2.0.0-beta.1...v2.0.0-beta.2)
|
||||
|
||||
> 15 November 2019
|
||||
|
||||
- bump packages [`428532e`](https://github.com/oceanprotocol/commons/commit/428532e2c624fed19bae342b40fdb0f5d9a403d3)
|
||||
- Release 2.0.0-beta.2 [`9f55d0a`](https://github.com/oceanprotocol/commons/commit/9f55d0a69577ee64fe8fd6ce9889e31f90fd1562)
|
||||
- bump squid-js [`b75af1b`](https://github.com/oceanprotocol/commons/commit/b75af1bae3f05006ea557c6de05dfe3ddea555eb)
|
||||
|
||||
#### [v2.0.0-beta.1](https://github.com/oceanprotocol/commons/compare/v2.0.0-beta.0...v2.0.0-beta.1)
|
||||
|
||||
> 14 November 2019
|
||||
|
||||
- bump web3 packages [`13a8bf8`](https://github.com/oceanprotocol/commons/commit/13a8bf86a56d3bddca44aa505a27e95507069238)
|
||||
- Release 2.0.0-beta.1 [`cf9d65d`](https://github.com/oceanprotocol/commons/commit/cf9d65da3f353db60da331f8d553e3e19f849d15)
|
||||
|
||||
#### [v2.0.0-beta.0](https://github.com/oceanprotocol/commons/compare/v1.3.2...v2.0.0-beta.0)
|
||||
|
||||
> 14 November 2019
|
||||
|
||||
- update to new DDO structure [`e34dde1`](https://github.com/oceanprotocol/commons/commit/e34dde1a111d00943dc68d32c04b8fa230996d6d)
|
||||
- Release 2.0.0-beta.0 [`0136695`](https://github.com/oceanprotocol/commons/commit/0136695051fe9f753946f1b7de4a55264e3cb174)
|
||||
- contentLength as string [`3d9935b`](https://github.com/oceanprotocol/commons/commit/3d9935b46553143ed1fad6ee6e6b80c23ca6e59e)
|
||||
|
||||
#### [v1.3.2](https://github.com/oceanprotocol/commons/compare/v1.3.1...v1.3.2)
|
||||
|
||||
> 22 November 2019
|
||||
|
||||
- Release 1.3.2 [`b02cda0`](https://github.com/oceanprotocol/commons/commit/b02cda043c33c00174e4e4f3ec56e7d0aa5386da)
|
||||
- bump to squid-js v0.8.3 [`8ca727f`](https://github.com/oceanprotocol/commons/commit/8ca727fffc2cc137b978b7d65ed586da405b015b)
|
||||
|
||||
#### [v1.3.1](https://github.com/oceanprotocol/commons/compare/v1.3.0...v1.3.1)
|
||||
|
||||
> 7 November 2019
|
||||
|
||||
- Bump squid [`#206`](https://github.com/oceanprotocol/commons/pull/206)
|
||||
- bump squid [`ccdef81`](https://github.com/oceanprotocol/commons/commit/ccdef8143ea2f6062c4ffbe65451fdce7c5c40e3)
|
||||
- downgrade @typescript-eslint packages [`afd4ec9`](https://github.com/oceanprotocol/commons/commit/afd4ec991f384596d26e63f2dcb710eda648457e)
|
||||
- Release 1.3.1 [`c8a46a5`](https://github.com/oceanprotocol/commons/commit/c8a46a5316c811766907a0b5866989e750b2ff0a)
|
||||
|
||||
#### [v1.3.0](https://github.com/oceanprotocol/commons/compare/v1.2.2...v1.3.0)
|
||||
|
||||
> 1 November 2019
|
||||
|
||||
- bump packages [`#204`](https://github.com/oceanprotocol/commons/pull/204)
|
||||
- lock to react-scripts 3.0.1 [`da9237e`](https://github.com/oceanprotocol/commons/commit/da9237ea46fd8bc5af26b168bc9a1cd1708fe122)
|
||||
- web3 1.2.2 & truffle-hd-wallet updates, simplify types [`aec1f78`](https://github.com/oceanprotocol/commons/commit/aec1f782574077510fcad323e87e6c72b3cf039a)
|
||||
- more test fixes [`fe4f223`](https://github.com/oceanprotocol/commons/commit/fe4f2233f09240c63351f03209d1588fcb7b0dcb)
|
||||
|
||||
#### [v1.2.2](https://github.com/oceanprotocol/commons/compare/v1.2.1...v1.2.2)
|
||||
|
||||
> 24 October 2019
|
||||
|
||||
- IPFS fixes [`#203`](https://github.com/oceanprotocol/commons/pull/203)
|
||||
- stream files when adding [`77deaf0`](https://github.com/oceanprotocol/commons/commit/77deaf063e2ef3c6650fe7238acae3749bea2a1b)
|
||||
- Release 1.2.2 [`ae34031`](https://github.com/oceanprotocol/commons/commit/ae34031e9f2cd1a6aea801d50149156baeb41609)
|
||||
- lazy load IPFS component [`4319115`](https://github.com/oceanprotocol/commons/commit/4319115e0015e888587f2d6538e1301936385137)
|
||||
|
||||
#### [v1.2.1](https://github.com/oceanprotocol/commons/compare/v1.2.0...v1.2.1)
|
||||
|
||||
> 15 October 2019
|
||||
|
||||
- package fixes [`78d4c8b`](https://github.com/oceanprotocol/commons/commit/78d4c8b874ac1764c219a80231c6d06d02539ff7)
|
||||
- hotfix for Docker build [`8aadcb9`](https://github.com/oceanprotocol/commons/commit/8aadcb9d97f3f6b4b8344718d4f5bd604de0ae39)
|
||||
- Docker tweaks [`9226bf2`](https://github.com/oceanprotocol/commons/commit/9226bf2799b7c85a0c85e42c537cc53de9eabead)
|
||||
|
||||
#### [v1.2.0](https://github.com/oceanprotocol/commons/compare/v1.1.4...v1.2.0)
|
||||
|
||||
> 14 October 2019
|
||||
|
||||
- Add files to IPFS during publish flow [`#191`](https://github.com/oceanprotocol/commons/pull/191)
|
||||
- working prototype of adding files to IPFS during publish flow [`1c59d49`](https://github.com/oceanprotocol/commons/commit/1c59d49d5dddcf28ed015ede4a132e6498e91711)
|
||||
- new client package-lock [`725215b`](https://github.com/oceanprotocol/commons/commit/725215b6ee0b065855f55b7124340abf63a0b357)
|
||||
- bump IPFS packages [`af8df22`](https://github.com/oceanprotocol/commons/commit/af8df224cb08e052605090f96c9a730f672a6a47)
|
||||
|
||||
#### [v1.1.4](https://github.com/oceanprotocol/commons/compare/v1.1.3...v1.1.4)
|
||||
|
||||
> 14 October 2019
|
||||
|
||||
- Faucet route refactor [`#202`](https://github.com/oceanprotocol/commons/pull/202)
|
||||
- Put Channels behind feature switch [`#201`](https://github.com/oceanprotocol/commons/pull/201)
|
||||
- put channels behind feature switch [`a7209f6`](https://github.com/oceanprotocol/commons/commit/a7209f690d925d74c57b8c61498d3cea522d8f70)
|
||||
- more dynamic intro text [`e007ab2`](https://github.com/oceanprotocol/commons/commit/e007ab20901e2155bd891fd77e2d1aa98daee5f9)
|
||||
- Release 1.1.4 [`10b6623`](https://github.com/oceanprotocol/commons/commit/10b662343faa4a27bc8259f1406cf622c2c8ac67)
|
||||
|
||||
#### [v1.1.3](https://github.com/oceanprotocol/commons/compare/v1.1.2...v1.1.3)
|
||||
|
||||
> 8 October 2019
|
||||
|
@ -12,7 +194,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|||
- added token faucet functionality [`#199`](https://github.com/oceanprotocol/commons/pull/199)
|
||||
- prettier [`3235dc1`](https://github.com/oceanprotocol/commons/commit/3235dc1d5e24f314e6d9b2886d709eadc25913df)
|
||||
- - increased token amount given [`aeb24aa`](https://github.com/oceanprotocol/commons/commit/aeb24aadda30934785436a0501d57e71a69f2708)
|
||||
- fixed coded ui tests [`d7e93d1`](https://github.com/oceanprotocol/commons/commit/d7e93d116c54b33e782a9b649fe5b3c8f9e5bd10)
|
||||
- Release 1.1.3 [`8f0988e`](https://github.com/oceanprotocol/commons/commit/8f0988e1b0978dc58a235edbd70bf742cb41e511)
|
||||
|
||||
#### [v1.1.2](https://github.com/oceanprotocol/commons/compare/v1.1.1...v1.1.2)
|
||||
|
||||
|
@ -109,9 +291,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|||
- Connect to pacific [`#167`](https://github.com/oceanprotocol/commons/pull/167)
|
||||
- Cypress cleanup & fixes [`#165`](https://github.com/oceanprotocol/commons/pull/165)
|
||||
- End-to-end testing setup with Cypress [`#134`](https://github.com/oceanprotocol/commons/pull/134)
|
||||
- fix web3 version + use truffle-hdwallet [`d364a7b`](https://github.com/oceanprotocol/commons/commit/d364a7beef5dd547b2d41f2907736481734b1c8b)
|
||||
- add tests [`e5960d3`](https://github.com/oceanprotocol/commons/commit/e5960d3fd621ebe3d7af267d98cfcce1262e93fb)
|
||||
- fresh package-lock [`9b9db4b`](https://github.com/oceanprotocol/commons/commit/9b9db4b655b10d2255201a2abc37b234be2e9c68)
|
||||
- bump packages [`96e5363`](https://github.com/oceanprotocol/commons/commit/96e5363859c4c2cda1d00928cf3595daac8e1e84)
|
||||
- add docs, consolidate more config values [`8717621`](https://github.com/oceanprotocol/commons/commit/87176212efd0648873e1f3f26c7767dd475da52c)
|
||||
|
||||
#### [v0.5.4](https://github.com/oceanprotocol/commons/compare/v0.5.3...v0.5.4)
|
||||
|
||||
|
@ -119,17 +301,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|||
|
||||
- bump to squid-js v0.6.0 [`#163`](https://github.com/oceanprotocol/commons/pull/163)
|
||||
- switch to axios for file url check [`#162`](https://github.com/oceanprotocol/commons/pull/162)
|
||||
- revert package-lock [`24b68ba`](https://github.com/oceanprotocol/commons/commit/24b68baa2488da52ad2cb510b2750ab5cafef4ac)
|
||||
- use pacific, fix export vars [`67f7368`](https://github.com/oceanprotocol/commons/commit/67f736809b8097434c7960b4be7ccd208e182b98)
|
||||
- remove faucet + target nile node [`3b3c08f`](https://github.com/oceanprotocol/commons/commit/3b3c08f5490b56e17e20248d12f61c8eabce4b52)
|
||||
- switch to axios for file publish [`7043266`](https://github.com/oceanprotocol/commons/commit/70432662542a4de24133bfdd8906e569adfeb606)
|
||||
- Release 0.5.4 [`9699030`](https://github.com/oceanprotocol/commons/commit/96990309e044bc2355951b9c72e0f7cefdf82feb)
|
||||
- bump to squid-js v0.6.2 [`57e9cd6`](https://github.com/oceanprotocol/commons/commit/57e9cd69ffcbdb341f39349d44ea3aa785f51f65)
|
||||
|
||||
#### [v0.5.3](https://github.com/oceanprotocol/commons/compare/v0.5.2...v0.5.3)
|
||||
|
||||
> 19 June 2019
|
||||
|
||||
- SEO component [`#159`](https://github.com/oceanprotocol/commons/pull/159)
|
||||
- switch to axios for file publish [`7043266`](https://github.com/oceanprotocol/commons/commit/70432662542a4de24133bfdd8906e569adfeb606)
|
||||
- Release 0.5.3 [`75a262f`](https://github.com/oceanprotocol/commons/commit/75a262f5d633bd0f053ead0b5fd44d4ad56bd029)
|
||||
- add robots.txt [`3024944`](https://github.com/oceanprotocol/commons/commit/30249447ceb7ccbc2b9347d7a757a93cd690fcbd)
|
||||
|
||||
#### [v0.5.2](https://github.com/oceanprotocol/commons/compare/v0.5.1...v0.5.2)
|
||||
|
||||
|
@ -137,18 +319,18 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|||
|
||||
- add config values for Pacific connection [`#161`](https://github.com/oceanprotocol/commons/pull/161)
|
||||
- Refactor VersionNumbers to be sourced from squid-js [`#160`](https://github.com/oceanprotocol/commons/pull/160)
|
||||
- fix web3 version + use truffle-hdwallet [`d364a7b`](https://github.com/oceanprotocol/commons/commit/d364a7beef5dd547b2d41f2907736481734b1c8b)
|
||||
- add tests [`e5960d3`](https://github.com/oceanprotocol/commons/commit/e5960d3fd621ebe3d7af267d98cfcce1262e93fb)
|
||||
- output overall status [`059ae62`](https://github.com/oceanprotocol/commons/commit/059ae62f967f40d9635cc729d31ab84fa913df8b)
|
||||
- switch to using squid-js for version numbers [`c4f862b`](https://github.com/oceanprotocol/commons/commit/c4f862baa5fa835ec3ff3aafeefa60f524d011b2)
|
||||
- collapse contracts by default [`838757f`](https://github.com/oceanprotocol/commons/commit/838757f5e832973f54540b0bd78fd7b6ec3fcafe)
|
||||
|
||||
#### [v0.5.1](https://github.com/oceanprotocol/commons/compare/v0.5.0...v0.5.1)
|
||||
|
||||
> 14 June 2019
|
||||
|
||||
- Submarine links and Pacific support [`#158`](https://github.com/oceanprotocol/commons/pull/158)
|
||||
- tweak CI app starting [`81cb06e`](https://github.com/oceanprotocol/commons/commit/81cb06e19b56a069c0f1827e909005831d42606e)
|
||||
- prototype using truffle-privatekey-provider & ganache to provide accounts [`d8f4ebe`](https://github.com/oceanprotocol/commons/commit/d8f4ebe7b4ed2592a6e8b01e52e5ed3ffefd4aa5)
|
||||
- cleanup, add asset fixture, add eslint-plugin-cypress [`8f73c08`](https://github.com/oceanprotocol/commons/commit/8f73c08fdd1de3d04b0aa171515378ca75c8fe67)
|
||||
- link up transaction IDs with submarine, support pacific too [`97d6c27`](https://github.com/oceanprotocol/commons/commit/97d6c2756ed31f90f960dae21b8889d61232cd09)
|
||||
- link version numbers to release pages [`6f7edfa`](https://github.com/oceanprotocol/commons/commit/6f7edfa30f3b188e87cbce3c2404db313920e305)
|
||||
- Release 0.5.1 [`c063ad8`](https://github.com/oceanprotocol/commons/commit/c063ad82cb5e3a51b5083427fc50afc5b161533a)
|
||||
|
||||
#### [v0.5.0](https://github.com/oceanprotocol/commons/compare/v0.4.5...v0.5.0)
|
||||
|
||||
|
@ -212,18 +394,18 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|||
> 28 May 2019
|
||||
|
||||
- AI For Good: channels, new front-page & categories list [`#125`](https://github.com/oceanprotocol/commons/pull/125)
|
||||
- asset files & fixed metadata tweaks [`be6c478`](https://github.com/oceanprotocol/commons/commit/be6c478ca723e7face0fc0d37129fd9ff183cffe)
|
||||
- cleanup contentType in one central place, add more manual replacements [`5e94d73`](https://github.com/oceanprotocol/commons/commit/5e94d73197275a89e9460f98dab5408a7dc1f52a)
|
||||
- fix tests [`d74a4c0`](https://github.com/oceanprotocol/commons/commit/d74a4c0cbca57e5bf0f8e687148dd0332334acfc)
|
||||
- rebase fix [`90b163b`](https://github.com/oceanprotocol/commons/commit/90b163b2aa1703fd4e450e4e83076ed4522b0aad)
|
||||
- category search, make multiple layouts on one page possible [`1b1ac5c`](https://github.com/oceanprotocol/commons/commit/1b1ac5c9ef75e3a67d949a07e8177245e7912fe7)
|
||||
- channel teaser component, use on channels page [`1b7d343`](https://github.com/oceanprotocol/commons/commit/1b7d34398490a14a0fd62db7b28e54dab14acc30)
|
||||
|
||||
#### [v0.3.2](https://github.com/oceanprotocol/commons/compare/v0.3.1...v0.3.2)
|
||||
|
||||
> 27 May 2019
|
||||
|
||||
- Add range error handling [`#144`](https://github.com/oceanprotocol/commons/pull/144)
|
||||
- rebase fix [`90b163b`](https://github.com/oceanprotocol/commons/commit/90b163b2aa1703fd4e450e4e83076ed4522b0aad)
|
||||
- category search, make multiple layouts on one page possible [`1b1ac5c`](https://github.com/oceanprotocol/commons/commit/1b1ac5c9ef75e3a67d949a07e8177245e7912fe7)
|
||||
- channel teaser component, use on channels page [`1b7d343`](https://github.com/oceanprotocol/commons/commit/1b7d34398490a14a0fd62db7b28e54dab14acc30)
|
||||
- update changelog [`7669545`](https://github.com/oceanprotocol/commons/commit/7669545d1391b764fd42419c41162182b93d9118)
|
||||
- Release 0.3.2 [`63b87cf`](https://github.com/oceanprotocol/commons/commit/63b87cfb82b410886baefe8a20da0b7f1d3ac34e)
|
||||
- add range error handling [`2687c78`](https://github.com/oceanprotocol/commons/commit/2687c7847425c549927993ee396d8e12072ad9da)
|
||||
|
||||
#### [v0.3.1](https://github.com/oceanprotocol/commons/compare/v0.3.0...v0.3.1)
|
||||
|
||||
|
@ -239,17 +421,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|||
|
||||
- Consume feedback mesages [`#110`](https://github.com/oceanprotocol/commons/pull/110)
|
||||
- fresh package-lock [`743fe53`](https://github.com/oceanprotocol/commons/commit/743fe533dc848dd1f120e6086e3ef311a23395a0)
|
||||
- update changelog [`01e68b6`](https://github.com/oceanprotocol/commons/commit/01e68b6632b44c71ee8f6f0521d56355d2c4f6a7)
|
||||
- bump required component versions [`d6a7800`](https://github.com/oceanprotocol/commons/commit/d6a7800cc4b408f12e2e6d4b8c5c6100536ab2d7)
|
||||
- message tweaks [`0e12204`](https://github.com/oceanprotocol/commons/commit/0e12204a5a0b72b070f5b7a8cc9d14c351cff3c2)
|
||||
- message output refactor, testing [`879f511`](https://github.com/oceanprotocol/commons/commit/879f51170ea0dfdf97d72a3594ac73b920d52162)
|
||||
|
||||
#### [v0.2.14](https://github.com/oceanprotocol/commons/compare/v0.2.13...v0.2.14)
|
||||
|
||||
> 20 May 2019
|
||||
|
||||
- AI Commons link [`#137`](https://github.com/oceanprotocol/commons/pull/137)
|
||||
- message tweaks [`0e12204`](https://github.com/oceanprotocol/commons/commit/0e12204a5a0b72b070f5b7a8cc9d14c351cff3c2)
|
||||
- message output refactor, testing [`879f511`](https://github.com/oceanprotocol/commons/commit/879f51170ea0dfdf97d72a3594ac73b920d52162)
|
||||
- add AI Commons logo [`081772c`](https://github.com/oceanprotocol/commons/commit/081772ce3764b95d67cf685c5d71c335c7f68d47)
|
||||
- clarify changelog updating [`bf3378b`](https://github.com/oceanprotocol/commons/commit/bf3378bc489b197cc2fc0d4f955e376b39dee1ca)
|
||||
- update changelog [`7e2d7ac`](https://github.com/oceanprotocol/commons/commit/7e2d7ac6ad06c7acd26851d95ba3ab673f7a45b9)
|
||||
|
||||
#### [v0.2.13](https://github.com/oceanprotocol/commons/compare/v0.2.12...v0.2.13)
|
||||
|
||||
|
@ -257,9 +439,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|||
|
||||
- Output total assets [`#128`](https://github.com/oceanprotocol/commons/pull/128)
|
||||
- Updated Telegram link [`#138`](https://github.com/oceanprotocol/commons/pull/138)
|
||||
- output total assets in the marketplace, use new Market Provider for it [`2244082`](https://github.com/oceanprotocol/commons/commit/22440827cafb8ccc4621e49df12b96b1192dd5f0)
|
||||
- styling, AI Commons link [`e6fc7a9`](https://github.com/oceanprotocol/commons/commit/e6fc7a9085805a18a1779de4b9628dcc96403f4f)
|
||||
- update changelog [`7df6958`](https://github.com/oceanprotocol/commons/commit/7df695812325f6470cabd036f744cf2e5281ae6f)
|
||||
- Release 0.2.13 [`7a6075b`](https://github.com/oceanprotocol/commons/commit/7a6075b553050a0bc9512873fad8e56a8f4f6ee3)
|
||||
- remove AI Commons line for now [`21786a7`](https://github.com/oceanprotocol/commons/commit/21786a7d16a2e999835c85605dcdc4e23c6727ea)
|
||||
|
||||
#### [v0.2.12](https://github.com/oceanprotocol/commons/compare/v0.2.11...v0.2.12)
|
||||
|
||||
|
@ -267,9 +449,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|||
|
||||
- Fix versions vwv.y.z [`#135`](https://github.com/oceanprotocol/commons/pull/135)
|
||||
- consistent AI For Good category naming [`#136`](https://github.com/oceanprotocol/commons/pull/136)
|
||||
- output total assets in the marketplace, use new Market Provider for it [`2244082`](https://github.com/oceanprotocol/commons/commit/22440827cafb8ccc4621e49df12b96b1192dd5f0)
|
||||
- styling, AI Commons link [`e6fc7a9`](https://github.com/oceanprotocol/commons/commit/e6fc7a9085805a18a1779de4b9628dcc96403f4f)
|
||||
- update changelog [`a831848`](https://github.com/oceanprotocol/commons/commit/a83184851ca1293a684463b32bd2dbc0c59d5583)
|
||||
- Release 0.2.12 [`8c4fefc`](https://github.com/oceanprotocol/commons/commit/8c4fefcee1e4c7c9e02eeb97fe90911e2bc54ef6)
|
||||
|
||||
#### [v0.2.11](https://github.com/oceanprotocol/commons/compare/v0.2.10...v0.2.11)
|
||||
|
||||
|
@ -287,7 +468,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|||
- AI for Good category [`#126`](https://github.com/oceanprotocol/commons/pull/126)
|
||||
- Network detection tweaks [`#122`](https://github.com/oceanprotocol/commons/pull/122)
|
||||
- bump squid-js [`97b20b4`](https://github.com/oceanprotocol/commons/commit/97b20b4e9b09f3ade7d55636fb6ef169bacf4222)
|
||||
- isCorrectNetwork -> isOceanNetwork [`807723b`](https://github.com/oceanprotocol/commons/commit/807723be350a60da97f25c53eed102bafcbf1c3c)
|
||||
- isCorrectNetwork -> isOceanNetwork [`807723b`](https://github.com/oceanprotocol/commons/commit/807723be350a60da97f25c53eed102bafcbf1c3c)
|
||||
- less verbose error logging [`f49fa14`](https://github.com/oceanprotocol/commons/commit/f49fa14b2aa7d35a91f8003ddd297b4f2df8ca78)
|
||||
|
||||
#### [v0.2.9](https://github.com/oceanprotocol/commons/compare/v0.2.8...v0.2.9)
|
||||
|
@ -342,7 +523,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|||
|
||||
- fix search titles [`#112`](https://github.com/oceanprotocol/commons/pull/112)
|
||||
- Release 0.2.4 [`8f832b6`](https://github.com/oceanprotocol/commons/commit/8f832b63220a46a8de0061ffc2498186e2099315)
|
||||
- update telegram link [`e6806f4`](https://github.com/oceanprotocol/commons/commit/e6806f467d6e2299bc0886eba53d0646dfa4df31)
|
||||
|
||||
#### [v0.2.3](https://github.com/oceanprotocol/commons/compare/v0.2.2...v0.2.3)
|
||||
|
||||
|
@ -499,7 +679,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|||
- add changelog [`#33`](https://github.com/oceanprotocol/commons/pull/33)
|
||||
- Front-page tweaks & user asset list [`#19`](https://github.com/oceanprotocol/commons/pull/19)
|
||||
- add invoice view [`#29`](https://github.com/oceanprotocol/commons/pull/29)
|
||||
- root app->/client, microservice in /server [`#28`](https://github.com/oceanprotocol/commons/pull/28)
|
||||
- root app->/client, microservice in /server [`#28`](https://github.com/oceanprotocol/commons/pull/28)
|
||||
- Account & Faucet UI [`#25`](https://github.com/oceanprotocol/commons/pull/25)
|
||||
- New publish flow [`#23`](https://github.com/oceanprotocol/commons/pull/23)
|
||||
- package updates [`#27`](https://github.com/oceanprotocol/commons/pull/27)
|
||||
|
@ -524,4 +704,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|||
- kick out prototyping stuff [`#58`](https://github.com/oceanprotocol/commons/issues/58)
|
||||
- one dev interface for client & server [`7e42991`](https://github.com/oceanprotocol/commons/commit/7e42991706f139a34e425dd7c20b28b4f55d77aa)
|
||||
- npm install [`07f6d22`](https://github.com/oceanprotocol/commons/commit/07f6d22a36f0f253f9a6619912489679f62218da)
|
||||
- display published [`43d0847`](https://github.com/oceanprotocol/commons/commit/43d0847d48ccf3f5796f27aae6cd179770c8a8d5)
|
||||
- start command [`c49fc85`](https://github.com/oceanprotocol/commons/commit/c49fc85017b0560cf96c7ed8e7d6e2c2ace1bff9)
|
||||
|
|
29
README.md
29
README.md
|
@ -1,3 +1,7 @@
|
|||
**This repo is obsolete as of Ocean V3 (Oct 2020). Superseded by [oceanprotocol/market](https://github.com/oceanprotocol/market).**
|
||||
|
||||
----
|
||||
|
||||
[![banner](https://raw.githubusercontent.com/oceanprotocol/art/master/github/repo-banner%402x.png)](https://oceanprotocol.com)
|
||||
|
||||
<h1 align="center">Commons</h1>
|
||||
|
@ -6,13 +10,10 @@
|
|||
> https://commons.oceanprotocol.com
|
||||
|
||||
[![Build Status](https://travis-ci.com/oceanprotocol/commons.svg?branch=master)](https://travis-ci.com/oceanprotocol/commons)
|
||||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/6a19987e62344b1c9c1d5bc9f315c733)](https://www.codacy.com/app/ocean-protocol/commons)
|
||||
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/6a19987e62344b1c9c1d5bc9f315c733)](https://www.codacy.com/app/ocean-protocol/commons)
|
||||
[![Maintainability](https://api.codeclimate.com/v1/badges/ed6e8212a8d294b6aa88/maintainability)](https://codeclimate.com/github/oceanprotocol/commons/maintainability)
|
||||
[![Test Coverage](https://api.codeclimate.com/v1/badges/ed6e8212a8d294b6aa88/test_coverage)](https://codeclimate.com/github/oceanprotocol/commons/test_coverage)
|
||||
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-7b1173.svg?style=flat-square)](https://github.com/prettier/prettier)
|
||||
[![js oceanprotocol](https://img.shields.io/badge/js-oceanprotocol-7b1173.svg)](https://github.com/oceanprotocol/eslint-config-oceanprotocol)
|
||||
[![css bigchaindb](https://img.shields.io/badge/css-bigchaindb-39BA91.svg)](https://github.com/bigchaindb/stylelint-config-bigchaindb)
|
||||
|
||||
<img width="1218" alt="Commons UI" src="https://user-images.githubusercontent.com/90316/55874266-296ef080-5b92-11e9-8ac6-2423cb2a80fb.png">
|
||||
|
||||
|
@ -30,6 +31,8 @@ If you're a developer and want to contribute to, or want to utilize this marketp
|
|||
- [⛵️ Environment Variables](#️-environment-variables)
|
||||
- [Client](#client)
|
||||
- [Server](#server)
|
||||
- [Feature Switches](#feature-switches)
|
||||
- [More Settings](#more-settings)
|
||||
- [👩🔬 Testing](#-testing)
|
||||
- [Unit Tests](#unit-tests)
|
||||
- [End-to-End Integration Tests](#end-to-end-integration-tests)
|
||||
|
@ -133,6 +136,24 @@ cp server/.env.example server/.env
|
|||
vi server/.env
|
||||
```
|
||||
|
||||
#### Feature Switches
|
||||
|
||||
Beside configuring the network endpopints, the client allows to activate some features with environment variables in `client/.env.local`:
|
||||
|
||||
| Env Variable | Feature Description |
|
||||
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `REACT_APP_SHOW_CHANNELS` | Show the channels feature which shows assets based on a certain tag in a prominent view. This is deeactivated by default and only activated in live Commons deployments. |
|
||||
| `REACT_APP_SHOW_REQUEST_TOKENS_BUTTON` | Shows a second button on the `/faucet` route to request Ocean Tokens in addition to Ether. Will only work in Ocean testnets. |
|
||||
| `REACT_APP_ALLOW_PRICING` | Activate pricing feature. Will show a price input during publish flow, and output prices for each data asset. |
|
||||
|
||||
#### More Settings
|
||||
|
||||
| Env Variable | Example | Feature Description |
|
||||
| --------------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------- |
|
||||
| client: `REACT_APP_IPFS_GATEWAY_URI`<br /> server: `IPFS_GATEWAY_URI` | `"https://ipfs.oceanprotocol.com"` | The IPFS gateway URI. |
|
||||
| `REACT_APP_IPFS_NODE_URI` | `"https://ipfs.oceanprotocol.com:443"` | The IPFS node URI used to add files to IPFS. |
|
||||
| `REACT_APP_REPORT_EMAIL` | `"jelly@mcjellyfish.com"` | The email used for the _report an asset_ feature. |
|
||||
|
||||
## 👩🔬 Testing
|
||||
|
||||
Test suite is setup with [Jest](https://jestjs.io) and [react-testing-library](https://github.com/kentcdodds/react-testing-library) for unit testing, and [Cypress](https://www.cypress.io) for integration testing.
|
||||
|
@ -184,7 +205,7 @@ npm run cypress:open
|
|||
For linting and auto-formatting you can use from the root of the project:
|
||||
|
||||
```bash
|
||||
# auto format all ts & css with eslint & stylelint
|
||||
# auto format all ts & css with eslint
|
||||
npm run lint
|
||||
|
||||
# auto format all ts & css with prettier, taking all configs into account
|
||||
|
|
|
@ -1,2 +1,6 @@
|
|||
node_modules
|
||||
.env.local
|
||||
.env
|
||||
build
|
||||
coverage
|
||||
__mocks__
|
||||
|
|
|
@ -52,6 +52,12 @@ REACT_APP_BRIZO_ADDRESS="0x0474ed05ba757dde575dfaaaa267d9e7f3643abc"
|
|||
# REACT_APP_FAUCET_URI="http://localhost:3001"
|
||||
# REACT_APP_BRIZO_ADDRESS="0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0"
|
||||
|
||||
#
|
||||
# APP CONFIG
|
||||
#
|
||||
REACT_APP_REPORT_EMAIL="test@example.com"
|
||||
# REACT_APP_SHOW_CHANNELS=true
|
||||
# REACT_APP_ALLOW_PRICING=true
|
||||
# REACT_APP_SHOW_REQUEST_TOKENS_BUTTON=true
|
||||
REACT_APP_IPFS_GATEWAY_URI="https://ipfs.oceanprotocol.com"
|
||||
REACT_APP_IPFS_NODE_URI="https://ipfs.oceanprotocol.com:443"
|
||||
|
|
|
@ -1,20 +1,23 @@
|
|||
FROM node:11-alpine
|
||||
LABEL maintainer="Ocean Protocol <devops@oceanprotocol.com>"
|
||||
|
||||
RUN apk add --no-cache --update\
|
||||
bash\
|
||||
g++\
|
||||
gcc\
|
||||
git\
|
||||
gettext\
|
||||
make\
|
||||
python
|
||||
RUN apk add --no-cache --update \
|
||||
bash \
|
||||
g++ \
|
||||
gcc \
|
||||
git \
|
||||
gettext \
|
||||
make \
|
||||
python \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
COPY package*.json /app/frontend/
|
||||
WORKDIR /app/frontend
|
||||
RUN npm install -g npm serve \
|
||||
&& npm install \
|
||||
&& npm cache clean --force
|
||||
|
||||
COPY . /app/frontend
|
||||
WORKDIR /app/frontend
|
||||
|
||||
RUN npm install -g npm serve
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
# Default ENV values
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,73 +1,72 @@
|
|||
{
|
||||
"name": "commons-client",
|
||||
"description": "Ocean Protocol marketplace frontend to explore, download, and publish open data sets.",
|
||||
"version": "1.1.3",
|
||||
"version": "2.4.1",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "CI=false react-scripts --max_old_space_size=4096 build",
|
||||
"test": "react-scripts test --coverage --watchAll=false",
|
||||
"test": "react-scripts test --coverage --watchAll=false --silent",
|
||||
"test:watch": "react-scripts test --coverage",
|
||||
"eject": "react-scripts eject",
|
||||
"coverage": "cat coverage/lcov.info | codacy-coverage --token 8801f827fe1144ffa85cd7da94f2bbf7",
|
||||
"analyze": "source-map-explorer 'build/static/js/*.js'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@oceanprotocol/art": "^2.2.0",
|
||||
"@oceanprotocol/squid": "^0.7.2",
|
||||
"@oceanprotocol/squid": "^2.2.0",
|
||||
"@oceanprotocol/typographies": "^0.1.0",
|
||||
"@sindresorhus/slugify": "^0.9.1",
|
||||
"axios": "^0.19.0",
|
||||
"@sindresorhus/slugify": "^1.0.0",
|
||||
"@truffle/hdwallet-provider": "^1.0.35",
|
||||
"axios": "^0.19.2",
|
||||
"bip39": "^3.0.2",
|
||||
"classnames": "^2.2.6",
|
||||
"ethereum-blockies": "github:MyEtherWallet/blockies",
|
||||
"filesize": "^4.1.2",
|
||||
"history": "^4.9.0",
|
||||
"is-url": "^1.2.4",
|
||||
"moment": "^2.24.0",
|
||||
"query-string": "^6.8.2",
|
||||
"react": "16.8.6",
|
||||
"react-collapsed": "^2.1.1",
|
||||
"react-datepicker": "^2.8.0",
|
||||
"react-dom": "16.8.6",
|
||||
"filesize": "^6.1.0",
|
||||
"history": "^4.10.1",
|
||||
"ipfs-http-client": "44.2.0",
|
||||
"is-url-superb": "^4.0.0",
|
||||
"moment": "^2.26.0",
|
||||
"node-sass": "^4.14.1",
|
||||
"query-string": "^6.13.1",
|
||||
"react": "^16.13.1",
|
||||
"react-collapsed": "^3.0.0",
|
||||
"react-datepicker": "^3.0.0",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-dotdotdot": "^1.3.1",
|
||||
"react-ga": "^2.6.0",
|
||||
"react-helmet": "^5.2.1",
|
||||
"react-markdown": "^4.1.0",
|
||||
"react-modal": "^3.9.1",
|
||||
"react-moment": "^0.9.2",
|
||||
"react-paginate": "^6.3.0",
|
||||
"react-popper": "^1.3.3",
|
||||
"react-router-dom": "^5.0.1",
|
||||
"react-transition-group": "^4.2.1",
|
||||
"react-dropzone": "^11.0.1",
|
||||
"react-ga": "^3.0.0",
|
||||
"react-helmet": "^6.0.0",
|
||||
"react-markdown": "^4.3.1",
|
||||
"react-modal": "^3.11.2",
|
||||
"react-moment": "^0.9.7",
|
||||
"react-paginate": "^6.3.2",
|
||||
"react-popper": "^1.3.7",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"react-transition-group": "^4.4.1",
|
||||
"shortid": "^2.2.15",
|
||||
"truffle-hdwallet-provider": "1.0.14",
|
||||
"web3": "1.2.0"
|
||||
"web3": "^1.2.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-mock/state": "^0.1.8",
|
||||
"@testing-library/jest-dom": "^4.0.0",
|
||||
"@testing-library/react": "^8.0.7",
|
||||
"@types/classnames": "^2.2.9",
|
||||
"@types/filesize": "^4.1.0",
|
||||
"@sheerun/mutationobserver-shim": "^0.3.3",
|
||||
"@testing-library/jest-dom": "^5.9.0",
|
||||
"@testing-library/react": "^10.2.1",
|
||||
"@types/classnames": "^2.2.10",
|
||||
"@types/is-url": "^1.2.28",
|
||||
"@types/jest": "^24.0.16",
|
||||
"@types/react": "^16.8.23",
|
||||
"@types/react-datepicker": "^2.8.0",
|
||||
"@types/react-dom": "^16.8.5",
|
||||
"@types/react-dotdotdot": "^1.2.0",
|
||||
"@types/react-helmet": "^5.0.8",
|
||||
"@types/react-modal": "^3.8.2",
|
||||
"@types/jest": "^26.0.0",
|
||||
"@types/react": "^16.9.35",
|
||||
"@types/react-datepicker": "^2.11.0",
|
||||
"@types/react-dom": "^16.9.8",
|
||||
"@types/react-helmet": "^6.0.0",
|
||||
"@types/react-modal": "^3.10.5",
|
||||
"@types/react-paginate": "^6.2.1",
|
||||
"@types/react-router-dom": "^4.3.4",
|
||||
"@types/react-transition-group": "^4.2.0",
|
||||
"@types/shortid": "0.0.29",
|
||||
"@types/web3": "^1.0.19",
|
||||
"jest-mock-axios": "^3.1.0",
|
||||
"node-sass": "^4.12.0",
|
||||
"react-scripts": "^3.0.0",
|
||||
"source-map-explorer": "^2.0.1",
|
||||
"typescript": "^3.6.2"
|
||||
"@types/react-router-dom": "^5.1.5",
|
||||
"@types/react-transition-group": "^4.4.0",
|
||||
"@types/shortid": "^0.0.29",
|
||||
"jest-mock-axios": "^4.2.0",
|
||||
"react-scripts": "^3.4.1",
|
||||
"source-map-explorer": "^2.4.2",
|
||||
"typescript": "^3.9.3"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
import Web3 from 'web3'
|
||||
import { Eth } from 'web3/eth'
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
web3: Web3
|
||||
ethereum: Eth
|
||||
}
|
||||
}
|
|
@ -3,3 +3,8 @@
|
|||
declare module 'ethereum-blockies' {
|
||||
export function toDataUrl(address: string): string
|
||||
}
|
||||
|
||||
declare module 'ipfs'
|
||||
declare module 'ipfs-http-client'
|
||||
declare module 'react-collapsed'
|
||||
declare module 'filesize'
|
|
@ -1 +0,0 @@
|
|||
declare module 'react-collapsed'
|
|
@ -1 +0,0 @@
|
|||
declare module 'truffle-hdwallet-provider'
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
|||
import { render } from '@testing-library/react'
|
||||
import App from './App'
|
||||
import { User } from './context'
|
||||
import { userMock, userMockConnected } from '../__mocks__/user-mock'
|
||||
import { userMock, userMockConnected } from './__mocks__/user-mock'
|
||||
|
||||
describe('App', () => {
|
||||
it('should be able to run tests', () => {
|
||||
|
|
|
@ -3,7 +3,7 @@ import { BrowserRouter as Router } from 'react-router-dom'
|
|||
import { render } from '@testing-library/react'
|
||||
import Routes from './Routes'
|
||||
import { User } from './context'
|
||||
import { userMockConnected } from '../__mocks__/user-mock'
|
||||
import { userMockConnected } from './__mocks__/user-mock'
|
||||
|
||||
describe('Routes', () => {
|
||||
it('renders without crashing', () => {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from 'react'
|
||||
import { Route, Switch } from 'react-router-dom'
|
||||
import { showChannels } from './config'
|
||||
|
||||
import About from './routes/About'
|
||||
import Home from './routes/Home'
|
||||
|
@ -24,8 +25,12 @@ const Routes = () => (
|
|||
<Route component={Asset} path="/asset/:did" />
|
||||
<Route component={Faucet} path="/faucet" />
|
||||
<Route component={History} path="/history" />
|
||||
<Route component={Channels} exact path="/channels" />
|
||||
<Route component={Channel} path="/channels/:channel" />
|
||||
{showChannels && (
|
||||
<>
|
||||
<Route component={Channels} exact path="/channels" />
|
||||
<Route component={Channel} path="/channels/:channel" />
|
||||
</>
|
||||
)}
|
||||
<Route component={NotFound} />
|
||||
</Switch>
|
||||
)
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
import { DDO } from '@oceanprotocol/squid'
|
||||
|
||||
const ddoMock = ({
|
||||
id: 'xxx',
|
||||
findServiceByType: () => {
|
||||
return { index: 'xxx' }
|
||||
}
|
||||
} as any) as DDO
|
||||
|
||||
export default ddoMock
|
|
@ -13,6 +13,16 @@ const oceanMock = {
|
|||
}
|
||||
},
|
||||
assets: {
|
||||
query: () => {
|
||||
return {
|
||||
results: [],
|
||||
page: 1,
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
total_pages: 1611,
|
||||
total_results: 1611
|
||||
/* eslint-enable @typescript-eslint/camelcase */
|
||||
}
|
||||
},
|
||||
resolve: jest.fn(),
|
||||
order: () => {
|
||||
return {
|
|
@ -21,7 +21,7 @@
|
|||
}
|
||||
|
||||
.unlock {
|
||||
font-size: $font-size-small !important; // stylelint-disable-line
|
||||
font-size: $font-size-small !important;
|
||||
margin-left: $spacer / 2;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
|||
display: inline-block;
|
||||
fill: currentColor;
|
||||
margin-right: $spacer / 8;
|
||||
transition: .2s ease-out;
|
||||
transition: 0.2s ease-out;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import { render, fireEvent } from '@testing-library/react'
|
|||
import { toDataUrl } from 'ethereum-blockies'
|
||||
import Account from './Account'
|
||||
import { User } from '../../context'
|
||||
import { userMockConnected } from '../../../__mocks__/user-mock'
|
||||
import { userMockConnected } from '../../__mocks__/user-mock'
|
||||
|
||||
describe('Account', () => {
|
||||
it('renders without crashing', () => {
|
||||
|
|
|
@ -62,7 +62,7 @@ export default class Account extends PureComponent<
|
|||
{isBurner ? (
|
||||
<button
|
||||
className={styles.toggle}
|
||||
onClick={event => this.toggleAccountInfo(event)}
|
||||
onClick={(event) => this.toggleAccountInfo(event)}
|
||||
title="Show More Account Info"
|
||||
>
|
||||
<Caret
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
font-weight: $font-weight-bold;
|
||||
text-transform: uppercase;
|
||||
border-radius: 2px;
|
||||
transition: .2s ease-out;
|
||||
transition: 0.2s ease-out;
|
||||
color: $brand-white;
|
||||
background: $brand-grey-light;
|
||||
box-shadow: 0 9px 18px 0 rgba(0, 0, 0, .1);
|
||||
box-shadow: 0 9px 18px 0 rgba(0, 0, 0, 0.1);
|
||||
min-height: 45px;
|
||||
user-select: none;
|
||||
|
||||
|
@ -25,21 +25,21 @@
|
|||
color: $brand-white;
|
||||
background: $brand-grey-light;
|
||||
text-decoration: none;
|
||||
transform: translate3d(0, -.05rem, 0);
|
||||
box-shadow: 0 12px 30px 0 rgba(0, 0, 0, .1);
|
||||
transform: translate3d(0, -0.05rem, 0);
|
||||
box-shadow: 0 12px 30px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: $brand-grey-light;
|
||||
transition: none;
|
||||
transform: none;
|
||||
box-shadow: 0 5px 18px 0 rgba(0, 0, 0, .1);
|
||||
box-shadow: 0 5px 18px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
cursor: not-allowed;
|
||||
pointer-events: none;
|
||||
opacity: .5;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { PureComponent } from 'react'
|
||||
import React from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import cx from 'classnames'
|
||||
import styles from './Button.module.scss'
|
||||
|
@ -15,47 +15,34 @@ interface ButtonProps {
|
|||
name?: string
|
||||
}
|
||||
|
||||
export default class Button extends PureComponent<ButtonProps, any> {
|
||||
public render() {
|
||||
let classes
|
||||
const {
|
||||
primary,
|
||||
link,
|
||||
href,
|
||||
children,
|
||||
className,
|
||||
to,
|
||||
...props
|
||||
} = this.props
|
||||
|
||||
if (primary) {
|
||||
classes = styles.buttonPrimary
|
||||
} else if (link) {
|
||||
classes = styles.link
|
||||
} else {
|
||||
classes = styles.button
|
||||
}
|
||||
|
||||
if (to) {
|
||||
return (
|
||||
<Link to={to} className={cx(classes, className)} {...props}>
|
||||
{children}
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
if (href) {
|
||||
return (
|
||||
<a href={href} className={cx(classes, className)} {...props}>
|
||||
{children}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<button className={cx(classes, className)} {...props}>
|
||||
{children}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
function getClasses(primary: boolean | undefined, link: boolean | undefined) {
|
||||
return primary ? styles.buttonPrimary : link ? styles.link : styles.button
|
||||
}
|
||||
|
||||
const Button = ({
|
||||
primary,
|
||||
link,
|
||||
href,
|
||||
children,
|
||||
className,
|
||||
to,
|
||||
...props
|
||||
}: ButtonProps) => {
|
||||
const classes = getClasses(primary, link)
|
||||
|
||||
return to ? (
|
||||
<Link to={to} className={cx(classes, className)} {...props}>
|
||||
{children}
|
||||
</Link>
|
||||
) : href ? (
|
||||
<a href={href} className={cx(classes, className)} {...props}>
|
||||
{children}
|
||||
</a>
|
||||
) : (
|
||||
<button className={cx(classes, className)} {...props}>
|
||||
{children}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
export default Button
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
background-color: $body-background;
|
||||
border-radius: $border-radius;
|
||||
overflow: hidden;
|
||||
opacity: .85;
|
||||
transition: .2s ease-out;
|
||||
opacity: 0.85;
|
||||
transition: 0.2s ease-out;
|
||||
border: 1px solid $brand-grey-lighter;
|
||||
}
|
||||
|
||||
|
@ -21,5 +21,5 @@
|
|||
|
||||
.dimmed {
|
||||
composes: categoryImage;
|
||||
opacity: .6;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
top: 50%;
|
||||
margin-top: -.6rem;
|
||||
fill: rgba($brand-grey-light, .7);
|
||||
margin-top: -0.6rem;
|
||||
fill: rgba($brand-grey-light, 0.7);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
|||
padding: $spacer / 3;
|
||||
margin: 0;
|
||||
border-radius: $border-radius;
|
||||
transition: .2s ease-out;
|
||||
transition: 0.2s ease-out;
|
||||
min-height: 43px;
|
||||
appearance: none;
|
||||
|
||||
|
@ -63,8 +63,8 @@
|
|||
font-size: $font-size-base;
|
||||
color: $brand-grey-light;
|
||||
font-weight: $font-weight-base;
|
||||
transition: .2s ease-out;
|
||||
opacity: .7;
|
||||
transition: 0.2s ease-out;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
&[readonly],
|
||||
|
@ -95,7 +95,6 @@
|
|||
border: 0;
|
||||
|
||||
// custom arrow
|
||||
// stylelint-disable
|
||||
background-image: linear-gradient(45deg, transparent 50%, $brand-purple 50%),
|
||||
linear-gradient(135deg, $brand-purple 50%, transparent 50%),
|
||||
linear-gradient(
|
||||
|
@ -107,7 +106,6 @@
|
|||
background-position: calc(100% - 18px) calc(1rem + 5px),
|
||||
calc(100% - 13px) calc(1rem + 5px), 100% 0;
|
||||
background-size: 5px 5px, 5px 5px, 2.5rem 3rem;
|
||||
// stylelint-enable
|
||||
background-repeat: no-repeat;
|
||||
|
||||
&:focus {
|
||||
|
@ -153,7 +151,7 @@
|
|||
font-size: $font-size-small;
|
||||
line-height: 1.2;
|
||||
border: 2px solid $brand-grey-lighter;
|
||||
border-radius: .2rem;
|
||||
border-radius: 0.2rem;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react'
|
||||
import { render } from '@testing-library/react'
|
||||
import { render, fireEvent } from '@testing-library/react'
|
||||
import Input from './Input'
|
||||
|
||||
describe('Input', () => {
|
||||
|
@ -7,10 +7,10 @@ describe('Input', () => {
|
|||
const { container } = render(<Input name="my-input" label="My Input" />)
|
||||
expect(container.firstChild).toBeInTheDocument()
|
||||
expect(container.querySelector('.label')).toHaveTextContent('My Input')
|
||||
expect(container.querySelector('.input')).toHaveAttribute(
|
||||
'id',
|
||||
'my-input'
|
||||
)
|
||||
|
||||
const input = container.querySelector('.input')
|
||||
expect(input).toHaveAttribute('id', 'my-input')
|
||||
input && fireEvent.focus(input)
|
||||
})
|
||||
|
||||
it('renders as text input by default', () => {
|
||||
|
@ -25,13 +25,13 @@ describe('Input', () => {
|
|||
const { container } = render(
|
||||
<Input name="my-input" label="My Input" type="search" />
|
||||
)
|
||||
expect(container.querySelector('.input')).toHaveAttribute(
|
||||
'type',
|
||||
'search'
|
||||
)
|
||||
const input = container.querySelector('.input')
|
||||
expect(input).toHaveAttribute('type', 'search')
|
||||
expect(container.querySelector('label + div')).toHaveClass(
|
||||
'inputWrapSearch'
|
||||
)
|
||||
|
||||
input && fireEvent.focus(input)
|
||||
})
|
||||
|
||||
it('renders select', () => {
|
||||
|
|
|
@ -30,6 +30,7 @@ interface InputProps {
|
|||
rows?: number
|
||||
group?: any
|
||||
multiple?: boolean
|
||||
pattern?: string
|
||||
}
|
||||
|
||||
interface InputState {
|
||||
|
@ -55,7 +56,7 @@ export default class Input extends PureComponent<InputProps, InputState> {
|
|||
}
|
||||
}
|
||||
|
||||
public toggleFocus = () => {
|
||||
public handleFocus = () => {
|
||||
this.setState({ isFocused: !this.state.isFocused })
|
||||
}
|
||||
|
||||
|
@ -93,8 +94,8 @@ export default class Input extends PureComponent<InputProps, InputState> {
|
|||
className={styles.select}
|
||||
name={name}
|
||||
required={required}
|
||||
onFocus={this.toggleFocus}
|
||||
onBlur={this.toggleFocus}
|
||||
onFocus={this.handleFocus}
|
||||
onBlur={this.handleFocus}
|
||||
onChange={onChange}
|
||||
value={value}
|
||||
>
|
||||
|
@ -116,8 +117,8 @@ export default class Input extends PureComponent<InputProps, InputState> {
|
|||
<textarea
|
||||
id={name}
|
||||
className={styles.input}
|
||||
onFocus={this.toggleFocus}
|
||||
onBlur={this.toggleFocus}
|
||||
onFocus={this.handleFocus}
|
||||
onBlur={this.handleFocus}
|
||||
{...this.props}
|
||||
/>
|
||||
</div>
|
||||
|
@ -153,8 +154,8 @@ export default class Input extends PureComponent<InputProps, InputState> {
|
|||
selected={this.state.dateCreated}
|
||||
onChange={this.handleDateChange}
|
||||
className={styles.input}
|
||||
onFocus={this.toggleFocus}
|
||||
onBlur={this.toggleFocus}
|
||||
onFocus={this.handleFocus}
|
||||
onBlur={this.handleFocus}
|
||||
id={name}
|
||||
name={name}
|
||||
/>
|
||||
|
@ -169,8 +170,8 @@ export default class Input extends PureComponent<InputProps, InputState> {
|
|||
id={name}
|
||||
type={type || 'text'}
|
||||
className={styles.input}
|
||||
onFocus={this.toggleFocus}
|
||||
onBlur={this.toggleFocus}
|
||||
onFocus={this.handleFocus}
|
||||
onBlur={this.handleFocus}
|
||||
{...this.props}
|
||||
/>
|
||||
{group}
|
||||
|
@ -180,8 +181,8 @@ export default class Input extends PureComponent<InputProps, InputState> {
|
|||
id={name}
|
||||
type={type || 'text'}
|
||||
className={styles.input}
|
||||
onFocus={this.toggleFocus}
|
||||
onBlur={this.toggleFocus}
|
||||
onFocus={this.handleFocus}
|
||||
onBlur={this.handleFocus}
|
||||
{...this.props}
|
||||
/>
|
||||
)}
|
||||
|
|
|
@ -39,7 +39,9 @@
|
|||
max-width: 16rem;
|
||||
}
|
||||
|
||||
:global .react-datepicker-popper[data-placement^='top'] .react-datepicker__triangle:before,
|
||||
:global
|
||||
.react-datepicker-popper[data-placement^='top']
|
||||
.react-datepicker__triangle:before,
|
||||
:global .react-datepicker__year-read-view--down-arrow:before,
|
||||
:global .react-datepicker__month-read-view--down-arrow:before,
|
||||
:global .react-datepicker__month-year-read-view--down-arrow:before {
|
||||
|
|
|
@ -17,6 +17,6 @@
|
|||
font-size: $font-size-base;
|
||||
color: $brand-grey-light;
|
||||
display: inline-block;
|
||||
margin-left: .1rem;
|
||||
margin-left: 0.1rem;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba($brand-black, .7);
|
||||
background: rgba($brand-black, 0.7);
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
animation: fadeIn .2s ease-out backwards;
|
||||
animation: fadeIn 0.2s ease-out backwards;
|
||||
}
|
||||
|
||||
.modal {
|
||||
|
@ -25,7 +25,7 @@
|
|||
margin: $spacer auto;
|
||||
max-width: $break-point--small;
|
||||
position: relative;
|
||||
animation: moveUp .2s ease-out backwards;
|
||||
animation: moveUp 0.2s ease-out backwards;
|
||||
|
||||
@media (min-width: $break-point--small) {
|
||||
padding: $spacer * 2 $spacer * 1.5;
|
||||
|
@ -68,7 +68,7 @@
|
|||
|
||||
&:hover,
|
||||
&:focus {
|
||||
opacity: .7;
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ const Modal = ({
|
|||
title,
|
||||
description,
|
||||
isOpen,
|
||||
toggleModal,
|
||||
onToggleModal,
|
||||
children,
|
||||
onAfterOpen,
|
||||
onRequestClose,
|
||||
|
@ -17,7 +17,7 @@ const Modal = ({
|
|||
title: string
|
||||
description?: string
|
||||
isOpen: boolean
|
||||
toggleModal: () => void
|
||||
onToggleModal: () => void
|
||||
children: any
|
||||
onAfterOpen?: () => void
|
||||
onRequestClose?: () => void
|
||||
|
@ -34,7 +34,7 @@ const Modal = ({
|
|||
>
|
||||
<button
|
||||
className={styles.close}
|
||||
onClick={toggleModal}
|
||||
onClick={onToggleModal}
|
||||
data-testid="closeModal"
|
||||
>
|
||||
×
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react'
|
||||
import Helmet from 'react-helmet'
|
||||
import { Helmet } from 'react-helmet'
|
||||
import { withRouter, RouteComponentProps } from 'react-router-dom'
|
||||
import meta from '../../data/meta.json'
|
||||
import imageDefault from '../../img/share.png'
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
border-radius: 50%;
|
||||
border: 2px solid $brand-purple;
|
||||
border-top-color: $brand-violet;
|
||||
animation: spinner .6s linear infinite;
|
||||
animation: spinner 0.6s linear infinite;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
|||
height: $font-size-small;
|
||||
margin-top: -($font-size-small);
|
||||
margin-left: -($font-size-small / 2);
|
||||
border-width: .1rem;
|
||||
border-width: 0.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import React from 'react'
|
||||
import { render } from '@testing-library/react'
|
||||
import Spinner from './Spinner'
|
||||
|
||||
describe('Spinner', () => {
|
||||
it('renders without crashing', () => {
|
||||
const { container } = render(<Spinner />)
|
||||
expect(container.firstChild).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('renders small variant', () => {
|
||||
const { container } = render(<Spinner small />)
|
||||
expect(container.firstChild).toBeInTheDocument()
|
||||
})
|
||||
})
|
|
@ -4,10 +4,10 @@
|
|||
display: inline-block;
|
||||
position: relative;
|
||||
cursor: help;
|
||||
padding: .5rem;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
// default: red square
|
||||
/* default: red square */
|
||||
.statusIndicator {
|
||||
width: $font-size-small;
|
||||
height: $font-size-small;
|
||||
|
@ -15,7 +15,7 @@
|
|||
background: $red;
|
||||
}
|
||||
|
||||
// yellow triangle
|
||||
/* yellow triangle */
|
||||
.statusIndicatorCloseEnough {
|
||||
composes: statusIndicator;
|
||||
background: none;
|
||||
|
@ -26,7 +26,7 @@
|
|||
border-bottom: $font-size-small solid $yellow;
|
||||
}
|
||||
|
||||
// green circle
|
||||
/* green circle */
|
||||
.statusIndicatorActive {
|
||||
composes: statusIndicator;
|
||||
border-radius: 50%;
|
||||
|
|
|
@ -19,9 +19,9 @@ const Indicator = ({
|
|||
ref={forwardedRef}
|
||||
>
|
||||
<User.Consumer>
|
||||
{user => (
|
||||
{(user) => (
|
||||
<Market.Consumer>
|
||||
{market =>
|
||||
{(market) =>
|
||||
!user.isLogged || !market.networkMatch ? (
|
||||
<span
|
||||
className={styles.statusIndicatorCloseEnough}
|
||||
|
|
|
@ -7,12 +7,12 @@ $popoverWidth: 18rem;
|
|||
width: $popoverWidth;
|
||||
padding: $spacer / 2;
|
||||
background: $brand-black;
|
||||
border-radius: .1rem;
|
||||
border: .1rem solid $brand-grey-light;
|
||||
box-shadow: 0 6px 16px 0 rgba($brand-black, .3);
|
||||
border-radius: 0.1rem;
|
||||
border: 0.1rem solid $brand-grey-light;
|
||||
box-shadow: 0 6px 16px 0 rgba($brand-black, 0.3);
|
||||
color: $brand-grey-light;
|
||||
font-size: $font-size-small;
|
||||
animation: showPopup .2s ease-in forwards;
|
||||
animation: showPopup 0.2s ease-in forwards;
|
||||
white-space: initial;
|
||||
text-align: left;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ $popoverWidth: 18rem;
|
|||
}
|
||||
|
||||
.popoverInfoline {
|
||||
border-bottom: .05rem solid $brand-grey;
|
||||
border-bottom: 0.05rem solid $brand-grey;
|
||||
padding: $spacer / 3 0;
|
||||
|
||||
&:first-child {
|
||||
|
@ -40,15 +40,12 @@ $popoverWidth: 18rem;
|
|||
border-bottom: 0;
|
||||
}
|
||||
|
||||
/* stylelint-disable */
|
||||
button {
|
||||
svg,
|
||||
&[data-action] {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* stylelint-enable */
|
||||
}
|
||||
|
||||
.balance {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import React from 'react'
|
||||
import { render } from '@testing-library/react'
|
||||
import Popover from './Popover'
|
||||
import { userMock, userMockConnected } from '../../../../__mocks__/user-mock'
|
||||
import { marketMock } from '../../../../__mocks__/market-mock'
|
||||
import { userMock, userMockConnected } from '../../../__mocks__/user-mock'
|
||||
import { marketMock } from '../../../__mocks__/market-mock'
|
||||
import { User, Market } from '../../../context'
|
||||
|
||||
describe('Popover', () => {
|
||||
|
|
|
@ -18,36 +18,32 @@ export default class Popover extends PureComponent<{
|
|||
ref={this.props.forwardedRef}
|
||||
style={this.props.style}
|
||||
>
|
||||
{
|
||||
<>
|
||||
<div className={styles.popoverInfoline}>
|
||||
<Account />
|
||||
</div>
|
||||
|
||||
{account && balance && (
|
||||
<div className={styles.popoverInfoline}>
|
||||
<span
|
||||
className={styles.balance}
|
||||
title={(balance.eth / 1e18).toFixed(10)}
|
||||
>
|
||||
<strong>
|
||||
{(balance.eth / 1e18).toFixed(3).slice(0, -1)}
|
||||
</strong>{' '}
|
||||
ETH
|
||||
</span>
|
||||
<span className={styles.balance}>
|
||||
<strong>{balance.ocn}</strong> OCEAN
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Market.Consumer>
|
||||
{(market) => (
|
||||
<div className={styles.popoverInfoline}>
|
||||
<Account />
|
||||
</div>
|
||||
|
||||
{account && balance && (
|
||||
<div className={styles.popoverInfoline}>
|
||||
<span
|
||||
className={styles.balance}
|
||||
title={(balance.eth / 1e18).toFixed(10)}
|
||||
>
|
||||
<strong>
|
||||
{(balance.eth / 1e18)
|
||||
.toFixed(3)
|
||||
.slice(0, -1)}
|
||||
</strong>{' '}
|
||||
ETH
|
||||
</span>
|
||||
<span className={styles.balance}>
|
||||
<strong>{balance.ocn}</strong> OCEAN
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Market.Consumer>
|
||||
{market => (
|
||||
<div className={styles.popoverInfoline}>
|
||||
{network && !market.networkMatch
|
||||
? `Please connect to Custom RPC
|
||||
{network && !market.networkMatch
|
||||
? `Please connect to Custom RPC
|
||||
${
|
||||
market.network === 'Pacific'
|
||||
? 'https://pacific.oceanprotocol.com'
|
||||
|
@ -57,13 +53,10 @@ export default class Popover extends PureComponent<{
|
|||
? 'https://duero.dev-ocean.com'
|
||||
: 'http://localhost:8545'
|
||||
}`
|
||||
: network &&
|
||||
`Connected to ${network} network`}
|
||||
</div>
|
||||
)}
|
||||
</Market.Consumer>
|
||||
</>
|
||||
}
|
||||
: network && `Connected to ${network} network`}
|
||||
</div>
|
||||
)}
|
||||
</Market.Consumer>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ export default class AccountStatus extends PureComponent<
|
|||
}
|
||||
|
||||
private togglePopover() {
|
||||
this.setState(prevState => ({
|
||||
this.setState((prevState) => ({
|
||||
isPopoverOpen: !prevState.isPopoverOpen
|
||||
}))
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ export default class AccountStatus extends PureComponent<
|
|||
return (
|
||||
<Manager>
|
||||
<Reference>
|
||||
{({ ref }) => (
|
||||
{({ ref }: { ref: any }) => (
|
||||
<AccountIndicator
|
||||
togglePopover={() => this.togglePopover()}
|
||||
className={this.props.className}
|
||||
|
@ -39,7 +39,15 @@ export default class AccountStatus extends PureComponent<
|
|||
</Reference>
|
||||
{this.state.isPopoverOpen && (
|
||||
<Popper placement="auto">
|
||||
{({ ref, style, placement }) => (
|
||||
{({
|
||||
ref,
|
||||
style,
|
||||
placement
|
||||
}: {
|
||||
ref: any
|
||||
style: any
|
||||
placement: any
|
||||
}) => (
|
||||
<AccountPopover
|
||||
forwardedRef={ref}
|
||||
style={style}
|
||||
|
|
|
@ -17,18 +17,18 @@ const AssetTeaser = ({
|
|||
list?: boolean
|
||||
minimal?: boolean
|
||||
}) => {
|
||||
const { metadata } = asset.findServiceByType('Metadata')
|
||||
const { base } = metadata
|
||||
const { attributes } = asset.findServiceByType('metadata')
|
||||
const { main, additionalInformation } = attributes
|
||||
|
||||
return list ? (
|
||||
<article className={styles.assetList}>
|
||||
<Link to={`/asset/${asset.id}`}>
|
||||
<h1>{base.name}</h1>
|
||||
<h1>{main.name}</h1>
|
||||
<div
|
||||
className={styles.date}
|
||||
title={`Published on ${base.datePublished}`}
|
||||
title={`Published on ${main.datePublished}`}
|
||||
>
|
||||
{moment(base.datePublished, 'YYYYMMDD').fromNow()}
|
||||
{moment(main.datePublished, 'YYYYMMDD').fromNow()}
|
||||
</div>
|
||||
</Link>
|
||||
</article>
|
||||
|
@ -39,22 +39,32 @@ const AssetTeaser = ({
|
|||
}
|
||||
>
|
||||
<Link to={`/asset/${asset.id}`}>
|
||||
{base.categories && !minimal && (
|
||||
<CategoryImage dimmed category={base.categories[0]} />
|
||||
)}
|
||||
<h1>{base.name}</h1>
|
||||
{additionalInformation &&
|
||||
additionalInformation.categories &&
|
||||
!minimal && (
|
||||
<CategoryImage
|
||||
dimmed
|
||||
category={additionalInformation.categories[0]}
|
||||
/>
|
||||
)}
|
||||
<h1>{main.name}</h1>
|
||||
|
||||
{!minimal && (
|
||||
{additionalInformation && !minimal && (
|
||||
<div className={styles.description}>
|
||||
<Dotdotdot clamp={3}>{base.description}</Dotdotdot>
|
||||
<Dotdotdot clamp={3}>
|
||||
{additionalInformation.description}
|
||||
</Dotdotdot>
|
||||
</div>
|
||||
)}
|
||||
<footer className={styles.assetFooter}>
|
||||
{base.categories && <div>{base.categories[0]}</div>}
|
||||
{additionalInformation &&
|
||||
additionalInformation.categories && (
|
||||
<div>{additionalInformation.categories[0]}</div>
|
||||
)}
|
||||
{allowPricing && (
|
||||
<div className={styles.price}>
|
||||
<span>
|
||||
{Web3.utils.fromWei(base.price.toString())}
|
||||
{Web3.utils.fromWei(main.price.toString())}
|
||||
</span>{' '}
|
||||
OCEAN
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
@import '../../styles/variables';
|
||||
|
||||
.dropzone {
|
||||
margin-top: $spacer;
|
||||
margin-bottom: $spacer;
|
||||
border: 0.2rem dashed $brand-grey-lighter;
|
||||
border-radius: $border-radius * 2;
|
||||
padding: $spacer;
|
||||
background: $brand-white;
|
||||
transition: 0.2s ease-out;
|
||||
cursor: pointer;
|
||||
|
||||
p {
|
||||
text-align: center;
|
||||
margin-bottom: 0;
|
||||
font-size: $font-size-small;
|
||||
color: $brand-grey-light;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus,
|
||||
&:active {
|
||||
border-color: $brand-grey-light;
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.dragover {
|
||||
composes: dropzone;
|
||||
border-color: $brand-pink;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
composes: dropzone;
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.dropzoneFiles {
|
||||
padding: $spacer 0;
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
import React from 'react'
|
||||
import { fireEvent, render, act } from '@testing-library/react'
|
||||
import Dropzone from './Dropzone'
|
||||
|
||||
function mockData(files: any) {
|
||||
return {
|
||||
dataTransfer: {
|
||||
files,
|
||||
items: files.map((file: any) => ({
|
||||
kind: 'file',
|
||||
type: file.type,
|
||||
getAsFile: () => file
|
||||
})),
|
||||
types: ['Files']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function flushPromises(ui: any, container: any) {
|
||||
return new Promise((resolve) =>
|
||||
setImmediate(() => {
|
||||
render(ui, { container })
|
||||
resolve(container)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
function dispatchEvt(node: any, type: string, data: any) {
|
||||
const event = new Event(type, { bubbles: true })
|
||||
Object.assign(event, data)
|
||||
fireEvent(node, event)
|
||||
}
|
||||
|
||||
test('invoke onDragEnter when dragenter event occurs', async () => {
|
||||
const file = new File([JSON.stringify({ ping: true })], 'ping.json', {
|
||||
type: 'application/json'
|
||||
})
|
||||
const data = mockData([file])
|
||||
const handleOnDrop = jest.fn()
|
||||
|
||||
await act(async () => {
|
||||
const ui = <Dropzone handleOnDrop={handleOnDrop} />
|
||||
const { container } = render(ui)
|
||||
|
||||
// drop a file
|
||||
const dropzone = container.querySelector('div')
|
||||
dispatchEvt(dropzone, 'dragenter', data)
|
||||
dispatchEvt(dropzone, 'dragover', data)
|
||||
dispatchEvt(dropzone, 'drop', data)
|
||||
await flushPromises(ui, container)
|
||||
})
|
||||
|
||||
expect(handleOnDrop).toHaveBeenCalled()
|
||||
})
|
|
@ -0,0 +1,62 @@
|
|||
import React, { useCallback } from 'react'
|
||||
import { useDropzone } from 'react-dropzone'
|
||||
import styles from './Dropzone.module.scss'
|
||||
import { formatBytes } from '../../utils/utils'
|
||||
|
||||
export default function Dropzone({
|
||||
handleOnDrop,
|
||||
disabled,
|
||||
multiple
|
||||
}: {
|
||||
handleOnDrop(files: File[]): void
|
||||
disabled?: boolean
|
||||
multiple?: boolean
|
||||
}) {
|
||||
const onDrop = useCallback((acceptedFiles) => handleOnDrop(acceptedFiles), [
|
||||
handleOnDrop
|
||||
])
|
||||
|
||||
const {
|
||||
acceptedFiles,
|
||||
getRootProps,
|
||||
getInputProps,
|
||||
isDragActive,
|
||||
isDragReject
|
||||
} = useDropzone({ onDrop })
|
||||
|
||||
const files = acceptedFiles.map((file: any) => (
|
||||
<li key={file.path}>
|
||||
{file.path} - {formatBytes(file.size, 0)}
|
||||
</li>
|
||||
))
|
||||
|
||||
return (
|
||||
<>
|
||||
{acceptedFiles.length > 0 ? (
|
||||
<aside className={styles.dropzoneFiles}>
|
||||
<ul>{files}</ul>
|
||||
</aside>
|
||||
) : (
|
||||
<div
|
||||
{...getRootProps({
|
||||
className: isDragActive
|
||||
? styles.dragover
|
||||
: disabled
|
||||
? styles.disabled
|
||||
: styles.dropzone
|
||||
})}
|
||||
>
|
||||
<input {...getInputProps({ multiple })} />
|
||||
<p>
|
||||
{isDragActive && !isDragReject
|
||||
? `Drop it like it's hot!`
|
||||
: multiple
|
||||
? `Drag 'n' drop some files here, or click to select files`
|
||||
: `Drag 'n' drop a file here, or click to select a file`}
|
||||
{}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
@import '../../styles/variables';
|
||||
|
||||
.assetList {
|
||||
color: $brand-grey-dark;
|
||||
border-bottom: 1px solid $brand-grey-lighter;
|
||||
padding-top: $spacer / 2;
|
||||
padding-bottom: $spacer / 2;
|
||||
|
||||
h1 {
|
||||
font-size: $font-size-base;
|
||||
color: inherit;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.listRow {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-size: $font-size-small;
|
||||
color: $brand-grey-light;
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
import React, { useEffect, useState, useContext } from 'react'
|
||||
import { User } from '../../context'
|
||||
import moment from 'moment'
|
||||
import shortid from 'shortid'
|
||||
import styles from './JobTeaser.module.scss'
|
||||
import Dotdotdot from 'react-dotdotdot'
|
||||
|
||||
export default function JobTeaser({ job }: { job: any }) {
|
||||
const { ocean } = useContext(User)
|
||||
const [assetName, setAssetName] = useState()
|
||||
const [assetUrl, setAssetUrl] = useState()
|
||||
useEffect(() => {
|
||||
async function getAsset() {
|
||||
try {
|
||||
const {
|
||||
did
|
||||
} = await (ocean as any).keeper.agreementStoreManager.getAgreement(
|
||||
job.agreementId
|
||||
)
|
||||
const asset = await (ocean as any).assets.resolve(did)
|
||||
const { attributes } = asset.findServiceByType('metadata')
|
||||
const { main } = attributes
|
||||
const link = '/asset/did:op:' + did
|
||||
setAssetName(main.name)
|
||||
setAssetUrl(link as any)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
getAsset()
|
||||
}, [ocean, job.agreementId])
|
||||
|
||||
return (
|
||||
<article className={styles.assetList}>
|
||||
<div className={styles.listRow}>
|
||||
<h1>
|
||||
<a href={assetUrl}>{assetName}</a>
|
||||
</h1>
|
||||
<div
|
||||
className={styles.date}
|
||||
title={`Created on ${job.dateCreated}`}
|
||||
>
|
||||
{moment.unix(job.dateCreated).fromNow()}
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.listRow}>
|
||||
<div>Job status</div>
|
||||
<div>{job.statusText}</div>
|
||||
</div>
|
||||
<div>
|
||||
{job.algorithmLogUrl ? (
|
||||
<a href={job.algorithmLogUrl}> Algorithm log</a>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
{job.resultsUrl ? (
|
||||
<>
|
||||
<div>Output URL</div>
|
||||
{job.resultsUrl.map((result: string) => (
|
||||
<a href={result} key={shortid.generate()}>
|
||||
{' '}
|
||||
{result.substring(0, 52)}...
|
||||
</a>
|
||||
))}
|
||||
</>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</div>
|
||||
</article>
|
||||
)
|
||||
}
|
|
@ -21,14 +21,14 @@ export default class Pagination extends PureComponent<
|
|||
private mq = window.matchMedia && window.matchMedia('(min-width: 600px)')
|
||||
|
||||
public componentDidMount() {
|
||||
if (window.matchMedia) {
|
||||
if (window && window.matchMedia) {
|
||||
this.mq.addListener(this.viewportChange)
|
||||
this.viewportChange(this.mq)
|
||||
}
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
if (window.matchMedia) {
|
||||
if (window && window.matchMedia) {
|
||||
this.mq.removeListener(this.viewportChange)
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ export default class Pagination extends PureComponent<
|
|||
// adapt based on media query match
|
||||
marginPagesDisplayed={smallViewport ? 0 : 1}
|
||||
pageRangeDisplayed={smallViewport ? 3 : 6}
|
||||
onPageChange={data => handlePageClick(data)}
|
||||
onPageChange={(data) => handlePageClick(data)}
|
||||
disableInitialCallback
|
||||
previousLabel="←"
|
||||
nextLabel="→"
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
@import '../../styles/variables';
|
||||
|
||||
.results {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
grid-gap: $spacer;
|
||||
max-width: calc(18rem + #{$spacer * 2});
|
||||
margin: auto;
|
||||
margin-top: $spacer * 2;
|
||||
|
||||
@media (min-width: $break-point--small) {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
max-width: none;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
@media (min-width: $break-point--medium) {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
.simple {
|
||||
composes: results;
|
||||
margin-top: 0;
|
||||
|
||||
@media (min-width: $break-point--medium) {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
text-align: center;
|
||||
margin-top: $spacer * 4;
|
||||
color: $brand-grey-light;
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
import React from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { DDO } from '@oceanprotocol/squid'
|
||||
import Spinner from '../atoms/Spinner'
|
||||
import AssetTeaser from './AssetTeaser'
|
||||
import styles from './SearchResults.module.scss'
|
||||
|
||||
export interface SearchResultsState {
|
||||
results: DDO[]
|
||||
totalResults: number
|
||||
offset: number
|
||||
totalPages: number
|
||||
currentPage: number
|
||||
isLoading: boolean
|
||||
}
|
||||
|
||||
export default function SearchResults({
|
||||
isLoading,
|
||||
results,
|
||||
simpleGrid
|
||||
}: {
|
||||
isLoading: boolean
|
||||
results: DDO[]
|
||||
simpleGrid?: boolean
|
||||
}) {
|
||||
return isLoading ? (
|
||||
<Spinner message="Searching..." />
|
||||
) : results && results.length ? (
|
||||
<div className={simpleGrid ? styles.simple : styles.results}>
|
||||
{results.map((asset: any) => (
|
||||
<AssetTeaser key={asset.id} asset={asset} />
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className={styles.empty}>
|
||||
<p>No Data Sets Found.</p>
|
||||
<Link to="/publish">+ Publish A Data Set</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -19,15 +19,15 @@
|
|||
.indicatorActive {
|
||||
display: inline-block;
|
||||
margin-right: $spacer / 4;
|
||||
margin-bottom: -.1rem;
|
||||
margin-bottom: -0.1rem;
|
||||
}
|
||||
|
||||
.indicator {
|
||||
composes: statusIndicator from '../AccountStatus/Indicator.module.scss';
|
||||
composes: statusindicator from '../AccountStatus/Indicator.module.scss';
|
||||
}
|
||||
|
||||
.indicatorActive {
|
||||
composes: statusIndicatorActive from '../AccountStatus/Indicator.module.scss';
|
||||
composes: statusindicatoractive from '../AccountStatus/Indicator.module.scss';
|
||||
}
|
||||
|
||||
.indicatorLabel {
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
td {
|
||||
padding: $spacer / 6 $spacer / 2;
|
||||
|
||||
// stylelint-disable-next-line selector-max-compound-selectors
|
||||
&,
|
||||
code {
|
||||
font-size: $font-size-mini;
|
||||
|
@ -33,7 +32,6 @@
|
|||
text-align: right;
|
||||
}
|
||||
|
||||
// stylelint-disable-next-line selector-no-qualifying-type
|
||||
&[colspan] {
|
||||
padding: 0;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ export const VersionTableContracts = ({
|
|||
Object.keys(contracts)
|
||||
// sort alphabetically
|
||||
.sort((a, b) => a.localeCompare(b))
|
||||
.map(key => {
|
||||
.map((key) => {
|
||||
const submarineLink = `https://submarine.${
|
||||
network === 'pacific'
|
||||
? 'oceanprotocol'
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
padding: 0;
|
||||
margin: 0;
|
||||
margin-left: -1rem;
|
||||
margin-top: -.1rem;
|
||||
padding-right: .5rem;
|
||||
margin-top: -0.1rem;
|
||||
padding-right: 0.5rem;
|
||||
cursor: pointer;
|
||||
|
||||
svg {
|
||||
fill: $brand-grey-light;
|
||||
transition: .2s ease-out;
|
||||
transition: 0.2s ease-out;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import { StateMock } from '@react-mock/state'
|
|||
import VersionNumbers from '.'
|
||||
|
||||
import { User } from '../../../context'
|
||||
import { userMockConnected } from '../../../../__mocks__/user-mock'
|
||||
import { userMockConnected } from '../../../__mocks__/user-mock'
|
||||
|
||||
afterEach(() => {
|
||||
mockAxios.reset()
|
||||
|
|
|
@ -148,7 +148,7 @@ export default class VersionNumbers extends PureComponent<
|
|||
|
||||
return (
|
||||
<Market.Consumer>
|
||||
{market => (
|
||||
{(market) => (
|
||||
<p className={styles.versionsMinimal}>
|
||||
<a
|
||||
title={`${squid.name} v${squid.version}\n${brizo.name} v${brizo.version}\n${aquarius.name} v${aquarius.version}`}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
.latestAssetsWrap {
|
||||
// full width break out of container
|
||||
margin-right: calc(-50vw + 50%);
|
||||
// margin-right: calc(-50vw + 50%);
|
||||
}
|
||||
|
||||
.latestAssets {
|
||||
|
|
|
@ -3,7 +3,7 @@ import { BrowserRouter } from 'react-router-dom'
|
|||
import { render } from '@testing-library/react'
|
||||
import AssetsLatest from './AssetsLatest'
|
||||
import { User } from '../../context'
|
||||
import { userMockConnected } from '../../../__mocks__/user-mock'
|
||||
import { userMockConnected } from '../../__mocks__/user-mock'
|
||||
|
||||
describe('AssetsLatest', () => {
|
||||
it('renders without crashing', () => {
|
||||
|
|
|
@ -37,7 +37,7 @@ export default class AssetsLatest extends PureComponent<{}, AssetsLatestState> {
|
|||
}
|
||||
|
||||
try {
|
||||
const search = await ocean.aquarius.queryMetadata(searchQuery)
|
||||
const search = await ocean.assets.query(searchQuery)
|
||||
this.setState({
|
||||
latestAssets: search.results,
|
||||
isLoadingLatest: false
|
||||
|
|
|
@ -79,7 +79,7 @@ export default class AssetsUser extends PureComponent<
|
|||
<>
|
||||
{results
|
||||
.slice(0, recent || undefined)
|
||||
.filter(asset => !!asset)
|
||||
.filter((asset) => !!asset)
|
||||
.map((asset: any) => (
|
||||
<AssetTeaser
|
||||
list={list}
|
||||
|
|
|
@ -62,7 +62,6 @@
|
|||
transform: none;
|
||||
|
||||
// category image
|
||||
// stylelint-disable-next-line
|
||||
.channelTitle + div {
|
||||
opacity: 1;
|
||||
background-size: 105%;
|
||||
|
@ -74,13 +73,3 @@
|
|||
.channelTeaser {
|
||||
color: $brand-grey;
|
||||
}
|
||||
|
||||
.channelResults {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
grid-gap: $spacer;
|
||||
|
||||
@media (min-width: $break-point--small) {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import { render } from '@testing-library/react'
|
|||
import ChannelTeaser from './ChannelTeaser'
|
||||
import { BrowserRouter } from 'react-router-dom'
|
||||
import { User } from '../../context'
|
||||
import { userMockConnected } from '../../../__mocks__/user-mock'
|
||||
import { userMockConnected } from '../../__mocks__/user-mock'
|
||||
|
||||
describe('ChannelTeaser', () => {
|
||||
it('renders without crashing', () => {
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
import React, { Component } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { User } from '../../context'
|
||||
import { Logger } from '@oceanprotocol/squid'
|
||||
import Spinner from '../atoms/Spinner'
|
||||
import AssetTeaser from '../molecules/AssetTeaser'
|
||||
import { Logger, DDO } from '@oceanprotocol/squid'
|
||||
import CategoryImage from '../atoms/CategoryImage'
|
||||
import SearchResults from '../molecules/SearchResults'
|
||||
import styles from './ChannelTeaser.module.scss'
|
||||
import channels from '../../data/channels.json'
|
||||
import CategoryImage from '../atoms/CategoryImage'
|
||||
|
||||
interface ChannelTeaserProps {
|
||||
channel: string
|
||||
}
|
||||
|
||||
interface ChannelTeaserState {
|
||||
channelAssets?: any[]
|
||||
channelAssets?: DDO[]
|
||||
isLoadingChannel?: boolean
|
||||
}
|
||||
|
||||
|
@ -26,7 +25,7 @@ export default class ChannelTeaser extends Component<
|
|||
// Get channel content
|
||||
public channel = channels.items
|
||||
.filter(({ tag }) => tag === this.props.channel)
|
||||
.map(channel => channel)[0]
|
||||
.map((channel) => channel)[0]
|
||||
|
||||
public state = {
|
||||
channelAssets: [],
|
||||
|
@ -52,7 +51,7 @@ export default class ChannelTeaser extends Component<
|
|||
}
|
||||
|
||||
try {
|
||||
const search = await ocean.aquarius.queryMetadata(searchQuery)
|
||||
const search = await ocean.assets.query(searchQuery)
|
||||
this.setState({
|
||||
channelAssets: search.results,
|
||||
isLoadingChannel: false
|
||||
|
@ -81,17 +80,11 @@ export default class ChannelTeaser extends Component<
|
|||
</header>
|
||||
</div>
|
||||
<div>
|
||||
{isLoadingChannel ? (
|
||||
<Spinner message="Loading..." />
|
||||
) : channelAssets && channelAssets.length ? (
|
||||
<div className={styles.channelResults}>
|
||||
{channelAssets.map((asset: any) => (
|
||||
<AssetTeaser key={asset.id} asset={asset} />
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div>No data sets found.</div>
|
||||
)}
|
||||
<SearchResults
|
||||
isLoading={isLoadingChannel}
|
||||
results={channelAssets}
|
||||
simpleGrid
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
width: 100px;
|
||||
height: auto;
|
||||
vertical-align: middle;
|
||||
margin-top: -.05rem;
|
||||
margin-top: -0.05rem;
|
||||
margin-left: $spacer / 6;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ export default function Footer() {
|
|||
</small>
|
||||
|
||||
<nav className={styles.links}>
|
||||
{meta.social.map(site => (
|
||||
{meta.social.map((site) => (
|
||||
<a key={site.title} href={site.url}>
|
||||
{site.title}
|
||||
</a>
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
&::-webkit-scrollbar {
|
||||
width: 3px;
|
||||
height: 3px;
|
||||
transition: opacity .2s ease-out;
|
||||
transition: opacity 0.2s ease-out;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,5 +99,5 @@
|
|||
|
||||
.accountStatus {
|
||||
margin-left: $spacer / 2;
|
||||
margin-bottom: -.5rem;
|
||||
margin-bottom: -0.5rem;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import { ReactComponent as Logo } from '@oceanprotocol/art/logo/logo.svg'
|
|||
import AccountStatus from '../molecules/AccountStatus'
|
||||
import styles from './Header.module.scss'
|
||||
|
||||
import menu from '../../data/menu.json'
|
||||
import menu from '../../data/menu'
|
||||
import meta from '../../data/meta.json'
|
||||
|
||||
const MenuItem = ({ item }: { item: any }) => (
|
||||
|
@ -29,7 +29,7 @@ export default class Header extends PureComponent {
|
|||
</NavLink>
|
||||
|
||||
<nav className={styles.headerMenu}>
|
||||
{menu.map(item => (
|
||||
{menu.map((item) => (
|
||||
<MenuItem key={item.title} item={item} />
|
||||
))}
|
||||
<AccountStatus className={styles.accountStatus} />
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
import React, { useEffect, useState } from 'react'
|
||||
import { getUserJobs } from '../../utils/getUserJobs'
|
||||
import { User } from '../../context'
|
||||
import Spinner from '../atoms/Spinner'
|
||||
import JobTeaser from '../molecules/JobTeaser'
|
||||
|
||||
export default function JobsUser() {
|
||||
const { ocean, account } = React.useContext(User)
|
||||
const [jobList, setJobList] = useState<any[]>([])
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
useEffect(() => {
|
||||
setIsLoading(true)
|
||||
async function getJobs() {
|
||||
const userJobs = await getUserJobs(ocean, account)
|
||||
setJobList(userJobs as any)
|
||||
setIsLoading(false)
|
||||
}
|
||||
getJobs()
|
||||
}, [account, ocean])
|
||||
|
||||
return (
|
||||
<>
|
||||
{isLoading ? (
|
||||
<Spinner />
|
||||
) : jobList && jobList.length ? (
|
||||
jobList
|
||||
.reverse()
|
||||
.map((job: any) => <JobTeaser key={job.jobId} job={job} />)
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
@import '../../styles/variables';
|
||||
|
||||
.openLink {
|
||||
font-size: $font-size-small !important; // stylelint-disable-line
|
||||
font-size: $font-size-small !important;
|
||||
margin-left: $spacer / 2;
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
|||
align-items: flex-start;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
transition: border .2s ease-out;
|
||||
transition: border 0.2s ease-out;
|
||||
margin-bottom: $spacer;
|
||||
position: relative;
|
||||
|
||||
|
|
|
@ -3,11 +3,11 @@ import { render, fireEvent } from '@testing-library/react'
|
|||
import ReactModal from 'react-modal'
|
||||
import WalletSelector from './WalletSelector'
|
||||
import { User, Market } from '../../context'
|
||||
import { userMockConnected } from '../../../__mocks__/user-mock'
|
||||
import { marketMock } from '../../../__mocks__/market-mock'
|
||||
import { userMockConnected } from '../../__mocks__/user-mock'
|
||||
import { marketMock } from '../../__mocks__/market-mock'
|
||||
|
||||
describe('WalletSelector', () => {
|
||||
it('renders without crashing', async () => {
|
||||
it('renders without crashing', () => {
|
||||
ReactModal.setAppElement(document.createElement('div'))
|
||||
|
||||
const { container, getByText } = render(
|
||||
|
@ -20,11 +20,11 @@ describe('WalletSelector', () => {
|
|||
expect(container.firstChild).toBeInTheDocument()
|
||||
fireEvent.click(getByText('Select wallet'))
|
||||
|
||||
const burnerButton = await getByText('Burner Wallet')
|
||||
const burnerButton = getByText('Burner Wallet')
|
||||
fireEvent.click(burnerButton)
|
||||
|
||||
fireEvent.click(getByText('Select wallet'))
|
||||
// const metamaskButton = await getByText('MetaMask')
|
||||
// const metamaskButton = getByText('MetaMask')
|
||||
// fireEvent.click(metamaskButton)
|
||||
})
|
||||
})
|
||||
|
|
|
@ -90,7 +90,7 @@ export default class WalletSelector extends PureComponent<
|
|||
title={content.title}
|
||||
description={content.description}
|
||||
isOpen={this.state.isModalOpen}
|
||||
toggleModal={this.handleToggleModal}
|
||||
onToggleModal={this.handleToggleModal}
|
||||
>
|
||||
<div className={styles.info}>
|
||||
{content.buttons.map(({ title, description, icon }) => (
|
||||
|
|
|
@ -2,8 +2,8 @@ import React from 'react'
|
|||
import { render } from '@testing-library/react'
|
||||
import Web3message from './Web3message'
|
||||
import { User, Market } from '../../context'
|
||||
import { userMock, userMockConnected } from '../../../__mocks__/user-mock'
|
||||
import { marketMock } from '../../../__mocks__/market-mock'
|
||||
import { userMock, userMockConnected } from '../../__mocks__/user-mock'
|
||||
import { marketMock } from '../../__mocks__/market-mock'
|
||||
|
||||
describe('Web3message', () => {
|
||||
it('renders with burner wallet message', () => {
|
||||
|
|
|
@ -22,7 +22,7 @@ export default class Web3message extends PureComponent<{ extended?: boolean }> {
|
|||
|
||||
return (
|
||||
<User.Consumer>
|
||||
{user => (
|
||||
{(user) => (
|
||||
<em
|
||||
dangerouslySetInnerHTML={{
|
||||
__html:
|
||||
|
|
|
@ -119,15 +119,12 @@
|
|||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
/* stylelint-disable declaration-no-important */
|
||||
code {
|
||||
display: block;
|
||||
padding: 0 !important;
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
/* stylelint-enable declaration-no-important */
|
||||
|
||||
@media (min-width: $break-point--small) {
|
||||
width: 70%;
|
||||
}
|
||||
|
|
|
@ -3,14 +3,17 @@ import { render } from '@testing-library/react'
|
|||
import { DDO, MetaData } from '@oceanprotocol/squid'
|
||||
import { BrowserRouter as Router } from 'react-router-dom'
|
||||
import AssetDetails, { datafilesLine } from './AssetDetails'
|
||||
import oceanMock from '../../../__mocks__/ocean-mock'
|
||||
import ddoMock from '../../../__mocks__/ddo-mock'
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
describe('AssetDetails', () => {
|
||||
it('renders loading without crashing', () => {
|
||||
const { container } = render(
|
||||
<AssetDetails
|
||||
metadata={({ base: { name: '' } } as any) as MetaData}
|
||||
ddo={({} as any) as DDO}
|
||||
ocean={oceanMock}
|
||||
metadata={({ main: { name: '' } } as any) as MetaData}
|
||||
ddo={ddoMock}
|
||||
/>
|
||||
)
|
||||
expect(container.firstChild).toBeInTheDocument()
|
||||
|
@ -20,17 +23,20 @@ describe('AssetDetails', () => {
|
|||
const { container } = render(
|
||||
<Router>
|
||||
<AssetDetails
|
||||
ocean={oceanMock}
|
||||
metadata={
|
||||
({
|
||||
base: {
|
||||
main: {
|
||||
name: 'Hello',
|
||||
description: 'Description',
|
||||
categories: ['Category'],
|
||||
files: [{ index: 0 }]
|
||||
},
|
||||
additionalInformation: {
|
||||
description: 'Description',
|
||||
categories: ['Category']
|
||||
}
|
||||
} as any) as MetaData
|
||||
}
|
||||
ddo={({} as any) as DDO}
|
||||
ddo={ddoMock}
|
||||
/>
|
||||
</Router>
|
||||
)
|
||||
|
@ -44,7 +50,8 @@ describe('AssetDetails', () => {
|
|||
const files = [
|
||||
{
|
||||
index: 0,
|
||||
url: 'https://hello.com'
|
||||
url: 'https://hello.com',
|
||||
contentType: 'application/json'
|
||||
}
|
||||
]
|
||||
const { container } = render(datafilesLine(files))
|
||||
|
@ -55,11 +62,13 @@ describe('AssetDetails', () => {
|
|||
const files = [
|
||||
{
|
||||
index: 0,
|
||||
url: 'https://hello.com'
|
||||
url: 'https://hello.com',
|
||||
contentType: 'application/json'
|
||||
},
|
||||
{
|
||||
index: 1,
|
||||
url: 'https://hello2.com'
|
||||
url: 'https://hello2.com',
|
||||
contentType: 'application/json'
|
||||
}
|
||||
]
|
||||
const { container } = render(datafilesLine(files))
|
||||
|
|
|
@ -7,10 +7,12 @@ import CategoryLink from '../../atoms/CategoryLink'
|
|||
import styles from './AssetDetails.module.scss'
|
||||
import AssetFilesDetails from './AssetFilesDetails'
|
||||
import Report from './Report'
|
||||
import { allowPricing } from '../../../config'
|
||||
import Web3 from 'web3'
|
||||
import AssetsJob from './AssetJob'
|
||||
import Web3message from '../../organisms/Web3message'
|
||||
|
||||
interface AssetDetailsProps {
|
||||
ocean: any
|
||||
metadata: MetaData
|
||||
ddo: DDO
|
||||
}
|
||||
|
@ -31,19 +33,25 @@ const MetaFixedItem = ({ name, value }: { name: string; value: string }) => (
|
|||
</li>
|
||||
)
|
||||
|
||||
export default function AssetDetails({ metadata, ddo }: AssetDetailsProps) {
|
||||
const { base } = metadata
|
||||
const price = base.price && Web3.utils.fromWei(base.price.toString())
|
||||
export default function AssetDetails({
|
||||
metadata,
|
||||
ddo,
|
||||
ocean
|
||||
}: AssetDetailsProps) {
|
||||
const { main, additionalInformation } = metadata
|
||||
const price = main.price && Web3.utils.fromWei(main.price.toString())
|
||||
const isCompute = !!ddo.findServiceByType('compute')
|
||||
const isAccess = !!ddo.findServiceByType('access')
|
||||
|
||||
const metaFixed = [
|
||||
{
|
||||
name: 'Author',
|
||||
value: base.author,
|
||||
value: main.author,
|
||||
show: true
|
||||
},
|
||||
{
|
||||
name: 'License',
|
||||
value: base.license,
|
||||
value: main.license,
|
||||
show: true
|
||||
},
|
||||
{
|
||||
|
@ -61,36 +69,45 @@ export default function AssetDetails({ metadata, ddo }: AssetDetailsProps) {
|
|||
return (
|
||||
<>
|
||||
<aside className={styles.metaPrimary}>
|
||||
<h2 className={styles.copyrightHolder} title="Copyright Holder">
|
||||
{base.copyrightHolder}
|
||||
</h2>
|
||||
{additionalInformation &&
|
||||
additionalInformation.copyrightHolder && (
|
||||
<h2
|
||||
className={styles.copyrightHolder}
|
||||
title="Copyright Holder"
|
||||
>
|
||||
{additionalInformation.copyrightHolder}
|
||||
</h2>
|
||||
)}
|
||||
<div className={styles.metaPrimaryData}>
|
||||
<span
|
||||
title={`Date created, published on ${base.datePublished}`}
|
||||
title={`Date created, published on ${main.datePublished}`}
|
||||
>
|
||||
<Moment
|
||||
date={base.dateCreated}
|
||||
date={main.dateCreated}
|
||||
format="L"
|
||||
interval={0}
|
||||
/>
|
||||
</span>
|
||||
|
||||
{base.categories && (
|
||||
<CategoryLink category={base.categories[0]} />
|
||||
)}
|
||||
{additionalInformation &&
|
||||
additionalInformation.categories && (
|
||||
<CategoryLink
|
||||
category={additionalInformation.categories[0]}
|
||||
/>
|
||||
)}
|
||||
|
||||
{base.files && datafilesLine(base.files)}
|
||||
{main.files && datafilesLine(main.files)}
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
{base.description && (
|
||||
{additionalInformation && additionalInformation.description && (
|
||||
<Markdown
|
||||
text={base.description}
|
||||
text={additionalInformation.description}
|
||||
className={styles.description}
|
||||
/>
|
||||
)}
|
||||
|
||||
<Report did={ddo.id} title={metadata.base.name} />
|
||||
<Report did={ddo.id} title={main.name} />
|
||||
|
||||
<div className={styles.metaFixed}>
|
||||
<h2
|
||||
|
@ -101,8 +118,8 @@ export default function AssetDetails({ metadata, ddo }: AssetDetailsProps) {
|
|||
</h2>
|
||||
<ul>
|
||||
{metaFixed
|
||||
.filter(item => item.show)
|
||||
.map(item => (
|
||||
.filter((item) => item.show)
|
||||
.map((item) => (
|
||||
<MetaFixedItem
|
||||
key={shortid.generate()}
|
||||
name={item.name}
|
||||
|
@ -111,8 +128,14 @@ export default function AssetDetails({ metadata, ddo }: AssetDetailsProps) {
|
|||
))}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<AssetFilesDetails files={base.files ? base.files : []} ddo={ddo} />
|
||||
{isAccess ? (
|
||||
<AssetFilesDetails
|
||||
files={main.files ? main.files : []}
|
||||
ddo={ddo}
|
||||
/>
|
||||
) : null}
|
||||
{isCompute ? <AssetsJob ddo={ddo} ocean={ocean} /> : null}
|
||||
{isCompute || isAccess ? <Web3message /> : null}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
.empty {
|
||||
font-size: $font-size-mini;
|
||||
font-weight: $font-weight-base;
|
||||
opacity: .75;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
// move spinner a bit up
|
||||
|
|
|
@ -7,20 +7,20 @@ import { StateMock } from '@react-mock/state'
|
|||
import ReactGA from 'react-ga'
|
||||
import { User, Market } from '../../../context'
|
||||
import AssetFile, { messages } from './AssetFile'
|
||||
import { userMockConnected } from '../../../../__mocks__/user-mock'
|
||||
import { marketMock } from '../../../../__mocks__/market-mock'
|
||||
import { userMockConnected } from '../../../__mocks__/user-mock'
|
||||
import { marketMock } from '../../../__mocks__/market-mock'
|
||||
|
||||
const file = {
|
||||
index: 0,
|
||||
url: 'https://hello.com',
|
||||
contentType: 'application/x-zip',
|
||||
contentLength: 100
|
||||
contentLength: '100'
|
||||
}
|
||||
|
||||
const ddo = ({
|
||||
id: 'xxx',
|
||||
findServiceByType: () => {
|
||||
return { serviceDefinitionId: 'xxx' }
|
||||
return { index: 'xxx' }
|
||||
}
|
||||
} as any) as DDO
|
||||
|
||||
|
|
|
@ -59,8 +59,6 @@ export default class AssetFile extends PureComponent<
|
|||
|
||||
try {
|
||||
const accounts = await ocean.accounts.list()
|
||||
const service = ddo.findServiceByType('Access')
|
||||
|
||||
const agreements = await ocean.keeper.conditions.accessSecretStoreCondition.getGrantedDidByConsumer(
|
||||
accounts[0].id
|
||||
)
|
||||
|
@ -74,7 +72,7 @@ export default class AssetFile extends PureComponent<
|
|||
;({ agreementId } = agreement)
|
||||
} else {
|
||||
agreementId = await ocean.assets
|
||||
.order(ddo.id, service.serviceDefinitionId, accounts[0])
|
||||
.order(ddo.id, accounts[0])
|
||||
.next((step: number) => this.setState({ step }))
|
||||
}
|
||||
|
||||
|
@ -84,7 +82,6 @@ export default class AssetFile extends PureComponent<
|
|||
const path = await ocean.assets.consume(
|
||||
agreementId,
|
||||
ddo.id,
|
||||
service.serviceDefinitionId,
|
||||
accounts[0],
|
||||
'',
|
||||
index
|
||||
|
@ -119,11 +116,9 @@ export default class AssetFile extends PureComponent<
|
|||
<ul key={index} className={styles.file}>
|
||||
{contentType || contentLength ? (
|
||||
<>
|
||||
<li>{cleanupContentType(contentType)}</li>
|
||||
<li>
|
||||
{contentType && cleanupContentType(contentType)}
|
||||
</li>
|
||||
<li>
|
||||
{contentLength && contentLength > 0
|
||||
{contentLength && contentLength !== '0'
|
||||
? filesize(contentLength)
|
||||
: ''}
|
||||
</li>
|
||||
|
@ -139,7 +134,7 @@ export default class AssetFile extends PureComponent<
|
|||
<Spinner message={messages[step]} />
|
||||
) : (
|
||||
<Market.Consumer>
|
||||
{market => (
|
||||
{(market) => (
|
||||
<Button
|
||||
primary
|
||||
className={styles.buttonMain}
|
||||
|
|
|
@ -2,7 +2,6 @@ import React, { PureComponent } from 'react'
|
|||
import { DDO, File } from '@oceanprotocol/squid'
|
||||
import AssetFile from './AssetFile'
|
||||
import { User } from '../../../context'
|
||||
import Web3message from '../../organisms/Web3message'
|
||||
import styles from './AssetFilesDetails.module.scss'
|
||||
|
||||
export default class AssetFilesDetails extends PureComponent<{
|
||||
|
@ -15,11 +14,10 @@ export default class AssetFilesDetails extends PureComponent<{
|
|||
return files.length ? (
|
||||
<>
|
||||
<div className={styles.files}>
|
||||
{files.map(file => (
|
||||
{files.map((file) => (
|
||||
<AssetFile key={file.index} ddo={ddo} file={file} />
|
||||
))}
|
||||
</div>
|
||||
<Web3message />
|
||||
</>
|
||||
) : (
|
||||
<div>No files attached.</div>
|
||||
|
|
|
@ -0,0 +1,102 @@
|
|||
@import '../../../styles/variables';
|
||||
|
||||
.box {
|
||||
margin-bottom: $spacer / 2;
|
||||
background: $brand-white;
|
||||
border-radius: $border-radius;
|
||||
border: 1px solid $brand-grey-lighter;
|
||||
padding: $spacer / 2;
|
||||
}
|
||||
|
||||
.dataType {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.dragndrop {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
height: 90px;
|
||||
color: $brand-grey-light;
|
||||
background-color: $brand-white;
|
||||
}
|
||||
|
||||
.filleddragndrop {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
font-weight: 900;
|
||||
height: 90px;
|
||||
color: $brand-grey;
|
||||
background-color: $brand-white;
|
||||
}
|
||||
|
||||
.inputWrap {
|
||||
margin-top: $spacer / 4;
|
||||
background: $brand-gradient;
|
||||
border-radius: $border-radius;
|
||||
padding: 2px;
|
||||
display: flex;
|
||||
position: relative;
|
||||
|
||||
&.isFocused {
|
||||
background: $brand-black;
|
||||
}
|
||||
|
||||
> div,
|
||||
> div > div {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.jobButtonWrapper {
|
||||
text-align: right;
|
||||
margin-top: $spacer / 4;
|
||||
}
|
||||
|
||||
.error {
|
||||
text-align: center;
|
||||
color: $red;
|
||||
font-size: $font-size-small;
|
||||
}
|
||||
|
||||
.message {
|
||||
margin-bottom: $spacer;
|
||||
}
|
||||
|
||||
.success {
|
||||
margin-top: $spacer / 1.5;
|
||||
composes: message;
|
||||
background: $green;
|
||||
padding: $spacer / 1.5;
|
||||
border-radius: $border-radius;
|
||||
color: $brand-white;
|
||||
font-weight: $font-weight-bold;
|
||||
text-align: center;
|
||||
|
||||
&,
|
||||
a,
|
||||
button {
|
||||
color: $brand-white;
|
||||
}
|
||||
|
||||
a,
|
||||
button {
|
||||
transition: color 0.2s ease-out;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: $brand-pink;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
display: inline-block;
|
||||
margin-right: $spacer;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,155 @@
|
|||
import React, { ChangeEvent, useState } from 'react'
|
||||
import { DDO } from '@oceanprotocol/squid'
|
||||
import Input from '../../atoms/Form/Input'
|
||||
import computeOptions from '../../../data/computeOptions.json'
|
||||
import styles from './AssetJob.module.scss'
|
||||
import Spinner from '../../atoms/Spinner'
|
||||
import Button from '../../atoms/Button'
|
||||
import { messages } from './AssetFile'
|
||||
import ReactDropzone from 'react-dropzone'
|
||||
import { readFileContent } from '../../../utils/utils'
|
||||
|
||||
interface JobsProps {
|
||||
ocean: any
|
||||
ddo: DDO
|
||||
}
|
||||
|
||||
const rawAlgorithmMeta = {
|
||||
rawcode: `console.log('Hello world'!)`,
|
||||
format: 'docker-image',
|
||||
version: '0.1',
|
||||
container: {}
|
||||
}
|
||||
|
||||
export default function AssetsJobs({ ddo, ocean }: JobsProps) {
|
||||
const [isJobStarting, setIsJobStarting] = useState(false)
|
||||
const [step, setStep] = useState(99)
|
||||
const [error, setError] = useState('')
|
||||
|
||||
const [computeType, setComputeType] = useState('')
|
||||
const [computeValue, setComputeValue] = useState({})
|
||||
const [algorithmRawCode, setAlgorithmRawCode] = useState('')
|
||||
const [isPublished, setIsPublished] = useState(false)
|
||||
const [file, setFile] = useState(null)
|
||||
|
||||
const onDrop = async (files: any) => {
|
||||
setFile(files[0])
|
||||
const fileText = await readFileContent(files[0])
|
||||
setAlgorithmRawCode(fileText)
|
||||
}
|
||||
|
||||
const handleSelectChange = (event: ChangeEvent<HTMLInputElement>) => {
|
||||
const comType = event.target.value
|
||||
setComputeType(comType)
|
||||
|
||||
const selectedComputeOption = computeOptions.find(
|
||||
(x) => x.name === comType
|
||||
)
|
||||
if (selectedComputeOption !== undefined)
|
||||
setComputeValue(selectedComputeOption.value)
|
||||
}
|
||||
|
||||
const startJob = async () => {
|
||||
try {
|
||||
setIsJobStarting(true)
|
||||
setIsPublished(false)
|
||||
setError('')
|
||||
const accounts = await ocean.accounts.list()
|
||||
const ComputeOutput = {
|
||||
publishAlgorithmLog: false,
|
||||
publishOutput: false,
|
||||
brizoAddress: ocean.config.brizoAddress,
|
||||
brizoUri: ocean.config.brizoUri,
|
||||
metadataUri: ocean.config.aquariusUri,
|
||||
nodeUri: ocean.config.nodeUri,
|
||||
owner: accounts[0].getId(),
|
||||
secretStoreUri: ocean.config.secretStoreUri
|
||||
}
|
||||
|
||||
const agreement = await ocean.compute
|
||||
.order(accounts[0], ddo.id)
|
||||
.next((step: number) => setStep(step))
|
||||
|
||||
rawAlgorithmMeta.container = computeValue
|
||||
rawAlgorithmMeta.rawcode = algorithmRawCode
|
||||
|
||||
await ocean.compute.start(
|
||||
accounts[0],
|
||||
agreement,
|
||||
undefined,
|
||||
rawAlgorithmMeta,
|
||||
ComputeOutput
|
||||
)
|
||||
setIsPublished(true)
|
||||
setFile(null)
|
||||
} catch (error) {
|
||||
setError('Failed to start job!')
|
||||
console.error(error)
|
||||
}
|
||||
setIsJobStarting(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<span className={styles.bold}>New job</span>
|
||||
<div className={styles.dataType}>
|
||||
<Input
|
||||
type="select"
|
||||
name="select"
|
||||
label="Select image to run the algorithm"
|
||||
placeholder=""
|
||||
value={computeType}
|
||||
options={computeOptions.map((x) => x.name)}
|
||||
onChange={handleSelectChange}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<div className={styles.inputWrap}>
|
||||
<ReactDropzone
|
||||
onDrop={(acceptedFiles) => onDrop(acceptedFiles)}
|
||||
>
|
||||
{({ getRootProps, getInputProps }) => (
|
||||
<div {...getRootProps()}>
|
||||
<input {...getInputProps()} />
|
||||
{file === null && (
|
||||
<div className={styles.dragndrop}>
|
||||
Click or drop your notebook here
|
||||
</div>
|
||||
)}
|
||||
{file !== null && (
|
||||
<div className={styles.filleddragndrop}>
|
||||
You selected: {(file as any).path}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</ReactDropzone>
|
||||
</div>
|
||||
<div className={styles.jobButtonWrapper}>
|
||||
<Button
|
||||
primary
|
||||
onClick={() => startJob()}
|
||||
disabled={
|
||||
isJobStarting || file === null || computeType === ''
|
||||
}
|
||||
name="Purchase access"
|
||||
>
|
||||
Start job
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
{isJobStarting ? <Spinner message={messages[step]} /> : ''}
|
||||
{error !== '' && <div className={styles.error}>{error}</div>}
|
||||
{isPublished ? (
|
||||
<div className={styles.success}>
|
||||
<p>Your job started!</p>
|
||||
<Button link to="/history/">
|
||||
Watch the progress in the history page.
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -34,7 +34,30 @@ describe('Report', () => {
|
|||
expect(comment).toHaveTextContent('Plants')
|
||||
fireEvent.click(getByTestId('report'))
|
||||
mockAxios.mockResponse(mockResponse)
|
||||
// expect(mockAxios.post).toHaveBeenCalled()
|
||||
expect(mockAxios).toHaveBeenCalled()
|
||||
|
||||
// close modal
|
||||
fireEvent.click(getByTestId('closeModal'))
|
||||
})
|
||||
|
||||
it('catches response error', async () => {
|
||||
ReactModal.setAppElement(document.createElement('div'))
|
||||
|
||||
const { getByText, getByLabelText, getByTestId } = render(
|
||||
<Report did="did:xxx" title="Hello" />
|
||||
)
|
||||
// open modal
|
||||
fireEvent.click(getByText('Report Data Set'))
|
||||
await wait(() => expect(getByText('did:xxx')).toBeInTheDocument())
|
||||
|
||||
// add comment
|
||||
const comment = getByLabelText('Comment')
|
||||
fireEvent.change(comment, {
|
||||
target: { value: 'Plants' }
|
||||
})
|
||||
expect(comment).toHaveTextContent('Plants')
|
||||
fireEvent.click(getByTestId('report'))
|
||||
mockAxios.mockError({ message: 'Error catch' })
|
||||
|
||||
// close modal
|
||||
fireEvent.click(getByTestId('closeModal'))
|
||||
|
|
|
@ -36,13 +36,13 @@ export default class Report extends PureComponent<
|
|||
this.signal.cancel()
|
||||
}
|
||||
|
||||
private inputChange = (event: ChangeEvent<HTMLInputElement>) => {
|
||||
private handleInputChange = (event: ChangeEvent<HTMLInputElement>) => {
|
||||
this.setState({
|
||||
comment: event.target.value
|
||||
})
|
||||
}
|
||||
|
||||
private toggleModal = () => {
|
||||
private handleToggleModal = () => {
|
||||
this.setState({ isModalOpen: !this.state.isModalOpen })
|
||||
this.state.isModalOpen && this.reset()
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ export default class Report extends PureComponent<
|
|||
<Button
|
||||
link
|
||||
className={styles.openLink}
|
||||
onClick={this.toggleModal}
|
||||
onClick={this.handleToggleModal}
|
||||
>
|
||||
Report Data Set
|
||||
</Button>
|
||||
|
@ -108,7 +108,7 @@ export default class Report extends PureComponent<
|
|||
title="Report Data Set"
|
||||
description="Found some faulty metadata, wrongly attributed data, or anything else wrong with this data set? Tell us about it and we will take a look."
|
||||
isOpen={this.state.isModalOpen}
|
||||
toggleModal={this.toggleModal}
|
||||
onToggleModal={this.handleToggleModal}
|
||||
>
|
||||
<div className={styles.info}>
|
||||
<h3>{this.props.title}</h3>
|
||||
|
@ -135,7 +135,7 @@ export default class Report extends PureComponent<
|
|||
help="Briefly describe what is wrong with this asset. If you want to get contacted by us, add your email at the end."
|
||||
required
|
||||
value={this.state.comment}
|
||||
onChange={this.inputChange}
|
||||
onChange={this.handleInputChange}
|
||||
rows={1}
|
||||
/>
|
||||
<Button
|
||||
|
|
|
@ -20,18 +20,22 @@ interface AssetProps {
|
|||
}
|
||||
|
||||
interface AssetState {
|
||||
ocean: any
|
||||
ddo: DDO
|
||||
metadata: MetaData
|
||||
error: string
|
||||
isLoading: boolean
|
||||
}
|
||||
|
||||
class Asset extends Component<AssetProps, AssetState> {
|
||||
public static contextType = User
|
||||
|
||||
public state = {
|
||||
ocean: undefined,
|
||||
ddo: ({} as any) as DDO,
|
||||
metadata: ({ base: { name: '' } } as any) as MetaData,
|
||||
error: ''
|
||||
metadata: ({ main: { name: '' } } as any) as MetaData,
|
||||
computeMetadata: undefined,
|
||||
error: '',
|
||||
isLoading: true
|
||||
}
|
||||
|
||||
public async componentDidMount() {
|
||||
|
@ -42,8 +46,14 @@ class Asset extends Component<AssetProps, AssetState> {
|
|||
try {
|
||||
const { ocean } = this.context
|
||||
const ddo = await ocean.assets.resolve(this.props.match.params.did)
|
||||
const { metadata } = ddo.findServiceByType('Metadata')
|
||||
this.setState({ ddo, metadata })
|
||||
const { attributes } = ddo.findServiceByType('metadata')
|
||||
|
||||
this.setState({
|
||||
ocean,
|
||||
ddo,
|
||||
metadata: attributes,
|
||||
isLoading: false
|
||||
})
|
||||
} catch (error) {
|
||||
Logger.error(error.message)
|
||||
this.setState({
|
||||
|
@ -53,8 +63,9 @@ class Asset extends Component<AssetProps, AssetState> {
|
|||
}
|
||||
|
||||
public render() {
|
||||
const { metadata, ddo, error } = this.state
|
||||
const isLoading = metadata.base.name === ''
|
||||
const { metadata, ddo, error, isLoading, ocean } = this.state
|
||||
const { main, additionalInformation } = metadata
|
||||
|
||||
const hasError = error !== ''
|
||||
|
||||
return isLoading && !hasError ? (
|
||||
|
@ -68,19 +79,20 @@ class Asset extends Component<AssetProps, AssetState> {
|
|||
</Content>
|
||||
) : (
|
||||
<Route
|
||||
title={metadata.base.name}
|
||||
title={main.name}
|
||||
image={
|
||||
metadata.base.categories && (
|
||||
additionalInformation &&
|
||||
additionalInformation.categories && (
|
||||
<CategoryImage
|
||||
header
|
||||
dimmed
|
||||
category={metadata.base.categories[0]}
|
||||
category={additionalInformation.categories[0]}
|
||||
/>
|
||||
)
|
||||
}
|
||||
>
|
||||
<Content>
|
||||
<AssetDetails metadata={metadata} ddo={ddo} />
|
||||
<AssetDetails metadata={metadata} ddo={ddo} ocean={ocean} />
|
||||
</Content>
|
||||
</Route>
|
||||
)
|
||||
|
|
|
@ -1,21 +1 @@
|
|||
@import '../../styles/variables';
|
||||
|
||||
.results {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
grid-gap: $spacer;
|
||||
max-width: calc(18rem + #{$spacer * 2});
|
||||
margin: auto;
|
||||
margin-top: $spacer * 2;
|
||||
|
||||
@media (min-width: $break-point--small) {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
max-width: none;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
@media (min-width: $break-point--medium) {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import { render } from '@testing-library/react'
|
|||
import Channel from './Channel'
|
||||
import { User } from '../../context'
|
||||
import { createMemoryHistory } from 'history'
|
||||
import { userMockConnected } from '../../../__mocks__/user-mock'
|
||||
import { userMockConnected } from '../../__mocks__/user-mock'
|
||||
import { MemoryRouter } from 'react-router'
|
||||
|
||||
describe('Channel', () => {
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
import React, { PureComponent } from 'react'
|
||||
import { Logger } from '@oceanprotocol/squid'
|
||||
import { History } from 'history'
|
||||
import Spinner from '../../components/atoms/Spinner'
|
||||
import Route from '../../components/templates/Route'
|
||||
import { User } from '../../context'
|
||||
import AssetTeaser from '../molecules/AssetTeaser'
|
||||
import Pagination from '../../components/molecules/Pagination'
|
||||
import styles from './Channel.module.scss'
|
||||
import SearchResults, { SearchResultsState } from '../molecules/SearchResults'
|
||||
import Content from '../../components/atoms/Content'
|
||||
import channels from '../../data/channels.json'
|
||||
import CategoryImage from '../atoms/CategoryImage'
|
||||
|
@ -20,13 +18,7 @@ interface ChannelProps {
|
|||
}
|
||||
}
|
||||
|
||||
interface ChannelState {
|
||||
results: any[]
|
||||
totalResults: number
|
||||
offset: number
|
||||
totalPages: number
|
||||
currentPage: number
|
||||
isLoading: boolean
|
||||
interface ChannelState extends SearchResultsState {
|
||||
title: string
|
||||
description: string
|
||||
}
|
||||
|
@ -35,7 +27,7 @@ export default class Channel extends PureComponent<ChannelProps, ChannelState> {
|
|||
// get content data based on received channel param
|
||||
public channel = channels.items
|
||||
.filter(({ tag }) => tag === this.props.match.params.channel)
|
||||
.map(channel => channel)[0]
|
||||
.map((channel) => channel)[0]
|
||||
|
||||
public state = {
|
||||
results: [],
|
||||
|
@ -68,7 +60,7 @@ export default class Channel extends PureComponent<ChannelProps, ChannelState> {
|
|||
}
|
||||
|
||||
try {
|
||||
const search = await ocean.aquarius.queryMetadata(searchQuery)
|
||||
const search = await ocean.assets.query(searchQuery)
|
||||
this.setState({
|
||||
results: search.results,
|
||||
totalResults: search.totalResults,
|
||||
|
@ -81,31 +73,28 @@ export default class Channel extends PureComponent<ChannelProps, ChannelState> {
|
|||
}
|
||||
}
|
||||
|
||||
private handlePageClick = async (data: { selected: number }) => {
|
||||
private onPageClick = async (data: { selected: number }) => {
|
||||
// react-pagination starts counting at 0, we start at 1
|
||||
const toPage = data.selected + 1
|
||||
|
||||
this.props.history.push({ search: `?page=${toPage}` })
|
||||
|
||||
await this.setState({ currentPage: toPage, isLoading: true })
|
||||
this.setState({
|
||||
currentPage: toPage,
|
||||
isLoading: true
|
||||
})
|
||||
await this.getChannelAssets()
|
||||
}
|
||||
|
||||
public renderResults = () =>
|
||||
this.state.isLoading ? (
|
||||
<Spinner message="Searching..." />
|
||||
) : this.state.results && this.state.results.length ? (
|
||||
<div className={styles.results}>
|
||||
{this.state.results.map((asset: any) => (
|
||||
<AssetTeaser key={asset.id} asset={asset} />
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div>No data sets found.</div>
|
||||
)
|
||||
|
||||
public render() {
|
||||
const { title, description, totalPages, currentPage } = this.state
|
||||
const {
|
||||
title,
|
||||
description,
|
||||
totalPages,
|
||||
currentPage,
|
||||
isLoading,
|
||||
results
|
||||
} = this.state
|
||||
|
||||
return (
|
||||
<Route
|
||||
|
@ -114,12 +103,12 @@ export default class Channel extends PureComponent<ChannelProps, ChannelState> {
|
|||
image={<CategoryImage header category={title} />}
|
||||
>
|
||||
<Content wide>
|
||||
{this.renderResults()}
|
||||
<SearchResults isLoading={isLoading} results={results} />
|
||||
|
||||
<Pagination
|
||||
totalPages={totalPages}
|
||||
currentPage={currentPage}
|
||||
handlePageClick={this.handlePageClick}
|
||||
handlePageClick={this.onPageClick}
|
||||
/>
|
||||
</Content>
|
||||
</Route>
|
||||
|
|
|
@ -28,6 +28,15 @@ export const faucetUri =
|
|||
//
|
||||
export const verbose = true
|
||||
export const analyticsId = 'UA-60614729-11'
|
||||
export const allowPricing = process.env.REACT_APP_ALLOW_PRICING || false
|
||||
|
||||
export const showChannels =
|
||||
process.env.REACT_APP_SHOW_CHANNELS === 'true' || false
|
||||
export const allowPricing =
|
||||
process.env.REACT_APP_ALLOW_PRICING === 'true' || false
|
||||
export const showRequestTokens =
|
||||
process.env.REACT_APP_SHOW_REQUEST_TOKENS_BUTTON || false
|
||||
process.env.REACT_APP_SHOW_REQUEST_TOKENS_BUTTON === 'true' || false
|
||||
// https://ipfs.github.io/public-gateway-checker/
|
||||
export const ipfsGatewayUri =
|
||||
process.env.REACT_APP_IPFS_GATEWAY_URI || 'https://gateway.ipfs.io'
|
||||
export const ipfsNodeUri =
|
||||
process.env.REACT_APP_IPFS_NODE_URI || 'https://ipfs.infura.io:5001'
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import Web3 from 'web3'
|
||||
import HDWalletProvider from '@truffle/hdwallet-provider'
|
||||
import { nodeUri } from '../config'
|
||||
import HDWalletProvider from 'truffle-hdwallet-provider'
|
||||
import { requestFromFaucet } from '../ocean'
|
||||
const bip39 = require('bip39') // eslint-disable-line @typescript-eslint/no-var-requires
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const bip39 = require('bip39')
|
||||
|
||||
export class BurnerWalletProvider {
|
||||
private web3: Web3
|
||||
|
@ -12,10 +14,6 @@ export class BurnerWalletProvider {
|
|||
this.web3 = null as any
|
||||
}
|
||||
|
||||
public async isAvailable() {
|
||||
return true
|
||||
}
|
||||
|
||||
public async isLogged() {
|
||||
if (localStorage.getItem('seedphrase') !== null) {
|
||||
return true
|
||||
|
@ -28,20 +26,20 @@ export class BurnerWalletProvider {
|
|||
const isLogged = await this.isLogged()
|
||||
|
||||
if (isLogged) {
|
||||
mnemonic = (await localStorage.getItem('seedphrase')) as string
|
||||
mnemonic = localStorage.getItem('seedphrase')
|
||||
} else {
|
||||
mnemonic = bip39.generateMnemonic()
|
||||
localStorage.setItem('seedphrase', mnemonic)
|
||||
}
|
||||
|
||||
localStorage.setItem('logType', 'BurnerWallet')
|
||||
const provider = new HDWalletProvider(mnemonic, `${nodeUri}`, 0, 1)
|
||||
this.web3 = new Web3(provider)
|
||||
const provider = new HDWalletProvider(mnemonic, nodeUri, 0, 1)
|
||||
this.web3 = new Web3(provider as any)
|
||||
const accounts = await this.web3.eth.getAccounts()
|
||||
const balance = await this.web3.eth.getBalance(accounts[0])
|
||||
|
||||
// fill with Ether if account balance is empty
|
||||
balance === '0' && (await requestFromFaucet(provider.addresses[0]))
|
||||
balance === '0' && (await requestFromFaucet(provider.getAddress(0)))
|
||||
}
|
||||
|
||||
public async logout() {
|
||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
|||
import { render } from '@testing-library/react'
|
||||
import MarketProvider from './MarketProvider'
|
||||
import { User, Market } from '../context'
|
||||
import { userMockConnected } from '../../__mocks__/user-mock'
|
||||
import { userMockConnected } from '../__mocks__/user-mock'
|
||||
|
||||
describe('MarketProvider', () => {
|
||||
it('renders without crashing', () => {
|
||||
|
@ -10,7 +10,7 @@ describe('MarketProvider', () => {
|
|||
<User.Provider value={userMockConnected}>
|
||||
<MarketProvider ocean={userMockConnected.ocean as any}>
|
||||
<Market.Consumer>
|
||||
{market => (
|
||||
{(market) => (
|
||||
<div data-testid="hello">{market.network}</div>
|
||||
)}
|
||||
</Market.Consumer>
|
||||
|
|
|
@ -59,7 +59,7 @@ export default class MarketProvider extends PureComponent<
|
|||
|
||||
try {
|
||||
const { ocean } = this.props
|
||||
const search = await ocean.aquarius.queryMetadata(searchQuery)
|
||||
const search = await ocean.assets.query(searchQuery)
|
||||
this.setState({ totalAssets: search.totalResults })
|
||||
} catch (error) {
|
||||
Logger.error('Error', error.message)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue