diff --git a/.github/workflows/frontend-checks.yml b/.github/workflows/frontend-checks.yml index d0f70ec61f..2d9344413f 100644 --- a/.github/workflows/frontend-checks.yml +++ b/.github/workflows/frontend-checks.yml @@ -29,7 +29,7 @@ jobs: run: | while read -r logo do - if [ ! -f src/frontend/assets/icons/"$logo" ] + if [ ! -f src/frontend/src/assets/icons/"$logo" ] then echo "Logo not found: $logo" exit 1 @@ -62,7 +62,7 @@ jobs: - name: Upload Pages artifact uses: actions/upload-pages-artifact@v3 with: - path: 'dist-showcase' + path: "dist-showcase" # Deploy the showcase to GitHub Pages showcase-deploy: diff --git a/.github/workflows/update-dapps.yml b/.github/workflows/update-dapps.yml index f8ba860255..42673d5c69 100644 --- a/.github/workflows/update-dapps.yml +++ b/.github/workflows/update-dapps.yml @@ -4,7 +4,7 @@ name: Dapps Update on: schedule: # Check for updates daily - - cron: '0 0 * * *' + - cron: "0 0 * * *" workflow_dispatch: jobs: @@ -32,13 +32,14 @@ jobs: base: main add-paths: | src/frontend/src/flows/dappsExplorer/dapps.json - src/frontend/assets/icons + src/frontend/src/assets/icons commit-message: Update dapps committer: GitHub author: gix-bot branch: bot-dapps-update delete-branch: true - title: 'Update dapps list' + title: + "Update dapps list" # Since the this is a scheduled job, a failure won't be shown on any # PR status. To notify the team, we send a message to our Slack channel on failure. diff --git a/Cargo.lock b/Cargo.lock index c48bf5a696..922fbcaac7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1952,6 +1952,7 @@ dependencies = [ "candid_parser", "canister_tests", "captcha", + "flate2", "getrandom", "hex", "hex-literal", diff --git a/scripts/update-dapps b/scripts/update-dapps index d24300dadc..e6d612f1a7 100755 --- a/scripts/update-dapps +++ b/scripts/update-dapps @@ -10,7 +10,7 @@ cd "$SCRIPTS_DIR/.." # The path where we save the list of dapps in II DAPPS_JSON="$PWD/src/frontend/src/flows/dappsExplorer/dapps.json" # The path where we save logos in II -II_LOGO_PREFIX="src/frontend/assets/icons" +II_LOGO_PREFIX="src/frontend/src/assets/icons" function title() { echo "Update dapps descriptions & logos from dfinity/portal" @@ -65,7 +65,7 @@ function update() { # The actual path prefix where logos are stored portal_filepath_prefix="static/img/showcase" # The path where we save logos in II - II_LOGO_PREFIX="src/frontend/assets/icons" + II_LOGO_PREFIX="src/frontend/src/assets/icons" # The path where we save the list of dapps in II DAPPS_JSON="$PWD/src/frontend/src/flows/dappsExplorer/dapps.json" @@ -117,7 +117,7 @@ function update() { --show-error \ --silent \ "$portal_url/$portal_logo_path" \ - --output "src/frontend/assets/icons/$logo" + --output "$ii_logo_path" done < <(jq -cMr <"$DAPPS_JSON" '.[] | .logo') diff --git a/src/frontend/index.html b/src/frontend/index.html index d085effd0b..fc6f3eddae 100644 --- a/src/frontend/index.html +++ b/src/frontend/index.html @@ -5,7 +5,7 @@ Internet Identity - + diff --git a/src/frontend/assets/favicon.ico b/src/frontend/src/assets/favicon.ico similarity index 100% rename from src/frontend/assets/favicon.ico rename to src/frontend/src/assets/favicon.ico diff --git a/src/frontend/assets/icons/Gate23_logo.png b/src/frontend/src/assets/icons/Gate23_logo.png similarity index 100% rename from src/frontend/assets/icons/Gate23_logo.png rename to src/frontend/src/assets/icons/Gate23_logo.png diff --git a/src/frontend/assets/icons/Optigames_logo.svg b/src/frontend/src/assets/icons/Optigames_logo.svg similarity index 100% rename from src/frontend/assets/icons/Optigames_logo.svg rename to src/frontend/src/assets/icons/Optigames_logo.svg diff --git a/src/frontend/assets/icons/ReCheck_logo.png b/src/frontend/src/assets/icons/ReCheck_logo.png similarity index 100% rename from src/frontend/assets/icons/ReCheck_logo.png rename to src/frontend/src/assets/icons/ReCheck_logo.png diff --git a/src/frontend/assets/icons/aegis-finance_logo.webp b/src/frontend/src/assets/icons/aegis-finance_logo.webp similarity index 100% rename from src/frontend/assets/icons/aegis-finance_logo.webp rename to src/frontend/src/assets/icons/aegis-finance_logo.webp diff --git a/src/frontend/assets/icons/allkinds_logo.svg b/src/frontend/src/assets/icons/allkinds_logo.svg similarity index 100% rename from src/frontend/assets/icons/allkinds_logo.svg rename to src/frontend/src/assets/icons/allkinds_logo.svg diff --git a/src/frontend/assets/icons/arth_logo.png b/src/frontend/src/assets/icons/arth_logo.png similarity index 100% rename from src/frontend/assets/icons/arth_logo.png rename to src/frontend/src/assets/icons/arth_logo.png diff --git a/src/frontend/assets/icons/asset-app_logo.png b/src/frontend/src/assets/icons/asset-app_logo.png similarity index 100% rename from src/frontend/assets/icons/asset-app_logo.png rename to src/frontend/src/assets/icons/asset-app_logo.png diff --git a/src/frontend/assets/icons/autoroyale_logo.png b/src/frontend/src/assets/icons/autoroyale_logo.png similarity index 100% rename from src/frontend/assets/icons/autoroyale_logo.png rename to src/frontend/src/assets/icons/autoroyale_logo.png diff --git a/src/frontend/assets/icons/ava_logo.webp b/src/frontend/src/assets/icons/ava_logo.webp similarity index 100% rename from src/frontend/assets/icons/ava_logo.webp rename to src/frontend/src/assets/icons/ava_logo.webp diff --git a/src/frontend/assets/icons/b3pay_logo.png b/src/frontend/src/assets/icons/b3pay_logo.png similarity index 100% rename from src/frontend/assets/icons/b3pay_logo.png rename to src/frontend/src/assets/icons/b3pay_logo.png diff --git a/src/frontend/assets/icons/bit10_logo.webp b/src/frontend/src/assets/icons/bit10_logo.webp similarity index 100% rename from src/frontend/assets/icons/bit10_logo.webp rename to src/frontend/src/assets/icons/bit10_logo.webp diff --git a/src/frontend/assets/icons/blocklist.png b/src/frontend/src/assets/icons/blocklist.png similarity index 100% rename from src/frontend/assets/icons/blocklist.png rename to src/frontend/src/assets/icons/blocklist.png diff --git a/src/frontend/assets/icons/bridge23_logo.png b/src/frontend/src/assets/icons/bridge23_logo.png similarity index 100% rename from src/frontend/assets/icons/bridge23_logo.png rename to src/frontend/src/assets/icons/bridge23_logo.png diff --git a/src/frontend/assets/icons/canister-store_logo.png b/src/frontend/src/assets/icons/canister-store_logo.png similarity index 100% rename from src/frontend/assets/icons/canister-store_logo.png rename to src/frontend/src/assets/icons/canister-store_logo.png diff --git a/src/frontend/assets/icons/canistergeek_logo.webp b/src/frontend/src/assets/icons/canistergeek_logo.webp similarity index 100% rename from src/frontend/assets/icons/canistergeek_logo.webp rename to src/frontend/src/assets/icons/canistergeek_logo.webp diff --git a/src/frontend/assets/icons/canlista_logo.webp b/src/frontend/src/assets/icons/canlista_logo.webp similarity index 100% rename from src/frontend/assets/icons/canlista_logo.webp rename to src/frontend/src/assets/icons/canlista_logo.webp diff --git a/src/frontend/assets/icons/chainkeyx_logo.png b/src/frontend/src/assets/icons/chainkeyx_logo.png similarity index 100% rename from src/frontend/assets/icons/chainkeyx_logo.png rename to src/frontend/src/assets/icons/chainkeyx_logo.png diff --git a/src/frontend/assets/icons/cipherAI_logo.webp b/src/frontend/src/assets/icons/cipherAI_logo.webp similarity index 100% rename from src/frontend/assets/icons/cipherAI_logo.webp rename to src/frontend/src/assets/icons/cipherAI_logo.webp diff --git a/src/frontend/assets/icons/civic_logo.png b/src/frontend/src/assets/icons/civic_logo.png similarity index 100% rename from src/frontend/assets/icons/civic_logo.png rename to src/frontend/src/assets/icons/civic_logo.png diff --git a/src/frontend/assets/icons/clpfinance_logo.png b/src/frontend/src/assets/icons/clpfinance_logo.png similarity index 100% rename from src/frontend/assets/icons/clpfinance_logo.png rename to src/frontend/src/assets/icons/clpfinance_logo.png diff --git a/src/frontend/assets/icons/configeek_logo.webp b/src/frontend/src/assets/icons/configeek_logo.webp similarity index 100% rename from src/frontend/assets/icons/configeek_logo.webp rename to src/frontend/src/assets/icons/configeek_logo.webp diff --git a/src/frontend/assets/icons/cyclestransferstation_logo.png b/src/frontend/src/assets/icons/cyclestransferstation_logo.png similarity index 100% rename from src/frontend/assets/icons/cyclestransferstation_logo.png rename to src/frontend/src/assets/icons/cyclestransferstation_logo.png diff --git a/src/frontend/assets/icons/cyqlio_logo.svg b/src/frontend/src/assets/icons/cyqlio_logo.svg similarity index 100% rename from src/frontend/assets/icons/cyqlio_logo.svg rename to src/frontend/src/assets/icons/cyqlio_logo.svg diff --git a/src/frontend/assets/icons/d-vote_logo.webp b/src/frontend/src/assets/icons/d-vote_logo.webp similarity index 100% rename from src/frontend/assets/icons/d-vote_logo.webp rename to src/frontend/src/assets/icons/d-vote_logo.webp diff --git a/src/frontend/assets/icons/dbox_logo.webp b/src/frontend/src/assets/icons/dbox_logo.webp similarity index 100% rename from src/frontend/assets/icons/dbox_logo.webp rename to src/frontend/src/assets/icons/dbox_logo.webp diff --git a/src/frontend/assets/icons/decideai_logo.png b/src/frontend/src/assets/icons/decideai_logo.png similarity index 100% rename from src/frontend/assets/icons/decideai_logo.png rename to src/frontend/src/assets/icons/decideai_logo.png diff --git a/src/frontend/assets/icons/dflow_logo.png b/src/frontend/src/assets/icons/dflow_logo.png similarity index 100% rename from src/frontend/assets/icons/dflow_logo.png rename to src/frontend/src/assets/icons/dflow_logo.png diff --git a/src/frontend/assets/icons/distrikt_logo.webp b/src/frontend/src/assets/icons/distrikt_logo.webp similarity index 100% rename from src/frontend/assets/icons/distrikt_logo.webp rename to src/frontend/src/assets/icons/distrikt_logo.webp diff --git a/src/frontend/assets/icons/dmail-network_logo.png b/src/frontend/src/assets/icons/dmail-network_logo.png similarity index 100% rename from src/frontend/assets/icons/dmail-network_logo.png rename to src/frontend/src/assets/icons/dmail-network_logo.png diff --git a/src/frontend/assets/icons/doocoins_logo.webp b/src/frontend/src/assets/icons/doocoins_logo.webp similarity index 100% rename from src/frontend/assets/icons/doocoins_logo.webp rename to src/frontend/src/assets/icons/doocoins_logo.webp diff --git a/src/frontend/assets/icons/dotmeet_logo.svg b/src/frontend/src/assets/icons/dotmeet_logo.svg similarity index 100% rename from src/frontend/assets/icons/dotmeet_logo.svg rename to src/frontend/src/assets/icons/dotmeet_logo.svg diff --git a/src/frontend/assets/icons/doxa_logo.webp b/src/frontend/src/assets/icons/doxa_logo.webp similarity index 100% rename from src/frontend/assets/icons/doxa_logo.webp rename to src/frontend/src/assets/icons/doxa_logo.webp diff --git a/src/frontend/assets/icons/dragginz_logo.webp b/src/frontend/src/assets/icons/dragginz_logo.webp similarity index 100% rename from src/frontend/assets/icons/dragginz_logo.webp rename to src/frontend/src/assets/icons/dragginz_logo.webp diff --git a/src/frontend/assets/icons/dscvr_logo.webp b/src/frontend/src/assets/icons/dscvr_logo.webp similarity index 100% rename from src/frontend/assets/icons/dscvr_logo.webp rename to src/frontend/src/assets/icons/dscvr_logo.webp diff --git a/src/frontend/assets/icons/dsign_logo.webp b/src/frontend/src/assets/icons/dsign_logo.webp similarity index 100% rename from src/frontend/assets/icons/dsign_logo.webp rename to src/frontend/src/assets/icons/dsign_logo.webp diff --git a/src/frontend/assets/icons/dsocial_logo.webp b/src/frontend/src/assets/icons/dsocial_logo.webp similarity index 100% rename from src/frontend/assets/icons/dsocial_logo.webp rename to src/frontend/src/assets/icons/dsocial_logo.webp diff --git a/src/frontend/assets/icons/estatedao_logo.png b/src/frontend/src/assets/icons/estatedao_logo.png similarity index 100% rename from src/frontend/assets/icons/estatedao_logo.png rename to src/frontend/src/assets/icons/estatedao_logo.png diff --git a/src/frontend/assets/icons/eventhub_logo.png b/src/frontend/src/assets/icons/eventhub_logo.png similarity index 100% rename from src/frontend/assets/icons/eventhub_logo.png rename to src/frontend/src/assets/icons/eventhub_logo.png diff --git a/src/frontend/assets/icons/faceless_logo.png b/src/frontend/src/assets/icons/faceless_logo.png similarity index 100% rename from src/frontend/assets/icons/faceless_logo.png rename to src/frontend/src/assets/icons/faceless_logo.png diff --git a/src/frontend/assets/icons/fomowell_logo.png b/src/frontend/src/assets/icons/fomowell_logo.png similarity index 100% rename from src/frontend/assets/icons/fomowell_logo.png rename to src/frontend/src/assets/icons/fomowell_logo.png diff --git a/src/frontend/assets/icons/football-god_logo.webp b/src/frontend/src/assets/icons/football-god_logo.webp similarity index 100% rename from src/frontend/assets/icons/football-god_logo.webp rename to src/frontend/src/assets/icons/football-god_logo.webp diff --git a/src/frontend/assets/icons/formify_logo.webp b/src/frontend/src/assets/icons/formify_logo.webp similarity index 100% rename from src/frontend/assets/icons/formify_logo.webp rename to src/frontend/src/assets/icons/formify_logo.webp diff --git a/src/frontend/assets/icons/funded_logo.webp b/src/frontend/src/assets/icons/funded_logo.webp similarity index 100% rename from src/frontend/assets/icons/funded_logo.webp rename to src/frontend/src/assets/icons/funded_logo.webp diff --git a/src/frontend/assets/icons/hamster_logo.svg b/src/frontend/src/assets/icons/hamster_logo.svg similarity index 100% rename from src/frontend/assets/icons/hamster_logo.svg rename to src/frontend/src/assets/icons/hamster_logo.svg diff --git a/src/frontend/assets/icons/helix_logo.svg b/src/frontend/src/assets/icons/helix_logo.svg similarity index 100% rename from src/frontend/assets/icons/helix_logo.svg rename to src/frontend/src/assets/icons/helix_logo.svg diff --git a/src/frontend/assets/icons/ic-websocket_logo.webp b/src/frontend/src/assets/icons/ic-websocket_logo.webp similarity index 100% rename from src/frontend/assets/icons/ic-websocket_logo.webp rename to src/frontend/src/assets/icons/ic-websocket_logo.webp diff --git a/src/frontend/assets/icons/icdex_logo.webp b/src/frontend/src/assets/icons/icdex_logo.webp similarity index 100% rename from src/frontend/assets/icons/icdex_logo.webp rename to src/frontend/src/assets/icons/icdex_logo.webp diff --git a/src/frontend/assets/icons/icevent_logo_112x112.png b/src/frontend/src/assets/icons/icevent_logo_112x112.png similarity index 100% rename from src/frontend/assets/icons/icevent_logo_112x112.png rename to src/frontend/src/assets/icons/icevent_logo_112x112.png diff --git a/src/frontend/assets/icons/ichub_logo.png b/src/frontend/src/assets/icons/ichub_logo.png similarity index 100% rename from src/frontend/assets/icons/ichub_logo.png rename to src/frontend/src/assets/icons/ichub_logo.png diff --git a/src/frontend/assets/icons/icme_logo.webp b/src/frontend/src/assets/icons/icme_logo.webp similarity index 100% rename from src/frontend/assets/icons/icme_logo.webp rename to src/frontend/src/assets/icons/icme_logo.webp diff --git a/src/frontend/assets/icons/icpanda-dao_logo.webp b/src/frontend/src/assets/icons/icpanda-dao_logo.webp similarity index 100% rename from src/frontend/assets/icons/icpanda-dao_logo.webp rename to src/frontend/src/assets/icons/icpanda-dao_logo.webp diff --git a/src/frontend/assets/icons/icpex_logo.png b/src/frontend/src/assets/icons/icpex_logo.png similarity index 100% rename from src/frontend/assets/icons/icpex_logo.png rename to src/frontend/src/assets/icons/icpex_logo.png diff --git a/src/frontend/assets/icons/icpp-logo.dracula-cyan.112x112.png b/src/frontend/src/assets/icons/icpp-logo.dracula-cyan.112x112.png similarity index 100% rename from src/frontend/assets/icons/icpp-logo.dracula-cyan.112x112.png rename to src/frontend/src/assets/icons/icpp-logo.dracula-cyan.112x112.png diff --git a/src/frontend/assets/icons/icpsig_logo.png b/src/frontend/src/assets/icons/icpsig_logo.png similarity index 100% rename from src/frontend/assets/icons/icpsig_logo.png rename to src/frontend/src/assets/icons/icpsig_logo.png diff --git a/src/frontend/assets/icons/icpswap_logo.webp b/src/frontend/src/assets/icons/icpswap_logo.webp similarity index 100% rename from src/frontend/assets/icons/icpswap_logo.webp rename to src/frontend/src/assets/icons/icpswap_logo.webp diff --git a/src/frontend/assets/icons/icrouter_logo.webp b/src/frontend/src/assets/icons/icrouter_logo.webp similarity index 100% rename from src/frontend/assets/icons/icrouter_logo.webp rename to src/frontend/src/assets/icons/icrouter_logo.webp diff --git a/src/frontend/assets/icons/icto_logo.png b/src/frontend/src/assets/icons/icto_logo.png similarity index 100% rename from src/frontend/assets/icons/icto_logo.png rename to src/frontend/src/assets/icons/icto_logo.png diff --git a/src/frontend/assets/icons/iknows_logo.png b/src/frontend/src/assets/icons/iknows_logo.png similarity index 100% rename from src/frontend/assets/icons/iknows_logo.png rename to src/frontend/src/assets/icons/iknows_logo.png diff --git a/src/frontend/assets/icons/john-dao_logo.webp b/src/frontend/src/assets/icons/john-dao_logo.webp similarity index 100% rename from src/frontend/assets/icons/john-dao_logo.webp rename to src/frontend/src/assets/icons/john-dao_logo.webp diff --git a/src/frontend/assets/icons/juno_logo.svg b/src/frontend/src/assets/icons/juno_logo.svg similarity index 100% rename from src/frontend/assets/icons/juno_logo.svg rename to src/frontend/src/assets/icons/juno_logo.svg diff --git a/src/frontend/assets/icons/kinic_logo.webp b/src/frontend/src/assets/icons/kinic_logo.webp similarity index 100% rename from src/frontend/assets/icons/kinic_logo.webp rename to src/frontend/src/assets/icons/kinic_logo.webp diff --git a/src/frontend/assets/icons/kontribute_logo.webp b/src/frontend/src/assets/icons/kontribute_logo.webp similarity index 100% rename from src/frontend/assets/icons/kontribute_logo.webp rename to src/frontend/src/assets/icons/kontribute_logo.webp diff --git a/src/frontend/assets/icons/metaforo-icp_logo.png b/src/frontend/src/assets/icons/metaforo-icp_logo.png similarity index 100% rename from src/frontend/assets/icons/metaforo-icp_logo.png rename to src/frontend/src/assets/icons/metaforo-icp_logo.png diff --git a/src/frontend/assets/icons/metaviz_logo.png b/src/frontend/src/assets/icons/metaviz_logo.png similarity index 100% rename from src/frontend/assets/icons/metaviz_logo.png rename to src/frontend/src/assets/icons/metaviz_logo.png diff --git a/src/frontend/assets/icons/missionispossible_logo.webp b/src/frontend/src/assets/icons/missionispossible_logo.webp similarity index 100% rename from src/frontend/assets/icons/missionispossible_logo.webp rename to src/frontend/src/assets/icons/missionispossible_logo.webp diff --git a/src/frontend/assets/icons/mora_logo.png b/src/frontend/src/assets/icons/mora_logo.png similarity index 100% rename from src/frontend/assets/icons/mora_logo.png rename to src/frontend/src/assets/icons/mora_logo.png diff --git a/src/frontend/assets/icons/motokopilot_logo.png b/src/frontend/src/assets/icons/motokopilot_logo.png similarity index 100% rename from src/frontend/assets/icons/motokopilot_logo.png rename to src/frontend/src/assets/icons/motokopilot_logo.png diff --git a/src/frontend/assets/icons/nfid_logo.webp b/src/frontend/src/assets/icons/nfid_logo.webp similarity index 100% rename from src/frontend/assets/icons/nfid_logo.webp rename to src/frontend/src/assets/icons/nfid_logo.webp diff --git a/src/frontend/assets/icons/nftanvil_logo.webp b/src/frontend/src/assets/icons/nftanvil_logo.webp similarity index 100% rename from src/frontend/assets/icons/nftanvil_logo.webp rename to src/frontend/src/assets/icons/nftanvil_logo.webp diff --git a/src/frontend/assets/icons/nnsfront-enddapp_logo-dark.webp b/src/frontend/src/assets/icons/nnsfront-enddapp_logo-dark.webp similarity index 100% rename from src/frontend/assets/icons/nnsfront-enddapp_logo-dark.webp rename to src/frontend/src/assets/icons/nnsfront-enddapp_logo-dark.webp diff --git a/src/frontend/assets/icons/nobleblocks_logo.webp b/src/frontend/src/assets/icons/nobleblocks_logo.webp similarity index 100% rename from src/frontend/assets/icons/nobleblocks_logo.webp rename to src/frontend/src/assets/icons/nobleblocks_logo.webp diff --git a/src/frontend/assets/icons/nuance_logo.webp b/src/frontend/src/assets/icons/nuance_logo.webp similarity index 100% rename from src/frontend/assets/icons/nuance_logo.webp rename to src/frontend/src/assets/icons/nuance_logo.webp diff --git a/src/frontend/assets/icons/oisy_logo.svg b/src/frontend/src/assets/icons/oisy_logo.svg similarity index 100% rename from src/frontend/assets/icons/oisy_logo.svg rename to src/frontend/src/assets/icons/oisy_logo.svg diff --git a/src/frontend/assets/icons/oneblock.png b/src/frontend/src/assets/icons/oneblock.png similarity index 100% rename from src/frontend/assets/icons/oneblock.png rename to src/frontend/src/assets/icons/oneblock.png diff --git a/src/frontend/assets/icons/open-internet-metaverse_logo.webp b/src/frontend/src/assets/icons/open-internet-metaverse_logo.webp similarity index 100% rename from src/frontend/assets/icons/open-internet-metaverse_logo.webp rename to src/frontend/src/assets/icons/open-internet-metaverse_logo.webp diff --git a/src/frontend/assets/icons/openchat_logo.webp b/src/frontend/src/assets/icons/openchat_logo.webp similarity index 100% rename from src/frontend/assets/icons/openchat_logo.webp rename to src/frontend/src/assets/icons/openchat_logo.webp diff --git a/src/frontend/assets/icons/openfpl_logo.png b/src/frontend/src/assets/icons/openfpl_logo.png similarity index 100% rename from src/frontend/assets/icons/openfpl_logo.png rename to src/frontend/src/assets/icons/openfpl_logo.png diff --git a/src/frontend/assets/icons/pass_logo.svg b/src/frontend/src/assets/icons/pass_logo.svg similarity index 100% rename from src/frontend/assets/icons/pass_logo.svg rename to src/frontend/src/assets/icons/pass_logo.svg diff --git a/src/frontend/assets/icons/personal_dao_logo.png b/src/frontend/src/assets/icons/personal_dao_logo.png similarity index 100% rename from src/frontend/assets/icons/personal_dao_logo.png rename to src/frontend/src/assets/icons/personal_dao_logo.png diff --git a/src/frontend/assets/icons/ping_logo.webp b/src/frontend/src/assets/icons/ping_logo.webp similarity index 100% rename from src/frontend/assets/icons/ping_logo.webp rename to src/frontend/src/assets/icons/ping_logo.webp diff --git a/src/frontend/assets/icons/pleximail_logo.png b/src/frontend/src/assets/icons/pleximail_logo.png similarity index 100% rename from src/frontend/assets/icons/pleximail_logo.png rename to src/frontend/src/assets/icons/pleximail_logo.png diff --git a/src/frontend/assets/icons/rakeoff_logo.webp b/src/frontend/src/assets/icons/rakeoff_logo.webp similarity index 100% rename from src/frontend/assets/icons/rakeoff_logo.webp rename to src/frontend/src/assets/icons/rakeoff_logo.webp diff --git a/src/frontend/assets/icons/redsteep_logo.png b/src/frontend/src/assets/icons/redsteep_logo.png similarity index 100% rename from src/frontend/assets/icons/redsteep_logo.png rename to src/frontend/src/assets/icons/redsteep_logo.png diff --git a/src/frontend/assets/icons/riide_logo.png b/src/frontend/src/assets/icons/riide_logo.png similarity index 100% rename from src/frontend/assets/icons/riide_logo.png rename to src/frontend/src/assets/icons/riide_logo.png diff --git a/src/frontend/assets/icons/sagatarot_logo.webp b/src/frontend/src/assets/icons/sagatarot_logo.webp similarity index 100% rename from src/frontend/assets/icons/sagatarot_logo.webp rename to src/frontend/src/assets/icons/sagatarot_logo.webp diff --git a/src/frontend/assets/icons/seers_logo.webp b/src/frontend/src/assets/icons/seers_logo.webp similarity index 100% rename from src/frontend/assets/icons/seers_logo.webp rename to src/frontend/src/assets/icons/seers_logo.webp diff --git a/src/frontend/assets/icons/signals_logo.webp b/src/frontend/src/assets/icons/signals_logo.webp similarity index 100% rename from src/frontend/assets/icons/signals_logo.webp rename to src/frontend/src/assets/icons/signals_logo.webp diff --git a/src/frontend/assets/icons/sonic-dex_logo.webp b/src/frontend/src/assets/icons/sonic-dex_logo.webp similarity index 100% rename from src/frontend/assets/icons/sonic-dex_logo.webp rename to src/frontend/src/assets/icons/sonic-dex_logo.webp diff --git a/src/frontend/assets/icons/staex_logo.png b/src/frontend/src/assets/icons/staex_logo.png similarity index 100% rename from src/frontend/assets/icons/staex_logo.png rename to src/frontend/src/assets/icons/staex_logo.png diff --git a/src/frontend/assets/icons/stoicwallet_logo.webp b/src/frontend/src/assets/icons/stoicwallet_logo.webp similarity index 100% rename from src/frontend/assets/icons/stoicwallet_logo.webp rename to src/frontend/src/assets/icons/stoicwallet_logo.webp diff --git a/src/frontend/assets/icons/taggr_logo.webp b/src/frontend/src/assets/icons/taggr_logo.webp similarity index 100% rename from src/frontend/assets/icons/taggr_logo.webp rename to src/frontend/src/assets/icons/taggr_logo.webp diff --git a/src/frontend/assets/icons/taxlint_logo.png b/src/frontend/src/assets/icons/taxlint_logo.png similarity index 100% rename from src/frontend/assets/icons/taxlint_logo.png rename to src/frontend/src/assets/icons/taxlint_logo.png diff --git a/src/frontend/assets/icons/tipjar_logo.webp b/src/frontend/src/assets/icons/tipjar_logo.webp similarity index 100% rename from src/frontend/assets/icons/tipjar_logo.webp rename to src/frontend/src/assets/icons/tipjar_logo.webp diff --git a/src/frontend/assets/icons/trax_logo.webp b/src/frontend/src/assets/icons/trax_logo.webp similarity index 100% rename from src/frontend/assets/icons/trax_logo.webp rename to src/frontend/src/assets/icons/trax_logo.webp diff --git a/src/frontend/assets/icons/unfoldvr_logo.webp b/src/frontend/src/assets/icons/unfoldvr_logo.webp similarity index 100% rename from src/frontend/assets/icons/unfoldvr_logo.webp rename to src/frontend/src/assets/icons/unfoldvr_logo.webp diff --git a/src/frontend/assets/icons/uniswapfrontendontheic_logo.webp b/src/frontend/src/assets/icons/uniswapfrontendontheic_logo.webp similarity index 100% rename from src/frontend/assets/icons/uniswapfrontendontheic_logo.webp rename to src/frontend/src/assets/icons/uniswapfrontendontheic_logo.webp diff --git a/src/frontend/assets/icons/upas_logo.png b/src/frontend/src/assets/icons/upas_logo.png similarity index 100% rename from src/frontend/assets/icons/upas_logo.png rename to src/frontend/src/assets/icons/upas_logo.png diff --git a/src/frontend/assets/icons/usergeek_logo.webp b/src/frontend/src/assets/icons/usergeek_logo.webp similarity index 100% rename from src/frontend/assets/icons/usergeek_logo.webp rename to src/frontend/src/assets/icons/usergeek_logo.webp diff --git a/src/frontend/assets/icons/virtuaseal.png b/src/frontend/src/assets/icons/virtuaseal.png similarity index 100% rename from src/frontend/assets/icons/virtuaseal.png rename to src/frontend/src/assets/icons/virtuaseal.png diff --git a/src/frontend/assets/icons/yuku_logo.png b/src/frontend/src/assets/icons/yuku_logo.png similarity index 100% rename from src/frontend/assets/icons/yuku_logo.png rename to src/frontend/src/assets/icons/yuku_logo.png diff --git a/src/frontend/assets/icons/zon_logo.webp b/src/frontend/src/assets/icons/zon_logo.webp similarity index 100% rename from src/frontend/assets/icons/zon_logo.webp rename to src/frontend/src/assets/icons/zon_logo.webp diff --git a/src/frontend/assets/unknowndapp.png b/src/frontend/src/assets/unknowndapp.png similarity index 100% rename from src/frontend/assets/unknowndapp.png rename to src/frontend/src/assets/unknowndapp.png diff --git a/src/frontend/src/flows/dappsExplorer/dapps.ts b/src/frontend/src/flows/dappsExplorer/dapps.ts index 6836df6e8e..d285d087fa 100644 --- a/src/frontend/src/flows/dappsExplorer/dapps.ts +++ b/src/frontend/src/flows/dappsExplorer/dapps.ts @@ -1,5 +1,10 @@ -import { BASE_URL } from "$src/environment"; import { features } from "$src/features"; +// This path should point to internet-identity/src/frontend/src/assets/icons/* +const iconFiles = import.meta.glob("../../assets/icons/*", { + eager: true, + query: "?url", + import: "default", +}); // The list of dapps. This is derived from https://github.com/dfinity/portal: // * Only dapps using II are used @@ -39,7 +44,8 @@ export class KnownDapp { // Path to use for logo files public get logoSrc(): string { - return BASE_URL + "icons/" + this.descr.logo; + const path = `../../assets/icons/${this.descr.logo}`; + return iconFiles[path] as string; } public get name(): string { diff --git a/src/frontend/src/flows/dappsExplorer/teaser.ts b/src/frontend/src/flows/dappsExplorer/teaser.ts index e70d991c35..4df9088d04 100644 --- a/src/frontend/src/flows/dappsExplorer/teaser.ts +++ b/src/frontend/src/flows/dappsExplorer/teaser.ts @@ -70,13 +70,18 @@ const marqueeList = (dapps: KnownDapp[]): TemplateResult => { > ${rows.map((rowDapps, i) => { const rowContent = rowDapps.map( - // XXX: it's important not to lazy load the image, otherwise - // images start appearing before they're loaded. This then - // shows an empty space where the image suddenly pops seconds - // later. ({ logoSrc, name }) => html`
- ${name} + ${name} { + const img = e.target as HTMLImageElement; + img.classList.remove("c-marquee__image--loading"); + img.classList.add("c-marquee__image--loaded"); + }} + />
` ); diff --git a/src/frontend/src/flows/verifiableCredentials/allowCredentials.ts b/src/frontend/src/flows/verifiableCredentials/allowCredentials.ts index 8067478529..5540d1e80e 100644 --- a/src/frontend/src/flows/verifiableCredentials/allowCredentials.ts +++ b/src/frontend/src/flows/verifiableCredentials/allowCredentials.ts @@ -14,6 +14,8 @@ import DOMPurify from "dompurify"; import copyJson from "./allowCredentials.json"; +import unknownDappLogo from "$src/assets/unknowndapp.png"; + /* * Get the dapp that corresponds to the origin, or create a new one if it's * unknown @@ -25,7 +27,7 @@ const getOrigin = (origin: string, dapplist: KnownDapp[]): KnownDapp => { foundDapp = new KnownDapp({ name: origin, website: origin, - logo: "../unknowndapp.png", + logo: unknownDappLogo, }); } diff --git a/src/frontend/src/styles/main.css b/src/frontend/src/styles/main.css index b7fc34867d..a9b6d2b2f3 100644 --- a/src/frontend/src/styles/main.css +++ b/src/frontend/src/styles/main.css @@ -3272,6 +3272,15 @@ input[type="checkbox"] { height: 100%; width: 100%; object-fit: contain; + transition: opacity 0.3s ease-in; +} + +.c-marquee__image--loading { + opacity: 0; +} + +.c-marquee__image--loaded { + opacity: 1; } @keyframes marquee { diff --git a/src/internet_identity/Cargo.toml b/src/internet_identity/Cargo.toml index 1c179b83c2..273a54dbae 100644 --- a/src/internet_identity/Cargo.toml +++ b/src/internet_identity/Cargo.toml @@ -48,6 +48,7 @@ hex-literal = "0.4" regex.workspace = true ic-response-verification.workspace = true identity_jose = { git = "https://github.com/dfinity/identity.rs.git", rev = "aa510ef7f441848d6c78058fe51ad4ad1d9bd5d8", default-features = false} +flate2 = "1.0" [features] diff --git a/src/internet_identity/tests/integration/http.rs b/src/internet_identity/tests/integration/http.rs index b6f710c034..32a5b7c611 100644 --- a/src/internet_identity/tests/integration/http.rs +++ b/src/internet_identity/tests/integration/http.rs @@ -8,6 +8,7 @@ use crate::v2_api::authn_method_test_helpers::{ use canister_tests::api::{http_request, internet_identity as api}; use canister_tests::flows; use canister_tests::framework::*; +use flate2::read::GzDecoder; use ic_cdk::api::management_canister::main::CanisterId; use ic_response_verification::types::VerificationInfo; use ic_response_verification::verify_request_response_pair; @@ -20,6 +21,7 @@ use internet_identity_interface::internet_identity::types::{ use pocket_ic::{CallError, PocketIc}; use serde_bytes::ByteBuf; use std::collections::HashMap; +use std::io::Read; use std::time::Duration; /// Verifies that some expected assets are delivered, certified and have security headers. @@ -111,7 +113,7 @@ fn should_set_cache_control_for_fonts() -> Result<(), CallError> { let env = env(); let canister_id = install_ii_canister(&env, II_WASM.clone()); - //get index page + // Get index page let index_request = HttpRequest { method: "GET".to_string(), url: "/".to_string(), @@ -121,10 +123,10 @@ fn should_set_cache_control_for_fonts() -> Result<(), CallError> { }; let index_response = http_request(&env, canister_id, &index_request)?; - // Convert body to string and find the font URL + // Convert body to string let html = String::from_utf8(index_response.body.into_vec()).expect("Failed to parse HTML"); - // Find the css URL in the HTML + // Find the CSS URL in the HTML let css_url = { let css_suffix = "cacheable.css"; let css_end = html @@ -137,7 +139,7 @@ fn should_set_cache_control_for_fonts() -> Result<(), CallError> { html[prefix_start..css_end + css_suffix.len()].to_string() }; - //get css file + // Get CSS file let css_request = HttpRequest { method: "GET".to_string(), url: css_url, @@ -159,7 +161,7 @@ fn should_set_cache_control_for_fonts() -> Result<(), CallError> { let css_body = String::from_utf8(css_response.body.into_vec()).expect("Failed to parse CSS"); - // Find the css URL in the HTML + // Find the Font URL in the CSS let font_url = css_body .lines() .find(|line| line.contains("CircularXXWeb-Regular")) @@ -206,14 +208,14 @@ fn should_set_cache_control_for_fonts() -> Result<(), CallError> { Ok(()) } -/// Verifies that the cache-control header is set for the spa file. +/// Verifies that the cache-control header is set for the SPA file. #[test] fn should_set_cache_control_for_spa() -> Result<(), CallError> { const CERTIFICATION_VERSION: u16 = 2; let env = env(); let canister_id = install_ii_canister(&env, II_WASM.clone()); - //get index page + // Get index page let index_request = HttpRequest { method: "GET".to_string(), url: "/".to_string(), @@ -223,10 +225,10 @@ fn should_set_cache_control_for_spa() -> Result<(), CallError> { }; let index_response = http_request(&env, canister_id, &index_request)?; - // Convert body to string and find the font URL + // Convert body to string let html = String::from_utf8(index_response.body.into_vec()).expect("Failed to parse HTML"); - // Find the spa URL in the HTML + // Find the SPA URL in the HTML let spa_url = { let spa_suffix = "cacheable.js"; let spa_end = html @@ -239,7 +241,7 @@ fn should_set_cache_control_for_spa() -> Result<(), CallError> { html[prefix_start..spa_end + spa_suffix.len()].to_string() }; - //get spa file + // Get SPA file let request = HttpRequest { method: "GET".to_string(), url: spa_url, @@ -268,6 +270,124 @@ fn should_set_cache_control_for_spa() -> Result<(), CallError> { Ok(()) } +/// Verifies that the cache-control header is set for the icons. +#[test] +fn should_set_cache_control_for_icons() -> Result<(), CallError> { + const CERTIFICATION_VERSION: u16 = 2; + let env = env(); + let canister_id = install_ii_canister(&env, II_WASM.clone()); + + // Icon we are testing for + const ICON_NAME: &str = "icpswap_logo"; + const ICON_SUFFIX: &str = ".webp"; + + // Get index page + let index_request = HttpRequest { + method: "GET".to_string(), + url: "/".to_string(), + headers: vec![], + body: ByteBuf::new(), + certificate_version: Some(CERTIFICATION_VERSION), + }; + let index_response = http_request(&env, canister_id, &index_request)?; + + // Convert body to string + let index_html = + String::from_utf8(index_response.body.into_vec()).expect("Failed to parse HTML"); + + // Find the SPA URL in the HTML + let spa_url = { + let spa_suffix = "cacheable.js"; + let spa_end = index_html + .find(spa_suffix) + .expect("Could not find cacheable.js in HTML"); + let prefix_start = index_html[..spa_end] + .rfind('/') + .expect("Could not find starting / for spa URL"); + + index_html[prefix_start..spa_end + spa_suffix.len()].to_string() + }; + + // Get SPA file + let spa_request = HttpRequest { + method: "GET".to_string(), + url: spa_url, + headers: vec![], + body: ByteBuf::new(), + certificate_version: Some(CERTIFICATION_VERSION), + }; + + let spa_response = http_request(&env, canister_id, &spa_request)?; + + assert_eq!(spa_response.status_code, 200); + assert!(spa_response.headers.contains(&( + "Cache-Control".to_string(), + "public, max-age=31536000".to_string() + ))); + + let spa_result = verify_response_certification( + &env, + canister_id, + spa_request, + spa_response.clone(), + CERTIFICATION_VERSION, + ); + assert_eq!(spa_result.verification_version, CERTIFICATION_VERSION); + + let spa_bytes = spa_response.body.into_vec(); + + // Decompress the SPA bytes + let mut decoder = GzDecoder::new(&spa_bytes[..]); + let mut spa_body = String::new(); + decoder.read_to_string(&mut spa_body).unwrap(); + + // Find the icon URL in the HTML + let icon_url = spa_body + .lines() + .find(|line| line.contains(ICON_NAME)) + .and_then(|line| { + if let Some(url_start) = line.find(&format!("\"/{ICON_NAME}")) { + if let Some(url_end) = line[url_start..].find(&format!("{ICON_SUFFIX}\"")) { + let url = line[url_start..url_start + url_end + 5] + .trim_matches(|c| c == '"' || c == '/'); + Some(format!("/{}", url)) + } else { + None + } + } else { + None + } + }) + .expect("Could not find icon URL in HTML"); + + let icon_request = HttpRequest { + method: "GET".to_string(), + url: icon_url, + headers: vec![], + body: ByteBuf::new(), + certificate_version: Some(CERTIFICATION_VERSION), + }; + + let icon_response = http_request(&env, canister_id, &icon_request)?; + + assert_eq!(icon_response.status_code, 200); + assert!(icon_response.headers.contains(&( + "Cache-Control".to_string(), + "public, max-age=31536000".to_string() + ))); + + let icon_result = verify_response_certification( + &env, + canister_id, + icon_request, + icon_response, + CERTIFICATION_VERSION, + ); + assert_eq!(icon_result.verification_version, CERTIFICATION_VERSION); + + Ok(()) +} + /// Verifies that expected metrics are available via the HTTP endpoint. #[test] fn ii_canister_serves_http_metrics() -> Result<(), CallError> { @@ -287,9 +407,9 @@ fn ii_canister_serves_http_metrics() -> Result<(), CallError> { "internet_identity_prepare_id_alias_counter", ]; let env = env(); - env.advance_time(Duration::from_secs(300)); // advance time to see it reflected on the metrics endpoint + env.advance_time(Duration::from_secs(300)); // Advance time to see it reflected on the metrics endpoint - // spawn an archive so that we also get the archive related metrics + // Spawn an archive so that we also get the archive related metrics let canister_id = install_ii_canister_with_arg( &env, II_WASM.clone(),