From 6e2f32d8720cbdbc8755e11dc322efa1d8c2c158 Mon Sep 17 00:00:00 2001 From: Franck Wei <32359115+franckwei@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:47:04 +0100 Subject: [PATCH 1/2] Merge develop into main (#131) Co-authored-by: Dominik Zborowski Co-authored-by: Jacek Norbert Co-authored-by: Hugo Masclet Co-authored-by: Pedro Pereira Co-authored-by: Pedro Pereira Co-authored-by: Pedro Pereira Co-authored-by: Andreas Richter <708186+richtera@users.noreply.github.com> --- .env.example | 4 + .eslintrc.cjs | 2 + .github/auto_assign.yaml | 20 + .github/workflows/ci.yml | 2 + .github/workflows/review.yaml | 12 + .gitignore | 3 +- app.vue | 121 +- components/AppAvatar.vue | 63 + components/AppButtonConnectOrInstall.vue | 4 +- components/AppFooter.vue | 86 +- components/AppFooterNetworkSelect.vue | 45 + components/AppLoader.vue | 7 + components/AppModal.vue | 2 +- components/AppNavbar.vue | 59 +- components/AppNavbarProfileDropdown.vue | 8 +- components/AppNotFound.vue | 41 + components/AssetBalance.vue | 27 + components/AssetCreator.vue | 53 + components/AssetImages.vue | 22 +- components/AssetLinks.vue | 6 +- components/AssetListItem.vue | 56 + components/AssetOwnInfo.vue | 20 +- components/AssetSupply.vue | 27 + ...teDefault.vue => ModalTemplateDefault.vue} | 0 components/ModalTemplateSelectAssets.vue | 79 + components/ModalTemplateSwitchNetwork.vue | 57 + components/NftList.vue | 10 +- components/NftListCard.vue | 84 +- components/ProfileCard.vue | 60 + components/ProfileDetails.vue | 54 + components/ProfileHeader.vue | 63 - components/SendCard.vue | 8 +- components/SendCardAmount.vue | 95 + components/SendCardDraft.vue | 99 + components/SendCardHeader.vue | 21 + .../{SendPending.vue => SendCardPending.vue} | 4 +- components/SendCardProfileSearch.vue | 177 + .../{SendSuccess.vue => SendCardSuccess.vue} | 2 +- components/SendDraft.vue | 192 -- components/TokenList.vue | 13 +- components/TokenListCard.vue | 115 +- components/TokenListLyxCard.vue | 94 +- components/profile.vue | 50 - composables/useAsset.ts | 52 + composables/useBrowserExtension.ts | 143 +- composables/useConnectedProfile.ts | 23 + composables/useCurrency.ts | 38 + composables/useErc725.ts | 248 +- composables/useIntl.ts | 43 +- composables/useModal.ts | 2 + composables/useProfile.ts | 20 + composables/useProfileBase.ts | 24 - composables/useViewedProfile.ts | 21 + composables/useWeb3.ts | 7 +- layouts/default.vue | 9 - models/asset.ts | 62 + models/base.ts | 16 + models/creator.ts | 40 + models/image.ts | 36 + models/profile.ts | 71 + nuxt.config.ts | 23 +- package.json | 44 +- pages/404.vue | 38 +- pages/[...slug].vue | 3 + pages/[profileAddress]/index.vue | 79 +- pages/[profileAddress]/lyx-details.vue | 91 + .../nft/[nftAddress]/tokenId/[tokenId].vue | 129 - pages/[profileAddress]/send.vue | 176 +- .../[profileAddress]/token/[tokenAddress].vue | 94 - .../asset/[nftAddress]/tokenId/[tokenId].vue | 114 + pages/asset/[tokenAddress].vue | 102 + pages/index.vue | 25 +- plugins/1.isBrave.ts | 2 + plugins/2.isOpera.ts | 2 + plugins/index.d.ts | 2 + plugins/intl.ts | 12 +- public/images/lyx-token.svg | 12 + public/images/switch-network.png | Bin 0 -> 23467 bytes repositories/asset.ts | 190 + repositories/creator.ts | 26 + repositories/image.ts | 35 + repositories/profile.ts | 49 + shared/config.ts | 65 +- shared/enums.ts | 24 + shared/errors.ts | 10 +- shared/routes.ts | 13 +- site.meta.json | 6 +- stores/app.ts | 93 +- stores/currency.ts | 33 + stores/profileConnected.ts | 27 - stores/profileViewed.ts | 122 - stores/send.ts | 8 +- tailwind.config.js | 12 + .../e2e/404.spec.ts-snapshots/404-chrome.png | Bin 105465 -> 105554 bytes .../landing-no-extension-chrome.png | Bin 198937 -> 199522 bytes tests/e2e/lyx-details.spec.ts | 14 + tests/unit/utils/validateLsp3Metadata.spec.ts | 47 + translations/en_US.json | 35 +- tsconfig.json | 1 + types/assets.ts | 84 +- types/currency.ts | 9 + types/device.ts | 22 + types/enums.ts | 9 - types/global.d.ts | 55 +- types/modal.ts | 9 + types/network.ts | 14 + types/provider.d.ts | 30 + utils/assetChecks.ts | 16 + utils/browserInfo.ts | 2 + utils/checkNetwork.ts | 15 + utils/detectStandard.ts | 2 - utils/fetchAsset.ts | 21 + utils/fetchAssets.ts | 21 + utils/fetchLSP7Assets.ts | 103 +- utils/fetchLSP8Assets.ts | 169 +- utils/fetchLsp3Profile.ts | 55 + utils/fetchLsp4Creators.ts | 77 + utils/fetchLsp4Metadata.ts | 51 + utils/fetchLsp7Balance.ts | 16 + utils/fetchLsp8Metadata.ts | 69 + utils/fetchProfile.ts | 64 +- utils/fetcher.ts | 41 + utils/formatUrl.ts | 10 +- utils/fromWeiWithDecimals.ts | 41 + utils/getCurrentProfileAddress.ts | 10 + utils/getErrorMessage.ts | 37 + utils/getImages.ts | 97 + utils/getProfileImages.ts | 50 - utils/setupViewedAssets.ts | 17 - utils/setupViewedProfile.ts | 19 - ...{checkInterface.ts => supportInterface.ts} | 9 +- utils/validateLSP3.ts | 43 - utils/validateLSP4Metadata.ts | 6 +- utils/validateLsp3Metadata.ts | 92 + yarn.lock | 3049 ++++++++++------- 135 files changed, 5880 insertions(+), 3134 deletions(-) create mode 100644 .github/auto_assign.yaml create mode 100644 .github/workflows/review.yaml create mode 100644 components/AppAvatar.vue create mode 100644 components/AppFooterNetworkSelect.vue create mode 100644 components/AppLoader.vue create mode 100644 components/AppNotFound.vue create mode 100644 components/AssetBalance.vue create mode 100644 components/AssetCreator.vue create mode 100644 components/AssetListItem.vue create mode 100644 components/AssetSupply.vue rename components/{AppModalTemplateDefault.vue => ModalTemplateDefault.vue} (100%) create mode 100644 components/ModalTemplateSelectAssets.vue create mode 100644 components/ModalTemplateSwitchNetwork.vue create mode 100644 components/ProfileCard.vue create mode 100644 components/ProfileDetails.vue delete mode 100644 components/ProfileHeader.vue create mode 100644 components/SendCardAmount.vue create mode 100644 components/SendCardDraft.vue create mode 100644 components/SendCardHeader.vue rename components/{SendPending.vue => SendCardPending.vue} (91%) create mode 100644 components/SendCardProfileSearch.vue rename components/{SendSuccess.vue => SendCardSuccess.vue} (96%) delete mode 100644 components/SendDraft.vue delete mode 100644 components/profile.vue create mode 100644 composables/useAsset.ts create mode 100644 composables/useConnectedProfile.ts create mode 100644 composables/useCurrency.ts create mode 100644 composables/useProfile.ts delete mode 100644 composables/useProfileBase.ts create mode 100644 composables/useViewedProfile.ts create mode 100644 models/asset.ts create mode 100644 models/base.ts create mode 100644 models/creator.ts create mode 100644 models/image.ts create mode 100644 models/profile.ts create mode 100644 pages/[...slug].vue create mode 100644 pages/[profileAddress]/lyx-details.vue delete mode 100644 pages/[profileAddress]/nft/[nftAddress]/tokenId/[tokenId].vue delete mode 100644 pages/[profileAddress]/token/[tokenAddress].vue create mode 100644 pages/asset/[nftAddress]/tokenId/[tokenId].vue create mode 100644 pages/asset/[tokenAddress].vue create mode 100644 public/images/lyx-token.svg create mode 100644 public/images/switch-network.png create mode 100644 repositories/asset.ts create mode 100644 repositories/creator.ts create mode 100644 repositories/image.ts create mode 100644 repositories/profile.ts create mode 100644 shared/enums.ts create mode 100644 stores/currency.ts delete mode 100644 stores/profileConnected.ts delete mode 100644 stores/profileViewed.ts create mode 100644 tailwind.config.js create mode 100644 tests/e2e/lyx-details.spec.ts create mode 100644 tests/unit/utils/validateLsp3Metadata.spec.ts create mode 100644 types/currency.ts create mode 100644 types/device.ts delete mode 100644 types/enums.ts create mode 100644 types/modal.ts create mode 100644 types/network.ts create mode 100644 types/provider.d.ts create mode 100644 utils/assetChecks.ts create mode 100644 utils/checkNetwork.ts create mode 100644 utils/fetchAsset.ts create mode 100644 utils/fetchAssets.ts create mode 100644 utils/fetchLsp3Profile.ts create mode 100644 utils/fetchLsp4Creators.ts create mode 100644 utils/fetchLsp4Metadata.ts create mode 100644 utils/fetchLsp7Balance.ts create mode 100644 utils/fetchLsp8Metadata.ts create mode 100644 utils/fetcher.ts create mode 100644 utils/fromWeiWithDecimals.ts create mode 100644 utils/getCurrentProfileAddress.ts create mode 100644 utils/getErrorMessage.ts create mode 100644 utils/getImages.ts delete mode 100644 utils/getProfileImages.ts delete mode 100644 utils/setupViewedAssets.ts delete mode 100644 utils/setupViewedProfile.ts rename utils/{checkInterface.ts => supportInterface.ts} (75%) delete mode 100644 utils/validateLSP3.ts create mode 100644 utils/validateLsp3Metadata.ts diff --git a/.env.example b/.env.example index 63bd8e95..f07635be 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,6 @@ +# neccessary Algolia envs for searching to work properly +ALGOLIA_APPLICATION_ID=YOUR_ALGOLIA_APPLICATION_ID +ALGOLIA_API_KEY=YOUR_ALGOLIA_API_KEY + # dev envs not needed in production YATA_API_TOKEN=YOUR_YATA_API_TOKEN # yata api token for fetching translations diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 3be56d63..1a3e92f8 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -65,6 +65,8 @@ module.exports = { rules: { 'import/order': 'off', '@typescript-eslint/no-unused-vars': 'off', + 'playwright/no-networkidle': 'off', + 'playwright/no-skipped-test': 'off', }, }, { diff --git a/.github/auto_assign.yaml b/.github/auto_assign.yaml new file mode 100644 index 00000000..9620a493 --- /dev/null +++ b/.github/auto_assign.yaml @@ -0,0 +1,20 @@ +# Set to true to add reviewers to pull requests +addReviewers: true + +# Set to true to add assignees to pull requests +# It can also be set to "author" +addAssignees: false + +# A list of reviewers to be added to pull requests (GitHub user name) +reviewers: + - dzbo + - richtera + - Hugoo + - doubleppereira + +# A number of reviewers added to the pull request +# Set 0 to add all the reviewers (default: 0) +numberOfReviewers: 0 + +skipKeywords: + - chore( diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be422b62..0981f37e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,8 @@ on: env: CF_PROJECT_NAME: wallet-universalprofile-cloud CF_BASE_URL: wallet-universalprofile-cloud + ALGOLIA_API_KEY: '${{ secrets.ALGOLIA_API_KEY }}' + ALGOLIA_APPLICATION_ID: '${{ secrets.ALGOLIA_APPLICATION_ID }}' jobs: test: diff --git a/.github/workflows/review.yaml b/.github/workflows/review.yaml new file mode 100644 index 00000000..42caab1e --- /dev/null +++ b/.github/workflows/review.yaml @@ -0,0 +1,12 @@ +name: 'Auto Assign' +on: + pull_request: + types: [opened, ready_for_review] + +jobs: + add-reviews: + runs-on: ubuntu-latest + steps: + - uses: kentaro-m/auto-assign-action@v1.2.4 + with: + configuration-path: '.github/auto_assign.yaml' diff --git a/.gitignore b/.gitignore index 42b4b8c2..94378352 100644 --- a/.gitignore +++ b/.gitignore @@ -17,8 +17,7 @@ logs .fleet .idea /public/assets/* -# tailwind config is used just for vs code extension intelisense -tailwind.config.js +types/contracts # Local env files .env diff --git a/app.vue b/app.vue index 17dfdc02..21644ac0 100644 --- a/app.vue +++ b/app.vue @@ -1,64 +1,39 @@ diff --git a/components/AppAvatar.vue b/components/AppAvatar.vue new file mode 100644 index 00000000..a2ed2cc9 --- /dev/null +++ b/components/AppAvatar.vue @@ -0,0 +1,63 @@ + + + diff --git a/components/AppButtonConnectOrInstall.vue b/components/AppButtonConnectOrInstall.vue index 9d663a81..f1e10351 100644 --- a/components/AppButtonConnectOrInstall.vue +++ b/components/AppButtonConnectOrInstall.vue @@ -1,6 +1,6 @@ + diff --git a/components/AppFooterNetworkSelect.vue b/components/AppFooterNetworkSelect.vue new file mode 100644 index 00000000..7e2f2beb --- /dev/null +++ b/components/AppFooterNetworkSelect.vue @@ -0,0 +1,45 @@ + + + diff --git a/components/AppLoader.vue b/components/AppLoader.vue new file mode 100644 index 00000000..86d6a446 --- /dev/null +++ b/components/AppLoader.vue @@ -0,0 +1,7 @@ + diff --git a/components/AppModal.vue b/components/AppModal.vue index 72fff6e9..6c957285 100644 --- a/components/AppModal.vue +++ b/components/AppModal.vue @@ -7,7 +7,7 @@ const loadModalTemplate = () => { const templateName = appStore.modal?.template ? appStore.modal.template : MODAL_DEFAULT_TEMPLATE - return import(`./AppModalTemplate${templateName}.vue`) + return import(`./ModalTemplate${templateName}.vue`) }) } diff --git a/components/AppNavbar.vue b/components/AppNavbar.vue index 248ca906..e60bb399 100644 --- a/components/AppNavbar.vue +++ b/components/AppNavbar.vue @@ -1,27 +1,29 @@ + + diff --git a/components/AssetBalance.vue b/components/AssetBalance.vue new file mode 100644 index 00000000..b7e7688c --- /dev/null +++ b/components/AssetBalance.vue @@ -0,0 +1,27 @@ + + + diff --git a/components/AssetCreator.vue b/components/AssetCreator.vue new file mode 100644 index 00000000..7df6a917 --- /dev/null +++ b/components/AssetCreator.vue @@ -0,0 +1,53 @@ + + + diff --git a/components/AssetImages.vue b/components/AssetImages.vue index 6de5ecba..273f8fe3 100644 --- a/components/AssetImages.vue +++ b/components/AssetImages.vue @@ -1,8 +1,8 @@ + + diff --git a/components/AssetOwnInfo.vue b/components/AssetOwnInfo.vue index 54ec47f0..b4365a10 100644 --- a/components/AssetOwnInfo.vue +++ b/components/AssetOwnInfo.vue @@ -1,13 +1,13 @@