Skip to content

Commit

Permalink
Merge branch 'develop' into dev-tools/reenable-coverage-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex6323 committed Oct 30, 2024
2 parents 716dd4c + f31e0f5 commit 17e34de
Show file tree
Hide file tree
Showing 31 changed files with 494 additions and 457 deletions.
40 changes: 36 additions & 4 deletions .github/workflows/release_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,19 @@ jobs:
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5
with:
images: docker-registry.iota.org/iota-node
# mapping semver tags to networks
# v{MAJOR}.{MINOR}.{PATCH}-alpha -> alphanet
# v{MAJOR}.{MINOR}.{PATCH}-beta -> devnet
# v{MAJOR}.{MINOR}.{PATCH}-rc -> testnet
# v{MAJOR}.{MINOR}.{PATCH} -> mainnet
tags: |
type=raw,value={{sha}},enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value={{tag}},enable=${{ github.event_name == 'release' }}
type=match,pattern=(.*)-v\d+\.\d+\.\d+,group=1,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-alpha.*\d*,group=0,value=alphanet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-beta.*\d*,group=0,value=devnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-rc.*\d*,group=0,value=testnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+$,group=0,value=mainnet,enable=${{ github.event_name == 'release' }}
- name: Login to Docker Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3
Expand Down Expand Up @@ -97,11 +105,19 @@ jobs:
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5
with:
images: docker-registry.iota.org/iota-indexer
# mapping semver tags to networks
# v{MAJOR}.{MINOR}.{PATCH}-alpha -> alphanet
# v{MAJOR}.{MINOR}.{PATCH}-beta -> devnet
# v{MAJOR}.{MINOR}.{PATCH}-rc -> testnet
# v{MAJOR}.{MINOR}.{PATCH} -> mainnet
tags: |
type=raw,value={{sha}},enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value={{tag}},enable=${{ github.event_name == 'release' }}
type=match,pattern=(.*)-v\d+\.\d+\.\d+,group=1,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-alpha.*\d*,group=0,value=alphanet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-beta.*\d*,group=0,value=devnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-rc.*\d*,group=0,value=testnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+$,group=0,value=mainnet,enable=${{ github.event_name == 'release' }}
- name: Login to Docker Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3
Expand Down Expand Up @@ -148,11 +164,19 @@ jobs:
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5
with:
images: docker-registry.iota.org/iota-tools
# mapping semver tags to networks
# v{MAJOR}.{MINOR}.{PATCH}-alpha -> alphanet
# v{MAJOR}.{MINOR}.{PATCH}-beta -> devnet
# v{MAJOR}.{MINOR}.{PATCH}-rc -> testnet
# v{MAJOR}.{MINOR}.{PATCH} -> mainnet
tags: |
type=raw,value={{sha}},enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value={{tag}},enable=${{ github.event_name == 'release' }}
type=match,pattern=(.*)-v\d+\.\d+\.\d+,group=1,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-alpha.*\d*,group=0,value=alphanet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-beta.*\d*,group=0,value=devnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-rc.*\d*,group=0,value=testnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+$,group=0,value=mainnet,enable=${{ github.event_name == 'release' }}
- name: Login to Docker Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3
Expand Down Expand Up @@ -199,11 +223,19 @@ jobs:
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5
with:
images: docker-registry.iota.org/iota-graphql-rpc
# mapping semver tags to networks
# v{MAJOR}.{MINOR}.{PATCH}-alpha -> alphanet
# v{MAJOR}.{MINOR}.{PATCH}-beta -> devnet
# v{MAJOR}.{MINOR}.{PATCH}-rc -> testnet
# v{MAJOR}.{MINOR}.{PATCH} -> mainnet
tags: |
type=raw,value={{sha}},enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value={{tag}},enable=${{ github.event_name == 'release' }}
type=match,pattern=(.*)-v\d+\.\d+\.\d+,group=1,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-alpha.*\d*,group=0,value=alphanet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-beta.*\d*,group=0,value=devnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-rc.*\d*,group=0,value=testnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+$,group=0,value=mainnet,enable=${{ github.event_name == 'release' }}
- name: Login to Docker Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3
Expand Down
6 changes: 6 additions & 0 deletions apps/apps-backend/src/features/features.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ export class FeaturesController {
[Feature.AccountFinder]: {
defaultValue: false,
},
[Feature.WalletDashboardMigration]: {
defaultValue: false,
},
[Feature.WalletDashboardSupplyIncreaseVesting]: {
defaultValue: false,
},
},
dateUpdated: new Date().toISOString(),
};
Expand Down
2 changes: 2 additions & 0 deletions apps/core/src/constants/features.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ export enum Feature {
NetworkOutageOverride = 'network-outage-override',
ModuleSourceVerification = 'module-source-verification',
WalletEffectsOnlySharedTransaction = 'wallet-effects-only-shared-transaction',
StardustMigration = 'migration',
SupplyIncreaseVesting = 'supply-increase-vesting',
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@
import { PROTECTED_ROUTES } from '@/lib/constants/routes.constants';
import { IotaLogoMark } from '@iota/ui-icons';
import { SidebarItem } from './SidebarItem';
import { Feature } from '@iota/core';
import { useFeature } from '@growthbook/growthbook-react';

export function Sidebar() {
const featureFlags = {
Migrations: useFeature<boolean>(Feature.StardustMigration).value,
Vesting: useFeature<boolean>(Feature.SupplyIncreaseVesting).value,
};

const filteredRoutes = PROTECTED_ROUTES.filter(({ title }) => {
return title in featureFlags ? featureFlags[title as keyof typeof featureFlags] : true;
});

return (
<nav className="flex h-screen flex-col items-center gap-y-2xl bg-neutral-100 py-xl dark:bg-neutral-6">
<IotaLogoMark className="h-10 w-10 text-neutral-10 dark:text-neutral-92" />
<div className="flex flex-col gap-y-xs">
{PROTECTED_ROUTES.map((route) => (
{filteredRoutes.map((route) => (
<SidebarItem key={route.path} {...route} />
))}
</div>
Expand Down
15 changes: 15 additions & 0 deletions apps/wallet-dashboard/app/(protected)/migrations/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
'use client';

import { useFeature } from '@growthbook/growthbook-react';
import { Feature } from '@iota/core';
import { useRouter } from 'next/navigation';
import { useEffect } from 'react';

function MigrationDashboardPage(): JSX.Element {
const router = useRouter();
const stardustMigrationEnabled = useFeature<boolean>(Feature.StardustMigration).value;

useEffect(() => {
if (!stardustMigrationEnabled) {
router.push('/');
}
}, [stardustMigrationEnabled, router]);

return (
<div className="flex items-center justify-center pt-12">
<h1>MIGRATIONS</h1>
Expand Down
13 changes: 13 additions & 0 deletions apps/wallet-dashboard/app/(protected)/vesting/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import {
TimelockedStakedObjectsGrouped,
} from '@/lib/utils';
import { NotificationType } from '@/stores/notificationStore';
import { useFeature } from '@growthbook/growthbook-react';
import {
Feature,
TIMELOCK_IOTA_TYPE,
useGetActiveValidatorsInfo,
useGetAllOwnedObjects,
Expand All @@ -24,11 +26,14 @@ import {
import { useCurrentAccount, useIotaClient, useSignAndExecuteTransaction } from '@iota/dapp-kit';
import { IotaValidatorSummary } from '@iota/iota-sdk/client';
import { useQueryClient } from '@tanstack/react-query';
import { useRouter } from 'next/navigation';
import { useEffect } from 'react';

function VestingDashboardPage(): JSX.Element {
const account = useCurrentAccount();
const queryClient = useQueryClient();
const iotaClient = useIotaClient();
const router = useRouter();
const { addNotification } = useNotifications();
const { openPopup, closePopup } = usePopups();
const { data: currentEpochMs } = useGetCurrentEpochStartTimestamp();
Expand All @@ -39,6 +44,8 @@ function VestingDashboardPage(): JSX.Element {
const { data: timelockedStakedObjects } = useGetTimelockedStakedObjects(account?.address || '');
const { mutateAsync: signAndExecuteTransaction } = useSignAndExecuteTransaction();

const supplyIncreaseVestingEnabled = useFeature<boolean>(Feature.SupplyIncreaseVesting).value;

const timelockedMapped = mapTimelockObjects(timelockedObjects || []);
const timelockedstakedMapped = formatDelegatedTimelockedStake(timelockedStakedObjects || []);

Expand Down Expand Up @@ -134,6 +141,12 @@ function VestingDashboardPage(): JSX.Element {
);
}

useEffect(() => {
if (!supplyIncreaseVestingEnabled) {
router.push('/');
}
}, [router, supplyIncreaseVestingEnabled]);

return (
<div className="flex flex-row">
<div className="flex w-1/2 flex-col items-center justify-center space-y-4 pt-12">
Expand Down
50 changes: 26 additions & 24 deletions apps/wallet-dashboard/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
import { Inter } from 'next/font/google';

import './globals.css';

import { GrowthBookProvider } from '@growthbook/growthbook-react';
import { IotaClientProvider, lightTheme, darkTheme, WalletProvider } from '@iota/dapp-kit';
import { getAllNetworks, getDefaultNetwork } from '@iota/iota-sdk/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import React from 'react';

import '@iota/dapp-kit/dist/index.css';
import { Popup, PopupProvider } from '@/components/Popup';
import { growthbook } from '@/lib/utils';
import { Toaster } from 'react-hot-toast';

const inter = Inter({ subsets: ['latin'] });
growthbook.init();

export default function RootLayout({
children,
Expand All @@ -31,28 +32,29 @@ export default function RootLayout({
return (
<html lang="en">
<body className={inter.className} ref={bodyRef}>
<QueryClientProvider client={queryClient}>
<IotaClientProvider networks={allNetworks} defaultNetwork={defaultNetwork}>
<WalletProvider
autoConnect={true}
theme={[
{
variables: lightTheme,
},
{
selector: '.dark',
variables: darkTheme,
},
]}
>
<PopupProvider>
{children}
<Toaster />
<Popup />
</PopupProvider>
</WalletProvider>
</IotaClientProvider>
</QueryClientProvider>
<GrowthBookProvider growthbook={growthbook}>
<QueryClientProvider client={queryClient}>
<IotaClientProvider networks={allNetworks} defaultNetwork={defaultNetwork}>
<WalletProvider
theme={[
{
variables: lightTheme,
},
{
selector: '.dark',
variables: darkTheme,
},
]}
>
<PopupProvider>
{children}
<Toaster />
<Popup />
</PopupProvider>
</WalletProvider>
</IotaClientProvider>
</QueryClientProvider>
</GrowthBookProvider>
</body>
</html>
);
Expand Down
35 changes: 0 additions & 35 deletions apps/wallet-dashboard/components/Coins/CoinItem.tsx

This file was deleted.

74 changes: 0 additions & 74 deletions apps/wallet-dashboard/components/Coins/MyCoins.tsx

This file was deleted.

Loading

0 comments on commit 17e34de

Please sign in to comment.