Skip to content

Commit

Permalink
Merge branch 'develop' into tooling-dashboard/add-receive-popup
Browse files Browse the repository at this point in the history
  • Loading branch information
VmMad committed Nov 5, 2024
2 parents 0511aa1 + 0de2f4c commit 59dd905
Show file tree
Hide file tree
Showing 187 changed files with 3,830 additions and 3,700 deletions.
12 changes: 12 additions & 0 deletions .changeset/seven-falcons-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@iota/bcs': minor
'@iota/create-dapp': minor
'@iota/dapp-kit': minor
'@iota/graphql-transport': minor
'@iota/kiosk': minor
'@iota/ledgerjs-hw-app-iota': minor
'@iota/iota-sdk': minor
'@iota/wallet-standard': minor
---

Changes for compatibility with the node, simplification of exposed APIs and general improvements.
22 changes: 9 additions & 13 deletions .github/workflows/_cargo_deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,20 @@ on:
type: string
required: false
default: "./Cargo.toml"
secrets:
SSH_PRIVATE_KEY_IOTA_CI:
required: true
SSH_GITHUB_KNOWN_HOSTS:
required: true

concurrency:
group: cargo-deny-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
cargo-deny:
bans-licenses-sources:
name: cargo deny (bans, licenses, sources)
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- uses: EmbarkStudios/cargo-deny-action@8371184bd11e21dcf8ac82ebf8c9c9f74ebf7268 # pin@v2
with:
manifest-path: ${{ inputs.manifest-path }}
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_IOTA_CI }}
ssh-known-hosts: ${{ secrets.SSH_GITHUB_KNOWN_HOSTS }}
use-git-cli: true
- run: cargo deny --manifest-path ${{ inputs.manifest-path || './Cargo.toml' }} check bans licenses sources

advisories:
name: cargo deny (advisories)
runs-on: [self-hosted]
steps:
- run: cargo deny --manifest-path ${{ inputs.manifest-path || './Cargo.toml' }} check advisories
1 change: 0 additions & 1 deletion .github/workflows/_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:

deny:
uses: ./.github/workflows/_cargo_deny.yml
secrets: inherit

rust-tests:
if: |
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/_vercel_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ jobs:
secrets: inherit
with:
isProd: false
isStaging: false

explorer-prod:
name: Vercel Explorer Production
explorer-staging:
name: Vercel Explorer Staging
if: inputs.isDevelop
uses: ./.github/workflows/apps_explorer_deploy.yml
secrets: inherit
with:
isProd: true
isProd: false
isStaging: true

ui-kit-preview:
name: Vercel UI Kit Preview
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/apps_explorer_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,25 @@ name: Deploy for Explorer
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.EXPLORER_VERCEL_PROJECT_ID }}
EXPLORER_VERCEL_PROJECT_STAGING_URL: ${{ secrets.EXPLORER_VERCEL_PROJECT_STAGING_URL }}

on:
workflow_dispatch:
inputs:
isProd:
type: boolean
required: true
isStaging:
type: boolean
required: true
workflow_call:
inputs:
isProd:
type: boolean
required: true
isStaging:
type: boolean
required: true

jobs:
deploy:
Expand Down Expand Up @@ -64,8 +75,11 @@ jobs:
id: deploy_url
if: ${{ inputs.isProd == false }}
run: echo "DEPLOY_URL=$(cat vercel_output.txt | awk 'END{print}')" >> $GITHUB_OUTPUT
- name: Alias Staging deploy
if: ${{ inputs.isStaging }}
run: vercel alias ${{ steps.deploy_url.outputs.DEPLOY_URL }} $EXPLORER_VERCEL_PROJECT_STAGING_URL --token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_SCOPE }}
- name: Comment on pull request
if: ${{ inputs.isProd == false }}
if: ${{ inputs.isProd == false && inputs.isStaging == false }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # pin@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
30 changes: 6 additions & 24 deletions .github/workflows/links_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- cron: "0 0 * * *"

jobs:
link_checker:
links-checker:
name: Check links and create automated issue if needed
runs-on: self-hosted
env:
Expand All @@ -20,8 +20,9 @@ jobs:

- name: Check all links at *.md and doc files
id: lychee
uses: lycheeverse/lychee-action@ec3ed119d4f44ad2673a7232460dc7dff59d2421 # pin@v1.8.0
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # pin@v1.10.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
output: ${{ env.LYCHEE_OUT }}
format: markdown
## Do not fail this step on broken links
Expand All @@ -35,42 +36,23 @@ jobs:
--max-concurrency 10
--no-progress
'./**/*.md'
env:
## Avoid rate limiting when checking github.com links
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Find the last report issue open
uses: micalevisk/last-issue-action@305829d9728f47beb0029417167a0af890edfd6e # [email protected]
id: last_issue
with:
state: open
labels: |
report
automated issue
labels: broken-links
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create issue from report file
if: steps.last_issue.outputs.has_found == 'false'
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # pin@v4
with:
title: Link checker report
content-filepath: ${{ env.LYCHEE_OUT }}
issue-number: ${{ steps.last_issue.outputs.issue_number }}
labels: |
report
automated issue
- name: Update last report open issue created
if: steps.last_issue.outputs.has_found == 'true'
- name: Create or update report
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # pin@v4
with:
title: Link checker report
content-filepath: ${{ env.LYCHEE_OUT }}
issue-number: ${{ steps.last_issue.outputs.issue_number }}
labels: |
report
automated issue
labels: broken-links

- name: Close last report open issue
if: steps.lychee.outputs.exit_code == 0
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
uses: ./.github/workflows/_cargo_deny.yml
with:
manifest-path: external-crates/move/Cargo.toml
secrets: inherit

release:
name: build release binaries
Expand Down
1 change: 1 addition & 0 deletions apps/explorer/src/components/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function Footer(): JSX.Element {
<div className="mt-4 flex justify-center pt-5 text-neutral-10 md:hidden md:self-start">
<IotaLogoWeb width={137} height={36} />
</div>
<p className="mt-8 w-full text-center text-body-sm text-neutral-40">{EXPLORER_REV}</p>
</footer>
);
}
Expand Down
2 changes: 2 additions & 0 deletions apps/explorer/src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@

/// <reference types="vite/client" />
/// <reference types="vite-plugin-svgr/client" />

declare const EXPLORER_REV: string;
1 change: 0 additions & 1 deletion apps/explorer/tests/utils/localnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export async function split_coin(address: string) {
showEffects: true,
showEvents: true,
},
requestType: 'WaitForLocalExecution',
});

return result;
Expand Down
5 changes: 5 additions & 0 deletions apps/explorer/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

/// <reference types="vitest" />
import react from '@vitejs/plugin-react';
import { execSync } from 'child_process';
import { defineConfig } from 'vite';
import svgr from 'vite-plugin-svgr';
import { configDefaults } from 'vitest/config';

process.env.VITE_VERCEL_ENV = process.env.VERCEL_ENV || 'development';
const EXPLORER_REV = execSync('git rev-parse HEAD').toString().trim().toString();

// https://vitejs.dev/config/
export default defineConfig({
Expand All @@ -30,4 +32,7 @@ export default defineConfig({
'~': new URL('./src', import.meta.url).pathname,
},
},
define: {
EXPLORER_REV: JSON.stringify(EXPLORER_REV),
},
});
12 changes: 6 additions & 6 deletions apps/ui-kit/src/lib/components/atoms/panel/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ interface PanelProps {
* Show or hide border around the panel.
*/
hasBorder?: boolean;
/**
* Background color of the panel.
*/
bgColor?: string;
}

export function Panel({
children,
hasBorder,
bgColor = 'bg-neutral-100 dark:bg-neutral-10',
}: React.PropsWithChildren<PanelProps>): React.JSX.Element {
const borderClass = hasBorder
? 'border border-shader-neutral-light-8 dark:border-shader-neutral-dark-8'
: 'border border-transparent';
return (
<div
className={cx(
'flex w-full flex-col rounded-xl bg-neutral-100 dark:bg-neutral-10',
borderClass,
)}
>
<div className={cx('flex w-full flex-col rounded-xl', bgColor, borderClass)}>
{children}
</div>
);
Expand Down
33 changes: 24 additions & 9 deletions apps/wallet-dashboard/app/(protected)/home/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,44 @@
// SPDX-License-Identifier: Apache-2.0
'use client';

import { AccountBalance, MyCoins } from '@/components';
import { AccountBalance, MyCoins, StakingOverview } from '@/components';
import { useFeature } from '@growthbook/growthbook-react';
import { Feature } from '@iota/core';
import { useCurrentAccount, useCurrentWallet } from '@iota/dapp-kit';
import clsx from 'clsx';

function HomeDashboardPage(): JSX.Element {
const { connectionStatus } = useCurrentWallet();
const account = useCurrentAccount();

const stardustMigrationEnabled = useFeature<boolean>(Feature.StardustMigration).value;
// Add the logic here to check if the user has migration objects.
const needsMigration = false && stardustMigrationEnabled;

return (
<main className="flex flex-1 flex-col items-center space-y-8 py-md">
{connectionStatus === 'connected' && account && (
<>
<div className="home-page-grid-container h-full w-full">
<div
className={clsx(
'home-page-grid-container h-full w-full',
needsMigration && 'with-migration',
)}
>
<div style={{ gridArea: 'balance' }} className="flex grow overflow-hidden">
<AccountBalance />
</div>
<div style={{ gridArea: 'staking' }} className="flex grow overflow-hidden">
Staking
</div>
<div
style={{ gridArea: 'migration' }}
className="flex grow overflow-hidden"
>
Migration
<StakingOverview />
</div>
{needsMigration && (
<div
style={{ gridArea: 'migration' }}
className="flex grow overflow-hidden"
>
Migration
</div>
)}
<div style={{ gridArea: 'coins' }}>
<MyCoins />
</div>
Expand Down
20 changes: 7 additions & 13 deletions apps/wallet-dashboard/app/(protected)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,18 @@
'use client';

import { Notifications } from '@/components/index';
import React, { useEffect, useState, type PropsWithChildren } from 'react';
import React, { useEffect, type PropsWithChildren } from 'react';
import { useCurrentAccount, useCurrentWallet } from '@iota/dapp-kit';
import { Button } from '@iota/apps-ui-kit';
import { redirect } from 'next/navigation';
import { Sidebar } from './components';
import { TopNav } from './components/top-nav/TopNav';
import { useTheme } from '@/contexts';

function DashboardLayout({ children }: PropsWithChildren): JSX.Element {
const [isDarkMode, setIsDarkMode] = useState(false);
const { connectionStatus } = useCurrentWallet();
const { theme, toggleTheme } = useTheme();
const account = useCurrentAccount();

const toggleDarkMode = () => {
setIsDarkMode(!isDarkMode);
if (isDarkMode) {
document.documentElement.classList.remove('dark');
} else {
document.documentElement.classList.add('dark');
}
};

useEffect(() => {
if (connectionStatus !== 'connected' && !account) {
redirect('/');
Expand All @@ -44,7 +35,10 @@ function DashboardLayout({ children }: PropsWithChildren): JSX.Element {
</div>

<div className="fixed bottom-5 right-5">
<Button onClick={toggleDarkMode} text={isDarkMode ? 'Light Mode' : 'Dark Mode'} />
<Button
onClick={toggleTheme}
text={`${theme === 'dark' ? 'Light' : 'Dark'} mode`}
/>
</div>

<Notifications />
Expand Down
Loading

0 comments on commit 59dd905

Please sign in to comment.